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

240 lines
5.3 KiB

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