chengziding 1 년 전
부모
커밋
e94e007c1d
4개의 변경된 파일31개의 추가작업 그리고 24개의 파일을 삭제
  1. 3 0
      main.js
  2. 5 0
      package-lock.json
  3. 2 1
      package.json
  4. 21 23
      pages/down.vue

+ 3 - 0
main.js

@@ -29,7 +29,10 @@ import Directives from './directives/index.js';
 
 if (process.env.NODE_ENV === 'production') {
 	Vue.config.productionTip = false;
+	Vue.config.ignoredElements.push('wx-open-launch-weapp')
 }
+
+
 // 挂载全局自定义方法
 Vue.prototype.$store = store
 Vue.prototype.$adpid = ""

+ 5 - 0
package-lock.json

@@ -1324,6 +1324,11 @@
             "resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz",
             "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
         },
+        "weixin-js-sdk": {
+            "version": "1.6.0",
+            "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz",
+            "integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ=="
+        },
         "which-module": {
             "version": "2.0.0",
             "resolved": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz",

+ 2 - 1
package.json

@@ -14,6 +14,7 @@
     },
     "dependencies": {
         "clipboard": "^2.0.6",
-        "lite-server": "^2.6.1"
+        "lite-server": "^2.6.1",
+        "weixin-js-sdk": "^1.6.0"
     }
 }

+ 21 - 23
pages/down.vue

@@ -21,11 +21,10 @@
 				<image src="/static/login/btn_02.png" mode="aspectFit" class="logo"></image>
 				<text>IOS下载</text>
 			</button>
-			<view class="" style="width: 100%; height: 30rpx;">
+			<!-- <view class="" style="width: 100%; height: 30rpx;">
 
-			</view>
-			<!-- <wx-open-launch-weapp username="gh_9b86ebba08b0" path="pages/homeQX/index" >宜格服务小程序</wx-open-launch-weapp> -->
-			<button class="btn" @click.stop="onWeChat()">
+			</view> -->
+			<button class="btn pdr0" @click.stop="onWeChat()">
 				<image src="/static/login/btn_03.png" mode="aspectFit" class="logo"></image>
 				<text>宜格服务小程序</text>
 			</button>
@@ -34,8 +33,6 @@
 		</view>
 	</view>
 </template>
-<!-- <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
-
 <script>
 	export default {
 		data() {
@@ -53,14 +50,14 @@
 			};
 		},
 		onLoad(options) {
-			const ua = navigator.userAgent.toLowerCase()
-			const isWeixin = ua.indexOf('micromessenger') != -1;
-			this.showHint = isWeixin
-
+			// const ua = navigator.userAgent.toLowerCase()
+			// const isWeixin = ua.indexOf('micromessenger') != -1;
+			// this.showHint = isWeixin
 		},
 
 		methods: {
 			getData(type) {
+				
 				this.$http.get("/app/version/newest", {
 					type: type
 				}).then((res) => {
@@ -72,21 +69,19 @@
 				});
 			},
 			downLoad(type) {
-				this.getData(type)
-				// window.location.href = type == 1 ? this.appInfo.android_link : this.appInfo.ios_link;
+				const ua = navigator.userAgent.toLowerCase()
+				const isWeixin = ua.indexOf('micromessenger') != -1;
+				if(isWeixin){
+					this.showHint = isWeixin;
+					uni.pageScrollTo({
+						scrollTop:0
+					})
+				}else{
+					this.getData(type)
+				}
 			},
-
 			onWeChat() {
-				console.log("wx  = " , wx)
-				// wx.config({
-				// 	// debug: true, // 调试时可开启
-				// 	appId: '小程序 AppID', // <!-- replace -->
-				// 	timestamp: 0, // 必填,填任意数字即可
-				// 	nonceStr: 'nonceStr', // 必填,填任意非空字符串即可
-				// 	signature: 'signature', // 必填,填任意非空字符串即可
-				// 	jsApiList: ['chooseImage'], // 必填,随意一个接口即可 
-				// 	openTagList: ['wx-open-launch-weapp'], // 填入打开小程序的开放标签名
-				// })
+				location.href='weixin://dl/business/?appid=wxe67b047223bd1446&path=pages/homeQX/index'
 			},
 
 		},
@@ -205,4 +200,7 @@
 			}
 		}
 	}
+	.pdr0{
+		padding-right: 0 !important;
+	}
 </style>