club-consult-details.vue 9.8 KB

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