支持自定义客服
parent
5720a3ce87
commit
2880d116e9
5
App.vue
5
App.vue
|
|
@ -2674,12 +2674,9 @@
|
||||||
longitude: res.longitude || null,
|
longitude: res.longitude || null,
|
||||||
status: 1,
|
status: 1,
|
||||||
});
|
});
|
||||||
clearInterval(self.data.get_user_location_timer);
|
|
||||||
},
|
|
||||||
fail: function(res) {
|
|
||||||
clearInterval(self.data.get_user_location_timer);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
clearInterval(self.data.get_user_location_timer);
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<block v-if="online_service_status == 1">
|
<block v-if="online_service_status == 1">
|
||||||
<!-- 是否商品页样式 -->
|
<!-- 是否商品页样式 -->
|
||||||
<view v-if="propIsGoods == true" class="goods-chat-container item fl cp">
|
<view v-if="propIsGoods == true" class="goods-chat-container item fl cp">
|
||||||
<block v-if="is_chat == 1">
|
<block v-if="is_chat == 1 || (common_app_customer_service_custom || null) != null">
|
||||||
<view @tap="chat_event">
|
<view @tap="chat_event">
|
||||||
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
||||||
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
||||||
|
|
@ -13,17 +13,21 @@
|
||||||
<!-- #ifdef MP-WEIXIN || MP-TOUTIAO || MP-BAIDU || MP-KUAISHOU -->
|
<!-- #ifdef MP-WEIXIN || MP-TOUTIAO || MP-BAIDU || MP-KUAISHOU -->
|
||||||
<button open-type="contact" :show-message-card="propCard" :send-message-title="propTitle" :send-message-path="propPath" :send-message-img="propImg">
|
<button open-type="contact" :show-message-card="propCard" :send-message-title="propTitle" :send-message-path="propPath" :send-message-img="propImg">
|
||||||
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
||||||
|
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
||||||
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
<button open-type="contact" class="alipay-contact">
|
<button open-type="contact" class="alipay-contact">
|
||||||
<contact-button :tnt-inst-id="mini_alipay_tnt_inst_id" :scene="mini_alipay_scene" :alipay-card-no="mini_alipay_openid || ''" :icon="common_static_url+'chat-icon.png'" size="40rpx*40rpx" />
|
<contact-button :tnt-inst-id="mini_alipay_tnt_inst_id" :scene="mini_alipay_scene" :alipay-card-no="mini_alipay_openid || ''" :icon="common_static_url+'chat-icon.png'" size="40rpx*40rpx" />
|
||||||
|
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
||||||
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef H5 || APP -->
|
<!-- #ifdef H5 || APP -->
|
||||||
<button type="default" @tap="call_event">
|
<button type="default" @tap="call_event">
|
||||||
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
|
||||||
<!-- #endif -->
|
|
||||||
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
<text class="text dis-block text-size-xs cr-grey">{{$t('online-service.online-service.4l6k22')}}</text>
|
||||||
</button>
|
</button>
|
||||||
|
<!-- #endif -->
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<!-- 默认浮动展示-可拖拽位置 -->
|
<!-- 默认浮动展示-可拖拽位置 -->
|
||||||
|
|
@ -33,7 +37,7 @@
|
||||||
<movable-view direction="all" :x="x" :y="y" :animation="false" class="online-service-event-submit spread">
|
<movable-view direction="all" :x="x" :y="y" :animation="false" class="online-service-event-submit spread">
|
||||||
<view class="ring"></view>
|
<view class="ring"></view>
|
||||||
<view class="ring"></view>
|
<view class="ring"></view>
|
||||||
<block v-if="is_chat == 1">
|
<block v-if="is_chat == 1 || (common_app_customer_service_custom || null) != null">
|
||||||
<button type="default" :class="common_ent" @tap="chat_event">
|
<button type="default" :class="common_ent" @tap="chat_event">
|
||||||
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
|
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -69,9 +73,11 @@
|
||||||
return {
|
return {
|
||||||
theme_view: app.globalData.get_theme_value_view(),
|
theme_view: app.globalData.get_theme_value_view(),
|
||||||
common_static_url: app.globalData.get_static_url('common'),
|
common_static_url: app.globalData.get_static_url('common'),
|
||||||
|
client_value: app.globalData.application_client_type(),
|
||||||
is_chat: 0,
|
is_chat: 0,
|
||||||
chat_url: null,
|
chat_url: null,
|
||||||
common_app_customer_service_tel: null,
|
common_app_customer_service_tel: null,
|
||||||
|
common_app_customer_service_custom: null,
|
||||||
online_service_status: 0,
|
online_service_status: 0,
|
||||||
is_online_service_fixed: app.globalData.data.is_online_service_fixed,
|
is_online_service_fixed: app.globalData.data.is_online_service_fixed,
|
||||||
mini_alipay_tnt_inst_id: null,
|
mini_alipay_tnt_inst_id: null,
|
||||||
|
|
@ -165,9 +171,6 @@
|
||||||
top: 250,
|
top: 250,
|
||||||
height_dec: this.propIsBar ? 350 : 250,
|
height_dec: this.propIsBar ? 350 : 250,
|
||||||
// #endif
|
// #endif
|
||||||
// 是否使用客服系统
|
|
||||||
is_chat: this.propIsChat || this.is_chat,
|
|
||||||
chat_url: this.propChatUrl || this.chat_url,
|
|
||||||
// 是否灰度
|
// 是否灰度
|
||||||
common_ent: this.propIsGrayscale ? 'grayscale' : ''
|
common_ent: this.propIsGrayscale ? 'grayscale' : ''
|
||||||
});
|
});
|
||||||
|
|
@ -175,33 +178,33 @@
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化配置
|
// 初始化配置
|
||||||
init_config(status) {
|
init_config(status) {
|
||||||
|
// 客服优先级顺序( 1客服系统 -> 2自定义客服 -> 3平台提供的客服 -> 4电话客服 )
|
||||||
if ((status || false) == true) {
|
if ((status || false) == true) {
|
||||||
// 是否使用客服系统
|
// 是否使用客服系统
|
||||||
var is_chat = app.globalData.get_config('plugins_base.chat.data.is_mobile_chat', 0);
|
var is_chat = app.globalData.get_config('plugins_base.chat.data.is_mobile_chat', 0);
|
||||||
var chat_url = app.globalData.get_config('plugins_base.chat.data.chat_url');
|
var chat_url = app.globalData.get_config('plugins_base.chat.data.chat_url');
|
||||||
if(is_chat == 1 && chat_url != null) {
|
if(is_chat == 1 && (chat_url != null || (this.propChatUrl || null) != null)) {
|
||||||
this.setData({
|
this.setData({
|
||||||
is_chat: is_chat,
|
is_chat: is_chat,
|
||||||
chat_url: chat_url,
|
chat_url: this.propChatUrl || chat_url,
|
||||||
common_app_customer_service_tel: app.globalData.get_config('config.common_app_customer_service_tel'),
|
|
||||||
online_service_status: app.globalData.get_config('config.common_app_is_online_service', 0)
|
online_service_status: app.globalData.get_config('config.common_app_is_online_service', 0)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-BAIDU || MP-ALIPAY || MP-KUAISHOU || H5 || APP
|
var online_service_url = app.globalData.get_config('config.common_app_customer_service_custom', null);
|
||||||
this.setData({
|
this.setData({
|
||||||
common_app_customer_service_tel: app.globalData.get_config('config.common_app_customer_service_tel'),
|
common_app_customer_service_tel: app.globalData.get_config('config.common_app_customer_service_tel', null),
|
||||||
|
common_app_customer_service_custom: (online_service_url == null || (online_service_url[this.client_value] || null) == null) ? null : online_service_url[this.client_value],
|
||||||
online_service_status: app.globalData.get_config('config.common_app_is_online_service', 0)
|
online_service_status: app.globalData.get_config('config.common_app_is_online_service', 0)
|
||||||
});
|
});
|
||||||
// #endif
|
|
||||||
|
// 对应平台没有提供客服的、电话和自定义客服必须存在一个
|
||||||
// #ifdef H5 || APP
|
var arr = ['qq', 'h5', 'ios', 'android'];
|
||||||
if((this.common_app_customer_service_tel || null) == null) {
|
if(arr.indexOf(this.client_value) != -1 && (this.common_app_customer_service_tel || null) == null && (this.common_app_customer_service_custom || null) == null) {
|
||||||
this.setData({
|
this.setData({
|
||||||
online_service_status: 0
|
online_service_status: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
// 在线客服开启,获取用户openid
|
// 在线客服开启,获取用户openid
|
||||||
if(this.online_service_status == 1)
|
if(this.online_service_status == 1)
|
||||||
|
|
@ -219,19 +222,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 客服电话
|
// 客服事件
|
||||||
call_event() {
|
chat_event() {
|
||||||
if (this.common_app_customer_service_tel == null) {
|
if(this.is_chat == 1) {
|
||||||
app.globalData.showToast(this.$t('setup.setup.utnr7g'));
|
// 进入客服系统
|
||||||
|
app.globalData.chat_entry_handle(this.chat_url);
|
||||||
} else {
|
} else {
|
||||||
app.globalData.call_tel(this.common_app_customer_service_tel);
|
// 自定义客服
|
||||||
|
app.globalData.url_open(this.common_app_customer_service_custom);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 进入客服系统
|
// 客服电话
|
||||||
chat_event() {
|
call_event() {
|
||||||
var url = this.propChatUrl || this.chat_url || null;
|
app.globalData.call_tel(this.common_app_customer_service_tel);
|
||||||
app.globalData.chat_entry_handle(url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue