group-det.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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 3" :key="i">
  17. <image class="swiper-item" src="@/static/img/my/lqzx-bg.png" mode="scaleToFill"></image>
  18. <view class="swiper-num fc-f">{{BanenerCurrent + 1}}/3</view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="box-border-box p-24 card-f">
  22. <view class="card-top">
  23. <image src="@/static/img/buy/tg-det-bg.png" mode="scaleToFill"></image>
  24. <view class="card-money">
  25. <view class="">
  26. <span class="fs-28 fc-f fw-600">¥</span><span class="fs-48 fc-f fw-600">90.8</span>
  27. </view>
  28. <view class="fs-24 fw-400 fc-f text-line-through">原价100.0</view>
  29. </view>
  30. <view class="info-1-time">
  31. <view class="time-title">倒计时</view>
  32. <view class="time-day" v-if="showTime">{{time.day}}<text>天</text></view>
  33. <view class="time-hms" v-else>
  34. <view class="time-H">{{time.h}}</view>
  35. <view class="time-dian">:</view>
  36. <view class="time-M">{{time.m}}</view>
  37. <view class="time-dian">:</view>
  38. <view class="time-S">{{time.s}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="card-bottom box-border-box p-24">
  43. <view class="fs-36 fc-3 fw-600 text-overflow-ellipsis mb-32">巧妙借助猪猪一身雪白的特点巧妙借助猪猪一身雪白的特点巧妙借助猪猪一身雪白的</view>
  44. <view class="jd-f mb-12">
  45. <view class="jd-1"></view>
  46. <view class="jd-2" :style="{width:setWidth(182,92)+'rpx'}"></view>
  47. </view>
  48. <view class="flex-justify-space align-items-center">
  49. <view class="">
  50. <span class="fs-24 fc-9">已团</span>
  51. <span class="fs-24 fc-3">90</span>
  52. </view>
  53. <view class="">
  54. <span class="fs-24 fc-9">剩余</span>
  55. <span class="fs-24 fc-3">90</span>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <image class="pwxq" src="@/static/img/buy/tgxq.png" mode="scaleToFill"></image>
  61. <view class="box-border-box plr-24">
  62. <view class="box-card box-border-box p-24 fs-30 fc-0">
  63. 套餐内日描述套餐内日描述套餐内日描述套餐 内日描述套餐内日描述套餐内日描述套餐内日描述套餐内日描述
  64. <image src="../static/img/my/bg.png" mode=""></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="bottom-box box-border-box p-24">
  69. <view class="flex-justify-space">
  70. <view class="align-items-flex-end box-1">
  71. <span class="fs-28 fc-FB3D03 fw-600">¥</span>
  72. <span class="fs-44 fc-FB3D03 fw-600">19.5</span>
  73. </view>
  74. <view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">{{bText}}</view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import tools from "@/service/tools";
  81. export default {
  82. data(){
  83. return{
  84. BanenerCurrent:1,
  85. showTime:false,
  86. isTimeEnd:false,
  87. bText:'立即抢购',
  88. time:{
  89. day:'',
  90. h:"",
  91. m:'',
  92. s:'',
  93. },
  94. }
  95. },
  96. onShow() {
  97. this.setCountDown('2024-6-21 12:45:00');
  98. },
  99. methods:{
  100. toBack(){
  101. tools.leftClick()
  102. },
  103. onSwiperChange(e){
  104. this.BanenerCurrent = e.detail.current;
  105. },
  106. setWidth(total,num){
  107. let w = 0
  108. let tH = 654;
  109. w = (tH/total * num).toFixed(0)
  110. return w
  111. },
  112. setCountDown(sTime){
  113. let end = new Date(sTime.replace(/-/g, "/")).getTime();
  114. let now = new Date().getTime();
  115. let msec = end - now;
  116. this.time.day = parseInt(msec / 1000 / 60 / 60 / 24);
  117. let h = parseInt(msec / 1000 / 60 / 60 % 24);
  118. let m = parseInt(msec / 1000 / 60 % 60);
  119. let s = parseInt(msec / 1000 % 60);
  120. this.time.h = h > 9 ? h : '0' + h;
  121. this.time.m = m > 9 ? m : '0' + m;
  122. this.time.s = s > 9 ? s : '0' + s;
  123. msec -= 1000;
  124. if(this.time.day >= 1){
  125. this.showTime = true;
  126. }else{
  127. this.showTime = false;
  128. };
  129. if(msec>=0){
  130. setTimeout(()=>{
  131. this.setCountDown(sTime);
  132. }, 1000);
  133. }else{
  134. this.isTimeEnd = true;
  135. this.bText = '活动结束';
  136. this.time.h = '--';
  137. this.time.m = '--';
  138. this.time.s = '--';
  139. };
  140. },
  141. toSave(){
  142. if(!this.isTimeEnd){
  143. uni.navigateTo({
  144. url:'/pages-buy/save-order'
  145. })
  146. }
  147. },
  148. },
  149. }
  150. </script>
  151. <style scoped lang="scss">
  152. .ticket-det-box{
  153. position: relative;
  154. .nav-box{
  155. position: absolute;
  156. .yuan-bg{
  157. width: 60rpx;
  158. height: 60rpx;
  159. background-color: #B3B3B4;
  160. border-radius: 50%;
  161. text-align: center;
  162. line-height: 62rpx;
  163. }
  164. }
  165. .bottom-box{
  166. .box-1{
  167. flex: 1;
  168. height: 100rpx;
  169. background: #FDE9E8;
  170. border-radius: 200rpx 0rpx 0rpx 200rpx;
  171. box-sizing: border-box;
  172. padding-left: 32rpx;
  173. padding-bottom: 20rpx;
  174. }
  175. .box-2{
  176. width: 200rpx;
  177. height: 100rpx;
  178. line-height: 100rpx;
  179. background: #FD2E42;
  180. border-radius: 0rpx 200rpx 200rpx 0rpx;
  181. text-align: center;
  182. }
  183. }
  184. .swiper{
  185. width: 100%;
  186. height: 750rpx;
  187. position: relative;
  188. .swiper-item{
  189. width: 100%;
  190. height: 750rpx;
  191. }
  192. .swiper-num{
  193. position: absolute;
  194. right: 24rpx;
  195. bottom: 24rpx;
  196. width: 120rpx;
  197. height: 48rpx;
  198. background: rgba(51,51,51,0.6);
  199. border-radius: 200rpx;
  200. text-align: center;
  201. line-height: 48rpx;
  202. }
  203. }
  204. .box-card{
  205. width: 100%;
  206. min-height: 100rpx;
  207. background: #FFFFFF;
  208. border-radius: 20rpx;
  209. }
  210. .pwxq{
  211. width: 146rpx;
  212. height: 46rpx;
  213. margin: 38rpx auto 24rpx auto;
  214. }
  215. .card-f{
  216. width: 100%;
  217. position: relative;
  218. height: 386rpx;
  219. .card-top{
  220. width: 100%;
  221. height: 148rpx;
  222. position: relative;
  223. image{
  224. position: absolute;
  225. top: 0;
  226. left: 0;
  227. width: 100%;
  228. height: 148rpx;
  229. z-index: 1;
  230. }
  231. .card-money{
  232. position: absolute;
  233. top: 10rpx;
  234. left: 20rpx;
  235. z-index: 10;
  236. }
  237. }
  238. .card-bottom{
  239. width: 702rpx;
  240. height: 234rpx;
  241. border-radius: 20rpx;
  242. background-color: #fff;
  243. position: absolute;
  244. bottom: 0;
  245. left: 24rpx;
  246. z-index: 2;
  247. }
  248. }
  249. .jd-f{
  250. position: relative;
  251. width: 654rpx;
  252. height: 18rpx;
  253. .jd-1{
  254. position: absolute;
  255. top: 0;
  256. left: 0;
  257. width: 654rpx;
  258. height: 18rpx;
  259. background: #FEE0E0;
  260. border-radius: 200rpx 200rpx 200rpx 200rpx;
  261. z-index: 10;
  262. }
  263. .jd-2{
  264. position: absolute;
  265. top: 0;
  266. left: 0;
  267. height: 18rpx;
  268. // background: linear-gradient( 90deg, #3FF9F9 0%, #E0FEA4 100%);
  269. background-color: #FF2652;
  270. border-radius: 200rpx 200rpx 200rpx 200rpx;
  271. z-index: 12;
  272. }
  273. }
  274. .info-1-time{
  275. position: absolute;
  276. top: 40rpx;
  277. right: 24rpx;
  278. z-index: 20;
  279. display: flex;
  280. .time-title{
  281. font-size: 26rpx;
  282. font-weight: 400;
  283. color: rgba(255,255,255,0.8);
  284. margin-right: 20rpx;
  285. margin-top: 30rpx;
  286. }
  287. .time-day{
  288. font-size: 40rpx;
  289. color: #fff;
  290. margin-top: 16rpx;
  291. text{
  292. margin-left: 6rpx;
  293. font-size: 24rpx;
  294. font-weight: 400;
  295. color: rgba(255,255,255,0.8);
  296. }
  297. }
  298. .time-hms{
  299. margin-top: 30rpx;
  300. display: flex;
  301. }
  302. .time-dian{
  303. color: #fff;
  304. margin: 0 8rpx;
  305. }
  306. .time-H,.time-M,.time-S{
  307. width: 34rpx;
  308. height: 34rpx;
  309. background-color: #fff;
  310. border-radius: 4rpx;
  311. text-align: center;
  312. line-height: 34rpx;
  313. color: #FF2C35;
  314. }
  315. }
  316. }
  317. </style>