多租户商城-商户小程序端

163 lines
3.7 KiB

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