index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <!-- 客服列表 -->
  3. <view v-if="show" :style="colorStyle">
  4. <view class="discountInfo on">
  5. <view class="title">
  6. 客服列表
  7. <view class="btn acea-row row-center-wrapper" style="flex-wrap: nowrap;" @click="closeDiscount"><text class="iconfont icon-ic_close"></text></view>
  8. </view>
  9. <view class="list">
  10. <view class="item acea-row row-middle" v-for="(item,index) in customerList" :key="index">
  11. <image :src="item.avatar" mode="" class="img"></image>
  12. <view class="text">{{item.staff_name}}</view>
  13. <view class="contact acea-row row-center-wrapper" @click="callPhone(item)">
  14. <view class="inner">联系客服</view>
  15. </view>
  16. </view>
  17. </view>
  18. <slot name="bottom"></slot>
  19. </view>
  20. <view class="mask" @touchmove.prevent :hidden="false" @click="closeDiscount"></view>
  21. </view>
  22. </template>
  23. <script>
  24. import colors from "@/mixins/color";
  25. export default {
  26. props: {
  27. customerList: {
  28. type: Array,
  29. default: []
  30. },
  31. customerType:{
  32. type:Number,
  33. default:1
  34. }
  35. },
  36. mixins:[colors],
  37. data() {
  38. return {
  39. show: false,
  40. };
  41. },
  42. mounted() {},
  43. methods: {
  44. closeDiscount() {
  45. this.$emit('closeKefu')
  46. },
  47. callPhone(item) {
  48. if(this.customerType == 1){
  49. if (item.customer_phone) {
  50. uni.makePhoneCall({
  51. phoneNumber: item.customer_phone //仅为示例
  52. });
  53. }
  54. }else{
  55. uni.navigateTo({
  56. url: '/pages/store/service/index?id='+item.id
  57. })
  58. }
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .discountInfo {
  65. position: fixed;
  66. bottom: 0;
  67. width: 100%;
  68. left: 0;
  69. background-color: #fff;
  70. z-index: 300;
  71. border-radius: 40rpx 40rpx 0 0;
  72. transform: translate3d(0, 100%, 0);
  73. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  74. padding-bottom: 22rpx;
  75. padding-bottom: calc(22rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  76. padding-bottom: calc(22rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  77. .title {
  78. height: 108rpx;
  79. font-weight: 500;
  80. font-size: 32rpx;
  81. line-height: 108rpx;
  82. color: #333333;
  83. text-align: center;
  84. position: relative;
  85. .btn {
  86. position: absolute;
  87. top: 50%;
  88. right: 32rpx;
  89. width: 36rpx;
  90. height: 36rpx;
  91. border-radius: 50%;
  92. background: #EEEEEE;
  93. transform: translateY(-50%);
  94. text-align: center;
  95. line-height: 36rpx;
  96. }
  97. .iconfont {
  98. font-size: 24rpx;
  99. color: #999999;
  100. vertical-align: text-bottom;
  101. }
  102. }
  103. .list {
  104. height: 750rpx;
  105. margin: 34rpx 32rpx;
  106. overflow-x: hidden;
  107. overflow-y: auto;
  108. .item {
  109. height: 80rpx;
  110. margin-bottom: 40rpx;
  111. .img {
  112. width: 80rpx;
  113. height: 80rpx;
  114. border-radius: 50%;
  115. border: 1rpx solid #EEEEEE;
  116. transform: rotateZ(360deg);
  117. }
  118. .text {
  119. flex: 1;
  120. padding: 0 20rpx;
  121. font-size: 28rpx;
  122. color: #333333;
  123. }
  124. .contact {
  125. width: 166rpx;
  126. height: 56rpx;
  127. border-radius: 40rpx;
  128. background: var(--view-theme);
  129. text-align: center;
  130. font-size: 24rpx;
  131. line-height: 56rpx;
  132. color: var(--view-theme);
  133. // overflow: hidden;
  134. .inner {
  135. width: 168rpx;
  136. height: 56rpx;
  137. // border-radius: 28rpx;
  138. background: rgba(255, 255, 255, 0.9);
  139. }
  140. }
  141. }
  142. }
  143. }
  144. .on {
  145. transform: translate3d(0, 0, 0);
  146. }
  147. </style>