check.vue 11 KB

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