|
|
@@ -4,6 +4,7 @@
|
|
|
<text class="shopname">{{shopInfo.shopName}}</text>
|
|
|
<text class="button" @click="btnScanQR">扫码兑换</text>
|
|
|
<text class="button" @click="btnExchgRecord">兑换记录</text>
|
|
|
+ <text class="button" @click="btnSignOut">退出登录</text>
|
|
|
<!-- <text class="">{{qrCode}}</text> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -14,6 +15,7 @@
|
|
|
import {
|
|
|
apiVerfExchange,
|
|
|
apiGetWxJsSdkConfig,
|
|
|
+ apiVerfSignOut,
|
|
|
checkResCode
|
|
|
} from '../../common/api.js';
|
|
|
|
|
|
@@ -129,11 +131,56 @@
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ verfSignOut() {
|
|
|
+ uni.request({
|
|
|
+ url: apiVerfSignOut,
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded",
|
|
|
+ "token": this.token,
|
|
|
+ },
|
|
|
+ method: "POST",
|
|
|
+ data: {
|
|
|
+ qrCode: this.qrCode
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log("verfSignOut", res);
|
|
|
+ if (checkResCode(res)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "您已退出登录",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log("verfSignOut err", err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
btnExchgRecord() {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/exchgRecord/exchgRecord"
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ btnSignOut() {
|
|
|
+ let that = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: `您确定要退出登录吗?`,
|
|
|
+ confirmText: '确定', //确定文本的文字
|
|
|
+ cancelText: '取消', //确定文本的文字
|
|
|
+ showCancel: true, //没有取消按钮的弹框
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.verfSignOut();
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|