Răsfoiți Sursa

Merge branch 'dev/v1.0.53.5_yf' of jianyu/web into hotfix/v1.0.53.5

yangfeng 10 luni în urmă
părinte
comite
b034f23b07

+ 19 - 9
apps/work-bench/src/api/modules/user.js

@@ -1,8 +1,8 @@
-import request from '../index'
 import qs from 'qs'
+import request from '../index'
 
 // 获取用户权限
-export function ajaxGetPower () {
+export function ajaxGetPower() {
   return request({
     url: '/bigmember/use/isAdd',
     method: 'post'
@@ -10,7 +10,7 @@ export function ajaxGetPower () {
 }
 
 // 获取用户信息
-export function ajaxGetUserInfo (data) {
+export function ajaxGetUserInfo(data) {
   return request({
     url: '/jypay/user/getSimpleData',
     method: 'post',
@@ -19,7 +19,7 @@ export function ajaxGetUserInfo (data) {
 }
 
 // 退出登录
-export function ajaxSetSignOut (data) {
+export function ajaxSetSignOut(data) {
   return request({
     url: '/front/signOut',
     method: 'post',
@@ -28,7 +28,7 @@ export function ajaxSetSignOut (data) {
 }
 
 // 检查是否登录状态
-export function ajaxCheckUserLoginStatus (data) {
+export function ajaxCheckUserLoginStatus(data) {
   return request({
     url: '/front/hasSign',
     method: 'post',
@@ -36,14 +36,14 @@ export function ajaxCheckUserLoginStatus (data) {
   })
 }
 
-export function ajaxGetUserIdentitys () {
+export function ajaxGetUserIdentitys() {
   return request({
     url: '/publicapply/identity/list',
     method: 'post'
   })
 }
 
-export function ajaxSwitchUserIdentity (data) {
+export function ajaxSwitchUserIdentity(data) {
   data = qs.stringify(data)
   return request({
     url: '/publicapply/identity/switch',
@@ -56,9 +56,8 @@ export function ajaxSwitchUserIdentity (data) {
  * 获取客服二维码
  * @param data { type: "kf" } 只获取客服的二维码,
  * 不传参根据用户权限判断是否返回客成二维码
- * @returns {*}
  */
-export function getCustomInfo (data) {
+export function getCustomInfo(data) {
   data = qs.stringify(data)
   return request({
     url: '/bigmember/use/getCustom',
@@ -66,3 +65,14 @@ export function getCustomInfo (data) {
     data
   })
 }
+
+/**
+ * 获取商务合作二维码及工作时间
+ */
+export function getCommonAdList(data) {
+  return request({
+    url: '/publicapply/free/getJyAdList',
+    method: 'POST',
+    data
+  })
+}

+ 91 - 80
apps/work-bench/src/components/CustomServiceCorner.vue

@@ -8,10 +8,11 @@
       trigger="click"
       :visible-arrow="false"
       @show="onShowPopover"
-      popper-class="custom-popover-menu">
+      popper-class="custom-popover-menu"
+    >
       <div class="self-card">
         <div class="self-row" @click="onClickCustomer">
-          <img src="@/assets/img/icon/kefu.png" alt="">
+          <img src="@/assets/img/icon/kefu.png" alt="" />
           <span>在线客服</span>
         </div>
         <el-tooltip
@@ -21,9 +22,9 @@
           :visible-arrow="false"
           popper-class="kf-phone-tooltip"
         >
-          <div slot="content" class="kf-phone">客服热线:400-108-6670<br>服务时间:工作日 9:00-17:40</div>
+          <div slot="content" class="kf-phone" v-html="workTime"></div>
           <div class="self-row">
-            <img src="@/assets/img/icon/dianhua.png" alt="">
+            <img src="@/assets/img/icon/dianhua.png" alt="" />
             <span>客服热线</span>
           </div>
         </el-tooltip>
@@ -37,38 +38,39 @@
           v-if="hasExclusiveCustomer"
         >
           <div slot="content" class="qw-qrcode">
-            <img :src="exclusiveCustomerInfo.qrcode" alt="">
+            <img :src="exclusiveCustomerInfo.qrcode" alt="" />
             <p class="text">微信扫一扫</p>
           </div>
           <div class="self-row">
-            <img src="@/assets/img/icon/qiwei.png" alt="">
+            <img src="@/assets/img/icon/qiwei.png" alt="" />
             <span>客服企微</span>
           </div>
         </el-tooltip>
         <div class="self-row" v-else>
-          <img src="@/assets/img/icon/qiwei.png" alt="">
+          <img src="@/assets/img/icon/qiwei.png" alt="" />
           <span>客服企微</span>
         </div>
         <div class="self-row" @click="jumpHelpPage">
-          <img src="@/assets/img/icon/help.png" alt="">
+          <img src="@/assets/img/icon/help.png" alt="" />
           <span>帮助中心</span>
         </div>
       </div>
       <div class="custom-btn" slot="reference">
-        <img src="@/assets/img/icon/wenhao.png" alt="">
+        <img src="@/assets/img/icon/wenhao.png" alt="" />
       </div>
     </el-popover>
   </div>
 </template>
 <script>
 import { Popover } from 'element-ui'
-import { mapGetters } from 'vuex'
+import { mapGetters, mapActions } from 'vuex'
 export default {
   components: {
     [Popover.name]: Popover
   },
-  data () {
+  data() {
     return {
+      workTime: ''
     }
   },
   computed: {
@@ -77,24 +79,34 @@ export default {
       'exclusiveCustomerInfo'
     ])
   },
-  created () {},
+  created() {
+    this.getCommonAdListFn({ codes: ['jy_pc_sidebar_float'] }).then((res) => {
+      if (res) {
+        const adList = res.jy_pc_sidebar_float
+        console.log(adList)
+        if (adList && adList.length > 0) {
+          this.workTime = adList[0]?.s_pic.replace('/n', '<br>')
+        }
+      }
+    })
+  },
   methods: {
+    ...mapActions('customer', ['getCommonAdListFn']),
     // 显示的时候触发
-    onShowPopover () {
+    onShowPopover() {
       this.$BRACE.$emit('close-customer')
     },
     // 在线客服
-    onClickCustomer () {
+    onClickCustomer() {
       try {
         this.$BRACE.$emit('open-customer')
         if (this.$refs.customServiceCorner) {
           this.$refs.customServiceCorner.doClose()
         }
-      } catch (e) {
-      }
+      } catch (e) {}
     },
     // 跳转到帮助中心
-    jumpHelpPage () {
+    jumpHelpPage() {
       if (this.$refs.customServiceCorner) {
         this.$refs.customServiceCorner.doClose()
       }
@@ -104,82 +116,82 @@ export default {
 }
 </script>
 <style lang="scss">
-  .custom-popover-menu.el-popover{
-    box-sizing: border-box;
-    width: 132px;
-    min-width:132px;
-    height: 168px;
-    background: #fff;
-    border: none;
-    box-shadow: 0 0 16px rgba(0,0,0,0.16);
-    border-radius: 8px;
-    padding: 8px;
-    .self-card{
-      color: #1d1d1d;
-      font-size:14px;
-      line-height: 22px;
-      .self-row{
-        display: flex;
-        align-items: center;
-        height:38px;
-        padding-left:8px;
-        cursor: pointer;
-        border-radius: 4px;
-        &:hover{
-          background: #EAF8FA;
-        }
-        img {
-          width:20px;
-          height:20px;
-          margin-right:8px;
-        }
+.custom-popover-menu.el-popover {
+  box-sizing: border-box;
+  width: 132px;
+  min-width: 132px;
+  height: 168px;
+  background: #fff;
+  border: none;
+  box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
+  border-radius: 8px;
+  padding: 8px;
+  .self-card {
+    color: #1d1d1d;
+    font-size: 14px;
+    line-height: 22px;
+    .self-row {
+      display: flex;
+      align-items: center;
+      height: 38px;
+      padding-left: 8px;
+      cursor: pointer;
+      border-radius: 4px;
+      &:hover {
+        background: #eaf8fa;
+      }
+      img {
+        width: 20px;
+        height: 20px;
+        margin-right: 8px;
       }
     }
   }
-  .kf-phone-tooltip.el-tooltip__popper.is-light{
-    border: 2px solid #FFFFFF;
-    box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
+}
+.kf-phone-tooltip.el-tooltip__popper.is-light {
+  border: 2px solid #ffffff;
+  box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
+  font-size: 14px;
+  line-height: 22px;
+  left: -240px;
+  color: #1d1d1d;
+  padding: 12px 20px;
+  border-radius: 8px;
+  box-sizing: border-box;
+}
+.qw-qrcode-tooltip.el-tooltip__popper.is-light {
+  border: none;
+  width: 144px;
+  height: 154px;
+  border-radius: 8px;
+  padding: 12px 20px;
+  box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
+  img {
+    width: 104px;
+    height: 104px;
+  }
+  .text {
+    text-align: center;
     font-size: 14px;
     line-height: 22px;
-    left: -240px;
-    color: #1D1D1D;
-    padding: 12px 20px;
-    border-radius: 8px;
-    box-sizing: border-box;
-  }
-  .qw-qrcode-tooltip.el-tooltip__popper.is-light{
-    border:none;
-    width:144px;
-    height: 154px;
-    border-radius: 8px;
-    padding: 12px 20px;
-    box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
-    img{
-      width: 104px;
-      height: 104px;
-    }
-    .text{
-      text-align: center;
-      font-size:14px;
-      line-height: 22px;
-    }
   }
+}
 </style>
 <style lang="scss" scoped>
-.custom-service-corner{
-  .custom-btn{
+.custom-service-corner {
+  .custom-btn {
     position: fixed;
     bottom: 50px;
     right: 32px;
-    width:40px;
-    height:40px;
+    width: 40px;
+    height: 40px;
     border-radius: 50%;
     background: #fff;
     text-align: center;
     line-height: 40px;
-    box-shadow: 0 0 16px rgba(0,0,0,0.16);
+    box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
     cursor: pointer;
-    z-index:10;
+    z-index: 10;
     img {
       width: 24px;
       height: 24px;
@@ -196,7 +208,7 @@ export default {
   //  box-sizing: border-box;
   //}
 }
-.mini-custom{
+.mini-custom {
   display: none;
   position: fixed;
   right: 84px;
@@ -211,9 +223,8 @@ export default {
   z-index: 9999;
 }
 @media screen and (max-height: 800px) {
-  .mini-custom{
+  .mini-custom {
     bottom: 20px;
   }
 }
-
 </style>

+ 22 - 11
apps/work-bench/src/store/modules/customer.js

@@ -1,44 +1,55 @@
-import { ajaxObtainShunt } from '../../api/modules'
+import { ajaxObtainShunt, getCommonAdList } from '../../api/modules'
+
+const process = require('node:process')
 
 export default {
   namespaced: true,
   state: () => ({
     showCustomer: false,
-    customerUrl: ''
+    customerUrl: '',
+    adList: []
   }),
   mutations: {
-    setCustomerUrl (state, data) {
+    setCustomerUrl(state, data) {
       state.customerUrl = data
     },
-    setCustomerStatus (state, data) {
+    setCustomerStatus(state, data) {
       state.showCustomer = data
     }
   },
   actions: {
-    async open ({ dispatch }) {
+    async open({ dispatch }) {
       dispatch('checkObtainShunt', { isFind: true })
     },
-    async checkObtainShunt ({ state, commit, dispatch, rootGetters }, payload = {}) {
+    async checkObtainShunt({ commit }, payload = {}) {
       ajaxObtainShunt({
         type: 'PC',
         isFind: payload.isFind
-      }).then(res => {
+      }).then((res) => {
         if (res && res.data && res.data.url) {
           // window.open(process.env.VUE_APP_BASE_SITE + res.data.url)
-          commit('setCustomerUrl', process.env.VUE_APP_BASE_SITE + res.data.url + '&from=aside')
+
+          commit(
+            'setCustomerUrl',
+            `${process.env.VUE_APP_BASE_SITE + res.data.url}&from=aside`
+          )
           commit('setCustomerStatus', true)
         }
       })
     },
-    close ({ commit }) {
+    close({ commit }) {
       commit('setCustomerStatus', false)
+    },
+    async getCommonAdListFn(payload = {}) {
+      const res = await getCommonAdList(payload)
+      return res?.data
     }
   },
   getters: {
-    getCustomerStatus (state) {
+    getCustomerStatus(state) {
       return state.showCustomer
     },
-    getCustomerUrl (state) {
+    getCustomerUrl(state) {
       return state.customerUrl
     }
   }