二手车小程序
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('navbar.carinfo')"></uni-nav-bar>
|
||||
<view class="content">
|
||||
<view class="cont">{{$t('carinfo.mag')}}</view>
|
||||
<view class="">
|
||||
<textarea auto-height v-model="carinfo.condition_desc" :placeholder="$t('carinfo.maginput')"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot">
|
||||
<view>
|
||||
<button class="btn1" plain="true" @click="leftClick">{{$t('button.previous')}}</button>
|
||||
<button class="btn" @click="addFn">{{$t('button.submit')}}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { request,showToast } from '@/api/apiT.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:'',
|
||||
carinfo:{},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.id = options.id;
|
||||
const carinfo = uni.getStorageSync('newcarinfo');
|
||||
this.carinfo = JSON.parse(carinfo);
|
||||
this.carinfo .draft_id=this.id
|
||||
},
|
||||
methods: {
|
||||
leftClick(){
|
||||
uni.navigateBack({})
|
||||
},
|
||||
addFn(){
|
||||
console.log(this.carinfo)
|
||||
request({
|
||||
url:'vehicle/add',
|
||||
method:'post',
|
||||
data:this.carinfo
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
if(res.data.code ==0){
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/mine',// 替换为你要跳转的页面路径
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
textarea {
|
||||
min-height: 640rpx;// 设置默认高度 ,解决设置自适应高度之后高度无效问题
|
||||
width: 100%;
|
||||
}
|
||||
.content{
|
||||
margin: 20px 12px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10px;
|
||||
.cont{
|
||||
position: relative;
|
||||
font-weight: 500;
|
||||
}
|
||||
.cont::after{
|
||||
content : '';
|
||||
position : absolute;
|
||||
width : 200%;
|
||||
height : 200%;
|
||||
top : 0;
|
||||
left : 0;
|
||||
transform-origin: 0 0;
|
||||
border-width: 0;
|
||||
border-bottom-width:1px;
|
||||
border-style : solid;
|
||||
transform : scale(0.5, 0.5);
|
||||
border-radius : 1px;
|
||||
box-sizing : border-box;
|
||||
pointer-events : none;
|
||||
border-color:#C3C3C3;
|
||||
}
|
||||
}
|
||||
.content view{
|
||||
padding: 20px 10px;
|
||||
}
|
||||
.right{
|
||||
text-align: right;
|
||||
}
|
||||
.select{
|
||||
display: flex;
|
||||
}
|
||||
.caogao{
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
bottom: 280rpx;
|
||||
}
|
||||
.caogao image{
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
.foot{
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
.foot view{
|
||||
display: flex;
|
||||
width: 94%;
|
||||
margin: 15px 3%;
|
||||
}
|
||||
.btn{
|
||||
background-color: #3F435B;
|
||||
color: white;
|
||||
border-radius: 50px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: 2%;
|
||||
flex-grow:1
|
||||
}
|
||||
.btn1{
|
||||
border-color:#9E9E9E !important;
|
||||
border-radius: 50px;
|
||||
color: #414141;
|
||||
margin-bottom: 40px;
|
||||
width: 110px;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user