club-consult-details.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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 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="club.providerTime">
  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: 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: 70rpx;
  213. position: fixed;
  214. top: 0;
  215. left: 0;
  216. box-sizing: border-box;
  217. padding: 10rpx 0;
  218. background-color: #ffffff;
  219. z-index: 9999;
  220. .btn {
  221. width: 50%;
  222. line-height: 50rpx;
  223. box-sizing: border-box;
  224. text-align: center;
  225. font-size: $font-size-30;
  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: -10rpx;
  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: 20rpx;
  254. padding-top: 94rpx;
  255. float: left;
  256. box-sizing: border-box;
  257. .club-main-empty{
  258. width: 100%;
  259. height: 100%;
  260. display: flex;
  261. align-items: center;
  262. justify-content: center;
  263. flex-direction: column;
  264. background-color: #ffffff;
  265. .club-empty-image{
  266. width: 300rpx;
  267. height: 180rpx;
  268. margin-bottom: 20rpx;
  269. }
  270. .txt{
  271. font-size: 24rpx;
  272. color: #666666;
  273. }
  274. }
  275. .list {
  276. width: 100%;
  277. height: auto;
  278. padding: 20rpx;
  279. box-sizing: border-box;
  280. background: #ffffff;
  281. position: relative;
  282. border-radius: 8rpx;
  283. margin-bottom: 20rpx;
  284. float: left;
  285. .list-cell-top {
  286. width: 100%;
  287. height: 140rpx;
  288. box-sizing: border-box;
  289. .list-logo {
  290. width: 140rpx;
  291. height: 140rpx;
  292. float: left;
  293. position: relative;
  294. image {
  295. width: 140rpx;
  296. height: 140rpx;
  297. border-radius: 8rpx;
  298. }
  299. .list-tips {
  300. display: inline-block;
  301. width: 100%;
  302. height: 32rpx;
  303. line-height: 32rpx;
  304. background: rgba(0, 0, 0, 0.1);
  305. color: #333;
  306. position: absolute;
  307. bottom: 0;
  308. left: 0;
  309. box-sizing: border-box;
  310. text-align: left;
  311. font-size: 20rpx;
  312. padding-left: 4rpx;
  313. border-radius: 8rpx 8rpx 0 0;
  314. text-align: center;
  315. }
  316. .list-id {
  317. display: inline-block;
  318. width: 100%;
  319. height: 32rpx;
  320. line-height: 32rpx;
  321. background: rgba(0, 0, 0, 0.1);
  322. color: #333;
  323. position: absolute;
  324. top: 0;
  325. left: 0;
  326. box-sizing: border-box;
  327. text-align: left;
  328. font-size: 20rpx;
  329. padding-left: 4rpx;
  330. border-radius: 8rpx 8rpx 0 0;
  331. text-align: center;
  332. }
  333. }
  334. .list-content {
  335. width: 520rpx;
  336. height: auto;
  337. float: left;
  338. padding-left: 20rpx;
  339. box-sizing: border-box;
  340. .list-name {
  341. width: 100%;
  342. height: 50rpx;
  343. float: left;
  344. line-height: 50rpx;
  345. text-align: left;
  346. font-size: $font-size-26;
  347. color: #333333;
  348. .tags {
  349. display: inline-block;
  350. height: 36rpx;
  351. box-sizing: border-box;
  352. padding: 0 15rpx;
  353. border-radius: 8rpx;
  354. background: #f0cb72;
  355. font-size: $font-size-22;
  356. color: #4e4539;
  357. text-align: center;
  358. line-height: 36rpx;
  359. margin-left: 20rpx;
  360. margin-top: 7rpx;
  361. &.sv {
  362. background: #333333;
  363. color: #f0cb72;
  364. }
  365. &.xf {
  366. background-color: #f94b4b;
  367. color: #ffffff;
  368. }
  369. }
  370. }
  371. .list-tags {
  372. width: 100%;
  373. height: auto;
  374. float: left;
  375. line-height: 36rpx;
  376. margin: 7rpx 0;
  377. .tags {
  378. display: inline-block;
  379. height: 36rpx;
  380. box-sizing: border-box;
  381. padding: 0 8rpx 0 15rpx;
  382. border-radius: 8rpx;
  383. background: rgba(0, 0, 0, 0.1);
  384. font-size: 20rpx;
  385. color: #666666;
  386. text-align: center;
  387. line-height: 36rpx;
  388. margin-right: 16rpx;
  389. .icon-xiayibu {
  390. font-size: 20rpx;
  391. margin-left: 10rpx;
  392. }
  393. }
  394. }
  395. .list-ntel {
  396. width: 100%;
  397. height: 50rpx;
  398. float: left;
  399. line-height: 50rpx;
  400. text-align: left;
  401. font-size: $font-size-24;
  402. color: #666666;
  403. .list-link {
  404. display: inline-block;
  405. float: left;
  406. margin-right: 12rpx;
  407. color: #999999;
  408. }
  409. .list-texl {
  410. display: inline-block;
  411. float: left;
  412. text-decoration: underline;
  413. }
  414. }
  415. }
  416. }
  417. }
  418. }
  419. </style>