订单结算修改,增加限时折扣

This commit is contained in:
2025-10-24 16:13:40 +08:00
parent 5aa469a7b7
commit 26532150b5
36 changed files with 4989 additions and 1885 deletions

View File

@@ -11,21 +11,21 @@
<view class="box">
<view class="u-flex top justify-between u-p-32">
<text class="title">确认信息</text>
<up-icon name="close"></up-icon>
<up-icon name="close" @click="close"></up-icon>
</view>
<view class="info">
<view class="color-333">兑换码包含内容如下:</view>
<view class="u-m-t-32 u-flex u-col-center">
<view class="color-333 font-bold small-title">店铺</view>
<text class="color-666 u-m-l-38">店铺名称</text>
<text class="color-666 u-m-l-38">{{data.shopName}}</text>
</view>
<view class="u-m-t-32 u-flex u-col-center">
<view class="color-333 font-bold small-title">名称</view>
<text class="color-666 u-m-l-38">10张券兑换码</text>
<text class="color-666 u-m-l-38">{{data.name}}</text>
</view>
<view class="u-m-t-32 u-flex u-col-center">
<view class="u-m-t-32 u-flex u-col-center" v-if="data.couponInfoList&&data.couponInfoList.length">
<view class="color-333 font-bold small-title">优惠券</view>
<text class="color-666 u-m-l-38">优惠券名称*2优惠券名称*1</text>
<text class="color-666 u-m-l-38">{{data.couponInfoList.map(item=>item.title+'*'+item.num).join('、')}}</text>
</view>
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
<view class="cancel" @click="close">取消</view>
@@ -39,6 +39,13 @@
<script setup>
import { ref } from "vue";
const props=defineProps({
//兑换码信息
data:{
type:Object,
default:()=>({}),
},
})
const show = defineModel({
type: Boolean,
default: false,

View File

@@ -14,46 +14,92 @@
<view class="input-box u-flex">
<image class="icon" src="/user/static/duihuan.png"></image>
<view class="u-flex-1">
<input placeholder="请输入兑换码" />
<input placeholder="请输入兑换码" v-model="code" />
</view>
</view>
</view>
<view class="u-flex justify-center u-m-t-24">
<button class="duihuan">确认兑换</button>
<button class="duihuan" @click="confirmExchange">确认兑换</button>
</view>
</view>
<view class="desc">
<view>兑换说明:</view>
<view>
兑换说明 1请直接输入您获得的兑换码点击立即兑换即可
1请直接输入您获得的兑换码点击立即兑换即可
<br />
2兑换码为一次性兑换完成之后即失效
<br />
3兑换获得的奖励将直接发送至您的账号可直接前往余额或优惠券查看
<br />
4兑换码为赠品不可转赠不退不换
<br />
5兑换码需在有效期内完成兑换过期即作废
</view>
</view>
</view>
<confirmModal v-model="modal.confirm.show"></confirmModal>
<resultModal v-model="modal.result.show" :title="modal.result.title"></resultModal>
<confirmModal v-model="modal.confirm.show" :data="modal.confirm.data" @confirm="exchange"></confirmModal>
<resultModal
v-model="modal.result.show"
:title="modal.result.title"
></resultModal>
</view>
</template>
<script setup>
import { result } from "lodash";
import confirmModal from "./components/confirm.vue";
import resultModal from "./components/result.vue";
import { reactive } from "vue";
import * as exchangeApi from "@/common/api/market/exchange.js";
import { reactive, ref } from "vue";
const modal = reactive({
confirm: {
show: false,
},
result:{
show:true,
title:'该兑换码无效,请输入有效兑换码'
}
result: {
show: false,
title: "该兑换码无效,请输入有效兑换码",
},
});
const code = ref("");
function confirmExchange() {
if (code.value == "") {
uni.showToast({
title: "请输入兑换码",
icon: "none",
});
return;
}
exchangeApi.redemption({
code: code.value,
}).then((res) => {
if (res) {
modal.confirm.show = true;
modal.confirm.data = res;
}
})
}
function exchange() {
exchangeApi
.exchange({
code: code.value,
})
.then((res) => {
if (res) {
modal.result.title = "兑换成功!奖励已发放至您的账户";
modal.result.show = true;
code.value = "";
}
})
.catch((err) => {
console.log("err,", err);
modal.result.title = err.message || "该兑换码无效,请输入有效兑换码";
modal.result.show = true;
});
}
function back() {
uni.navigateBack();
}
@@ -115,7 +161,6 @@ function back() {
font-weight: 700;
}
.desc {
width: 662rpx;
color: #666666;
font-size: 24rpx;
font-weight: 400;

View File

@@ -270,10 +270,10 @@
return v;
});
tiaojian_menus = tiaojian_menus.filter(v => {
if (!state.isCostRewardPoints && v.name == '消费送积分') {
if (!res.memberLevel.isCostRewardPoints && v.name == '消费送积分') {
return false
}
if (!state.isCycleReward && v.name == '周期福利') {
if (!res.memberLevel.isCycleReward && v.name == '周期福利') {
return false
}
if (!res.memberLevel.cycleRewardCouponList || res.memberLevel.cycleRewardCouponList.length <=