扫码领取优惠券用微信支付,h5退出登录问题,我的页面登录

ymt-db-dev
游梦婷 1 year ago
parent b43f9a8acb
commit 8fddf4e34f
  1. 2
      pages/goods/externalCoupon/externalCoupon.vue
  2. 9
      pages/login/register.vue
  3. 33
      pages/order/confirmation.vue
  4. 76
      pages/tabBar/user/user.vue
  5. 27
      pages/user/deposit/deposit.vue
  6. 13
      pages/userLogin/userLogin.vue

@ -409,7 +409,7 @@
toGoods(e) {
if (app.globalData.userInfo) {
uni.navigateTo({
url: '../../order/confirmation?id=' + e
url: '../../order/confirmation?type=2&id=' + e
})
} else {
uni.showToast({

@ -51,6 +51,15 @@
},
onLoad() {
},
onUnload(){
// if(!app.globalData.userInfo&&!app.globalData.token){
// uni.switchTab({
// url:'/pages/tabBar/home/home'
// })
// }
},
methods: {
//

@ -141,6 +141,23 @@
</view>
</view>
</view>
<template v-if="payWeixin==2">
<view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff">
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;">
<view class="dis-flex">
<image mode="aspectFit" :src="imageUrl+'payType/weixin.png'" style="width:30px;height:30px;"></image>
<text class="margle">微信</text>
</view>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" >
<radio :checked="paytype==2" color="#0083f5" />
</view>
</view>
</template>
<template v-else>
<view class="width100" v-for="(item,index) in paytypeList" :key="index">
<view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff" @tap="paytype=item.payTypeId" >
@ -211,7 +228,7 @@
</view> -->
</view>
</template>
<view v-if="paytype=='7'" class="backcorfff">
<view class="heightl60 paddleft10 fcor333 fontwig6 font16 width100 backcorfff flleft">车队油卡列表</view>
<view class="line1"></view>
@ -382,6 +399,8 @@
isFinish:false,
isAgree:false,//
Timer:null,
payWeixin:'',//
};
},
onLoad(option) {
@ -389,6 +408,12 @@
if (option.postPayType != undefined && option.postPayType) {
this.postPayType = option.postPayType;
}
if(option.type&&option.type==2){
this.payWeixin = 2;
this.paytype = 2;
}
// #ifdef H5
this.identificationCode = app.globalData.staffCode;
// #endif
@ -484,7 +509,7 @@
/* 默认选第一个支付方式 */
if(this.paytypeList.length>0){
if(this.paytypeList.length>0&&!this.payWeixin){
this.paytype = this.paytypeList[0].payTypeId;
if(this.paytype == 8){
if(this.isDiscount){
@ -493,7 +518,7 @@
this.priceValue = [0,Number(this.availIntegal)];
this.isDiscount = true;
this.blockEnd();
console.log(this.paytype,"11111111",this.priceValue);
// console.log(this.paytype,"11111111",this.priceValue);
})
}
}
@ -1253,7 +1278,7 @@
.deductionPrice).toFixed(2);
}
if(Number(this.paytheprice)==0){
if(Number(this.paytheprice)==0&&!this.payWeixin){
this.paytype = 8;
}

@ -10,6 +10,12 @@
<image :src="user.headerImg" v-else></image>
</view>
<!-- 昵称 -->
<template v-if="!user">
<view class="right" @click="logInMethod">
<view class=" fcorfff fontwig6 font18">未登录</view>
</view>
</template>
<template v-else>
<view class="right">
<!-- #ifdef MP -->
<view class="username" v-if="user && user.infoCompleteStatus == 1" @click="jumplogin">点击获取信息</view>
@ -20,6 +26,7 @@
<!-- #endif -->
<view class="font14 fcor333">{{userphone}}</view>
</view>
</template>
</view>
<!-- 优惠券卡券 -->
<view class="headcoun width100">
@ -249,20 +256,34 @@
uni.stopPullDownRefresh();
}, 1000);
},
onLoad() {
if (!app.globalData.userInfo) {
if(!app.globalData.userInfo&&!app.globalData.token){
/* 没登录 */
// #ifdef MP
uni.navigateTo({
url: '/pages/userLogin/userLogin'
})
// #endif
// #ifdef H5
uni.navigateTo({
url: '/pages/login/register'
})
// #endif
}else{
this.findUser();
// this.queryHzfDiscountTotalNum();
}
},
onReady() {
//,
uni.setStorage({
key: 'UserInfo',
data: false,
success: function() {},
fail: function(e) {}
});
// uni.setStorage({
// key: 'UserInfo',
// data: false,
// success: function() {},
// fail: function(e) {}
// });
},
onShow() {
if (app.globalData.userInfo) {
@ -317,21 +338,26 @@
]
// #endif
// #ifdef H5
let url = "../../login/updatePas/resetPas";
if (!app.globalData.userInfo.isSetPayPwd) {
url = "../../login/updatePas/updatePas";
}
if(app.globalData.userInfo&&app.globalData.token){
this.czList = [{
url: '/pages/goods/recording/recording',
text: '积分记录',
img: '../../../static/img/ghkpay.png'
},
{
url: '../../login/updatePas/updatePas',
url: url,
text: '支付密码',
img: '../../../static/img/user/user11.png'
},
{
url: '',
text: '退出登录',
img: '../../../static/img/user/user12.png'
img: '../../../static/img/exit.png'
},
{
url: '',
@ -344,23 +370,22 @@
img: '../../../static/img/adresw.png'
}
]
return;
}
}else{
this.czList = [{
url: '/pages/goods/recording/recording',
text: '积分记录',
img: '../../../static/img/ghkpay.png'
},
{
url: '../../login/updatePas/resetPas',
url: url,
text: '支付密码',
img: '../../../static/img/user/user11.png'
},
{
url: '',
text: '退出登录',
img: '../../../static/img/exit.png'
},
// {
// url: '',
// text: '退',
// img: '../../../static/img/exit.png'
// },
{
url: '',
text: '客服',
@ -372,9 +397,24 @@
img: '../../../static/img/adresw.png'
}
]
}
// #endif
},
methods: {
//
logInMethod(){
// #ifdef MP
uni.navigateTo({
url: '/pages/userLogin/userLogin'
})
// #endif
// #ifdef H5
uni.navigateTo({
url: '/pages/login/register'
})
// #endif
},
//
findUser() {
findUser().then(res => {

@ -3,7 +3,7 @@
<view class="block">
<view class="content">
<view class="my">
我的账户余额 {{user.gold}} ( 1:100)
我的账户余额 {{user.gold || 0}} ( 1:100)
</view>
</view>
</view>
@ -67,7 +67,8 @@
import {
create,
wechatPay,
getThirdPartyByDetail
getThirdPartyByDetail,
findUser,
} from "../../../Utils/Api.js";
// #ifdef H5
var jweixin = require('jweixin-module');
@ -86,20 +87,38 @@
};
},
onLoad(options) {
console.log(options)
// console.log(options)
if(options.inputAmount){
this.inputAmount=options.inputAmount;
this.isGoBack = true;
}
this.user = app.globalData.userInfo
},
onShow() {
this.getThirdPartyByDetail();
this.findUser();
console.log(this.user,"user")
},
methods: {
//
findUser() {
findUser().then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
uni.setStorage({
key: "user",
data: res.return_data
})
}
});
},
//
getThirdPartyByDetail() {
// #ifdef H5

@ -353,7 +353,18 @@
}
})
},
}
},
onUnload(){
// if(!app.globalData.userInfo&&!app.globalData.token){
// console.log("",uni)
// uni.reLaunch({
// url: '/pages/tabBar/home/home'
// })
// }
},
}
</script>

Loading…
Cancel
Save