Commit d39eae0a by 姜雷

Merge branch 'develop' into test

parents 91b28ab3 0b375fde
......@@ -150,7 +150,7 @@ Component({
},
goRecordsPage() {
wx.navigateTo({
url: '/pages/platformFeeRecord/platformFeeRecord',
url: '/pages/platformFee/platformFee',
});
},
toggleType() {
......
......@@ -178,6 +178,52 @@ Page({
// url: '/pages/home/home'
// })
},
codeLogin() {
wx.login({
success: res => {
if (res.code) {
const code = res.code;
systemFetch({
url: '/boss/login',
method: 'POST',
data: {
code,
},
})
.then(res => {
console.log(res);
const {
token,
data: { userInfo, userRoles },
} = res;
app.globalData.token = token;
app.globalData.userInfo = userInfo;
app.globalData.userRoles = userRoles;
try {
wx.setStorageSync('token', token);
} catch (error) {}
wx.hideLoading();
wx.redirectTo({
url: '/pages/homeAndReport/homeAndReport',
});
})
.catch(err => {
console.log(err);
wx.hideLoading();
wx.showToast({
title: err.errMsg,
icon: 'none',
});
});
} else {
wx.showToast({
title: '登录获取code失败',
icon: 'none',
});
}
},
});
},
nameInputHandle(e) {
const value = e.detail.value;
this.updateInputValue('account', value);
......
......@@ -11,5 +11,8 @@
</div>
</view>
<button class="login-btn" bindtap="loginHandle">登录</button>
<view class="wx-login" bind:tap="codeLogin">
<image class="wx-login-icon" src="../../images/ic_wechat@2x.png"></image>
</view>
</view>
</view>
\ No newline at end of file
......@@ -39,3 +39,12 @@
.login-btn {
margin-top: 40rpx;
}
.wx-login {
width: 72rpx;
height: 72rpx;
margin: 80rpx auto 0;
}
.wx-login-icon {
width: 72rpx;
height: 72rpx;
}
{
"name": "demo",
"version": "1.0.1",
"name": "wx-manage-shell",
"version": "1.0.2",
"scripts": {
"compile": "./node_modules/typescript/bin/tsc",
"tsc": "node ./node_modules/typescript/lib/tsc.js"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment