club-active-details.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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">
  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-tags">
  40. <text
  41. class="tags"
  42. @click.stop="
  43. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  44. "
  45. >
  46. {{ club.activeState }} <text class="iconfont icon-xiayibu"></text>
  47. </text>
  48. <text
  49. class="tags"
  50. @click.stop="
  51. this.$api.navigateTo('/pages/service/service?id=1041&title=标签说明')
  52. "
  53. >
  54. {{ club.customerValue }} <text class="iconfont icon-xiayibu"></text>
  55. </text>
  56. </view>
  57. <view class="list-ntel" v-if="tabSmallCurrentIndex === 1">
  58. <text class="list-link">销售:{{ club.serviceName ? club.serviceName : '' }}</text>
  59. </view>
  60. <view class="list-ntel" v-if="tabSmallCurrentIndex !== 1">
  61. <text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
  62. <text class="list-texl" @click="handlePhone(club.contractMobile)">
  63. {{ club.contractMobile ? club.contractMobile : '' }}
  64. </text>
  65. </view>
  66. <view class="list-ntel" v-if="listQuery.type === 6">
  67. <text class="list-link">分配时间:{{ club.providerTime | dateConversion }}</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: 90rpx;
  212. position: fixed;
  213. top: 0;
  214. left: 0;
  215. box-sizing: border-box;
  216. padding: 20rpx 0;
  217. background-color: #ffffff;
  218. .btn {
  219. width: 50%;
  220. line-height: 50rpx;
  221. box-sizing: border-box;
  222. text-align: center;
  223. font-size: $font-size-34;
  224. float: left;
  225. color: #333333;
  226. position: relative;
  227. &::before{
  228. content: '';
  229. width: 100rpx;
  230. height: 4rpx;
  231. background-color: #ffffff;
  232. position: absolute;
  233. bottom: -20rpx;
  234. left: 50%;
  235. margin-left: -50rpx;
  236. }
  237. &.edit {
  238. border-right: 1px solid #e1e1e1;
  239. }
  240. &.active{
  241. color: #FF5B00;
  242. &::before{
  243. background-color: #FF5B00;
  244. }
  245. }
  246. }
  247. }
  248. .club-main {
  249. width: 100%;
  250. height: 100%;
  251. padding-top: 114rpx;
  252. float: left;
  253. .club-main-empty{
  254. width: 100%;
  255. height: 100%;
  256. display: flex;
  257. align-items: center;
  258. justify-content: center;
  259. flex-direction: column;
  260. background-color: #ffffff;
  261. .club-empty-image{
  262. width: 300rpx;
  263. height: 180rpx;
  264. margin-bottom: 20rpx;
  265. }
  266. .txt{
  267. font-size: 24rpx;
  268. color: #666666;
  269. }
  270. }
  271. .list {
  272. width: 100%;
  273. height: 200rpx;
  274. padding: 24rpx;
  275. box-sizing: border-box;
  276. background: #ffffff;
  277. position: relative;
  278. border-bottom: 1px solid #ebebeb;
  279. .list-cell-top {
  280. width: 100%;
  281. height: 140rpx;
  282. box-sizing: border-box;
  283. .list-logo {
  284. width: 140rpx;
  285. height: 140rpx;
  286. float: left;
  287. position: relative;
  288. image {
  289. width: 140rpx;
  290. height: 140rpx;
  291. border-radius: 8rpx;
  292. }
  293. .list-tips {
  294. display: inline-block;
  295. width: 100%;
  296. height: 32rpx;
  297. line-height: 32rpx;
  298. background: rgba(0, 0, 0, 0.1);
  299. color: #333;
  300. position: absolute;
  301. bottom: 0;
  302. left: 0;
  303. box-sizing: border-box;
  304. text-align: left;
  305. font-size: 20rpx;
  306. padding-left: 4rpx;
  307. border-radius: 8rpx 8rpx 0 0;
  308. text-align: center;
  309. }
  310. .list-id {
  311. display: inline-block;
  312. width: 100%;
  313. height: 32rpx;
  314. line-height: 32rpx;
  315. background: rgba(0, 0, 0, 0.1);
  316. color: #333;
  317. position: absolute;
  318. top: 0;
  319. left: 0;
  320. box-sizing: border-box;
  321. text-align: left;
  322. font-size: 20rpx;
  323. padding-left: 4rpx;
  324. border-radius: 8rpx 8rpx 0 0;
  325. text-align: center;
  326. }
  327. }
  328. .list-content {
  329. width: 560rpx;
  330. height: 150rpx;
  331. float: left;
  332. padding-left: 20rpx;
  333. box-sizing: border-box;
  334. .list-name {
  335. width: 100%;
  336. height: 50rpx;
  337. float: left;
  338. line-height: 50rpx;
  339. text-align: left;
  340. font-size: $font-size-26;
  341. color: #333333;
  342. .tags {
  343. display: inline-block;
  344. height: 36rpx;
  345. box-sizing: border-box;
  346. padding: 0 15rpx;
  347. border-radius: 8rpx;
  348. background: #f0cb72;
  349. font-size: $font-size-22;
  350. color: #4e4539;
  351. text-align: center;
  352. line-height: 36rpx;
  353. margin-left: 20rpx;
  354. margin-top: 7rpx;
  355. &.sv {
  356. background: #333333;
  357. color: #f0cb72;
  358. }
  359. &.xf {
  360. background-color: #f94b4b;
  361. color: #ffffff;
  362. }
  363. }
  364. }
  365. .list-tags {
  366. width: 100%;
  367. height: 36rpx;
  368. float: left;
  369. line-height: 36rpx;
  370. margin: 7rpx 0;
  371. .tags {
  372. display: inline-block;
  373. height: 36rpx;
  374. box-sizing: border-box;
  375. padding: 0 8rpx 0 15rpx;
  376. border-radius: 8rpx;
  377. background: #faede5;
  378. font-size: $font-size-22;
  379. color: $color-system;
  380. text-align: center;
  381. line-height: 36rpx;
  382. margin-right: 16rpx;
  383. .icon-xiayibu {
  384. font-size: 20rpx;
  385. margin-left: 10rpx;
  386. }
  387. }
  388. }
  389. .list-ntel {
  390. width: 100%;
  391. height: 50rpx;
  392. float: left;
  393. line-height: 50rpx;
  394. text-align: left;
  395. font-size: $font-size-24;
  396. color: #666666;
  397. .list-link {
  398. display: inline-block;
  399. float: left;
  400. margin-right: 12rpx;
  401. }
  402. .list-texl {
  403. display: inline-block;
  404. float: left;
  405. text-decoration: underline;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. </style>