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

优化

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