CustomServiceCorner.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <!--桌面右下角客服-->
  2. <template>
  3. <div class="custom-service-corner">
  4. <el-popover
  5. ref="customServiceCorner"
  6. placement="left-end"
  7. width="132"
  8. trigger="click"
  9. :visible-arrow="false"
  10. @show="onShowPopover"
  11. popper-class="custom-popover-menu"
  12. >
  13. <div class="self-card">
  14. <div class="self-row" @click="onClickCustomer">
  15. <img src="@/assets/img/icon/kefu.png" alt="" />
  16. <span>在线客服</span>
  17. </div>
  18. <el-tooltip
  19. trigger="click"
  20. placement="left"
  21. effect="light"
  22. :visible-arrow="false"
  23. popper-class="kf-phone-tooltip"
  24. >
  25. <div slot="content" class="kf-phone" v-html="workTime"></div>
  26. <div class="self-row">
  27. <img src="@/assets/img/icon/dianhua.png" alt="" />
  28. <span>客服热线</span>
  29. </div>
  30. </el-tooltip>
  31. <el-tooltip
  32. trigger="click"
  33. placement="left"
  34. effect="light"
  35. :visible-arrow="false"
  36. popper-class="qw-qrcode-tooltip"
  37. v-if="hasExclusiveCustomer"
  38. >
  39. <div slot="content" class="qw-qrcode">
  40. <!-- <img :src="exclusiveCustomerInfo.qrcode" alt="" />
  41. <p class="text">微信扫一扫</p> -->
  42. <PCContentPopover set-class="leave-aside-card" ></PCContentPopover>
  43. </div>
  44. <div class="self-row">
  45. <img src="@/assets/img/icon/qiwei.png" alt="" />
  46. <span>客服企微</span>
  47. </div>
  48. </el-tooltip>
  49. <div class="self-row" v-else>
  50. <img src="@/assets/img/icon/qiwei.png" alt="" />
  51. <span>客服企微</span>
  52. </div>
  53. <div class="self-row" @click="jumpHelpPage">
  54. <img src="@/assets/img/icon/help.png" alt="" />
  55. <span>帮助中心</span>
  56. </div>
  57. </div>
  58. <div class="custom-btn" slot="reference">
  59. <img src="@/assets/img/icon/wenhao.png" alt="" />
  60. </div>
  61. </el-popover>
  62. </div>
  63. </template>
  64. <script>
  65. /* eslint-disable */
  66. import { Popover } from 'element-ui'
  67. import { mapGetters, mapActions } from 'vuex'
  68. import LeaveInfo from '@jy/plugin-leave-source'
  69. export default {
  70. components: {
  71. [Popover.name]: Popover,
  72. PCContentPopover: LeaveInfo.PCContentPopover
  73. },
  74. data() {
  75. return {
  76. workTime: ''
  77. }
  78. },
  79. computed: {
  80. ...mapGetters('work-bench/user', [
  81. 'hasExclusiveCustomer',
  82. 'exclusiveCustomerInfo'
  83. ])
  84. },
  85. created() {
  86. this.getCommonAdListFn({ codes: ['jy_pc_sidebar_float'] }).then((res) => {
  87. if (res) {
  88. const adList = res.jy_pc_sidebar_float
  89. console.log(adList)
  90. if (adList && adList.length > 0) {
  91. this.workTime = adList[0]?.s_pic.replace('/n', '<br>')
  92. }
  93. }
  94. })
  95. },
  96. methods: {
  97. ...mapActions('customer', ['getCommonAdListFn']),
  98. // 显示的时候触发
  99. onShowPopover() {
  100. this.$BRACE.$emit('close-customer')
  101. },
  102. // 在线客服
  103. onClickCustomer() {
  104. try {
  105. this.$BRACE.$emit('open-customer')
  106. if (this.$refs.customServiceCorner) {
  107. this.$refs.customServiceCorner.doClose()
  108. }
  109. } catch (e) {}
  110. },
  111. // 跳转到帮助中心
  112. jumpHelpPage() {
  113. if (this.$refs.customServiceCorner) {
  114. this.$refs.customServiceCorner.doClose()
  115. }
  116. window.open('/helpCenter/index', '_blank')
  117. }
  118. }
  119. }
  120. /* eslint-disable */
  121. </script>
  122. <style lang="scss">
  123. .custom-popover-menu.el-popover {
  124. box-sizing: border-box;
  125. width: 132px;
  126. min-width: 132px;
  127. height: 168px;
  128. background: #fff;
  129. border: none;
  130. box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
  131. border-radius: 8px;
  132. padding: 8px;
  133. .self-card {
  134. color: #1d1d1d;
  135. font-size: 14px;
  136. line-height: 22px;
  137. .self-row {
  138. display: flex;
  139. align-items: center;
  140. height: 38px;
  141. padding-left: 8px;
  142. cursor: pointer;
  143. border-radius: 4px;
  144. &:hover {
  145. background: #eaf8fa;
  146. }
  147. img {
  148. width: 20px;
  149. height: 20px;
  150. margin-right: 8px;
  151. }
  152. }
  153. }
  154. }
  155. .kf-phone-tooltip.el-tooltip__popper.is-light {
  156. border: 2px solid #ffffff;
  157. box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
  158. font-size: 14px;
  159. line-height: 22px;
  160. left: -240px;
  161. color: #1d1d1d;
  162. padding: 12px 20px;
  163. border-radius: 8px;
  164. box-sizing: border-box;
  165. }
  166. .qw-qrcode-tooltip.el-tooltip__popper.is-light {
  167. border: none;
  168. width: 364px;
  169. height: 306px;
  170. border-radius: 8px;
  171. padding: 0;
  172. box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
  173. img {
  174. width: 104px;
  175. height: 104px;
  176. }
  177. .text {
  178. text-align: center;
  179. font-size: 14px;
  180. line-height: 22px;
  181. }
  182. }
  183. </style>
  184. <style lang="scss" scoped>
  185. .custom-service-corner {
  186. .custom-btn {
  187. position: fixed;
  188. bottom: 50px;
  189. right: 32px;
  190. width: 40px;
  191. height: 40px;
  192. border-radius: 50%;
  193. background: #fff;
  194. text-align: center;
  195. line-height: 40px;
  196. box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
  197. cursor: pointer;
  198. z-index: 10;
  199. img {
  200. width: 24px;
  201. height: 24px;
  202. }
  203. }
  204. //.kf-phone {
  205. // font-size: 14px;
  206. // line-height: 22px;
  207. // left: -240px;
  208. // color: #1D1D1D;
  209. // padding: 12px 20px;
  210. // border-radius: 8px;
  211. // box-sizing: border-box;
  212. //}
  213. }
  214. .mini-custom {
  215. display: none;
  216. position: fixed;
  217. right: 84px;
  218. bottom: 80px;
  219. max-height: 674px;
  220. min-height: 400px;
  221. width: 460px;
  222. height: calc(100% - 40px);
  223. box-shadow: 0 0 20px 0 rgba(8, 31, 38, 0.12);
  224. border-radius: 8px;
  225. overflow: hidden;
  226. z-index: 9999;
  227. }
  228. @media screen and (max-height: 800px) {
  229. .mini-custom {
  230. bottom: 20px;
  231. }
  232. }
  233. </style>