AI销管
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

258 řádky
5.2 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. onPullDownRefresh(){
  69. this.changeAgentListShow()
  70. this.changePausedAgentListShow()
  71. setTimeout(function () {
  72. uni.stopPullDownRefresh();
  73. }, 1000);
  74. },
  75. computed: {
  76. activeAgentList() {
  77. return this.activeTotal == 1 ? this.agentList : this.pausedAgentList
  78. },
  79. },
  80. methods: {
  81. tabtimetap(idx) {
  82. // console.log(idx)
  83. this.activeTotal = idx
  84. },
  85. changeAgentListShow() {
  86. this.$u.get("/zkAgentPool/nextFreeAgent?itemId=" + this.houseId).then(res => {
  87. this.agentList = res;
  88. })
  89. },
  90. // 获取暂停的经纪人列表
  91. changePausedAgentListShow() {
  92. this.$u.get("/zkAgentPool/stopAgentList?itemId=" + this.houseId).then(res => {
  93. this.pausedAgentList = res;
  94. })
  95. },
  96. changeAgentStatus(id) {
  97. let content = "";
  98. if (this.activeTotal == 1) {
  99. content = "确定当前顾问暂停接待?";
  100. } else {
  101. content = "确定取消暂停?";
  102. }
  103. uni.showModal({
  104. content,
  105. cancelColor: "#999999",
  106. success: res => {
  107. if (res.confirm) {
  108. this.$u.get("/zkAgentPool/update", {
  109. agentId: id,
  110. status: this.activeTotal == 1 ? 2 : 0
  111. }).then(res => {
  112. uni.showToast({
  113. icon: "none",
  114. title: "操作成功",
  115. })
  116. this.changeAgentListShow()
  117. this.changePausedAgentListShow()
  118. })
  119. }
  120. },
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .box {
  128. background: #F8F8F8;
  129. width: 100%;
  130. min-height: 100vh;
  131. font-size: 30rpx;
  132. font-weight: 400;
  133. .header {
  134. position: sticky;
  135. top: var(--window-top);
  136. z-index: 999;
  137. }
  138. // line-height: 30px;
  139. .tab {
  140. height: 88rpx;
  141. border-bottom: 1px solid #E0E0E0;
  142. background: #FFFFFF;
  143. display: flex;
  144. align-items: center;
  145. .tabbox {
  146. flex: 1;
  147. height: 100%;
  148. text-align: center;
  149. line-height: 92rpx;
  150. color: #666666;
  151. font-size: 28rpx;
  152. display: flex;
  153. justify-content: center;
  154. .activecllasscet {
  155. border-bottom: 2px solid #2671E2;
  156. color: #2671E2;
  157. font-weight: 600;
  158. }
  159. }
  160. }
  161. .nextcon {
  162. height: 78rpx;
  163. background: #F4F8FD;
  164. color: #2671E2;
  165. text-align: center;
  166. line-height: 78rpx;
  167. }
  168. .content-tips {
  169. background: #fff;
  170. padding: 0 30rpx;
  171. height: 168rpx;
  172. margin-bottom: 20rpx;
  173. overflow: hidden;
  174. .top {
  175. margin-top: 19rpx;
  176. display: flex;
  177. justify-content: space-between;
  178. .tit {
  179. height: 52rpx;
  180. display: flex;
  181. .img {
  182. width: 52rpx;
  183. height: 52rpx;
  184. border-radius: 50%;
  185. line-height: 47rpx;
  186. text-align: center;
  187. background: #FFFFFF;
  188. border: 1px solid #C9C9C9;
  189. margin-right: 20rpx;
  190. }
  191. .test {
  192. font-weight: 600;
  193. color: #333333;
  194. margin-top: 6rpx;
  195. }
  196. }
  197. .state {
  198. display: flex;
  199. .point {
  200. width: 12rpx;
  201. height: 12rpx;
  202. background: #2B6EFF;
  203. border-radius: 50%;
  204. margin-right: 9rpx;
  205. margin-top: 16rpx;
  206. }
  207. }
  208. }
  209. .reception {
  210. display: flex;
  211. font-weight: 400;
  212. width: 100%;
  213. margin-top: 28rpx;
  214. justify-content: space-between;
  215. color: #666666;
  216. line-height: 30rpx;
  217. .btn {
  218. width: 100rpx;
  219. height: 48rpx;
  220. background: #FFFFFF;
  221. border-radius: 4rpx;
  222. border: 1px solid #C9C9C9;
  223. text-align: center;
  224. line-height: 48rpx;
  225. color: #333333;
  226. font-size: 28rpx;
  227. }
  228. }
  229. }
  230. }
  231. .nolist {
  232. text-align: center;
  233. height: 300rpx;
  234. color: #CCCCCC;
  235. line-height: 300rpx;
  236. }
  237. </style>