zhaoxiaohai 3 năm trước cách đây
mục cha
commit
286fba88dc

+ 1 - 1
components/My_DisplayItem/index.wxml

@@ -9,7 +9,7 @@
             <image wx:elif="{{content.ftype=='产品策划'}}" src="/static/supplyAndDemand/icon-02.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='平面设计'}}" src="/static/supplyAndDemand/icon-03.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='寻找面料'}}" src="/static/supplyAndDemand/icon-04.png" mode="aspectFit"></image>
-            <image wx:elif="{{content.ftype=='寻找沙发布'}}" src="/static/supplyAndDemand/icon-05.png" mode="aspectFit"></image>
+            <image wx:elif="{{content.ftype=='商业培训'}}" src="/static/supplyAndDemand/icon-05.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='寻找主播'}}" src="/static/supplyAndDemand/icon-06.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='面料设计'}}" src="/static/supplyAndDemand/icon-07.png" mode="aspectFit"></image>
             <image wx:else src="/static/tacitly-approve/MRproduct.png" mode="aspectFit"></image>

+ 34 - 29
pages/login/QrCode.js

@@ -17,35 +17,14 @@ Page({
     /**
      * 生命周期函数--监听页面加载
      query */
-    onLoad: function () {
-        const query = {
-            q: 'https://www.cnd3b.com/qr?type=partner&fbrand=测试品牌名&tagentsid=36112'
-            // q: 'https://www.cnd3b.com/qr?type=shop&fbrand=测试品牌名&tagentsid=36112'
-        };
-        if (query.q) {
-            const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容、
-            const data = {
-                type: q.slice(q.indexOf("type=") + 5, q.indexOf('&')),
-                id: q.slice(q.lastIndexOf('=') + 1),
-                name: q.slice(q.lastIndexOf('fbrand=') + 7, q.lastIndexOf('&'))
-            }
-            if (!wx.getStorageSync('userData').token) {
-                wx.setStorageSync('qrCodeMsg', data);
-                wx.showModal({
-                    title: '提示',
-                    content: '当前未登录,请登录后进入',
-                    showCancel: false,
-                    success: (res => {
-                        if (res.confirm) wx.navigateTo({
-                            url: '/pages/login/index',
-                        })
-                    })
-                });
-            } else {
-                this.setData({
-                    codeMsg: data
-                })
-            }
+    onLoad: function (query) {
+        console.log(query)
+        if (query.url) {
+            const q = decodeURIComponent(query.url);
+            return this.setDataUrl(q)
+        } else if (query.q) { // 获取到二维码原始链接内容、
+            const q = decodeURIComponent(query.q);
+            return this.setDataUrl(q)
         } else {
             this.setData({
                 codeMsg: wx.getStorageSync('qrCodeMsg')
@@ -54,6 +33,32 @@ Page({
             console.log(wx.getStorageSync('qrCodeMsg'))
         }
     },
+    setDataUrl(url) {
+        let q = url;
+        console.log("q", q)
+        const data = {
+            type: q.slice(q.indexOf("type=") + 5, q.indexOf('&')),
+            id: q.slice(q.lastIndexOf('=') + 1),
+            name: q.slice(q.lastIndexOf('fbrand=') + 7, q.lastIndexOf('&'))
+        }
+        if (!wx.getStorageSync('userData').token) {
+            wx.setStorageSync('qrCodeMsg', data);
+            wx.showModal({
+                title: '提示',
+                content: '当前未登录,请登录后进入',
+                showCancel: false,
+                success: (res => {
+                    if (res.confirm) wx.navigateTo({
+                        url: '/pages/login/index',
+                    })
+                })
+            });
+        } else {
+            this.setData({
+                codeMsg: data
+            })
+        }
+    },
     /* 确定 */
     confirm() {
         const that = this;

+ 9 - 2
pages/storeMessage/select.js

@@ -34,10 +34,17 @@ Page({
         } else {
             wx.scanCode({
                 success(res) {
-                    console.log("扫码", res)
+                    if (res.errMsg != 'scanCode:ok') return wx.showToast({
+                        title: '扫码失败',
+                    });
+                    wx.navigateTo({
+                        url: '/pages/login/QrCode?url=' + encodeURIComponent(res.result),
+                    });
                 },
                 fail(err) {
-                    console.log(err)
+                    wx.showToast({
+                        title: '扫码失败',
+                    });
                 }
             })
         }

BIN
static/supplyAndDemand/icon-01.png


BIN
static/supplyAndDemand/icon-02.png


BIN
static/supplyAndDemand/icon-03.png


BIN
static/supplyAndDemand/icon-04.png


BIN
static/supplyAndDemand/icon-05.png


BIN
static/supplyAndDemand/icon-06.png


BIN
static/supplyAndDemand/icon-07.png