diff --git a/App.vue b/App.vue index 560e0bc..6151d7c 100644 --- a/App.vue +++ b/App.vue @@ -1,125 +1,132 @@ \ No newline at end of file diff --git a/api/property.js b/api/property.js index 5e316fa..e016efe 100644 --- a/api/property.js +++ b/api/property.js @@ -1,5 +1,5 @@ import oahttp from "@/utils/oahttp.js"; -import oahttp2 from "@/utils/logistics.js"; + // http://logistics.lihaink.cn/api/getCarHistory /** * 车辆列表 @@ -15,9 +15,9 @@ export const applycarApi = (data) => oahttp.post('/vehicle/rentApply', data) // 显示轨迹 export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) // 获取可购买车辆列表 -export const canBuyCarListApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) +export const canBuyCarListApi = (data) => oahttp.get('/vehicle/getFreeCars', data) // 购买车辆 -export const buyCarApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) +export const buyCarApi = (data) => oahttp.post('/vehicle/buyCars', data) // 当前车辆位置信息 // export const locusApi = (data) => oahttp.post('/vehicle/vehicleTrack', data) // api / getCarLocal diff --git a/config/app.js b/config/app.js index c573f3d..3bc16c6 100644 --- a/config/app.js +++ b/config/app.js @@ -1,7 +1,7 @@ let httpApiThree; let httpApi; // 总域名 let httpApiTwo; // 物流系统域名 -let httpApiTest + const env = 'dev'; // 开发 // const env = 'prod'; // 生产 @@ -22,7 +22,7 @@ switch (env) { httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境 - httpApiTest = 'http://192.168.1.11:8081' //测试环境 + //测试环境 } @@ -50,7 +50,7 @@ module.exports = { HTTP_REQUEST_URL: httpApi, HTTP_REQUEST_URL_THREE: httpApiThree, HTTP_REQUEST_URL_TWO: httpApiTwo, - httpApiTest: httpApiTest, + // #ifdef H5 //H5接口是浏览器地址 diff --git a/subpkg/property/agencyList.vue b/subpkg/property/agencyList.vue index 0699270..a607ffa 100644 --- a/subpkg/property/agencyList.vue +++ b/subpkg/property/agencyList.vue @@ -13,9 +13,15 @@ {{item.create_time.slice(0, 10)}} - + {{item.company_b_name}}提出租赁车辆一辆 + + {{item.company_b_name}}上传自有车辆一辆 + + + {{item.company_b_name}}提出解除租赁 + @@ -64,6 +70,10 @@ background-color: #FF7C32; color: white; padding: 0 10rpx; + font-size: 24rpx; + // line-height: rpx; + display: flex; + align-items: center; width: 200rpx; height: 50rpx; margin-right: 10rpx; diff --git a/subpkg/property/buyCar.vue b/subpkg/property/buyCar.vue index 4cccbac..0c0ebc8 100644 --- a/subpkg/property/buyCar.vue +++ b/subpkg/property/buyCar.vue @@ -13,29 +13,33 @@ - + - 车牌号: {{item.lincense}} + 车牌号: {{item.license}} - + + + 当前状态: 当前使用中 - - 当前状态: 平台公司闲置中 + + 当前状态: 闲置中 + - + - + 选择该车辆为监管车辆 @@ -55,12 +59,12 @@ - + - {{item.lincense}} + {{item.license}} - + @@ -86,53 +90,54 @@ queryCar: '', a: "https://tse3-mm.cn.bing.net/th/id/OIP-C.0xzWZj1_A-nzJiUBxrk8XQHaEo?w=298&h=186&c=7&r=0&o=5&pid=1.7", carList: [], - carListI: [{ - checked: [], - lincense: '川Y103D1' - }, { - checked: [], - lincense: '川Y103D6' - }, { - checked: [], - lincense: '川Y103D5' - }, { - checked: [], - lincense: '川Y103D4' - }, { - checked: [], - lincense: '川Y103D3' - }, { - checked: [], - lincense: '川Y103D2' - }], + carListI: [], showPop: false, - carCheckeList: [1, 1, 1, 1, 1, 1, 1, 1], + carCheckeList: [], carCheckedArr: [] } }, methods: { buyCarFn() { + + if (this.carCheckedArr.length == 0) { Toast("请先选择车辆!") return } - // buyCarApi({}).then(res => { - // Toast("购买成功!") - // setTimeout(() => { - // uni.navigateTo({ - // url: '/subpkg/property/index' - // }) - // }, 500) - // }) - uni.navigateTo({ - url: '/subpkg/property/index' + let data = [] + this.carList.forEach(item => { + this.carCheckedArr.forEach(items => { + if (item.id == items) { + data.push({ + id: item.id, + license: item.license + }) + } + }) }) + let datas = JSON.stringify(data) + + buyCarApi({ + cars: datas + }).then(res => { + Toast("申请成功!") + setTimeout(() => { + uni.redirectTo({ + url: '/subpkg/property/index' + }) + }, 1000) + + }) + // uni.navigateTo({ + // url: '/subpkg/property/index' + // }) }, queryCarFn() { this.carList = [] this.carListI.forEach(item => { - if (item.lincense.includes(this.queryCar)) { + // console.log(item.license) + if (item.license.includes(this.queryCar)) { this.carList.push(item) } }) @@ -147,11 +152,11 @@ } else { this.carCheckedArr.push(i) } - // console.log(this.carCheckedArr) + console.log(this.carCheckedArr) }, popChange(index) { this.checkboxChange(index) - console.log(this.carCheckedArr) + // console.log(this.carCheckedArr) }, close() { this.showPop = false @@ -165,11 +170,18 @@ } }, - onLoad() { - // canBuyCarListApi({}).then(res => { - // this.carListI = res.data - // }) - this.carList = Array.from(this.carListI); + onLoad(option) { + // console.log(option.license) + canBuyCarListApi().then(res => { + res.data.forEach(item => { + if (item.license == option.license) { + item.flag = true + } + }) + + this.carListI = res.data + this.carList = Array.from(this.carListI); + }) } @@ -185,7 +197,6 @@ padding: 20rpx; background-color: #fff; - // padding-bottom: 200rpx; .car-info { display: flex; justify-content: space-between; @@ -220,7 +231,7 @@ // margin-right: 30rpx; width: 182.5rpx; display: flex; - // justify-content: ; + // justify-tent: ; flex-direction: column; align-items: center; position: relative; @@ -238,7 +249,7 @@ height: 100rpx; position: fixed; bottom: 0; - z-index: 1000000; + z-index: 1000; width: 100vw; box-sizing: border-box; border-radius: 30rpx 30rpx 0 0; diff --git a/subpkg/property/chosseCompany.vue b/subpkg/property/chosseCompany.vue index 0212da2..5df8813 100644 --- a/subpkg/property/chosseCompany.vue +++ b/subpkg/property/chosseCompany.vue @@ -46,12 +46,12 @@ 自有车辆 - + - + - 车牌号:{{dataList.cars_info.license}} + 车牌号:{{item.license}} @@ -133,7 +133,7 @@ {{typeFn( dataList.type) }} - {{'2023-03-03'}} + {{dataList.update_time}} @@ -202,11 +202,11 @@ this.dataList = res.data.vehicleContract this.carList = res.data.vehicleRentCars this.checked = [this.carList[0]?.car_id] || '' - this.dataList.cars_info = JSON.parse(this.dataList.cars_info) || "" + // if (this.dataList.status == 3) { // uni.navigateBack() // } - console.log(this.dataList.cars_info.pic) + if (this.carList.length > 0 || this.dataList.cars_info) { this.flag1 = false } @@ -244,7 +244,7 @@ return "租赁合同" } if (status == 1) { - return "自有车两" + return "自有车辆" } if (status == 2) { "解除合同" diff --git a/subpkg/property/contractList.vue b/subpkg/property/contractList.vue index 67c5842..4d472f7 100644 --- a/subpkg/property/contractList.vue +++ b/subpkg/property/contractList.vue @@ -30,7 +30,7 @@ export default { data() { return { - datasList: [1, 2, 3], + datasList: [], } }, onLoad() { diff --git a/subpkg/property/index.vue b/subpkg/property/index.vue index 8c719cc..e0e6077 100644 --- a/subpkg/property/index.vue +++ b/subpkg/property/index.vue @@ -4,6 +4,7 @@ + @@ -43,7 +44,7 @@ - 上传头像 + 上传车辆图片 @@ -59,8 +60,6 @@ - - @@ -77,6 +76,7 @@ ... + @@ -85,11 +85,10 @@ - + 您的购车申请已经提交,我们正在加快审核中,请耐心等待,在此期间您可以继续使用车辆完成配送任务哦~ ... - @@ -106,16 +105,16 @@ + + - - - + @@ -139,7 +138,7 @@ - 上传头像 + 上传车辆图片 @@ -213,7 +212,6 @@ - @@ -309,7 +307,7 @@ leaseApi, upVehicleApi, getAgencyDetailApi, - getvehicleDetailApi, + // getvehicleDetailApi, villageCompanyApi, } from "@/api/property.js" @@ -352,7 +350,7 @@ }, onLoad() { - this.initIndex() + // this.initIndex() setTimeout(() => { this.flag = true }) @@ -368,21 +366,27 @@ methods: { // 初始化页面 initIndex() { - let type = (JSON.parse(Cache.get("USER_INFO")).company.company_type) + let type = this.$store.state.app.userInfo.company.company_type + this.company_type = type // 小组公司 if (type == 18) { villageCompanyApi().then(res => { this.showLoading = false this.datas = res.data - this.step = res.data?.status || 9999 + console.log(res.data?.id) + if (res.data?.id) { + this.step = res.data?.status + } else { + this.step = 9999 + + } if (this.step == 3) { uni.redirectTo({ url: `/subpkg/property/vehicle_a?id=${res.data.cars_info.id}` }) } }) - } // 镇街公司 else { @@ -441,7 +445,6 @@ }) }, 2000) }) - this.show = false this.noInfo = false diff --git a/subpkg/property/vehicle_a.vue b/subpkg/property/vehicle_a.vue index 9bcc7ab..b21fa64 100644 --- a/subpkg/property/vehicle_a.vue +++ b/subpkg/property/vehicle_a.vue @@ -24,7 +24,9 @@ 行驶总里程: {{datas.mileage}} - 自有车辆 + 购买车辆 + 租赁车辆 + 自有车辆 承租公司: @@ -68,7 +70,9 @@ - 《租赁合同》 + 《租赁合同》 + 《自有车辆合同》 + 《购车合同》 {{ datas.create_time}} @@ -85,7 +89,8 @@ - + @@ -173,6 +178,11 @@ url }) }, + navTo2(url) { + uni.redirectTo({ + url + }) + }, // 计算到期时间 overDateFn(date) { var specifiedDate = new Date(date); @@ -218,7 +228,7 @@ end_time: `${this.queryData} 23:59:59`, start_time: `${this.queryData} 00:00:00`, }).then(res => { - console.log(res.data) + // console.log(res.data) this.markers[0].latitude = res.data[0].latitude this.markers[0].longitude = res.data[0].longitude this.polyline = [{