diff --git a/pages/home/qrcode/index.js b/pages/home/qrcode/index.js index f6d6b8c..bb27231 100644 --- a/pages/home/qrcode/index.js +++ b/pages/home/qrcode/index.js @@ -8,13 +8,23 @@ Page({ * 页面的初始数据 */ data: { - + userInfo: {} }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + this.setData({ userInfo: app.userInfo}) + }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: '纸通宝工厂版——' + this.data.userInfo.factoryName, + path: 'pages/login/index?qrcode=562333739288498176', + imageUrl: '/assets/image/icon_logo.png', + success: function (res) {} + } } - }) \ No newline at end of file diff --git a/pages/home/qrcode/index.json b/pages/home/qrcode/index.json index 8835af0..edb0418 100644 --- a/pages/home/qrcode/index.json +++ b/pages/home/qrcode/index.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents": { + "van-button": "/components/button/index", + "van-divider": "/components/divider/index" + } } \ No newline at end of file diff --git a/pages/home/qrcode/index.wxml b/pages/home/qrcode/index.wxml index 2385a63..e61210a 100644 --- a/pages/home/qrcode/index.wxml +++ b/pages/home/qrcode/index.wxml @@ -2,3 +2,18 @@ 二维码名片 + + + + + {{userInfo.factoryName || '未注册工厂'}} + + + + + + 使用微信扫码可以注册成为工厂客户 + 微信分享 + + + diff --git a/pages/home/qrcode/index.wxss b/pages/home/qrcode/index.wxss index 65eec81..86b83d3 100644 --- a/pages/home/qrcode/index.wxss +++ b/pages/home/qrcode/index.wxss @@ -1 +1,32 @@ -/* pages/home/qrcode/index.wxss */ \ No newline at end of file +/* pages/home/qrcode/index.wxss */ +.semi-circle { + width: 100%; + height: 1000rpx; + position: relative; + background: #ffffff; + border-radius: 8px; +} + +.semi-circle:after { + position: absolute; + content: ""; + width: 20px; + height: 20px; + background: #f1f1f1; + border-radius: 100%; + right: 0; + top: 770rpx; + transform: translate(50%, -50%); +} + +.semi-circle:before { + position: absolute; + content: ""; + width: 20px; + height: 20px; + background: #f1f1f1; + border-radius: 100%; + left: 0; + top: 770rpx; + transform: translate(-50%, -50%); +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index 617339b..c729c18 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -39,6 +39,9 @@ Page({ //扫二维码进入的, let q = decodeURIComponent(options.q) this.data.code = q.substring(q.indexOf('?')) + } else if(options.qrcode){ + //分享进入 + this.data.code = '?mark=ztb_saas&QrCodeRecordId=' + options.qrcode } this.wxLogin() },