1. 修改登录方式

yj-dev
杨杰 3 years ago
parent 5f55f72b51
commit f38fa69985
  1. 4
      Utils/Api.js
  2. 46
      pages/goods/externalCoupon/externalCoupon.vue
  3. 1
      pages/goods/goods.vue
  4. 22
      pages/order/confirmation.vue
  5. 33
      pages/tabBar/user/user.vue
  6. 50
      pages/userLogin/userLogin.vue
  7. 16
      subPages/recharge-centre/recharge-centre.vue
  8. 26
      subPages/unionComfirmation/unionComfirmation.vue

@ -31,6 +31,10 @@ export const updateUserPayPwd = params => {
export const findUser = params => {
return POST('GET', `${base}/highUser/findUser`, params).then(res => res.data);
}
//绑定用户电话
export const loginByPhone = params => {
return POST('GET', `${base}/wechat/loginByPhone`, params).then(res => res.data);
};
//微信登录
export const WXlogin = params => {
return POST('GET', `${base}/wechat/login`, params).then(res => res.data);

@ -14,7 +14,7 @@
</view>
</view>
<view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" @click="getuserinfo"
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" open-type="getPhoneNumber" @getphonenumber="loginByPhone"
withCredentials="true">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view>
@ -62,7 +62,8 @@
getDiscountByQrCode,
receiveDiscount,
HandleCode,
getUserInfo
getUserInfo,
loginByPhone
} from '../../../Utils/Api.js';
// import authorize from '../../../components/Authorize';
let app = getApp();
@ -249,6 +250,47 @@
// })
},
//
loginByPhone(PhoneNumber) {
if(PhoneNumber.detail.iv == undefined){
uni.showToast({
title: "用户取消授权",
icon: "none"
});
return;
}
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
loginByPhone(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: '手机号授权成功',
icon: 'none',
duration: 2000
})
this.user = res.return_data.object.highUser;
app.globalData.token = res.return_data.uniqueCode;
app.globalData.userInfo = res.return_data
.object
.highUser;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
this.receiveDiscount();
this.userInfo = 2;
}
});
},
//
toGoods(e) {
if (app.globalData.userInfo) {

@ -119,7 +119,6 @@
<script>
import {
getCouponById,
GetPhoneNumber,
getUserInfo
} from "../../Utils/Api.js";
// import authorize from '../../components/Authorize.vue'

@ -127,8 +127,8 @@
</view>
</view>
<!-- #ifdef MP -->
<button class="btn" open-type="getPhoneNumber" v-if="user.phone == null"
@getphonenumber="getPhoneNumber">立即支付</button>
<button class="btn" open-type="getPhoneNumber" v-if="user == null"
@getphonenumber="loginByPhone">立即支付</button>
<button class="btn" v-else @tap="toPay">立即支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
@ -162,7 +162,7 @@
import {
addOrder,
getCouponById,
GetPhoneNumber,
loginByPhone,
getUserNormalDiscountList,
bindUserPhone,
orderToPay,
@ -351,13 +351,20 @@
})
},
//
getPhoneNumber(PhoneNumber) {
loginByPhone(PhoneNumber) {
if (PhoneNumber.detail.iv == undefined) {
uni.showToast({
title: "用户取消授权",
icon: "none"
});
return;
}
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
loginByPhone(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
@ -365,6 +372,11 @@
this.user = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "user",
data: res.return_data

@ -14,7 +14,7 @@
</view>
<!-- 昵称,个性签名 -->
<view class="right">
<view class="username" v-if="!user.name">请授权登录</view>
<view class="username" v-if="user && user.infoCompleteStatus == 1" @click="jumplogin">点击获取信息</view>
<view class="username" v-else>{{user.name}}</view>
<view class="font14 fcorfff" v-if="!user.gold">积分: 0</view>
<view class="font14 fcorfff" v-else>积分: {{user.gold}} </view>
@ -22,8 +22,8 @@
</view>
<!-- 二维码按钮 -->
<!-- #ifdef MP -->
<button class="erweima fotct aliitem font14" v-if="user.phone == null" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber">
<button class="erweima fotct aliitem font14" v-if="user == null" open-type="getPhoneNumber"
@getphonenumber="loginByPhone">
<image src="../../../static/img/jingbi.png"></image> 充值金额
</button>
<button class="erweima fotct aliitem font14" v-else @click="toDeposit">
@ -132,7 +132,7 @@
</template>
<script>
import {
GetPhoneNumber,
loginByPhone,
findUser
} from "../../../Utils/Api.js";
// import authorize from '../../../components/Authorize';
@ -177,8 +177,7 @@
icon: "pingjia"
}
],
huafeiList:[
{
huafeiList: [{
text: '待支付',
icon: "fukuan"
},
@ -324,17 +323,29 @@
}
});
},
getPhoneNumber(PhoneNumber) {
loginByPhone(PhoneNumber) {
if (PhoneNumber.detail.iv == undefined) {
uni.showToast({
title: "用户取消授权",
icon: "none"
});
return;
}
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
loginByPhone(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "user",
data: res.return_data
@ -351,6 +362,12 @@
url: '/pages/login/register?id=2'
})
},
//
jumplogin() {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
},
//
toScan() {
uni.scanCode({

@ -1,12 +1,12 @@
<template>
<view>
<image mode="widthFix" class="width90 mart20" v-if="!user" :src="imagewxUrl+imgadres"></image>
<image mode="widthFix" class="width90 mart20" v-if="!user.phone && user" :src="imagewxUrl+imgadres1"></image>
<image mode="widthFix" class="width90 mart20" v-if="user && user.infoCompleteStatus == 1" :src="imagewxUrl+imgadres"></image>
<image mode="widthFix" class="width90 mart20" v-if="!user" :src="imagewxUrl+imgadres1"></image>
<!-- #ifdef MP -->
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user" @click="getuserinfo">
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="user && user.infoCompleteStatus == 1" @click="getuserinfo">
授权并登录</view>
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone && user"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button>
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user"
open-type="getPhoneNumber" @getphonenumber="loginByPhone">授权手机号</button>
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user"
@click="reqmessage">授权获取消息通知</button> -->
<!-- #endif -->
@ -21,7 +21,7 @@
const app = getApp();
import {
getUserInfo,
GetPhoneNumber
loginByPhone
} from "../../Utils/Api.js"
export default {
data() {
@ -64,7 +64,7 @@
key: "token",
data: res.return_data.uniqueCode
})
if (res.return_data.object.highUser.phone) {
if (res.return_data.object.highUser.infoCompleteStatus == 0) {
uni.navigateBack({
})
}
@ -84,35 +84,29 @@
})
that.isShowAuth = false
},
//
// reqmessage() {
// uni.requestSubscribeMessage({
// tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
// success(res) {
// uni.navigateBack({})
// },
// fail: (res) => {
// uni.navigateBack({})
// }
// })
// },
//
getPhoneNumber(PhoneNumber) {
loginByPhone(PhoneNumber) {
if(PhoneNumber.detail.iv == undefined){
uni.showToast({
title: "用户取消授权",
icon: "none"
});
return;
}
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
loginByPhone(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: '授权成功',
title: '手机号授权成功',
icon: 'none',
duration: 2000
})
uni.navigateBack({
})
this.user = res.return_data.object.highUser;
app.globalData.token = res.return_data.uniqueCode;
app.globalData.userInfo = res.return_data
.object
.highUser;
@ -122,6 +116,14 @@
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
if(res.return_data.object.highUser.infoCompleteStatus == 0){
uni.navigateBack({
})
}
}
});
},

@ -22,35 +22,35 @@
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">1:</view>
<view style="margin-left: 5%;">慢充话费与营业厅充值一样只是到账时间稍长充值过程中可能出现分批到账的情况但是总金额不会少请耐心等待如72小时未到账请联系客服查询</view>
<view style="margin-left: 5%;">慢充话费与营业厅充值一样只是到账时间稍长充值过程中可能出现分批到账的情况但是总金额不会少请耐心等待</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">2:</view>
<view style="margin-left: 5%;">此业务为话费慢充平均4-5小时到账最晚72小时内到账月末月初为充值高峰期话费可能会有延迟请您耐心等待或在48小时后联系客服确认订单状态</view>
<view style="margin-left: 5%;">此业务为话费慢充日常72小时内到账如遇月初月末高峰期或系统更新到账时间会有一定延迟敬请谅解急单勿拍</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">3:</view>
<view style="margin-left: 5%;">由于优惠有限每个手机号30天内仅支持2次充值(不限金额)如1号充值1单29号充值1单第三单需要在第31号才能充值请根据自己话费使用情况选择对应金额 </view>
<view style="margin-left: 5%;">目前仅支持(移动联通电信三网号段) 运营商黑名单号码(长期欠费或非实名制认证)携号转网空号虚拟卡如165.167.170.171.162等等虚拟号段副卡号码或做过某些特殊套餐绑定的卡暂不支持充值请勿下单</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">4:</view>
<view style="margin-left: 5%;">目前仅支持(移动联通电信三网号段)165167 170171162等虚拟号段暂不支持充值携号转网号码暂不能充值否则损失自负无法退款</view>
<view style="margin-left: 5%;">停机号码需要额外补缴欠费后慢充话费才能到账<text class="fcoreb5">此服务为虚拟充值类服务无特殊情况不支持退款下单前请确认充值的号码无误</text></view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">5:</view>
<view style="margin-left: 5%;">停机号码需要额外补缴欠费后慢充话费才能到账此服务为虚拟充值类服务无特殊情况不支持退款</view>
<view style="margin-left: 5%;">空号错号充值后不支持退款请您务必核对确认号码无误后再进行充值非空号欠费可充欠费1个月导致空号的不能充值损失自负无法退款</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">6:</view>
<view style="margin-left: 5%;">空号错号充值后不支持退款请您务必核对确认号码无误后再进行充值非空号欠费可充欠费1个月导致空号的不能充值损失自负无法退款</view>
<view style="margin-left: 5%;"><text class="fcoreb5">本充值业务不提供发票</text>如需发票请在运营商手机客户端储开取电子发票也可以凭身份证到运营商实体营业厅打印发票</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">7:</view>
<view style="margin-left: 5%;">本充值业务不提供发票如需发票请在运营商手机客户端储开取电子发票也可以凭身份证到运营商实体营业厅打印发票 </view>
<view style="margin-left: 5%;">如遇系统维护充值失败将72小时后原路退款到付款账户 </view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6 marb40" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">8:</view>
<view style="margin-left: 5%;">如遇系统维护充值失败将72小时后原路退款到付款账户</view>
<view style="margin-left: 5%;">请登录所属运营商app手机营业厅查看充值号码的到账情况如金额有出入或未到账请截图充值记录明细反馈给客服</view>
</view>
<view class="height100p"></view>
<view class="bombtn width94 font16">

@ -66,15 +66,16 @@
<view class="width100 height60"></view>
<view class="footer">
<view class="settlement">
<view class="sum">实付:<view class="money" v-if="paytype == 'weixin' || paytype == 'gonghuika' ">{{payPrice}}</view>
<view class="sum">实付:<view class="money" v-if="paytype == 'weixin' || paytype == 'gonghuika' ">
{{payPrice}}</view>
<view class="money aliitem" v-else>
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../static/img/jfx.png">
</image>{{payPrice*100}}
</view>
</view>
<!-- #ifdef MP -->
<button class="btn" open-type="getPhoneNumber" v-if="user.phone == null"
@getphonenumber="getPhoneNumber">立即支付</button>
<button class="btn" open-type="getPhoneNumber" v-if="user == null"
@getphonenumber="loginByPhone">立即支付</button>
<button class="btn" v-else @tap="toPay">立即支付</button>
<!-- #endif -->
<!-- #ifdef H5 -->
@ -96,7 +97,8 @@
orderToGoldPay,
orderToGoldPayunion,
hltUnionCardPayUnion,
getHuiLianTongCardBalance
getHuiLianTongCardBalance,
loginByPhone
} from '../../Utils/Api.js';
import ssPaymentPassword from '../../components/sanshui-payment-password';
let app = getApp();
@ -198,17 +200,29 @@
})
},
//
getPhoneNumber(PhoneNumber) {
loginByPhone(PhoneNumber) {
if (PhoneNumber.detail.iv == undefined) {
uni.showToast({
title: "用户取消授权",
icon: "none"
});
return;
}
let params = {
openId: app.globalData.openId,
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
}
GetPhoneNumber(params).then(res => {
loginByPhone(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "user",
data: res.return_data

Loading…
Cancel
Save