feat(客服功能): 优化客服联系按钮显示和交互逻辑

修改客服电话模板为更明显的按钮样式
在页面列表和跳转逻辑中增加客服联系判断条件
This commit is contained in:
2026-01-03 23:56:32 +08:00
parent 230491996a
commit 350bb5a86b
3 changed files with 11 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
<template name="pageList"> <template name="pageList">
<view class="index-href-box"> <view class="index-href-box">
<block wx:for="{{urlList}}" wx:key="index"> <block wx:for="{{urlList}}" wx:key="index">
<button wx:if="{{item.phone}}" class="item" open-type="contact" show-message-card="true"> <button wx:if="{{item.phone || item.name=='联系客服'}}" class="item" open-type="contact" show-message-card="true">
<view class="item_b" style="background-image:url('{{item.img}}')"> <view class="item_b" style="background-image:url('{{item.img}}')">
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
</view> </view>

View File

@@ -124,8 +124,15 @@ Page({
}, },
toPage: function (t) { toPage: function (t) {
console.info(t); console.info(t);
// 有phone字段 但允许为空
if (t.currentTarget.dataset.phone || t.currentTarget.dataset.name=='联系客服') {
// 打开客服聊天窗口
return wx.openCustomerServiceChat();
}
var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg; var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg;
if (console.log("showImg", n), i) { if (console.log("showImg", a), i) {
this.isneedUpload = !0; this.isneedUpload = !0;
if (o && !e.globalData.user.session) return this.isneedUpload = !0, wx.navigateTo({ if (o && !e.globalData.user.session) return this.isneedUpload = !0, wx.navigateTo({
url: "/pages/login/login" url: "/pages/login/login"

View File

@@ -1,5 +1,3 @@
<view class="service-tel"> <view class="service-tel">
<!-- <view>=客服电话=</view> <button size="mini" type="default" plain="ture" open-type="contact" >== 联系客服 ==</button>
<view bindtap="callUs">{{tel}}</view> --> </view>
<!-- <button class="service-tel" open-type="contact" show-message-card="true">联系客服</button> -->
</view>