home.vue 6.8 KB

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