This commit is contained in:
zmj 2024-05-08 19:18:54 +08:00
parent 0c6e085b65
commit 765f13eea4
5 changed files with 50 additions and 16 deletions

View File

@ -67,7 +67,6 @@
auto_arrival: 0, auto_arrival: 0,
mer_location: 0, mer_location: 0,
statusBarHeight: 0, statusBarHeight: 0,
mer_location: 0,
store_street_theme: 1, store_street_theme: 1,
sys_intention_agree: '', sys_intention_agree: '',
copyright_status: '', copyright_status: '',

View File

@ -146,6 +146,7 @@
height: 76rpx; height: 76rpx;
border: 1px solid white; border: 1px solid white;
border-radius: 38rpx; border-radius: 38rpx;
background: rgba(255, 255, 255, 0.4);
} }
.next-btn-text { .next-btn-text {

View File

@ -4,7 +4,7 @@
<view class="card" style="height: 300rpx;" <view class="card" style="height: 300rpx;"
@click="navgo(`/pages/product/addGoodDetail/goodsSearch?mer_id=${mer_id}&&type=simple&&formData=${JSON.stringify(formData)}`)"> @click="navgo(`/pages/product/addGoodDetail/goodsSearch?mer_id=${mer_id}&&type=simple&&formData=${JSON.stringify(formData)}`)">
<u-form-item label="想卖什么" prop="title"> <u-form-item label="想卖什么" prop="title">
<text slot='right' style="font-size:28rpx ; color:#989898 ;">{{value1.length}}/{{maxLength}}</text> <text slot='right' style="font-size:28rpx ; color:#989898 ;">{{cateLength}}/{{maxLength}}</text>
</u-form-item> </u-form-item>
<u-line></u-line> <u-line></u-line>
<u--textarea v-model="formData.cate_name" placeholder="请输入内容" :autoHeight='true' <u--textarea v-model="formData.cate_name" placeholder="请输入内容" :autoHeight='true'
@ -60,9 +60,9 @@
</view> </view>
<view class="card"> <view class="card">
<u-form-item label="规格与价格" prop="userInfo.name" ref="item1" border-bottom> <u-form-item label="价格与库存" prop="userInfo.name" ref="item1" border-bottom>
</u-form-item> </u-form-item>
<u-form-item label="计量单位" prop="userInfo.name" ref="item1" border-bottom> <u-form-item label="计量单位" prop="formData.unit_name" ref="item1" border-bottom>
<view style="display: flex;" slot='right' @click='showPouple=true'> <view style="display: flex;" slot='right' @click='showPouple=true'>
<view style="margin-right: 10rpx;line-height: 25rpx;color:#777777"> <view style="margin-right: 10rpx;line-height: 25rpx;color:#777777">
{{formData.attrValue[0].unit_name ||'请选择'}} {{formData.attrValue[0].unit_name ||'请选择'}}
@ -70,17 +70,17 @@
<u-icon name="arrow-right" style="margin-right: 30rpx;"></u-icon> <u-icon name="arrow-right" style="margin-right: 30rpx;"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="零售价格" prop="userInfo.name" ref="item1" border-bottom> <u-form-item label="零售价格" prop="formData.price" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;" <u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入零售价" type='number' @blur='fixed2(1)' v-model="formData.attrValue[0].price" placeholder="请输入零售价" type='number' @blur='fixed2(1)' v-model="formData.attrValue[0].price"
slot='right'></u--input> slot='right'></u--input>
</u-form-item> </u-form-item>
<u-form-item v-if='isWholeSale' label="批发价格" prop="userInfo.name" ref="item1" border-bottom> <u-form-item v-if='isWholeSale' label="批发价格" prop="formData.wholesale_price" ref="item1" border-bottom>
<u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;" <u--input inputAlign='right' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入批发价格" @blur='fixed2(2)' type='number' placeholder="请输入批发价格" @blur='fixed2(2)' type='number'
v-model="formData.attrValue[0].wholesale_price" slot='right'></u--input> v-model="formData.attrValue[0].wholesale_price" slot='right'></u--input>
</u-form-item> </u-form-item>
<u-form-item label="商品库存" prop="userInfo.name" ref="item1"> <u-form-item label="商品库存" prop="formData.stock" ref="item1">
<u--input inputAlign='right' type='number' placeholderStyle="color:#777777" style="width: 300rpx;" <u--input inputAlign='right' type='number' placeholderStyle="color:#777777" style="width: 300rpx;"
placeholder="请输入库存" v-model="formData.attrValue[0].stock" slot='right'></u--input> placeholder="请输入库存" v-model="formData.attrValue[0].stock" slot='right'></u--input>
</u-form-item> </u-form-item>
@ -167,6 +167,12 @@
components: { components: {
uploadImgVideo, uploadImgVideo,
}, },
computed: {
cateLength() {
return this.formData.cate_name?.length || 0
}
},
data() { data() {
return { return {
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast', coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
@ -285,7 +291,35 @@
}, },
message: '请至少上传2张图片', message: '请至少上传2张图片',
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
}] }],
"formData.unit_name": [{
validator: (rule, value, callback) => {
return Boolean(this.formData.attrValue[0].unit_name)
},
message: '请选择计量单位',
trigger: ['change', 'blur'],
}],
"formData.price": [{
validator: (rule, value, callback) => {
return Boolean(this.formData.attrValue[0].price)
},
message: '请输入零售价格',
trigger: ['change', 'blur'],
}],
"formData.wholesale_price": [{
validator: (rule, value, callback) => {
return Boolean(this.formData.attrValue[0].wholesale_price)
},
message: '请输入批发价格',
trigger: ['change', 'blur'],
}],
"formData.stock": [{
validator: (rule, value, callback) => {
return Boolean(this.formData.attrValue[0].stock)
},
message: '请输入库存',
trigger: ['change', 'blur'],
}],
}, },
}; };
@ -463,10 +497,12 @@
}, },
async submit() { async submit() {
this.$refs.formData.validate().then(res => { this.$refs.formData.validate().then(res => {
// console.log(res)
// return
this.handAdd() this.handAdd()
}).catch(errors => { }).catch(errors => {
console.log(errors) console.log('err', errors)
uni.$u.toast(errors[0].message) // uni.$u.toast(errors[0].message)
}) })
} }

View File

@ -70,7 +70,6 @@
<view style="flex: 1;text-align: center;" @click="editGoods(item)"> <view style="flex: 1;text-align: center;" @click="editGoods(item)">
编辑商品 编辑商品
</view> </view>
</view> </view>
<view class="card-footer" v-if='where.type==1'> <view class="card-footer" v-if='where.type==1'>
<view class="card-footer-li" style="flex: 1.5;"> <view class="card-footer-li" style="flex: 1.5;">
@ -965,7 +964,8 @@
.card { .card {
width: 718rpx; width: 718rpx;
height: 410rpx; padding-bottom: 20rpx;
// height: 410rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 16rpx; border-radius: 16rpx;
background-color: #fff; background-color: #fff;
@ -1006,13 +1006,11 @@
height: 74rpx; height: 74rpx;
border-radius: 0 0 16rpx 16rpx; border-radius: 0 0 16rpx 16rpx;
background-color: #FFF1EC; background-color: #FFF1EC;
position: absolute;
bottom: 0;
display: flex; display: flex;
// justify-content: space-around;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
color: #777777; color: #777777;
transform: translateY(20rpx);
.card-footer-li { .card-footer-li {
text-align: center; text-align: center;

View File

@ -154,7 +154,7 @@
height: 76rpx; height: 76rpx;
border: 1px solid white; border: 1px solid white;
border-radius: 38rpx; border-radius: 38rpx;
background-color: #939394; background: rgba(255, 255, 255, 0.4);
} }
.next-btn-text { .next-btn-text {