baodan.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="center">
  3. <view class="titleNview-placing"></view>
  4. <view class="product-box" v-if="integralList.length != 0">
  5. <view class="product-title">
  6. <view class="pt-title">会员商品</view>
  7. <view class="pt-bg">
  8. <image src="../../static/img/title.png" mode=""></image>
  9. </view>
  10. </view>
  11. <view class="hotgoods">
  12. <view class="hotgoods-item" v-for="item in integralList" :key="item.id" @click="navToDetailPage(item)">
  13. <view class="image-wrapper">
  14. <!-- <image class="image-bg" src="../../static/img/libao-bg.png" mode=""></image> -->
  15. <image class="image" :src="item.image" mode="scaleToFill"></image>
  16. </view>
  17. <view class="title clamp">{{ item.store_name }}</view>
  18. <view class="hot-price">
  19. <view class="price">
  20. <text class="font-size-sm">¥</text>
  21. {{ item.price * 1 }}
  22. </view>
  23. <!-- <view class="yuanPrice">月销:{{ item.sort }}</view> -->
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. loadIndexs
  33. } from '@/api/index.js';
  34. import {
  35. groomList
  36. } from '@/api/product.js';
  37. export default {
  38. data() {
  39. return {
  40. productname: '',
  41. integralList: [],
  42. carouselList: [''],
  43. page: 1,
  44. limit: 10,
  45. loadType: 'more'
  46. };
  47. },
  48. onShow: function() {
  49. // 判断是否强制登录
  50. // if (!this.hasLogin) {
  51. // // 登录拦截
  52. // interceptor();
  53. // }
  54. this.page = 1;
  55. this.limit = 10;
  56. this.loadType = 'more';
  57. this.integralList = [];
  58. this.loadData();
  59. },
  60. methods: {
  61. navTo(url) {
  62. if (url == '') {
  63. this.$api.msg('暂未开通,敬请期待');
  64. } else {
  65. uni.navigateTo({
  66. url,
  67. fail() {
  68. uni.switchTab({
  69. url
  70. });
  71. }
  72. });
  73. }
  74. },
  75. // 请求载入数据
  76. async loadData() {
  77. const obj = this;
  78. if (obj.loadType == 'loading' || obj.loadType == 'noMore') {
  79. return;
  80. }
  81. obj.loadType = 'loading';
  82. groomList({
  83. pages: obj.page,
  84. limit: obj.limit
  85. }, 1).then(({
  86. data
  87. }) => {
  88. this.integralList = this.integralList.concat(data.list);
  89. console.log(data.list, '123456');
  90. if (data.list.length == obj.limit) {
  91. obj.loadType = 'more';
  92. obj.page++;
  93. } else {
  94. obj.loadType = 'noMore';
  95. }
  96. });
  97. },
  98. //详情页
  99. navToDetailPage(item) {
  100. let id = item.id;
  101. uni.navigateTo({
  102. url: '/pages/product/product?id=' + id + '&isjf=1'
  103. });
  104. }
  105. }
  106. };
  107. </script>
  108. <style lang="scss">
  109. .center,
  110. page {
  111. height: auto;
  112. min-height: 100%;
  113. }
  114. .titleNview-placing {
  115. height: var(--status-bar-height);
  116. box-sizing: content-box;
  117. }
  118. .top-search {
  119. margin-top: 30rpx;
  120. height: 80rpx;
  121. padding: 0 20rpx;
  122. .search-box {
  123. position: relative;
  124. z-index: 2;
  125. justify-content: center;
  126. width: 740rpx;
  127. height: 60rpx;
  128. background: #fff;
  129. border-radius: 30rpx;
  130. .search {
  131. width: 26rpx;
  132. height: 30rpx;
  133. }
  134. .search-font input {
  135. width: 500rpx;
  136. margin-left: 14rpx;
  137. font-size: 28rpx;
  138. font-family: PingFang SC;
  139. font-weight: 500;
  140. color: #aaaaaa;
  141. }
  142. }
  143. }
  144. .banner {
  145. margin: 20rpx auto 0;
  146. width: 690rpx;
  147. height: 350rpx;
  148. .banner-item {
  149. width: 690rpx;
  150. height: 350rpx;
  151. image {
  152. width: 100%;
  153. height: 100%;
  154. }
  155. }
  156. }
  157. .product-box {
  158. margin-top: 20rpx;
  159. background: #ffffff;
  160. padding: 26rpx 30rpx 20rpx;
  161. .product-title {
  162. margin: 0 auto;
  163. position: relative;
  164. width: 352rpx;
  165. display: flex;
  166. align-items: center;
  167. .pt-title {
  168. width: 352rpx;
  169. text-align: center;
  170. font-size: 35rpx;
  171. font-family: Source Han Sans CN;
  172. font-weight: 500;
  173. color: #ff4c4c;
  174. }
  175. .pt-bg {
  176. position: absolute;
  177. top: 0;
  178. left: 0;
  179. right: 0;
  180. width: 352rpx;
  181. height: 9rpx;
  182. image {
  183. width: 100%;
  184. height: 100%;
  185. }
  186. }
  187. }
  188. .hotgoods {
  189. margin-top: 38rpx;
  190. width: 100%;
  191. display: flex;
  192. flex-wrap: wrap;
  193. padding: 0 0 30rpx;
  194. border-radius: 14rpx;
  195. .hotgoods-item {
  196. width: 48%;
  197. background-color: #ffffff;
  198. border-radius: 12rpx;
  199. &:nth-child(2n + 1) {
  200. margin-right: 24rpx;
  201. }
  202. .image-wrapper {
  203. width: 100%;
  204. height: 330rpx;
  205. border-radius: 3px;
  206. overflow: hidden;
  207. position: relative;
  208. .image-bg {
  209. position: absolute;
  210. top: 0;
  211. left: 0;
  212. right: 0;
  213. bottom: 0;
  214. width: 100%;
  215. height: 100%;
  216. opacity: 1;
  217. border-radius: 12rpx 12rpx 0 0;
  218. z-index: 2;
  219. }
  220. .image {
  221. width: 100%;
  222. height: 100%;
  223. opacity: 1;
  224. border-radius: 12rpx 12rpx 0 0;
  225. }
  226. }
  227. .title {
  228. margin-top: 24rpx;
  229. font-size: 34rpx;
  230. font-family: PingFang SC;
  231. font-weight: 500;
  232. color: #333333;
  233. }
  234. .hot-price {
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. padding: 14rpx 0 10rpx;
  239. .price {
  240. margin-left: 10rpx;
  241. font-size: 30rpx;
  242. font-family: PingFang SC;
  243. font-weight: bold;
  244. color: #ff1a1a;
  245. }
  246. .yuanPrice {
  247. font-size: 30rpx;
  248. font-family: PingFang SC;
  249. font-weight: bold;
  250. color: #999999;
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>