shop-applet/pages/product/addGood/addGood.vue

157 lines
3.4 KiB
Vue
Raw Normal View History

2023-11-15 18:21:56 +08:00
<template>
2024-04-17 18:02:49 +08:00
<view class='content'>
<u--form :model="model1" :rules="rules" ref="uForm" labelPosition="top"
:labelStyle="{fontWeight:'bold',fontSize:'32rpx'}" labelWidth='100'>
<u-form-item label="想卖什么" prop="userInfo.name" ref="item1">
<view class="borders">
<u--textarea v-model="model1.userInfo.name" placeholder="请描述您想卖的货品名称,如:红富士苹果、宁夏西瓜、梨。"></u--textarea>
2024-04-03 17:41:28 +08:00
</view>
2024-04-17 18:02:49 +08:00
</u-form-item>
<u-form-item label="上传商品图" prop="userInfo.name" ref="item1">
<uploadImgVideo></uploadImgVideo>
</u-form-item>
<u-form-item label="商品售价" prop="userInfo.name" ref="item1">
<view class="borders" style="width:250rpx;height: 100rpx;">
<u--input placeholder="" v-model="text"></u--input>
2024-04-03 17:41:28 +08:00
</view>
2024-04-17 18:02:49 +08:00
<text style="margin: 0 20rpx;"></text>
<uni-section type="line" style="width:250rpx;">
<uni-data-select v-model="text" :localdata="range" placeholder=""></uni-data-select>
</uni-section>
</u-form-item>
<view class="footer">
<view class="footer-top">
<text style="margin: 0 auto; ">
显示全部<u-icon style="display: inline-block;font-weight: bold;" color="$uni-newTheme-color"
name="arrow-right"></u-icon>
</text>
2024-04-03 17:41:28 +08:00
</view>
2024-04-17 18:02:49 +08:00
<view class="footer-bottom">
发布内容越详尽成单力越高
2024-04-03 17:41:28 +08:00
</view>
</view>
2023-11-18 19:04:13 +08:00
2024-04-17 18:02:49 +08:00
<view class="submit-btn">
<u-button text="立即发布获取订单" @click='goDetail' :class="{height:'200px'}" color="#33BB3C"></u-button>
2024-04-03 17:41:28 +08:00
</view>
2024-04-17 18:02:49 +08:00
</u--form>
2024-04-03 17:41:28 +08:00
</view>
2023-11-15 18:21:56 +08:00
</template>
<script>
2024-04-17 18:02:49 +08:00
import uploadImgVideo from "./components/uploadImgVideo.vue"
2024-04-03 17:41:28 +08:00
export default {
components: {
2024-04-17 18:02:49 +08:00
uploadImgVideo,
2024-04-03 17:41:28 +08:00
},
data() {
return {
2024-04-17 18:02:49 +08:00
showSex: false,
model1: {
userInfo: {
name: '',
sex: '',
},
2024-04-03 17:41:28 +08:00
},
2024-04-17 18:02:49 +08:00
range: [{
value: 0,
text: "篮球"
2024-04-03 17:41:28 +08:00
},
{
2024-04-17 18:02:49 +08:00
value: 1,
text: "足球"
},
{
value: 2,
text: "游泳"
},
2024-04-03 17:41:28 +08:00
],
2024-04-17 18:02:49 +08:00
text: "",
rules: {
// 'userInfo.name': {
// type: 'string',
// required: true,
// message: '请填写姓名',
// trigger: ['blur', 'change']
// },
// 'userInfo.sex': {
// type: 'string',
// max: 1,
// required: true,
// message: '请选择男或女',
// trigger: ['blur', 'change']
// },
2024-04-03 17:41:28 +08:00
},
2024-04-17 18:02:49 +08:00
radio: '',
switchVal: false
2024-04-03 17:41:28 +08:00
};
},
methods: {
2024-04-17 18:02:49 +08:00
sexSelect(e) {
this.model1.userInfo.sex = e.name
this.$refs.uForm.validateField('userInfo.sex')
2024-04-03 17:41:28 +08:00
},
2024-04-17 18:02:49 +08:00
goDetail() {
uni.navigateTo({
url: '/pages/product/addGoodDetail/addGoodDetail'
2024-04-03 17:41:28 +08:00
})
2024-04-17 18:02:49 +08:00
}
},
2024-04-17 18:02:49 +08:00
};
</script>
2023-11-18 19:04:13 +08:00
2024-04-17 18:02:49 +08:00
<style lang='scss'>
.content {
width: 100vw;
min-height: 100vh;
background-color: white;
box-sizing: border-box;
padding: 30rpx;
.borders {
width: 690rpx;
border: 1px solid #CECECE;
border-radius: 10rpx;
}
}
2024-04-08 16:42:44 +08:00
2024-04-17 18:02:49 +08:00
.footer {
position: absolute;
bottom: 270rpx;
left: 50%;
transform: translate(-50%, 0);
font-size: 28rpx;
.footer-top {
color: $uni-newTheme-color;
display: flex;
font-weight: bold;
align-items: center;
}
2024-04-08 16:42:44 +08:00
2024-04-17 18:02:49 +08:00
.footer-bottom {
font-size: 28rpx;
color: #989898;
2024-04-03 17:41:28 +08:00
}
2023-11-15 18:21:56 +08:00
2024-04-17 18:02:49 +08:00
}
2023-11-15 18:21:56 +08:00
2024-04-17 18:02:49 +08:00
.submit-btn {
position: absolute;
bottom: 86rpx;
left: 50%;
transform: translate(-50%, 0);
width: 670rpx;
border-radius: 40rpx;
overflow: hidden;
2024-04-03 17:41:28 +08:00
}
2023-11-15 18:21:56 +08:00
2024-04-17 18:02:49 +08:00
/deep/ .uni-select {
height: 100rpx;
border: 2rpx #CECECE solid;
2024-04-03 17:41:28 +08:00
}
2023-11-15 18:21:56 +08:00
</style>