club-active-details.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <view class="container club clearfix">
  3. <view class="club-tabs">
  4. <view class="btn edit" :class="tabCurrentIndex === 4 ? 'active': '' " @click.stop="handleClick(4)">活跃机构</view>
  5. <view class="btn" :class="tabCurrentIndex === 5 ? 'active': '' " @click.stop="handleClick(5)">不活跃机构</view>
  6. </view>
  7. <view class="club-main">
  8. <view v-if="isEmpty" class="club-main-empty">
  9. <image
  10. class="club-empty-image"
  11. src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
  12. mode="aspectFit"
  13. ></image>
  14. <view class="txt">暂无机构数据</view>
  15. </view>
  16. <view v-else class="club-list clearfix">
  17. <scroll-view scroll-y="true">
  18. <view class="list" v-for="(club, index) in clubList" :key="index">
  19. <view class="list-cell-top">
  20. <view class="list-logo">
  21. <image
  22. :src="
  23. club.headpic
  24. ? club.headpicx
  25. : 'https://static.caimei365.com/app/img/icon/icon-club@3x.png'
  26. "
  27. mode=""
  28. ></image>
  29. <!-- <text class="list-id">编号:{{ club.newClubId }}</text> -->
  30. <text class="list-tips">{{ club.userIdentity === 2 ? '资质机构' : '个人机构' }}</text>
  31. </view>
  32. <view class="list-content">
  33. <view class="list-name">
  34. {{ club.name }}
  35. <text class="tags" v-if="club.vipFlag == 0 && club.userIdentity === 2">VIP</text>
  36. <text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
  37. <text class="tags xf" v-if="club.newDeal === 1">新分配</text>
  38. </view>
  39. <view class="list-ntel" v-if="tabSmallCurrentIndex === 1">
  40. <text class="list-link">销售:{{ club.serviceName ? club.serviceName : '' }}</text>
  41. </view>
  42. <view class="list-ntel" v-if="tabSmallCurrentIndex !== 1">
  43. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  44. <text class="list-texl" @click="handlePhone(club.contractMobile)">
  45. {{ club.contractMobile ? club.contractMobile : '' }}
  46. </text>
  47. </view>
  48. <view class="list-ntel" v-if="listQuery.type === 6">
  49. <text class="list-link">分配时间:{{ club.providerTime | dateConversion }}</text>
  50. </view>
  51. <view class="list-tags">
  52. <text
  53. class="tags"
  54. @click.stop="
  55. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  56. "
  57. >
  58. {{ club.activeState }} <text class="iconfont icon-xiayibu"></text>
  59. </text>
  60. <text
  61. class="tags"
  62. @click.stop="
  63. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  64. "
  65. >
  66. {{ club.customerValue }} <text class="iconfont icon-xiayibu"></text>
  67. </text>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!--加载loadding-->
  73. <tui-loadmore :visible="loadding" :index="3" type="black" />
  74. <tui-nomore :visible="!pullUpOn" bgcolor="#f7f7f7" :text="nomoreText" />
  75. </scroll-view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import { mapState, mapMutations } from 'vuex'
  82. const defaultListQuery = {
  83. spId: 0,
  84. status: 90,
  85. type: 4,
  86. pageNum: 1,
  87. pageSize: 10
  88. }
  89. export default {
  90. data() {
  91. return {
  92. listQuery: Object.assign({}, defaultListQuery),
  93. isEmpty: false,
  94. nomoreText: '上拉显示更多',
  95. hasNextPage: false,
  96. loadding: false,
  97. pullUpOn: true,
  98. pullFlag: true,
  99. tabCurrentIndex: 4,
  100. clubList: []
  101. }
  102. },
  103. filters: {
  104. dateConversion(val) {
  105. const date = new Date(val)
  106. const setZero = val => (val < 10 ? '0' + val : val)
  107. return `${date.getFullYear()}-${setZero(date.getMonth() + 1)}-${setZero(date.getDate())} ${setZero(
  108. date.getHours()
  109. )}:${setZero(date.getMinutes())}:${setZero(date.getSeconds())}`
  110. }
  111. },
  112. onLoad(option) {
  113. },
  114. computed: {
  115. ...mapState(['isManage'])
  116. },
  117. methods: {
  118. async initGetStotage() {
  119. // 初始化
  120. const userInfo = await this.$api.getStorage()
  121. this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  122. this.getClubList()
  123. },
  124. async getClubList() {
  125. try{
  126. const res = await this.SellerService.getClubList(this.listQuery)
  127. const data = res.data
  128. if (data.results && data.results.length > 0) {
  129. this.hasNextPage = data.hasNextPage
  130. this.clubList =data.results
  131. this.isEmpty = false
  132. this.pullFlag = false
  133. setTimeout(() => {
  134. this.pullFlag = true
  135. }, 500)
  136. if (this.hasNextPage) {
  137. this.pullUpOn = false
  138. this.nomoreText = '上拉显示更多'
  139. } else {
  140. this.pullUpOn = true
  141. this.loadding = false
  142. this.nomoreText = '已至底部'
  143. }
  144. } else {
  145. this.isEmpty = true
  146. }
  147. }catch(error){
  148. this.$util.msg(error.msg, 2000)
  149. }
  150. },
  151. async getOnReachBottomData() {
  152. try{
  153. const res = await this.SellerService.getClubList(this.listQuery)
  154. const data = res.data
  155. this.hasNextPage = data.hasNextPage
  156. this.clubList = this.clubList.concat(data.results)
  157. this.pullFlag = false // 防上拉暴滑
  158. setTimeout(() => {
  159. this.pullFlag = true
  160. }, 500)
  161. if (this.hasNextPage) {
  162. this.pullUpOn = false
  163. this.nomoreText = '上拉显示更多'
  164. } else {
  165. this.pullUpOn = false
  166. this.loadding = false
  167. this.nomoreText = '已至底部'
  168. }
  169. }catch(error){
  170. //TODO handle the exception
  171. console.log('加载分页失败')
  172. }
  173. },
  174. handleClick(index){
  175. this.tabCurrentIndex = this.listQuery.type = index
  176. this.getClubList()
  177. },
  178. // 拨打电话
  179. handlePhone(phoneNumber) {
  180. uni.makePhoneCall({
  181. phoneNumber: phoneNumber //拨打电话
  182. })
  183. }
  184. },
  185. onReachBottom() {
  186. if (this.hasNextPage) {
  187. this.loadding = true
  188. this.pullUpOn = true
  189. this.listQuery.pageNum++
  190. this.getOnReachBottomData()
  191. }
  192. },
  193. onShow() {
  194. this.initGetStotage()
  195. }
  196. }
  197. </script>
  198. <style lang="scss">
  199. page {
  200. height: auto;
  201. }
  202. page,
  203. .container {
  204. /* padding-bottom: 120upx; */
  205. width: 100%;
  206. height: 100%;
  207. background: #f7f7f7;
  208. }
  209. .club-tabs{
  210. width: 100%;
  211. height: 70rpx;
  212. position: fixed;
  213. top: 0;
  214. left: 0;
  215. box-sizing: border-box;
  216. padding: 10rpx 0;
  217. background-color: #ffffff;
  218. z-index: 9999;
  219. .btn {
  220. width: 50%;
  221. line-height: 50rpx;
  222. box-sizing: border-box;
  223. text-align: center;
  224. font-size: $font-size-30;
  225. float: left;
  226. color: #333333;
  227. position: relative;
  228. &::before{
  229. content: '';
  230. width: 100rpx;
  231. height: 4rpx;
  232. background-color: #ffffff;
  233. position: absolute;
  234. bottom: -10rpx;
  235. left: 50%;
  236. margin-left: -50rpx;
  237. }
  238. &.edit {
  239. border-right: 1px solid #e1e1e1;
  240. }
  241. &.active{
  242. color: #FF5B00;
  243. &::before{
  244. background-color: #FF5B00;
  245. }
  246. }
  247. }
  248. }
  249. .club-main {
  250. width: 100%;
  251. height: 100%;
  252. padding: 20rpx;
  253. padding-top: 94rpx;
  254. float: left;
  255. box-sizing: border-box;
  256. .club-main-empty{
  257. width: 100%;
  258. height: 100%;
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. flex-direction: column;
  263. background-color: #ffffff;
  264. .club-empty-image{
  265. width: 300rpx;
  266. height: 180rpx;
  267. margin-bottom: 20rpx;
  268. }
  269. .txt{
  270. font-size: 24rpx;
  271. color: #666666;
  272. }
  273. }
  274. .list {
  275. width: 100%;
  276. height: auto;
  277. padding: 20rpx;
  278. box-sizing: border-box;
  279. background: #ffffff;
  280. position: relative;
  281. border-radius: 8rpx;
  282. margin-bottom: 20rpx;
  283. float: left;
  284. .list-cell-top {
  285. width: 100%;
  286. height: 140rpx;
  287. box-sizing: border-box;
  288. .list-logo {
  289. width: 140rpx;
  290. height: 140rpx;
  291. float: left;
  292. position: relative;
  293. image {
  294. width: 140rpx;
  295. height: 140rpx;
  296. border-radius: 8rpx;
  297. }
  298. .list-tips {
  299. display: inline-block;
  300. width: 100%;
  301. height: 32rpx;
  302. line-height: 32rpx;
  303. background: rgba(0, 0, 0, 0.1);
  304. color: #333;
  305. position: absolute;
  306. bottom: 0;
  307. left: 0;
  308. box-sizing: border-box;
  309. text-align: left;
  310. font-size: 20rpx;
  311. padding-left: 4rpx;
  312. border-radius: 8rpx 8rpx 0 0;
  313. text-align: center;
  314. }
  315. .list-id {
  316. display: inline-block;
  317. width: 100%;
  318. height: 32rpx;
  319. line-height: 32rpx;
  320. background: rgba(0, 0, 0, 0.1);
  321. color: #333;
  322. position: absolute;
  323. top: 0;
  324. left: 0;
  325. box-sizing: border-box;
  326. text-align: left;
  327. font-size: 20rpx;
  328. padding-left: 4rpx;
  329. border-radius: 8rpx 8rpx 0 0;
  330. text-align: center;
  331. }
  332. }
  333. .list-content {
  334. width: 530rpx;
  335. height: auto;
  336. float: left;
  337. padding-left: 20rpx;
  338. box-sizing: border-box;
  339. .list-name {
  340. width: 100%;
  341. height: 50rpx;
  342. float: left;
  343. line-height: 50rpx;
  344. text-align: left;
  345. font-size: $font-size-26;
  346. color: #333333;
  347. .tags {
  348. display: inline-block;
  349. height: 36rpx;
  350. box-sizing: border-box;
  351. padding: 0 15rpx;
  352. border-radius: 8rpx;
  353. background: #f0cb72;
  354. font-size: $font-size-22;
  355. color: #4e4539;
  356. text-align: center;
  357. line-height: 36rpx;
  358. margin-left: 20rpx;
  359. margin-top: 7rpx;
  360. &.sv {
  361. background: #333333;
  362. color: #f0cb72;
  363. }
  364. &.xf {
  365. background-color: #f94b4b;
  366. color: #ffffff;
  367. }
  368. }
  369. }
  370. .list-tags {
  371. width: 100%;
  372. height: auto;
  373. float: left;
  374. line-height: 36rpx;
  375. margin: 7rpx 0;
  376. .tags {
  377. display: inline-block;
  378. height: 36rpx;
  379. box-sizing: border-box;
  380. padding: 0 8rpx 0 15rpx;
  381. border-radius: 8rpx;
  382. background: rgba(0, 0, 0, 0.1);
  383. font-size: 20rpx;
  384. color: #666666;
  385. text-align: center;
  386. line-height: 36rpx;
  387. margin-right: 16rpx;
  388. .icon-xiayibu {
  389. font-size: 20rpx;
  390. margin-left: 10rpx;
  391. }
  392. }
  393. }
  394. .list-ntel {
  395. width: 100%;
  396. height: 50rpx;
  397. float: left;
  398. line-height: 50rpx;
  399. text-align: left;
  400. font-size: $font-size-24;
  401. color: #666666;
  402. .list-link {
  403. display: inline-block;
  404. float: left;
  405. margin-right: 12rpx;
  406. }
  407. .list-texl {
  408. display: inline-block;
  409. float: left;
  410. text-decoration: underline;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. </style>