AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

consumerSearch.vue 7.4 KiB

2 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view class="box">
  3. <view class="search-box">
  4. <u-search class="search-boxs" placeholder="请输入" v-model="keyword" action-text="搜索" :show-action="true"
  5. @search="searchinfo" @custom="searchinfo"></u-search>
  6. </view>
  7. <!-- 搜索结果 -->
  8. <view class="search-result" v-if="recordList.length > 0">
  9. 筛选结果:<text class="result-num">{{ recordList.length + 1 }}</text>条
  10. </view>
  11. <view class="content">
  12. <view class="content-tips" v-for="(item,index) in recordList" :key='index' @click="gotoDetail(item.id)">
  13. <view class="content-first">
  14. <view class="left">
  15. <template v-if="item.level > 0">
  16. <view class="img">{{ item.level | levelText }}</view>
  17. </template>
  18. <view class="test">{{item.name}}</view>
  19. </view>
  20. <view class="right">
  21. {{item.fraction || '0'}}%
  22. <image class="right-img" src="../../../static/images/arrow-right.png" mode=""></image>
  23. </view>
  24. </view>
  25. <view class="content-sec">
  26. <view class="content-sec-lab">
  27. 客户手机:<view class="content-sec-lab1">{{item.phone | phoneText}}</view>
  28. </view>
  29. <view class="content-sec-lab">
  30. 负责顾问:<view class="content-sec-lab1">{{item.agentName}}</view>
  31. </view>
  32. <view class="content-sec-lab" style="line-height: 46rpx;">
  33. 客户意向:
  34. <text v-if="item.demand.cusSemanticWordsList==null">暂无</text>
  35. <template v-else>
  36. <block v-for="(che,ind) in item.demand.cusSemanticWordsList" :key='ind'>
  37. <view class="content-sec-tips">{{che.name}}</view>
  38. </block>
  39. </template>
  40. </view>
  41. <view class="content-sec-lab">
  42. 添加时间:<view class="content-sec-lab1">{{item.createTime | formatTime}}</view>
  43. </view>
  44. <view class="content-sec-num">
  45. <view class="">{{item.visitRecord || '--'}}次到访 | {{item.mm || '0'}}<text style="font-size: 24rpx;">min</text></view>
  46. </view>
  47. </view>
  48. </view>
  49. <template v-if="recordList.length==0" >
  50. <view style="width: 100%;height: 100%;display: flex;align-items: center;">
  51. <view style="width: 100%;height: 100%;padding-top: 200rpx;">
  52. <view style="width: 100%;text-align: center;">
  53. <image style="width: 220rpx;height: 200rpx;"
  54. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  55. </view>
  56. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  57. </view>
  58. </view>
  59. </template>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. keyword: '',
  68. recordList: [],
  69. nextPage: 1,
  70. totalRecord: '',
  71. buildingID: '',
  72. permissions: {
  73. commonly1: false
  74. }
  75. }
  76. },
  77. onShow() {
  78. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  79. this.permissions.commonly1 = newmenulist.khgl_ck;
  80. this.buildingID = uni.getStorageSync('buildingID').id;
  81. this.nextPage = 1;
  82. this.recordList = [];
  83. },
  84. onReachBottom() {
  85. if (this.totalRecord == this.nextPage) {
  86. uni.showToast({
  87. icon: 'none',
  88. title: '到底了',
  89. duration: 2000
  90. });
  91. return
  92. } else {
  93. this.nextPage += 1;
  94. this.getMyCustom();
  95. }
  96. },
  97. methods: {
  98. // 客户详情
  99. gotoDetail(id) {
  100. if (this.permissions.commonly1 == true) {
  101. uni.navigateTo({
  102. url: `/pages/center/consumer/consumerDetail?id=${id}`
  103. })
  104. }
  105. },
  106. searchinfo() {
  107. this.nextPage = 1;
  108. this.recordList = [];
  109. this.getMyCustom();
  110. },
  111. getMyCustom() {
  112. var parames = {
  113. pageNum: this.nextPage,
  114. pageSize: 10,
  115. query: {
  116. projectId: this.buildingID,
  117. nameOrPhone: this.keyword
  118. }
  119. };
  120. this.$u.post("/customer/customerManagement", parames).then(data => {
  121. var list = data.results || [];
  122. list.forEach(item => {
  123. if (item.demand.cusSemanticWordsList != null) {
  124. item.demand.cusSemanticWordsList.forEach(che => {
  125. if (che.isInterval == 0) {
  126. che.name = che.name + che.unit + '-' + che.endName + che.unit;
  127. }
  128. })
  129. }
  130. })
  131. this.recordList = [...this.recordList, ...list];
  132. this.totalRecord = data.totalPage;
  133. })
  134. },
  135. },
  136. filters: {
  137. // 筛选等级展示文字
  138. levelText(level) {
  139. let str = '';
  140. switch (Number(level)) {
  141. case 1:
  142. str = "A"
  143. break;
  144. case 2:
  145. str = "A"
  146. break;
  147. case 3:
  148. str = "A"
  149. break;
  150. case 4:
  151. str = "A"
  152. break;
  153. default:
  154. str = ''
  155. break;
  156. }
  157. return str
  158. },
  159. // 加密手机
  160. phoneText(mobile) {
  161. if (!mobile) return '--'
  162. return mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
  163. },
  164. // 格式化时间
  165. formatTime(time) {
  166. if (!time) return
  167. return time.substring(5, time.length)
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. .box {
  174. width: 100%;
  175. min-height: calc(100vh - var(--window-top));
  176. background: #F8F8F8;
  177. .search-box {
  178. width: 100%;
  179. height: 102rpx;
  180. background: #fff;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. .search-boxs {
  185. width: 686rpx;
  186. }
  187. }
  188. .search-result {
  189. width: 100%;
  190. height: 78rpx;
  191. display: flex;
  192. align-items: center;
  193. justify-content: center;
  194. background: #F4F8FD;
  195. .result-num {
  196. font-size: 30rpx;
  197. color: #2671E2;
  198. }
  199. }
  200. }
  201. .content {
  202. padding: 0 0 20rpx 0;
  203. .content-tips {
  204. margin-top: 20rpx;
  205. background: #fff;
  206. .content-first {
  207. padding: 19rpx 30rpx;
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. box-sizing: border-box;
  212. color: #292929;
  213. height: 90rpx;
  214. font-size: 30rpx;
  215. .left {
  216. display: flex;
  217. align-items: center;
  218. .img {
  219. width: 52rpx;
  220. height: 52rpx;
  221. border: 1px solid #E0E0E0;
  222. border-radius: 50%;
  223. text-align: center;
  224. line-height: 50rpx;
  225. margin-right: 20rpx;
  226. }
  227. .test {
  228. font-weight: 500;
  229. color: #333333;
  230. }
  231. }
  232. .right {
  233. display: flex;
  234. align-items: center;
  235. color: #2671E2;
  236. font-size: 30rpx;
  237. .right-img {
  238. margin: 5rpx 0 0 10rpx;
  239. width: 14rpx;
  240. height: 30rpx;
  241. }
  242. }
  243. }
  244. .content-sec {
  245. border-top: 1px solid #E0E0E0;
  246. padding: 0 30rpx;
  247. padding-bottom: 30rpx;
  248. position: relative;
  249. .content-sec-lab {
  250. margin-top: 30rpx;
  251. display: flex;
  252. font-size: 30rpx;
  253. font-weight: 400;
  254. color: #666666;
  255. line-height: 46rpx;
  256. .content-sec-lab1 {
  257. color: #333333;
  258. }
  259. .content-sec-tips {
  260. max-width: 160rpx;
  261. height: 46rpx;
  262. background: #F2F2F2;
  263. border-radius: 6rpx;
  264. text-align: center;
  265. line-height: 26rpx;
  266. overflow: hidden;
  267. text-overflow: ellipsis;
  268. white-space: nowrap;
  269. font-size: 26rpx;
  270. font-weight: 400;
  271. color: #333333;
  272. margin-right: 20rpx;
  273. box-sizing: border-box;
  274. padding: 10rpx 24rpx;
  275. }
  276. }
  277. .content-sec-num {
  278. position: absolute;
  279. bottom: 25rpx;
  280. right: 30rpx;
  281. padding: 3rpx 12rpx;
  282. background: #F4F8FD;
  283. border-radius: 6rpx;
  284. color: #2671E2;
  285. line-height: 45rpx;
  286. text-align: center;
  287. }
  288. }
  289. .content-last {
  290. display: flex;
  291. border-top: 1px solid #E0E0E0;
  292. // padding: 0 30rpx;
  293. height: 78rpx;
  294. .content-last-tab {
  295. width: 33.4%;
  296. text-align: center;
  297. font-size: 30rpx;
  298. font-weight: 400;
  299. color: #333333;
  300. line-height: 78rpx;
  301. border-right: 1px solid #E0E0E0;
  302. }
  303. }
  304. }
  305. }
  306. </style>