club-team-list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. <template>
  2. <view class="container club clearfix">
  3. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading="true"
  4. :loadingType="5" />
  5. <template v-else>
  6. <view class="club-search clearfix">
  7. <view class="search-main">
  8. <view class="search-from name">
  9. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  10. <input class="input" type="text" confirm-type="search" v-model="listQuery.name"
  11. @input="onShowClose" @confirm="getList" placeholder="机构名称/联系人/手机号" maxlength="16"
  12. :style="{ lineHeight: capsule.height + 'px' }" />
  13. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="club-main">
  18. <view class="club-list clearfix" v-if="!isEmpty">
  19. <view class="list" v-for="(club, index) in clubList" :key="index">
  20. <view class="list-cell-top">
  21. <view class="list-logo">
  22. <image src="https://static.caimei365.com/app/img/icon/icon-club@3x.png" mode="">
  23. </image>
  24. <!-- <text class="list-id">编号:{{ club.newClubId }}</text> -->
  25. <text class="list-tips">{{ club.userIdentity === 2 ? '资质机构' : '个人机构' }}</text>
  26. </view>
  27. <view class="list-content">
  28. <view class="list-name">
  29. <text
  30. class="list-name-text">{{ club.userIdentity === 2 ? club.name : club.linkMan }}</text>
  31. <text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
  32. <text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
  33. <text class="tags xf" v-if="club.newDeal === 1">新分配</text>
  34. </view>
  35. <view class="list-ntel">
  36. <text class="list-link">服务商:{{ club.serviceName ? club.serviceName : '' }}</text>
  37. </view>
  38. <view class="list-ntel">
  39. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  40. <text class="list-texl" @click="handlePhone(club.contractMobile)">
  41. {{ club.contractMobile ? club.contractMobile : '' }}
  42. </text>
  43. </view>
  44. <view class="list-ntel" v-if="listQuery.type === 6">
  45. <text class="list-link">分配时间:{{ club.providerTime | dateConversion }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="club-list-bot">
  50. <view class="btn" @click.stop="handleClickOper(1, club)">
  51. <text class="iconfont icon-jigouhuaxiang"></text> 机构画像
  52. </view>
  53. <view class="btn" @click.stop="handleClickOper(2, club)">
  54. <text class="iconfont icon-lijixiadan"></text> 机构订单
  55. <text v-if="club.orderNum > 0"
  56. class="opea-badge uni-badge uni-badge-error uni-small uni-badge--small icon-num">
  57. {{ showBadge(club.orderNum) }}
  58. </text>
  59. </view>
  60. <view class="btn" @click.stop="handleClickOper(3, club)">
  61. <text class="iconfont icon-tianxie"></text> 访问记录
  62. </view>
  63. <view class="btn none" @click.stop="handleClickOper(4, club)">
  64. <text class="iconfont icon-xiaoshou"></text> 更换服务商
  65. </view>
  66. </view>
  67. </view>
  68. <!--加载loadding-->
  69. <tui-loadmore :visible="loadding" :index="3" type="black" />
  70. <tui-nomore :visible="!pullUpOn" bgcolor="#f7f7f7" :text="nomoreText" />
  71. </view>
  72. <view v-else class="empty-container">
  73. <image class="club-empty-image"
  74. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
  75. mode="aspectFit"></image>
  76. <view class="txt">暂无机构~</view>
  77. </view>
  78. </view>
  79. </template>
  80. <!-- 选择弹窗 -->
  81. <cm-seller-popup ref="cmresellerpopup" :show="isSellerpopup" @handleChoiceaSeller="handleChoiceaSellerData" />
  82. </view>
  83. </template>
  84. <script>
  85. import { mapState, mapMutations } from 'vuex'
  86. import authorize from '@/common/config/authorize.js'
  87. import wxLogin from '@/common/config/wxLogin.js'
  88. import cmSellerPopup from '../components/cm-seller-popup'
  89. const defaultListQuery = {
  90. userIdentity: '',
  91. name: '',
  92. pageNum: 1,
  93. pageSize: 10,
  94. spId: 0,
  95. status: '',
  96. type: 1,
  97. groupServiceId: 0,
  98. }
  99. export default {
  100. components: {
  101. cmSellerPopup
  102. },
  103. data() {
  104. return {
  105. listTab: [{ name: '个人机构' }, { name: '资质机构' }],
  106. listItemTab: [{ name: '我的机构' }, { name: '组员机构' }, { name: '新分配机构' }],
  107. listQuery: Object.assign({}, defaultListQuery),
  108. isShowClose: false,
  109. isEmpty: false,
  110. nomoreText: '上拉显示更多',
  111. pageNum: 1,
  112. pageSize: 10,
  113. hasNextPage: false,
  114. loadding: false,
  115. pullUpOn: true,
  116. pullFlag: true,
  117. tabCurrentNum: 0,
  118. tabCurrentIndex: 0,
  119. tabSmallCurrentIndex: 0,
  120. clubList: [],
  121. isIphoneX: this.$store.state.isIphoneX,
  122. CustomBar: this.CustomBar,
  123. StatusBar: this.StatusBar,
  124. capsule: this.capsule,
  125. show_index: 0, //控制显示那个组件
  126. rightDrawer: false,
  127. isSellerpopup: false,
  128. salesParams: {
  129. choseServiceId: 0,
  130. clubId: 0,
  131. spId: 0
  132. },
  133. isShowIndex: false,
  134. currentIndex: 0,
  135. skeletonShow: true
  136. }
  137. },
  138. filters: {
  139. dateConversion(val) {
  140. const date = new Date(val)
  141. const setZero = val => (val < 10 ? '0' + val : val)
  142. return `${date.getFullYear()}-${setZero(date.getMonth() + 1)}-${setZero(date.getDate())} ${setZero(
  143. date.getHours()
  144. )}:${setZero(date.getMinutes())}:${setZero(date.getSeconds())}`
  145. }
  146. },
  147. onLoad(option) {
  148. this.initGetStotage(option)
  149. },
  150. computed: {
  151. ...mapState(['isManage'])
  152. },
  153. methods: {
  154. async initGetStotage(option) {
  155. // 初始化
  156. const userInfo = await this.$api.getStorage()
  157. uni.setNavigationBarTitle({ title: `${option.name}的机构` })
  158. this.listQuery.type = this.isManage ? 2 : 6
  159. this.listQuery.groupServiceId = option.groupServiceId
  160. this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  161. this.salesParams.choseServiceId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  162. this.getList()
  163. setTimeout(() => {
  164. this.skeletonShow = false
  165. }, 1000)
  166. },
  167. async getList() {
  168. try {
  169. this.listQuery.pageNum = 1
  170. const res = await this.SellerService.GetSellerClubList(this.listQuery)
  171. const data = res.data
  172. if (data.list && data.list.length > 0) {
  173. this.isEmpty = false
  174. this.hasNextPage = data.hasNextPage
  175. this.clubList = data.list.map((el, index) => {
  176. el.bubble = false
  177. return el
  178. })
  179. this.pullFlag = false
  180. setTimeout(() => {
  181. this.pullFlag = true
  182. }, 500)
  183. if (this.hasNextPage) {
  184. this.pullUpOn = false
  185. this.nomoreText = '上拉显示更多'
  186. } else {
  187. this.pullUpOn = true
  188. this.loadding = false
  189. this.nomoreText = '已至底部'
  190. }
  191. } else {
  192. this.isEmpty = true
  193. }
  194. } catch (error) {
  195. //TODO handle the exception
  196. this.$util.msg(error.msg, 2000)
  197. }
  198. },
  199. async getOnReachBottomData() {
  200. try {
  201. this.listQuery.pageNum++
  202. const res = await this.SellerService.GetSellerClubList(this.listQuery)
  203. const data = res.data
  204. if (data.list && data.list.length > 0) {
  205. this.hasNextPage = data.hasNextPage
  206. this.clubList = this.clubList.concat(data.list)
  207. this.pullFlag = false // 防上拉暴滑
  208. setTimeout(() => {
  209. this.pullFlag = true
  210. }, 500)
  211. if (this.hasNextPage) {
  212. this.pullUpOn = false
  213. this.nomoreText = '上拉显示更多'
  214. } else {
  215. this.pullUpOn = false
  216. this.loadding = false
  217. this.nomoreText = '已至底部'
  218. }
  219. }
  220. } catch (error) {
  221. //TODO handle the exception
  222. this.$util.msg(error.msg, 2000)
  223. }
  224. },
  225. userClubChoseSales(param) {
  226. //分配或更换服务商
  227. this.SellerService.userClubChoseSales(param)
  228. .then(response => {
  229. this.$util.msg('操作成功~', 2000, true, 'success')
  230. setTimeout(() => {
  231. this.getList()
  232. }, 1000)
  233. })
  234. .catch(error => {
  235. console.log('分配服务商异常')
  236. })
  237. },
  238. handleChoiceaSellerData(data) {
  239. // 确定搜索
  240. this.salesParams.spId = data.serviceProviderId
  241. this.userClubChoseSales(this.salesParams)
  242. },
  243. // 按钮操作
  244. handleClickOper(type, club) {
  245. /**
  246. * 1:机构画像 2:机构订单 3:访问记录 4:更换服务商
  247. * */
  248. console.log('type', type)
  249. switch (type) {
  250. case 1:
  251. this.$api.navigateTo(`/pages/seller/club/club-portrait?userId=${club.userId}`)
  252. break
  253. case 2:
  254. this.$api.setStorage('orderUserInfo', club)
  255. this.$api.navigateTo(
  256. `/pages/seller/order/order-historylist?clubId=${club.clubId}&listType=0&authType=1`)
  257. break
  258. case 3:
  259. this.$api.navigateTo(`/pages/seller/club/club-visit?clubId=${club.clubId}`)
  260. break
  261. case 4:
  262. this.handleReplaceClub(club)
  263. break
  264. }
  265. },
  266. handleReplaceClub(club) {
  267. //更换服务商
  268. this.salesParams.clubId = club.clubId
  269. this.isSellerpopup = true
  270. },
  271. // 拨打电话
  272. handlePhone(phoneNumber) {
  273. uni.makePhoneCall({
  274. phoneNumber: phoneNumber //拨打电话
  275. })
  276. },
  277. onShowClose() {
  278. //输入框失去焦点时触发
  279. if (this.listQuery.name != '') {
  280. this.isShowClose = true
  281. } else {
  282. this.isShowClose = false
  283. }
  284. },
  285. delInputText() {
  286. //清除输入框内容
  287. this.listQuery.name = ''
  288. this.isShowClose = false
  289. },
  290. showBadge(n) {
  291. let num = ''
  292. if (n > 100) {
  293. num = 99
  294. } else {
  295. num = n
  296. }
  297. return num
  298. },
  299. handleShowBubble(club, index) {
  300. this.currentIndex = index
  301. club.bubble = !club.bubble
  302. }
  303. },
  304. onReachBottom() {
  305. if (this.hasNextPage) {
  306. this.loadding = true
  307. this.pullUpOn = true
  308. this.getOnReachBottomData()
  309. }
  310. },
  311. onShow() {
  312. wxLogin.wxLoginAuthorize()
  313. }
  314. }
  315. </script>
  316. <style lang="scss">
  317. page {
  318. height: 100%;
  319. background: #F7F7F7;
  320. }
  321. .container {
  322. height: auto;
  323. background: #F7F7F7;
  324. position: relative;
  325. padding-top: 98rpx;
  326. box-sizing: border-box;
  327. }
  328. .club-search {
  329. height: auto;
  330. width: 100%;
  331. background: #ffffff;
  332. display: flex;
  333. flex-direction: column;
  334. position: fixed;
  335. top: 0;
  336. left: 0;
  337. z-index: 99;
  338. .search-top {
  339. flex: 1;
  340. display: flex;
  341. align-items: center;
  342. box-sizing: border-box;
  343. position: relative;
  344. .title {
  345. position: absolute;
  346. left: 50%;
  347. top: 50%;
  348. transform: translate(-50%, -50%);
  349. }
  350. .search-icon {
  351. text-align: center;
  352. float: left;
  353. .icon-fanhui {
  354. font-size: 44rpx;
  355. color: #333333;
  356. }
  357. .icon-shouye {
  358. font-size: 44rpx;
  359. color: #333333;
  360. }
  361. }
  362. }
  363. .search-main {
  364. width: 100%;
  365. height: 80rpx;
  366. box-sizing: border-box;
  367. padding: 10rpx 24rpx;
  368. .search-from {
  369. background: #f7f7f7;
  370. position: relative;
  371. width: 100%;
  372. height: 100%;
  373. padding-right: 60rpx;
  374. box-sizing: border-box;
  375. padding: 0 10rpx;
  376. float: left;
  377. border-radius: 30rpx;
  378. .icon-iconfonticonfontsousuo1 {
  379. width: 60rpx;
  380. height: 60rpx;
  381. line-height: 60rpx;
  382. text-align: center;
  383. display: block;
  384. font-size: $font-size-38;
  385. float: left;
  386. color: #999999;
  387. }
  388. .input {
  389. width: 520rpx;
  390. height: 100%;
  391. float: left;
  392. color: $text-color;
  393. font-size: $font-size-24;
  394. box-sizing: border-box;
  395. padding-left: 10rpx;
  396. }
  397. .icon-shanchu1 {
  398. font-size: $font-size-32;
  399. color: #999999;
  400. position: absolute;
  401. width: 60rpx;
  402. height: 60rpx;
  403. line-height: 60rpx;
  404. text-align: center;
  405. top: 0;
  406. right: 0;
  407. z-index: 10;
  408. }
  409. }
  410. .search-btn {
  411. width: 60rpx;
  412. height: 60rpx;
  413. line-height: 60rpx;
  414. text-align: center;
  415. font-size: $font-size-28;
  416. color: $color-system;
  417. float: left;
  418. background: #ffffff;
  419. .icon-shaixuan {
  420. font-size: 44rpx;
  421. color: #333333;
  422. }
  423. }
  424. }
  425. }
  426. .club-main {
  427. width: 100%;
  428. .club-list {
  429. width: 100%;
  430. height: auto;
  431. box-sizing: border-box;
  432. padding: 0 15rpx;
  433. }
  434. .list {
  435. width: 100%;
  436. height: auto;
  437. padding: 15rpx;
  438. box-sizing: border-box;
  439. background: #ffffff;
  440. position: relative;
  441. float: left;
  442. margin-bottom: 15rpx;
  443. border-radius: 8rpx;
  444. overflow: hidden;
  445. .list-cell-top {
  446. width: 100%;
  447. height: auto;
  448. box-sizing: border-box;
  449. .list-logo {
  450. width: 140rpx;
  451. height: 140rpx;
  452. float: left;
  453. position: relative;
  454. image {
  455. width: 140rpx;
  456. height: 140rpx;
  457. border-radius: 8rpx;
  458. }
  459. .list-tips {
  460. display: inline-block;
  461. width: 100%;
  462. height: 32rpx;
  463. line-height: 32rpx;
  464. background: rgba(0, 0, 0, 0.1);
  465. color: #333;
  466. position: absolute;
  467. bottom: 0;
  468. left: 0;
  469. box-sizing: border-box;
  470. text-align: left;
  471. font-size: 20rpx;
  472. padding-left: 4rpx;
  473. border-radius: 8rpx 8rpx 0 0;
  474. text-align: center;
  475. }
  476. .list-id {
  477. display: inline-block;
  478. width: 100%;
  479. height: 32rpx;
  480. line-height: 32rpx;
  481. background: rgba(0, 0, 0, 0.1);
  482. color: #333;
  483. position: absolute;
  484. top: 0;
  485. left: 0;
  486. box-sizing: border-box;
  487. text-align: left;
  488. font-size: 20rpx;
  489. padding-left: 4rpx;
  490. border-radius: 8rpx 8rpx 0 0;
  491. text-align: center;
  492. }
  493. }
  494. .list-content {
  495. width: 550rpx;
  496. height: auto;
  497. float: left;
  498. padding-left: 20rpx;
  499. box-sizing: border-box;
  500. .list-name {
  501. width: 100%;
  502. height: 50rpx;
  503. float: left;
  504. line-height: 50rpx;
  505. .list-name-text {
  506. width: 310rpx;
  507. text-align: left;
  508. text-overflow: ellipsis;
  509. overflow: hidden;
  510. display: -webkit-box;
  511. -webkit-line-clamp: 1;
  512. line-clamp: 1;
  513. -webkit-box-orient: vertical;
  514. font-size: $font-size-26;
  515. color: #333333;
  516. float: left;
  517. }
  518. .tags {
  519. display: inline-block;
  520. height: 36rpx;
  521. box-sizing: border-box;
  522. padding: 0 10rpx;
  523. border-radius: 8rpx;
  524. background: #f0cb72;
  525. font-size: $font-size-22;
  526. color: #4e4539;
  527. text-align: center;
  528. line-height: 36rpx;
  529. margin-left: 8rpx;
  530. margin-top: 7rpx;
  531. &.sv {
  532. background: #333333;
  533. color: #f0cb72;
  534. }
  535. &.xf {
  536. background-color: #f94b4b;
  537. color: #ffffff;
  538. }
  539. }
  540. }
  541. .list-tags {
  542. width: 100%;
  543. height: auto;
  544. float: left;
  545. line-height: 36rpx;
  546. margin: 7rpx 0;
  547. .tags {
  548. display: inline-block;
  549. height: 36rpx;
  550. box-sizing: border-box;
  551. padding: 0 8rpx 0 15rpx;
  552. border-radius: 8rpx;
  553. background: rgba(0, 0, 0, 0.1);
  554. font-size: 20rpx;
  555. color: #666666;
  556. text-align: center;
  557. line-height: 36rpx;
  558. margin-right: 16rpx;
  559. .icon-xiayibu {
  560. font-size: 20rpx;
  561. margin-left: 10rpx;
  562. }
  563. }
  564. .tags-or {
  565. display: inline-block;
  566. height: 36rpx;
  567. box-sizing: border-box;
  568. font-size: 20rpx;
  569. color: #666666;
  570. text-align: center;
  571. line-height: 36rpx;
  572. position: relative;
  573. padding: 0 8rpx 0 15rpx;
  574. border-radius: 8rpx;
  575. background: rgba(0, 0, 0, 0.1);
  576. .icon-dingdan {
  577. font-size: 22rpx;
  578. color: #999999;
  579. }
  580. }
  581. }
  582. .list-ntel {
  583. width: 100%;
  584. height: 50rpx;
  585. float: left;
  586. line-height: 50rpx;
  587. text-align: left;
  588. font-size: $font-size-24;
  589. color: #666666;
  590. .list-link {
  591. display: inline-block;
  592. float: left;
  593. margin-right: 12rpx;
  594. }
  595. .list-texl {
  596. display: inline-block;
  597. float: left;
  598. text-decoration: underline;
  599. }
  600. }
  601. }
  602. }
  603. .club-list-bot {
  604. width: 100%;
  605. height: 80rpx;
  606. float: left;
  607. background-color: #f7f7f7;
  608. border-radius: 8rpx;
  609. margin-top: 20rpx;
  610. .btn {
  611. height: 80rpx;
  612. box-sizing: border-box;
  613. line-height: 80rpx;
  614. padding: 0 20rpx;
  615. font-size: $font-size-24;
  616. color: #333333;
  617. text-align: center;
  618. float: left;
  619. position: relative;
  620. &:nth-child(1) {
  621. &:before {
  622. content: '';
  623. width: 1px;
  624. height: 20rpx;
  625. background-color: #b2b2b2;
  626. position: absolute;
  627. right: 0;
  628. top: 30rpx;
  629. }
  630. }
  631. &:nth-child(2) {
  632. &:before {
  633. content: '';
  634. width: 1px;
  635. height: 20rpx;
  636. background-color: #b2b2b2;
  637. position: absolute;
  638. right: 0;
  639. top: 30rpx;
  640. }
  641. .opea-badge {
  642. position: absolute;
  643. right: -2rpx;
  644. top: 2rpx;
  645. }
  646. }
  647. &:nth-child(3) {
  648. &:before {
  649. content: '';
  650. width: 1px;
  651. height: 20rpx;
  652. background-color: #b2b2b2;
  653. position: absolute;
  654. right: 0;
  655. top: 30rpx;
  656. }
  657. }
  658. &:last-child {
  659. padding: 0 20rpx;
  660. .iconfont {
  661. font-size: 24rpx;
  662. }
  663. }
  664. &.none {
  665. &::before {
  666. background-color: #f7f7f7 !important;
  667. }
  668. }
  669. .iconfont {
  670. font-size: 30rpx;
  671. color: #666666;
  672. margin-right: 2rpx;
  673. position: relative;
  674. }
  675. }
  676. }
  677. }
  678. }
  679. .tabBar {
  680. width: 100%;
  681. height: 98rpx;
  682. background: #fff;
  683. border-top: 1px solid #e5e5e5;
  684. position: fixed;
  685. bottom: 0px;
  686. left: 0px;
  687. right: 0px;
  688. z-index: 99;
  689. display: flex;
  690. align-items: center;
  691. justify-content: center;
  692. .tabBar_list {
  693. width: 86%;
  694. display: flex;
  695. justify-content: space-between;
  696. .tabBar_item {
  697. width: 120rpx;
  698. display: flex;
  699. justify-content: center;
  700. align-items: center;
  701. flex-direction: column;
  702. font-size: 20rpx;
  703. color: #999999;
  704. &.current {
  705. color: #166ce1;
  706. .iconfont {
  707. color: #166ce1;
  708. }
  709. }
  710. &.current1 {
  711. color: #16e15c;
  712. .iconfont {
  713. color: #16e15c;
  714. }
  715. }
  716. &.current2 {
  717. color: #ff0000;
  718. .iconfont {
  719. color: #ff0000;
  720. }
  721. }
  722. .iconfont {
  723. width: 48rpx;
  724. height: 48rpx;
  725. display: block;
  726. margin-bottom: 2rpx;
  727. text-align: center;
  728. font-size: 46rpx;
  729. color: #999999;
  730. }
  731. }
  732. }
  733. }
  734. .nav_active {
  735. color: $color-system;
  736. }
  737. </style>