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.
57 lines
1.3 KiB
57 lines
1.3 KiB
<template>
|
|
<view class="navbox">
|
|
<block v-for="(item, index) in data" :key="index">
|
|
<view class="nav_li" @tap="goto" :data-url="'/pages/shop/prolist?'+(bid>0?'bid='+bid+'&cid2':'cid')+'=' + item.id">
|
|
<image :src="item.pic"></image>
|
|
<view>{{item.name}}</view>
|
|
</view>
|
|
</block>
|
|
<loading v-if="loading"></loading>
|
|
<dp-tabbar :opt="opt"></dp-tabbar>
|
|
<popmsg ref="popmsg"></popmsg>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
var app = getApp();
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
opt:{},
|
|
loading:false,
|
|
isload: false,
|
|
menuindex:-1,
|
|
|
|
data: [],
|
|
bid:0,
|
|
};
|
|
},
|
|
|
|
onLoad: function (opt) {
|
|
this.opt = app.getopts(opt);
|
|
this.bid = this.opt.bid ? this.opt.bid : 0;
|
|
this.getdata();
|
|
},
|
|
onPullDownRefresh: function () {
|
|
this.getdata();
|
|
},
|
|
methods: {
|
|
getdata: function () {
|
|
var that = this;
|
|
that.loading = true;
|
|
app.get('ApiShop/category1', {bid:that.bid}, function (res) {
|
|
that.loading = false;
|
|
that.data = res.data;
|
|
that.loaded();
|
|
});
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
<style>
|
|
page{background-color:#fff}
|
|
.navbox{margin-top:12rpx;height: auto;overflow: hidden;padding-bottom:20rpx;}
|
|
.nav_li{width:33%;text-align: center;box-sizing: border-box;padding:30rpx 0 10rpx;float: left;}
|
|
.nav_li image{width:100rpx;height:100rpx;margin-bottom:20rpx;}
|
|
</style>
|