|
|
@@ -1,52 +1,16 @@
|
|
|
<template>
|
|
|
<div class="app-main app-content">
|
|
|
- <scroll-view
|
|
|
- scroll-y
|
|
|
- scroll-with-animation
|
|
|
- class="tab-view"
|
|
|
- :scroll-top="scrollTop"
|
|
|
- :style="{height:height+'px'}"
|
|
|
- >
|
|
|
- <div
|
|
|
- v-for="(item,index) in tabbar"
|
|
|
- :key="index"
|
|
|
- class="tab-bar-item"
|
|
|
- :class="[currentTab==index ? 'active' : '']"
|
|
|
- :data-current="index"
|
|
|
- @tap.stop="swichNav($event ,item)"
|
|
|
- >
|
|
|
+ <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop" :style="{height:height+'px'}" >
|
|
|
+ <div v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']" :data-current="index" @tap.stop="swichNav($event ,item)" >
|
|
|
<text>{{item.categoryName}}</text>
|
|
|
</div>
|
|
|
</scroll-view>
|
|
|
- <block
|
|
|
- v-for="(item,index) in tabbar"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <scroll-view
|
|
|
- scroll-y
|
|
|
- class="right-box"
|
|
|
- :style="{height:height+'px'}"
|
|
|
- @scrolltolower="onReachBottoms"
|
|
|
- v-if="currentTab==index"
|
|
|
- >
|
|
|
- <!--内容部分 start -->
|
|
|
- <div
|
|
|
- class="page-view"
|
|
|
- v-if="!$util.isEmpty(list.data)"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="goods-list"
|
|
|
- v-for="(items, subIndex) in list.data"
|
|
|
- :key="items.id"
|
|
|
- @click="pageTo(`/pages/goods/detail?id=${items.id}`)"
|
|
|
- >
|
|
|
+ <block v-for="(item,index) in tabbar" :key="index" >
|
|
|
+ <scroll-view scroll-y class="right-box" :style="{height:height+'px'}" @scrolltolower="onReachBottoms" v-if="currentTab==index" >
|
|
|
+ <div class="page-view" v-if="!$util.isEmpty(list.data)" >
|
|
|
+ <div class="goods-list" v-for="(items) in list.data" :key="items.id" @click="pageTo(`/pages/goods/detail?id=${items.id}`)" >
|
|
|
<div class="img-blo">
|
|
|
- <app-img
|
|
|
- :src="items.smallImgList[0]"
|
|
|
- alt="商品图"
|
|
|
- mode="aspectFit"
|
|
|
- :height="200"
|
|
|
- />
|
|
|
+ <app-img :src="items.smallImgList[0]" alt="商品图" mode="aspectFit" :height="200" />
|
|
|
</div>
|
|
|
<div class="goods-det">
|
|
|
<div class="goods-det-top">
|
|
|
@@ -58,10 +22,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<block v-else>
|
|
|
- <app-wrapper-empty
|
|
|
- title="暂无数据"
|
|
|
- :is-empty="$util.isEmpty(list.data)"
|
|
|
- />
|
|
|
+ <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
</block>
|
|
|
<!--内容部分 end -->
|
|
|
</scroll-view>
|
|
|
@@ -69,7 +30,6 @@
|
|
|
<tab-bar :current="1"></tab-bar>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
import AppImg from '@/components/app-img'
|
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
@@ -97,63 +57,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onShow () {
|
|
|
- uni.hideTabBar();
|
|
|
- },
|
|
|
- ceshi () {
|
|
|
- console.log(1232)
|
|
|
+ uni.hideTabBar()
|
|
|
},
|
|
|
- // onPullDownRefresh() {
|
|
|
- // this.resetList();
|
|
|
- // this._list().then(res => {
|
|
|
- // uni.stopPullDownRefresh();
|
|
|
- // });
|
|
|
- // },
|
|
|
- // // 加载更多
|
|
|
- // onReachBottom() {
|
|
|
- // console.log(1212)
|
|
|
- // if (this.list.moreData == 1) {
|
|
|
- // this._list().then(res => {
|
|
|
- // uni.stopPullDownRefresh();
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // uni.stopPullDownRefresh();
|
|
|
- // }
|
|
|
- // },
|
|
|
onLoad: function () {
|
|
|
- if (this.$util.isLogin()) {
|
|
|
- setTimeout(() => {
|
|
|
- uni.getSystemInfo({
|
|
|
- success: res => {
|
|
|
- this.height = res.windowHeight
|
|
|
- this.sInit()
|
|
|
- }
|
|
|
- })
|
|
|
- }, 50)
|
|
|
- }
|
|
|
- let account = uni.getStorageSync('account')
|
|
|
- getShopUser().then(res => {
|
|
|
- // 设置分享
|
|
|
- let shareParams = {
|
|
|
- title: '分类', // 分享标题
|
|
|
- desc: "", // 分享内容
|
|
|
- imgUrl: '',
|
|
|
- // #ifndef H5
|
|
|
- pagePath: `/pages/home/course?fromUserId=${res.id}&account=${account}`
|
|
|
- // #endif
|
|
|
- }
|
|
|
- this.jweixinFn(shareParams)
|
|
|
- console.log('分享地址',`/pages/home/course?fromUserId=${res.id}&account=${account}`)
|
|
|
- })
|
|
|
+ uni.hideTabBar()
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
+ init(){
|
|
|
+ this.sInit()
|
|
|
+ },
|
|
|
onReachBottoms () {
|
|
|
if (!this.list.finished) {
|
|
|
this._list().then(res => {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
});
|
|
|
} else {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
}
|
|
|
},
|
|
|
async sInit () {
|
|
|
@@ -172,13 +91,9 @@ export default {
|
|
|
},
|
|
|
// 列表
|
|
|
_list () {
|
|
|
- return getList({
|
|
|
- ...this.form,
|
|
|
- page: this.list.page
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
+ return getList({ ...this.form, page: this.list.page }) .then(res => {
|
|
|
this.completes(res)
|
|
|
- })
|
|
|
+ })
|
|
|
},
|
|
|
// 点击标题切换当前页时改变样式
|
|
|
swichNav (e, item) {
|
|
|
@@ -190,7 +105,6 @@ export default {
|
|
|
this.form.categoryId = item.id
|
|
|
this.resetList()
|
|
|
this._list()
|
|
|
- // this.checkCor()
|
|
|
}
|
|
|
},
|
|
|
// 判断当前滚动超过一屏时,设置tab标题滚动条。
|
|
|
@@ -221,10 +135,6 @@ page {
|
|
|
background: #fff;
|
|
|
}
|
|
|
|
|
|
-/* 左侧导航布局 start*/
|
|
|
-
|
|
|
-/* 隐藏scroll-view滚动条*/
|
|
|
-
|
|
|
::-webkit-scrollbar {
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
@@ -266,9 +176,6 @@ page {
|
|
|
left: 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-/* 左侧导航布局 end*/
|
|
|
-
|
|
|
.right-box {
|
|
|
width: 100%;
|
|
|
position: fixed;
|
|
|
@@ -307,9 +214,4 @@ page {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// img {
|
|
|
-// width: 100%;
|
|
|
-// height: 100%;
|
|
|
-// display: inline-block;
|
|
|
-// }
|
|
|
</style>
|