officialT.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view :class="['qn-page-' + theme]" style="height: 100vh">
  3. <view class="content">
  4. <view class="navbar">
  5. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  6. :class="[tabCurrentIndex === index ? 'current' : '']" @click="tabClick(item, index)">
  7. {{ item.text }}
  8. <view class="current-line primary-btn"></view>
  9. </view>
  10. </view>
  11. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300">
  12. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  13. <scroll-view @scrolltolower="getOrderSelect" scroll-y="true" style="height:100%">
  14. <u-empty v-if="tabItem.list.length == 0" mode="list"></u-empty>
  15. <view class="gq-list">
  16. <view class="gq-item" v-for="item in tabItem.list" @click="gotoDetail(item)">
  17. <view class="gq-logo">
  18. <image :src="item.avatar" mode="" class=""></image>
  19. </view>
  20. <view class="store-name ellipsis">
  21. {{item.name }}
  22. </view>
  23. <view class="info">
  24. <view class="info-tit">
  25. 职务:
  26. </view>
  27. <view class="info-val">
  28. {{item.duties}}
  29. </view>
  30. </view>
  31. <view class="info">
  32. <view class="info-tit">
  33. 联系:
  34. </view>
  35. <view class="info-val">
  36. {{item.phone}}
  37. </view>
  38. </view>
  39. <view class="info">
  40. <view class="info-tit">
  41. 地址:
  42. </view>
  43. <view class="info-val clamp">
  44. {{item.address}}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <u-loadmore margin-top="20" v-if="!(tabItem.list.length === 0 && tabItem.loaded)"
  50. :status="loading_status" />
  51. </scroll-view>
  52. </swiper-item>
  53. </swiper>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. navList: [{
  62. state: 1,
  63. text: '加盟',
  64. loadingType: 'loadmore',
  65. page: 1,
  66. pageSize: 10,
  67. list: [],
  68. loaded: false
  69. },
  70. {
  71. state: 2,
  72. text: '连锁',
  73. loadingType: 'loadmore',
  74. page: 1,
  75. pageSize: 10,
  76. list: [],
  77. loaded: false
  78. }
  79. ],
  80. tabCurrentIndex: 0,
  81. }
  82. },
  83. onLoad(opt) {
  84. this.tabCurrentIndex = +options.state;
  85. },
  86. onShow() {
  87. this.getOrderSelect();
  88. },
  89. onReachBottom() {
  90. },
  91. onReady() {
  92. },
  93. methods: {
  94. // 获取订单列表
  95. getOrderSelect(type) {
  96. let that = this
  97. let item = that.navList[that.tabCurrentIndex]
  98. if (type == 'reload') {
  99. item.loadingType = 'loadmore'
  100. item.list = []
  101. item.page = 1
  102. }
  103. if (type == 'tab' && item.loaded) {
  104. return
  105. }
  106. if (item.loadingType == 'loading' || item.loadingType == 'nomore') {
  107. return
  108. }
  109. item.loadingType = 'loading'
  110. that.$u.api.getOtherList({
  111. type: item.state,
  112. page: item.page,
  113. pageSize: item.pageSize,
  114. name: ''
  115. }).then(({
  116. data
  117. }) => {
  118. item.list = item.list.concat(data)
  119. item.page++
  120. if (item.pageSize == data.length) {
  121. item.loadingType = 'loadmore'
  122. } else {
  123. item.loadingType = 'nomore'
  124. }
  125. item.loaded = true
  126. })
  127. },
  128. tabClick(item, index) {
  129. this.tabCurrentIndex = index
  130. this.getOrderSelect('tab')
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .content {
  137. background: $page-color-base;
  138. height: 100vh;
  139. }
  140. .swiper-box {
  141. height: calc(100% - 80upx);
  142. }
  143. .list-scroll-content {
  144. height: 100%;
  145. }
  146. .navbar {
  147. display: flex;
  148. height: 88upx;
  149. background: #fff;
  150. position: relative;
  151. z-index: 10;
  152. border-bottom: 1upx solid #eee;
  153. .nav-item {
  154. flex: 1;
  155. display: flex;
  156. justify-content: center;
  157. align-items: center;
  158. height: 100%;
  159. font-size: 28upx;
  160. color: #666666;
  161. position: relative;
  162. font-weight: 300;
  163. &.current {
  164. font-weight: 500;
  165. .current-line {
  166. content: '';
  167. position: absolute;
  168. left: 50%;
  169. bottom: 10upx;
  170. transform: translateX(-50%);
  171. width: 40upx;
  172. height: 6upx;
  173. background: $base-btn-bg;
  174. border-radius: 6upx;
  175. /*border-bottom: 2px solid #F53C28;*/
  176. }
  177. }
  178. }
  179. }
  180. .gq-list {
  181. display: flex;
  182. flex-wrap: wrap;
  183. justify-content: flex-start;
  184. // justify-content: space-between;
  185. padding: 20rpx 0 20rpx 20rpx;
  186. }
  187. .gq-item {
  188. margin: 0 0 20rpx 14rpx;
  189. width: 227rpx;
  190. min-height: 351rpx;
  191. background: #FFFFFF;
  192. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  193. border-radius: 10rpx;
  194. display: flex;
  195. flex-direction: column;
  196. align-items: center;
  197. justify-content: space-between;
  198. padding: 30rpx 14rpx 20rpx;
  199. .gq-logo {
  200. width: 140rpx;
  201. height: 140rpx;
  202. border-radius: 50%;
  203. border: 1px solid #262261;
  204. display: flex;
  205. justify-content: center;
  206. align-items: center;
  207. image {
  208. width: 135rpx;
  209. height: 135rpx;
  210. background-color: #eee;
  211. border-radius: 50%;
  212. }
  213. }
  214. .store-name {
  215. padding-top: 10rpx;
  216. text-align: center;
  217. width: 100%;
  218. font-size: 26rpx;
  219. font-weight: 500;
  220. color: #262261;
  221. overflow: hidden;
  222. }
  223. .info {
  224. width: 100%;
  225. display: flex;
  226. padding: 5rpx 0;
  227. .info-tit {
  228. font-size: 18rpx;
  229. flex-shrink: 0;
  230. }
  231. .info-val {
  232. text-align: center;
  233. font-size: 20rpx;
  234. width: 140rpx;
  235. border-bottom: 1px #C7C7C7 solid;
  236. }
  237. }
  238. }
  239. </style>