Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

233 строки
5.0 KiB

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