订单结算修改,增加限时折扣
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user