H5-ThreeDoorder/components/b-Store/b-Store.vue

70 lines
1.2 KiB
Vue

<template>
<view class="b-Store">
<template v-for="(item,index) in storeList">
<view class="b-Store-Item" :key="index" @tap="Pagego(index,item)">
<image class="img" :src="item['img_url']"></image>
</view>
</template>
</view>
</template>
<script>
import {
GetBrandListAPI
} from '@/common/api/restaurant.js';
import { mapMutations } from 'vuex'
export default {
name: "b-Store",
data() {
return {
storeList: [],
};
},
mounted() {
this.GetList()
},
methods: {
...mapMutations({
SETBRANDINFOR:'shopping/SETBRANDINFOR'
}),
Pagego(index,item) {
if(!item['url'] || !item['brand_status']) return;
// 存入品牌信息
// this.SETBRANDINFOR(item)
uni.navigateTo({
url: `/pages${item['url']}`
})
},
/**
* @获取品牌列表
* */
GetList() {
GetBrandListAPI().then(data => {
this['storeList'] = data;
})
}
}
}
</script>
<style lang="scss">
.b-Store {
padding: 32rpx;
box-sizing: border-box;
.b-Store-Item {
width: 100%;
height: 232rpx;
border-radius: 15rpx;
color: #ffffff;
margin-bottom: 20rpx;
.img {
width: 100%;
height: 100%;
}
}
}
</style>