文件
NHCshopro/uniapp/pages/index/components/sh-image-goods.vue
wikiboss f141d35f1c Add 'uniapp/' from commit '096e31448ca089004c78af69f2006c2b0324d8a4'
git-subtree-dir: uniapp
git-subtree-mainline: b87880e247
git-subtree-split: 096e31448c
2026-11-20 09:08:51 +08:00

53 行
820 B
Vue

<template>
<view class="image-goods-box">
<image @tap="handleToGoodsDetail" v-if="image" :src="image" mode="widthFix" class="img"></image>
</view>
</template>
<script>
/**
* 图片商品
* @property {String} image -图片
* @property {Object} goods -商品信息
*/
export default {
components: {},
data() {
return {
};
},
props: {
image: {
type: String,
default: ''
},
goods: {
type: Object,
default: {
id: 0,
title: '',
image: ''
}
}
},
computed: {},
created() {},
methods: {
// 跳转商品详情
handleToGoodsDetail() {
if (this.goods.id) {
this.$tools.routerTo(`/pages/goods/detail?id=${this.goods.id}`);
}
}
}
};
</script>
<style lang="scss">
.image-goods-box {
.img {
width: 100%;
}
}
</style>