index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <view class="choiceness">
  3. <view class="top-box">
  4. <view class="position-box">
  5. <image class="back" src="@/static/back-btn.png" @click="back" mode=""></image>
  6. <view class="topbar">
  7. 限时秒杀
  8. </view>
  9. </view>
  10. <u-scroll-list class="swiper" :indicator="false" @scroll="left">
  11. <view class="scroll-list" style="flex-direction: row;" @scroll="left">
  12. <view class="type-item" v-for="(item, index) in typeList" :key="index" @click="handleTab(index)">
  13. <image class="type-icon" :src="item.src"></image>
  14. <view class="title-box">
  15. <view class="type-title">
  16. {{item.title}}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </u-scroll-list>
  22. <view class="detail-box">
  23. <image class="icon" :src="info.src" mode=""></image>
  24. <view class="info-box">
  25. <image class="card-tab" src="../../static/tab-title.png" mode=""></image>
  26. <image class="info-icon" :src="info.src" mode=""></image>
  27. <view class="info">
  28. <view class="title">
  29. {{info.detail.title}}
  30. </view>
  31. <view class="sub-title">
  32. {{info.detail.desc}}
  33. </view>
  34. <view class="btn-box">
  35. <view class="tab">
  36. <view class="label">
  37. </view>
  38. <view class="value">
  39. {{info.detail.cardName}}
  40. </view>
  41. </view>
  42. <view class="btn">
  43. 马上抢
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 列表 -->
  51. <zs-list class="store-box" mt="30rpx" @load="loadMore" :status="status">
  52. <view class="item" v-for="(item,index) in list" :key="index">
  53. <image class="card-tab" src="../../static/tab-title.png" mode=""></image>
  54. <image class="info-icon" :src="item.src" mode=""></image>
  55. <view class="info">
  56. <view class="title">
  57. {{item.title}}
  58. </view>
  59. <view class="sub-title">
  60. {{item.desc}}
  61. </view>
  62. <view class="btn-box">
  63. <view class="tab">
  64. <view class="label">
  65. </view>
  66. <view class="value">
  67. {{item.cardName}}
  68. </view>
  69. </view>
  70. <view class="btn">
  71. 马上抢
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </zs-list>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. active: 0,
  84. info: null,
  85. status: 'more',
  86. typeList: [{
  87. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/oLyIxdcdjuKT616019cf80a7b7ae265abcf3b05a9b10.png/1.png',
  88. title: '甘肃敦煌',
  89. detail: {
  90. title: '景区门票·鸣沙山月牙泉',
  91. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  92. cardName: '满200享7折'
  93. }
  94. },
  95. {
  96. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/gSNf2MrwFIob948da9579fe520ac36ef8fc3ae3164fe.png/1.png',
  97. title: '北京烤鸭',
  98. detail: {
  99. title: '景区门票·鸣沙山月牙泉',
  100. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  101. cardName: '满200享7折'
  102. }
  103. },
  104. {
  105. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/MFsbXSFsXbWH19aa1b7279e136e66a72212819c9e3d1.png/1.png',
  106. title: '维生素片',
  107. detail: {
  108. title: '景区门票·鸣沙山月牙泉',
  109. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  110. cardName: '满200享7折'
  111. }
  112. },
  113. {
  114. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/KsMua5e4gKl5ff07c6b0150fac72db44e877ce813381.png/1.png',
  115. title: '整理收纳',
  116. detail: {
  117. title: '景区门票·鸣沙山月牙泉',
  118. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  119. cardName: '满200享7折'
  120. }
  121. },
  122. {
  123. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/Qou1Wqc2PNzq84a88b1a352a1ffb04e2339b12d086fe.png/1.png',
  124. title: '水果',
  125. detail: {
  126. title: '景区门票·鸣沙山月牙泉',
  127. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  128. cardName: '满200享7折'
  129. }
  130. }
  131. ],
  132. list: [{
  133. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/gSNf2MrwFIob948da9579fe520ac36ef8fc3ae3164fe.png/1.png',
  134. title: '北京烤鸭',
  135. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  136. cardName: '满200享7折'
  137. },
  138. {
  139. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/MFsbXSFsXbWH19aa1b7279e136e66a72212819c9e3d1.png/1.png',
  140. title: '维生素片',
  141. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  142. cardName: '满200享7折'
  143. },
  144. {
  145. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/KsMua5e4gKl5ff07c6b0150fac72db44e877ce813381.png/1.png',
  146. title: '整理收纳',
  147. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  148. cardName: '满200享7折'
  149. },
  150. {
  151. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/Qou1Wqc2PNzq84a88b1a352a1ffb04e2339b12d086fe.png/1.png',
  152. title: '水果',
  153. desc: '鸣沙山月牙泉景区门票+往返观光车特惠套票',
  154. cardName: '满200享7折'
  155. }
  156. ]
  157. }
  158. },
  159. watch: {
  160. active: {
  161. handler: function(val) {
  162. this.info = this.typeList[val]
  163. },
  164. immediate: true
  165. },
  166. },
  167. methods: {
  168. back(){
  169. var pages = getCurrentPages();
  170. if(pages.length == 1){
  171. uni.switchTab({
  172. url:'/pages/index/index'
  173. })
  174. }else{
  175. uni.navigateBack();
  176. }
  177. },
  178. left(val) {
  179. console.log('left', val);
  180. },
  181. loadMore() {},
  182. handleTab(val) {
  183. this.active = val
  184. }
  185. },
  186. created() {
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. .choiceness {
  192. background: #F5f5f5;
  193. .top-box {
  194. background: linear-gradient(180deg, #FF4C3A 0%, rgba(255, 255, 255, 0) 70%);
  195. padding-top: 170rpx;
  196. padding-bottom: 20rpx;
  197. .position-box {
  198. position: absolute;
  199. width: 100%;
  200. top: 90rpx;
  201. left: 0;
  202. z-index: 2;
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. .back {
  207. position: absolute;
  208. top: 10rpx;
  209. left: 30rpx;
  210. color: #fff;
  211. display: flex;
  212. align-items: center;
  213. font-size: 24rpx;
  214. width: 40rpx;
  215. height: 40rpx;
  216. filter: invert(1);
  217. }
  218. .topbar {
  219. font-size: 36rpx;
  220. color: #FFFFFF;
  221. text-align: center;
  222. font-weight: bold;
  223. font-family: DOUYUFont;
  224. }
  225. }
  226. }
  227. .u-scroll-list {
  228. padding: 0 30rpx;
  229. }
  230. .scroll-list {
  231. display: flex;
  232. flex-direction: row;
  233. flex-wrap: nowrap;
  234. height: 176rpx;
  235. }
  236. .type-item {
  237. width: 140rpx;
  238. height: 176rpx;
  239. border-radius: 16rpx;
  240. position: relative;
  241. margin-left: 20rpx;
  242. display: inline-block;
  243. .type-icon {
  244. width: 140rpx;
  245. height: 176rpx;
  246. }
  247. .title-box {
  248. width: 100%;
  249. height: 36rpx;
  250. line-height: 36rpx;
  251. text-align: center;
  252. color: #FFFFFF;
  253. position: absolute;
  254. left: 0%;
  255. bottom: 0%;
  256. backdrop-filter: blur(5px);
  257. .type-title {
  258. width: 100%;
  259. position: absolute;
  260. top: 50%;
  261. left: 50%;
  262. transform: translate(-50%, -50%);
  263. font-size: 20rpx;
  264. }
  265. }
  266. }
  267. .detail-box {
  268. width: 686rpx;
  269. height: 582rpx;
  270. border-radius: 16rpx;
  271. background: #fff;
  272. padding: 20rpx;
  273. box-sizing: border-box;
  274. position: relative;
  275. left: 30rpx;
  276. top: 30rpx;
  277. &::before {
  278. position: absolute;
  279. top: -18rpx;
  280. left: calc(88rpx - 30rpx);
  281. content: '';
  282. width: 0;
  283. height: 0;
  284. border-left: 20rpx solid transparent;
  285. border-right: 20rpx solid transparent;
  286. border-bottom: 20rpx solid #fff;
  287. }
  288. .icon {
  289. width: 100%;
  290. height: 100%;
  291. border-radius: 16rpx;
  292. }
  293. .info-box {
  294. position: absolute;
  295. left: 44rpx;
  296. bottom: 44rpx;
  297. width: 596rpx;
  298. height: 222rpx;
  299. padding: 24rpx 20rpx;
  300. box-sizing: border-box;
  301. backdrop-filter: blur(10px);
  302. border-radius: 16rpx;
  303. background: rgba(255, 255, 255, .2);
  304. display: flex;
  305. align-items: center;
  306. .card-tab {
  307. width: 196rpx;
  308. height: 58rpx;
  309. position: absolute;
  310. top: -8rpx;
  311. left: 0%;
  312. }
  313. .info-icon {
  314. width: 142rpx;
  315. height: 142rpx;
  316. border-radius: 16rpx;
  317. align-self: flex-end;
  318. }
  319. .info {
  320. flex: 1;
  321. margin-left: 20rpx;
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: space-between;
  325. .title {
  326. color: #FFFFFF;
  327. font-weight: bold;
  328. font-size: 28rpx;
  329. }
  330. .sub-title {
  331. background: rgba(255, 255, 255, .5);
  332. font-size: 24rpx;
  333. color: #222222;
  334. border-radius: 16rpx;
  335. padding: 10rpx;
  336. margin-top: 8rpx;
  337. }
  338. .btn-box {
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. margin-top: 16rpx;
  343. .tab {
  344. display: flex;
  345. align-items: center;
  346. .label {
  347. width: 48rpx;
  348. height: 44rpx;
  349. line-height: 44rpx;
  350. font-size: 24rpx;
  351. text-align: center;
  352. color: #FFFFFF;
  353. background: linear-gradient(180deg, #FF4A39 0%, #FC8B45 100%);
  354. border-radius: 8rpx 0rpx 0rpx 8rpx;
  355. }
  356. .value {
  357. background: rgba(255, 255, 255, 0.5);
  358. color: #FE5B47;
  359. line-height: 44rpx;
  360. font-weight: 400;
  361. font-size: 24rpx;
  362. padding: 0 10rpx;
  363. border-radius: 0 8rpx 8rpx 0;
  364. }
  365. }
  366. .btn {
  367. width: 140rpx;
  368. height: 44rpx;
  369. line-height: 44rpx;
  370. text-align: center;
  371. background: #FF4C3A;
  372. border-radius: 30rpx;
  373. color: #fff;
  374. font-size: 28rpx;
  375. font-weight: bold;
  376. }
  377. }
  378. }
  379. }
  380. }
  381. .item {
  382. width: 690rpx;
  383. box-sizing: border-box;
  384. backdrop-filter: blur(10px);
  385. border-radius: 16rpx;
  386. background: #fff;
  387. display: flex;
  388. align-items: center;
  389. margin: 30rpx 30rpx 0;
  390. padding: 60rpx 20rpx 20rpx;
  391. .card-tab {
  392. width: 196rpx;
  393. height: 58rpx;
  394. position: absolute;
  395. top: -8rpx;
  396. left: 0%;
  397. }
  398. .info-icon {
  399. width: 220rpx;
  400. height: 220rpx;
  401. border-radius: 16rpx;
  402. align-self: flex-end;
  403. }
  404. .info {
  405. flex: 1;
  406. margin-left: 20rpx;
  407. display: flex;
  408. flex-direction: column;
  409. justify-content: space-between;
  410. .title {
  411. color: #222222;
  412. font-weight: bold;
  413. font-size: 28rpx;
  414. margin-top: -10rpx;
  415. }
  416. .sub-title {
  417. background: rgba(255, 76, 58, .1);
  418. font-size: 24rpx;
  419. color: #FF4C3A;
  420. border-radius: 16rpx;
  421. padding: 10rpx;
  422. margin-top: 10rpx;
  423. }
  424. .btn-box {
  425. display: flex;
  426. align-items: center;
  427. justify-content: space-between;
  428. margin-top: 16rpx;
  429. .tab {
  430. display: flex;
  431. align-items: center;
  432. .label {
  433. width: 48rpx;
  434. height: 44rpx;
  435. line-height: 44rpx;
  436. font-size: 24rpx;
  437. text-align: center;
  438. color: #FFFFFF;
  439. background: linear-gradient(180deg, #FF4A39 0%, #FC8B45 100%);
  440. border-radius: 8rpx 0rpx 0rpx 8rpx;
  441. }
  442. .value {
  443. background: rgba(254, 91, 71, 0.1);
  444. color: #FE5B47;
  445. line-height: 44rpx;
  446. font-weight: 400;
  447. font-size: 24rpx;
  448. padding: 0 10rpx;
  449. border-radius: 0 8rpx 8rpx 0;
  450. }
  451. }
  452. .btn {
  453. width: 140rpx;
  454. height: 44rpx;
  455. line-height: 44rpx;
  456. text-align: center;
  457. background: #FF4C3A;
  458. border-radius: 30rpx;
  459. color: #fff;
  460. font-size: 28rpx;
  461. font-weight: bold;
  462. }
  463. }
  464. }
  465. }
  466. }
  467. </style>