扫码领取优惠券用微信支付,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. 116
      pages/tabBar/user/user.vue
  5. 27
      pages/user/deposit/deposit.vue
  6. 13
      pages/userLogin/userLogin.vue

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

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

@ -141,6 +141,23 @@
</view> </view>
</view> </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="width100" v-for="(item,index) in paytypeList" :key="index">
<view class="width94 line1 mart5 marb5"></view> <view class="width94 line1 mart5 marb5"></view>
<view class="height50 width100 backcorfff" @tap="paytype=item.payTypeId" > <view class="height50 width100 backcorfff" @tap="paytype=item.payTypeId" >
@ -211,7 +228,7 @@
</view> --> </view> -->
</view> </view>
</template>
<view v-if="paytype=='7'" class="backcorfff"> <view v-if="paytype=='7'" class="backcorfff">
<view class="heightl60 paddleft10 fcor333 fontwig6 font16 width100 backcorfff flleft">车队油卡列表</view> <view class="heightl60 paddleft10 fcor333 fontwig6 font16 width100 backcorfff flleft">车队油卡列表</view>
<view class="line1"></view> <view class="line1"></view>
@ -382,6 +399,8 @@
isFinish:false, isFinish:false,
isAgree:false,// isAgree:false,//
Timer:null, Timer:null,
payWeixin:'',//
}; };
}, },
onLoad(option) { onLoad(option) {
@ -389,6 +408,12 @@
if (option.postPayType != undefined && option.postPayType) { if (option.postPayType != undefined && option.postPayType) {
this.postPayType = option.postPayType; this.postPayType = option.postPayType;
} }
if(option.type&&option.type==2){
this.payWeixin = 2;
this.paytype = 2;
}
// #ifdef H5 // #ifdef H5
this.identificationCode = app.globalData.staffCode; this.identificationCode = app.globalData.staffCode;
// #endif // #endif
@ -484,7 +509,7 @@
/* 默认选第一个支付方式 */ /* 默认选第一个支付方式 */
if(this.paytypeList.length>0){ if(this.paytypeList.length>0&&!this.payWeixin){
this.paytype = this.paytypeList[0].payTypeId; this.paytype = this.paytypeList[0].payTypeId;
if(this.paytype == 8){ if(this.paytype == 8){
if(this.isDiscount){ if(this.isDiscount){
@ -493,7 +518,7 @@
this.priceValue = [0,Number(this.availIntegal)]; this.priceValue = [0,Number(this.availIntegal)];
this.isDiscount = true; this.isDiscount = true;
this.blockEnd(); this.blockEnd();
console.log(this.paytype,"11111111",this.priceValue); // console.log(this.paytype,"11111111",this.priceValue);
}) })
} }
} }
@ -1253,7 +1278,7 @@
.deductionPrice).toFixed(2); .deductionPrice).toFixed(2);
} }
if(Number(this.paytheprice)==0){ if(Number(this.paytheprice)==0&&!this.payWeixin){
this.paytype = 8; this.paytype = 8;
} }

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

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

Loading…
Cancel
Save