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

248 lines
5.5 KiB

8 months ago
8 months ago
8 months ago
8 months ago
4 months ago
8 months ago
8 months ago
4 months ago
8 months ago
8 months ago
8 months ago
4 months ago
8 months ago
8 months ago
8 months ago
4 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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. </view>
  86. </template>
  87. <script>
  88. import mixinsList from '@/mixins/list.js'
  89. import mixinsProduct from '@/mixins/product.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, mixinsProduct],
  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. // name : '校园',
  142. // value : 4,
  143. // },
  144. // ],
  145. }
  146. },
  147. onShow() {
  148. this.getBannerList()
  149. },
  150. onLoad() {
  151. this.queryParams.className = 0
  152. },
  153. methods: {
  154. // 这点非常重要:e.name在这里返回是list1或list2,要手动将数据追加到相应列
  155. // changeList(e) {
  156. // this[e.name].push(e.value);
  157. // },
  158. // 获取banner
  159. getBannerList(){
  160. this.$api('getBannerList', res => {
  161. if(res.code == 200){
  162. this.bannerList = res.result
  163. }
  164. })
  165. },
  166. tabsClick(item) {
  167. this.queryParams.className = item.value
  168. this.getData()
  169. },
  170. }
  171. }
  172. </script>
  173. <style scoped lang="scss">
  174. .page{
  175. .swipe{
  176. overflow: hidden;
  177. border-radius: 20rpx;
  178. margin: 20rpx;
  179. }
  180. .notice{
  181. padding: 20rpx;
  182. }
  183. .productList{
  184. padding: 0 20rpx;
  185. }
  186. }
  187. // $show-lines: 1;
  188. // @import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
  189. // .waterfall-item {
  190. // overflow: hidden;
  191. // margin-top: 10px;
  192. // border-radius: 6px;
  193. // }
  194. // .waterfall-item__ft {
  195. // padding: 20rpx;
  196. // background: #fff;
  197. // &__title {
  198. // margin-bottom: 10rpx;
  199. // line-height: 48rpx;
  200. // font-weight: 700;
  201. // .value {
  202. // font-size: 32rpx;
  203. // color: #303133;
  204. // }
  205. // }
  206. // &__desc .value {
  207. // font-size: 28rpx;
  208. // color: #606266;
  209. // }
  210. // &__btn {
  211. // padding: 10px 0;
  212. // }
  213. // }
  214. // .waterfall-item__ft__title{
  215. // font-size: 28rpx;
  216. // }
  217. // .price{
  218. // color: #f40;
  219. // }
  220. // .oldPrice{
  221. // color: #777;
  222. // font-size: 22rpx;
  223. // text-decoration: underline;
  224. // }
  225. </style>