增加企业微信客服支持

master
gongfuxiang 2024-06-12 23:52:51 +08:00
parent 987ac4fca8
commit 4afb4ee4a3
2 changed files with 69 additions and 15 deletions

View File

@ -3,7 +3,7 @@
<block v-if="online_service_status == 1">
<!-- 是否商品页样式 -->
<view v-if="propIsGoods == true" class="goods-chat-container item fl cp">
<block v-if="is_chat == 1 || (common_app_customer_service_custom || null) != null">
<block v-if="is_chat == 1">
<view @tap="chat_event">
<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>
@ -37,7 +37,7 @@
<movable-view direction="all" :x="x" :y="y" :animation="false" class="online-service-event-submit spread">
<view class="ring"></view>
<view class="ring"></view>
<block v-if="is_chat == 1 || (common_app_customer_service_custom || null) != null">
<block v-if="is_chat == 1">
<button type="default" :class="common_ent" @tap="chat_event">
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
</button>
@ -78,6 +78,8 @@
chat_url: null,
common_app_customer_service_tel: null,
common_app_customer_service_custom: null,
common_app_customer_service_company_weixin_corpid: null,
common_app_customer_service_company_weixin_url: null,
online_service_status: 0,
is_online_service_fixed: app.globalData.data.is_online_service_fixed,
mini_alipay_tnt_inst_id: null,
@ -178,30 +180,48 @@
methods: {
//
init_config(status) {
// ( 1 -> 2 -> 3 -> 4 )
// ( -> -> (app+h5+) -> -> )
if ((status || false) == true) {
// 使
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 is_online_service = app.globalData.get_config('config.common_app_is_online_service', 0);
if(is_chat == 1 && (chat_url != null || (this.propChatUrl || null) != null)) {
this.setData({
is_chat: is_chat,
chat_url: this.propChatUrl || chat_url,
online_service_status: app.globalData.get_config('config.common_app_is_online_service', 0)
online_service_status: is_online_service,
});
} else {
var online_service_url = app.globalData.get_config('config.common_app_customer_service_custom', null);
this.setData({
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)
common_app_customer_service_company_weixin_corpid: app.globalData.get_config('config.common_app_customer_service_company_weixin_corpid', null),
common_app_customer_service_company_weixin_url: app.globalData.get_config('config.common_app_customer_service_company_weixin_url', null),
online_service_status: is_online_service,
});
//
var arr = ['qq', 'h5', 'ios', 'android'];
if(arr.indexOf(this.client_value) != -1 && (this.common_app_customer_service_tel || null) == null && (this.common_app_customer_service_custom || null) == null) {
//
if((this.common_app_customer_service_custom || null) != null || ((this.common_app_customer_service_company_weixin_corpid || null) != null && (this.common_app_customer_service_company_weixin_url || null) != null)) {
this.setData({
online_service_status: 0
is_chat: 1
});
}
// []线
if(['qq', 'h5', 'ios', 'android'].indexOf(this.client_value) != -1 && (this.common_app_customer_service_tel || null) == null && (this.common_app_customer_service_custom || null) == null) {
var temp_service_status = this.online_service_status;
if(this.client_value == 'qq') {
temp_service_status = 0;
} else {
// h5,app
if((this.common_app_customer_service_company_weixin_corpid || null) == null && (this.common_app_customer_service_company_weixin_url || null) == null) {
temp_service_status = 0;
}
}
this.setData({
online_service_status: temp_service_status
});
}
@ -224,12 +244,45 @@
//
chat_event() {
if(this.is_chat == 1) {
//
// 线
if((this.chat_url || null) != null) {
app.globalData.chat_entry_handle(this.chat_url);
} else {
//
app.globalData.url_open(this.common_app_customer_service_custom);
if((this.common_app_customer_service_custom || null) != null) {
app.globalData.url_open(this.common_app_customer_service_custom);
} else {
//
if((this.common_app_customer_service_company_weixin_corpid || null) != null && (this.common_app_customer_service_company_weixin_url || null) != null) {
// #ifdef APP
// app
plus.share.getServices(res => {
var wechat = res.find(i => i.id === 'weixin')
if(wechat) {
wechat.openCustomerServiceChat({
corpid: this.common_app_customer_service_company_weixin_corpid,
url: this.common_app_customer_service_company_weixin_url,
});
}
});
// #endif
// #ifdef MP-WEIXIN
//
uni.openCustomerServiceChat({
extInfo: {url: this.common_app_customer_service_company_weixin_url},
corpId: this.common_app_customer_service_company_weixin_corpid,
showMessageCard: this.propCard,
sendMessageTitle: this.propTitle,
sendMessagePath: this.propPath,
sendMessageImg: this.propImg,
});
// #endif
} else {
//
this.call_event();
}
}
}
},

View File

@ -38,7 +38,7 @@
<component-region-picker :propProvinceId="province_id" :propCityId="city_id" :propCountyId="county_id" :propShow="region_picker_show" @onclose="close_event" @call-back="region_event"></component-region-picker>
</view>
<view class="code-search oh pr">
<input type="text" maxlength="30" placeholder-class="cr-grey-9" class="cr-base dis-inline-block bg-base text-size-xs padding-left-sm va-m" :placeholder="$t('user-address-save.user-address-save.he685s')" @input="region_code_value_event" />
<input type="text" :value="address_data.code || ''" maxlength="30" placeholder-class="cr-grey-9" class="cr-base dis-inline-block bg-base text-size-xs padding-left-sm va-m" :placeholder="$t('user-address-save.user-address-save.he685s')" @input="region_code_value_event" />
<button type="default" size="mini" class="bg-black br-black cr-white text-size-xs pa" @tap="region_code_event" :disabled="form_submit_disabled_status">{{$t('user-address-save.user-address-save.mb7cjx')}}</button>
</view>
</view>
@ -123,7 +123,7 @@
</view>
<view class="flex-row align-c padding-vertical-sm margin-bottom-lg">
<view class="form-gorup-title">{{$t('user-address-save.user-address-save.761ek6')}}<text class="form-group-tips-must">*</text></view>
<view class="form-upload-data cr-grey-9">{{$t('user-address-save.user-address-save.c811s5')}}</view>
<view class="form-upload-data cr-grey-9 text-size-xs">{{$t('user-address-save.user-address-save.c811s5')}}</view>
</view>
<view class="flex-row align-c">
<view class="flex-width-half oh padding-right-main pr">
@ -302,7 +302,8 @@
this.setData({
address_data: ads_data || {},
idcard_images_data: idcard_images,
editor_path_type: data.editor_path_type || '',
editor_path_type: data.editor_path_type || '',
data_list_loding_status: 3,
});
if (this.alias_list.indexOf(alias) === -1) {
this.setData({