1.修改文案

master
杨杰 3 years ago
parent e86bb96f67
commit 8377c5d683
  1. 9
      high-unionPay/Utils/Api.js
  2. 10
      high-unionPay/pages/goods/coupon-details/coupon-details.vue
  3. 52
      high-unionPay/pages/goods/externalCoupon/externalCoupon.vue
  4. 11
      high-unionPay/pages/pay/success/success.vue
  5. 36
      high-unionPay/pages/unionPay/unionPay-entrance/unionPay-entrance.vue
  6. 33
      high-unionPay/pages/userLogin/userLogin.vue

@ -14,6 +14,10 @@ export const HandleCode = params => {
export const GetPhoneNumber = params => { export const GetPhoneNumber = params => {
return POST('GET', `${base}/wechat/getPhoneNumber`, params).then(res => res.data); return POST('GET', `${base}/wechat/getPhoneNumber`, params).then(res => res.data);
}; };
//银联手机号登录
export const unionPhoneLogin = params => {
return POST('GET', `${base}/user/unionPhoneLogin`, params).then(res => res.data);
};
//获取用户授权信息 //获取用户授权信息
export const getUserInfo = params => { export const getUserInfo = params => {
return POST('GET', `${base}/wechat/getUserInfo`, params).then(res => res.data); return POST('GET', `${base}/wechat/getUserInfo`, params).then(res => res.data);
@ -181,7 +185,10 @@ export const orderToUnionPayphone = params => {
export const paygetOrderById = params => { export const paygetOrderById = params => {
return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data); return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data);
} }
//获取设置用户参数
export const getUserParam = params => {
return POST('GET', `${base}/highUser/getUserParam`, params).then(res => res.data);
}
/** /**
* 工会卡 * 工会卡
*/ */

@ -49,9 +49,15 @@
</view> --> </view> -->
</view> </view>
<view class="mart20 fotct fcorred font15 marb20 height20" <view class="mart20 fotct fcorred font15 marb20 height20"
v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4"> v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0">
预约订单已成功 门店会在24小时内联系您</view>
<view class="mart20 fotct fcorred font15 marb20 height20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3">
请出示核销码(商户扫客户)</view> 请出示核销码(商户扫客户)</view>
<view class="width90 mart20 fotct" v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4"> <view class="mart20 fotct fcorred font15 marb20 height20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3">
请告知加油员用码商支付</view>
<view class="width90 mart20 fotct" v-if="!couponDesInfo.couponInfo.reserveStatus">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image>
</view> </view>
<view class="fotct fcor333 font15 marb10 mart10" v-if="couponDesInfo.couponInfo.couponSource != 4">{{couponDesInfo.couponCodeInfo.codeKey}}</view> <view class="fotct fcor333 font15 marb10 mart10" v-if="couponDesInfo.couponInfo.couponSource != 4">{{couponDesInfo.couponCodeInfo.codeKey}}</view>

@ -14,7 +14,7 @@
</view> </view>
</view> </view>
<view class="line1 mart15"></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> withCredentials="true">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button> <button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view> <view class="width90 mart10 fcor666">去使用</view>
@ -62,7 +62,8 @@
getDiscountByQrCode, getDiscountByQrCode,
receiveDiscount, receiveDiscount,
HandleCode, HandleCode,
getUserInfo getUserInfo,
loginByPhone
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
// import authorize from '../../../components/Authorize'; // import authorize from '../../../components/Authorize';
let app = getApp(); let app = getApp();
@ -124,9 +125,9 @@
}) })
} }
}) })
var arr1 = decodeURIComponent(options.q); // var arr1 = decodeURIComponent(options.q);
var arr2 = arr1.split('='); // var arr2 = arr1.split('=');
this.codes = arr2[2]; this.codes = options.id;
this.getDiscountByQrCode(); this.getDiscountByQrCode();
}, },
@ -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) { toGoods(e) {
if (app.globalData.userInfo) { if (app.globalData.userInfo) {

@ -37,8 +37,15 @@
<view class="width100"> <view class="width100">
<view class="width90 mart10 fcor666" v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3">请出示核销码(商户扫客户)</view> <view class="mart20 fotct fcorred font15 marb20 height20"
<view class="mart20 fotct fcorred font15 marb20" v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3">请告知加油员用码商支付</view> v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0">
预约订单已成功 门店会在24小时内联系您</view>
<view class="mart20 fotct fcorred font15 marb20 height20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3">
请出示核销码(商户扫客户)</view>
<view class="mart20 fotct fcorred font15 marb20 height20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3">
请告知加油员用码商支付</view>
<view class="width90 mart20 fotct" v-if="!couponDesInfo.couponInfo.reserveStatus"> <view class="width90 mart20 fotct" v-if="!couponDesInfo.couponInfo.reserveStatus">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg">
</image> </image>

@ -12,24 +12,25 @@
</template> </template>
<script> <script>
import {
getUserParam
} from '../../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return {} return {}
}, },
onLoad() { onLoad() {
console.log('==========') let that = this;
uni.getStorage({ uni.getStorage({
key: "user", key: "user",
success(e) { success(e) {
app.globalData.userInfo = e.data //token app.globalData.userInfo = e.data //token
uni.getStorage({ uni.getStorage({
key: 'token', key: 'token',
success(e) { success(e) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
app.globalData.token = e.data; app.globalData.token = e.data;
that.getUserParam();
}, },
fail() { fail() {
uni.navigateTo({ uni.navigateTo({
@ -46,14 +47,29 @@
}) })
}, },
methods: { methods: {
//ID
getUserParam() {
getUserParam().then(res => {
if (res.return_code == '000000' && res.return_data) {
uni.navigateTo({
url: '../../goods/externalCoupon/externalCoupon?id=' + res.return_data
})
}
})
},
// //
jumprecharge(item) { jumprecharge(item) {
if (!app.globalData.latitude) { if (app.globalData.userInfo) {
this.hqaddress(item); if (!app.globalData.latitude) {
return; this.hqaddress(item);
return;
}
this.jumpsValue(item);
} else {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
} }
this.jumpsValue(item);
}, },
// //
// //

@ -1,8 +1,8 @@
<template> <template>
<view> <view>
<image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres1"></image> <image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres"></image>
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> --> <!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> -->
<view class="width94">{{code}}</view> <!-- <view class="width94">{{code}}</view> -->
<UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope"> <UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope">
授权手机号 授权手机号
</UPButton> </UPButton>
@ -24,7 +24,8 @@
const app = getApp(); const app = getApp();
import { import {
getUserInfo, getUserInfo,
GetPhoneNumber GetPhoneNumber,
unionPhoneLogin
} from "../../Utils/Api.js" } from "../../Utils/Api.js"
export default { export default {
name: 'App', name: 'App',
@ -33,7 +34,7 @@
user: '', user: '',
scope: "scope.mobile,scope.auth", scope: "scope.mobile,scope.auth",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'login.png', imgadres: 'loginunion.png',
imgadres1: 'loginphone.png', imgadres1: 'loginphone.png',
resinfo: '', resinfo: '',
scope: "scope.mobile", scope: "scope.mobile",
@ -45,7 +46,10 @@
}, },
methods: { methods: {
btnClick(result) { btnClick(result) {
this.code = result.code; this.code = result.code;
if(result.code){
this.unionPhoneLogin(result.code)
}
}, },
getuserinfo() { getuserinfo() {
let that = this; let that = this;
@ -107,21 +111,19 @@
// }) // })
// }, // },
// //
getPhoneNumber(PhoneNumber) { unionPhoneLogin(item) {
let params = { let params = {
openId: app.globalData.openId, code: item
iv: PhoneNumber.detail.iv,
encryptedData: PhoneNumber.detail.encryptedData
} }
GetPhoneNumber(params).then(res => { unionPhoneLogin(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.showToast({ uni.showToast({
title: '授权成功', title: '授权成功',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
uni.navigateBack({}) this.user = res.return_data.object.highUser;
this.user = res.return_data.object.highUser; app.globalData.token = res.return_data.uniqueCode;
app.globalData.userInfo = res.return_data app.globalData.userInfo = res.return_data
.object .object
.highUser; .highUser;
@ -130,7 +132,12 @@
data: res.return_data data: res.return_data
.object .object
.highUser .highUser
}) })
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.navigateBack({})
} }
}); });
}, },

Loading…
Cancel
Save