list.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <app-layout :haveBackground="false">
  3. <view class="page">
  4. <view class="search main-left cross-center">
  5. <image style="margin-right: 15rpx;" src="https://t17.9026.com/web/statics/image/sale/search_icon.png"
  6. mode=""></image><input type="text" v-model="searchVal" @input="search" placeholder-class="search_plh_class" placeholder="客户名、楼盘名">
  7. </view>
  8. <view class="list">
  9. <view class="main-between cross-center item" v-for="(item,index) in dataList" :key="index"
  10. @click="navCusmterInfo(item.id,item.name,item.mobile,item.user_id)">
  11. <view class="main-left">
  12. <view>
  13. <image style="width: 94rpx;height: 94rpx;border-radius: 50%;margin-right: 26rpx;"
  14. :src="item.avatar" mode=""></image>
  15. </view>
  16. <view class="main-between-y ">
  17. <view class="name cross-center">{{item.name}}
  18. <image style="width: 96rpx; height: 32rpx;margin-left: 10rpx;"
  19. :src="item.is_verify==1?'https://t17.9026.com/web/statics/image/index/ysm.png':''"
  20. mode=""></image>
  21. </view>
  22. <view class="addr t-omit">{{item.estate.name}} {{item.estate.estate_no}}{{item.estate.room_no}}
  23. </view>
  24. </view>
  25. </view>
  26. <image style="width: 13rpx;height: 21rpx;"
  27. src="https://t17.9026.com/web/statics/image/sale/arrow_right.png" mode=""></image>
  28. </view>
  29. <view class="no-more" v-if="noMore">没有更多了...</view>
  30. <view style="height: 200rpx;"></view>
  31. <app-no-goods v-if="dataList.length === 0" :title="'暂无数据'" background="#f7f7f7"></app-no-goods>
  32. </view>
  33. <navigator url="/pages/sale/cusmter/addCustomer" hover-class="navigator-hover" v-if="!why==='select_customer'">
  34. <button class="addPro" type="default">添加客户</button>
  35. </navigator>
  36. </view>
  37. </app-layout>
  38. </template>
  39. <script>
  40. import appNoGoods from '@/components/page-component/app-no-goods/app-no-goods.vue';
  41. export default {
  42. components:{
  43. appNoGoods
  44. },
  45. data() {
  46. return {
  47. searchVal:"",
  48. dataList: [],
  49. page:1,
  50. noMore:false,
  51. why:'',
  52. };
  53. },
  54. onLoad(option) {
  55. this.why=option.why
  56. this.getData()
  57. },
  58. onReachBottom() {
  59. if(!this.noMore){
  60. this.page++
  61. this.getData()
  62. }
  63. },
  64. methods: {
  65. search(){
  66. this.$utils.debounce(()=>{
  67. this.page=1
  68. this.getData()
  69. },800)
  70. },
  71. getData(){
  72. this.$showLoading()
  73. this.$request({
  74. url: this.$api.sale.customer_list,
  75. data: {
  76. page: this.page,
  77. keyword: this.searchVal,
  78. },
  79. method: 'post'
  80. }).then(res => {
  81. if (res.code === 0) {
  82. if(this.page===1){
  83. this.dataList = res.data.list
  84. }else{
  85. this.dataList=this.dataList.concat(res.data.list)
  86. }
  87. if(res.data.list.length<20){
  88. this.noMore=true
  89. }
  90. }
  91. this.$hideLoading()
  92. })
  93. },
  94. navCusmterInfo(id,name,mobile,user_id) {
  95. if(this.why==='select_customer'){
  96. let pages = getCurrentPages();
  97. let prevPage = pages[pages.length - 2]; //上一个页面
  98. prevPage.$vm.customerInfo={user_id:user_id,name:name,mobile:mobile}
  99. uni.navigateBack()
  100. }else{
  101. uni.navigateTo({
  102. url: `/pages/sale/cusmter/info?id=${id}`
  103. })
  104. }
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .page {
  111. min-height: 100vh;
  112. background-color: #fff;
  113. padding-top: 20rpx;
  114. }
  115. .search {
  116. width: 678rpx;
  117. height: 77rpx;
  118. background: #F8F8F8;
  119. border-radius: 39rpx;
  120. margin: auto;
  121. padding: 0 43rpx;
  122. input {
  123. width: 100%;
  124. }
  125. image {
  126. width: 24rpx;
  127. height: 27rpx;
  128. }
  129. }
  130. /deep/.search_plh_class {
  131. font-size: 28rpx;
  132. font-family: PingFang SC;
  133. font-weight: 500;
  134. color: #999999;
  135. }
  136. .list {margin-top: 20rpx;
  137. .item {
  138. background-color: #fff;
  139. height: 145rpx;
  140. width: 678rpx;
  141. margin: 0 auto;
  142. border-bottom: 1rpx solid #EEEEEE;
  143. .name {
  144. font-size: 32rpx;
  145. font-family: PingFang SC;
  146. font-weight: bold;
  147. color: #222222;
  148. }
  149. .addr {
  150. width: 490rpx;
  151. font-size: 24rpx;
  152. font-family: PingFang SC;
  153. font-weight: 500;
  154. color: #999999;
  155. }
  156. }
  157. }
  158. .addPro {
  159. position: fixed;
  160. bottom: 0;
  161. width: 100%;
  162. height: 100rpx;
  163. background: #A18353;
  164. font-size: 32rpx;
  165. font-family: PingFang SC;
  166. font-weight: bold;
  167. color: #FFFFFF;
  168. }
  169. .no-more {
  170. font-size: 24rpx;
  171. font-weight: 500;
  172. color: #666666;
  173. margin-top: 37rpx;
  174. text-align: center;
  175. }
  176. </style>