CustomServiceCorner.vue 5.4 KB

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