check.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <view>
  3. <wm-watermark :text="userInfo2.phone" :num="50"></wm-watermark>
  4. <view class="customer-list-wrap">
  5. <view v-if="customerList.length == 0" class="empty-wrap"><u-empty mode="list" text="暂无相关客户"></u-empty></view>
  6. <view v-for="(item, index) in customerList" class="customer-item" :key="index">
  7. <view class="info">
  8. <view class="customer">
  9. <view class="relname">
  10. {{groupTypeObj[item.group_type]}}:{{ item.nickname }}{{item.dept_code ? `(${item.dept_code})` : ''}}
  11. </view>
  12. <view class="item" @click="dial(item.phone)">
  13. <u-icon class="u-m-r-5" name="phone" size="22"></u-icon>
  14. {{ item.phone }}
  15. <u-tag
  16. :text="`认证:${authStateObj[item.auth_state]}`"
  17. :type="item.auth_state == 1 ? 'success' : item.auth_state == 2 ? 'warning' : 'error'"
  18. size="mini"
  19. class="u-m-l-20 u-m-r-10"
  20. ></u-tag>
  21. <u-tag
  22. :text="item.bind_wechat == 1 ? '已绑定微信' : '未绑定微信'"
  23. :type="item.bind_wechat == 1 ? 'success' : 'warning'"
  24. size="mini"
  25. ></u-tag>
  26. </view>
  27. <!-- <view class="item">
  28. <u-icon class="u-m-r-5" name="home" size="22"></u-icon>
  29. {{ item.estate_name }}
  30. </view> -->
  31. <!-- <view class="item">
  32. <u-icon class="u-m-r-5" name="rmb" size="22"></u-icon>
  33. 预期最高收益{{ item.commission }}
  34. </view> -->
  35. </view>
  36. <view class="data-wrap">
  37. <view class="date u-m-t-5 u-m-b-20">推荐人:{{item.referrer || '未填'}}</view>
  38. <!-- -->
  39. <u-tag
  40. @click="pageTo(`/pages/saler/deal?id=${item.id}&name=${item.nickname}-${item.phone}&gt=${item.group_type}`)"
  41. v-if="item.auth_state == 2"
  42. text="审核"
  43. type="primary"
  44. ></u-tag>
  45. <!-- <view class="date">保护期截止:{{item.lock_at}}</view> -->
  46. </view>
  47. </view>
  48. <view class="scoped-list-img-more">
  49. <view class="slim-tips" @click="itemImgShowHandle(index)">
  50. <view class="li">身份证:{{item.id_number}}</view>
  51. <!-- <view class="li">银行卡:{{item.bank_number}}</view> -->
  52. <view class="b">{{item.isImgShow ? '收缩图片<' : '展开图片>'}}</view>
  53. </view>
  54. <view class="slim-content" v-if="item.isImgShow">
  55. <view class="op">
  56. <image class="img" :src="item.id_card_front" mode="aspectFit" @click="previewImgHandle(item.id_card_front, [item.id_card_front])"></image>
  57. </view>
  58. <view class="op">
  59. <image class="img" :src="item.id_card_revers" mode="aspectFit" @click="previewImgHandle(item.id_card_revers, [item.id_card_revers])"></image>
  60. </view>
  61. <!-- <view class="op">
  62. <image class="img" :src="item.bank_card" mode="aspectFit" @click="previewImgHandle(item.bank_card, [item.bank_card])"></image>
  63. </view> -->
  64. <view class="op" v-if="item.busines_licens">
  65. <image class="img" :src="item.busines_licens" mode="aspectFit" @click="previewImgHandle(item.busines_licens, [item.busines_licens])"></image>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="float-search" @click="searchPopupShow = true"><u-icon name="search" size="42" color="#fff"></u-icon></view>
  72. <!-- 平台佣金政策弹窗 -->
  73. <u-popup v-model="searchPopupShow" mode="center" width="80%" height="440rpx" border-radius="20">
  74. <view class="bwin-popup">
  75. <view class="popup-header">用户搜索</view>
  76. <view class="popup-body">
  77. <u-input v-model="searchFormData.nickname" border placeholder="请输入昵称(支持模糊搜索)"></u-input>
  78. <u-divider marginTop="10" marginBottom="10"></u-divider>
  79. <u-input v-model="searchFormData.phone" border placeholder="请输入手机号(可仅输入一部分)"></u-input>
  80. </view>
  81. <view class="popup-footer" style="position: absolute;">
  82. <u-button size="medium" @click="searchPopupShow = false">取消</u-button>
  83. <u-button size="medium" type="primary" @click="searchHandle()">搜索</u-button>
  84. </view>
  85. </view>
  86. </u-popup>
  87. <u-loadmore
  88. v-if="customerList.length > 0"
  89. marginTop="32"
  90. :line="true"
  91. :status="loadmore.status"
  92. :loading-text="loadmore.loadingText"
  93. :loadmore-text="loadmore.defaultText"
  94. :nomore-text="loadmore.nomoreText"
  95. />
  96. </view>
  97. </template>
  98. <script>
  99. import { arrToObj } from '@/utils'
  100. import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'
  101. import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'
  102. export default {
  103. components: {
  104. wmWatermark
  105. },
  106. data() {
  107. return {
  108. searchKeyword: null,
  109. searchPopupShow: false,
  110. searchFormData: {
  111. name: '',
  112. phone: ''
  113. }, // 搜索栏数据
  114. orderMethod: 0,
  115. filterDropdownValue: {}, // 默认筛选
  116. customerList: [], // 客户列表
  117. stepList: ['审核中', '未到访', '已到访', '已认购', '已签约', '已结佣'],
  118. loadmore: {
  119. status: 'loadmore',
  120. loadingText: '努力加载中',
  121. defaultText: '轻轻上拉 查看更多',
  122. nomoreText: '实在没有了',
  123. currnetPage: 1
  124. },
  125. curRoles: '',
  126. userInfo2: {},
  127. authStateObj: {},
  128. groupTypeObj: {},
  129. };
  130. },
  131. onLoad(params) {
  132. this.getDataList()
  133. this.userInfo2 = uni.getStorageSync('MD_userInfo2')
  134. this.curRoles = uni.getStorageSync('MD_userInfo2') ? uni.getStorageSync('MD_userInfo2').roles : ''
  135. const dictObj = uni.getStorageSync('MD_dict')
  136. this.authStateObj = arrToObj(dictObj.auth_state)
  137. this.groupTypeObj = arrToObj(dictObj.group_type)
  138. },
  139. onReachBottom() {
  140. if (this.loadmore.status == 'nomore') return;
  141. this.loadmore.currnetPage++
  142. this.getDataList()
  143. },
  144. onPullDownRefresh() {
  145. // 防止频繁刷新
  146. },
  147. methods: {
  148. dial(tel) {
  149. uni.makePhoneCall({
  150. phoneNumber: tel
  151. });
  152. },
  153. previewImgHandle (current, urls){
  154. uni.previewImage({
  155. current,
  156. urls
  157. })
  158. },
  159. itemImgShowHandle (index) {
  160. let list = this.customerList || []
  161. list[index].isImgShow = !list[index].isImgShow
  162. this.customerList = JSON.parse(JSON.stringify(list))
  163. },
  164. copyTextHandle (item) {
  165. uniCopy({
  166. content: `${item.name}-${item.sex == 'male'?'男':'女'}-${item.phone}`,
  167. success:(res)=>{
  168. uni.showToast({
  169. title: res,
  170. icon: 'none'
  171. })
  172. },
  173. error:(e)=>{
  174. uni.showToast({
  175. title: e,
  176. icon: 'none',
  177. duration:3000,
  178. })
  179. }
  180. })
  181. },
  182. getDataList (bc) {
  183. const that = this
  184. let params = {
  185. // auth_state: 2,
  186. ...this.searchFormData
  187. }
  188. if (that.orderMethod > 0) {
  189. if (that.orderMethod === 1) {
  190. params.order_by = JSON.stringify([{
  191. field: 'create_at',
  192. sort: 'desc',
  193. }])
  194. }
  195. if (that.orderMethod === 2) {
  196. params.order_by = JSON.stringify([{
  197. field: 'create_at',
  198. sort: 'asc',
  199. }])
  200. }
  201. }
  202. uni.api.base.apiuserauthlist({
  203. page: that.loadmore.currnetPage,
  204. ...params,
  205. }).then(res => {
  206. let list = res.list || []
  207. list.map(item => {
  208. item.isImgShow = false
  209. })
  210. if (list.length < 10) {
  211. that.loadmore.status = 'nomore';
  212. }
  213. if (res.current_page === 1) {
  214. if (list.length === 0) {
  215. uni.$msg('无搜索结果', 'none');
  216. }
  217. that.customerList = [...list]
  218. } else {
  219. that.customerList = that.customerList.concat(list)
  220. }
  221. if (bc) bc()
  222. })
  223. },
  224. customBack() {
  225. uni.navigateBack();
  226. },
  227. // 带监听器跳转
  228. pageTo(url, data) {
  229. /// xxxxx
  230. uni.navigateTo({
  231. url: url,
  232. events: {
  233. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  234. update: function(data) {
  235. // 当B页面运行 eventChannel.emit('update', { a:1 }); 时,会运行这里的代码逻辑。
  236. }
  237. },
  238. success: function(res) {
  239. // 通过eventChannel向被打开页面传送数据
  240. res.eventChannel.emit('data', data);
  241. }
  242. });
  243. },
  244. searchHandle() {
  245. this.loadmore.currnetPage = 1
  246. this.getDataList(() => {
  247. this.searchPopupShow = false
  248. })
  249. },
  250. getTime(n) {
  251. let date = n ? new Date(n) : new Date()
  252. let year = date.getFullYear()
  253. let month = date.getMonth() + 1
  254. month = month > 9 ? month : '0' + month
  255. let day = date.getDate()
  256. day = day > 9 ? day : '0' + day
  257. let hour = date.getHours()
  258. hour = hour > 9 ? hour : '0' + hour
  259. let minute = date.getMinutes()
  260. minute = minute > 9 ? minute : '0' + minute
  261. let second = date.getSeconds()
  262. second = second > 9 ? second : '0' + second
  263. return `${year}-${month}-${day} ${hour}:${minute}:${second}`
  264. },
  265. }
  266. };
  267. </script>
  268. <style lang="scss">
  269. .search-wrap {
  270. padding: 20rpx;
  271. }
  272. .filter-wrap {
  273. position: relative;
  274. }
  275. // 列表
  276. .customer-list-wrap {
  277. width: 100%;
  278. .customer-item {
  279. display: flex;
  280. flex-direction: column;
  281. align-items: flex-start;
  282. font-size: $u-p2;
  283. color: $u-content-color;
  284. border-bottom: 1rpx solid $u-border-color;
  285. padding: 24rpx 32rpx;
  286. .info {
  287. display: flex;
  288. align-items: flex-start;
  289. justify-content: space-between;
  290. width: 100%;
  291. margin-bottom: 10rpx;
  292. .customer {
  293. display: flex;
  294. flex-direction: column;
  295. align-items: flex-start;
  296. .relname {
  297. color: $u-main-color;
  298. font-size: $u-p;
  299. font-weight: bold;
  300. margin-bottom: 10rpx;
  301. }
  302. .item {
  303. margin-bottom: 10rpx;
  304. }
  305. }
  306. .data-wrap {
  307. text-align: right;
  308. .date {
  309. font-size: $u-sub;
  310. }
  311. }
  312. }
  313. .tool-wrap {
  314. display: flex;
  315. align-items: center;
  316. justify-content: space-between;
  317. width: 100%;
  318. }
  319. }
  320. }
  321. .float-search {
  322. opacity: 0.9;
  323. position: fixed;
  324. right: 20rpx;
  325. bottom: 40rpx;
  326. padding: 20rpx;
  327. border-radius: 50%;
  328. background-color: $u-theme-color;
  329. }
  330. .scoped-list-more-info {
  331. position: absolute;
  332. right: 20rpx;
  333. }
  334. .scoped-list-img-more {
  335. .slim-tips {
  336. padding-left: 120rpx;
  337. position: relative;
  338. padding-bottom: 10rpx;
  339. .b {
  340. position: absolute;
  341. left: 0;
  342. top: 0;
  343. color: #2080f0;
  344. }
  345. }
  346. .op {
  347. display: inline-block;
  348. vertical-align: middle;
  349. height: 150rpx;
  350. width: 150rpx;
  351. margin-right: 10rpx;
  352. &:last-child {
  353. margin-right: 0;
  354. }
  355. .img {
  356. height: 150rpx;
  357. width: 150rpx;
  358. }
  359. }
  360. }
  361. </style>