@@ -26,8 +26,28 @@
|
||||
<!-- 商品信息 -->
|
||||
<view class="goods-info">
|
||||
<text class="goods-name">{{ item.productName }}</text>
|
||||
<!-- 商品价格组件 -->
|
||||
<GoodsPrice :goods="item" />
|
||||
|
||||
<!-- 价格信息 -->
|
||||
<view class="price-info">
|
||||
<!-- VIP优惠价 -->
|
||||
<!-- <view v-if="item.isVipPrice === 1 && item.vipPrice" class="price-row">
|
||||
<text class="vip-price">¥{{ item.vipPrice.toFixed(2) }}</text>
|
||||
<text class="vip-label">{{ $t('order.vipPriceLabel') }}</text>
|
||||
<text class="original-price">¥{{ item.price.toFixed(2) }}</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 活动价 -->
|
||||
<!-- <view v-else-if="item.activityPrice && item.activityPrice > 0" class="price-row">
|
||||
<text class="activity-price">¥{{ item.activityPrice.toFixed(2) }}</text>
|
||||
<text class="activity-label">{{ $t('order.activityLabel') }}</text>
|
||||
<text class="original-price">¥{{ item.price.toFixed(2) }}</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 普通价格 -->
|
||||
<view class="price-row">
|
||||
<text class="normal-price">{{ item.price.toFixed(2) }} 天医币</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 数量 -->
|
||||
<!-- <view class="quantity-row">
|
||||
@@ -49,20 +69,25 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { orderApi } from '@/api/modules/order'
|
||||
import type { IOrderGoods } from '@/types/order'
|
||||
import Confirm from '@/components/order/Confirm.vue';
|
||||
import GoodsPrice from '@/components/order/GoodsPrice.vue';
|
||||
import type { IOrderGoods } from '@/types/order'
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
const userInfo = ref({})
|
||||
const userInfo = ref(null)
|
||||
const getUserInfo = async () => {
|
||||
const res = await orderApi.getUserInfo()
|
||||
userInfo.value = res.result || {}
|
||||
try {
|
||||
const res = await orderApi.getUserInfo()
|
||||
if (res.code === 0) {
|
||||
userInfo.value = res.result || {}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,11 +96,15 @@ const getUserInfo = async () => {
|
||||
const goodsIds = ref<string>('')
|
||||
const goodsList = ref<IOrderGoods[]>([])
|
||||
const getGoodsList = async () => {
|
||||
// 获取商品详情
|
||||
const res = await orderApi.getShopProductListByIds(goodsIds.value)
|
||||
|
||||
if (res.shopProductList?.length > 0) {
|
||||
goodsList.value = res.shopProductList
|
||||
try {
|
||||
// 获取商品详情
|
||||
const res = await orderApi.getShopProductListByIds(goodsIds.value)
|
||||
|
||||
if (res.code === 0 && res.shopProductList?.length > 0) {
|
||||
goodsList.value = res.shopProductList
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取商品列表失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +181,43 @@ onLoad(async (options: any) => {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.price-info {
|
||||
.price-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 10rpx;
|
||||
|
||||
.vip-price,
|
||||
.activity-price {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #e97512;
|
||||
}
|
||||
|
||||
.normal-price {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.vip-label {
|
||||
font-size: 22rpx;
|
||||
color: #fa2d12;
|
||||
}
|
||||
|
||||
.activity-label {
|
||||
font-size: 22rpx;
|
||||
color: #613804;
|
||||
}
|
||||
|
||||
.original-price {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.quantity-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user