Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
dc0d7d30ce
5 changed files with 67 additions and 5 deletions
  1. 16
      pages/home/qrcode/index.js
  2. 5
      pages/home/qrcode/index.json
  3. 15
      pages/home/qrcode/index.wxml
  4. 33
      pages/home/qrcode/index.wxss
  5. 3
      pages/login/index.js

16
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) {}
}
}
})

5
pages/home/qrcode/index.json

@ -1,3 +1,6 @@
{
"usingComponents": {}
"usingComponents": {
"van-button": "/components/button/index",
"van-divider": "/components/divider/index"
}
}

15
pages/home/qrcode/index.wxml

@ -2,3 +2,18 @@
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">二维码名片</view>
</cu-custom>
<view class="flex flex-center" style="padding: 32rpx">
<view class="semi-circle" style="padding: 32rpx">
<view class="text-black text-bold" style="text-align: center;margin-bottom:32rpx">
<text style="font-size:40rpx">{{userInfo.factoryName || '未注册工厂'}}</text>
</view>
<view style="width:622rpx;height:622rpx;background:#CCCCCC;"></view>
<view style="width:622rpx;height:6rpx;"></view>
<van-divider dashed />
<view class="text-gray" style="text-align: center;margin-top:32rpx">
<text>使用微信扫码可以注册成为工厂客户</text>
<van-button round type="info" custom-style="width:450rpx;margin-top:24rpx" open-type="share">微信分享</van-button>
</view>
</view>
</view>

33
pages/home/qrcode/index.wxss

@ -1 +1,32 @@
/* pages/home/qrcode/index.wxss */
/* 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%);
}

3
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()
},

Loading…
Cancel
Save