提交 8c65f22b authored 作者: 刘旭's avatar 刘旭

优化

上级 b7f30a93
......@@ -10,13 +10,16 @@
<view v-if="cartList.length > 0" style="width: 100%; display:flex; margin-top: 10rpx;">
<u-checkbox-group @change="checkboxGroupChange" style="width: 100%; display:flex">
<block v-for="(item, index) in cartList" :key="item.id">
<view class="group-item">
<view class="item">
<view v-if="item.isSubmit" class="group-item">
<u-row class="item">
<u-col :span="1">
<u-checkbox
:name="item.id"
v-model="item.checked"
shape="circle"
></u-checkbox>
</u-col>
<u-col :span="3">
<u-image
v-if="type === 0"
width="140rpx"
......@@ -28,9 +31,13 @@
"
class="img"
></u-image>
<view class="details">
</u-col>
<u-col :span="delCircle ? 7 : 5" class="details">
<view>{{ item.goodsName }}</view>
<view class="b-tag">
<view
class="b-tag"
:style="delCircle ? 'margin-bottom: 26%;' : 'margin-bottom: 40%;'"
>
<block
v-for="(item1, index1) in item.specifications?.length"
:key="index1"
......@@ -43,13 +50,14 @@
/>
</block>
</view>
<!-- <view style="font-weight: bold;">¥{{ item.price }}</view> -->
</view>
</view>
<view v-if="delCircle" class="circle" @tap="deleteCart(index)">
</u-col>
<u-col v-if="delCircle" :span="1">
<view class="circle" @tap="deleteCart(index)">
<view class="horizontal"></view>
</view>
<view v-else class="number-box">
</u-col>
<u-col v-else :span="3" style="margin-top: 20%;">
<view class="number-box">
<u-number-box
v-model="item.number"
:min="1"
......@@ -57,6 +65,49 @@
@change="valChange($event, item)"
></u-number-box>
</view>
</u-col>
</u-row>
</view>
<!-- 失效商品数据 -->
<view v-else class="group-item">
<view class="item">
<u-row>
<u-col :span="1">
<u-checkbox
:name="item.id"
:disabled="!item.isSubmit && !delCircle"
v-model="item.checked"
shape="circle"
></u-checkbox>
</u-col>
<u-col :span="3">
<u-image
v-if="type === 0"
width="140rpx"
height="200rpx"
:src="
item.picUrl?.split('http').length > 1
? item.picUrl
: baseUrl + item.picUrl
"
class="img"
></u-image>
</u-col>
<u-col :span="7">
<view class="details">
<view>{{ item.goodsName }}</view>
<view style="color: #ccc; margin-top: 20%;">
{{ item.message }}
</view>
</view>
</u-col>
<u-col :span="1">
<view v-if="delCircle" class="circle" @tap="deleteCart(index)">
<view class="horizontal"></view>
</view>
</u-col>
</u-row>
</view>
</view>
</block>
</u-checkbox-group>
......@@ -350,29 +401,21 @@ onShow(() => {
<style lang="scss" scoped>
.group-item {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15rpx;
margin-bottom: 10rpx;
background-color: #fff;
.item {
display: flex;
justify-content: flex-start;
.details {
width: 55%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: self-start !important;
margin-left: 20rpx;
.b-tag {
display: flex;
flex-direction: row;
margin-bottom: 40%;
flex-wrap: wrap;
}
}
}
.circle {
position: relative;
display: inline-block;
......@@ -397,7 +440,6 @@ onShow(() => {
display: flex;
flex-direction: column;
justify-content: flex-end;
margin-top: 20%;
}
}
......
......@@ -161,8 +161,7 @@ let rules = ref({
}],
deliveryAddr: [{ required: true, message: '请选择收货地址', trigger: 'blur' }],
deliveryDate: [{ required: true, message: '请选择交货时间', trigger: 'blur' },
{pattern: /^[1-9]\d*|0$/, message: '不能为负数', trigger: 'blur'},
{type: 'integer', message: '不能为小数', trigger: 'blur'}],
{ pattern: /^[+]{0,1}(\d+)$/g, message: '必须为正整数', trigger: 'blur' }],
noOrder: [{ required: true, message: '请输入订单号', trigger: 'blur' }],
pay: [{ required: true, message: '请输入付款方式', trigger: 'blur' }],
guarantee: [{ required: true, message: '请输入保修', trigger: 'blur' }],
......@@ -171,9 +170,9 @@ let rules = ref({
});
let guaranteeList = ref([
{value: '1年', label: '1年'},
{value: '2年', label: '2年'},
{value: '其他', label: '其他'}
{ value: '1年', label: '1年' },
{ value: '2年', label: '2年' },
{ value: '其他', label: '其他' }
])
let uFormRef = ref();
......@@ -192,12 +191,6 @@ onReady(() => {
uFormRef.value?.setRules(rules.value);
})
// 打开单价popup
// let fillIn = () => {
// if(!quotationData.value.items) return
// orderRef.value.form = quotationData.value.items
// orderRef.value.show = true
// }
let submit = () => {
uFormRef.value?.validate((valid: any, err: any) => {
......@@ -214,7 +207,6 @@ let submit = () => {
items: quotationData.value.items,
quotation: formData.value,
};
console.log(data, 'submit');
fillQuotation(data).then((res: any) => {
if (res.data.code === 200) showModel.value = true
});
......@@ -246,7 +238,7 @@ let modelConfirm = () => {
// 点击取消按钮
let modelCancel = () => {
uni.redirectTo({
uni.reLaunch({
url: './editQuotation?orderId=' + orderId.value
})
}
......@@ -291,6 +283,7 @@ let initQuotation = (orderId: number) => {
let initQuotationOrder = (orderId: number) => {
quotationOrder({ orderId }).then((res: any) => {
if(res.data.data) {
// res.data.data.id = null
formData.value = res.data.data
}
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论