list.vue 17 KB

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