NurseStationApp/pages/shopping/shopping.vue

88 lines
2.1 KiB
Vue
Raw Normal View History

2022-10-20 19:39:57 +08:00
2022-10-12 16:54:34 +08:00
<template>
2022-10-12 17:45:22 +08:00
<view class="app">
<view class="cards">
<view class="item" :style="{background:listcolor[index]}" @tap='goProductList(item)'
v-for="(item,index) in goodsCategoryList" :key="index">
<!-- <image src="../../static/sp.png" mode=""></image> -->
<image :src="item.goodsCatrgoryPicture" mode=""></image>
2022-10-12 17:45:22 +08:00
<view class="title">
{{item.goodsCategoryName}}
2022-10-12 17:45:22 +08:00
</view>
</view>
<view class=" item">
2022-10-12 17:45:22 +08:00
</view>
<!-- <view class="item" style="background-color: #E1AE3C;">
2022-10-13 10:37:47 +08:00
<image src="../../static/znsb.png" mode=""></image>
2022-10-12 17:45:22 +08:00
<view class="title" style="font-size: 42rpx;">
可穿戴医疗设备
</view>
</view>
<view class="item" style="background: #4C7BC9;">
2022-10-13 10:37:47 +08:00
<image src="../../static/cp.png" mode=""></image>
2022-10-12 17:45:22 +08:00
<view class="title" style="font-size: 42rpx;">
适老化改造
</view>
</view> -->
2022-10-12 17:45:22 +08:00
</view>
2022-10-12 16:54:34 +08:00
</view>
</template>
<script>
import {
goodsCategoryList
} from '@/api/shopping/shopping.js';
import baseurl from '@/api/baseurl.js'
2022-10-12 16:54:34 +08:00
export default {
data() {
return {
pageNum: 1,
pageSize: 999,
goodsCategoryList: [],
listcolor: ['#00C176', '#D43953', '#E1AE3C', '#4C7BC9', '#00C176'],
2022-10-20 19:39:57 +08:00
// img: '',
};
},
onLoad(options) {
this.goodsCategory()
2022-10-12 17:45:22 +08:00
},
methods: {
//跳转到商品列表页面
goProductList(item) {
console.log(item)
// if (number == 1) {
// var titlename = '特医食品'
// uni.navigateTo({
// url: `/pages/ProductList/ProductList?title=${titlename}&goodsCategoryId=${this.id}`
// })
// }
uni.navigateTo({
url: `/pages/ProductList/ProductList?title=${item.goodsCategoryName}&goodsCategoryId=${item.id}`
})
2022-10-12 17:45:22 +08:00
},
//获取商城信息
goodsCategory() {
goodsCategoryList(this.pageSize, this.pageNum, ).then(res => {
res.data.forEach(e => {
e.goodsCatrgoryPicture = baseurl + e.goodsCatrgoryPicture
})
this.goodsCategoryList = res.data
})
}
2022-10-12 17:45:22 +08:00
},
2022-10-12 16:54:34 +08:00
}
</script>
<style lang="scss">
2022-10-12 17:45:22 +08:00
.app {
2022-10-17 11:21:23 +08:00
// background-color: #F4F5F7;
// width: 100%;
// height: 100vh;
// position: relative;
2022-10-12 17:45:22 +08:00
2022-10-12 17:45:22 +08:00
}
2022-10-20 19:39:57 +08:00
</style>