Browse Source

首页列表

undefined
xubinxcode 4 years ago
parent
commit
2f05accfc4
5 changed files with 57 additions and 27 deletions
  1. +54
    -24
      addons/unishop/uniapp/uni-shop/pages/index/index.vue
  2. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html
  3. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.6abbf52a.js
  4. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.1d143e4a.js
  5. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.551a9523.js

+ 54
- 24
addons/unishop/uniapp/uni-shop/pages/index/index.vue View File

@@ -30,6 +30,7 @@
<text>{{item.name}}</text>
</view>
</view>
<!-- 所有商品 -->
<view class="seckill-section">
<view class="floor-list-whitelist">
<view v-for="(item, index) in cateList" :key="index" class="floor-item" @click="navToDetailPages(item)">
@@ -41,25 +42,22 @@
</view>
</view>
</view>
<uni-load-more :status="loadingType"></uni-load-more>
<!-- 秒杀楼层 -->
<view class="seckill-section" v-if="flashSale && flashSale.product.length > 0">
<!-- <view class="s-header" @click="navTo('/pages/flash/list')"> -->
<!-- <text class="miaosha">Promotion</text> -->
<!-- <text class="tip">{{(new Date(flashSale.starttime*1000)).getHours()}}点场</text> -->
<!-- <text class="tip" v-if="flashSale.countdown">下一场倒计时</text> -->
<!-- <text class="tip" v-else>{{flashSale.title}}</text> -->
<!-- <uni-countdown ref="countd" v-if="flashSale.countdown" @timeup="timeup" :show-day="flashSale.countdown.day ? true : false" -->
<!-- :day="day" :hour="hour" :minute="minute" :second="second" color="#FFFFFF" background-color="#00B26A" border-color="#00B26A"></uni-countdown> -->
<!-- <text class="yticon icon-you"></text> -->
<!-- <text class="miaosha">Promotion</text> -->
<!-- <text class="tip">{{(new Date(flashSale.starttime*1000)).getHours()}}点场</text> -->
<!-- <text class="tip" v-if="flashSale.countdown">下一场倒计时</text> -->
<!-- <text class="tip" v-else>{{flashSale.title}}</text> -->
<!-- <uni-countdown ref="countd" v-if="flashSale.countdown" @timeup="timeup" :show-day="flashSale.countdown.day ? true : false" -->
<!-- :day="day" :hour="hour" :minute="minute" :second="second" color="#FFFFFF" background-color="#00B26A" border-color="#00B26A"></uni-countdown> -->
<!-- <text class="yticon icon-you"></text> -->
<!-- </view> -->
<view class="floor-list-whitelist">
<view v-for="item in cateList" :key="item.id">
<view class="cate-item b-b two" :class="{active: item.id==fId}" @click="changeFirst(item.id)">{{item.name}}</view>
<view
v-for="tItem in item.child" :key="tItem.id"
class="cate-item b-b"
:class="{active: tItem.id==sId}"
@click="changeSecond(tItem)">
<view class="cate-item b-b two" @click="changeFirst(item.id)">{{item.name}}</view>
<view v-for="tItem in item.child" :key="tItem.id" class="cate-item b-b" :class="{active: tItem.id==sId}" @click="changeSecond(tItem)">
{{tItem.name}}
</view>
</view>
@@ -234,6 +232,7 @@
},
data() {
return {
loadingType: '',
titleNViewBackground: '',
swiperCurrent: 0,
swiperLength: 0,
@@ -261,16 +260,17 @@
// this.loadData();
},
onReachBottom() {
this.getProduct();
this.loadCateList();
// this.getProduct();
},
onPullDownRefresh() {
if (this.$refs && this.$refs.countd) {
this.$refs.countd.syncFlag = false;
}
this.goodsList = [];
this.page = 1;
this.loadCateList();
this.loadData();
// this.goodsList = [];
// this.page = 1;
this.loadCateList('refresh');
// this.loadData();
},
onShareAppMessage(e) {

@@ -301,11 +301,11 @@
// }
// });

uni.stopPullDownRefresh();
// uni.stopPullDownRefresh();

this.getFlash();
// this.getFlash();

this.getProduct();
// this.getProduct();
}

},
@@ -329,10 +329,39 @@
}
}
},
async loadCateList(fid, sid){
async loadCateList(type) {
if (type === 'refresh') {
this.cateList = [];
this.page = 1;
}
const that = this;
//let list = await this.$api.json('cateList');
this.cateList = await this.$api.request('/product/lists', 'GET', {fid:"",sid:0,page:this.page,by:'weigh',desc:'desc'});
let cateList = await this.$api.request('/product/lists', 'GET', {
fid: "",
sid: 0,
page: this.page,
by: 'weigh',
desc: 'desc'
});
// uni.stopPullDownRefresh();
if (!cateList) {
this.loadingType = 'nomore';
return;
}
this.cateList = this.cateList.concat(cateList);

//判断是否还有下一页,有是more 没有是nomore
this.loadingType = cateList.length > 20 ? 'nomore' : 'more';
if (cateList.length < 20) {
this.loadingType = 'nomore';
} else {
this.loadingType = 'more';
this.page++;
}

if (type === 'refresh') {
uni.stopPullDownRefresh();
}
},
// 获取限时秒杀数据
async getFlash() {
@@ -354,7 +383,7 @@
this.titleNViewBackground = this.carouselList[index].background;
},
//详情
navToDetailPages(item){
navToDetailPages(item) {
uni.navigateTo({
url: `/pages/product/product?id=${item.product_id}`
});
@@ -500,6 +529,7 @@
width: 100%;
height: 50vw;
max-height: 400px;

.carousel-item {
width: 100%;
height: 100%;


+ 1
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html View File

@@ -1,3 +1,3 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>宜家自购商城</title><script>document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.445a3e90.js></script><script src=/h5/static/js/index.c3cfa27e.js></script></body></html>
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.445a3e90.js></script><script src=/h5/static/js/index.6abbf52a.js></script></body></html>

addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.6abbf52a.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.1d143e4a.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-index-index.551a9523.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save