From 747ee9226fbc81c51b09fbddd42762c6a8bf96fa Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=AE=A2=E6=9C=8D=E5=8A=9F=E8=83=BD=20=E6=8B=A8?= =?UTF-8?q?=E6=89=93=E7=94=B5=E8=AF=9D=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=E8=B0=83=E7=94=A8=E5=BE=AE=E4=BF=A1=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=9A=84=E6=8B=A8=E6=89=93=E7=94=B5=E8=AF=9D=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BB=8E=E5=90=8E=E5=8F=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E7=9A=84=E7=94=B5=E8=AF=9D=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- pages/index/index.vue | 2 +- pages/main/index.vue | 19 ++++++++++++++----- pages/order/refund.vue | 26 ++++++++++++++------------ utils/index.js | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 18 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 3ccef19..3d28e27 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -29,7 +29,7 @@ - + diff --git a/pages/main/index.vue b/pages/main/index.vue index d7a764c..67af311 100644 --- a/pages/main/index.vue +++ b/pages/main/index.vue @@ -30,7 +30,7 @@ 地图 - + 客服 @@ -48,6 +48,9 @@ @@ -74,9 +83,9 @@ margin-top: 89rpx; border: 12rpx solid #fff; } + .setItemBox { width: 72rpx; height: 72rpx; } - \ No newline at end of file diff --git a/pages/order/refund.vue b/pages/order/refund.vue index ba417b4..5c3d649 100644 --- a/pages/order/refund.vue +++ b/pages/order/refund.vue @@ -111,7 +111,7 @@ - + 联系客服 Number(this.fullPrice)) { this.requestRefund_price = Number(this.fullPrice) @@ -181,11 +183,11 @@ if (this.isPressed) { //防止提交订单按钮重复点击 return } - + this.isPressed = true - + //提交前检查 - if(!this.refund_remarkDescription){ + if (!this.refund_remarkDescription) { uni.showToast({ title: '请填写退款说明', icon: 'error' @@ -193,7 +195,7 @@ this.isPressed = false return } - if(Number(this.requestRefund_price)===0){ + if (Number(this.requestRefund_price) === 0) { uni.showToast({ title: '请填写退款额', icon: 'error' @@ -201,13 +203,13 @@ this.isPressed = false return } - + //提交 uni.$u.http.post('/Api/Check/refundOrder', { - order_sn:this.order_sn, //订单号 + order_sn: this.order_sn, //订单号 shop_id: this.$store.state.shop_id, //商铺id - apply_price:Number(this.requestRefund_price), //申请价格 - refund_remark:this.refund_remarkDescription //退款说明 + apply_price: Number(this.requestRefund_price), //申请价格 + refund_remark: this.refund_remarkDescription //退款说明 }, { header: { 'Token': this.$store.state.userInfo.token, diff --git a/utils/index.js b/utils/index.js index ba26030..6dc5341 100644 --- a/utils/index.js +++ b/utils/index.js @@ -291,4 +291,43 @@ function initMqtt() { }) //更新订单 } }) +} + +/** + * 微信接口 拨打电话 + * @param {string} tel 电话号码 + */ +export function callPhone(tel) { + if (!tel) { + console.error("电话号码为空,无法拨打") + wx.showToast({ + title: "电话号码为空", + icon: "none", + duration: 2000 + }) + return + } + + wx.showActionSheet({ + itemList: [`拨打电话:${tel}`], + success: () => { + wx.makePhoneCall({ + phoneNumber: tel, // 电话号码来源 + success: () => { + console.log("拨打电话成功") + wx.showToast({ + title: "电话拨打完成", + icon: "success", + duration: 2000 + }) + }, + fail: (err) => { + console.error("拨打电话失败", err) + } + }) + }, + fail: (err) => { + console.error("用户取消拨打电话", err) + } + }) } \ No newline at end of file