index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <page :title="title" :light="false" navColor="#fff" ref="pageRef">
  3. <!-- <view
  4. class="pagae-nav"
  5. :style="{ paddingTop: statusBarHeight + 'px', background: headerBg }"
  6. >
  7. <view class="flex-align-center relative" style="height: 80rpx">
  8. <text class="cuIcon-back back" @click.stop="back"></text>
  9. <view v-if="data" class="title line-ellipsis">
  10. {{ data && data.name }}
  11. </view>
  12. </view>
  13. </view> -->
  14. <view style="background-color: #fff">
  15. <view class="overflow-hidden paddingT10">
  16. <swiper
  17. @change="bannerChange"
  18. :current="active"
  19. class="screen-swiper"
  20. :indicator-dots="false"
  21. circular="true"
  22. duration="400"
  23. >
  24. <swiper-item v-for="(item, index) in products" :key="index">
  25. <view class="image-wrapper">
  26. <image :src="item.spu.cover" class="image" mode="aspectFit" />
  27. <image
  28. class="super-text translateX"
  29. :src="LEVEL_MAP[item.level].titleImg"
  30. />
  31. <view class="swiperIndex font6">
  32. <span class="current">{{ index + 1 }}</span>
  33. /{{ products.length }}
  34. </view>
  35. </view>
  36. <view class="content-wrapper font2">
  37. <view class="flex-align">
  38. <view style="color: #666666; width: 120rpx" class="flex-shrink0">
  39. 名称:
  40. </view>
  41. <text style="color: #000000" class="marginL10">{{ title }}</text>
  42. </view>
  43. <view class="flex-align paddingT8">
  44. <view style="color: #666666; width: 150rpx">参考价格:</view>
  45. <text style="color: #000000" class="marginL10">
  46. {{ item.spu.marketPrice }}元
  47. </text>
  48. </view>
  49. <view class="flex-align paddingT8">
  50. <view style="color: #666666; width: 150rpx">投放数量:</view>
  51. <text style="color: #000000" class="marginL10">
  52. {{ data.mode == 'YFS_PRO'? item.quantity : '无限' }}
  53. </text>
  54. </view>
  55. <view class="flex-align paddingT8">
  56. <view style="color: #666666; width: 120rpx">参数:</view>
  57. <scroll-view
  58. scroll-x
  59. class="flex1 scroll-wrapper"
  60. v-if="item.spu && item.spu.parameter"
  61. >
  62. <view
  63. v-for="param in JSON.parse(item.spu.parameter)"
  64. :key="param.label"
  65. class="item"
  66. >
  67. <view style="color: #000000">{{ param.label }}</view>
  68. <view style="color: #666666">{{ param.value }}</view>
  69. </view>
  70. </scroll-view>
  71. </view>
  72. <view class="paddingT8 flex-align" v-if="item.spu.brandName">
  73. <view style="color: #666666; width: 120rpx">品牌:</view>
  74. <text style="color: #000000" class="marginL10">
  75. {{ item.spu.brandName }}
  76. </text>
  77. </view>
  78. </view>
  79. </swiper-item>
  80. </swiper>
  81. </view>
  82. <view class="content-wrapper font2" style="margin-top: 0">
  83. <view class="flex">
  84. <view style="color: #666666; width: 120rpx" class="flex-shrink0">
  85. 发货规则:
  86. </view>
  87. <text style="color: #000000" class="marginL10">
  88. 宝箱商品购买后会自动放在仓库中。您可以在仓库中进行提货,申请提货后,我们在5个工作日内进行发货
  89. (如遇特殊情况可能会有延迟)。
  90. </text>
  91. </view>
  92. <view class="paddingT8 flex">
  93. <view style="color: #666666; width: 120rpx" class="flex-shrink0">
  94. 运费说明:
  95. </view>
  96. <text style="color: #000000" class="marginL10">
  97. 宝箱购买商品满5件包邮,不满足包邮条件的,全国范围统一15元运费。可配送区域为中国大陆地区
  98. (除特殊偏远地区),收件地址在此之外的区域请勿下单。
  99. </text>
  100. </view>
  101. </view>
  102. <view class="rell_product">
  103. <image class="width100 height100" :src="resource.real100" mode="widthFix" />
  104. </view>
  105. <detail v-if="productDetail" :data="productDetail" />
  106. </view>
  107. </page>
  108. </template>
  109. <script>
  110. import { LEVEL_MAP } from '@/utils/config'
  111. import checkout from './../award_detail/checkout'
  112. import resource from '@/utils/resource'
  113. import detail from './detail'
  114. export default {
  115. components: { checkout, detail },
  116. data() {
  117. return {
  118. resource,
  119. LEVEL_MAP,
  120. poolId: null,
  121. active: 0,
  122. data: null,
  123. products: [],
  124. productDetail: null,
  125. title: '',
  126. scrollTop: 0
  127. }
  128. },
  129. onLoad(options) {
  130. this.poolId = options.poolId
  131. this.active = options.index
  132. },
  133. mounted() {
  134. setTimeout(() => {
  135. this.getData(true)
  136. }, 100)
  137. },
  138. computed: {
  139. hide() {
  140. return !this.$store.state.hide
  141. },
  142. statusBarHeight() {
  143. if (this.$store.state.systemInfo) {
  144. return this.$store.state.systemInfo.statusBarHeight
  145. }
  146. return 20
  147. },
  148. headerBg() {
  149. return this.scrollTop > 0 ? '#fff' : 'transparent'
  150. }
  151. },
  152. onPageScroll(e) {
  153. this.scrollTop = e.scrollTop
  154. },
  155. methods: {
  156. async getData(loading = false) {
  157. const res = await this.$service.award.detail(this.poolId, loading)
  158. this.data = res
  159. if (res) {
  160. this.products = res.luckGoodsList
  161. this.productDetail = this.products[this.active].spu
  162. this.title = this.products[this.active].name
  163. }
  164. },
  165. async pay(num) {
  166. const res = await this.$service.award.preview(this.poolId, num)
  167. if (res) {
  168. this.$refs.checkoutRef.show(num, res)
  169. this.lock = true
  170. }
  171. },
  172. onSuccess(param) {
  173. this.$cache.set(this.$cache.key.AWARD_GOODS, this.products)
  174. if (param.num >= 10) {
  175. this.$router.push('lottery_more', param)
  176. } else {
  177. this.$router.push('lottery', param)
  178. }
  179. setTimeout(() => {
  180. this.getData(false)
  181. }, 500)
  182. },
  183. bannerChange(e) {
  184. this.active = e.detail.current
  185. this.productDetail = { ...this.products[this.active].spu }
  186. this.title = this.products[this.active].name
  187. }
  188. }
  189. }
  190. </script>
  191. <style></style>
  192. <style lang="scss" scoped>
  193. .fill-height {
  194. height: 168rpx;
  195. }
  196. .pagae-nav {
  197. position: fixed;
  198. left: 0;
  199. top: 0;
  200. width: 100%;
  201. z-index: 100;
  202. align-items: center;
  203. .title {
  204. font-size: 30rpx;
  205. font-weight: bold;
  206. text-align: center;
  207. line-height: 72rpx;
  208. width: 500rpx;
  209. }
  210. .back {
  211. z-index: 1800;
  212. font-size: 32rpx;
  213. line-height: 32rpx;
  214. position: absolute;
  215. left: 20rpx;
  216. top: 24rpx;
  217. }
  218. }
  219. .bottom {
  220. position: fixed;
  221. left: 0;
  222. right: 0;
  223. bottom: 0;
  224. background: #171b1e;
  225. height: 168rpx;
  226. padding-bottom: 40rpx;
  227. .bottom-btns {
  228. height: 128rpx;
  229. .text {
  230. width: 100px;
  231. text-align: center;
  232. position: absolute;
  233. bottom: 26rpx;
  234. font-size: 24rpx;
  235. color: #fff;
  236. }
  237. }
  238. .image {
  239. height: 108rpx;
  240. width: 100%;
  241. }
  242. }
  243. .content-wrapper {
  244. padding: 32rpx;
  245. margin: 28rpx;
  246. background: #fffcf4;
  247. border-radius: 12rpx;
  248. }
  249. .screen-swiper {
  250. min-height: 1200rpx;
  251. swiper-item {
  252. position: relative;
  253. }
  254. .image-wrapper {
  255. height: 780rpx;
  256. position: relative;
  257. .image {
  258. height: 660rpx;
  259. width: 100%;
  260. }
  261. .super-text {
  262. position: absolute;
  263. bottom: 20rpx;
  264. width: 180rpx;
  265. height: 64rpx;
  266. }
  267. .swiperIndex {
  268. position: absolute;
  269. right: 40rpx;
  270. bottom: 20rpx;
  271. font-size: 20rpx;
  272. font-family: Source Han Sans, Source Han Sans;
  273. font-weight: 500;
  274. color: #fec433;
  275. width: 84rpx;
  276. height: 32rpx;
  277. background: #000000;
  278. border-radius: 708rpx 708rpx 708rpx 708rpx;
  279. text-align: center;
  280. line-height: 32rpx;
  281. .current {
  282. font-size: 28rpx;
  283. font-weight: bold;
  284. }
  285. }
  286. }
  287. .content-wrapper {
  288. .scroll-wrapper {
  289. padding-left: 20rpx;
  290. overflow: hidden;
  291. white-space: nowrap;
  292. width: 100%;
  293. .item {
  294. display: inline-block;
  295. padding: 0 20rpx;
  296. border-right: 2rpx solid #565758;
  297. &:first-child {
  298. padding-left: 0;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. .rell_product {
  305. height: 306rpx;
  306. margin: 28rpx;
  307. }
  308. </style>