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. 30
      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. 13
      pages/order/confirmation.vue
  9. 13
      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
success(res) {
resolve(res)
if(res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code == 104001){
uni.showToast({
title:'登录信息过期,请重新授权',
icon:'none',
duration:2000
})
if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code ==
104001) {
app.globalData.userInfo = '';
app.globalData.token = '';
uni.setStorage({
@ -29,8 +25,17 @@ function request(method, url, data) {
key: "token",
data: ''
})
uni.reLaunch({
url: '/pages/tabBar/home/home'
uni.showToast({
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": {

@ -13,10 +13,10 @@
<!-- #endif -->
<!-- 底部菜单 -->
<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 v-else class="width100 fotct btnfot" @click="buy">
</button> -->
<button class="width100 fotct btnfot" @click="buy">
立即兑换
</button>
</view>
@ -112,7 +112,7 @@
</view>
</view>
</wybPopup>
<authorize></authorize>
<!-- <authorize></authorize> -->
</view>
</template>
@ -122,12 +122,12 @@
GetPhoneNumber,
getUserInfo
} 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';
let app = getApp()
export default {
components: {
authorize,
// authorize,
wybPopup
},
data() {

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

@ -87,9 +87,9 @@
</view>
<!-- #ifdef MP -->
<button class="reBtn flright" open-type="getPhoneNumber" v-if="user.phone == null"
@getphonenumber="getPhoneNumber">去支付</button>
<button class="reBtn flright" v-else @click="toPay">去支付</button>
<!-- <button class="reBtn flright" open-type="getPhoneNumber" v-if="user.phone == null"
@getphonenumber="getPhoneNumber">去支付</button> -->
<button class="reBtn flright" @click="toPay">去支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button>
@ -124,8 +124,7 @@
<script>
import {
getGasDetailByStoreKey,
addOrder,
GetPhoneNumber
addOrder
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp();
@ -278,29 +277,6 @@
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
jumpH5Bding() {
uni.navigateTo({

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

@ -37,7 +37,7 @@
点击授权查询个人卡券
</button>
<view class="loading-text" v-if="productList != '' ">{{ loadingText }}</view>
<authorize></authorize>
<!-- <authorize></authorize> -->
</view>
</template>
@ -47,11 +47,11 @@
getCouponListByStoreId,
getUserInfo
} from '../../../Utils/Api.js';
import authorize from '../../../components/Authorize';
// import authorize from '../../../components/Authorize';
let app = getApp();
export default {
components: {
authorize
// authorize
},
data() {
return {
@ -88,14 +88,15 @@
}
},
onLoad(option) {
this.user = app.globalData.userInfo;
this.merchanId = option.id;
this.distance = option.juli;
},
onShow() {
this.user = app.globalData.userInfo;
this.getMerchantStoreById();
if (!this.user) {} else {
if (this.user) {
this.getCouponListByStoreId();
}
},
onReachBottom() {
this.getCouponListByStoreId();
@ -103,81 +104,9 @@
methods: {
//
getuserinfo() {
// uni.showLoading({
// title: '...'
// });
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"
});
}
uni.navigateTo({
url:'../../userLogin/userLogin'
})
// } else {
// uni.showToast({
// title: "",
// icon: "none"
// });
// }
// },
// fail(res) {
// uni.hideLoading();
// }
// })
// }
// })
},
//
getMerchantStoreById() {

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

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

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

@ -182,22 +182,6 @@
<wybPopup ref="popup" type="center" height="850" width="600" radius="6" bgColor="" :showCloseIcon="true">
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image>
</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>
</template>
@ -213,7 +197,6 @@
getTPigKFCToken,
getTPigCinemaToken,
getCmsContent,
GetPhoneNumber,
} from "../../../Utils/Api.js"; //api
// import { getUserInfo } from '../../../Utils/Api.js'
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
@ -430,33 +413,7 @@
closePopup() {
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 == '肯德基') {
if (!app.globalData.userInfo) {
this.getuserinfos();
return false;
}
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
uni.navigateTo({
url:'../../userLogin/userLogin'
})
return false;
}
uni.navigateTo({
@ -775,11 +730,9 @@
} else if (item.name == '电影票') {
if (!app.globalData.userInfo) {
this.getuserinfos();
return false;
}
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
uni.navigateTo({
url:'../../userLogin/userLogin'
})
return false;
}
uni.navigateTo({
@ -789,11 +742,9 @@
} else if (item.name == '话费充值') {
if (!app.globalData.userInfo) {
this.getuserinfos();
return false;
}
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
uni.navigateTo({
url:'../../userLogin/userLogin'
})
return false;
}
uni.navigateTo({
@ -811,11 +762,9 @@
//
jumphuafei(item) {
if (!app.globalData.userInfo) {
this.getuserinfos();
return false;
}
if (!app.globalData.userInfo.phone) {
this.isShowAuth = true;
uni.navigateTo({
url:'../../userLogin/userLogin'
})
return false;
}
uni.navigateTo({

@ -113,7 +113,7 @@
</view>
<!-- 占位 -->
<view class="place-bottom"></view>
<authorize></authorize>
<!-- <authorize></authorize> -->
</view>
</template>
<script>
@ -121,12 +121,12 @@
GetPhoneNumber,
findUser
} 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";
let app = getApp()
export default {
components: {
authorize,
// authorize,
uniBadge
},
data() {
@ -241,9 +241,9 @@
});
},
onShow() {
if (app.globalData.userInfo) {
// if (app.globalData.userInfo) {
this.findUser();
}
// }
if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{

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