From 0b4b3136aa9c14c87fcc0e08d31f024b9ce2400a Mon Sep 17 00:00:00 2001 From: gukai15D <1522776404@qq.com> Date: Tue, 25 Jun 2024 12:06:34 +0800 Subject: [PATCH 1/8] 1 --- yarn.lock | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 yarn.lock diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + -- 2.39.2 From abeedca86c74cbdf3695eedf7df1db89943b8f72 Mon Sep 17 00:00:00 2001 From: gukai <1522776404@qq.com> Date: Thu, 27 Jun 2024 20:41:52 +0800 Subject: [PATCH 2/8] 1 --- pages.json | 12 +++++++ pages/card/index.vue | 78 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 pages/card/index.vue diff --git a/pages.json b/pages.json index 93089ca..fde07bf 100644 --- a/pages.json +++ b/pages.json @@ -12,6 +12,18 @@ } } }, + { + "path": "pages/card/index", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "会员卡", + "enablePullDownRefresh": true, + "mp-alipay": { + "transparentTitle": "always", + "titlePenetrate": "YES" + } + } + }, { "path": "pages/my/my", "style": { diff --git a/pages/card/index.vue b/pages/card/index.vue new file mode 100644 index 0000000..e63c3ad --- /dev/null +++ b/pages/card/index.vue @@ -0,0 +1,78 @@ + + + + + \ No newline at end of file -- 2.39.2 From 639a45ab29e9dc9b5d20dba4b10c91d153c3575a Mon Sep 17 00:00:00 2001 From: gukai <1522776404@qq.com> Date: Sun, 30 Jun 2024 18:42:19 +0800 Subject: [PATCH 3/8] 1 --- api/modules/common.js | 9 +++ api/modules/user.js | 18 ++++- components/login/logins.vue | 2 +- pages.json | 12 ++++ pages/card/index.vue | 82 +++++++++++------------ pages/card/loading.vue | 65 ++++++++++++++++++ pages/index/index.vue | 31 +++------ subPackages/inPersonToPay/index/index.vue | 14 ++++ 8 files changed, 167 insertions(+), 66 deletions(-) create mode 100644 pages/card/loading.vue diff --git a/api/modules/common.js b/api/modules/common.js index 3faebb0..630cebd 100644 --- a/api/modules/common.js +++ b/api/modules/common.js @@ -178,4 +178,13 @@ export default { needLogin: true, }); }, + + getAliCard(data = {}) { + return request({ + url: "/common/getAliCard", + method: "POST", + data, + needLogin: true, + }); + }, }; \ No newline at end of file diff --git a/api/modules/user.js b/api/modules/user.js index 222b222..49ab90e 100644 --- a/api/modules/user.js +++ b/api/modules/user.js @@ -174,5 +174,21 @@ export default { data, needLogin: true, }); - } + }, + openAliCard(data = {}) { + return request({ + url: "/user/openAliCard", + method: "POST", + data, + needLogin: true, + }); + }, + creatCard(data = {}) { + return request({ + url: "/user/creatCard", + method: "POST", + data, + needLogin: true, + }); + }, }; \ No newline at end of file diff --git a/components/login/logins.vue b/components/login/logins.vue index 5d6d8fe..9871a50 100644 --- a/components/login/logins.vue +++ b/components/login/logins.vue @@ -187,7 +187,7 @@ backPage() { if (this.type == 0) { - + this.$emit('isLogin') } else if (this.type != 2) { setTimeout(() => { const backPage = uni.getStorageSync("backPage") diff --git a/pages.json b/pages.json index fde07bf..1d66cd4 100644 --- a/pages.json +++ b/pages.json @@ -24,6 +24,18 @@ } } }, + { + "path": "pages/card/loading", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "会员卡", + "enablePullDownRefresh": true, + "mp-alipay": { + "transparentTitle": "always", + "titlePenetrate": "YES" + } + } + }, { "path": "pages/my/my", "style": { diff --git a/pages/card/index.vue b/pages/card/index.vue index e63c3ad..e295f48 100644 --- a/pages/card/index.vue +++ b/pages/card/index.vue @@ -1,11 +1,13 @@ - - - - + @@ -108,7 +105,8 @@ payCurrent: false, coupon: [], activeCoupon: {}, - mch_id: 0 + mch_id: 0, + wcCode: -1 } }, computed: { @@ -122,43 +120,26 @@ } }, async onLoad(query) { - - if (!this.$utils.isInAliBrowser()) { - return uni.showModal({ - title: '提示', - content: '请使用支付宝扫码', - showCancel: false - }) + if (query.wxcode) { + this.wcCode = query.wxcode + query.mch_id = uni.getStorageSync('pay_mch_id') + } else { + if (query.state) { + return uni.showModal({ + title: '提示', + content: '登录失败' + }) + } + this.wcCode = '' + if (query.mch_id > 0) { + uni.setStorageSync('pay_mch_id', query.mch_id) + } } - let qrCode = ''; - - // #ifdef MP-ALIPAY - let qrQuery = '' - if (query.query && query.query.qrCode) { - qrQuery = query.query.qrCode; // 存储二维码码 - } else { - qrQuery = uni.getStorageSync('qrcode') - } - qrCode = decodeURIComponent(qrQuery || ''); // 适用于支付宝小程序 - // #endif - - // #ifdef MP-WEIXIN - qrCode = decodeURIComponent(query.q || ''); - // #endif - - // #ifdef MP - const params = this.$utils.oneValues(qrCode) - // #endif - - // #ifdef H5 - const params = query - // #endif - + const params = query const { mch_id } = params; - this.mch_id = mch_id || 0 this.$nextTick(() => { this.init() @@ -256,11 +237,11 @@ break; case 2: - return uni.showModal({ - title: '提示', - content: '请使用支付宝扫码', - showCancel: false - }) + // return uni.showModal({ + // title: '提示', + // content: '请使用支付宝扫码', + // showCancel: false + // }) // #ifndef MP await this.wechatPayNow({ payType, @@ -286,9 +267,7 @@ order_no, order_type }) - break; - default: break; } diff --git a/subPackages/login/login/index.vue b/subPackages/login/login/index.vue index f90df75..315f97f 100644 --- a/subPackages/login/login/index.vue +++ b/subPackages/login/login/index.vue @@ -15,9 +15,16 @@ export default { wcCode: undefined }; }, - onLoad({ wxcode } = {}) { + onLoad({ wxcode, state } = {}) { if (wxcode) { this.wcCode = wxcode + } else { + if (state) { + return uni.showModal({ + title: '提示', + content: '登录失败' + }) + } } }, methods: {}, -- 2.39.2 From d87ceeb7c27486cd1d83c3f21d09106d455315af Mon Sep 17 00:00:00 2001 From: gukai <1522776404@qq.com> Date: Wed, 10 Jul 2024 09:33:12 +0800 Subject: [PATCH 5/8] 1 --- manifest.json | 2 +- subPackages/inPersonToPay/index/index.vue | 18 ++++++++---------- subPackages/inPersonToPay/result/index.vue | 22 +++++++++++++++++++++- utils/wxConfig.js | 5 +++-- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/manifest.json b/manifest.json index a5dddec..c184945 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "佰因商城", + "name" : "门店收银", "appid" : "__UNI__730E59B", "description" : "", "versionName" : "1.0.0", diff --git a/subPackages/inPersonToPay/index/index.vue b/subPackages/inPersonToPay/index/index.vue index 5963d8e..af1d35f 100644 --- a/subPackages/inPersonToPay/index/index.vue +++ b/subPackages/inPersonToPay/index/index.vue @@ -237,11 +237,6 @@ break; case 2: - // return uni.showModal({ - // title: '提示', - // content: '请使用支付宝扫码', - // showCancel: false - // }) // #ifndef MP await this.wechatPayNow({ payType, @@ -316,6 +311,7 @@ if (res.data == -1) { return this.successSubmit(); } + let that = this wxConfig.init(["chooseWXPay"]).then(wx => { wx.chooseWXPay({ // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。 @@ -326,20 +322,22 @@ signType: res.data.signType, // 签名算法 paySign: res.data.paySign, // 签名 success: function(res) { + console.log(res, 'success') if (res.err_msg == "get_brand_wcpay_request:ok" || res.err_Info == "success" || res.errMsg == "chooseWXPay:ok") { - this.successSubmit(); + that.successSubmit(); } else { - this.failSubmit(); + that.failSubmit(); } }, complete: function(err) { + console.log(res, 'complete') if (res.err_msg == "get_brand_wcpay_request:ok" || res.err_Info == "success" || res.errMsg == "chooseWXPay:ok" || res.errMsg == "getBrandWCPayRequest:ok") { - this.successSubmit(); + that.successSubmit(); } else { - this.failSubmit(); + that.failSubmit(); } }, }) @@ -473,7 +471,7 @@ setTimeout(() => { this.toUrl('/subPackages/inPersonToPay/result/index?price=' + this.total_price + '&mch_id=' + - this.mch_id) + this.mch_id, 'reLaunch') uni.removeStorageSync("支付" + this.mch_id) this.total_price = "" this.payCurrent = false diff --git a/subPackages/inPersonToPay/result/index.vue b/subPackages/inPersonToPay/result/index.vue index 5a1a84f..1fa87a6 100644 --- a/subPackages/inPersonToPay/result/index.vue +++ b/subPackages/inPersonToPay/result/index.vue @@ -1,5 +1,5 @@ + + + + \ No newline at end of file diff --git a/pages/takeaway/compontents/page-info.vue b/pages/takeaway/compontents/page-info.vue new file mode 100644 index 0000000..692b9d0 --- /dev/null +++ b/pages/takeaway/compontents/page-info.vue @@ -0,0 +1,279 @@ + + + + \ No newline at end of file diff --git a/pages/takeaway/compontents/page-sku.vue b/pages/takeaway/compontents/page-sku.vue new file mode 100644 index 0000000..b509d61 --- /dev/null +++ b/pages/takeaway/compontents/page-sku.vue @@ -0,0 +1,547 @@ + + + + + + + \ No newline at end of file diff --git a/pages/takeaway/compontents/smallMaterial.vue b/pages/takeaway/compontents/smallMaterial.vue new file mode 100644 index 0000000..5a98a0c --- /dev/null +++ b/pages/takeaway/compontents/smallMaterial.vue @@ -0,0 +1,244 @@ + + + + + \ No newline at end of file diff --git a/pages/takeaway/index.vue b/pages/takeaway/index.vue new file mode 100644 index 0000000..7d8af7a --- /dev/null +++ b/pages/takeaway/index.vue @@ -0,0 +1,486 @@ + + + + \ No newline at end of file diff --git a/pages/takeaway/orderAndSettlement/edit.vue b/pages/takeaway/orderAndSettlement/edit.vue new file mode 100644 index 0000000..b83b4bb --- /dev/null +++ b/pages/takeaway/orderAndSettlement/edit.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/pages/takeaway/orderAndSettlement/index.vue b/pages/takeaway/orderAndSettlement/index.vue new file mode 100644 index 0000000..6e7f699 --- /dev/null +++ b/pages/takeaway/orderAndSettlement/index.vue @@ -0,0 +1,734 @@ + + + + + \ No newline at end of file diff --git a/subPackages/inPersonToPay/index/index.vue b/subPackages/inPersonToPay/index/index.vue index af1d35f..0f713df 100644 --- a/subPackages/inPersonToPay/index/index.vue +++ b/subPackages/inPersonToPay/index/index.vue @@ -8,18 +8,21 @@ - + {{ info.name }} - + - + - + + {{ total_price }} + + @@ -34,30 +37,11 @@ - - - - 微信 - - - - - - - - - 支付宝 - - - - - - - 微信 + 微信支付 @@ -65,7 +49,7 @@ - 支付宝 + 支付宝支付 @@ -73,7 +57,16 @@ - + + + + + @@ -82,6 +75,7 @@ import coupons from '../compontents/coupons.vue'; import logins from '@/components/login/logins.vue' + import keyword from '@/components/the/keyword.vue' // #ifndef MP import wxConfig from '@/utils/wxConfig' @@ -91,7 +85,8 @@ components: { coupons, isPhone, - logins + logins, + keyword }, data() { return { @@ -183,24 +178,29 @@ } this.coupon = res.data.coupon }, + valueChange(e) { + this.total_price += ('' + e) + this.formatInput() + }, + valueBackspace() { + let value = this.total_price.toString() + value = value.slice(0, -1) + this.total_price = value + }, formatInput() { if (this.total_price !== null) { - let value = this.total_price.toString(); - value = value.replace(/[^\d.]/g, ""); // 去掉非数字和小数点 - value = value.replace(/^\./g, ""); // 去掉开头的小数点 - value = value.replace(/\.{2,}/g, "."); // 去掉多余的小数点 - value = value.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); - // 将第一个小数点替换成分隔符 - value = parseFloat(value); - if (isNaN(value)) { - value = null; - } else { - value = value.toFixed(2); // 保留两位小数 + let value = this.total_price + let value_arr = value.toString().split('.') + if (value_arr.length > 1) { + var len = value_arr.pop().length; + if (len > 2) { + value = parseFloat(value); + value = value.toFixed(2); // 保留两位小数 + } } this.total_price = value; } }, - async pay(type) { if (this.submit()) return this.payCurrent = true @@ -496,6 +496,15 @@ \ No newline at end of file diff --git a/pages/takeaway/index - 副本.vue b/pages/takeaway/index - 副本.vue new file mode 100644 index 0000000..9f6a00d --- /dev/null +++ b/pages/takeaway/index - 副本.vue @@ -0,0 +1,777 @@ + + + + \ No newline at end of file diff --git a/pages/takeaway/index.vue b/pages/takeaway/index.vue index e1547fb..3002273 100644 --- a/pages/takeaway/index.vue +++ b/pages/takeaway/index.vue @@ -1,185 +1,234 @@