diff --git a/App.vue b/App.vue
index 8434f37..4e988ba 100644
--- a/App.vue
+++ b/App.vue
@@ -4,9 +4,23 @@
import Api from '@/common/js/api.js'
export default {
globalData: {
- systemInfo: null
+ systemInfo: null,
+ tableCode: null,
+ shopId: null,
+ queueId: null,
},
- onLaunch: function() {
+ onLaunch: function(options) {
+ if ( options.query&&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) {
uni.cache.clear();
}
@@ -68,7 +82,14 @@
// console.log('App Hide');
},
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;
+ },
}
};
diff --git a/common/js/api.js b/common/js/api.js
index 2236663..8f69837 100644
--- a/common/js/api.js
+++ b/common/js/api.js
@@ -161,7 +161,9 @@ export default {
getUserConpons(data) { //我的优惠券
return uni.api.post("/userConpons/find", data);
},
-
+ conponList(data) { //获取优惠券
+ return uni.api.post("/coupon/find", data);
+ },
ordergetYhqPara(data) { //获取优惠券参数列表
return uni.api.get("/order/getYhqPara", data);
},
diff --git a/components/cwx-keyboard/cwx-keyboard.vue b/components/cwx-keyboard/cwx-keyboard.vue
index 2b4a0ff..9478598 100644
--- a/components/cwx-keyboard/cwx-keyboard.vue
+++ b/components/cwx-keyboard/cwx-keyboard.vue
@@ -82,7 +82,12 @@
//处理按键
_handleKeyPress(e) {
// console.log('点击传e', e.target.dataset.num);
+ // #ifdef MP-WEIXIN
let num = e.target.dataset.num;
+ // #endif
+ // #ifdef MP-ALIPAY
+ let num = e.target.targetDataset.num;
+ // #endif
//不同按键处理逻辑
// -1 代表无效按键,直接返回
if (num == -1) return false;
@@ -154,6 +159,7 @@
// this.money = S + num;
// }
// }
+ console.log(num)
if (this.money.length == 6) {
this.$emit('confirmEvent', this.money); //提交参数
return
diff --git a/components/payPassword.vue b/components/payPassword.vue
index 37531ca..408b4b0 100644
--- a/components/payPassword.vue
+++ b/components/payPassword.vue
@@ -6,22 +6,22 @@
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
@@ -67,8 +67,8 @@
* @param {Object} val
*/
KeyInfo(val) {
-
- if (val.index >= 6) {
+ console.log(val)
+ if (val.index&&val.index >= 6) {
return;
}
// 判断是否输入的是删除键
diff --git a/components/payPasswordtwo.vue b/components/payPasswordtwo.vue
index 8eb5a54..03a7b2f 100644
--- a/components/payPasswordtwo.vue
+++ b/components/payPasswordtwo.vue
@@ -7,22 +7,22 @@
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
- ●
+ ●
@@ -56,7 +56,7 @@
},
watch: {
consumeFee(newVal, oldVal) {
-
+ console.log(this.consumeFee)
}
},
methods: {
diff --git a/pages/chooseasong/index.vue b/pages/chooseasong/index.vue
index 8531df7..2521395 100644
--- a/pages/chooseasong/index.vue
+++ b/pages/chooseasong/index.vue
@@ -134,11 +134,17 @@
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: {},
diff --git a/pages/index/components/diamond.vue b/pages/index/components/diamond.vue
index 106878f..e920283 100644
--- a/pages/index/components/diamond.vue
+++ b/pages/index/components/diamond.vue
@@ -1,6 +1,6 @@
-
{{item.name}}
@@ -31,7 +31,7 @@
},
methods: {
clickdistrict(item) {
- // console.log(item,'调试')
+ console.log(item,'调试')
switch (item.jumpType) {
case 'absolute':
uni.pro.navigateTo('webview/webview', {
diff --git a/pages/member/components/registermember.vue b/pages/member/components/registermember.vue
index 09fa87f..c81d248 100644
--- a/pages/member/components/registermember.vue
+++ b/pages/member/components/registermember.vue
@@ -49,7 +49,7 @@
@@ -202,7 +202,6 @@
uni.login({
provider: 'weixin',
success: async (data) => {
- console.log(data)
let res = await this.api.userwxlogins({
code: data.code,
encryptedData: d.detail.encryptedData,
@@ -222,36 +221,12 @@
console.log(res)
my.getPhoneNumber({
success: async (data) => {
- console.log(data)
let res = await this.api.userwxlogins({
encryptedData: JSON.parse(data.response).response,
source: "alipay"
})
- this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
- this.mobile = res.data;
- }
- });
- }
- });
- // #endif
-
- // #ifdef MP-ALIPAY
- // 支付宝小程序环境
- my.getAuthCode({
- scopes: 'auth_user',
- success: (res) => {
- console.log(res)
- let authCode = res.authCode;
- my.getPhoneNumber({
- success: async (data) => {
- let res = await this.api.userwxlogins({
- // code: authCode,
- encryptedData: JSON.parse(data.response).response,
- source: "alipay"
- })
- this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7)
- this.mobile = res.data;
- console.log(this.phonetitle)
+ this.telephone = res.data
+ // console.log(this.phonetitle)
}
});
}
diff --git a/pages/member/index - 副本.vue b/pages/member/index - 副本.vue
new file mode 100644
index 0000000..695940e
--- /dev/null
+++ b/pages/member/index - 副本.vue
@@ -0,0 +1,723 @@
+
+
+
+
+
+ {{ shopUserInfo.shopName }}
+
+
+
+
+ 账户余额(元)
+
+ {{shopUserInfo.amount || '0.00'}}
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+ ¥
+
+
+ 自定义金额
+
+
+
+
+ 充值
+
+ ¥{{item.amount}}
+
+
+
+ 赠{{inputshow}}
+ ¥{{ item.giftAmount }}
+
+
+ 赠送{{item.giftAmount}}元
+
+
+
+
+
+
+
+
+ 您将获得:
+
+
+
+ {{ item }}
+
+
+
+
+
+
+ 适用门店
+ {{ shopUserInfo.shopName }}
+
+
+ 充值说明
+ 1.充值金额1家门店可用
+ 2.储值完成后不支持自助退款,可联系商家处理
+ 3.钱包余额不支持转赠,不可提现,长期有效
+
+
+
+
+
+
+
+
+
+ 已同意
+ 《用户隐私协议》
+
+
+
+ 立即充值
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue
index 4a776ca..ecfef4b 100644
--- a/pages/order_food/order_food.vue
+++ b/pages/order_food/order_food.vue
@@ -374,6 +374,7 @@
shopExtend: null,
shopId: "",
tableCode: "",
+ orderAMeal: true,
}
},
onPageScroll(e) {
@@ -402,16 +403,24 @@
this.$store.getters.is_BarHeight.customBar)
}
},
- onLoad(e) {
- if (e.q) {
- this.tableCode = this.getQueryString(decodeURIComponent(e.q), 'code')
+ onLoad(options) {
+ // #ifdef MP-WEIXIN
+ if (options.q) {
+ this.tableCode = this.getQueryString(decodeURIComponent(options.q), 'code')
uni.cache.set('tableCode', this.tableCode)
}
- if ( e.shopId ) {
- this.shopId = e.shopId
+ // #endif
+ // #ifdef MP-ALIPAY
+ if (getApp().globalData.tableCode) {
+ this.tableCode = getApp().globalData.tableCode
+ uni.cache.set('tableCode', this.tableCode)
}
- if ( e.tableCode ) {
- this.tableCode = e.tableCode
+ // #endif
+ if ( options.shopId ) {
+ this.shopId = options.shopId
+ }
+ if ( options.tableCode ) {
+ this.tableCode = options.tableCode
}
},
@@ -431,7 +440,9 @@
},
async onShow() {
let _this = this;
-
+ if (!this.orderAMeal){
+ uni.pro.switchTab('index/index')
+ }
this.$nextTick(() => {
uni.pageScrollTo({
scrollTop: 0,
@@ -539,7 +550,8 @@
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
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', {
tableCode: this.tableCode,
shopId: res.data.storeInfo.id,
diff --git a/pages/pay_code/pay_code.vue b/pages/pay_code/pay_code.vue
index 4f3025e..82bfda0 100644
--- a/pages/pay_code/pay_code.vue
+++ b/pages/pay_code/pay_code.vue
@@ -40,7 +40,7 @@
textMargin: 14
},
qrcodeSize: 400,
- createcardNo: '4637700074809642',
+ createcardNo: '',
shopInfo: null
};
},
@@ -58,7 +58,6 @@
console.log(res)
if (res.code == 0) {
this.createcardNo = res.data;
- console.log(this.$refs.tkiBarcode)
this.$refs.tkiBarcode.setval(this.createcardNo) //操作属性
this.$refs.tkiQrcode.setval(this.createcardNo) //操作属性
}
diff --git a/pages/product/placeOrder.vue b/pages/product/placeOrder.vue
index 740b319..1c92dd3 100644
--- a/pages/product/placeOrder.vue
+++ b/pages/product/placeOrder.vue
@@ -55,6 +55,7 @@
+
-
+
+
+
+
+
+ 支付宝支付
+
+
+
+
+
+
@@ -98,7 +112,7 @@
-
+
@@ -109,7 +123,7 @@
payPassword
},
onLoad(e) {
- this.$store.dispatch("set_shopid"); //获取shapid
+ // this.$store.dispatch("set_shopid"); //获取shapid
this.getInfo(e.id)
this.orderIds = e.id
this.amount = uni.cache.get('userInfo').amount
@@ -143,6 +157,12 @@
// 余额支付
async accountPayevent(pwd) {
this.ispws = false
+ if ( this.amountVIP.isVip == 0 ) {
+ uni.pro.navigateTo('/pages/member/index', {
+ shopId: this.info.shopId,
+ })
+ return;
+ }
let res = await this.api.payOrderPay({
orderId: this.listinfoid.id,
payType: "deposit",
@@ -207,7 +227,7 @@
let isVip = uni.cache.get('userInfo').isPwd
if (isVip == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', {
- shopId_id: uni.cache.get('shopId')
+ shopId_id: this.info.shopId
})
} else {
this.ispws = true
@@ -221,12 +241,19 @@
},
async payEvent(id) {
let res = await this.api.payOrderPay({
+ // #ifdef MP-WEIXIN
payType: 'wechatPay',
+ // #endif
+ // #ifdef MP-ALIPAY
+ payType: 'aliPay',
+ // #endif
orderId: id,
orderType: 'group'
})
if (res) {
+ // 微信支付还是余额支付
uni.requestPayment({
+ // #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
@@ -234,22 +261,32 @@
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
+ // #endif
+ // #ifdef MP-ALIPAY
+ provider: 'alipay', //支付类型-固定值
+ orderInfo: res.data.tradeNo, // 支付宝支付商户号
+ // #endif
success: (res) => {
+ let _this = this
uni.showToast({
title: "支付成功"
})
uni.navigateBack()
},
- fail: (err) => {
- setTimeout(res => {
- uni.showToast({
- icon: 'none',
- title: '支付失败'
- })
- uni.hideLoading()
- }, 2000)
+ fail: async (err) => {
+ console.log(err)
+ let res = await this.api.cancelOrderPay({
+ orderId: this.listinfoid.id,
+ })
+
+ uni.showToast({
+ icon: 'none',
+ title: '支付失败'
+ })
+ uni.hideLoading()
}
});
+
}
},
diff --git a/pages/user/coupon.vue b/pages/user/coupon.vue
index e60afef..b2c5fec 100644
--- a/pages/user/coupon.vue
+++ b/pages/user/coupon.vue
@@ -3,10 +3,10 @@
+ :class="tabIndex == index?'towcontentlistxitemboxopacity':''"
+ v-for="(item,index) in tabList" :key="index" @click="towcontentclick(index,item)">
{{item.name}}
-
@@ -74,27 +74,27 @@
export default {
data() {
return {
- listbox: [{
+ tabList: [{
name: '全部',
type: ''
},
{
name: '未使用',
- type: '0'
+ type: '1'
},
{
name: '已使用',
- type: '1'
+ type: '2'
}
],
- towcontentclickindex: 0,
+ tabIndex: 0,
list: [],
status: "",
};
},
onLoad() {
- this.ordermineCouponsthis()
+ this.getCouponList()
},
methods: {
@@ -105,15 +105,15 @@
* @param {Object} item
*/
towcontentclick(index, item) {
- this.towcontentclickindex = index;
+ this.tabIndex = index;
this.status = item.type;
- this.ordermineCouponsthis()
+ this.getCouponList()
},
/**
* 获取优惠券数据
*/
- async ordermineCouponsthis() {
+ async getCouponList() {
try {
let res = await this.api.getUserConpons({
userId: uni.cache.get('userInfo').id,
diff --git a/pagesOrder/components/orderInfoAfter.vue b/pagesOrder/components/orderInfoAfter.vue
index c656ffe..bae1e76 100644
--- a/pagesOrder/components/orderInfoAfter.vue
+++ b/pagesOrder/components/orderInfoAfter.vue
@@ -81,7 +81,7 @@
备注:
- {{ listinfo.orderInfo.remark}}
+ {{ listinfo.orderInfo.remark||""}}
就餐人数:
diff --git a/pagesOrder/components/orderInfoPoints.vue b/pagesOrder/components/orderInfoPoints.vue
new file mode 100644
index 0000000..d99a700
--- /dev/null
+++ b/pagesOrder/components/orderInfoPoints.vue
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+ 自提凭证
+
+
+
+
+ 提货码:241578956432
+
+
+
+
+
+
+
+
+
+
+
+
+ 自取店:{{ listinfo.name }}
+
+ 15303589754
+
+
+ 门店地址:
+ 门店地址门店地址门店地址门店地址门店地址门店地址门店地址门店地址
+
+
+
+
+
+
+
+
+ DIMO联名马克杯
+ 100积分X1
+
+
+
+
+
+ 支付方式:
+ {{listinfo.name}}
+
+
+ 兑换时间:
+ {{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}
+
+
+ 订单编号:
+ {{listinfo.orderNo}}(点击复制)
+
+
+
+
+
+
+
+
+
diff --git a/pagesOrder/components/paymentMethod.vue b/pagesOrder/components/paymentMethod.vue
index ca35a7a..d69cd2d 100644
--- a/pagesOrder/components/paymentMethod.vue
+++ b/pagesOrder/components/paymentMethod.vue
@@ -92,6 +92,7 @@
.paymentMethod{
box-sizing: border-box;
margin-top: 30rpx;
+ padding: 0 20rpx 220rpx 20rpx;
border-radius: 18rpx;
.paymentMethod_content{
background-color: #fff;
diff --git a/pagesOrder/components/rechargeFree.vue b/pagesOrder/components/rechargeFree.vue
new file mode 100644
index 0000000..2671dfc
--- /dev/null
+++ b/pagesOrder/components/rechargeFree.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+ 优惠
+ 充值消费2倍(¥50),本单立享免单!
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pagesOrder/components/topUpActivity.vue b/pagesOrder/components/topUpActivity.vue
new file mode 100644
index 0000000..dc7a6b1
--- /dev/null
+++ b/pagesOrder/components/topUpActivity.vue
@@ -0,0 +1,142 @@
+
+
+
+
+ 充值更划算
+
+
+ 首充优惠
+ {{ item.amount }}元
+ 赠{{ item.giftAmount }}元50积分
+ 赠送2张优惠券
+
+
+
+
+
+
+
+
+
diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue
index c903705..0d802f6 100644
--- a/pagesOrder/confirm_order/index.vue
+++ b/pagesOrder/confirm_order/index.vue
@@ -1,11 +1,5 @@
-
-
-
-
-
-
@@ -83,13 +77,20 @@
{{(shopTableInfo.seatNum*storeInfo.tableFee).toFixed(2)}}
-
+
+ 使用29积分抵扣¥29.00
+
+
+
+
+
+ 暂无可用优惠券
+
小计¥
{{listinfo.payAmount}}
@@ -105,38 +106,13 @@
+
+
+
+
-
-
-
实付金额
@@ -173,10 +149,11 @@