ticket-det.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="ticket-det-box iPhone-bottom flex-common-css box-border-box">
  3. <view class="nav-box">
  4. <Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
  5. <template>
  6. <view slot="custom" class="align-items-center">
  7. <view class="yuan-bg">
  8. <uni-icons type="left" size="20" @click="toBack()" color="#000"></uni-icons>
  9. </view>
  10. </view>
  11. </template>
  12. </Nav>
  13. </view>
  14. <view class="scroll-view-css">
  15. <swiper class="swiper " circular :autoplay="true" :interval="3000" :duration="500" :current='BanenerCurrent' @change="onSwiperChange">
  16. <swiper-item v-for="(item,i) in obj.image" :key="i">
  17. <image class="swiper-item" :src="item" mode="aspectFill" @click="lookImg(obj.image,i)"></image>
  18. <view class="swiper-num fc-f">{{BanenerCurrent}}/{{obj.image.length}}</view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="box-border-box p-24">
  22. <view class="box-card box-border-box p-24">
  23. <view class="mb-12">
  24. <span class="fs-28 fc-FB3D03 fw-600">¥</span>
  25. <span class="fs-44 fc-FB3D03 fw-600">{{obj.price||''}}</span>
  26. </view>
  27. <view class="fs-36 fw-600">{{obj.title||''}}</view>
  28. </view>
  29. </view>
  30. <image class="pwxq" src="@/static/img/buy/pwxq.png" mode="scaleToFill"></image>
  31. <view class="box-border-box plr-24">
  32. <view class="box-card box-border-box p-24 fs-30 fc-0" v-html="obj.content"></view>
  33. </view>
  34. </view>
  35. <view class="bottom-box box-border-box p-24" >
  36. <view class="flex-justify-space">
  37. <view class="align-items-flex-end box-1">
  38. <span class="fs-28 fc-f fw-600">¥</span>
  39. <span class="fs-44 fc-f fw-600">{{obj.price||''}}</span>
  40. </view>
  41. <view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">立即抢购</view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {ticketInfo} from '@/api/ticket.js';
  48. import tools from "@/service/tools";
  49. export default {
  50. data(){
  51. return{
  52. BanenerCurrent:1,
  53. id:"",
  54. obj:{
  55. image:[],
  56. },
  57. }
  58. },
  59. onLoad(e) {
  60. if(e.id){
  61. this.id = e.id;
  62. this.getInfo();
  63. }
  64. },
  65. methods:{
  66. getInfo(){
  67. ticketInfo({id:this.id}).then((res)=>{
  68. if(res.code === 1){
  69. this.obj = res.data;
  70. }
  71. })
  72. },
  73. lookImg(list,i){
  74. tools.lookBigImg(i,list);
  75. },
  76. toBack(){
  77. tools.leftClick()
  78. },
  79. onSwiperChange(e){
  80. this.BanenerCurrent = e.detail.current;
  81. },
  82. toSave(){
  83. if(!this.isTimeEnd){
  84. let goodsData = {
  85. title:this.obj.title,
  86. cover_img:this.obj.cover_img,
  87. price:this.obj.price,
  88. id:this.obj.id,
  89. }
  90. uni.navigateTo({
  91. url:'/pages-buy/save-ticket?goodsData=' + encodeURIComponent(JSON.stringify(goodsData))
  92. })
  93. }
  94. },
  95. },
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .ticket-det-box{
  100. position: relative;
  101. .nav-box{
  102. position: absolute;
  103. .yuan-bg{
  104. width: 60rpx;
  105. height: 60rpx;
  106. background-color: #B3B3B4;
  107. border-radius: 50%;
  108. text-align: center;
  109. line-height: 62rpx;
  110. }
  111. }
  112. .bottom-box{
  113. .box-1{
  114. flex: 1;
  115. height: 100rpx;
  116. background: #333333;
  117. border-radius: 200rpx 0rpx 0rpx 200rpx;
  118. box-sizing: border-box;
  119. padding-left: 32rpx;
  120. padding-bottom: 20rpx;
  121. }
  122. .box-2{
  123. width: 200rpx;
  124. height: 100rpx;
  125. line-height: 100rpx;
  126. background: #41ABF5;
  127. border-radius: 0rpx 200rpx 200rpx 0rpx;
  128. text-align: center;
  129. }
  130. }
  131. .swiper{
  132. width: 100%;
  133. height: 750rpx;
  134. position: relative;
  135. .swiper-item{
  136. width: 100%;
  137. height: 750rpx;
  138. }
  139. .swiper-num{
  140. position: absolute;
  141. right: 24rpx;
  142. bottom: 24rpx;
  143. width: 120rpx;
  144. height: 48rpx;
  145. background: rgba(51,51,51,0.6);
  146. border-radius: 200rpx;
  147. text-align: center;
  148. line-height: 48rpx;
  149. }
  150. }
  151. .box-card{
  152. width: 100%;
  153. min-height: 100rpx;
  154. background: #FFFFFF;
  155. border-radius: 20rpx;
  156. }
  157. .pwxq{
  158. width: 146rpx;
  159. height: 46rpx;
  160. margin: 38rpx auto 24rpx auto;
  161. }
  162. }
  163. </style>