|
@@ -1,17 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
|
|
<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
|
|
- <scroll-view class="scrollView" scroll-with-animation :scroll-into-view="topItem" scroll-y="true"
|
|
|
|
- @scroll="handleScroll">
|
|
|
|
|
|
+ <scroll-view class="scrollView" scroll-with-animation :scroll-into-view="topItem" scroll-y="true" @scroll="handleScroll">
|
|
<view class="main" id="top">
|
|
<view class="main" id="top">
|
|
<view class="zero one">
|
|
<view class="zero one">
|
|
- <input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
|
|
|
|
- placeholder-class="placss">
|
|
|
|
|
|
+ <input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
|
|
</view>
|
|
</view>
|
|
<view class="zero two">
|
|
<view class="zero two">
|
|
- <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
|
|
|
|
- indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
|
|
|
|
+ <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
|
|
<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
|
|
- <image class="image" :src="item.url" mode=""></image>
|
|
|
|
|
|
+ <image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode=""></image>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
@@ -37,8 +34,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zero five">
|
|
<view class="zero five">
|
|
- <view class="list" v-for="(item,index) in marketList" :key="index"
|
|
|
|
- @tap="toCommon('pagesHome/market/detail')">
|
|
|
|
|
|
+ <view class="list" v-for="(item,index) in marketList" :key="index" @tap="toCommon('pagesHome/market/detail')">
|
|
<image class="image" :src="item.url" mode=""></image>
|
|
<image class="image" :src="item.url" mode=""></image>
|
|
<view class="name">
|
|
<view class="name">
|
|
{{item.name}}
|
|
{{item.name}}
|
|
@@ -70,18 +66,6 @@
|
|
useBar: true
|
|
useBar: true
|
|
},
|
|
},
|
|
bannerList: [ // 轮播图
|
|
bannerList: [ // 轮播图
|
|
- {
|
|
|
|
- url: require('@/static/test.png')
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- url: require('@/static/test.png')
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- url: require('@/static/test.png')
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- url: require('@/static/test.png')
|
|
|
|
- },
|
|
|
|
],
|
|
],
|
|
btnList: [ //功能按钮
|
|
btnList: [ //功能按钮
|
|
{
|
|
{
|
|
@@ -226,8 +210,22 @@
|
|
topItem: ''
|
|
topItem: ''
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- onShow: function() {},
|
|
|
|
|
|
+ onShow: function() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.search();
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async search() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let res;
|
|
|
|
+ // 轮播图
|
|
|
|
+ res = await that.$api(`/banner`, 'GET', {
|
|
|
|
+ is_use: '0'
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ that.$set(that, `bannerList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 公共跳转
|
|
// 公共跳转
|
|
toCommon(e) {
|
|
toCommon(e) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|