AI销管
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

377 rader
8.7 KiB

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