bayi 1 år sedan
förälder
incheckning
70a847de6f
7 ändrade filer med 45 tillägg och 19 borttagningar
  1. 3 8
      pages/my/gzh/index.js
  2. 9 1
      pages/my/index.js
  3. 15 4
      pages/my/index.less
  4. 4 2
      pages/my/index.wxml
  5. 11 1
      pages/my/index.wxss
  6. BIN
      static/编组 13.png
  7. 3 3
      utils/request.js

+ 3 - 8
pages/my/gzh/index.js

@@ -1,21 +1,16 @@
-import {
-    getWxQrcode
-} from '~/api/user'
+
 Component({
     data: {
         show: false,
-        qrCode: ''
+        qrCode: 'https://reader-wx.ai160.com/images/reader/v3/ldxkx.jpg'
     },
     methods: {
-        async open() {
-            let res = await getWxQrcode()
-            console.log(res);
+        open() {
             this.getTabBar().setData({
                 mask: true
             })
             this.setData({
                 show: true,
-                qrCode: res.ticketUrl
             })
         },
         closeModal() {

+ 9 - 1
pages/my/index.js

@@ -2,6 +2,7 @@ import {
     getMyInfo,
     buyVip,
     getVipInfo,
+    getWxQrcode,
     getLearnCard
 } from '~/api/user'
 import {
@@ -20,12 +21,13 @@ Page({
         vipTime: '',
         tasks: [],
         isIos: app.globalData.isIOS,
+        qrCode: '',
         activationModal: false,
         activationRes: {},
         products: [],
         isPreferential: false
     },
-    onLoad() {
+    async onLoad() {
         // 手工绑定 
         this.storeBindings = createStoreBindings(this, {
             store,
@@ -33,6 +35,12 @@ Page({
                 setUser: 'setUser'
             }
         })
+        if (this.data.isIos) {
+            let qrCode = await getWxQrcode()
+            this.setData({
+                qrCode: qrCode.ticketUrl
+            })
+        }
     },
     async onShow() {
         if (typeof this.getTabBar === 'function') {

+ 15 - 4
pages/my/index.less

@@ -212,6 +212,7 @@
 
     .scrollViewBox {
         height: 330rpx;
+
         .goodsList {
             position: absolute;
             margin-top: 40rpx;
@@ -284,10 +285,20 @@
         }
     }
 
-    .iosVip {
-        margin-top: 30rpx;
-        height: 230rpx;
-        width: 710rpx;
+    .longpressBox {
+        position: relative;
+        .iosVip {
+            margin-top: 30rpx;
+            height: 230rpx;
+            width: 710rpx;
+        }
+        .qrCode{
+            position: absolute;
+            top: 59rpx;
+            right: 68rpx;
+            width: 174rpx;
+            height: 174rpx;
+        }
     }
 
     .activationModal {

+ 4 - 2
pages/my/index.wxml

@@ -81,8 +81,10 @@
         </scroll-view>
     </view>
     <!-- ios -->
-    <image wx:if="{{vipTime!='1'&&isIos}}" src="https://reader-wx.ai160.com/images/reader/v3/pay1.png" class="iosVip"
-        show-menu-by-longpress="{{true}}" />
+    <view class="longpressBox" wx:if="{{isIos}}">
+        <image src="https://reader-wx.ai160.com/images/reader/v3/pay1.png" class="iosVip" />
+        <image src="{{qrCode}}" class="qrCode" show-menu-by-longpress="{{true}}" />
+    </view>
     <view class="activation" bindtap="activationCode" wx:if="{{vipTime!='1'}}">
         <view class="tips">
             <image src="/static/activation.png" class="tipsImg" />学习卡激活

+ 11 - 1
pages/my/index.wxss

@@ -239,11 +239,21 @@
 .container .scrollViewBox .goodsList .pbbg3 .pay {
   background: linear-gradient(325deg, #FFBD96 0%, #FFF1E7 100%);
 }
-.container .iosVip {
+.container .longpressBox {
+  position: relative;
+}
+.container .longpressBox .iosVip {
   margin-top: 30rpx;
   height: 230rpx;
   width: 710rpx;
 }
+.container .longpressBox .qrCode {
+  position: absolute;
+  top: 59rpx;
+  right: 68rpx;
+  width: 174rpx;
+  height: 174rpx;
+}
 .container .activationModal {
   position: fixed;
   z-index: 2;

BIN
static/编组 13.png


+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
+/* if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else {
+} else { */
     baseUrl = 'https://reader-api.ai160.com/wx'
     oldUrl = 'https://reader-api.ai160.com'
-}
+// }
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {