72 lines
2.1 KiB
Vue
72 lines
2.1 KiB
Vue
<template>
|
|
<view class="container">
|
|
<ModuleTitle :title="commodityDTO.title" />
|
|
<view class="container-scroll">
|
|
<view
|
|
v-for="(item, index) in commodityDTO.commodityList"
|
|
:key="`${item.commodityId}-${index}`"
|
|
>
|
|
<view class="mk-card-item" @click="placeOrderHandle(item)">
|
|
<!-- <view class="card-badge">超值推荐</view> -->
|
|
<image class="card-img" :src="item.commodityIcon" mode="aspectFill" />
|
|
<view class="card-content">
|
|
<view class="card-title-column">
|
|
<text class="card-title">{{ item.commodityName }}</text>
|
|
<view
|
|
class="card-tags"
|
|
v-for="tag in item.commodityTradeRuleList"
|
|
:key="tag"
|
|
>
|
|
<text class="card-tag">{{ tag }}</text>
|
|
</view>
|
|
</view>
|
|
<template
|
|
v-for="(serviceItem, index) in item.commodityServices"
|
|
:key="serviceItem.serviceTitle"
|
|
>
|
|
<view v-if="index < 3" class="card-desc"
|
|
>· {{ serviceItem.serviceTitle }}</view
|
|
>
|
|
</template>
|
|
<view class="card-bottom-row">
|
|
<view class="card-price-row">
|
|
<text class="card-price-fu">¥</text>
|
|
<text class="card-price">{{ item.commodityPrice }}</text>
|
|
<text class="card-unit">/{{ item.stockUnitLabel }}</text>
|
|
</view>
|
|
|
|
<text class="card-btn">下单</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { defineProps } from "vue";
|
|
import { checkToken } from "@/hooks/useGoLogin";
|
|
import ModuleTitle from "@/components/ModuleTitle/index.vue";
|
|
|
|
const props = defineProps({
|
|
commodityDTO: {
|
|
type: Object,
|
|
default: {},
|
|
},
|
|
});
|
|
|
|
/// 去下单
|
|
const placeOrderHandle = (item) => {
|
|
checkToken().then(() => {
|
|
uni.navigateTo({
|
|
url: `/pages/goods/index?commodityId=${item.commodityId}`,
|
|
});
|
|
});
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@import "./styles/index.scss";
|
|
</style>
|