index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="container flex-center flex-column">
  3. <global-loading />
  4. <view v-if="StoreListData.length > 0" class="inStoreBackImg flex-items-plus">
  5. <label>选择进入的店铺</label>
  6. </view>
  7. <view>
  8. <view
  9. v-for="(item, index) in StoreListData" :key="index" class="flex-items-plus flex-column"
  10. @click="getStore(item)"
  11. >
  12. <view class="store-box flex-items-plus flex-sp-between mar-top-30 bor-line-E5E5E5 pad-bot-30">
  13. <view class="flex-items-plus">
  14. <image class="storeLogoImg" :src="item.shopLogo"></image>
  15. <view class="font-color-656 fs24 mar-left-20">
  16. <label class="fs30 font-color-333">{{ item.shopName }}</label>
  17. <view class="flex-row-plus mar-top-20">
  18. <label>等级:{{ item.levelName }} </label>
  19. </view>
  20. <view class="mar-top-10">关系:<label>{{ item.state == 1 ? '有效' : '被清退' }}</label></view>
  21. </view>
  22. </view>
  23. <view class="income">
  24. <view class="font-color-333 fs30">总收益</view>
  25. <view class="font-color-C5AA7B fs30">{{ item.price }}元</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view v-if="ifEmpty" class="emptyCart-box flex-items-plus flex-column">
  31. <image class="emptyCart-img" src="../../static/images/origin/bgnull.png"></image>
  32. <label class="font-color-999 fs26 mar-top-30">这里空空如也~</label>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. const NET = require('../../utils/request')
  38. const API = require('../../config/api')
  39. export default {
  40. data() {
  41. return {
  42. currentId: '',
  43. StoreListData: [],
  44. StoreListQuery: {
  45. id: ''
  46. },
  47. page: 1,
  48. pageSize: 20,
  49. loadingType: 0,
  50. ifEmpty: false
  51. }
  52. },
  53. onLoad() {
  54. this.getStoreList()
  55. },
  56. onReachBottom() {
  57. if (this.loadingType == 1) {
  58. uni.stopPullDownRefresh()
  59. } else {
  60. this.page = this.page + 1
  61. this.getStoreList()
  62. }
  63. },
  64. onBackPress(e) {
  65. if (e.from === 'navigateBack') {
  66. return false
  67. }
  68. this.back()
  69. return true
  70. },
  71. methods: {
  72. back() {
  73. uni.switchTab({
  74. url: '../../pages/tabbar/user/index'
  75. })
  76. },
  77. getStoreList() {
  78. // uni.showLoading({
  79. // mask: true,
  80. // title: '加载中...'
  81. // })
  82. NET.request(API.FindSaleStoreList, {
  83. page: this.page,
  84. pageSize: this.pageSize
  85. }, 'GET').then((res) => {
  86. uni.hideLoading()
  87. if (res.data.list.length == 0) {
  88. this.loadingType = 1
  89. this.page = this.page
  90. }
  91. this.StoreListData = this.StoreListData.concat(res.data.list)
  92. if (this.StoreListData.length === 0) {
  93. this.ifEmpty = true
  94. }
  95. })
  96. .catch((res) => {
  97. uni.hideLoading()
  98. })
  99. },
  100. getStore(item) {
  101. uni.navigateTo({
  102. url: 'salesIndex?distributeInfo=' + JSON.stringify(item)
  103. })
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. page {
  110. background: #F8F8F8;
  111. }
  112. .emptyCart-box {
  113. margin-top: 70upx;
  114. .emptyCart-img {
  115. width: 113upx;
  116. height: 98upx;
  117. }
  118. }
  119. .container {
  120. .inStoreBackImg {
  121. width: 100%;
  122. height: 100upx;
  123. background: #333333;
  124. color: #FFFFFF;
  125. }
  126. .store-box {
  127. width: 690upx;
  128. background: #FFFFFF;
  129. padding: 22rpx;
  130. .storeLogoImg {
  131. width: 140upx;
  132. height: 140upx;
  133. }
  134. .income {
  135. width: 200rpx;
  136. text-align: center;
  137. border-left: 2rpx solid #F3F4F5;
  138. }
  139. }
  140. }
  141. </style>