buycheck.vue 11 KB

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