index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <mobile-frame :frameStyle="frameStyle" @toPath="toPath">
  3. <view class="main">
  4. <view class="one">
  5. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  6. <view class="list-scroll-view">
  7. <view class="list" v-for="(item,index) in list" :key="index">
  8. <view class="list_1">
  9. <view class="l">
  10. <image class="image" :src="item.url" mode=""></image>
  11. </view>
  12. <view class="c">
  13. <view class="name">
  14. {{item.name}}
  15. </view>
  16. <view class="other">
  17. <text>宝贝数<text>{{item.market_num}}</text></text>
  18. <text>关注数<text>{{item.follow_num}}</text></text>
  19. </view>
  20. </view>
  21. <view class="r" @tap="toFolllow(item)">
  22. <text class="iconfont icon-yduishoucangshixin-copy" v-if="item.is_follow==true"></text>
  23. <text class="iconfont icon-yduishoucangkongxin-copy" v-else></text>
  24. </view>
  25. </view>
  26. <view class="list_2">
  27. <view class="market" v-for="(tag,indexs) in item.market" :key="indexs">
  28. <image class="image" :src="tag.url" mode=""></image>
  29. <view class="money">
  30. ¥{{tag.money}}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </scroll-view>
  37. </view>
  38. </view>
  39. </mobile-frame>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. frameStyle: {
  46. useBar: true
  47. },
  48. list: [ //
  49. {
  50. url: require('@/static/test.png'),
  51. name: '官方自营店',
  52. market_num: 12,
  53. follow_num: 12,
  54. is_follow: true,
  55. market: [ //
  56. {
  57. url: require('@/static/test.png'),
  58. money: 10
  59. },
  60. {
  61. url: require('@/static/test.png'),
  62. money: 10
  63. },
  64. {
  65. url: require('@/static/test.png'),
  66. money: 10
  67. }
  68. ]
  69. },
  70. {
  71. url: require('@/static/test.png'),
  72. name: '官方自营店',
  73. market_num: 12,
  74. follow_num: 12,
  75. is_follow: false,
  76. market: [ //
  77. {
  78. url: require('@/static/test.png'),
  79. money: 10
  80. }
  81. ]
  82. }
  83. ]
  84. };
  85. },
  86. onShow: function() {},
  87. methods: {
  88. // 分页
  89. toPage() {
  90. },
  91. // 关注
  92. toFolllow(e) {
  93. console.log(e);
  94. },
  95. toPath(e) {
  96. if (e && e.route) uni.redirectTo({
  97. url: `/${e.route}`
  98. })
  99. },
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. .main {
  105. .one {
  106. .list {
  107. margin: 2vw 2vw 0 2vw;
  108. padding: 2vw;
  109. border-radius: 5px;
  110. background-color: #f5f5f5;
  111. .list_1 {
  112. display: flex;
  113. flex-direction: row;
  114. margin: 0 0 1vw 0;
  115. .l {
  116. width: 20vw;
  117. .image {
  118. width: 100%;
  119. height: 20vw;
  120. border-radius: 5px;
  121. }
  122. }
  123. .c {
  124. padding: 0 0 0 2vw;
  125. width: 60vw;
  126. .name {
  127. font-size: 16px;
  128. font-weight: bold;
  129. margin: 0 0 1vw 0;
  130. }
  131. .other {
  132. font-size: 14px;
  133. text {
  134. padding: 0 2vw 0 0;
  135. }
  136. }
  137. }
  138. .r {
  139. width: 10vw;
  140. text-align: right;
  141. text {
  142. font-size: 30px;
  143. }
  144. }
  145. }
  146. .list_2 {
  147. display: flex;
  148. flex-direction: row;
  149. flex-wrap: wrap;
  150. .market {
  151. position: relative;
  152. margin: 0 2vw 2vw 0;
  153. width: 29vw;
  154. .image {
  155. width: 100%;
  156. height: 20vw;
  157. }
  158. .money {
  159. position: absolute;
  160. bottom: 0;
  161. font-size: 10px;
  162. width: 100%;
  163. background-color: #0000005f;
  164. color: #fff;
  165. padding: 0.2vw 0;
  166. text-align: center;
  167. font-size: 14px;
  168. }
  169. }
  170. .market:nth-child(3n) {
  171. margin: 0 0 2vw 0;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. .scroll-view {
  178. position: absolute;
  179. top: 0;
  180. left: 0;
  181. right: 0;
  182. bottom: 0;
  183. .list-scroll-view {
  184. display: flex;
  185. flex-direction: column;
  186. }
  187. }
  188. </style>