Commit 54c10c0a authored by 张娇(东信)'s avatar 张娇(东信)

跳转详情页

parent cf72bbd2
......@@ -64,7 +64,12 @@
style="position: relative; float: right; top: -42rpx"
></wd-icon>
<view class="hot-img" v-for="(item, index) in hotImgList" :key="index">
<img class="rice" @tap="toDetail" :src="item.img" style="width: 670rpx; height: 236rpx" />
<img
class="rice"
@tap="toDetail(item)"
:src="item.img"
style="width: 670rpx; height: 236rpx"
/>
</view>
</view>
<!-- tabs-->
......@@ -93,7 +98,7 @@
:key="index"
style="margin-left: 20rpx"
>
<img @tap="toDetail" :src="item.imgUrl" style="width: 330rpx; height: 330rpx" />
<img @tap="toDetail(item)" :src="item.imgUrl" style="width: 330rpx; height: 330rpx" />
<view class="detail-title">{{ whh }}</view>
<view class="price-page">
<text class="price">{{ item.price }}</text>
......@@ -202,10 +207,10 @@ function handleClick(e) {
function onChange(e) {
console.log(e);
}
function toDetail() {
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
function toCart() {
......
......@@ -32,7 +32,7 @@
</view>
</view>
</view>
<view class="product-page" v-for="(item, index) in list" :key="index" @click="toDetail">
<view class="product-page" v-for="(item, index) in list" :key="index">
<view>
<view class="page-title">{{ item.categoryName }}</view>
<img :src="item.img" class="main-img" />
......@@ -41,7 +41,7 @@
class="detail-border"
v-for="(item, index) in item.commodityList"
:key="index"
@click="toDetail"
@click="toDetail(item)"
>
<img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" />
<view class="detail-title">{{ item.prodName }}</view>
......@@ -73,23 +73,6 @@ const swiperList = ref([]);
const current = ref(0);
// 轮播图数据
let lunboData;
const detailList = ref([
{
img: '/static/assistingAgriculture/assets/detailedMapOne.png',
price: '25',
text: '干辣椒炒肉干辣椒炒肉',
},
{
img: '/static/assistingAgriculture/assets/detailedMapTwo.png',
price: '25',
text: '贵阳辣子鸡',
},
{
img: '/static/assistingAgriculture/assets/detailedMapThree.png',
price: '25',
text: '麻辣鱼豆腐',
},
]);
onMounted(async () => {
getList();
getPresaleCategoryList();
......@@ -153,10 +136,10 @@ const toBuilding = (item) => {
}
};
// 跳转详情页
function toDetail() {
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
</script>
......
......@@ -47,7 +47,7 @@
</text>
</scroll-view>
</view>
<view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail">
<view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)">
<img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" />
<view>
<text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text>
......@@ -71,7 +71,7 @@
</view>
<view class="waterfall">
<view class="wt-left wt-list">
<view class="wt-item" v-for="(good, index) in buyList" :key="index" @tap="toDetail">
<view class="wt-item" v-for="(good, index) in buyList" :key="index" @tap="toDetail(item)">
<view class="item-img">
<image :src="good.img" mode="widthFix" style="border-radius: 16rpx"></image>
<image
......@@ -216,11 +216,6 @@ const choice = (index, categoryId) => {
});
light.value = index;
};
// 点击商品 跳转详情
function ToDetail(id) {
console.log('点击了商品', id);
}
function handleClick(e) {
console.log(e);
}
......@@ -233,10 +228,10 @@ function toCart() {
url: '/pages/assistingAgriculture/cart/cart',
});
}
function toDetail() {
// TODO: 跳转到筑农严选
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
function toTab(item) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment