|
|
@ -6,7 +6,7 @@ |
|
|
|
请选择您要发布的车辆类型: |
|
|
|
</view> |
|
|
|
<view class="se-flex se-flex-ai-c se-flex-ff-rw"> |
|
|
|
<view class="se-py-10 se-px-30 se-fs-22 se-br-10 se-mr-15 se-mt-10" :class="item.id==form.typeId ? 'se-bgc-green se-c-white se-b-green' : 'se-b se-c-text'" @click="handleCartype(item)" v-for="(item,index) in actions" :key="index"> |
|
|
|
<view v-if="item.name !='环卫设备及配件'" class="se-py-10 se-px-30 se-fs-22 se-br-10 se-mr-15 se-mt-10" :class="item.id==form.cartypeId ? 'se-bgc-green se-c-white se-b-green' : 'se-b se-c-text'" @click="handleCartype(item)" v-for="(item,index) in categoryList" :key="index"> |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -49,7 +49,7 @@ |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="价格" prop="price"> |
|
|
|
<u--input v-model="form.price" placeholder="请填写价格"></u--input> |
|
|
|
<div slot="right" class="se-c-green">¥</div> |
|
|
|
<div slot="right" class="se-c-green">¥ <text v-if="form.cartypeName=='租赁车辆'">/月</text> </div> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="库存" prop="inventory"> |
|
|
|
<u--input v-model="form.inventory" type="number" placeholder="请填写库存"></u--input> |
|
|
@ -141,11 +141,12 @@ |
|
|
|
</u--form> |
|
|
|
|
|
|
|
<u-datetime-picker |
|
|
|
:show="showDate" |
|
|
|
v-model="date" |
|
|
|
mode="date" |
|
|
|
@confirm="onConfirm" |
|
|
|
@cancel="onCancel" |
|
|
|
:maxDate="maxDate" |
|
|
|
:show="showDate" |
|
|
|
v-model="date" |
|
|
|
mode="date" |
|
|
|
@confirm="onConfirm" |
|
|
|
@cancel="onCancel" |
|
|
|
></u-datetime-picker> |
|
|
|
<u-action-sheet :actions="categoryOneList" @select="selectCategoryOneClick" title="分类" :show="categoryOneShow" @close="categoryOneShow=false"></u-action-sheet> |
|
|
|
<u-action-sheet :actions="categoryTwoList" @select="selectCategoryTwoClick" title="分类" :show="categoryTwoShow" @close="categoryTwoShow=false"></u-action-sheet> |
|
|
@ -153,7 +154,11 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { queryTypeList,addGoods,queryCategoryOneList,queryCategoryTwoList } from "@/common/api.js" |
|
|
|
const now = new Date(); |
|
|
|
const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime(); |
|
|
|
const startOfYesterday = startOfToday - 24 * 60 * 60 * 1000; |
|
|
|
|
|
|
|
import { queryTypeList,addGoods,queryCategoryOneList,queryCategoryTwoList,queryCategoryList } from "@/common/api.js" |
|
|
|
import QQMapWX from "@/util/qqmap-wx-jssdk.min.js" |
|
|
|
export default { |
|
|
|
components:{ |
|
|
@ -161,6 +166,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
maxDate:startOfYesterday, |
|
|
|
actions:[], |
|
|
|
showType:false, |
|
|
|
showDate:false, |
|
|
@ -169,77 +175,106 @@ |
|
|
|
categoryOneList:[], |
|
|
|
categoryTwoShow:false, |
|
|
|
categoryTwoList:[], |
|
|
|
categoryList:[],//分类 |
|
|
|
form: { |
|
|
|
// typeId:"",//类型 |
|
|
|
// cartypeId:"",//一级分类 |
|
|
|
// cartypeName:"",//一级分类名称 |
|
|
|
// categorytwoId:"",//二级分类 |
|
|
|
// categorytwoName:"",//二级分类名称 |
|
|
|
// goodsName:"驾驶式扫地机",//标题 |
|
|
|
// brand:"大众",//品牌 |
|
|
|
// model:"朗逸",//型号 |
|
|
|
// area:"湖南省长沙市岳麓区含光路658号",//区域 |
|
|
|
// latitude:"28.23586", |
|
|
|
// longitude:"112.931496", |
|
|
|
// address:'', |
|
|
|
// date:"2024-12-15",//时间 |
|
|
|
// mileage:"2000",//距离 |
|
|
|
// price:"210000",//价格 |
|
|
|
// inventory:"5",//库存 |
|
|
|
// contacts:"柳川",//联系人 |
|
|
|
// phone:"13189698115",//联系人电话 |
|
|
|
// views:"5",//浏览量 |
|
|
|
// fileCarList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片 |
|
|
|
// fileFrontList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片前 |
|
|
|
// fileBackList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片后 |
|
|
|
// fileLeftList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片左 |
|
|
|
// fileRightList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片右 |
|
|
|
// fileCabList:[ |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
// } |
|
|
|
// ],//车辆照片 驾驶室 |
|
|
|
// introduce:`车型名称:车辆的品牌和型号,例如 "Toyota Corolla 2024"。 |
|
|
|
// 车辆类型:轿车、SUV、MPV、皮卡、跑车等。 |
|
|
|
// 价格区间:可选项,适用于市场推广。`,//车辆介绍 |
|
|
|
|
|
|
|
typeId:"",//类型 |
|
|
|
typeName:"",//类型名称 |
|
|
|
cartypeId:"",//一级分类 |
|
|
|
cartypeName:"",//一级分类名称 |
|
|
|
categorytwoId:"",//二级分类 |
|
|
|
categorytwoName:"",//二级分类名称 |
|
|
|
goodsName:"驾驶式扫地机",//标题 |
|
|
|
brand:"大众",//品牌 |
|
|
|
model:"朗逸",//型号 |
|
|
|
area:"湖南省长沙市岳麓区含光路658号",//区域 |
|
|
|
latitude:"28.23586", |
|
|
|
longitude:"112.931496", |
|
|
|
goodsName:"",//标题 |
|
|
|
brand:"",//品牌 |
|
|
|
model:"",//型号 |
|
|
|
area:"",//区域 |
|
|
|
latitude:"", |
|
|
|
longitude:"", |
|
|
|
address:'', |
|
|
|
date:"2024-12-15",//时间 |
|
|
|
mileage:"2000",//距离 |
|
|
|
price:"210000",//价格 |
|
|
|
inventory:"5",//库存 |
|
|
|
contacts:"柳川",//联系人 |
|
|
|
phone:"13189698115",//联系人电话 |
|
|
|
views:"5",//浏览量 |
|
|
|
fileCarList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片 |
|
|
|
fileFrontList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片前 |
|
|
|
fileBackList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片后 |
|
|
|
fileLeftList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片左 |
|
|
|
fileRightList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片右 |
|
|
|
fileCabList:[ |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png" |
|
|
|
}, |
|
|
|
{ |
|
|
|
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png" |
|
|
|
} |
|
|
|
],//车辆照片 驾驶室 |
|
|
|
introduce:`车型名称:车辆的品牌和型号,例如 "Toyota Corolla 2024"。 |
|
|
|
车辆类型:轿车、SUV、MPV、皮卡、跑车等。 |
|
|
|
价格区间:可选项,适用于市场推广。`,//车辆介绍 |
|
|
|
date:"",//时间 |
|
|
|
mileage:"",//距离 |
|
|
|
price:"",//价格 |
|
|
|
inventory:"",//库存 |
|
|
|
contacts:"",//联系人 |
|
|
|
phone:"",//联系人电话 |
|
|
|
views:"",//浏览量 |
|
|
|
fileCarList:[],//车辆照片 |
|
|
|
fileFrontList:[],//车辆照片前 |
|
|
|
fileBackList:[],//车辆照片后 |
|
|
|
fileLeftList:[],//车辆照片左 |
|
|
|
fileRightList:[],//车辆照片右 |
|
|
|
fileCabList:[],//车辆照片 驾驶室 |
|
|
|
introduce:``,//车辆介绍 |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
typeId:[ |
|
|
@ -415,14 +450,30 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.onQueryTypeList() |
|
|
|
this.onQueryCategoryOneList() |
|
|
|
this.onQueryCategoryTwoList() |
|
|
|
// this.onQueryTypeList() |
|
|
|
// this.onQueryCategoryOneList() |
|
|
|
// this.onQueryCategoryTwoList() |
|
|
|
this.onQueryCategoryList() |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onQueryCategoryList(){ |
|
|
|
let that = this |
|
|
|
queryCategoryList({}).then(response=>{ |
|
|
|
console.info("queryCategoryList",response) |
|
|
|
if(response.result.length>0){ |
|
|
|
that.categoryList = response.result |
|
|
|
that.form.cartypeId = response.result[0].id |
|
|
|
that.form.cartypeName = response.result[0].name |
|
|
|
that.categoryTwoList = response.result[0].carrentCategorytwoList |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
handleCategoryOneChange(){ |
|
|
|
console.info('handleCategoryOneChange') |
|
|
|
this.categoryOneShow = true |
|
|
@ -519,14 +570,17 @@ |
|
|
|
// this.$refs.citySelectRef.open() |
|
|
|
}, |
|
|
|
handleCartype(event){ |
|
|
|
this.form.typeId = event.id |
|
|
|
this.form.cartypeId = event.id |
|
|
|
this.form.cartypeName = event.name |
|
|
|
this.categoryTwoList =event.carrentCategorytwoList |
|
|
|
this.form.categorytwoId = "" |
|
|
|
this.form.categorytwoName = "" |
|
|
|
}, |
|
|
|
// 照片 |
|
|
|
delCarFront(event) { |
|
|
|
this.form.fileCarList.splice(event.index, 1) |
|
|
|
}, |
|
|
|
async afterCarFront(e) { |
|
|
|
console.info("e",e) |
|
|
|
let self = this |
|
|
|
e.file.forEach(file => { |
|
|
|
self.$Oss.ossUpload(file.url).then(url => { |
|
|
@ -622,9 +676,9 @@ |
|
|
|
onAddGoods(){ |
|
|
|
let that = this |
|
|
|
let params={ |
|
|
|
// cartypeId:that.form.cartypeId, |
|
|
|
cartypeId:that.form.cartypeId, |
|
|
|
// categorytwoId:"1867040891523936258", |
|
|
|
cartypeId:that.form.typeId, |
|
|
|
// cartypeId:that.form.typeId, |
|
|
|
categorytwoId:that.form.categorytwoId, |
|
|
|
goodsName:that.form.goodsName,//商品名称 |
|
|
|
brand:that.form.brand,//品牌 |
|
|
@ -655,6 +709,11 @@ |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
uni.switchTab({ |
|
|
|
url:"/pages/home/index" |
|
|
|
}) |
|
|
|
},1500) |
|
|
|
}).catch(error=>{ |
|
|
|
|
|
|
|
}) |
|
|
|