ticket-det.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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" @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 richText plr-24">
  32. <!-- <view class="box-card box-border-box p-24 fs-30 fc-0" v-html="obj.content"></view> -->
  33. <rich-text :nodes="obj.content"></rich-text>
  34. </view>
  35. </view>
  36. <view class="bottom-box box-border-box p-24">
  37. <view class="flex-justify-space">
  38. <view class="align-items-flex-end box-1">
  39. <span class="fs-28 fc-f fw-600">¥</span>
  40. <span class="fs-44 fc-f fw-600">{{obj.price||''}}</span>
  41. </view>
  42. <view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">立即抢购</view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. ticketInfo
  50. } from '@/api/ticket.js';
  51. import tools from "@/service/tools";
  52. export default {
  53. data() {
  54. return {
  55. BanenerCurrent: 1,
  56. id: "",
  57. obj: {
  58. image: [],
  59. },
  60. }
  61. },
  62. onLoad(e) {
  63. if (e.id) {
  64. this.id = e.id;
  65. this.getInfo();
  66. }
  67. },
  68. methods: {
  69. getInfo() {
  70. ticketInfo({
  71. id: this.id
  72. }).then((res) => {
  73. if (res.code === 1) {
  74. this.obj = res.data;
  75. let zfc = res.data.content
  76. let a = zfc.replace(/font color="#c24f4a"/g, "p style='color:#c24f4a'")
  77. this.obj.content = a.replace(/\font/g, "\p")
  78. }
  79. })
  80. },
  81. lookImg(list, i) {
  82. tools.lookBigImg(i, list);
  83. },
  84. toBack() {
  85. tools.leftClick()
  86. },
  87. onSwiperChange(e) {
  88. this.BanenerCurrent = (e.detail.current + 1);
  89. },
  90. toSave() {
  91. if (!this.isTimeEnd) {
  92. let goodsData = {
  93. title: this.obj.title,
  94. cover_img: this.obj.cover_img,
  95. price: this.obj.price,
  96. id: this.obj.id,
  97. }
  98. uni.navigateTo({
  99. url: '/pages-buy/save-ticket?goodsData=' + encodeURIComponent(JSON.stringify(goodsData))
  100. })
  101. }
  102. },
  103. },
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. ::deep .richText p {
  108. color: red;
  109. }
  110. .ticket-det-box {
  111. position: relative;
  112. .nav-box {
  113. position: absolute;
  114. .yuan-bg {
  115. width: 60rpx;
  116. height: 60rpx;
  117. background-color: #B3B3B4;
  118. border-radius: 50%;
  119. text-align: center;
  120. line-height: 62rpx;
  121. }
  122. }
  123. .bottom-box {
  124. .box-1 {
  125. flex: 1;
  126. height: 100rpx;
  127. background: #333333;
  128. border-radius: 200rpx 0rpx 0rpx 200rpx;
  129. box-sizing: border-box;
  130. padding-left: 32rpx;
  131. padding-bottom: 20rpx;
  132. }
  133. .box-2 {
  134. width: 200rpx;
  135. height: 100rpx;
  136. line-height: 100rpx;
  137. background: #41ABF5;
  138. border-radius: 0rpx 200rpx 200rpx 0rpx;
  139. text-align: center;
  140. }
  141. }
  142. .swiper {
  143. width: 100%;
  144. height: 750rpx;
  145. position: relative;
  146. .swiper-item {
  147. width: 100%;
  148. height: 750rpx;
  149. }
  150. .swiper-num {
  151. position: absolute;
  152. right: 24rpx;
  153. bottom: 24rpx;
  154. width: 120rpx;
  155. height: 48rpx;
  156. background: rgba(51, 51, 51, 0.6);
  157. border-radius: 200rpx;
  158. text-align: center;
  159. line-height: 48rpx;
  160. }
  161. }
  162. .box-card {
  163. width: 100%;
  164. min-height: 100rpx;
  165. background: #FFFFFF;
  166. border-radius: 20rpx;
  167. }
  168. .pwxq {
  169. width: 146rpx;
  170. height: 46rpx;
  171. margin: 38rpx auto 24rpx auto;
  172. }
  173. }
  174. </style>