chengjunhui 11 місяців тому
батько
коміт
ab3e823147
6 змінених файлів з 37 додано та 20 видалено
  1. 1 1
      common/request/index-shop.js
  2. 1 1
      common/request/index.js
  3. 3 3
      common/wx/jswx.js
  4. 1 1
      common/wx/util.js
  5. 2 2
      manifest.json
  6. 29 12
      pages/goods.vue

+ 1 - 1
common/request/index-shop.js

@@ -22,7 +22,7 @@ shopHttp.setConfig(config => {
 	config.header = {
 		...config.header,
 		...systemInfoHeaders,
-    'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
+    // 'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
 	};
 	return config;
 });

+ 1 - 1
common/request/index.js

@@ -22,7 +22,7 @@ http.setConfig(config => {
 	config.header = {
 		...config.header,
 		...systemInfoHeaders,
-    'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
+    // 'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
 	};
 	return config;
 });

+ 3 - 3
common/wx/jswx.js

@@ -16,9 +16,9 @@ const requestFun = ({
       url: baseWxUrl + url, //仅为示例,并非真实接口地址。
       data: data,
       method: method,
-      header: {
-        'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
-      },
+      // header: {
+      //   'Content-Security-Policy': "frame-src 'self' https://*.qq.com webcompt:;"
+      // },
       success: (res) => {
         resolve(res.data)
       },

+ 1 - 1
common/wx/util.js

@@ -1,5 +1,5 @@
 export const isWeiXin = () => {
-  const = ua = navigator.userAgent.toLowerCase();
+  const ua = navigator.userAgent.toLowerCase();
   if (ua.match(/MicroMessenger/i) == "micromessenger") {
     //在微信中打开
     console.log('微信');

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "宜格分享",
     "appid" : "__UNI__90011BF",
     "description" : "应用描述",
-    "versionName" : "1.1.3",
-    "versionCode" : 113,
+    "versionName" : "1.1.7",
+    "versionCode" : 117,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 29 - 12
pages/goods.vue

@@ -141,27 +141,37 @@
       </view>
     </view>
 
-    <view class="jump-box" @click="openApp">
+    <view v-if="!isWeiXin" class="jump-box" @click="openApp">
       <image class="logo-img" src="/static/logo.png" mode="aspectFill"></image>
       <view class="tip">打开宜格服务APP</view>
     </view>
 
-    <view class="wx-open">
+    <view class="wx-open" v-else>
       <wx-open-launch-app id="launch-btn" appid="wx2cbf40f5fffa9e80" :extinfo="queryPath" @launch="launchApp"
         @error="errorApp">
         <script type="text/wxtag-template">
           <style>
             .btn { 
+							border: none;
               width: 150px;
-              height: 50px;
-              border: none;
-              font-size: 14px;
-              border-radius: 4px;
-              background-color: #fff; 
+              height: 40px;
+              color: #fff;
+              background-color: #6be5f8;
+              border-radius: 20px;
+							display: flex;
+							align-items: center;
             }
+						.logo-img {
+						  width: 20px;
+						  height: 20px;
+						  margin-right: 5px;
+						  box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
+						}
           </style>
-          <button class="btn">打开宜格服务APP</button>
-          <image src="/static/wxbtn.png" mode=""></image>
+          <button class="btn">
+						<!-- <image class="logo-img" src="../static/logo.png" mode="aspectFill"></image> -->
+						<text>打开宜格服务APP</text>
+					</button>
         </script>
       </wx-open-launch-app>
     </view>
@@ -172,6 +182,7 @@
 
 <script>
   import comment from "@/components/ld-comment/ld-comment.vue";
+	import { isWeiXin } from "@/common/wx/util.js"
   export default {
     components: {
       comment
@@ -202,7 +213,8 @@
         goodsInfo: {},
         timer: null,
         showHint: false,
-        queryPath: null
+        queryPath: null,
+				isWeiXin: isWeiXin()
       };
     },
     props: {
@@ -217,6 +229,7 @@
       },
     },
     created() {
+			// console.log(isWeiXin(),"=============")
       this.type = this.options.type;
       this.queryPath = `jumpType=goods&goodsType=${this.options.type}&goodsId=${this.options.id}`
       alert('res=>' + uni.getStorageSync('wx_access_token'))
@@ -251,7 +264,11 @@
         console.log(e, 1111)
       },
       errorApp(e) {
+				// alert(e + 1111111111111)
         console.log(e, 1111)
+				uni.navigateTo({
+					url: "/pages/down"
+				})
       },
       openApp() {
         const ua = navigator.userAgent.toLowerCase()
@@ -1002,10 +1019,10 @@
 
   .wx-open {
     position: fixed;
-    bottom: 400rpx;
+    bottom: 200rpx;
     left: 50%;
     width: 300rpx;
-    height: 100rpx;
+    height: 80rpx;
     color: red;
     transform: translateX(-50%);
     z-index: 9;