订单删除
This commit is contained in:
@@ -183,7 +183,6 @@
|
||||
|
||||
// 计算购物车商品费用
|
||||
const totalPrices = computed(() => {
|
||||
|
||||
let combinedArray = [];
|
||||
for (const key in props.orderinfo.detailMap) {
|
||||
if (props.orderinfo.detailMap.hasOwnProperty(key)) {
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
</view>
|
||||
<scroll-view scroll-y class="scroll-view">
|
||||
<view class="list-wrap">
|
||||
<view class="ShoppingCart">
|
||||
购物车
|
||||
</view>
|
||||
<view class="shop-item" v-for="(item,index) in cartList" :key="item.id">
|
||||
<view class="shop-item-content">
|
||||
<view class="cover" v-if="item.productId!=-999">
|
||||
@@ -69,11 +72,57 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="shop-item-remark" v-if="item.productId!=-999">
|
||||
<view class="label">备注</view>
|
||||
<up--input placeholder="商品备注(选填)" border="none" v-model="item.note"
|
||||
@blur="productBlur(item)"></up--input>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 历史订单 -->
|
||||
<view class="card" v-if="orderinfo.detailMap">
|
||||
<!-- 订单头部 -->
|
||||
<view class="cardcalorders">
|
||||
<!-- ··· 历史订单 ··· -->
|
||||
历史订单
|
||||
<view class="absolute flex-start">
|
||||
<up-icon name="trash" color="#999"></up-icon>
|
||||
<text style="color:' #999;'" @click="clickcancelOrder('all')">清空历史订单</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card_item" v-for="(value, key) in orderinfo.detailMap" :key="key">
|
||||
<view class="head">
|
||||
<view class="head_left">
|
||||
<text class="placeNum">第{{key}}次下单</text>
|
||||
<view class="placeTime flex-start">
|
||||
<up-icon name="trash" color="#999"></up-icon>
|
||||
<text class="t" @click="clickcancelOrder('',key)">清空</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单详情 -->
|
||||
<view class="shop-info">
|
||||
<view class="item" v-for="item in value" :key="item.id">
|
||||
<view class="cover">
|
||||
<up-image width="80" radius="10" height="80" :src="item.productImg"
|
||||
v-if="item.productId!=-999"></up-image>
|
||||
<up-image width="80" radius="10" height="80"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix" v-else></up-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{item.productName}}</text>
|
||||
<text class="productSkuName"
|
||||
v-if="item.productSkuName">{{item.productSkuName}}</text>
|
||||
</view>
|
||||
|
||||
<view class="price">
|
||||
<view class="priceAmount">
|
||||
¥{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item.memberPrice||item.price):item.price}}
|
||||
</view>
|
||||
<view class="num">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="semicircle_icon" v-if="index > 0">
|
||||
<view class="semicircle_left_icon"></view>
|
||||
<view class="semicircle_right_icon"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -95,7 +144,7 @@
|
||||
} from '@/stores/user.js';
|
||||
|
||||
// 定义自定义事件
|
||||
const emits = defineEmits(['customevent', 'close']);
|
||||
const emits = defineEmits(['customevent', 'close', 'clickcancelOrder']);
|
||||
|
||||
const props = defineProps({
|
||||
cartList: {
|
||||
@@ -108,6 +157,13 @@
|
||||
showCart: {
|
||||
type: Boolean
|
||||
},
|
||||
orderinfo: {
|
||||
type: Object,
|
||||
default: {
|
||||
detailMap: {}
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
|
||||
@@ -171,6 +227,13 @@
|
||||
};
|
||||
})
|
||||
|
||||
const clickcancelOrder = (i, key) => {
|
||||
emits('clickcancelOrder', {
|
||||
i,
|
||||
key
|
||||
})
|
||||
}
|
||||
|
||||
const calculateValue = (cartNumber, i, step = 1) => {
|
||||
if (i == '+') {
|
||||
const result = parseFloat(cartNumber) + parseFloat(step);
|
||||
@@ -247,6 +310,13 @@
|
||||
padding: 28rpx 0 0 28rpx;
|
||||
}
|
||||
|
||||
.ShoppingCart {
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
color: #969494;
|
||||
}
|
||||
|
||||
.shop-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -428,5 +498,365 @@
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
// background-color: #fff;
|
||||
border-radius: 20upx;
|
||||
margin-bottom: 28upx;
|
||||
position: relative;
|
||||
|
||||
.cardcalorders {
|
||||
position: relative;
|
||||
margin: 40rpx 0 20rpx;
|
||||
font-size: 35rpx;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
|
||||
.absolute {
|
||||
position: absolute;
|
||||
right: 28rpx;
|
||||
top: 2rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card_item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
padding-right: 20rpx;
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
// padding: 32rpx 0;
|
||||
.head_left {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
|
||||
.placeNum {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.placeTime {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
|
||||
.t {
|
||||
margin-left: 4rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
border-bottom: 2rpx dashed #e5e5e5;
|
||||
|
||||
|
||||
.item {
|
||||
margin: 30rpx 0;
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 16upx;
|
||||
|
||||
.productName {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.productSkuName {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.n {
|
||||
font-size: 24upx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.priceAmount {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
align-self: flex-end;
|
||||
width: 92rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background: #999999;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.totalAmount {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
padding: 32rpx 0;
|
||||
border-bottom: 2rpx dashed #e5e5e5;
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.semicircle_icon {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: -22.5rpx;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.semicircle_left_icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
margin-left: -22.5rpx;
|
||||
background-color: #f9f9f9;
|
||||
border-radius: 50%;
|
||||
// box-shadow: inset -20rpx 0rpx 22rpx -20rpx rgba(87, 86, 86, 0.35);
|
||||
|
||||
}
|
||||
|
||||
.semicircle_right_icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
margin-right: -22.5rpx;
|
||||
background-color: #f9f9f9;
|
||||
border-radius: 50%;
|
||||
// box-shadow: inset 13rpx 0rpx 16rpx -9rpx rgba(87, 86, 86, 0.35);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cell-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx 34rpx 0 34rpx;
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
padding-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.val {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding-bottom: 32rpx;
|
||||
border-bottom: 2rpx dashed #e5e5e5;
|
||||
|
||||
view:nth-child(1) {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-right: 42rpx;
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.val.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.productCoupon {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
margin: 0 0 10rpx 0;
|
||||
|
||||
.name {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin: 0 30rpx;
|
||||
line-height: 20rpx;
|
||||
}
|
||||
|
||||
.amount {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.favorable {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 26rpx;
|
||||
padding-top: 26rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.favorable_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 400rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.favorable_right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.favorable_right_text {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
font-weight: 400rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.favorable_right {
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
|
||||
.favorable_right_text {
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin: 0 30rpx;
|
||||
}
|
||||
|
||||
text:nth-child(3) {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.favorable_right.column {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.favorable.column {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.cell-item.column {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.total-wrap {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
padding: 0 34rpx;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 64rpx;
|
||||
|
||||
.price {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order_footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 34rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user