1.增加新的登录页面

yj-dev
杨杰 3 years ago
parent ac940c5561
commit 4e8fd74453
  1. 21
      Utils/Request.js
  2. 9
      pages.json
  3. 12
      pages/goods/goods.vue
  4. 28
      pages/goods/refuel-confirm/refuel-confirm.vue
  5. 32
      pages/goods/refuel-details/refuel-details.vue
  6. 6
      pages/goods/refuel/refuel.vue
  7. 89
      pages/goods/store-list/store-details.vue
  8. 11
      pages/order/confirmation.vue
  9. 11
      pages/pay/payment/payment.vue
  10. 1
      pages/tabBar/category/category.vue
  11. 77
      pages/tabBar/home/home.vue
  12. 10
      pages/tabBar/user/user.vue
  13. 4
      pages/user/bindingCard/bindingCard.vue
  14. 117
      pages/userLogin/userLogin.vue
  15. BIN
      static/img/login.png

@ -13,12 +13,8 @@ function request(method, url, data) {
}, //有的时候这里不一定是 token 还可能是 Authorization }, //有的时候这里不一定是 token 还可能是 Authorization
success(res) { success(res) {
resolve(res) resolve(res)
if(res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code == 104001){ if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code ==
uni.showToast({ 104001) {
title:'登录信息过期,请重新授权',
icon:'none',
duration:2000
})
app.globalData.userInfo = ''; app.globalData.userInfo = '';
app.globalData.token = ''; app.globalData.token = '';
uni.setStorage({ uni.setStorage({
@ -29,8 +25,17 @@ function request(method, url, data) {
key: "token", key: "token",
data: '' data: ''
}) })
uni.reLaunch({ uni.showToast({
url: '/pages/tabBar/home/home' title: '登录信息过期,请重新授权',
icon: 'none',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url:'/pages/userLogin/userLogin'
})
}, 800);
}
}) })
} }
}, },

@ -517,6 +517,15 @@
} }
} }
,{
"path" : "pages/userLogin/userLogin",
"style" :
{
"navigationBarTitleText": "嗨森购",
"enablePullDownRefresh": false
}
}
], ],
"globalStyle": { "globalStyle": {

@ -13,10 +13,10 @@
<!-- #endif --> <!-- #endif -->
<!-- 底部菜单 --> <!-- 底部菜单 -->
<view class="footer"> <view class="footer">
<button v-if="user == '' " class="width100 fotct btnfot" @click="getuserinfo"> <!-- <button v-if="user == '' " class="width100 fotct btnfot" @click="getuserinfo">
立即兑换 立即兑换
</button> </button> -->
<button v-else class="width100 fotct btnfot" @click="buy"> <button class="width100 fotct btnfot" @click="buy">
立即兑换 立即兑换
</button> </button>
</view> </view>
@ -112,7 +112,7 @@
</view> </view>
</view> </view>
</wybPopup> </wybPopup>
<authorize></authorize> <!-- <authorize></authorize> -->
</view> </view>
</template> </template>
@ -122,12 +122,12 @@
GetPhoneNumber, GetPhoneNumber,
getUserInfo getUserInfo
} from "../../Utils/Api.js"; } from "../../Utils/Api.js";
import authorize from '../../components/Authorize.vue' // import authorize from '../../components/Authorize.vue'
import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../components/wyb-popup/wyb-popup.vue';
let app = getApp() let app = getApp()
export default { export default {
components: { components: {
authorize, // authorize,
wybPopup wybPopup
}, },
data() { data() {

@ -52,7 +52,7 @@
微信支付 微信支付
</view> </view>
<view class="flright width30 fotct"> <view class="flright width30 fotct">
<radio :checked="paytype=='weixin'" @click="changeRiado()" color="#0083f5" /> <radio :checked="paytype=='weixin'" color="#0083f5" />
</view> </view>
</view> </view>
@ -109,7 +109,6 @@
orderList: '', orderList: '',
refulAdress: '', refulAdress: '',
tongCardPrice: 0, tongCardPrice: 0,
balanceCardNo: '',
user: '', user: '',
paytype: '', paytype: '',
PaymentPassword: '', PaymentPassword: '',
@ -126,13 +125,7 @@
let that = this; let that = this;
that.paytype = ''; that.paytype = '';
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
uni.getStorage({
key: 'balanceCardNo',
success(e) {
that.balanceCardNo = e.data;
that.getHuiLianTongCardBalance(); that.getHuiLianTongCardBalance();
}
})
}, },
methods: { methods: {
// //
@ -151,7 +144,7 @@
}) })
let params = { let params = {
"orderId": this.orderNo, "orderId": this.orderNo,
"cardNo": this.balanceCardNo, "cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword "password": this.PaymentPassword
} }
hltUnionCardPay(params).then(res => { hltUnionCardPay(params).then(res => {
@ -214,7 +207,7 @@
// //
getHuiLianTongCardBalance() { getHuiLianTongCardBalance() {
let params = { let params = {
cardNo: this.balanceCardNo cardNo: this.user.hltCardNo.cardNo
} }
getHuiLianTongCardBalance(params).then(res => { getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -226,6 +219,20 @@
// //
orderToPay() { orderToPay() {
let that = this; let that = this;
uni.requestSubscribeMessage({
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
success (res) {
},
fail:(res) => {
// console.log(res)
// uni.showToast({
// title: '',
// duration:2000,
// icon:'none'
// })
}
})
if (that.paytype == '') { if (that.paytype == '') {
uni.showToast({ uni.showToast({
title: '请选择支付方式', title: '请选择支付方式',
@ -307,7 +314,6 @@
} }
that.$refs.paymentPassword.modalFun('show'); that.$refs.paymentPassword.modalFun('show');
} }
}, },
payRequest: function(self) { payRequest: function(self) {
let that = this; let that = this;

@ -87,9 +87,9 @@
</view> </view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<button class="reBtn flright" open-type="getPhoneNumber" v-if="user.phone == null" <!-- <button class="reBtn flright" open-type="getPhoneNumber" v-if="user.phone == null"
@getphonenumber="getPhoneNumber">去支付</button> @getphonenumber="getPhoneNumber">去支付</button> -->
<button class="reBtn flright" v-else @click="toPay">去支付</button> <button class="reBtn flright" @click="toPay">去支付</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> <button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button>
@ -124,8 +124,7 @@
<script> <script>
import { import {
getGasDetailByStoreKey, getGasDetailByStoreKey,
addOrder, addOrder
GetPhoneNumber
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp(); let app = getApp();
@ -278,29 +277,6 @@
this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2); this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2);
} }
}, },
//
getPhoneNumber(PhoneNumber) {
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
let that = this;
that.toPay();
}
});
},
// H5 // H5
jumpH5Bding() { jumpH5Bding() {
uni.navigateTo({ uni.navigateTo({

@ -73,7 +73,7 @@
</view> </view>
</view> </view>
</wybPopup> </wybPopup>
<authorize></authorize> <!-- <authorize></authorize> -->
</view> </view>
</template> </template>
@ -84,12 +84,12 @@
import slFilter from '@/components/sl-filter/sl-filter.vue'; import slFilter from '@/components/sl-filter/sl-filter.vue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'; import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue';
import authorize from '../../../components/Authorize.vue' // import authorize from '../../../components/Authorize.vue'
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
slFilter, slFilter,
authorize, // authorize,
uSearchBar, uSearchBar,
wybPopup wybPopup
}, },

@ -37,7 +37,7 @@
点击授权查询个人卡券 点击授权查询个人卡券
</button> </button>
<view class="loading-text" v-if="productList != '' ">{{ loadingText }}</view> <view class="loading-text" v-if="productList != '' ">{{ loadingText }}</view>
<authorize></authorize> <!-- <authorize></authorize> -->
</view> </view>
</template> </template>
@ -47,11 +47,11 @@
getCouponListByStoreId, getCouponListByStoreId,
getUserInfo getUserInfo
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import authorize from '../../../components/Authorize'; // import authorize from '../../../components/Authorize';
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
authorize // authorize
}, },
data() { data() {
return { return {
@ -88,14 +88,15 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.user = app.globalData.userInfo;
this.merchanId = option.id; this.merchanId = option.id;
this.distance = option.juli; this.distance = option.juli;
},
onShow() {
this.user = app.globalData.userInfo;
this.getMerchantStoreById(); this.getMerchantStoreById();
if (!this.user) {} else { if (this.user) {
this.getCouponListByStoreId(); this.getCouponListByStoreId();
} }
}, },
onReachBottom() { onReachBottom() {
this.getCouponListByStoreId(); this.getCouponListByStoreId();
@ -103,81 +104,9 @@
methods: { methods: {
// //
getuserinfo() { getuserinfo() {
// uni.showLoading({ uni.navigateTo({
// title: '...' url:'../../userLogin/userLogin'
// });
let that = this;
// wx.login({
// success(res) {
// if (res.code) {
// //
// var code = res.code;
//
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
iv: res.iv,
encryptedData: res.encryptedData
}
getUserInfo(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
app.globalData.userInfo = res
.return_data
.object
.highUser;
app.globalData.token = res
.return_data.uniqueCode;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data
.uniqueCode
})
that.user = res.return_data.object.highUser;
that.getCouponListByStoreId();
} else {
uni.hideLoading();
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
});
},
fail: res => {
uni.hideLoading();
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
}) })
// } else {
// uni.showToast({
// title: "",
// icon: "none"
// });
// }
// },
// fail(res) {
// uni.hideLoading();
// }
// })
// }
// })
}, },
// //
getMerchantStoreById() { getMerchantStoreById() {

@ -205,7 +205,6 @@
orderId: '', orderId: '',
jumpType: '', jumpType: '',
tongCardPrice: 0, tongCardPrice: 0,
balanceCardNo : ''
}; };
@ -219,13 +218,7 @@
that.paytype = ''; that.paytype = '';
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
that.findUser(); that.findUser();
uni.getStorage({
key: 'balanceCardNo',
success(e) {
that.balanceCardNo = e.data;
that.getHuiLianTongCardBalance(); that.getHuiLianTongCardBalance();
}
})
}, },
onHide() { onHide() {
@ -341,7 +334,7 @@
// //
getHuiLianTongCardBalance() { getHuiLianTongCardBalance() {
let params = { let params = {
cardNo: this.balanceCardNo cardNo: this.user.hltCardNo.cardNo
} }
getHuiLianTongCardBalance(params).then(res => { getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -574,7 +567,7 @@
let params = { let params = {
"orderId": this.orderId, "orderId": this.orderId,
"cardNo": this.balanceCardNo, "cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword "password": this.PaymentPassword
} }
hltUnionCardPay(params).then(res => { hltUnionCardPay(params).then(res => {

@ -95,7 +95,6 @@
couponId: '', couponId: '',
jumpType: '', jumpType: '',
PaymentPassword: '', PaymentPassword: '',
balanceCardNo: '',
tongCardPrice: 0 tongCardPrice: 0
}; };
}, },
@ -116,13 +115,7 @@
onShow() { onShow() {
let that = this; let that = this;
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
uni.getStorage({
key: 'balanceCardNo',
success(e) {
that.balanceCardNo = e.data;
that.getHuiLianTongCardBalance(); that.getHuiLianTongCardBalance();
}
})
}, },
methods: { methods: {
// //
@ -147,7 +140,7 @@
// //
getHuiLianTongCardBalance() { getHuiLianTongCardBalance() {
let params = { let params = {
cardNo: this.balanceCardNo cardNo: this.user.hltCardNo.cardNo
} }
getHuiLianTongCardBalance(params).then(res => { getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -295,7 +288,7 @@
} }
let params = { let params = {
"orderId": this.orderNo, "orderId": this.orderNo,
"cardNo": this.balanceCardNo, "cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword "password": this.PaymentPassword
} }
hltUnionCardPay(params).then(res => { hltUnionCardPay(params).then(res => {

@ -116,6 +116,7 @@
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
this.pageNum = 1;
this.categoryList = []; this.categoryList = [];
this.MerchantList = []; this.MerchantList = [];
if (app.globalData.cityName != '') { if (app.globalData.cityName != '') {

@ -182,22 +182,6 @@
<wybPopup ref="popup" type="center" height="850" width="600" radius="6" bgColor="" :showCloseIcon="true"> <wybPopup ref="popup" type="center" height="850" width="600" radius="6" bgColor="" :showCloseIcon="true">
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image> <image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image>
</wybPopup> </wybPopup>
<!-- // -->
<view class='Popup' v-if='isShowAuth'>
<view class="logo-auth">
<image src="../../../static/img/logo.png" mode="aspectFit"></image>
</view>
<view class='title'>授权提醒</view>
<view class='tip'>请授权手机号,以便为您提供更好的服务</view>
<view class='bottom flex'>
<view class='item' @click='close'>随便逛逛</view>
<!-- #ifdef MP -->
<button class='item grant' open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">去授权</button>
<!-- #endif -->
</view>
</view>
<view class='mask' v-if='isShowAuth' @click='close'></view>
<view class="height60"></view> <view class="height60"></view>
</view> </view>
</template> </template>
@ -213,7 +197,6 @@
getTPigKFCToken, getTPigKFCToken,
getTPigCinemaToken, getTPigCinemaToken,
getCmsContent, getCmsContent,
GetPhoneNumber,
} from "../../../Utils/Api.js"; //api } from "../../../Utils/Api.js"; //api
// import { getUserInfo } from '../../../Utils/Api.js' // import { getUserInfo } from '../../../Utils/Api.js'
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
@ -430,33 +413,7 @@
closePopup() { closePopup() {
this.$refs.popup.hide(); this.$refs.popup.hide();
}, },
//
getPhoneNumber(PhoneNumber) {
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: '授权成功',
icon: 'none',
duration: 2000
})
this.close();
app.globalData.userInfo = res.return_data
.object
.highUser;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
}
});
},
/** /**
* 跳转外链 * 跳转外链
*/ */
@ -761,11 +718,9 @@
}) })
} else if (item.name == '肯德基') { } else if (item.name == '肯德基') {
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
this.getuserinfos(); uni.navigateTo({
return false; url:'../../userLogin/userLogin'
} })
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
return false; return false;
} }
uni.navigateTo({ uni.navigateTo({
@ -775,11 +730,9 @@
} else if (item.name == '电影票') { } else if (item.name == '电影票') {
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
this.getuserinfos(); uni.navigateTo({
return false; url:'../../userLogin/userLogin'
} })
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
return false; return false;
} }
uni.navigateTo({ uni.navigateTo({
@ -789,11 +742,9 @@
} else if (item.name == '话费充值') { } else if (item.name == '话费充值') {
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
this.getuserinfos(); uni.navigateTo({
return false; url:'../../userLogin/userLogin'
} })
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
return false; return false;
} }
uni.navigateTo({ uni.navigateTo({
@ -811,11 +762,9 @@
// //
jumphuafei(item) { jumphuafei(item) {
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
this.getuserinfos(); uni.navigateTo({
return false; url:'../../userLogin/userLogin'
} })
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
return false; return false;
} }
uni.navigateTo({ uni.navigateTo({

@ -113,7 +113,7 @@
</view> </view>
<!-- 占位 --> <!-- 占位 -->
<view class="place-bottom"></view> <view class="place-bottom"></view>
<authorize></authorize> <!-- <authorize></authorize> -->
</view> </view>
</template> </template>
<script> <script>
@ -121,12 +121,12 @@
GetPhoneNumber, GetPhoneNumber,
findUser findUser
} from "../../../Utils/Api.js"; } from "../../../Utils/Api.js";
import authorize from '../../../components/Authorize'; // import authorize from '../../../components/Authorize';
import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue"; import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue";
let app = getApp() let app = getApp()
export default { export default {
components: { components: {
authorize, // authorize,
uniBadge uniBadge
}, },
data() { data() {
@ -241,9 +241,9 @@
}); });
}, },
onShow() { onShow() {
if (app.globalData.userInfo) { // if (app.globalData.userInfo) {
this.findUser(); this.findUser();
} // }
if (!app.globalData.userInfo.isSetPayPwd) { if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{ this.czList = [{

@ -149,10 +149,6 @@
bindHuiLianTongCard(params).then(res => { bindHuiLianTongCard(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.setStorage({
key: "balanceCardNo",
data: this.cardNoNumber
})
app.globalData.userInfo = res.return_data app.globalData.userInfo = res.return_data
.object .object
.highUser; .highUser;

@ -0,0 +1,117 @@
<template>
<view>
<image mode="widthFix" class="width90 mart20" src="../../static/img/login.png"></image>
<!-- #ifdef MP -->
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user" @click="getuserinfo">
授权并登录</view>
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user.phone && user"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16"
@click="getH5userinfo">授权并登录</button>
<!-- #endif -->
</view>
</template>
<script>
const app = getApp();
import {
getUserInfo,
GetPhoneNumber
} from "../../Utils/Api.js"
export default {
data() {
return {
user: ''
}
},
methods: {
getuserinfo() {
let that = this;
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
iv: res.iv,
encryptedData: res.encryptedData
}
getUserInfo(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
that.user = res.return_data.object.highUser;
app.globalData.token = res.return_data.uniqueCode;
that.isShowAuth = false
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
if (res.return_data.object.highUser.phone) {
uni.navigateBack({})
}
} else {
uni.showToast({
title: res.return_msg
})
}
});
},
fail: res => {
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
})
that.isShowAuth = false
},
//
getPhoneNumber(PhoneNumber) {
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: '授权成功',
icon: 'none',
duration: 2000
})
uni.navigateBack({})
app.globalData.userInfo = res.return_data
.object
.highUser;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
}
});
},
getH5userinfo() {
uni.navigateTo({
url: '/pages/login/register?id=1'
})
},
}
}
</script>
<style lang="scss">
.btns {
border-radius: 6px;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Loading…
Cancel
Save