This commit is contained in:
@@ -3,16 +3,11 @@
|
||||
<view v-if="list.length > 0">
|
||||
<nut-cell-group v-for="(itm, idx) in list" :key="idx">
|
||||
<nut-cell>
|
||||
<nut-checkbox
|
||||
v-model="itm.state.checkbox"
|
||||
:indeterminate="itm.state.indeterminate"
|
||||
@change="(val: boolean) => changeBoxAll(val, idx)"
|
||||
>{{ itm.StoreName }}
|
||||
<nut-checkbox v-model="itm.state.checkbox" :indeterminate="itm.state.indeterminate"
|
||||
@change="(val: boolean) => changeBoxAll(val, idx)">{{ itm.StoreName }}
|
||||
</nut-checkbox>
|
||||
</nut-cell>
|
||||
<nut-checkbox-group
|
||||
v-model="itm.state.checkboxgroup"
|
||||
:ref="el => getGroup(el, idx)"
|
||||
<nut-checkbox-group v-model="itm.state.checkboxgroup" :ref="el => getGroup(el, idx)"
|
||||
@change="label => changeBox(label, itm)">
|
||||
<nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1">
|
||||
<nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox>
|
||||
@@ -22,16 +17,13 @@
|
||||
<view class="center">
|
||||
<view>{{ item.name }}</view>
|
||||
<view class="price">
|
||||
<view>{{ item.price }} 元</view>
|
||||
<view>{{ item.exchange }} 积分</view>
|
||||
<view>{{ item.price }}元
|
||||
<text v-if="item.discount_integral > 0">+{{ item.discount_integral }}积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-input-number
|
||||
v-model="item.number"
|
||||
readonly
|
||||
:min="-1"
|
||||
@add.stop="() => onAdd(item)"
|
||||
<nut-input-number v-model="item.number" readonly :min="-1" @add.stop="() => onAdd(item)"
|
||||
@reduce.stop="() => onReduce(item)" />
|
||||
</view>
|
||||
</nut-cell>
|
||||
@@ -50,36 +42,26 @@
|
||||
<view>
|
||||
<view class="text-box">
|
||||
总金额:
|
||||
<nut-price
|
||||
v-model:price="localCount.price"
|
||||
size="normal"
|
||||
:need-symbol="false" />
|
||||
<nut-price v-model:price="localCount.price" size="normal" :need-symbol="false" />
|
||||
</view>
|
||||
<view class="text-box">
|
||||
总积分:
|
||||
<nut-price
|
||||
v-model:price="localCount.exchange"
|
||||
size="normal"
|
||||
:need-symbol="false" />
|
||||
<nut-price v-model:price="localCount.exchange" size="normal" :need-symbol="false" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-button type="primary" @click="sub">去结算</nut-button>
|
||||
</view>
|
||||
<!-- 支付 -->
|
||||
<Pay
|
||||
:is-show-pay="isShowPay"
|
||||
:interval="true"
|
||||
v-model:jfInfo="orderData"
|
||||
@closePay="closePay" />
|
||||
<Pay :is-show-pay="isShowPay" :interval="true" v-model:jfInfo="orderData" @closePay="closePay" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {nextTick, ref} from 'vue';
|
||||
import { nextTick, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {addCart, getAllCart} from '@/api/cart';
|
||||
import {createActiveOrder} from '@/api/goods';
|
||||
import { addCart, getAllCart } from '@/api/cart';
|
||||
import { createActiveOrder } from '@/api/goods';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
|
||||
interface CardList {
|
||||
@@ -90,6 +72,8 @@ interface CardList {
|
||||
number: string;
|
||||
price: number;
|
||||
exchange: number;
|
||||
pay_price: number;
|
||||
discount_integral: number;
|
||||
}
|
||||
|
||||
// const selectAllVal = ref(false);
|
||||
@@ -139,7 +123,7 @@ const changeBox = (label: string[], item: any) => {
|
||||
item.Goods.forEach((itm: any) => {
|
||||
if (itm.gid === id) {
|
||||
item['Count'].priceCount += itm.price;
|
||||
item['Count'].exchangeCount += itm.exchange;
|
||||
item['Count'].exchangeCount += itm.discount_integral;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -200,7 +184,7 @@ const sub = async () => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const {data: res} = await createActiveOrder({
|
||||
const { data: res } = await createActiveOrder({
|
||||
Bid: arr.map((item: any) => item.StoreBid),
|
||||
});
|
||||
if (res.oid) {
|
||||
|
||||
Reference in New Issue
Block a user