list.vue 3.2 KB

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