| | |
| | | <view class="list-item-row"> |
| | | <view class="list-item-row-label">运输重量/数量<b>*</b></view> |
| | | <view class="list-item-row-val"> |
| | | <input type="text" v-model="form.transportNum" placeholder="请输入" /> |
| | | <text @click="show4 = true">{{form.transportUnit}}</text> |
| | | <u-icon name="arrow-down" color="#111111" size="16"></u-icon> |
| | | <input type="text" style="flex: 1;" v-model="form.transportNum" placeholder="请输入" /> |
| | | <view @click="show4 = true" style="width: 100rpx; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end;"> |
| | | <text>{{form.transportUnit}}</text> |
| | | <u-icon name="arrow-down" color="#111111" size="16"></u-icon> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="list-item-row" v-if="viewStatus"> |
| | |
| | | <text>费用</text> |
| | | </view> |
| | | <view class="list-item-cate"> |
| | | <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">按天付费</view> |
| | | <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">{{item.name}}</view> |
| | | </view> |
| | | <view class="list-item-row"> |
| | | <view class="list-item-row-label">天数</view> |
| | |
| | | <view class="list-item-row"> |
| | | <view class="list-item-row-label">费用标准<b>*</b></view> |
| | | <view class="list-item-row-val"> |
| | | <input type="number" @blur="getPrice" v-model="form.price" placeholder="请输入" /> |
| | | <input type="digit" @blur="getPrice" v-model="form.price" placeholder="请输入" /> |
| | | <text>{{form.priceUnit}}</text> |
| | | </view> |
| | | </view> |
| | |
| | | <u-calendar |
| | | :show="show2" |
| | | color="#00BC12" |
| | | :allowSameDay="true" |
| | | mode="range" |
| | | @close="show2 = false" |
| | | @confirm="confirmDate" /> |
| | |
| | | ], |
| | | dw: [['个', '斤']], |
| | | carArr: [], |
| | | viewStatus: false |
| | | viewStatus: true |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | this.$u.api.getDetail({ |
| | | orderId: option.id |
| | | }).then(res => { |
| | | this.info = res.data |
| | | for (const key in this.form) { |
| | | this.form[key] = res.data[key] |
| | | } |
| | | this.form.price = Number(this.form.price) / 100 |
| | | if (!this.form.multifileList) { |
| | | this.form.multifileList = [] |
| | | } |
| | | if (!this.form.wayInfoDTOList) { |
| | | this.form.wayInfoDTOList = [] |
| | | if (res.code === 200) { |
| | | this.info = res.data |
| | | for (const key in this.form) { |
| | | this.form[key] = res.data[key] |
| | | } |
| | | this.form.price = Number(this.form.price) / 100 |
| | | if (!this.form.multifileList) { |
| | | this.form.multifileList = [] |
| | | } |
| | | if (!this.form.wayInfoDTOList) { |
| | | this.form.wayInfoDTOList = [] |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | | const res = uni.getStorageSync('carData'); |
| | | console.log(res) |
| | | this.form.linkPhone = this.userInfo.telephone |
| | | this.form.linkName = this.userInfo.name |
| | | this.form.startDate = res.startDate |
| | | this.form.endDate = res.endDate |
| | | this.form.lat = res.lat |
| | |
| | | this.getCategoryLists() |
| | | }, |
| | | methods: { |
| | | handleInputPrice(e) { |
| | | try{ |
| | | this.form.price = Number(this.form.price).toFixed(3) |
| | | }catch(e){ |
| | | this.form.price =null |
| | | } |
| | | }, |
| | | confirmDw(e) { |
| | | this.form.transportUnit = e.value[0] |
| | | this.show4 = false |
| | | }, |
| | | // 提交订单 |
| | | submit() { |
| | | var that = this; |
| | | if (!this.form.carUnit) { |
| | | return uni.showToast({ title: '请选择货车型号', icon: 'none' }) |
| | | } |
| | | if (!this.form.transportTypeName) { |
| | | return uni.showToast({ title: '请选择运输品种', icon: 'none' }) |
| | | } |
| | |
| | | if (!this.form.linkPhone) { |
| | | return uni.showToast({ title: '请输入联系电话', icon: 'none' }) |
| | | } |
| | | this.$u.api.release({ |
| | | ...this.form, |
| | | price: Number(this.form.price) * 100, |
| | | wayInfoDTOList: [ |
| | | { |
| | | lat: this.form.lat, |
| | | lgt: this.form.lgt, |
| | | location: this.form.location |
| | | }, |
| | | ...this.form.wayInfoDTOList, |
| | | { |
| | | lat: this.form.latEnd, |
| | | lgt: this.form.lgtEnd, |
| | | location: this.form.locationEnd |
| | | if (!that.form.id) { |
| | | uni.requestSubscribeMessage({ |
| | | tmplIds: ['oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg','AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8'], |
| | | success(res) { |
| | | that.$u.api.release({ |
| | | ...that.form, |
| | | price: Number(that.form.price) * 100, |
| | | wayInfoDTOList: [ |
| | | { |
| | | lat: that.form.lat, |
| | | lgt: that.form.lgt, |
| | | location: that.form.location |
| | | }, |
| | | ...that.form.wayInfoDTOList, |
| | | { |
| | | lat: that.form.latEnd, |
| | | lgt: that.form.lgtEnd, |
| | | location: that.form.locationEnd |
| | | } |
| | | ] |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | uni.navigateTo({ |
| | | url: `/pages/success/success?orderId=${res.data.id}` |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | ] |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | uni.navigateTo({ |
| | | url: `/pages/success/success?orderId=${res.data.id}` |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | // uni.requestSubscribeMessage({ |
| | | // tmplIds: ['3YSC7gouRlSjHXz4CrWOGFzPmGwEBtFj4snwdfMvKHk','AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8'], |
| | | // success(res) { |
| | | that.$u.api.updateOrder({ |
| | | ...that.form, |
| | | price: Number(that.form.price) * 100, |
| | | wayInfoDTOList: [ |
| | | { |
| | | lat: that.form.lat, |
| | | lgt: that.form.lgt, |
| | | location: that.form.location |
| | | }, |
| | | ...that.form.wayInfoDTOList, |
| | | { |
| | | lat: that.form.latEnd, |
| | | lgt: that.form.lgtEnd, |
| | | location: that.form.locationEnd |
| | | } |
| | | ] |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | uni.showToast({ |
| | | title: '编辑成功', |
| | | icon: 'success', |
| | | mask: true, |
| | | duration: 2000 |
| | | }) |
| | | setTimeout(() => { |
| | | uni.navigateBack({ delta: 1 }); |
| | | // uni.$emit('refresh') |
| | | }, 1500) |
| | | } |
| | | }) |
| | | // } |
| | | // }) |
| | | } |
| | | }, |
| | | uploadImg() { |
| | | var that = this; |
| | | uni.chooseImage({ |
| | | success: (chooseImageRes) => { |
| | | const tempFilePaths = chooseImageRes.tempFilePaths; |
| | | uni.uploadFile({ |
| | | url: this.$baseUrl + '/web/public/upload', |
| | | filePath: tempFilePaths[0], |
| | | name: 'file', |
| | | formData: { |
| | | 'folder': 'orders' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | const res = JSON.parse(uploadFileRes.data) |
| | | that.form.multifileList.push({ |
| | | fileurl: res.data.imgaddr, |
| | | name: res.data.originname, |
| | | url: res.data.url, |
| | | type: 0 |
| | | }) |
| | | } |
| | | }); |
| | | for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) { |
| | | uni.uploadFile({ |
| | | url: this.$baseUrl + '/web/public/upload', |
| | | filePath: chooseImageRes.tempFilePaths[i], |
| | | name: 'file', |
| | | formData: { |
| | | 'folder': 'orders' |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | const res = JSON.parse(uploadFileRes.data) |
| | | that.form.multifileList.push({ |
| | | fileurl: res.data.imgaddr, |
| | | name: res.data.originname, |
| | | url: res.data.url, |
| | | type: 0 |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | getPrice() { |
| | | if (this.form.price && this.form.priceNum1 && this.form.priceNum2) { |
| | | this.$u.api.getTotal({ |
| | | price: Number(this.form.price) * 100, |
| | | price: Number(this.form.price).toFixed(2) * 100, |
| | | priceUnit: this.form.priceUnit, |
| | | priceNum1: this.form.priceNum1, |
| | | priceNum2: this.form.priceNum2, |
| | | type: 1 |
| | | }).then(res => { |
| | | this.form.estimatedAccount = res.data |
| | | if (res.code === 200) { |
| | | this.form.estimatedAccount = res.data |
| | | } |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | getCategoryLists() { |
| | | this.$u.api.getCategoryList({ type: 1 }) |
| | | .then(res => { |
| | | this.car = [res.data] |
| | | res.data.forEach(item => { |
| | | if (item.id === this.form.categoryId) { |
| | | this.carArr = [item.detailList] |
| | | } |
| | | }) |
| | | if (res.code === 200) { |
| | | this.car = [res.data] |
| | | res.data.forEach(item => { |
| | | if (item.id === this.form.categoryId) { |
| | | this.carArr = [item.detailList] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | this.$u.api.getCategoryList({ type: 0 }) |
| | | .then(res => { |
| | | this.variety = [res.data] |
| | | if (res.code === 200) { |
| | | this.variety = [res.data] |
| | | } |
| | | }) |
| | | }, |
| | | confirmCategary(e) { |
| | |
| | | confirmDate(e) { |
| | | this.form.startDate = e[0] |
| | | this.form.endDate = e[e.length - 1] |
| | | this.form.priceNum1 = e.length; |
| | | let time = this.form.startDate == this.form.endDate ? 1 : 0 |
| | | this.form.priceNum1 = e.length - time; |
| | | this.show2 = false |
| | | }, |
| | | addAddr() { |
| | |
| | | if ([2].includes(type)) { |
| | | this.form.latitude = res.latitude |
| | | this.form.longitude = res.longitude |
| | | this.form.address = res.address |
| | | this.form.address = res.name || res.address |
| | | } else if (type === 3) { |
| | | this.form.locationEnd = res.address |
| | | this.form.locationEnd = res.name || res.address |
| | | this.form.latEnd = res.latitude |
| | | this.form.lgtEnd = res.longitude |
| | | } else if (type === 4) { |
| | | this.form.wayInfoDTOList[0].lat = res.latitude |
| | | this.form.wayInfoDTOList[0].lgt = res.longitude |
| | | this.form.wayInfoDTOList[0].location = res.address |
| | | } else if (type === 4) { |
| | | this.form.wayInfoDTOList[index].lat = res.latitude |
| | | this.form.wayInfoDTOList[index].lgt = res.longitude |
| | | this.form.wayInfoDTOList[index].location = res.name || res.address |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | } |
| | | .list-item-row-val { |
| | | width: 100%; |
| | | // width: 100%; |
| | | padding: 30rpx 0; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | text { |
| | | // width: 80%; |
| | | flex-shrink: 0; |
| | | font-weight: 400; |
| | | font-size: 30rpx; |