club-consult-details.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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.userIdentity === 2 ? club.name : club.linkMan }}
  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">
  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. const club = data.clubList
  129. if (club.list && club.list.length > 0) {
  130. this.hasNextPage = club.hasNextPage
  131. this.clubList =club.list
  132. this.isEmpty = false
  133. this.pullFlag = false
  134. setTimeout(() => {
  135. this.pullFlag = true
  136. }, 500)
  137. if (this.hasNextPage) {
  138. this.pullUpOn = false
  139. this.nomoreText = '上拉显示更多'
  140. } else {
  141. this.pullUpOn = true
  142. this.loadding = false
  143. this.nomoreText = '已至底部'
  144. }
  145. } else {
  146. this.isEmpty = true
  147. }
  148. }catch(error){
  149. this.$util.msg(error.msg, 2000)
  150. }
  151. },
  152. async getOnReachBottomData() {
  153. try{
  154. const res = await this.SellerService.getClubList(this.listQuery)
  155. const data = res.data
  156. const club = data.clubList
  157. this.hasNextPage = data.clubList.hasNextPage
  158. this.clubList = this.clubList.concat(club.list)
  159. this.pullFlag = false // 防上拉暴滑
  160. setTimeout(() => {
  161. this.pullFlag = true
  162. }, 500)
  163. if (this.hasNextPage) {
  164. this.pullUpOn = false
  165. this.nomoreText = '上拉显示更多'
  166. } else {
  167. this.pullUpOn = false
  168. this.loadding = false
  169. this.nomoreText = '已至底部'
  170. }
  171. }catch(error){
  172. //TODO handle the exception
  173. console.log('加载分页失败')
  174. }
  175. },
  176. handleClick(index){
  177. this.tabCurrentIndex = this.listQuery.type = index
  178. this.getClubList()
  179. },
  180. // 拨打电话
  181. handlePhone(phoneNumber) {
  182. uni.makePhoneCall({
  183. phoneNumber: phoneNumber //拨打电话
  184. })
  185. }
  186. },
  187. onReachBottom() {
  188. if (this.hasNextPage) {
  189. this.loadding = true
  190. this.pullUpOn = true
  191. this.listQuery.pageNum++
  192. this.getOnReachBottomData()
  193. }
  194. },
  195. onShow() {
  196. this.initGetStotage()
  197. }
  198. }
  199. </script>
  200. <style lang="scss">
  201. page {
  202. height: auto;
  203. }
  204. page,
  205. .container {
  206. /* padding-bottom: 120upx; */
  207. width: 100%;
  208. height: 100%;
  209. background: #f7f7f7;
  210. }
  211. .club-tabs{
  212. width: 100%;
  213. height: 90rpx;
  214. position: fixed;
  215. top: 0;
  216. left: 0;
  217. box-sizing: border-box;
  218. padding: 20rpx 0;
  219. background-color: #ffffff;
  220. .btn {
  221. width: 50%;
  222. line-height: 50rpx;
  223. box-sizing: border-box;
  224. text-align: center;
  225. font-size: $font-size-34;
  226. float: left;
  227. color: #333333;
  228. position: relative;
  229. &::before{
  230. content: '';
  231. width: 100rpx;
  232. height: 4rpx;
  233. background-color: #ffffff;
  234. position: absolute;
  235. bottom: -20rpx;
  236. left: 50%;
  237. margin-left: -50rpx;
  238. }
  239. &.edit {
  240. border-right: 1px solid #e1e1e1;
  241. }
  242. &.active{
  243. color: #FF5B00;
  244. &::before{
  245. background-color: #FF5B00;
  246. }
  247. }
  248. }
  249. }
  250. .club-main {
  251. width: 100%;
  252. height: 100%;
  253. padding-top: 114rpx;
  254. float: left;
  255. .club-main-empty{
  256. width: 100%;
  257. height: 100%;
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. flex-direction: column;
  262. background-color: #ffffff;
  263. .club-empty-image{
  264. width: 300rpx;
  265. height: 180rpx;
  266. margin-bottom: 20rpx;
  267. }
  268. .txt{
  269. font-size: 24rpx;
  270. color: #666666;
  271. }
  272. }
  273. .list {
  274. width: 100%;
  275. height: 240rpx;
  276. padding: 24rpx;
  277. box-sizing: border-box;
  278. background: #ffffff;
  279. position: relative;
  280. border-bottom: 1px solid #ebebeb;
  281. .list-cell-top {
  282. width: 100%;
  283. height: 140rpx;
  284. box-sizing: border-box;
  285. .list-logo {
  286. width: 140rpx;
  287. height: 140rpx;
  288. float: left;
  289. position: relative;
  290. image {
  291. width: 140rpx;
  292. height: 140rpx;
  293. border-radius: 8rpx;
  294. }
  295. .list-tips {
  296. display: inline-block;
  297. width: 100%;
  298. height: 32rpx;
  299. line-height: 32rpx;
  300. background: rgba(0, 0, 0, 0.1);
  301. color: #333;
  302. position: absolute;
  303. bottom: 0;
  304. left: 0;
  305. box-sizing: border-box;
  306. text-align: left;
  307. font-size: 20rpx;
  308. padding-left: 4rpx;
  309. border-radius: 8rpx 8rpx 0 0;
  310. text-align: center;
  311. }
  312. .list-id {
  313. display: inline-block;
  314. width: 100%;
  315. height: 32rpx;
  316. line-height: 32rpx;
  317. background: rgba(0, 0, 0, 0.1);
  318. color: #333;
  319. position: absolute;
  320. top: 0;
  321. left: 0;
  322. box-sizing: border-box;
  323. text-align: left;
  324. font-size: 20rpx;
  325. padding-left: 4rpx;
  326. border-radius: 8rpx 8rpx 0 0;
  327. text-align: center;
  328. }
  329. }
  330. .list-content {
  331. width: 560rpx;
  332. height: 150rpx;
  333. float: left;
  334. padding-left: 20rpx;
  335. box-sizing: border-box;
  336. .list-name {
  337. width: 100%;
  338. height: 50rpx;
  339. float: left;
  340. line-height: 50rpx;
  341. text-align: left;
  342. font-size: $font-size-26;
  343. color: #333333;
  344. .tags {
  345. display: inline-block;
  346. height: 36rpx;
  347. box-sizing: border-box;
  348. padding: 0 15rpx;
  349. border-radius: 8rpx;
  350. background: #f0cb72;
  351. font-size: $font-size-22;
  352. color: #4e4539;
  353. text-align: center;
  354. line-height: 36rpx;
  355. margin-left: 20rpx;
  356. margin-top: 7rpx;
  357. &.sv {
  358. background: #333333;
  359. color: #f0cb72;
  360. }
  361. &.xf {
  362. background-color: #f94b4b;
  363. color: #ffffff;
  364. }
  365. }
  366. }
  367. .list-tags {
  368. width: 100%;
  369. height: 36rpx;
  370. float: left;
  371. line-height: 36rpx;
  372. margin: 7rpx 0;
  373. .tags {
  374. display: inline-block;
  375. height: 36rpx;
  376. box-sizing: border-box;
  377. padding: 0 8rpx 0 15rpx;
  378. border-radius: 8rpx;
  379. background: #faede5;
  380. font-size: $font-size-22;
  381. color: $color-system;
  382. text-align: center;
  383. line-height: 36rpx;
  384. margin-right: 16rpx;
  385. .icon-xiayibu {
  386. font-size: 20rpx;
  387. margin-left: 10rpx;
  388. }
  389. }
  390. }
  391. .list-ntel {
  392. width: 100%;
  393. height: 50rpx;
  394. float: left;
  395. line-height: 50rpx;
  396. text-align: left;
  397. font-size: $font-size-24;
  398. color: #666666;
  399. .list-link {
  400. display: inline-block;
  401. float: left;
  402. margin-right: 12rpx;
  403. }
  404. .list-texl {
  405. display: inline-block;
  406. float: left;
  407. text-decoration: underline;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. </style>