Browse Source

新增客服

master
liaoxinyu 3 months ago
parent
commit
90f8576637
  1. 46
      App.vue
  2. 18
      api/home.js
  3. 26
      api/member.js
  4. 22
      i18n/lang/en.json
  5. 22
      i18n/lang/zh-TW.json
  6. 48
      pages/base/home.vue
  7. 121
      pages/oncs/onservice.vue
  8. BIN
      static/img/cs_w.png

46
App.vue

@ -140,6 +140,52 @@ export default {
color: $text-color;
}
.circle-pulse {
background: red;
width: 7px;
height: 7px;
border-radius: 50%;
position: absolute;
right: -10px;
top: 10px;
}
.circle-pulse:after {
background-color: red;
content: "";
display: table;
border-radius: 50%;
position: absolute;
animation-name: pulse1;
animation-duration: 0.9s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
}
@keyframes pulse1 {
0% {
opacity: 1;
width: 7px;
height: 7px;
left: 0;
top: 0;
}
95% {
opacity: 0.1;
left: -10.5px;
top: -10.5px;
width: 28px;
height: 28px;
}
100% {
opacity: 0;
width: 7px;
height: 7px;
left: 0;
top: 0;
}
}
/* #ifdef H5 */
.layout-page {
height: 100%!important;

18
api/home.js

@ -20,6 +20,24 @@ class Home {
static option(data){
return Serve.post('/option',data)
}
/*
* 获取用户在线接口
*/
static online(){
return Serve.get('/online')
}
/*
* 获取未读消息
*/
static chat(){
return Serve.get('/user/chat')
}
/*
* 已读消息
*/
static chatRead(){
return Serve.get('/user/chatRead')
}
}
export default Home;

26
api/member.js

@ -127,17 +127,21 @@ class Member {
static contact () {
return server.get(`/contact`);
}
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
// 提币获取邮箱验证码
static getWdcode(data){
return server.get(`/user/wdcode`, data);
}
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
// 提币获取邮箱验证码
static getWdcode(data){
return server.get(`/user/wdcode`, data);
}
// 查询用户的帐号
static getUnameByUid(data){
return server.get(`/user/getUserName`, data);
}
}
export default Member;

22
i18n/lang/en.json

@ -68,7 +68,27 @@
"c4": "Size",
"c5": "your transfer order has been submitted successfully, please wait patiently, and the transfer result will be notified by SMS or e-mail. Please check it carefully. If you have any questions, please contact the customer service in time.",
"c6": "Proportion of increase",
"c7": "Current valuation"
"c7": "Current valuation",
"loading": "loading",
"c12": "Rejection Information",
"c13": "Withdrawal password",
"c14": "Please fill in the withdrawal password",
"c15": "Reset withdrawal password",
"rejection":"Reason for rejection",
"c16": "Send",
"c17": "Transfer Address",
"c18": "Transfer Amount",
"c19": "Recharge/Transfer",
"c20": "Contact Customer Service",
"c21": "Select Currency",
"c22": "Password and Email Verification Code",
"c23": "Estimated arrival time",
"c24": "Received quantity",
"c25": "Withdrawal",
"c26": "The transfer quantity cannot be greater than {name}",
"c27": "Transfer Records",
"c28": "confirm",
"c29": "Please check your withdrawal address carefully and make sure it is filled in correctly. If you miss or fill in the wrong information, you may lose your assets."
},
"base": {
"a0": "Title",

22
i18n/lang/zh-TW.json

@ -67,7 +67,27 @@
"c3": "可開",
"c4": "數量",
"c5": "您的劃轉訂單已提交成功,請耐心等待,劃轉結果會以簡訊或郵件的管道通知。請注意查收,如有疑問請及時聯系客服",
"c6": "漲幅比例"
"c6": "漲幅比例",
"loading": "加载中",
"c12": "駁回信息",
"c13": "提款密碼",
"c14": "請填写提款密碼",
"c15": "重置提款密碼",
"rejection":"拒絕理由",
"c16": "轉移",
"c17": "轉移地址",
"c18": "轉移金額",
"c19": "充值/轉移",
"c20": "聯絡客服",
"c21": "選擇幣種",
"c22": "密碼及邮箱驗證碼",
"c23": "預計到帳時間",
"c24": "到帳數量",
"c25": "提現",
"c26": "轉移數量不能大於{name}",
"c27": "轉移記錄",
"c28": "確認",
"c29": "請認真核對您的提幣地址,務必檢查是否正確填寫。如果您漏添或填錯,將有可能對您的資產造成損失"
},
"base": {
"a0": "標題",

48
pages/base/home.vue

@ -864,6 +864,15 @@
</view>
<van-icon name="arrow" class="fn-18" />
</v-link>
<v-link :to="isLogin?'/pages/oncs/onservice':'/pages/login/index'" tag="div"
class="per-bot p-y-md p-x-sm d-flex align-center justify-between" style="position: relative;">
<view class="d-flex align-center">
<img src="@/static/img/cs_w.png" alt="" class="h-20 m-r-xs" />
<span class="circle-pulse1" v-if="newscount!==0">{{newscount>=100?'99+':newscount}}</span>
<view class="color-light">{{$t('common.service')}}</view>
</view>
<van-icon name="arrow" class="fn-18" />
</v-link>
<!-- <v-link :to="`/pages/help/detail?id=${167}`" tag="div"
class="per-bot p-y-md p-x-sm d-flex align-center justify-between">
<view class="d-flex align-center">
@ -971,7 +980,9 @@
guideList: [], //
guideId: '', // ID
articleList: [],
helpList: []
helpList: [],
newscount:0,
chatcount:null,
};
},
computed: {
@ -989,6 +1000,13 @@
},
watch: {
isShow(n) {
if(n&&this.isLogin){
this.chatcount = setInterval(()=>{
this.chat()
},2000)
} else if(!n){
clearInterval(this.chatcount);
}
if (n) {
this.indexData()
this.ws.send({
@ -1259,6 +1277,7 @@
})
.then(() => {
this.outLogin();
clearInterval(this.chatcount);
})
.catch(() => {});
})
@ -1356,6 +1375,16 @@
window.open("https://app.cxisux.com/download/ ", '_blank')
// #endif
}
},
chat(){
Home.chat().then(res => {
if(res.code==200){
this.newscount = res.data.count;
}else{
console.log('1111');
clearInterval(this.chatcount);
}
})
}
},
mounted() {
@ -1365,6 +1394,9 @@
this.getCollegeLinks();
this.getHelpList();
if (this.isLogin) {
this.chatcount = setInterval(()=>{
this.chat()
},5000)
this.createWalletAddress();
this.getAuthInfo()
}
@ -1373,6 +1405,20 @@
};
</script>
<style lang="scss" scoped>
.circle-pulse1 {
background: red;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
height: 20px;
font-size: 12px;
border-radius: 50%;
position: absolute;
right: 25%;
top: -10px;
color: #fff;
}
// .colbg {
// background-color: $bg;
// }

121
pages/oncs/onservice.vue

@ -0,0 +1,121 @@
<template>
<v-page>
<v-header :title="$t('common.service')"></v-header>
<view class="onsczone">
<web-view v-if="isLoad" :src="csurl" style="margin-top: 3rem;"></web-view>
<view style="display: flex;justify-content: center;align-items: center;" v-else>
<div class="loader"></div>
<div style="font-size: 20px;margin-left: 10px;">{{$t('common.loading')}}<span>...</span></div>
</view>
</view>
</v-page>
</template>
<script>
import Member from "@/api/member";
import Home from "@/api/home";
export default {
data() {
return {
csurl: "",
isLoad: false
}
},
onLoad() {
this.mkcslinks()
},
methods: {
// build
mkcslinks() {
let user = uni.getStorageSync('user')
if (user) {
let ustr = JSON.parse(user)
console.log(ustr)
Member.getUnameByUid({user_id: 1}).then(rfres => {
let rfu = rfres.data;
// query referr uname
let chaturl = "https://cs.skybtcs.com/chat/?toid=" + rfu.username + "&room_id=" + ustr.account + "&usid=" + ustr.user_id;
//this.csurl += rfres.username+"&room_id="+ustr.account+"&usid="+ustr.user_id;
// console.log("dd",chaturl);
this.csurl = chaturl;
this.isLoad = true;
if(this.isLoad===true){
this.chatRead()
}
})
console.log("user", this.csurl)
}
},
chatRead(){
Home.chatRead().then(res => {
console.log(res,'已读');
})
}
}
}
</script>
<style>
</style>
<style scoped>
.onsczone {
margin-top: 12rem;
}
.loader {
width: 50px;
aspect-ratio: 1;
display: grid;
border: 4px solid #0000;
border-radius: 50%;
border-right-color: #25b09b;
animation: l15 1s infinite linear;
}
.loader::before,
.loader::after {
content: "";
grid-area: 1/1;
margin: 2px;
border: inherit;
border-radius: 50%;
animation: l15 2s infinite;
}
.loader::after {
margin: 8px;
animation-duration: 3s;
}
@keyframes l15 {
100% {
transform: rotate(1turn)
}
}
span {
display: inline-block;
height: 1em;
line-height: 1;
text-align: left;
vertical-align: -.25em;
overflow: hidden;
}
span::before {
display: block;
content: '...\A..\A.';
white-space: pre-wrap;
animation: dot 3s infinite step-start both;
}
@keyframes dot {
33% {
transform: translateY(-2em);
}
66% {
transform: translateY(-1em);
}
}
</style>

BIN
static/img/cs_w.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Loading…
Cancel
Save