瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
5.4 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="商城"/>
  4. <!-- <view>
  5. <uv-swiper
  6. :list="bannerList"
  7. indicator
  8. height="320rpx"
  9. keyName="image"></uv-swiper>
  10. </view> -->
  11. <view class="swipe">
  12. <uv-swiper
  13. :list="bannerList"
  14. indicator
  15. height="320rpx"
  16. keyName="image"></uv-swiper>
  17. </view>
  18. <!-- 公告 -->
  19. <view class="notice">
  20. <uv-notice-bar
  21. fontSize="28rpx"
  22. @click="$utils.navigateTo('/pages_order/notice/noticeDetail')"
  23. :text="headInfo.notice.keyName"></uv-notice-bar>
  24. </view>
  25. <!-- 分类 -->
  26. <view class="LabelOptions">
  27. <uv-tabs :list="category"
  28. :activeStyle="{color : '#000', fontWeight : 900}"
  29. lineColor="#5baaff"
  30. lineHeight="8rpx"
  31. lineWidth="50rpx"
  32. :scrollable="false"
  33. @click="tabsClick"></uv-tabs>
  34. </view>
  35. <view class="productList">
  36. <productList :productList="list"/>
  37. </view>
  38. <!-- <view class="waterfall">
  39. <uv-waterfall ref="waterfall" v-model="list"
  40. :add-time="10"
  41. :left-gap="leftGap"
  42. :right-gap="rightGap"
  43. :column-gap="columnGap"
  44. @changeList="changeList">
  45. <template v-slot:list1>
  46. <view>
  47. <view v-for="(item, index) in list1" :key="item.id" class="waterfall-item"
  48. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)">
  49. <view class="waterfall-item__image" :style="[imageStyle(item)]">
  50. <image :src="item.image" mode="widthFix" :style="{width:item.width+'px'}"></image>
  51. </view>
  52. <view class="waterfall-item__ft">
  53. <view class="waterfall-item__ft__title">
  54. <text class="title">{{item.name}}</text>
  55. </view>
  56. <view class="waterfall-item__ft__desc uv-line-2">
  57. <text class="price">现价{{item.price}}</text>
  58. <text class="oldPrice">原价{{item.oldPrice}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <template v-slot:list2>
  65. <view>
  66. <view v-for="(item, index) in list2" :key="item.id" class="waterfall-item"
  67. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)">
  68. <view class="waterfall-item__image" :style="[imageStyle(item)]">
  69. <image :src="item.image" mode="widthFix" :style="{width:item.width+'px'}"></image>
  70. </view>
  71. <view class="waterfall-item__ft">
  72. <view class="waterfall-item__ft__title">
  73. <text class="title">{{item.name}}</text>
  74. </view>
  75. <view class="waterfall-item__ft__desc uv-line-2">
  76. <text class="price">现价{{item.price}}</text>
  77. <text class="oldPrice">原价{{item.oldPrice}}</text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. </uv-waterfall>
  84. </view> -->
  85. <tabber select="1" />
  86. </view>
  87. </template>
  88. <script>
  89. import mixinsList from '@/mixins/list.js'
  90. import tabber from '@/components/base/tabbar.vue'
  91. import productList from '@/components/user/productList.vue'
  92. import { mapState } from 'vuex'
  93. export default {
  94. mixins: [mixinsList],
  95. components : {
  96. tabber,
  97. productList,
  98. },
  99. computed: {
  100. ...mapState(['city', 'userInfo', 'headInfo']),
  101. // imageStyle(item) {
  102. // return item => {
  103. // const v = uni.upx2px(750) - this.leftGap - this.rightGap - this.columnGap;
  104. // const w = v / 2;
  105. // const rate = w / item.w;
  106. // const h = rate * item.h;
  107. // return {
  108. // width: w + 'px',
  109. // height: h + 'px'
  110. // }
  111. // }
  112. // }
  113. },
  114. data() {
  115. return {
  116. mixinsListApi: 'getShopPingPage',
  117. // list1: [], // 瀑布流第一列数据
  118. // list2: [], // 瀑布流第二列数据
  119. // leftGap: 10,
  120. // rightGap: 10,
  121. // columnGap: 10,
  122. bannerList : [],
  123. category : [
  124. {
  125. name : '美食商城',
  126. value : 0,
  127. },
  128. {
  129. name : '家乡特产',
  130. value : 1,
  131. },
  132. {
  133. name : '积分商城',
  134. value : 2,
  135. },
  136. {
  137. name : '二手集市',
  138. value : 3,
  139. },
  140. ],
  141. }
  142. },
  143. onShow() {
  144. this.getBannerList()
  145. },
  146. onLoad() {
  147. this.queryParams.className = 0
  148. },
  149. methods: {
  150. // 这点非常重要:e.name在这里返回是list1或list2,要手动将数据追加到相应列
  151. // changeList(e) {
  152. // this[e.name].push(e.value);
  153. // },
  154. // 获取banner
  155. getBannerList(){
  156. this.$api('getBannerList', res => {
  157. if(res.code == 200){
  158. this.bannerList = res.result
  159. }
  160. })
  161. },
  162. tabsClick(item) {
  163. this.queryParams.className = item.value
  164. this.getData()
  165. },
  166. }
  167. }
  168. </script>
  169. <style scoped lang="scss">
  170. .page{
  171. .swipe{
  172. overflow: hidden;
  173. border-radius: 20rpx;
  174. margin: 20rpx;
  175. }
  176. .notice{
  177. padding: 20rpx;
  178. }
  179. .productList{
  180. padding: 0 20rpx;
  181. }
  182. }
  183. // $show-lines: 1;
  184. // @import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
  185. // .waterfall-item {
  186. // overflow: hidden;
  187. // margin-top: 10px;
  188. // border-radius: 6px;
  189. // }
  190. // .waterfall-item__ft {
  191. // padding: 20rpx;
  192. // background: #fff;
  193. // &__title {
  194. // margin-bottom: 10rpx;
  195. // line-height: 48rpx;
  196. // font-weight: 700;
  197. // .value {
  198. // font-size: 32rpx;
  199. // color: #303133;
  200. // }
  201. // }
  202. // &__desc .value {
  203. // font-size: 28rpx;
  204. // color: #606266;
  205. // }
  206. // &__btn {
  207. // padding: 10px 0;
  208. // }
  209. // }
  210. // .waterfall-item__ft__title{
  211. // font-size: 28rpx;
  212. // }
  213. // .price{
  214. // color: #f40;
  215. // }
  216. // .oldPrice{
  217. // color: #777;
  218. // font-size: 22rpx;
  219. // text-decoration: underline;
  220. // }
  221. </style>