123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <view class="container">
- <uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="info" :current="current" :mode="mode"
- :dots-styles="dotsStyles" field="content">
- <swiper class="swiper-box" @change="change" :current="swiperDotIndex">
- <swiper-item>
- <image class="swiperItem" src="https://mall.rongtongh.cn/storage/img/raffle/2.jpg" mode="aspectFill">
- </swiper-item>
- <swiper-item>
- <image class="swiperItem" src="https://mall.rongtongh.cn/storage/img/raffle/3.jpg" mode="aspectFill">
- </swiper-item>
- <swiper-item>
- <image class="swiperItem" src="https://mall.rongtongh.cn/storage/img/raffle/1.jpg" mode="aspectFill">
- </swiper-item>
- </swiper>
- </uni-swiper-dot>
- <view class="tabs">
- <view class="tab" @click="clickTab(1)">
- <image class="tabImg" :src="tabImg(1)" mode="widthFix"></image>
- </view>
- <view class="tab" @click="clickTab(2)">
- <image class="tabImg" :src="tabImg(2)" mode="widthFix"></image>
- </view>
- <view class="tab" @click="clickTab(3)">
- <image class="tabImg" :src="tabImg(3)" mode="widthFix"></image>
- </view>
- <view class="tab" @click="clickTab(4)">
- <image class="tabImg" :src="tabImg(4)" mode="widthFix"></image>
- </view>
- </view>
- <view class="list" v-if="tabActive == 1">
-
- </view>
- <view class="list2" v-if="tabActive != 1">
- <view class="ka" v-for="(item, index) in list" @click="$navigateTo('/pages/drawCard_last/drawCard_last', {id: item.id})">
- <view class="top">
- <image mode="aspectFit" :src="item.prizeIconList[0]"></image>
- </view>
- <view class="ka-info">
- <view class="ka-name">
- {{item.name}}
- </view>
- <view class="row">
- <uni-tag text="创意热销" inverted type="default"></uni-tag>
- <view class="money">
- ¥{{item.price}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- raffleListApi
- } from "@/api/drawCard.js"
-
- export default {
- data() {
- return {
- tabActive: 1,
- list: [],
- info: [{
- content: '内容 A'
- }, {
- content: '内容 B'
- }, {
- content: '内容 C'
- }],
- dotsStyles: {},
- current: 0,
- mode: 'dot',
- swiperDotIndex: 0
- }
- },
- onShow() {
- this.getList()
- },
- methods: {
- getList () {
- let params = {
- limit: 999,
- page: 1,
- type: this.tabActive
- }
- raffleListApi(params).then(res => {
- console.log(res, 'res')
- this.list = res.data.list
- })
- },
- tabImg(index) {
- let url = 'https://mall.rongtongh.cn/storage/img/raffle/tab'
- + index
- + (this.tabActive == index ? 'a' : '' )
- + '.png'
- return url
- },
- clickTab(index) {
- this.tabActive = index
- this.getList()
- },
- clickItem() {
- },
- change() {
-
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .swiperItem {
- width: 100%;
- height: 100%;
- }
- .tabs {
- margin: 10px 0;
- height: 36px;
- display: flex;
- justify-content: space-around;
- align-items: center;
-
- .tab {
- .tabImg {
- width: 18vw;
- height: 100%;
- }
- }
- }
- .list2 {
- display: grid;
- grid-template-columns: 1fr 1fr;
- grid-gap: 10px;
- padding: 10px;
-
- .ka {
- width: calc(50vw - 15px);
- box-shadow: 0px 2px 8px 2px rgba(0,0,0,0.1);
- border-radius: 10px;
- // height: 60vw;
-
- .top {
- // height: 60vw;
- background: linear-gradient(180deg, #FAF1A7 0%, #FFE456 100%);
- text-align: center;
- display: flex;
- justify-content: center;
-
- image {
- width: 35vw;
- height: 50vw;
- }
- }
- .ka-info {
- padding: 10px;
- .ka-name {
- font-size: 15px;
- font-weight: 600;
- }
- .row {
- margin-top: 5px;
- display: flex;
- justify-content: space-between;
-
- .money {
- font-size: 16px;
- font-weight: 600;
- color: #FF2C43;
- }
- }
- }
- }
- }
- </style>
|