list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  5. <view class="lef">
  6. <image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
  7. <view class="tag">{{ item.shopType == 1 ? '经营门店' : '经营酒店' }}</view>
  8. </view>
  9. <view class="con">
  10. <view class="title omit">{{ item.name }}</view>
  11. <view class="ms">
  12. <view class="wz">{{ item.addres }}</view>
  13. <view class="audit" v-if="item.auditFlag == 0">
  14. <text class="icon">&#xe82e;</text>
  15. <text>待审核</text>
  16. </view>
  17. <view class="audit" v-if="item.auditFlag == 1" style="color: #18B566;">
  18. <text class="icon">&#xe82e;</text>
  19. <text>审核通过</text>
  20. </view>
  21. <view class="audit" v-if="item.auditFlag == 2" style="color: #F44336;">
  22. <text class="icon">&#xe82e;</text>
  23. <text>审核不通过</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="clear"></view>
  28. </view>
  29. </view>
  30. <view class="noLogin">
  31. <image class="u-error-icon" src="../../static/sj.png" mode="widthFix" v-if="list.length == 0"></image>
  32. <view class="dll" @click="go()">申请店铺</view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. ip: this.$http.urls.ip,
  41. list: [],
  42. param: { pageNum: 1, pageSize: 10 }
  43. };
  44. },
  45. onLoad() {
  46. uni.$on('shop', res => {
  47. this.getData();
  48. });
  49. this.getData();
  50. },
  51. methods: {
  52. //获取数据
  53. getData() {
  54. this.$http.request({
  55. url: this.$http.urls.getShopList,
  56. data: this.param,
  57. success: res => {
  58. this.list = res.data.data.list;
  59. this.list.forEach(item => {
  60. item.showPictures = item.showPictures.split(',');
  61. });
  62. }
  63. });
  64. },
  65. //开通店铺
  66. go() {
  67. uni.navigateTo({ url: '/pages/shop/apply' });
  68. },
  69. //详情
  70. detail(item) {
  71. uni.navigateTo({ url: '/pages/shop/manage?shopId=' + item.shopId });
  72. }
  73. },
  74. //下拉刷新
  75. onPullDownRefresh() {
  76. setTimeout(() => {
  77. uni.stopPullDownRefresh();
  78. this.getData();
  79. }, 1000);
  80. }
  81. };
  82. </script>
  83. <style lang="scss">
  84. .list {
  85. padding: 0px 10px 70px 10px;
  86. .item {
  87. background-color: white;
  88. padding: 15px 8px 15px 8px;
  89. border-bottom: 1px solid #e5e5e5;
  90. border-radius: 5px;
  91. margin-top: 10px;
  92. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  93. .lef {
  94. float: left;
  95. width: 30%;
  96. position: relative;
  97. overflow: hidden;
  98. height: 85px;
  99. border-radius: 4px;
  100. .pic {
  101. width: 100%;
  102. height: 85px;
  103. background-color: #dcdcdc;
  104. }
  105. .tag {
  106. position: absolute;
  107. bottom: 0;
  108. width: 100%;
  109. text-align: center;
  110. background-color: $theme-color;
  111. height: 20px;
  112. opacity: 0.7;
  113. color: white;
  114. }
  115. }
  116. .con {
  117. padding-left: 30px;
  118. width: 60%;
  119. float: left;
  120. .title {
  121. font-size: 15px;
  122. text-align: left;
  123. color: #252525;
  124. font-weight: bold;
  125. }
  126. .ms {
  127. margin-top: 5px;
  128. .ll {
  129. color: #d72424;
  130. font-size: 16px;
  131. padding-right: 5px;
  132. }
  133. .wz {
  134. font-size: 12px;
  135. }
  136. .audit {
  137. font-size: 12px;
  138. margin-top: 5px;
  139. color: $dar;
  140. .icon {
  141. padding-right: 3px;
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. .noLogin {
  149. margin-top: -40px;
  150. }
  151. </style>