新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
// 购物车统计信息
|
||||
export const settleFields = [
|
||||
{
|
||||
label: '商品总价',
|
||||
label: '支付总价',
|
||||
field: 'truePrice',
|
||||
prefix: '¥'
|
||||
},
|
||||
@ -22,6 +22,11 @@ export const settleFields = [
|
||||
field: 'postagePrice',
|
||||
prefix: '¥'
|
||||
},
|
||||
{
|
||||
label: '积分',
|
||||
field: 'integral',
|
||||
prefix: '-'
|
||||
},
|
||||
{
|
||||
label: '总计',
|
||||
field: 'totalPrice',
|
||||
|
@ -25,7 +25,6 @@
|
||||
>
|
||||
<uv-checkbox
|
||||
:name="item.cartInfo.productAttrUnique"
|
||||
:disabled="item.isAfterSales != 1"
|
||||
/>
|
||||
<view class="goods-col">
|
||||
<Goods
|
||||
@ -42,7 +41,9 @@
|
||||
class="sku-info flex flex-jc__sb flex-ai__center"
|
||||
>
|
||||
<view class="info">
|
||||
{{ item.cartInfo.productInfo &&item.cartInfo.productInfo.attrInfo && item.cartInfo.productInfo.attrInfo.sku }}
|
||||
{{
|
||||
item.cartInfo.productInfo && item.cartInfo.productInfo.attrInfo && item.cartInfo.productInfo.attrInfo.sku
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -50,7 +51,10 @@
|
||||
<view class="price-row flex flex-ai__center flex-jc__sb">
|
||||
<!-- price -->
|
||||
<view class="price-box flex flex-ai__end">
|
||||
¥{{item.cartInfo.truePrice }}
|
||||
¥{{ item.cartInfo.truePrice }}
|
||||
</view>
|
||||
<view class="cart-num">
|
||||
x {{ item.cartInfo.cartNum }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -85,7 +89,6 @@
|
||||
>
|
||||
<uv-checkbox
|
||||
name="all"
|
||||
:disabled="allDisabled"
|
||||
:checked="goodsSelectAll"
|
||||
@change="handleGoodsSelectAll"
|
||||
>
|
||||
@ -97,7 +100,7 @@
|
||||
{{ goodsSelect.length }} 件商品
|
||||
</view>
|
||||
<view class="action-total">
|
||||
总计:¥{{ statisticsInfo.totalPrice.toFixed(2) }}
|
||||
总计:¥{{ statisticsInfo.totalPrice.toFixed(2) }} 积分:{{ statisticsInfo.integral.toFixed(2) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btns">
|
||||
@ -108,7 +111,7 @@
|
||||
仅退款
|
||||
</view>
|
||||
<view
|
||||
v-if="status !== 0"
|
||||
v-if="status !== 0 && status !== 5"
|
||||
class="button"
|
||||
@click="toRefund(1)"
|
||||
>
|
||||
@ -127,9 +130,10 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
import Goods from "@/components/goodsComponents/Goods.vue";
|
||||
import { settleFields } from "@/pages/selectRefundGood/index.data";
|
||||
import { useInterface } from "@/hooks/useInterface";
|
||||
|
||||
const {toast} = useInterface();
|
||||
const {getParams, push, goBack} = useRouter()
|
||||
const goodsList = ref([])
|
||||
const goodsSelect = ref([])
|
||||
const goodsSelectAll = ref(false)
|
||||
const orderId = ref(null)
|
||||
@ -141,7 +145,8 @@ const statisticsInfo = ref({
|
||||
truePrice: 0,
|
||||
couponPrice: 0,
|
||||
postagePrice: 0,
|
||||
totalPrice: 0
|
||||
totalPrice: 0,
|
||||
integral: 0
|
||||
})
|
||||
|
||||
const handleGoodsSelectAll = (e) => {
|
||||
@ -150,11 +155,11 @@ const handleGoodsSelectAll = (e) => {
|
||||
goodsSelect.value = []
|
||||
return
|
||||
}
|
||||
goodsSelect.value = goodsList.value.filter(item=> item.isAfterSales === 1).map(item => item.cartInfo.productAttrUnique)
|
||||
goodsSelect.value = goodsList.value.map(item => item.cartInfo.productAttrUnique)
|
||||
}
|
||||
|
||||
const handleGoodsSelect = (value) => {
|
||||
goodsSelectAll.value = value.length === goodsList.value.filter(item=> item.isAfterSales === 1).length
|
||||
goodsSelectAll.value = value.length === goodsList.value.length
|
||||
}
|
||||
|
||||
watch(goodsSelect, (goodsSelect) => {
|
||||
@ -162,42 +167,46 @@ watch(goodsSelect, (goodsSelect) => {
|
||||
truePrice: 0,
|
||||
couponPrice: 0,
|
||||
postagePrice: 0,
|
||||
totalPrice: 0
|
||||
totalPrice: 0,
|
||||
integral: 0
|
||||
}
|
||||
let postagePrice = 0
|
||||
goodsList.value.filter(item => goodsSelect.includes(item.cartInfo.productAttrUnique)).forEach(item => {
|
||||
statisticsInfo.value.truePrice += item.cartInfo.truePrice * item.cartInfo.cartNum
|
||||
statisticsInfo.value.couponPrice += item.cartInfo.couponPrice
|
||||
statisticsInfo.value.integral += item.refundableIntegral * item.cartInfo.cartNum
|
||||
statisticsInfo.value.couponPrice += item.totalCouponPrice * item.cartInfo.cartNum
|
||||
postagePrice += item.cartInfo.postagePrice
|
||||
statisticsInfo.value.totalPrice += item.refundablePrice * item.cartInfo.cartNum
|
||||
})
|
||||
statisticsInfo.value.totalPrice = statisticsInfo.value.truePrice - statisticsInfo.value.couponPrice
|
||||
// 未发货退邮费
|
||||
if(status.value === 0){
|
||||
if (status.value === 0) {
|
||||
statisticsInfo.value.postagePrice = postagePrice
|
||||
statisticsInfo.value.totalPrice += statisticsInfo.value.postagePrice
|
||||
}
|
||||
})
|
||||
|
||||
const handleOrderInfo = async (option) => {
|
||||
const res = await applyForAfterSalesInfo(option)
|
||||
// orderInfoData.value = res
|
||||
goodsList.value = res
|
||||
orderId.value = res[0].orderId
|
||||
status.value = res[0].status
|
||||
for(let i=0;i<res.length;i++){
|
||||
if(res[i].isAfterSales === 1){
|
||||
allDisabled.value = false
|
||||
break
|
||||
const goodsList = ref([])
|
||||
|
||||
const handleOrderInfo = async () => {
|
||||
try {
|
||||
const res = await applyForAfterSalesInfo({
|
||||
key: id.value
|
||||
})
|
||||
goodsList.value = res
|
||||
orderId.value = res[0].orderId
|
||||
status.value = res[0].status
|
||||
} catch (e) {
|
||||
if (e.msg === "订单明细不存在!") {
|
||||
toast({title: '该笔订单已无商品可以售后'})
|
||||
goBack({}, 2000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const toRefund = (type) => {
|
||||
const toRefund = async (type) => {
|
||||
if (goodsSelect.value.length <= 0) {
|
||||
return
|
||||
}
|
||||
|
||||
refundType.value = type
|
||||
push({url: '/pages/refund/refund'}, {
|
||||
data: {
|
||||
@ -206,7 +215,7 @@ const toRefund = (type) => {
|
||||
orderId: orderId.value,
|
||||
id: id.value
|
||||
},
|
||||
type:'redirectTo'
|
||||
type: 'redirectTo'
|
||||
})
|
||||
}
|
||||
|
||||
@ -214,9 +223,7 @@ const toRefund = (type) => {
|
||||
onLoad((options) => {
|
||||
const params = getParams(options)
|
||||
id.value = params.id
|
||||
handleOrderInfo({
|
||||
key: params.id
|
||||
})
|
||||
handleOrderInfo()
|
||||
})
|
||||
|
||||
|
||||
@ -250,6 +257,7 @@ onLoad((options) => {
|
||||
gap: 20rpx;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
|
||||
.button {
|
||||
flex: 1;
|
||||
height: 80%;
|
||||
@ -268,11 +276,12 @@ onLoad((options) => {
|
||||
}
|
||||
}
|
||||
|
||||
.goods-row{
|
||||
@include useFlex(space-between,center);
|
||||
@include usePadding(20,10);
|
||||
.goods-row {
|
||||
@include useFlex(space-between, center);
|
||||
@include usePadding(20, 10);
|
||||
width: 100%;
|
||||
.goods-col{
|
||||
|
||||
.goods-col {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
@ -315,7 +324,7 @@ onLoad((options) => {
|
||||
|
||||
.price-box {
|
||||
font-size: 30rpx;
|
||||
color:$primary-color;
|
||||
color: $primary-color;
|
||||
|
||||
.old-price {
|
||||
font-size: 20rpx;
|
||||
@ -325,6 +334,7 @@ onLoad((options) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.cart-num {
|
||||
font-size: 24rpx;
|
||||
|
||||
|
Reference in New Issue
Block a user