增加商品券选择判断限制
This commit is contained in:
@@ -45,15 +45,22 @@
|
||||
|
||||
<template v-if="myQuan.types.sel==1">
|
||||
<view class="" @click="changeProductCoupon(item)" v-for="(item,index) in myQuan.res.productCoupon"
|
||||
:class="{filtergray:item.status}" :key="index">
|
||||
<view class="quan goods u-row-between u-flex u-col-center u-m-b-32 border-r-10 ">
|
||||
:class="{filtergray:!item.use}" :key="index"
|
||||
>
|
||||
<view class="quan goods u-row-between u-flex u-col-center u-m-b-32 border-r-10 u-relative" >
|
||||
<view class="no-use" v-if="!item.use">
|
||||
<image class="img" src="/pagesOrder/static/image/no-use.svg" mode=""></image>
|
||||
</view>
|
||||
<view class="sel u-abso" v-if="item.checked">
|
||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||
</view>
|
||||
<view class="u-p-t-32 u-p-b-32 u-p-l-24 u-p-r-24">
|
||||
<view class="u-flex">
|
||||
<up-image width="80rpx" height="80rpx" :src="item.productCover"></up-image>
|
||||
<view class="u-m-l-18">{{item.productName}}</view>
|
||||
<view class="u-m-l-18">
|
||||
<view class="u-m-l-18">{{item.productName}}</view>
|
||||
<view class="u-m-l-18 u-m-t-10 u-font-24 color-666">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" u-m-t-14 u-flex">
|
||||
<view>有效期:</view>
|
||||
@@ -64,6 +71,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="right u-flex u-flex-col u-col-bottom u-row-center">
|
||||
<view class="u-flex u-row-center w-full">
|
||||
<view class="color-red font-bold u-m-b-24 ">¥{{item.discountAmount}}</view>
|
||||
</view>
|
||||
<view class="u-flex ">
|
||||
<view class="use-btn" @click.stop="toEmitChooseQuan(item)">去使用</view>
|
||||
</view>
|
||||
@@ -112,12 +122,17 @@
|
||||
import {
|
||||
$activateByOrderId
|
||||
} from '@/http/yskApi/Instead.js'
|
||||
import {
|
||||
queryAllShopUser
|
||||
} from '@/http/yskApi/shop-user.js'
|
||||
import {returnNewGoodsList,returnCoupCanUse,returnProductCoupon} from '../quan_util.js'
|
||||
function back(){
|
||||
uni.navigateBack()
|
||||
}
|
||||
let order=ref({
|
||||
|
||||
})
|
||||
let canDikouGoodsArr=[]
|
||||
const myQuan = reactive({
|
||||
fullReductionCouponSel: {
|
||||
id: ''
|
||||
@@ -136,7 +151,16 @@
|
||||
})
|
||||
|
||||
function changeProductCoupon(item) {
|
||||
if(!item.use){
|
||||
return
|
||||
}
|
||||
item.checked = !item.checked
|
||||
const CheckedArr=myQuan.res.productCoupon.filter(v=>v.checked)
|
||||
const noCheckedArr=myQuan.res.productCoupon.filter(v=>!v.checked)
|
||||
noCheckedArr.map(v=>{
|
||||
console.log(returnCoupCanUse(canDikouGoodsArr,v,CheckedArr));
|
||||
v.use=returnCoupCanUse(canDikouGoodsArr,v,CheckedArr)
|
||||
})
|
||||
}
|
||||
|
||||
function changeFullReductionCouponSel(item) {
|
||||
@@ -150,15 +174,28 @@
|
||||
function toUse(item) {
|
||||
|
||||
}
|
||||
|
||||
let user=reactive({
|
||||
isVip:false
|
||||
})
|
||||
async function getQuan() {
|
||||
order.value=await orderApi.tbOrderInfoDetail(option.orderId)
|
||||
if(order.value.memberId){
|
||||
const userRes= await queryAllShopUser({
|
||||
id: order.value.memberId
|
||||
})
|
||||
if (userRes.content[0]) {
|
||||
user.value = userRes.content[0]
|
||||
}
|
||||
}
|
||||
|
||||
console.log(order.value);
|
||||
const res = await $activateByOrderId(option)
|
||||
canDikouGoodsArr=returnNewGoodsList(order.value.detailList||[])
|
||||
res.fullReductionCoupon = res.fullReductionCoupon.filter((v) => !v.use)
|
||||
res.productCoupon = res.productCoupon.filter((v) => !v.use).map(v => {
|
||||
res.productCoupon = res.productCoupon.map(v => {
|
||||
const calcCoup=returnProductCoupon(v,canDikouGoodsArr,user.value)
|
||||
return {
|
||||
...v,
|
||||
...calcCoup,
|
||||
checked: false
|
||||
}
|
||||
});
|
||||
@@ -201,7 +238,21 @@
|
||||
<style lang="scss" scoped>
|
||||
// $quan-color:rgb(233, 77, 60);
|
||||
$quan-color: #318AFE;
|
||||
|
||||
.no-use{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.img{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
.fixed-b {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
Reference in New Issue
Block a user