You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.0 KiB

3 months ago
<template>
<view class="wanl-list" style="background-color: #F2F3F4;min-height: calc(100vh);">
<!-- 导航条 -->
<view class="cu-custom" :style="{height: $wanlshop.wanlsys().height + 'px' }">
<view class="cu-bar bg-bgcolor fixed" :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px'}">
<!-- 1.1.9 升级 其他页面进入 -->
<view v-if="pagesNum > 1" class="action" @tap="$wanlshop.back(1)"><text class="wlIcon-fanhui1"></text></view>
<!-- 直接进入 -->
<view v-else class="action" @tap="$wanlshop.on('/pages/index')"><text class="wlIcon-zhuye"></text></view>
<view style="margin:0 24rpx;width: 100%;">
3 months ago
<u-search placeholder="搜索商品" bgColor="#F2F3F4" v-model="keyword"
@search="searchHandle"
height="60rpx" :showAction="false"></u-search>
3 months ago
</view>
<!-- <view class="action" @tap="editListstyle()">
<text class="wlIcon-listing-jf" v-if="liststyle == 'col-2-20'"></text>
<text class="wlIcon-liebiao" v-else></text>
</view> -->
</view>
</view>
<view class="imgContent">
<image src="../../static/images/img/bg2.png" mode="aspectFill"></image>
</view>
<u-tabs :list="catagoryData" keyName="name" lineColor="#EB6100"
:activeStyle="{'font-weight': 'bold','font-size': '36rpx','color': '#222222'}"
@click="clickHandle"></u-tabs>
<!-- 主体 -->
<block v-if="goodsData.length > 0">
1 week ago
<wanl-product :dataList="goodsData"/>
3 months ago
</block>
1 week ago
<view v-else style="text-align: center;margin-top: 30rpx;">
暂无数据
</view>
3 months ago
<view class="edgeInsetBottom"></view>
</view>
</template>
<script>
export default {
data() {
return {
keyword:'',
catagoryData:[],
3 months ago
// WanlScroll: 0, //记录页面滚动
// scrollStype: false, //滚动状态
3 months ago
liststyle: 'col-2-20', //列表样式
goodsData: [], //商品列表数据
goodsType: 'goods',
};
},
async onLoad(option) {
3 months ago
3 months ago
await uni.request({
url: '/wanlshop/common/init',
success: res => {
this.catagoryData = res.data.modulesData.categoryModules;
3 months ago
if(this.catagoryData.length>0){
this.category = this.catagoryData[0].id
}
3 months ago
this.loadData();
}
});
},
// 监听返回
onUnload() {
},
methods: {
clickHandle(val){
console.log(val)
},
//异步加载商品列表
async loadData() {
3 months ago
console.log(this.category,"liudan")
uni.request({
url: '/wanlshop/product/activelists',
method: 'GET',
data: {
type:3, //今日特价
1 week ago
3 months ago
},
success: res => {
1 week ago
this.goodsData = res.data;
3 months ago
}
})
3 months ago
},
search() {
this.$wanlshop.to(`/pages/page/search?type=${this.goodsType}`,'fade-in',100);
},
1 week ago
// editListstyle() {
// this.liststyle = this.liststyle == 'col-1-10'?'col-2-20':'col-1-10';
// }
3 months ago
}
};
</script>
<style scoped lang="scss">
.cu-custom .search-form{
border: 3rpx solid #fe6600;
background-color: #fff;
}
.cu-tag:not([class*="bg"]):not([class*="line"]){
background-color: #f7f7f7;
}
.imgContent{
image{
height: 360rpx;
width: 100%;
}
}
</style>