home.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view class="home">
  3. <view class="top-list">
  4. <loadSke :loading='topLoading' :list='bannerList'>
  5. <swiper class="swiper-box" :current="current" autoplay circular indicator-dots>
  6. <swiper-item v-for="(item,index) in bannerList" :key='index'>
  7. <image @click="clickJumpType(item)" class="image" :src="item.fileUrl" mode="aspectFill" :draggable="false" />
  8. </swiper-item>
  9. </swiper>
  10. <view class="eat-box">
  11. <view class="eat" v-for="(item,index) in couponList" :key='index' @click="clickJumpType(item)">
  12. <image :src="item.fileUrl" mode="scaleToFill" class="img"></image>
  13. <view class="text-box">
  14. <text class="text-1">{{item.pictureName}}</text>
  15. <text class="text-2">{{item.dataDescribe.toString()}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="menu-box">
  20. <view class="menu" v-for="(item,index) in menuList" :key='index' @click="clickJumpType(item)">
  21. <image :src="item.fileUrl" mode="scaleToFill" class="img"></image>
  22. <text class="text-1">{{item.pictureName}}</text>
  23. <text class="text-2">{{item.dataDescribe || '暂无描述'}}</text>
  24. </view>
  25. </view>
  26. </loadSke>
  27. </view>
  28. <view class="item-box">
  29. <view class="item-titBox">
  30. <text class="item-tit">限时特价</text>
  31. <!-- <text class="item-tit-right" @tap='go()'>更多视频 ></text> -->
  32. </view>
  33. <loadSke :loading='pddLoading' :list='pddList'>
  34. <view class="flex-box">
  35. <view class="film-box" v-for="(item,index) in pddList" :key='index' @click="goMiniApp(JSON.stringify({appId:item.we_app_info.app_id,path:item.we_app_info.page_path}))">
  36. <image :src="item.goods_image_url" mode="scaleToFill" class="img" draggable></image>
  37. <view class="bottom-box">
  38. <view class="tit">
  39. <text class="text-1">{{item.goods_name}}</text>
  40. </view>
  41. <view class="des-box">
  42. <view class="des">{{item.unified_tags}}</view>
  43. <!-- <view class="des">演员:高山南 山崎和佳奈 小山 山崎和佳奈 小山 ...</view> -->
  44. </view>
  45. <view class="buy-box">
  46. <text class="price">{{'¥'+(item.min_group_price)/100}}</text>
  47. <button type="default" class="buy">活动价 {{'¥'+(item.min_group_price-item.coupon_discount)/100}}</button>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- <view class="ad-video">
  53. <ad unit-id="adunit-173f2958099a2b25" ad-type="video" ad-theme="white"></ad>
  54. </view> -->
  55. </loadSke>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. getHomePageDataList,
  62. getPDD,
  63. getPddWxData
  64. } from '@/api/home.js'
  65. export default {
  66. data: () => ({
  67. bannerList: [],
  68. couponList: [],
  69. menuList: [],
  70. topLoading: true,
  71. pddList: [],
  72. pddLoading: true
  73. }),
  74. mounted() {
  75. this.init()
  76. },
  77. methods: {
  78. init() {
  79. getHomePageDataList().then(res => {
  80. this.bannerList = res.data.carouselChart
  81. this.couponList = res.data.coupon.slice(0, 4)
  82. this.menuList = res.data.menu
  83. this.$nextTick(() => {
  84. this.topLoading = false
  85. })
  86. })
  87. getPddWxData().then(res => {
  88. this.pddList = res
  89. this.$nextTick(() => {
  90. this.pddLoading = false
  91. })
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .top-list {
  99. padding: 30rpx;
  100. box-sizing: border-box;
  101. width: 100%;
  102. background-color: #FFFFFF;
  103. .swiper-box {
  104. width: 690rpx;
  105. height: 342rpx;
  106. overflow: hidden;
  107. .image {
  108. width: 100%;
  109. height: 100%;
  110. border-radius: 10px;
  111. }
  112. }
  113. .eat-box {
  114. margin-top: 40rpx;
  115. display: flex;
  116. justify-content: space-between;
  117. .eat {
  118. width: 144rpx;
  119. height: 190rpx;
  120. position: relative;
  121. .img {
  122. width: 100%;
  123. height: 100%;
  124. }
  125. .text-box {
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: center;
  129. align-items: center;
  130. position: absolute;
  131. bottom: 10rpx;
  132. left: 50%;
  133. width: 100%;
  134. transform: translateX(-50%);
  135. .text-1 {
  136. font-size: 24rpx;
  137. color: #FFFFFF;
  138. text-align: center;
  139. }
  140. .text-2 {
  141. font-size: 20rpx;
  142. color: #FFFFFF;
  143. text-align: center;
  144. }
  145. }
  146. }
  147. }
  148. .menu-box {
  149. display: flex;
  150. justify-content: flex-start;
  151. flex-wrap: wrap;
  152. margin: 0 -10rpx;
  153. .menu {
  154. width: 20%;
  155. padding: 0 10rpx;
  156. box-sizing: border-box;
  157. // height: 121rpx;
  158. margin-top: 40rpx;
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: space-between;
  162. align-items: center;
  163. .img {
  164. flex-shrink: 0;
  165. width: 64rpx;
  166. height: 64rpx;
  167. border-radius: 50%;
  168. }
  169. .text-1 {
  170. margin-top: 10rpx;
  171. font-size: 24rpx;
  172. color: #0F0404;
  173. text-align: center;
  174. overflow: hidden;
  175. text-overflow: ellipsis;
  176. white-space: nowrap;
  177. }
  178. .text-2 {
  179. font-size: 20rpx;
  180. color: #666666;
  181. text-align: center;
  182. overflow: hidden;
  183. text-overflow: ellipsis;
  184. white-space: nowrap;
  185. }
  186. }
  187. }
  188. }
  189. .item-box {
  190. background-color: #fff;
  191. margin-top: 40rpx;
  192. .item-titBox {
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. padding: 20rpx;
  197. border-bottom: 1rpx solid #e8e8e8;
  198. .item-tit {
  199. border-left: 8rpx solid #E31818;
  200. font-size: 30rpx;
  201. padding: 11rpx;
  202. margin-left: 20rpx;
  203. }
  204. .item-tit-right {
  205. font-size: 26rpx;
  206. color: #666666;
  207. line-height: 58rpx;
  208. padding: 11rpx;
  209. }
  210. }
  211. .flex-box {
  212. display: flex;
  213. justify-content: center;
  214. flex-wrap: wrap;
  215. background-color: #F8F8F8;
  216. padding-bottom: 20rpx;
  217. .film-box {
  218. width: 334rpx;
  219. border-radius: 20rpx;
  220. overflow: hidden;
  221. background: #FFFFFF;
  222. margin: 30rpx 11rpx 0;
  223. .img {
  224. width: 100%;
  225. height: 334rpx;
  226. }
  227. .bottom-box {
  228. padding: 30rpx 20rpx;
  229. .tit {
  230. display: flex;
  231. justify-content: space-between;
  232. .text-1 {
  233. width: 100%;
  234. font-size: 26rpx;
  235. overflow: hidden;
  236. text-overflow: ellipsis;
  237. white-space: nowrap;
  238. }
  239. }
  240. .des-box {
  241. margin-top: 10rpx;
  242. .des {
  243. width: 100%;
  244. font-size: 22rpx;
  245. color: #666666;
  246. overflow: hidden;
  247. text-overflow: ellipsis;
  248. white-space: nowrap;
  249. }
  250. }
  251. .buy-box {
  252. margin-top: 20rpx;
  253. display: flex;
  254. justify-content: flex-start;
  255. align-items: center;
  256. .price {
  257. // color: #E31818;
  258. text-decoration: line-through;
  259. font-size: 34rpx;
  260. }
  261. .buy {
  262. height: 40rpx;
  263. background: linear-gradient(90deg, #E31818, #ED3E24, #ED4F24);
  264. border-radius: 20rpx;
  265. margin-left: 10rpx;
  266. font-size: 20rpx;
  267. color: #FFFFFF;
  268. display: flex;
  269. justify-content: center;
  270. align-items: center;
  271. white-space: nowrap;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. .ad-video {
  279. margin-top: 40rpx;
  280. }
  281. </style>