giftpackage.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <view class="gift-package" v-if="!loadding">
  3. <view class="rule">
  4. <button class="rule_btn" @click="ReLaunch()">返回首页</button>
  5. <!-- <button class="rule_btn">活动规则</button> -->
  6. </view>
  7. <image class="gift-bg" :src="detail.file_path" mode="widthFix"></image>
  8. <view class="gift-package-main">
  9. <view class="p-0-30" v-if="detail.is_point">
  10. <view class="integral">
  11. <view class="title f30">
  12. 积分礼包
  13. </view>
  14. <view class="integral_btom d-c-c">
  15. <image src="/static/gift.png" mode="widthFix"></image>
  16. <view class="info">
  17. <view class="num">
  18. {{parseFloat(detail.point)}}积分
  19. </view>
  20. <view>无门槛 全品类</view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="t-c" v-if="detail.is_point">
  26. <text class="add">+</text>
  27. </view>
  28. <view class="p-0-30" v-if="detail.is_coupon">
  29. <view class="cuopon-group" if="detail.is_coupon">
  30. <view class="title f30">
  31. 优惠券礼包
  32. </view>
  33. <view class="body">
  34. <view class="item" v-for="(item,index) in detail.coupon_list" :key="index">
  35. <view class="cuopon_item">
  36. <view><image class="cuopon_img" src="../../../static/youhuiquan.png" mode=""></image></view>
  37. <view class="d-s-c">
  38. <view class="d-s-c item_cuopon">
  39. <view class="price">
  40. <view class="">
  41. <text class="f22">¥</text><text class="f34">{{parseFloat(item.reduce_price)}}</text>
  42. </view>
  43. <view class="f22">优惠券</view>
  44. </view>
  45. <view class="des">
  46. <view class="des_t">{{item.name}}</view>
  47. <view class="des_b" v-if="item.expire_type==20">有效期至{{item.end_time.text}}</view>
  48. <view class="des_b" v-if="item.expire_type==10">领取后{{item.expire_day}}天内有效</view>
  49. </view>
  50. </view>
  51. <view class="cuopon_num">X{{item.coupon_num}}张</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="t-c" v-if="detail.is_product&&detail.is_coupon">
  59. <text class="add">+</text>
  60. </view>
  61. <view class="p-0-30" v-if="detail.is_product">
  62. <view class="cuopon-group">
  63. <view class="title f30">
  64. <view>商品礼包</view>
  65. <view class="">({{detail.product_list.length}}选{{detail.product_num}})</view>
  66. </view>
  67. <view class="body">
  68. <view class="item mb30 bg-white" v-for="(item,index) in detail.product_list" :key="index" @click="choosePro(item.product_id)">
  69. <view class="d-s-c">
  70. <view>
  71. <image class="product_img" :src="item.image[0].file_path" mode="aspectFill"></image>
  72. </view>
  73. <view class="pro">
  74. <view class="pro_t">{{item.product_name}}</view>
  75. <view class="pro_b"><text class="f18">¥</text>{{item.product_price}}</view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="btns">
  83. <button type="primary" @click="toPay()">{{detail.money}}元购买</button>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import {pay} from '@/common/pay.js';
  90. import utils from '@/common/utils.js';
  91. export default {
  92. data() {
  93. return {
  94. /*是否加载完成*/
  95. loadding: false,
  96. package_id: 0,
  97. code: 0,
  98. /*礼包详情*/
  99. detail: {
  100. name:'',
  101. start_time:{text:''},
  102. end_time:{text:''},
  103. is_point:false,
  104. point:0,
  105. money:'',
  106. },
  107. }
  108. },
  109. onLoad(e) {
  110. /*商品id*/
  111. let scene = utils.getSceneData(e);
  112. this.package_id = e.package_id ? e.package_id : scene.pid;
  113. this.code = e.code ? e.code : scene.cid;
  114. if (typeof(this.code) == "undefined")
  115. {
  116. this.code = '';
  117. }
  118. },
  119. onShow() {
  120. /*获取数据*/
  121. this.getData();
  122. },
  123. methods: {
  124. /*获取数据*/
  125. getData() {
  126. let self = this;
  127. uni.showLoading({
  128. title: '加载中'
  129. });
  130. self.loadding = true;
  131. self._get('plus.package.package/index', {
  132. package_id: self.package_id,
  133. code: self.code
  134. }, function(res) {
  135. self.detail = res.data.data;
  136. self.loadding = false;
  137. });
  138. },
  139. /* 返回首页 */
  140. ReLaunch(){
  141. this.gotoPage('/pages/index/index', 'reLaunch');
  142. },
  143. toPay(){
  144. this.gotoPage('/pages/order/giftpackage-order?package_id='+this.package_id+'&code='+this.code);
  145. }
  146. }
  147. }
  148. </script>
  149. <style>
  150. page{
  151. }
  152. .gift-package {
  153. position: relative;
  154. min-height: 100vh;
  155. }
  156. .gift-package .gift-bg {
  157. position: absolute;
  158. top: 0;
  159. left: 0;
  160. right: 0;
  161. width: 100%;
  162. z-index: 0;
  163. }
  164. .gift-package .gift-package-main {
  165. width: 750rpx;
  166. padding-top: 700rpx;
  167. padding-bottom: 120rpx;
  168. background: linear-gradient(to bottom, #f5600b 0%,#e22319 50%,#e22319 100%);
  169. }
  170. .giftpackagr-info{
  171. margin: 0 auto;
  172. width: 350rpx;
  173. height: 43rpx;
  174. line-height: 43rpx;
  175. border: 1rpx solid #fa212c;
  176. background: rgba(255,255,255);
  177. border-radius: 30rpx;
  178. text-align: center;
  179. position: absolute;
  180. top: 258rpx;
  181. left: 200rpx;
  182. z-index: 10;
  183. }
  184. .detatime{
  185. /* padding:10px 30px; */
  186. font-size: 18rpx;
  187. color: #fa1f29;
  188. font-weight: 800;
  189. }
  190. /* .gift-package-main .datetime {
  191. margin: 0 auto;
  192. width: 600rpx;
  193. height: 60rpx;
  194. line-height: 60rpx;
  195. text-align: center;
  196. } */
  197. .cuopon-group {
  198. color: #ffffff;
  199. text-align: center;
  200. font-size: 30rpx;
  201. background-color: #ffffff30;
  202. border-radius: 15rpx;
  203. padding: 35rpx;
  204. position: relative;
  205. z-index: 98;
  206. }
  207. .cuopon-group .title{
  208. font-size: 40rpx;
  209. color: #FFFFFF;
  210. text-align: center;
  211. }
  212. .cuopon-group .body {
  213. margin-top: 20rpx;
  214. }
  215. .cuopon_item{
  216. position: relative;
  217. }
  218. .item_cuopon{
  219. z-index: 50;
  220. }
  221. .cuopon-group .body .item {
  222. padding: 20rpx;
  223. display: flex;
  224. flex-direction: column;
  225. border-radius: 20rpx;
  226. position: relative;
  227. }
  228. .cuopon_img{
  229. width: 493rpx;
  230. height: 123rpx;
  231. position: absolute;
  232. top: 0;
  233. left: 0;
  234. }
  235. .cuopon-group .body .item .price {
  236. z-index: 50;
  237. font-size:14rpx;
  238. margin-left: 26rpx;
  239. }
  240. .cuopon-group .body .item .des {
  241. z-index: 50;
  242. padding: 26rpx 0;
  243. font-size: 24rpx;
  244. text-align: left;
  245. margin-left: 50rpx;
  246. }
  247. .item .des .des_t {
  248. font-size: 26rpx;
  249. color: #000000;
  250. margin-bottom: 12rpx;
  251. }
  252. .item .des .des_c {
  253. font-size: 18rpx;
  254. color: #6b6b6b;
  255. margin-bottom: 8rpx;
  256. }
  257. .item .des .des_b {
  258. font-size: 18rpx;
  259. color: #6b6b6b;
  260. }
  261. .t-c{
  262. text-align: center;
  263. }
  264. .gift-package-main .integral {
  265. background-color: #ffffff66;
  266. padding: 60rpx 30rpx;
  267. border-radius: 15rpx;
  268. position: relative;
  269. z-index: 98;
  270. }
  271. .gift-package-main .integral .title{
  272. font-size: 40rpx;
  273. color: #FFFFFF;
  274. text-align: center;
  275. }
  276. .gift-package-main .integral_btom {
  277. width: 613rpx;
  278. height: 193rpx;
  279. background-color: #ffffff;
  280. margin-top: 20rpx;
  281. border-radius: 15rpx;
  282. }
  283. .gift-package-main .integral .info {
  284. margin-left: 30rpx;
  285. width: 300rpx;
  286. color: #f0510e;
  287. }
  288. .gift-package-main .integral image {
  289. width: 135rpx;
  290. height: 135rpx;
  291. }
  292. .gift-package-main .integral .num {
  293. font-size: 50rpx;
  294. }
  295. .gift-package-main .btns {
  296. margin-top: 92rpx;
  297. padding:0 84rpx;
  298. }
  299. .gift-package-main .btns button {
  300. height: 100rpx;
  301. line-height: 100rpx;
  302. text-shadow: 0 0 8rpx 0 rgba(0, 0, 0, .3);
  303. border-radius: 50rpx;
  304. color: #920202;
  305. font-size: 36rpx;
  306. box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, .1);
  307. background: linear-gradient(0deg, #ffde63, #edb12f);
  308. }
  309. .rule{
  310. overflow: hidden;
  311. position: fixed;
  312. right: 0;
  313. top: 480rpx;
  314. z-index: 100;
  315. }
  316. .rule_btn{
  317. margin-top: 27rpx;
  318. width: 183rpx;
  319. height: 62rpx;
  320. line-height: 62rpx;
  321. text-align: center;
  322. background-color: #e83514;
  323. border: 1rpx solid #ffffff;
  324. border-right: none;
  325. border-top-left-radius: 32rpx;
  326. border-bottom-left-radius: 32rpx;
  327. color: #ffffff;
  328. font-size: 26rpx;
  329. }
  330. .add{
  331. font-size: 73rpx;
  332. font-weight: 900;
  333. text-align: center;
  334. color: #FFFFFF;
  335. position: relative;
  336. z-index: 98;
  337. }
  338. .cuopon_num{
  339. position: absolute;
  340. right: 0;
  341. }
  342. .product_img{
  343. width: 140rpx;
  344. height: 140rpx;
  345. }
  346. .pro{
  347. margin-left: 12rpx;
  348. text-align: left;
  349. }
  350. .pro_t{
  351. font-size: 24rpx;
  352. color: #000000;
  353. margin-bottom: 15rpx;
  354. }
  355. .pro_c{
  356. font-size: 20rpx;
  357. color: #686868;
  358. margin-bottom: 33rpx;
  359. }
  360. .pro_b{
  361. font-size: 28rpx;
  362. color: #fd0000;
  363. margin-left: 252rpx;
  364. }
  365. .f18{
  366. font-size: 18rpx;
  367. }
  368. .pro_choose{
  369. width: 33rpx;
  370. height: 33rpx;
  371. position: absolute;
  372. right: 10rpx;
  373. top: 6rpx;
  374. }
  375. </style>