feat: 完善商品计奖隔离、积分商城兑换券抵扣与下线售后退款入口

这个提交包含在:
chen
2026-09-17 16:55:08 +08:00
父节点 f5b804fb57
当前提交 c3f5b3d4b5
共有 22 个文件被更改,包括 720 次插入 和 183 次删除

查看文件

@@ -1,7 +1,27 @@
<!-- 页面 -->
<template>
<s-layout title="积分商城">
<view class="ss-p-20">
<!-- 资产看板:当前积分与可用兑换券 -->
<view class="asset-banner ss-m-20 ss-p-20">
<view class="ss-flex ss-row-between ss-col-center">
<view class="asset-item">
<view class="asset-label">当前积分</view>
<view class="asset-val">{{ userInfo.score || 0 }}</view>
</view>
<view class="asset-line"></view>
<view class="asset-item">
<view class="asset-label">可用兑换券</view>
<view class="asset-val text-red">¥ {{ userVoucherAvailable }}</view>
</view>
<button class="ss-reset-button earn-btn" @tap="sheep.$router.go('/pages/commission/voucher')">
券明细
</button>
</view>
<view class="asset-tip ss-m-t-16">
💡 兑换商品时支持使用兑换券 1:1 抵扣现金部分
</view>
</view>
<view class="ss-p-x-20">
<view v-for="item in state.pagination.data" :key="item.id" class="ss-m-b-20">
<s-score-card
size="sl"
@@ -29,9 +49,15 @@
<script setup>
import sheep from '@/sheep';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { reactive } from 'vue';
import { computed, reactive } from 'vue';
import _ from 'lodash';
const userInfo = computed(() => sheep.$store('user').userInfo || {});
const agentInfo = computed(() => sheep.$store('user').agentInfo || {});
const userVoucherAvailable = computed(() => {
return agentInfo.value?.voucher_available || userInfo.value?.voucher_available || '0.00';
});
const state = reactive({
pagination: {
data: [],
@@ -75,3 +101,43 @@
getData();
});
</script>
<style lang="scss" scoped>
.asset-banner {
background: linear-gradient(135deg, #2d3139 0%, #1f2228 100%);
border-radius: 16rpx;
color: #fff;
.asset-item {
.asset-label {
font-size: 24rpx;
color: #999;
margin-bottom: 8rpx;
}
.asset-val {
font-size: 34rpx;
font-weight: bold;
color: #f7d088;
&.text-red {
color: #ff5252;
}
}
}
.asset-line {
width: 1rpx;
height: 48rpx;
background: rgba(255, 255, 255, 0.15);
}
.earn-btn {
padding: 8rpx 20rpx;
font-size: 24rpx;
color: #fff;
background: rgba(255, 255, 255, 0.15);
border-radius: 24rpx;
border: 1rpx solid rgba(255, 255, 255, 0.2);
}
.asset-tip {
font-size: 22rpx;
color: #d1b172;
}
}
</style>

查看文件

@@ -24,7 +24,7 @@
</view>
<button
class="ss-reset-button exchange-btn ss-flex ss-row-center ss-col-center"
@tap="sheep.$router.go('/pages/index/index')"
@tap="sheep.$router.go('/pages/app/score-shop')"
>
<text class="cicon-goods-o ss-m-r-6"></text>
<text>去兑换</text>

查看文件

@@ -39,6 +39,7 @@
<view class="score-text ss-m-r-16">
{{ goodsPrice.score }}
</view>
<view v-if="goodsPrice.price > 0" class="voucher-tip-tag">支持兑换券抵扣</view>
</view>
<view class="sales-text">
{{ formatExchange(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }}
@@ -237,6 +238,17 @@
line-height: 36rpx;
font-family: OPPOSANS;
}
.voucher-tip-tag {
font-size: 20rpx;
color: #ff3000;
background: rgba(255, 48, 0, 0.1);
border: 1rpx solid rgba(255, 48, 0, 0.2);
border-radius: 6rpx;
padding: 2rpx 8rpx;
margin-left: 12rpx;
line-height: normal;
align-self: center;
}
}
.origin-price-text {
font-size: 26rpx;

查看文件

@@ -146,21 +146,11 @@ const rules = reactive({});
// 提交表单
async function submit() {
// #ifdef MP
sheep.$platform.useProvider('wechat').subscribeMessage('order_aftersale_change');
// #endif
let data = {
...formData,
order_id: state.goodsItem.order_id,
order_item_id: state.goodsItem.id,
};
const res = await sheep.$api.order.aftersale.apply(data);
if (res.code === 1) {
uni.showToast({
title: res.msg,
});
sheep.$router.go('/pages/order/aftersale/list');
}
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
return;
}
//选择售后类型
function onRefundChange(e) {
@@ -182,7 +172,16 @@ function onReason() {
state.showModal = false;
}
onLoad((options) => {
state.goodsItem = JSON.parse(options.item);
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
setTimeout(() => {
sheep.$router.back();
}, 1200);
if (options?.item) {
state.goodsItem = JSON.parse(options.item);
}
});
</script>

查看文件

@@ -196,8 +196,13 @@
state.loading = false;
}
onLoad((options) => {
state.aftersaleId = options.id;
getDetail(options.id);
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
setTimeout(() => {
sheep.$router.back();
}, 1200);
});
</script>

查看文件

@@ -178,10 +178,13 @@
}
onLoad(async (options) => {
if (options.type) {
state.currentTab = options.type;
}
getOrderList();
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
setTimeout(() => {
sheep.$router.back();
}, 1200);
});
// 加载更多

查看文件

@@ -91,8 +91,13 @@ async function onConfirm() {
}
onLoad((options) => {
state.aftersaleId = options.id;
getDetail(options.id);
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
setTimeout(() => {
sheep.$router.back();
}, 1200);
});
</script>

查看文件

@@ -97,7 +97,6 @@
</view>
<view
class="order-item ss-flex ss-col-center ss-row-between"
v-if="state.orderPayload.order_type != 'score'"
>
<view class="item-title">兑换券</view>
<view class="ss-flex ss-col-center" @tap="openVoucher">

查看文件

@@ -91,40 +91,7 @@
</template>
<template #tool>
<view class="ss-flex">
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
申请售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('re_aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
重新售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale_info')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', {
id: item.ext.aftersale_id,
})
"
>
售后详情
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('buy_again')"
@@ -271,12 +238,7 @@
@tap="onPay(state.orderInfo.order_sn)"
>继续支付</button
>
<button
class="ss-reset-button cancel-btn"
v-if="state.orderInfo.btns?.includes('apply_refund')"
@tap="onRefund(state.orderInfo.id)"
>申请退款</button
>
<button
class="ss-reset-button cancel-btn"
v-if="state.orderInfo.btns?.includes('groupon')"
@@ -313,13 +275,7 @@
>
查看发票
</button>
<button
v-if="state.orderInfo.btns?.includes('re_apply_refund')"
class="ss-reset-button cancel-btn"
@tap.stop="onRefund(state.orderInfo.id)"
>
重新退款
</button>
<button
class="ss-reset-button cancel-btn"
v-if="state.orderInfo.btns?.includes('apply_invoice')"

查看文件

@@ -38,40 +38,7 @@
>
<template #tool>
<view class="ss-flex">
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
申请售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('re_aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
重新售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale_info')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', {
id: item.ext.aftersale_id,
})
"
>
售后详情
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('buy_again')"
@@ -168,20 +135,6 @@
查看物流
</button>
<button
v-if="order.btns.includes('apply_refund')"
class="tool-btn ss-reset-button"
@tap.stop="onRefund(order.id)"
>
申请退款
</button>
<button
v-if="order.btns.includes('re_apply_refund')"
class="tool-btn ss-reset-button"
@tap.stop="onRefund(order.id)"
>
重新退款
</button>
<button
v-if="order.btns.includes('cancel')"

查看文件

@@ -34,6 +34,13 @@
path: '/pages/order/list',
type: 'unpaid',
},
{
title: '待发货',
value: '2',
icon: '/assets/addons/shopro/uniapp/order/cargo.png',
path: '/pages/order/list',
type: 'nosend',
},
{
title: '待收货',
value: '3',
@@ -48,13 +55,6 @@
path: '/pages/order/list',
type: 'nocomment',
},
{
title: '售后单',
value: '0',
icon: '/assets/addons/shopro/uniapp/order/change_order.png',
path: '/pages/order/aftersale/list',
type: 'aftersale',
},
{
title: '全部订单',
value: '0',

查看文件

@@ -63,6 +63,15 @@ const _go = (
return;
}
// 退款与售后功能关闭拦截
if (startsWith(page, '/pages/order/aftersale')) {
uni.showToast({
title: '退款与售后功能暂未开放',
icon: 'none',
});
return;
}
url = page;
if (!isEmpty(query)) {
url += `?${query}`;