【类 型】: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;">
|
||||
<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" /> -->
|
||||
</view>
|
||||
<!-- 站长推荐 -->
|
||||
|
@ -30,7 +30,7 @@
|
||||
<u-icon name="map-fill" size="28"></u-icon>
|
||||
<view class="fz24">地图</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>
|
||||
<view class="fz24">客服</view>
|
||||
</view>
|
||||
@ -48,6 +48,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
callPhone
|
||||
} from '@/utils/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -59,13 +62,19 @@
|
||||
// 当页面显示时,设置tabber的激活项
|
||||
this.$store.commit('setTabbarCurrent', 2)
|
||||
},
|
||||
methods: {
|
||||
callPhone,
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
return this.$store.state.userInfo
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
methods: {}
|
||||
//商铺信息
|
||||
shopCon() {
|
||||
return this.$store.state.shopCon
|
||||
},
|
||||
},
|
||||
watch: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -74,9 +83,9 @@
|
||||
margin-top: 89rpx;
|
||||
border: 12rpx solid #fff;
|
||||
}
|
||||
|
||||
.setItemBox {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
|
||||
</style>
|
@ -111,7 +111,7 @@
|
||||
</u-popup>
|
||||
<!-- 按钮 -->
|
||||
<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 class="numberBut fci rad8 fz28 fb flex mac mc m-l-24" @click="handleSubmit"
|
||||
@ -126,7 +126,8 @@
|
||||
import {
|
||||
parseTime,
|
||||
formatPrice,
|
||||
truncate
|
||||
truncate,
|
||||
callPhone
|
||||
} from '@/utils/index.js'
|
||||
export default {
|
||||
data() {
|
||||
@ -150,6 +151,7 @@
|
||||
this.requestRefund_price = this.fullPrice //默认申请退款金额 为订单的总金额
|
||||
},
|
||||
methods: {
|
||||
callPhone, //拨打电话
|
||||
formatPrice, //格式化价格
|
||||
handledrRefund_priceShow() {
|
||||
if (!this.requestRefund_price) {
|
||||
@ -185,7 +187,7 @@
|
||||
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'
|
||||
@ -204,10 +206,10 @@
|
||||
|
||||
//提交
|
||||
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,
|
||||
|
@ -292,3 +292,42 @@ 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