Commit d65cd127 by luyt

feat: 在线聊天

1 parent 04600f3c
/**
* 申请门店开通
*/
import api from '~/utils/request/request'
const common = 'scrm.api.carlife.common.'
// export
\ No newline at end of file \ No newline at end of file
/**
* 拓客户,看线索接口
*/
import api from '~/utils/request/request'
const common = 'scrm.api.carlife.common.'
// 拓客户
// 看线索
// pages/tab/index/components/chat/chat.js
import { IMG_URL } from "~/utils/constantData.js";
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
kfUrl: "",
widgetStatus: false,
IMG_URL,
img_version: Date.now(),
},
/**
* 组件的方法列表
*/
methods: {
openKF(e) {
let { kfUrl, widgetStatus } = this.data;
if (kfUrl)
wx.pro.openCustomerServiceChat({
extInfo: {
url: kfUrl,
},
corpId: "ww6fe4fbe0d050a2b5",
success(res) {
console.log(res);
},
fail({ errMsg }) {
console.log(errMsg);
wx.$util.showToast(errMsg);
},
});
else
this.setData({
widgetStatus: !widgetStatus,
});
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/chat/chat.wxss */
.widget-box {
position: fixed;
right: 40rpx;
bottom: 232rpx;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: flex-end;
}
.widget {
height: 140rpx;
width: 112rpx;
box-sizing: border-box;
}
.widget-box .open {
position: relative;
z-index: 2;
}
.online-text {
position: absolute;
top: 74rpx;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 28rpx;
font-size: 20rpx;
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/chat/chat.wxml-->
<!-- wx:if="{{widgetStatus}}" -->
<view class="model" catchtouchmove="noScroll">
<view class="close-icon" bindtap="showFlex">
<image webp src="{{IMG_URL}}index/kf-close.png?v={{img_version}}"></image>
</view>
<view class="bgkf">
<image webp src="{{IMG_URL}}index/kfbg.png?v={{img_version}}"></image>
<view class="qr-box">
<view class="qr-icon">
<image webp src="{{IMG_URL}}index/qr-bg.png?v={{img_version}}"></image>
</view>
<view class="userinfo-wrap">
<view class="icon">
<image webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/user.png"></image>
</view>
<view class="name">hello</view>
<view class="qr-code">
<image webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/qr.png" show-menu-by-longpress="{{customerlist[0].qrCode}}"></image>
</view>
</view>
<view class="kf-text">
<image webp src="{{IMG_URL}}index/kf-text.png?v={{img_version}}"></image>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"product": "./components/product/product", "product": "./components/product/product",
"vas-toast": "./components/likeToast/likeToast" "vas-toast": "./components/likeToast/likeToast",
"chat":"./components/chat/chat"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 10, "onReachBottomDistance": 10,
......
...@@ -119,4 +119,5 @@ ...@@ -119,4 +119,5 @@
<image bindtap="guideFn" class="guide-img" src="{{IMG_URL}}index/guide{{guideSrcIndex}}.png" /> <image bindtap="guideFn" class="guide-img" src="{{IMG_URL}}index/guide{{guideSrcIndex}}.png" />
</view> </view>
<image class="chat" bindtap="chatFn" src="{{IMG_URL}}index/contact.png" /> <image class="chat" bindtap="chatFn" src="{{IMG_URL}}index/contact.png" />
<image class="output-value" bindtap="valuationFn" src="{{IMG_URL}}index/valuation.png" />
\ No newline at end of file \ No newline at end of file
<image class="output-value" bindtap="valuationFn" src="{{IMG_URL}}index/valuation.png" />
<!-- <chat></chat> -->
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!