支付宝优化
This commit is contained in:
29
App.vue
29
App.vue
@@ -4,9 +4,25 @@
|
|||||||
import Api from '@/common/js/api.js'
|
import Api from '@/common/js/api.js'
|
||||||
export default {
|
export default {
|
||||||
globalData: {
|
globalData: {
|
||||||
systemInfo: null
|
systemInfo: null,
|
||||||
|
tableCode: null,
|
||||||
|
shopId: null,
|
||||||
|
queueId: null,
|
||||||
},
|
},
|
||||||
onLaunch: function() {
|
onLaunch: function(options) {
|
||||||
|
console.log(3333)
|
||||||
|
console.log(options)
|
||||||
|
if ( options.query.qrCode ) {
|
||||||
|
if (this.getQueryString(options.query.qrCode, 'code')) {
|
||||||
|
this.globalData.tableCode = this.getQueryString(options.query.qrCode, 'code')
|
||||||
|
}
|
||||||
|
if (this.getQueryString(options.query.qrCode, 'shopId')) {
|
||||||
|
this.globalData.shopId = this.getQueryString(options.query.qrCode, 'shopId')
|
||||||
|
}
|
||||||
|
if (this.getQueryString(options.query.qrCode, 'queueId')) {
|
||||||
|
this.globalData.queueId = this.getQueryString(options.query.qrCode, 'queueId')
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
||||||
uni.cache.clear();
|
uni.cache.clear();
|
||||||
}
|
}
|
||||||
@@ -68,7 +84,14 @@
|
|||||||
// console.log('App Hide');
|
// console.log('App Hide');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getQueryString(url, name) { //解码
|
||||||
|
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||||
|
var r = url.substr(1).match(reg)
|
||||||
|
if (r != null) {
|
||||||
|
return r[2]
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -134,11 +134,17 @@
|
|||||||
timer: null //定时器
|
timer: null //定时器
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(options) {
|
||||||
// 隐藏首页按钮
|
// 隐藏首页按钮
|
||||||
if (e.q) {
|
|
||||||
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
|
// #ifdef MP-WEIXIN
|
||||||
|
if (options.q) {
|
||||||
|
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||||
|
// #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
|||||||
@@ -121,33 +121,35 @@
|
|||||||
type: "",
|
type: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onLoad(e) {
|
async onLoad(options) {
|
||||||
// if ( e.type == 'list' || e.type == 'index') {
|
// if ( e.type == 'list' || e.type == 'index') {
|
||||||
// this.shopId = e.shopId;
|
// this.shopId = e.shopId;
|
||||||
// this.init();
|
// this.init();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
console.log(e)
|
|
||||||
uni.cache.set('forceUpdate',1)
|
uni.cache.set('forceUpdate',1)
|
||||||
if (e.q) {
|
// #ifdef MP-WEIXIN
|
||||||
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
|
if (options.q) {
|
||||||
|
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||||
uni.cache.set('shopId',this.shopId)
|
uni.cache.set('shopId',this.shopId)
|
||||||
this.tokenShow = false;
|
this.tokenShow = false;
|
||||||
// 等待登录结果返回
|
|
||||||
// if (!uni.cache.get('token')) {
|
|
||||||
// await this.$onLaunched;
|
|
||||||
// }
|
|
||||||
this.shopInfo();
|
|
||||||
this.paygetActive()
|
|
||||||
} else{
|
|
||||||
this.shopId = e.shopId;
|
|
||||||
this.type = e.type;
|
|
||||||
if ( e.amount ) { this.amount = e.amount; }
|
|
||||||
uni.cache.set('shopId',this.shopId)
|
|
||||||
this.shopInfo();
|
|
||||||
this.paygetActive()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||||
|
uni.cache.set('shopId',this.shopId)
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
if (options.shopId) {
|
||||||
|
this.shopId = options.shopId
|
||||||
|
uni.cache.set('shopId',this.shopId)
|
||||||
|
}
|
||||||
|
if (options.type) {
|
||||||
|
this.type = options.type
|
||||||
|
}
|
||||||
|
if ( options.amount ) { this.amount = options.amount; }
|
||||||
|
this.shopInfo();
|
||||||
|
this.paygetActive()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -374,6 +374,7 @@
|
|||||||
shopExtend: null,
|
shopExtend: null,
|
||||||
shopId: "",
|
shopId: "",
|
||||||
tableCode: "",
|
tableCode: "",
|
||||||
|
orderAMeal: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -402,16 +403,24 @@
|
|||||||
this.$store.getters.is_BarHeight.customBar)
|
this.$store.getters.is_BarHeight.customBar)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(options) {
|
||||||
if (e.q) {
|
// #ifdef MP-WEIXIN
|
||||||
this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
|
if (options.q) {
|
||||||
|
this.tableCode = this.getQueryString(decodeURIComponent(options.q), 'code')
|
||||||
uni.cache.set('tableCode', this.tableCode)
|
uni.cache.set('tableCode', this.tableCode)
|
||||||
}
|
}
|
||||||
if ( e.shopId ) {
|
// #endif
|
||||||
this.shopId = e.shopId
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.tableCode) {
|
||||||
|
this.tableCode = getApp().globalData.tableCode
|
||||||
|
uni.cache.set('tableCode', this.tableCode)
|
||||||
}
|
}
|
||||||
if ( e.tableCode ) {
|
// #endif
|
||||||
this.tableCode = e.tableCode
|
if ( options.shopId ) {
|
||||||
|
this.shopId = options.shopId
|
||||||
|
}
|
||||||
|
if ( options.tableCode ) {
|
||||||
|
this.tableCode = options.tableCode
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -431,7 +440,9 @@
|
|||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
if (!this.orderAMeal){
|
||||||
|
uni.pro.switchTab('index/index')
|
||||||
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
@@ -539,7 +550,8 @@
|
|||||||
if (this.shopId) {params.shopId = this.shopId}
|
if (this.shopId) {params.shopId = this.shopId}
|
||||||
let res = await this.api.productqueryShop(params)
|
let res = await this.api.productqueryShop(params)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount) {
|
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount&&this.orderAMeal) {
|
||||||
|
this.orderAMeal = false;
|
||||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||||
tableCode: this.tableCode,
|
tableCode: this.tableCode,
|
||||||
shopId: res.data.storeInfo.id,
|
shopId: res.data.storeInfo.id,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
textMargin: 14
|
textMargin: 14
|
||||||
},
|
},
|
||||||
qrcodeSize: 400,
|
qrcodeSize: 400,
|
||||||
createcardNo: '4637700074809642',
|
createcardNo: '',
|
||||||
shopInfo: null
|
shopInfo: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<text class="t">备注:</text>
|
<text class="t">备注:</text>
|
||||||
<text class="info">{{ listinfo.orderInfo.remark}}</text>
|
<text class="info">{{ listinfo.orderInfo.remark||""}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<text class="t">就餐人数:</text>
|
<text class="t">就餐人数:</text>
|
||||||
|
|||||||
@@ -92,9 +92,8 @@
|
|||||||
.paymentMethod{
|
.paymentMethod{
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx 220rpx 20rpx;
|
||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
margin-bottom: 220rpx;
|
|
||||||
.paymentMethod_content{
|
.paymentMethod_content{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 22rpx;
|
border-radius: 22rpx;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
<!-- <rechargeFree ref="rechargeFree" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree> -->
|
<!-- <rechargeFree ref="rechargeFree" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree> -->
|
||||||
<!-- 充值活动 -->
|
<!-- 充值活动 -->
|
||||||
<topUpActivity ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
<!-- <topUpActivity ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity> -->
|
||||||
<!-- 支付方式 -->
|
<!-- 支付方式 -->
|
||||||
<paymentMethod ref="paymentMethod" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
<paymentMethod ref="paymentMethod" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
favorable: [
|
favorable: [
|
||||||
// { name: "优惠券", type: "coupon", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
|
// { name: "优惠券", type: "coupon", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
|
||||||
// { name: "团购优惠", type: "group", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
// { name: "团购优惠", type: "group", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||||
{ name: "积分抵扣", type: "points", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/points.png"},
|
// { name: "积分抵扣", type: "points", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/points.png"},
|
||||||
],
|
],
|
||||||
isPointsChecked: false,
|
isPointsChecked: false,
|
||||||
rechargeFreeChecked: false,
|
rechargeFreeChecked: false,
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<view class="headStatus" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||listinfo.status=='closed'">
|
<view class="headStatus" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||listinfo.status=='closed'">
|
||||||
<view class="status">
|
<view class="status">
|
||||||
<u-icon name="checkmark-circle-fill" color="#03C061" size="46"></u-icon>
|
<u-icon name="checkmark-circle-fill" color="#03C061" size="46"></u-icon>
|
||||||
<view class="statusName" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">下单成功</view>
|
<view class="statusName" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">{{listinfo.registerType == 'munchies'?'待支付':'下单成功'}}</view>
|
||||||
<view class="statusName" v-if="listinfo.status=='closed'">已完成</view>
|
<view class="statusName" v-if="listinfo.status=='closed'">已完成</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="time" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">下单时间:{{listinfo.createdAt}}</view>
|
<view class="time" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">下单时间:{{ listinfo.createdAt }}</view>
|
||||||
<view class="time" v-if="listinfo.status=='closed'">付款时间:{{listinfo.paidTime}}</view>
|
<view class="time" v-if="listinfo.status=='closed'">付款时间:{{listinfo.paidTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@@ -137,11 +137,16 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
if (options.q) {
|
if (options.q) {
|
||||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||||
this.queueId = this.getQueryString(decodeURIComponent(options.q), 'queueId')
|
this.queueId = this.getQueryString(decodeURIComponent(options.q), 'queueId')
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||||
|
if (getApp().globalData.queueId) { this.queueId = getApp().globalData.queueId }
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getQueueUpState();
|
this.getQueueUpState();
|
||||||
|
|||||||
Reference in New Issue
Block a user