2020-08-13 08:12:57 +00:00
|
|
|
|
<template>
|
2021-06-11 09:41:16 +00:00
|
|
|
|
<view class="orderGoods borRadius14">
|
2023-06-29 15:32:16 +00:00
|
|
|
|
<view class='total'>共{{ totalNmu }}件商品</view>
|
2021-06-11 09:41:16 +00:00
|
|
|
|
<view class='goodWrapper pad30'>
|
|
|
|
|
<view class='item acea-row row-between-wrapper' v-for="(item,index) in cartInfo" :key="index"
|
2023-06-29 15:32:16 +00:00
|
|
|
|
@click="jumpCon(item.spuId)">
|
2020-08-13 08:12:57 +00:00
|
|
|
|
<view class='pictrue'>
|
2023-06-29 15:32:16 +00:00
|
|
|
|
<image :src='item.picUrl' />
|
2020-08-13 08:12:57 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class='text'>
|
|
|
|
|
<view class='acea-row row-between-wrapper'>
|
2023-06-29 15:32:16 +00:00
|
|
|
|
<view class='name line1'>{{ item.spuName }}</view>
|
|
|
|
|
<view class='num'>x {{ item.count }}</view>
|
2020-08-13 08:12:57 +00:00
|
|
|
|
</view>
|
2023-06-29 15:32:16 +00:00
|
|
|
|
<view class='attr line1'>
|
|
|
|
|
<text v-for="(property, propertyIndex) in item.properties" :key="propertyIndex" style="padding-right: 10rpx;">
|
|
|
|
|
{{ property.valueName }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class='money font-color'>¥{{ fen2yuan(item.price) }}</view>
|
|
|
|
|
<!-- 评价状态 -->
|
|
|
|
|
<view class='evaluate' v-if='item.replyStatus === false && evaluate === 2' @click.stop="evaluateTap(item)">
|
|
|
|
|
评价
|
2021-06-11 09:41:16 +00:00
|
|
|
|
</view>
|
2023-06-29 15:32:16 +00:00
|
|
|
|
<view class='evaluate' v-else-if="item.replyStatus === true">已评价</view>
|
2020-08-13 08:12:57 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2023-06-29 15:32:16 +00:00
|
|
|
|
import * as Util from '@/utils/util.js';
|
2020-08-13 08:12:57 +00:00
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
|
evaluate: {
|
|
|
|
|
type: Number,
|
2023-06-29 15:32:16 +00:00
|
|
|
|
default: 0, // 是否开启评价功能 0 - 不开启;2 - 开启
|
2020-08-13 08:12:57 +00:00
|
|
|
|
},
|
|
|
|
|
cartInfo: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: function() {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
orderId: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
jump: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
2021-06-11 09:41:16 +00:00
|
|
|
|
},
|
|
|
|
|
productType: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: function() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2020-08-13 08:12:57 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-06-29 15:32:16 +00:00
|
|
|
|
totalNmu: 0 // 商品数量
|
2020-08-13 08:12:57 +00:00
|
|
|
|
};
|
|
|
|
|
},
|
2021-06-11 09:41:16 +00:00
|
|
|
|
watch: {
|
|
|
|
|
cartInfo: function(nVal, oVal) {
|
2020-08-13 08:12:57 +00:00
|
|
|
|
let num = 0
|
2021-06-11 09:41:16 +00:00
|
|
|
|
nVal.forEach((item, index) => {
|
2023-06-29 15:32:16 +00:00
|
|
|
|
num += item.count
|
2020-08-13 08:12:57 +00:00
|
|
|
|
})
|
|
|
|
|
this.totalNmu = num
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2023-06-29 15:32:16 +00:00
|
|
|
|
// TODO 芋艿:评价
|
2021-06-11 09:41:16 +00:00
|
|
|
|
evaluateTap(item) {
|
2020-08-13 08:12:57 +00:00
|
|
|
|
uni.navigateTo({
|
2023-07-01 13:47:34 +00:00
|
|
|
|
url: "/pages/users/goods_comment_con/index?unique=" + item.attrId + "&orderId=" + this.orderId + '&id=' + item.id
|
2020-08-13 08:12:57 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
2021-06-11 09:41:16 +00:00
|
|
|
|
jumpCon: function(id) {
|
2023-06-29 15:32:16 +00:00
|
|
|
|
let type = this.productType === 0 ?'normal':'video'
|
2021-06-11 09:41:16 +00:00
|
|
|
|
if (this.jump) {
|
2020-08-13 08:12:57 +00:00
|
|
|
|
uni.navigateTo({
|
2021-06-11 09:41:16 +00:00
|
|
|
|
url: `/pages/goods_details/index?id=${id}&type=${type}`
|
2020-08-13 08:12:57 +00:00
|
|
|
|
})
|
|
|
|
|
}
|
2023-06-29 15:32:16 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fen2yuan(price) {
|
|
|
|
|
return Util.fen2yuan(price)
|
|
|
|
|
},
|
2020-08-13 08:12:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.orderGoods {
|
|
|
|
|
background-color: #fff;
|
2021-06-11 09:41:16 +00:00
|
|
|
|
margin-top: 15rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.orderGoods .total {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 86rpx;
|
2021-06-11 09:41:16 +00:00
|
|
|
|
padding: 0 24rpx;
|
2020-08-13 08:12:57 +00:00
|
|
|
|
border-bottom: 2rpx solid #f0f0f0;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
color: #282828;
|
|
|
|
|
line-height: 86rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2021-06-11 09:41:16 +00:00
|
|
|
|
|
|
|
|
|
.pictrue image {
|
2020-09-15 08:13:25 +00:00
|
|
|
|
background: #f4f4f4;
|
|
|
|
|
}
|
2020-08-13 08:12:57 +00:00
|
|
|
|
</style>
|