【类 型】:feat
【原 因】:客服功能 拨打电话 【过 程】:调用微信提供的拨打电话接口 从后台获取客服的电话参数 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
ae63df0591
commit
747ee9226f
@ -29,7 +29,7 @@
|
|||||||
<!-- 主按钮 -->
|
<!-- 主按钮 -->
|
||||||
<view class="flex mse" style="margin-top: 30rpx;">
|
<view class="flex mse" style="margin-top: 30rpx;">
|
||||||
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
|
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
|
||||||
<mainBut url="/pages/order/index" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
|
<mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
|
||||||
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
|
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 站长推荐 -->
|
<!-- 站长推荐 -->
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<u-icon name="map-fill" size="28"></u-icon>
|
<u-icon name="map-fill" size="28"></u-icon>
|
||||||
<view class="fz24">地图</view>
|
<view class="fz24">地图</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="setItemBox flex mac column p-24">
|
<view class="setItemBox flex mac column p-24" @click="callPhone(shopCon.tel)">
|
||||||
<u-icon name="server-fill" size="28"></u-icon>
|
<u-icon name="server-fill" size="28"></u-icon>
|
||||||
<view class="fz24">客服</view>
|
<view class="fz24">客服</view>
|
||||||
</view>
|
</view>
|
||||||
@ -48,6 +48,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
callPhone
|
||||||
|
} from '@/utils/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -59,13 +62,19 @@
|
|||||||
// 当页面显示时,设置tabber的激活项
|
// 当页面显示时,设置tabber的激活项
|
||||||
this.$store.commit('setTabbarCurrent', 2)
|
this.$store.commit('setTabbarCurrent', 2)
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
callPhone,
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
userInfo() {
|
userInfo() {
|
||||||
return this.$store.state.userInfo
|
return this.$store.state.userInfo
|
||||||
}
|
},
|
||||||
|
//商铺信息
|
||||||
|
shopCon() {
|
||||||
|
return this.$store.state.shopCon
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {}
|
||||||
methods: {}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -74,9 +83,9 @@
|
|||||||
margin-top: 89rpx;
|
margin-top: 89rpx;
|
||||||
border: 12rpx solid #fff;
|
border: 12rpx solid #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setItemBox {
|
.setItemBox {
|
||||||
width: 72rpx;
|
width: 72rpx;
|
||||||
height: 72rpx;
|
height: 72rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -111,7 +111,7 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
<view class="m-l-24 m-r-24 m-t-24 flex mr">
|
<view class="m-l-24 m-r-24 m-t-24 flex mr">
|
||||||
<view class="nullBut border fcb rad8 fz28 flex mac mc">
|
<view class="nullBut border fcb rad8 fz28 flex mac mc" @click="callPhone(shopCon.tel)">
|
||||||
联系客服
|
联系客服
|
||||||
</view>
|
</view>
|
||||||
<view class="numberBut fci rad8 fz28 fb flex mac mc m-l-24" @click="handleSubmit"
|
<view class="numberBut fci rad8 fz28 fb flex mac mc m-l-24" @click="handleSubmit"
|
||||||
@ -126,7 +126,8 @@
|
|||||||
import {
|
import {
|
||||||
parseTime,
|
parseTime,
|
||||||
formatPrice,
|
formatPrice,
|
||||||
truncate
|
truncate,
|
||||||
|
callPhone
|
||||||
} from '@/utils/index.js'
|
} from '@/utils/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -140,7 +141,7 @@
|
|||||||
currentRemark: -1, // 当前选中的退款有缘索引
|
currentRemark: -1, // 当前选中的退款有缘索引
|
||||||
refund_remarkValue: '', // 退款说明 其他输入的内容
|
refund_remarkValue: '', // 退款说明 其他输入的内容
|
||||||
txtmaxlength: 30, //退款说明 其他文本框最多字数限制
|
txtmaxlength: 30, //退款说明 其他文本框最多字数限制
|
||||||
|
|
||||||
isPressed: false, //提交按钮是否锁定
|
isPressed: false, //提交按钮是否锁定
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -150,6 +151,7 @@
|
|||||||
this.requestRefund_price = this.fullPrice //默认申请退款金额 为订单的总金额
|
this.requestRefund_price = this.fullPrice //默认申请退款金额 为订单的总金额
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
callPhone, //拨打电话
|
||||||
formatPrice, //格式化价格
|
formatPrice, //格式化价格
|
||||||
handledrRefund_priceShow() {
|
handledrRefund_priceShow() {
|
||||||
if (!this.requestRefund_price) {
|
if (!this.requestRefund_price) {
|
||||||
@ -170,7 +172,7 @@
|
|||||||
onRefundPriceBlur() {
|
onRefundPriceBlur() {
|
||||||
// 使用 formatPrice 格式化输入的金额
|
// 使用 formatPrice 格式化输入的金额
|
||||||
this.requestRefund_price = this.formatPrice(this.requestRefund_price)
|
this.requestRefund_price = this.formatPrice(this.requestRefund_price)
|
||||||
|
|
||||||
// 检查金额是否超过订单总金额
|
// 检查金额是否超过订单总金额
|
||||||
if (Number(this.requestRefund_price) > Number(this.fullPrice)) {
|
if (Number(this.requestRefund_price) > Number(this.fullPrice)) {
|
||||||
this.requestRefund_price = Number(this.fullPrice)
|
this.requestRefund_price = Number(this.fullPrice)
|
||||||
@ -181,11 +183,11 @@
|
|||||||
if (this.isPressed) { //防止提交订单按钮重复点击
|
if (this.isPressed) { //防止提交订单按钮重复点击
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isPressed = true
|
this.isPressed = true
|
||||||
|
|
||||||
//提交前检查
|
//提交前检查
|
||||||
if(!this.refund_remarkDescription){
|
if (!this.refund_remarkDescription) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请填写退款说明',
|
title: '请填写退款说明',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
@ -193,7 +195,7 @@
|
|||||||
this.isPressed = false
|
this.isPressed = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(Number(this.requestRefund_price)===0){
|
if (Number(this.requestRefund_price) === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请填写退款额',
|
title: '请填写退款额',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
@ -201,13 +203,13 @@
|
|||||||
this.isPressed = false
|
this.isPressed = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//提交
|
//提交
|
||||||
uni.$u.http.post('/Api/Check/refundOrder', {
|
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
|
shop_id: this.$store.state.shop_id, //商铺id
|
||||||
apply_price:Number(this.requestRefund_price), //申请价格
|
apply_price: Number(this.requestRefund_price), //申请价格
|
||||||
refund_remark:this.refund_remarkDescription //退款说明
|
refund_remark: this.refund_remarkDescription //退款说明
|
||||||
}, {
|
}, {
|
||||||
header: {
|
header: {
|
||||||
'Token': this.$store.state.userInfo.token,
|
'Token': this.$store.state.userInfo.token,
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user