From 85ceb8605882913454b2427010111b57c7633be6 Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Sun, 14 Dec 2025 12:18:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(index):=20=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E6=AC=A1=E6=B6=88=E8=B4=B9=E9=80=89=E9=A1=B9=E5=92=8C=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增单次消费档位选择弹窗及支付功能 移除未使用的组件和配置文件 --- pages/common/common.wxss | 0 pages/goodsDetails/kefuBox/kefuBox.js | 7 - pages/goodsDetails/kefuBox/kefuBox.json | 4 - pages/goodsDetails/kefuBox/kefuBox.wxml | 37 ---- pages/goodsDetails/kefuBox/kefuBox.wxss | 189 ------------------ pages/goodsDetails/matchWrap/matchWrap.js | 5 - pages/goodsDetails/matchWrap/matchWrap.json | 4 - pages/goodsDetails/matchWrap/matchWrap.wxml | 34 ---- pages/goodsDetails/matchWrap/matchWrap.wxss | 171 ---------------- pages/index/index.js | 113 +++++++++-- pages/index/index.wxml | 14 +- pages/orderPaySuccess/matchList/matchList.js | 5 - .../orderPaySuccess/matchList/matchList.json | 4 - .../orderPaySuccess/matchList/matchList.wxml | 23 --- .../orderPaySuccess/matchList/matchList.wxss | 137 ------------- project.private.config.json | 71 ------- 16 files changed, 109 insertions(+), 709 deletions(-) delete mode 100644 pages/common/common.wxss delete mode 100644 pages/goodsDetails/kefuBox/kefuBox.js delete mode 100644 pages/goodsDetails/kefuBox/kefuBox.json delete mode 100644 pages/goodsDetails/kefuBox/kefuBox.wxml delete mode 100644 pages/goodsDetails/kefuBox/kefuBox.wxss delete mode 100644 pages/goodsDetails/matchWrap/matchWrap.js delete mode 100644 pages/goodsDetails/matchWrap/matchWrap.json delete mode 100644 pages/goodsDetails/matchWrap/matchWrap.wxml delete mode 100644 pages/goodsDetails/matchWrap/matchWrap.wxss delete mode 100644 pages/orderPaySuccess/matchList/matchList.js delete mode 100644 pages/orderPaySuccess/matchList/matchList.json delete mode 100644 pages/orderPaySuccess/matchList/matchList.wxml delete mode 100644 pages/orderPaySuccess/matchList/matchList.wxss delete mode 100644 project.private.config.json diff --git a/pages/common/common.wxss b/pages/common/common.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/pages/goodsDetails/kefuBox/kefuBox.js b/pages/goodsDetails/kefuBox/kefuBox.js deleted file mode 100644 index d544c30..0000000 --- a/pages/goodsDetails/kefuBox/kefuBox.js +++ /dev/null @@ -1,7 +0,0 @@ -Component({ - properties: {}, - data: { - showDialog: !1 - }, - methods: {} -}); \ No newline at end of file diff --git a/pages/goodsDetails/kefuBox/kefuBox.json b/pages/goodsDetails/kefuBox/kefuBox.json deleted file mode 100644 index 7e37c03..0000000 --- a/pages/goodsDetails/kefuBox/kefuBox.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/goodsDetails/kefuBox/kefuBox.wxml b/pages/goodsDetails/kefuBox/kefuBox.wxml deleted file mode 100644 index 392c918..0000000 --- a/pages/goodsDetails/kefuBox/kefuBox.wxml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 霸王餐福利 - 加客服进「声色福利群」 - - - 点我添加 - - - - - - - - - - - 购买须知 - - - - 此券属平台与商家补贴,一经售出无法退款,请确认后再下单。 - - - - - - - - - - diff --git a/pages/goodsDetails/kefuBox/kefuBox.wxss b/pages/goodsDetails/kefuBox/kefuBox.wxss deleted file mode 100644 index d90d54f..0000000 --- a/pages/goodsDetails/kefuBox/kefuBox.wxss +++ /dev/null @@ -1,189 +0,0 @@ -.keufubox:last-child { - margin-bottom: -5.333vw; -} - -.kebox { - border-radius: 1.6vw; - width: 92vw; -} - -.kebox,.mykefu { - background: #fff; -} - -.mykefu { - -webkit-box-pack: justify; - -ms-flex-pack: justify; - height: 17.067vw; - justify-content: space-between; -} - -.mykefu .le { - -webkit-box-flex: 1; - flex: 1; -} - -.mykefu,.mykefu .le { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; -} - -.mykefu .le image { - border-radius: 50%; - height: 9.6vw; - margin-right: 3.467vw; - max-width: 100%; - width: 9.6vw; -} - -.mykefu .le .box { - width: 57.333vw; -} - -.mykefu .le .title { - color: #2a2a2a; - font-size: 3.733vw; -} - -.mykefu .le .desc,.mykefu .le .title { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.mykefu .le .desc { - color: #969696; - font-size: 3.2vw; - line-height: 4.133vw; - width: 57.333vw; -} - -.kebox .btn { - border-radius: 6.667vw; - color: #fff; - font-size: 3.2vw; - height: 8.667vw; - line-height: 8.667vw; - position: relative; - text-align: center; -} - -.mykefu .btn { - background: #28c418; - font-size: 3.2vw; - width: 18.267vw; -} - -.modal-dialog { - position: fixed; - z-index: 20; -} - -.modal-dialog,.modal-dialog .modal { - height: 100%; - left: 0; - top: 0; - width: 100%; -} - -.modal-dialog .modal { - background: rgba(0,0,0,.5); - position: absolute; - transition: all .3s; -} - -.infopop-wrap { - left: 50%; - position: absolute; - top: 45%; - transform: translate(-50%,-50%); -} - -.infopop-content { - background-color: #fff; - border-radius: 2.133vw; - color: #666; - font-size: 4vw; - line-height: 5.333vw; - overflow: hidden; - padding-bottom: 6.667vw; - text-align: center; - width: 69.867vw; -} - -.info-buy_notice .top { - color: #fff; - height: 21.867vw; - margin-bottom: 3.467vw; - overflow: hidden; - position: relative; -} - -.info-buy_notice ._top { - background: #06a2b3; - border-radius: 0 0 50% 50%; - height: 100%; - left: 50%; - margin-bottom: 4vw; - position: absolute; - top: 0; - transform: translateX(-50%); - width: 120%; -} - -.info-buy_notice .top .title { - color: #fff; - font-size: 4.8vw; - left: 0; - position: absolute; - text-align: center; - top: 50%; - transform: translateY(-50%); - width: 100%; -} - -.info-buy_notice .txt { - font-size: 3.733vw; - line-height: 5.333vw; - padding: 0 4vw; - text-align: left; -} - -.info-buy_notice .btn { - background-color: #06a2b3; - border-radius: 10.667vw; - color: #fff; - font-size: 4vw; - height: 10.667vw; - line-height: 10.667vw; - margin-bottom: -2.133vw; - margin-top: 5.333vw; - text-align: center; - width: 34.667vw; -} - -.infopop-close { - background-color: #fff; - border-radius: 50%; - color: rgba(0,0,0,.6); - font-size: 8.267vw; - height: 8.533vw; - left: 50%; - line-height: 8.033vw; - margin: 4.267vw 0 0 -4.267vw; - padding: 0; - position: absolute; - text-align: center; - top: 100%; - width: 8.533vw; -} - -.info-buy_notice .btn::after,.info-buy_notice .btn::before { - background: transparent; - border: none; -} \ No newline at end of file diff --git a/pages/goodsDetails/matchWrap/matchWrap.js b/pages/goodsDetails/matchWrap/matchWrap.js deleted file mode 100644 index a85704f..0000000 --- a/pages/goodsDetails/matchWrap/matchWrap.js +++ /dev/null @@ -1,5 +0,0 @@ -Component({ - properties: {}, - data: {}, - methods: {} -}); \ No newline at end of file diff --git a/pages/goodsDetails/matchWrap/matchWrap.json b/pages/goodsDetails/matchWrap/matchWrap.json deleted file mode 100644 index 7e37c03..0000000 --- a/pages/goodsDetails/matchWrap/matchWrap.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/goodsDetails/matchWrap/matchWrap.wxml b/pages/goodsDetails/matchWrap/matchWrap.wxml deleted file mode 100644 index 2b3e41c..0000000 --- a/pages/goodsDetails/matchWrap/matchWrap.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 为您搭配更优惠 - - - - - - - - 【新会】椰子鸡再次返场!9.9元起抢「骨汁恋·星汇店」100元代金券! - - - - - ¥ - 9. - 90 - - - ¥100.00 - - - - 立即抢购 - - - - - - - diff --git a/pages/goodsDetails/matchWrap/matchWrap.wxss b/pages/goodsDetails/matchWrap/matchWrap.wxss deleted file mode 100644 index 5274675..0000000 --- a/pages/goodsDetails/matchWrap/matchWrap.wxss +++ /dev/null @@ -1,171 +0,0 @@ -.match-wrap { - border-top: 2.667vw solid #f8f8f8; -} - -.goods-match { - background-color: #fff; - border-radius: 2.133vw; - display: block; - padding: 12vw 3.6vw 3.6vw; - position: relative; -} - -.goods-match .til { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - background-color: #06a2b3; - border-radius: .533vw 2.933vw 2.933vw .533vw; - color: #fff; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - font-size: 3.2vw; - height: 5.867vw; - left: -.267vw; - padding-left: 1.467vw; - position: absolute; - top: 2.667vw; - width: 33.333vw; -} - -.goods-match .til view { - margin-right: 1.333vw; -} - -.goods-match .item { - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; -} - -.goods-match .hd { - -webkit-box-flex: 25.333vw; - border-radius: 1.6vw; - flex: 25.333vw 0 0; - height: 25.333vw; - overflow: hidden; - width: 25.333vw; -} - -.image-box.__100 { - padding-top: 100%; -} - -.image-box { - background-color: #ebebeb; - height: 0; - overflow: hidden; - position: relative; -} - -.image-box image { - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - -.goods-match .bd { - -webkit-box-flex: 1; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex: 1; - flex-direction: column; - justify-content: space-between; - padding: 0 0 0 2.667vw; -} - -.goods-match .bd_name { - -webkit-box-orient: vertical; - -webkit-line-clamp: 3; - color: #2a2a2a; - display: -webkit-box; - font-size: 3.733vw; - height: 16vw; - line-height: 5.333vw; - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; -} - -.goods-match .bd ._btm { - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; -} - -.goods-match .bd ._btm_lt { - -webkit-box-flex: 1; - flex: 1; -} - -.goods-match .bd_price { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; -} - -.now-price { - color: #eb5252; - font-family: DIN; - font-size: 3.2vw; - line-height: 1.75em; -} - -.goods-match .bd_price .old { - color: #9b9b9b; - font-family: DIN; - font-size: 3.2vw; - margin-left: 1.333vw; - text-decoration: line-through; -} - -.goods-match .bd_btn { - background-color: #06a2b3; - border-radius: 3.333vw; - color: #fff; - font-size: 3.2vw; - height: 6.667vw; - line-height: 6.667vw; - padding: 0 3.6vw; - text-align: center; -} - -.now-price .symbol { - display: inline; - margin: 0 .267vw 0 0; -} - -.now-price.__normal .buck { - display: inline; - font-size: 4.8vw; -} - -.cent { - display: inline; -} - -.hot { - display: inline-block; - height: 13px; - margin-right: 4px; - width: 13px; -} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 4eccdbd..ad3da20 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -16,7 +16,10 @@ Page({ tabStatus: { coupon: !1, shop: !1 - } + }, + showOneTimeOptions: !1, + oneTimeOptions: [], + oneTimeLoading: !1 }, bindViewTap: function () { wx.navigateTo({ @@ -184,24 +187,100 @@ Page({ e.globalData.needJumpUrl = !1, this.isneedUpload = !0; var t = this; if (console.log("this.isSubmit", this.isSubmit), this.isSubmit) return !1; - if (t.data.user.money <= 0) return t.startup(), !1; - if (t.data.user.money < 10) { - if (this.isshowModal) return t.startup(), !1; - this.isshowModal = !0, wx.showModal({ + wx.showActionSheet({ + itemList: ["单次消费", "立即启动"], + success: function (res) { + if (res.tapIndex === 0) { + t.openOneTimeOptions(); + } else { + if (t.data.user.money == 0) { + wx.showModal({ + title: "提示", + content: "您的洗车金额为0元,是否需要购买洗车金额?", + confirmText: "去购买", + cancelText: "取消", + success: function (m) { + if (m.confirm) { + wx.navigateTo({ + url: "/pages/voucher/voucher" + }), t.isneedUpload = !0; + } + } + }); + return; + } + else if (t.data.user.money < 10) { + wx.showModal({ + title: "提示", + content: "洗车金额不足10元,是否需要购买洗车金额还是直接开机?", + confirmText: "去购买", + cancelText: "直接开机", + success: function (m) { + if (m.confirm) { + wx.navigateTo({ + url: "/pages/voucher/voucher" + }), t.isneedUpload = !0; + } else { + t.startup(); + } + } + }); + return; + } + t.startup(); + } + } + }); + }, + openOneTimeOptions: function () { + var a = this; + if (a.data.oneTimeLoading) return !1; + a.setData({ oneTimeLoading: !0 }); + t.request('/v2/miniprogram/recharge/once', e.globalData.deviceData || {}, !0).then(function (res) { + a.setData({ + oneTimeOptions: res.data && res.data.list ? res.data.list : (res.data || []), + showOneTimeOptions: !0, + oneTimeLoading: !1 + }); + }).catch(function () { + a.setData({ oneTimeLoading: !1 }); + }); + }, + closeOneTimeOptions: function () { + this.setData({ showOneTimeOptions: !1 }); + }, + payOneTime: function (evt) { + var a = this, i = evt.currentTarget.dataset.id; + if (!i) return !1; + wx.showLoading({ title: "" }); + t.request('/v2/miniprogram/recharge/once/create', { + id: i, + devicecode: e.globalData.devicecode + }, !0).then(function (res) { + if (wx.hideLoading(), 200 != res.code) return wx.showModal({ title: "提示", - content: "账户余额小于10元,是否立即购买洗车金额?", - confirmText: "去购买", - cancelText: "立即启动", - success: function (e) { - e.confirm ? (wx.navigateTo({ - url: "/pages/voucher/voucher" - }), t.isneedUpload = !0) : t.startup(); - }, - fail: function (e) { - console.log("fail:", e); + content: res.message || "" + }), !1; + var r = res.data.result; + wx.requestPayment({ + timeStamp: r.timeStamp, + nonceStr: r.nonceStr, + package: r.package, + signType: r.signType, + paySign: r.paySign, + success: function () { + a.setData({ showOneTimeOptions: !1 }); + wx.showModal({ + title: "提示", + content: "限单次洗车" + }); + a.getData(); + a.startup(); } }); - } else t.startup(); + }).catch(function () { + wx.hideLoading(); + }); }, startup: function () { var a = this; @@ -242,4 +321,4 @@ Page({ }); }, onShareAppMessage: function () { } -}); \ No newline at end of file +}); diff --git a/pages/index/index.wxml b/pages/index/index.wxml index ad37654..1cbf23e 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -24,4 +24,16 @@ 立即启动 - \ No newline at end of file + + + 选择单次消费档位 + 限单次洗车 + + + 支付{{item.paymentamount}}元 后到账{{item.arrivalamount}}元洗车金 + + + 取消 + + + diff --git a/pages/orderPaySuccess/matchList/matchList.js b/pages/orderPaySuccess/matchList/matchList.js deleted file mode 100644 index a85704f..0000000 --- a/pages/orderPaySuccess/matchList/matchList.js +++ /dev/null @@ -1,5 +0,0 @@ -Component({ - properties: {}, - data: {}, - methods: {} -}); \ No newline at end of file diff --git a/pages/orderPaySuccess/matchList/matchList.json b/pages/orderPaySuccess/matchList/matchList.json deleted file mode 100644 index 7e37c03..0000000 --- a/pages/orderPaySuccess/matchList/matchList.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/orderPaySuccess/matchList/matchList.wxml b/pages/orderPaySuccess/matchList/matchList.wxml deleted file mode 100644 index 145afe0..0000000 --- a/pages/orderPaySuccess/matchList/matchList.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - 搭配更优惠 - - - - - - - - 【新会】椰子鸡再次返场!9.9元起抢「骨汁恋·星汇店」100元代金券! - - - - ¥9.90 - ¥100.00 - - 立即抢购 - - - - - diff --git a/pages/orderPaySuccess/matchList/matchList.wxss b/pages/orderPaySuccess/matchList/matchList.wxss deleted file mode 100644 index 85a80ee..0000000 --- a/pages/orderPaySuccess/matchList/matchList.wxss +++ /dev/null @@ -1,137 +0,0 @@ -.info-wrap { - background-color: #fff; - border-top: 3.2vw solid #f8f8f8; - padding: 0 4vw 5.333vw; -} - -.module-title { - color: #2a2a2a; - font-size: 4.267vw; - font-weight: 700; - line-height: 1; - margin: 5.333vw 0 8.533vw; - text-align: center; -} - -.module-title .tit { - display: inline-block; - position: relative; - vertical-align: top; -} - -.module-title .line { - background-color: #06a2b3; - border-radius: .8vw; - height: .8vw; - left: 35%; - margin-top: 2.133vw; - position: absolute; - top: 100%; - width: 30%; -} - -.tuijian-goods { - border-radius: 1.6vw; - box-shadow: 0 1.067vw 2.667vw 0 rgba(0,0,0,.08); - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - padding: 3.6vw; -} - -.tuijian-goods .lt { - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.tuijian-goods .lt image { - display: block; - height: 26vw; - width: 26vw; -} - -.tuijian-goods .tuijian-rt { - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - -webkit-box-flex: 1; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex: 1; - flex-direction: column; - justify-content: space-between; - margin-left: 3.2vw; -} - -.tuijian-goods .vip-price { - width: max-content; -} - -.tuijian-goods .goods-name { - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - color: #2a2a2a; - display: -webkit-box; - font-size: 3.733vw; - font-weight: 500; - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; -} - -.tuijian-goods .goods-info .price { - -webkit-box-align: center; - -ms-flex-align: center; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - justify-content: space-between; -} - -.tuijian-goods .goods-info .now-price { - color: #eb5252; - font-size: 3.467vw; - font-weight: 500; - margin-right: 3.2vw; -} - -.tuijian-goods .goods-info .old-price { - color: #9b9b9b; - font-size: 3.2vw; - text-decoration: line-through; -} - -.tuijian-goods .goods-info .btn { - -ms-flex-negative: 0; - background-color: #06a2b3; - border-radius: .933vw; - color: #fff; - flex-shrink: 0; - font-size: 3.2vw; - height: 6.667vw; - line-height: 6.667vw; - text-align: center; - width: 18.667vw; -} - -.vip-price { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - background-color: #2a2a2a; - border-radius: .8vw; - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - font-size: 2.933vw; - margin-right: 2.667vw; -} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json deleted file mode 100644 index 1ae9d49..0000000 --- a/project.private.config.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "JMApp", - "setting": { - "compileHotReLoad": true, - "urlCheck": false - }, - "condition": { - "miniprogram": { - "list": [ - { - "name": "pages/substituteWash/substituteWash", - "pathName": "pages/substituteWash/substituteWash", - "query": "scene=T1000098", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/substituteWash/substituteWash", - "pathName": "pages/substituteWash/substituteWash", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/washing/washing", - "pathName": "pages/washing/washing", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/washCodeDetail/washCodeDetail", - "pathName": "pages/washCodeDetail/washCodeDetail", - "query": "id=6", - "launchMode": "default", - "scene": null - }, - { - "name": "/pages/washCodeDetail/washCodeDetail", - "pathName": "/pages/washCodeDetail/washCodeDetail", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/refund/refund", - "pathName": "pages/refund/refund", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/OnlineCarHailing/OnlineCarHailing", - "pathName": "pages/OnlineCarHailing/OnlineCarHailing", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/wangdian/wangdian", - "pathName": "pages/wangdian/wangdian", - "query": "number=T1000126", - "launchMode": "default", - "scene": null - } - ] - } - }, - "libVersion": "3.8.9" -} \ No newline at end of file