ATFCustomerService.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="customer-service-container" style="height: 100%;padding: 20upx;box-sizing: border-box;">
  3. <scroll-view scroll-y style="height: 100%;">
  4. <view v-if="data && data.length">
  5. <view
  6. v-for="(item, index) in data" :key="index"
  7. style="display: flex;justify-content: space-between;align-items: center;margin-top: 30upx;"
  8. >
  9. <view style="flex: 1;display: flex;justify-content: space-between;align-items: center;">
  10. <JAvatar :src="common.seamingImgUrl(item.headImg)" :size="80" style="margin: 0 24upx 0 0;line-height: 1;">
  11. </JAvatar>
  12. <view style="flex: 1;display: flex;justify-content: space-between;">
  13. <view>{{ item.name }}</view>
  14. <view>
  15. <text v-if="item.state">在线</text>
  16. <text v-else>已下线</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view style="margin-left: 46upx;">
  21. <tui-button
  22. type="warning" width="120rpx" height="50rpx" shape="circle"
  23. @click="handleFlyToService(item.kfId)"
  24. >
  25. 选择
  26. </tui-button>
  27. </view>
  28. </view>
  29. </view>
  30. <view v-else>
  31. <tui-no-data :fixed="false" style="padding-top: 60upx;">暂无客服</tui-no-data>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. name: 'ATFCustomerService',
  39. props: {
  40. shopId: {
  41. type: [Number, String],
  42. default: ''
  43. },
  44. data: {
  45. type: Array,
  46. default: () => []
  47. }
  48. },
  49. data() {
  50. return {
  51. }
  52. },
  53. created() {
  54. },
  55. methods: {
  56. handleFlyToService(customerId) {
  57. this.$store.dispatch('app/flyToServiceAction', {
  58. shopId: this.shopId,
  59. customerId
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="less" scoped>
  66. .customer-service-container {}
  67. </style>