index.vue 3.2 KB

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