list.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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].url" 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>
  22. <view class="lx" @click.stop="up(item)" v-if="item.auditFlag == 1">
  23. <text class="icon">&#xec1d;</text>
  24. 上报数据
  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, memberId: this.$getUser().memberId }
  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 = JSON.parse(item.showPictures);
  61. });
  62. }
  63. });
  64. },
  65. //上报数据
  66. up(item) {
  67. uni.navigateTo({ url: '/pages/shop/up?item=' + JSON.stringify(item) });
  68. },
  69. //开通店铺
  70. go() {
  71. uni.navigateTo({ url: '/pages/shop/apply' });
  72. },
  73. //详情
  74. detail(item) {
  75. uni.navigateTo({ url: '/pages/shop/apply?item=' + JSON.stringify(item) });
  76. }
  77. },
  78. //下拉刷新
  79. onPullDownRefresh() {
  80. setTimeout(() => {
  81. uni.stopPullDownRefresh();
  82. this.getData();
  83. }, 1000);
  84. }
  85. };
  86. </script>
  87. <style lang="scss">
  88. .list {
  89. padding: 0px 10px 70px 10px;
  90. .item {
  91. background-color: white;
  92. padding: 15px 8px 15px 8px;
  93. border-bottom: 1px solid #e5e5e5;
  94. border-radius: 5px;
  95. margin-top: 10px;
  96. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  97. .lef {
  98. float: left;
  99. width: 30%;
  100. position: relative;
  101. overflow: hidden;
  102. .pic {
  103. width: 100%;
  104. border-radius: 3px;
  105. height: 80px;
  106. background-color: #dcdcdc;
  107. overflow: hidden;
  108. }
  109. .tag {
  110. position: absolute;
  111. bottom: 0px;
  112. width: 100%;
  113. text-align: center;
  114. background-color: red;
  115. height: 20px;
  116. opacity: 0.6;
  117. color: white;
  118. }
  119. }
  120. .con {
  121. padding-left: 30px;
  122. width: 60%;
  123. float: left;
  124. .title {
  125. font-size: 15px;
  126. text-align: left;
  127. color: #252525;
  128. font-weight: bold;
  129. }
  130. .ms {
  131. margin-top: 5px;
  132. .ll {
  133. color: #d72424;
  134. font-size: 16px;
  135. padding-right: 5px;
  136. }
  137. .wz {
  138. font-size: 12px;
  139. }
  140. .audit {
  141. font-size: 12px;
  142. margin-top: 5px;
  143. color: $dar;
  144. .icon {
  145. padding-right: 3px;
  146. }
  147. }
  148. }
  149. .lx {
  150. float: right;
  151. color: #fff;
  152. background: #d72424;
  153. border-radius: 4px;
  154. padding: 6px 8px;
  155. font-size: 15px;
  156. color: white;
  157. font-weight: bold;
  158. margin-right: -20px;
  159. margin-top: -15px;
  160. .icon {
  161. padding-right: 5px;
  162. font-size: 20px;
  163. }
  164. }
  165. }
  166. }
  167. }
  168. .noLogin {
  169. margin-top: -40px;
  170. }
  171. </style>