空状态需要处理,需要添加分享页面

This commit is contained in:
cbb
2025-12-26 17:42:07 +08:00
parent bb02cb22c0
commit dfc5888fa9
64 changed files with 11036 additions and 109 deletions

View File

@@ -1,10 +1,10 @@
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getProductDetail } from '@/api/mall'
import { getProductDetail, addOrder } from '@/api/mall'
import { reactive, ref } from 'vue'
import { formatRMB } from '@/utils'
import { getUserAddress } from '@/api'
import { navigateTo } from '@/utils/router'
import { navigateTo, redirectTo } from '@/utils/router'
const viewData = ref({})
@@ -63,7 +63,6 @@
formData.spec = id
priceData.value = price
formData.total = price
console.log('111111111111111111111')
}
/** 数量切换 */
@@ -81,13 +80,18 @@
}
// 提交订单
const onConfirm = () => {
const onConfirm = async () => {
const data = {
addressId: topRessData.id,
productId: viewData.value.id,
quantity: formData.num
quantity: formData.num,
skuId: formData.spec
}
console.log(data, '提交订单')
const res = await addOrder(data)
redirectTo('/pages/shop-together/detail', {
id: res.data.groupId,
type: 'add'
})
}
onShow(() => {
@@ -121,7 +125,7 @@
</view>
<!-- 商品展示 -->
<view class="product-box">
<view class="public-product_item">
<image
:src="viewData.mainImage"
mode="scaleToFill"
@@ -133,8 +137,8 @@
</text>
<view class="line-box">
<view class="rmb-box">
<text>¥{{ viewData.maxPrice }}</text>
<text>¥{{ viewData.minPrice }}</text>
<text>¥{{ viewData.originalPrice || '' }}</text>
<text>¥{{ priceData }}</text>
</view>
<!-- 添加数量 -->
<view class="add-num">
@@ -210,5 +214,6 @@
page {
background: #f9f9f9;
}
@import '@/styles/mall.scss';
@import './styles/confirm-order.scss';
</style>

View File

@@ -48,76 +48,6 @@
}
// 商品展示
.product-box {
margin: 16rpx 0;
padding: 32rpx;
border-radius: 32rpx;
background: #ffffff;
display: flex;
align-items: center;
.left-img {
width: 192rpx;
height: 192rpx;
border-radius: 8rpx;
flex-shrink: 0;
margin-right: 32rpx;
}
.right-content {
width: 100%;
height: 192rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
font-family: PingFang SC, PingFang SC;
font-style: normal;
text-transform: none;
.product-name {
font-weight: bold;
font-size: 32rpx;
color: #333333;
display: -webkit-box;
-webkit-box-orient: vertical;
box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
overflow-wrap: break-word;
}
.line-box {
display: flex;
justify-content: space-between;
align-items: flex-end;
.rmb-box {
display: flex;
flex-direction: column;
text {
font-weight: 500;
font-size: 32rpx;
color: #eb3c39;
// 第一个
&:first-child {
font-size: 24rpx;
color: #999999;
text-decoration-line: line-through;
}
}
}
.add-num {
display: flex;
align-items: center;
.uni-number-box {
width: 120rpx;
}
}
}
}
}
// 规格
.spec-box {