瑶都万能墙
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.

249 lines
5.5 KiB

5 months ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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="productCategory"
  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 mixinsProduct from '@/mixins/product.js'
  91. import tabber from '@/components/base/tabbar.vue'
  92. import productList from '@/components/user/productList.vue'
  93. import { mapState } from 'vuex'
  94. export default {
  95. mixins: [mixinsList, mixinsProduct],
  96. components : {
  97. tabber,
  98. productList,
  99. },
  100. computed: {
  101. ...mapState(['city', 'userInfo', 'headInfo']),
  102. // imageStyle(item) {
  103. // return item => {
  104. // const v = uni.upx2px(750) - this.leftGap - this.rightGap - this.columnGap;
  105. // const w = v / 2;
  106. // const rate = w / item.w;
  107. // const h = rate * item.h;
  108. // return {
  109. // width: w + 'px',
  110. // height: h + 'px'
  111. // }
  112. // }
  113. // }
  114. },
  115. data() {
  116. return {
  117. mixinsListApi: 'getShopPingPage',
  118. // list1: [], // 瀑布流第一列数据
  119. // list2: [], // 瀑布流第二列数据
  120. // leftGap: 10,
  121. // rightGap: 10,
  122. // columnGap: 10,
  123. bannerList : [],
  124. // category : [
  125. // {
  126. // name : '户外',
  127. // value : 0,
  128. // },
  129. // {
  130. // name : '美食',
  131. // value : 1,
  132. // },
  133. // {
  134. // name : '兑换',
  135. // value : 2,
  136. // },
  137. // {
  138. // name : '特产',
  139. // value : 3,
  140. // },
  141. // {
  142. // name : '校园',
  143. // value : 4,
  144. // },
  145. // ],
  146. }
  147. },
  148. onShow() {
  149. this.getBannerList()
  150. },
  151. onLoad() {
  152. this.queryParams.className = 0
  153. },
  154. methods: {
  155. // 这点非常重要:e.name在这里返回是list1或list2,要手动将数据追加到相应列
  156. // changeList(e) {
  157. // this[e.name].push(e.value);
  158. // },
  159. // 获取banner
  160. getBannerList(){
  161. this.$api('getBannerList', res => {
  162. if(res.code == 200){
  163. this.bannerList = res.result
  164. }
  165. })
  166. },
  167. tabsClick(item) {
  168. this.queryParams.className = item.value
  169. this.getData()
  170. },
  171. }
  172. }
  173. </script>
  174. <style scoped lang="scss">
  175. .page{
  176. .swipe{
  177. overflow: hidden;
  178. border-radius: 20rpx;
  179. margin: 20rpx;
  180. }
  181. .notice{
  182. padding: 20rpx;
  183. }
  184. .productList{
  185. padding: 0 20rpx;
  186. }
  187. }
  188. // $show-lines: 1;
  189. // @import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
  190. // .waterfall-item {
  191. // overflow: hidden;
  192. // margin-top: 10px;
  193. // border-radius: 6px;
  194. // }
  195. // .waterfall-item__ft {
  196. // padding: 20rpx;
  197. // background: #fff;
  198. // &__title {
  199. // margin-bottom: 10rpx;
  200. // line-height: 48rpx;
  201. // font-weight: 700;
  202. // .value {
  203. // font-size: 32rpx;
  204. // color: #303133;
  205. // }
  206. // }
  207. // &__desc .value {
  208. // font-size: 28rpx;
  209. // color: #606266;
  210. // }
  211. // &__btn {
  212. // padding: 10px 0;
  213. // }
  214. // }
  215. // .waterfall-item__ft__title{
  216. // font-size: 28rpx;
  217. // }
  218. // .price{
  219. // color: #f40;
  220. // }
  221. // .oldPrice{
  222. // color: #777;
  223. // font-size: 22rpx;
  224. // text-decoration: underline;
  225. // }
  226. </style>