check.vue 11 KB

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