|
|
|
@ -14,10 +14,10 @@ |
|
|
|
<!-- 右侧 二级分类 --> |
|
|
|
<scroll-view class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> |
|
|
|
|
|
|
|
<view v-if="list" class="cate-right-cont"> |
|
|
|
<view v-if="list.length>0" class="cate-right-cont"> |
|
|
|
<view class="cate-two-box"> |
|
|
|
<view class="cate-cont-box"> |
|
|
|
<view class="flex-two" v-for="(item, idx) in list" :key="idx" @click="onTargetGoods(item)"> |
|
|
|
<view class="flex-two" v-for="(item, idx) in list" :key="idx" @click="onTargetGoods(item.goods_islicode)"> |
|
|
|
<view class="cate-img-padding"> |
|
|
|
<view v-if="item.goods_image" class="cate-img"> |
|
|
|
<image class="image" mode="scaleToFill" :src="item.goods_image"></image> |
|
|
|
@ -28,9 +28,22 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 空白提示 --> |
|
|
|
<view v-else class="cate-right-cont"> |
|
|
|
<view class="empty-content"> |
|
|
|
<view class="empty-icon"> |
|
|
|
<image class="image" src="/static/empty.png" mode="widthFix"></image> |
|
|
|
</view> |
|
|
|
<view class="tips">暂无数据</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<empty v-if="!list.length" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
@ -38,10 +51,9 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import MescrollCompMixin from '@/components/mescroll-uni/mixins/mescroll-comp' |
|
|
|
import { setCartTabBadge } from '@/core/app' |
|
|
|
import SettingKeyEnum from '@/common/enum/setting/Key' |
|
|
|
|
|
|
|
import { PageCategoryStyleEnum } from '@/common/enum/store/page/category' |
|
|
|
import SettingModel from '@/common/model/Setting' |
|
|
|
|
|
|
|
import * as CategoryApi from '@/api/category' |
|
|
|
import * as GoodsApi from '@/api/goods' |
|
|
|
import Empty from '@/components/empty' |
|
|
|
@ -52,13 +64,13 @@ |
|
|
|
|
|
|
|
// 左侧菜单(固定) |
|
|
|
const menus = [ |
|
|
|
{ id: 'all', name: '全部标的数据', icon: 'qpdingdan' }, |
|
|
|
{ id: 'rs', name: '文化资源数据', icon: 'daifukuan', count: 0 }, |
|
|
|
{ id: 'rd', name: '文化数字内容', icon: 'daifahuo', count: 0 }, |
|
|
|
{ id: 'all', name: '全部标的数据', type:0}, |
|
|
|
{ id: 'rs', name: '文化资源数据', type: 1 }, |
|
|
|
{ id: 'rd', name: '文化数字内容', type: 2 }, |
|
|
|
] |
|
|
|
|
|
|
|
//分页大小 |
|
|
|
let limit=24; |
|
|
|
let limit=2; |
|
|
|
|
|
|
|
// 最后一次刷新时间 |
|
|
|
let lastRefreshTime; |
|
|
|
@ -129,6 +141,8 @@ |
|
|
|
lastRefreshTime = new Date().getTime() |
|
|
|
// 获取页面数据 |
|
|
|
this.getPageData() |
|
|
|
//加载分类数据 |
|
|
|
this.getCatList() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -160,9 +174,8 @@ |
|
|
|
handleSelectNav(index) { |
|
|
|
this.curIndex = index |
|
|
|
this.scrollTop = 0 |
|
|
|
|
|
|
|
// 加载对应的数据 |
|
|
|
this.getCatList(this.curIndex) |
|
|
|
// |
|
|
|
this.getCatList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 展示所有的数据 |
|
|
|
@ -172,23 +185,34 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询分类 获取列表 |
|
|
|
getCatList(type){ |
|
|
|
this.$toast(type) |
|
|
|
getCatList(){ |
|
|
|
console.log("curindex",this.curIndex) |
|
|
|
let item = menus[this.curIndex] |
|
|
|
console.log(item) |
|
|
|
let type= item.type |
|
|
|
|
|
|
|
if(type>0){ |
|
|
|
let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit} |
|
|
|
this.bindData(rd) |
|
|
|
}else{ |
|
|
|
this.getAllGoods() |
|
|
|
} |
|
|
|
|
|
|
|
// if(type>0){ |
|
|
|
// let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit} |
|
|
|
// this.bindData(rd) |
|
|
|
// }else{ |
|
|
|
// this.getAllGoods() |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
// 标的详情 |
|
|
|
onTargetGoods(gislicode){ |
|
|
|
// this.$toast(goodsId) |
|
|
|
this.$navTo('pages/goods/detail', { gislicode }) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 绑定数据 |
|
|
|
bindData(rd){ |
|
|
|
GoodsApi.soglist(rd).then(res=>{ |
|
|
|
this.list = res.data.data |
|
|
|
this.page=res.data.current_page |
|
|
|
console.log("res",res) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -203,6 +227,7 @@ |
|
|
|
<style> |
|
|
|
page { |
|
|
|
background: #fff; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style lang="scss" scoped> |
|
|
|
@ -217,7 +242,7 @@ |
|
|
|
|
|
|
|
// |
|
|
|
.secondary{ |
|
|
|
z-index: 6; |
|
|
|
z-index: 19; |
|
|
|
border-top: 1rpx solid #444; |
|
|
|
height: 100vh; |
|
|
|
} |
|
|
|
@ -233,7 +258,7 @@ |
|
|
|
|
|
|
|
// 一级分类+二级分类 20 |
|
|
|
.cate-left { |
|
|
|
height: 100%; |
|
|
|
// height: 100%; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
flex: 0 0 26%; |
|
|
|
@ -264,6 +289,25 @@ |
|
|
|
width: 100%; |
|
|
|
padding: 0 10px; |
|
|
|
} |
|
|
|
|
|
|
|
// 空白提示 |
|
|
|
.empty-content { |
|
|
|
box-sizing: border-box; |
|
|
|
width: 100%; |
|
|
|
padding: 140rpx 50rpx; |
|
|
|
text-align: center; |
|
|
|
|
|
|
|
.tips { |
|
|
|
font-size: 28rpx; |
|
|
|
color: gray; |
|
|
|
margin: 50rpx 0; |
|
|
|
} |
|
|
|
|
|
|
|
.empty-icon .image { |
|
|
|
width: 280rpx; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|