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.

index.vue 5.2 KiB

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