123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <template>
- <view class="center">
- <view class="top">
- <view class="vheigh"></view>
- <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image>
- <view class="top-main flex">
- <view class="search-box flex" @click="clickSearch()">
- <image class="search" src="../../static/img/search.png" mode=""></image>
- <view class="search-font">输入关键词搜索</view>
- </view>
- </view>
- </view>
- <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
- <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
- @click="bannerNavToUrl(item)">
- <image :src="item.pic" mode="scaleToFill" @error="imgerror($event,item)" />
- </swiper-item>
- </swiper>
- <view class="tongz flex">
- <view>
- <view class="tongz-bg">
- <image src="../../static/img/tongz-bg.png" mode=""></image>
- </view>
- <view class="tongz-left flex">
- <image class="image-left" src="../../static/img/ling.png" mode=""></image>
- <u-notice-bar style="width: 100%;" mode="vertical" type="none" :volume-icon="false"
- :more-icon="true" :list="text" @click="goDetails"
- @getMore="nav('/pages/index/message?type=6')"></u-notice-bar>
- </view>
- </view>
- </view>
-
- <view class="navbar">
- <view class="nav-item" @click="nav('/pages/index/index')">
- <image class="nav-img" src="../../static/img/newbanner.png" mode=""></image>
- </view>
- <view v-if="isShowIllegality" class="nav-item" @click="nav('/pages/navigation/main')">
- <image class="nav-img" src="../../static/img/oldbanner.png" mode=""></image>
- </view>
- </view>
- <view class="box margin-t-30 flex" v-if="isShowIllegality">
- <view class="leftbox flex">
- <view class="flex-center">
- <view class="title">
- {{ticketBase.fullname}}
- </view>
- </view>
- <view class="num flex">
- <image class="tip" src="../../static/img/wpicon.png" mode="scaleToFill"></image>
- <text class="chines margin-l-10">
- 价格(CNY):
- </text>
- <text class="onStrong margin-r-10">
- {{ticketBase.CurPrice}}
- </text>
- <image class="tip tipr" src="../../static/img/wpicon.png" mode="scaleToFill"></image>
- </view>
- </view>
- <view class="right flex-center">
- <view class="righttext flex-center">
- <view class="rightNumBox">
- <text class="font-size-sm" v-if="ticketBase.CurrentGains>0">+</text>
- <text class="font-size-sm" v-if="ticketBase.CurrentGains<0">-</text>
- {{ticketBase.CurrentGains}}
- <text class="font-size-sm">%</text>
- </view>
- </view>
- <view class="text">
- 近24小时涨跌幅
- </view>
- </view>
- </view>
- <!-- #ifdef H5 -->
- <view class="btm">
- <a href="https://beian.miit.gov.cn" class="a-pm">备案编号:浙ICP备2022017146号 </a>
- </view>
- <!-- #endif -->
- </view>
- </template>
- <script>
- import {
- loadIndexs,
- store_list
- } from '@/api/index.js';
- import {
- getTicket
- } from '@/api/quick.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- article
- } from '@/api/user.js';
- export default {
- data() {
- return {
- current: 0,
- titleNViewBackground: '',
- swiperCurrent: 0,
- swiperLength: 0,
- carouselList: [], //轮播图列表
- text: [],
- ticketBase: {},
- article: [],
- };
- },
- onShow() {
- },
- onLoad() {
- this.loadData();
- // this.getTicket();
- },
- computed: {
- ...mapState(["isShowIllegality"])
- },
- methods: {
- ...mapMutations(['setLat', 'setLon', 'setChoose','changeState']),
- imgerror(data,item){
- setTimeout(()=>{
- item.pic = item.pic+`?time=${(new Date).getTime()}`
- },1000)
- },
- goDetails(e) {
- uni.navigateTo({
- url: '/pages/index/messageInfo?id=' + this.article[e].id
- });
- },
- getTicket() {
- getTicket()
- .then(
- (res) => {
- console.log(res);
- this.ticketBase = res.data.v||{};
- this.ticketBase.CurrentGains = +this.ticketBase.CurrentGains
- }
- ).catch(
- (err) => {
- console.log(err);
- }
- )
- },
- loadData() {
- article({}, 6).then(({
- data
- }) => {
- this.text = data.map((re) => {
- return re.synopsis
- })
- this.article = data;
- });
- loadIndexs({})
- .then(({
- data
- }) => {
- let goods = data.info;
- this.dataList = goods.bastList; //精品推荐
- this.carouselList = data.banner;
- })
- .catch(e => {});
- },
- nav(url) {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- });
- }
- });
- },
- //轮播图切换修改背景色
- swiperChange(e) {
- const index = e.detail.current;
- this.swiperCurrent = index;
- this.titleNViewBackground = this.carouselList[index].background;
- },
- // 點擊搜索框
- clickSearch() {
- uni.navigateTo({
- url: '/pages/product/search'
- });
- },
- }
- };
- </script>
- <style lang="scss">
- .box {
- border-radius: 10rpx;
- line-height: 1;
- margin: 0 30rpx;
- background-image: url("../../static/img/indwxWp.png");
- background-size: 100% auto;
- background-repeat: no-repeat;
- position: relative;
- height: 230rpx;
- align-items: stretch;
- .leftbox {
- flex-grow: 1;
- padding: 20rpx 0;
- flex-direction: column;
- .title {
- padding: 6rpx 20rpx;
- border-radius: 50rpx;
- font-size: $font-sm;
- color: #FFF;
- border: 1px solid #FFF;
- }
- .num {
- font-size: $font-lg;
- text-align: center;
- color: $color-red;
- height: 80rpx;
- .onStrong {
- font-size: 36rpx;
- }
- .chines {
- color: #FFF;
- }
- .tip {
- width: 80rpx;
- height: 6rpx;
- &.tipr {
- transform: rotate(180deg);
- }
- }
- }
- }
- .right {
- flex-shrink: 0;
- width: 200rpx;
- flex-direction: column;
- color: #FFF;
- .righttext {
- width: 130rpx;
- height: 130rpx;
- border-radius: 1000rpx;
- border: 1px solid #FFF;
- .rightNumBox {
- font-size: 40rpx;
- }
- }
- .text {
- margin-top: 20rpx;
- font-size: $font-sm;
- text-shadow: 2px 2px 1px red;
- }
- }
- }
- page,
- .center {
- min-height: 100%;
- height: auto;
- background: #ffffff;
- }
- .vheigh {
- height: var(--status-bar-height);
- background-color: $base-color;
- }
- .top {
- position: relative;
- width: 100%;
- height: 360rpx;
- .top-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- .top-main {
- position: relative;
- z-index: 2;
- padding: 30rpx;
- .search-box {
- justify-content: center;
- width: 698rpx;
- height: 60rpx;
- background: rgba(255, 240, 245, 0.4);
- box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
- border-radius: 30rpx;
- .search {
- width: 34rpx;
- height: 34rpx;
- }
- .search-font {
- margin-left: 14rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- }
- }
- }
- .carousel {
- width: 700rpx;
- height: 276rpx;
- /* #ifndef APP-PLUS */
- margin: -240rpx auto 0;
- /* #endif */
- /* #ifdef APP-PLUS */
- margin: -180rpx auto 0;
- /* #endif */
- border-radius: 40rpx;
- image {
- border-radius: 40rpx;
- width: 700rpx;
- height: 276rpx;
- }
- }
- .tongz {
- width: 690rpx;
- height: 70rpx;
- margin: 32rpx auto 0;
- padding: 18rpx 30rpx 18rpx 24rpx;
- align-items: center;
- position: relative;
- .tongz-bg {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- width: 690rpx;
- height: 70rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .tongz-left {
- width: 640rpx;
- .image-left {
- width: 28rpx;
- height: 34rpx;
- }
- .tongz-font {
- margin-left: 22rpx;
- font-size: 28rpx;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #0f253a;
- }
- }
- .tongz-right {
- position: relative;
- z-index: 11;
- width: 12rpx;
- height: 26rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .nav-item {
- width: 698rpx;
- height: 219rpx;
- background: linear-gradient(150deg, #F5BE41 0%, #DF4226 100%);
- border-radius: 14rpx;
- margin: 40rpx auto 0;
- .nav-img {
- width: 100%;
- height: 100%;
- border-radius: 14rpx;
- }
- }
- .btm {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- .a-pm {
- text-decoration: none;
- width: 100%;
- height: 50rpx;
- line-height: 50rpx;
- color: navigator;
- }
- }
- </style>
|