AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

251 lines
5.0 KiB

  1. <template>
  2. <view class="box">
  3. <!-- 顾问选择 -->
  4. <view class="header">
  5. <view class="nextcon">
  6. 下一位接待顾问:{{agentList[0].name||'没有下一位了'}}
  7. </view>
  8. <view class="tab">
  9. <view class="tabbox">
  10. <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1)">排队顾问</view>
  11. </view>
  12. <view class="tabbox">
  13. <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2)">暂停顾问</view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="content">
  18. <view v-if="activeAgentList.length>0">
  19. <view v-for="(item,index) in activeAgentList" :key="index">
  20. <view class="content-tips">
  21. <view class="top">
  22. <view class="tit">
  23. <view class="img">
  24. {{item.name.slice(0,1)}}
  25. </view>
  26. <view class="test">
  27. {{item.name}}
  28. </view>
  29. </view>
  30. <!-- <view class="state">
  31. <view class="point" v-if="activeTotal==1"></view>
  32. {{activeTotal==1?'接待中':'空闲'}}
  33. </view> -->
  34. </view>
  35. <view class="reception">
  36. <view class="" style="line-height: 50rpx;">
  37. 今日接待:<test class="num">{{item.receiveNum||0}}</test>
  38. </view>
  39. <view class="btn" @click="changeAgentStatus(item.agentId)">
  40. {{activeTotal==1?'暂停':'恢复'}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="nolist" v-else>
  47. 暂无数据
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. value: "",
  57. activeTotal: 1,
  58. agentList: [],
  59. pausedAgentList: [],
  60. houseId: ''
  61. }
  62. },
  63. onLoad() {
  64. this.houseId = uni.getStorageSync('buildingID').id;
  65. this.changeAgentListShow()
  66. this.changePausedAgentListShow()
  67. },
  68. computed: {
  69. activeAgentList() {
  70. return this.activeTotal == 1 ? this.agentList : this.pausedAgentList
  71. },
  72. },
  73. methods: {
  74. tabtimetap(idx) {
  75. // console.log(idx)
  76. this.activeTotal = idx
  77. },
  78. changeAgentListShow() {
  79. this.$u.get("/zkAgentPool/nextFreeAgent?itemId=" + this.houseId).then(res => {
  80. this.agentList = res;
  81. })
  82. },
  83. // 获取暂停的经纪人列表
  84. changePausedAgentListShow() {
  85. this.$u.get("/zkAgentPool/stopAgentList?itemId=" + this.houseId).then(res => {
  86. this.pausedAgentList = res;
  87. })
  88. },
  89. changeAgentStatus(id) {
  90. let content = "";
  91. if (this.activeTotal == 1) {
  92. content = "确定当前顾问暂停接待?";
  93. } else {
  94. content = "确定取消暂停?";
  95. }
  96. uni.showModal({
  97. content,
  98. cancelColor: "#999999",
  99. success: res => {
  100. if (res.confirm) {
  101. this.$u.get("/zkAgentPool/update", {
  102. agentId: id,
  103. status: this.activeTotal == 1 ? 2 : 0
  104. }).then(res => {
  105. uni.showToast({
  106. icon: "none",
  107. title: "操作成功",
  108. })
  109. this.changeAgentListShow()
  110. this.changePausedAgentListShow()
  111. })
  112. }
  113. },
  114. })
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .box {
  121. background: #F8F8F8;
  122. width: 100%;
  123. min-height: 100vh;
  124. font-size: 30rpx;
  125. font-weight: 400;
  126. .header {
  127. position: sticky;
  128. top: var(--window-top);
  129. z-index: 999;
  130. }
  131. // line-height: 30px;
  132. .tab {
  133. height: 88rpx;
  134. border-bottom: 1px solid #E0E0E0;
  135. background: #FFFFFF;
  136. display: flex;
  137. align-items: center;
  138. .tabbox {
  139. flex: 1;
  140. height: 100%;
  141. text-align: center;
  142. line-height: 92rpx;
  143. color: #666666;
  144. font-size: 28rpx;
  145. display: flex;
  146. justify-content: center;
  147. .activecllasscet {
  148. border-bottom: 2px solid #2671E2;
  149. color: #2671E2;
  150. font-weight: 600;
  151. }
  152. }
  153. }
  154. .nextcon {
  155. height: 78rpx;
  156. background: #F4F8FD;
  157. color: #2671E2;
  158. text-align: center;
  159. line-height: 78rpx;
  160. }
  161. .content-tips {
  162. background: #fff;
  163. padding: 0 30rpx;
  164. height: 168rpx;
  165. margin-bottom: 20rpx;
  166. overflow: hidden;
  167. .top {
  168. margin-top: 19rpx;
  169. display: flex;
  170. justify-content: space-between;
  171. .tit {
  172. height: 52rpx;
  173. display: flex;
  174. .img {
  175. width: 52rpx;
  176. height: 52rpx;
  177. border-radius: 50%;
  178. line-height: 47rpx;
  179. text-align: center;
  180. background: #FFFFFF;
  181. border: 1px solid #C9C9C9;
  182. margin-right: 20rpx;
  183. }
  184. .test {
  185. font-weight: 600;
  186. color: #333333;
  187. margin-top: 6rpx;
  188. }
  189. }
  190. .state {
  191. display: flex;
  192. .point {
  193. width: 12rpx;
  194. height: 12rpx;
  195. background: #2B6EFF;
  196. border-radius: 50%;
  197. margin-right: 9rpx;
  198. margin-top: 16rpx;
  199. }
  200. }
  201. }
  202. .reception {
  203. display: flex;
  204. font-weight: 400;
  205. width: 100%;
  206. margin-top: 28rpx;
  207. justify-content: space-between;
  208. color: #666666;
  209. line-height: 30rpx;
  210. .btn {
  211. width: 100rpx;
  212. height: 48rpx;
  213. background: #FFFFFF;
  214. border-radius: 4rpx;
  215. border: 1px solid #C9C9C9;
  216. text-align: center;
  217. line-height: 48rpx;
  218. color: #333333;
  219. font-size: 28rpx;
  220. }
  221. }
  222. }
  223. }
  224. .nolist {
  225. text-align: center;
  226. height: 300rpx;
  227. color: #CCCCCC;
  228. line-height: 300rpx;
  229. }
  230. </style>