|  |  |  | 
|---|
|  |  |  | <view class="list-item-row-label">图片</view> | 
|---|
|  |  |  | <view class="list-item-row-upload"> | 
|---|
|  |  |  | <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> | 
|---|
|  |  |  | <image :src="item.url" mode="widthFix"></image> | 
|---|
|  |  |  | <image :src="item.url || item.fileurlFull" mode="widthFix"></image> | 
|---|
|  |  |  | <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="upload-item" @click="uploadImg"> | 
|---|
|  |  |  | 
|---|
|  |  |  | show: false, | 
|---|
|  |  |  | show1: false, | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | days: '', | 
|---|
|  |  |  | startDate: '', | 
|---|
|  |  |  | endDate: '', | 
|---|
|  |  |  | 
|---|
|  |  |  | estimatedAccount: '', | 
|---|
|  |  |  | type: 0 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | modify: false, | 
|---|
|  |  |  | cateList: [], | 
|---|
|  |  |  | viewStatus: false | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad(option) { | 
|---|
|  |  |  | this.form.linkPhone = this.userInfo.telephone | 
|---|
|  |  |  | this.form.days = option.days | 
|---|
|  |  |  | this.form.startDate = option.startDate | 
|---|
|  |  |  | this.form.endDate = option.endDate | 
|---|
|  |  |  | this.form.lat = option.latitude | 
|---|
|  |  |  | this.form.lgt = option.longitude | 
|---|
|  |  |  | this.form.location = option.address | 
|---|
|  |  |  | this.form.workType = option.workType | 
|---|
|  |  |  | // 编辑 | 
|---|
|  |  |  | if (option.id) { | 
|---|
|  |  |  | this.form.id = option.id | 
|---|
|  |  |  | this.$u.api.getDetail({ | 
|---|
|  |  |  | orderId: option.id | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | for (const key in this.form) { | 
|---|
|  |  |  | this.form[key] = res.data[key] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.form.days = res.data.totalDays | 
|---|
|  |  |  | this.form.price = Number(this.form.price) / 100 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.form.linkPhone = this.userInfo.telephone | 
|---|
|  |  |  | this.form.days = option.days | 
|---|
|  |  |  | this.form.startDate = option.startDate | 
|---|
|  |  |  | this.form.endDate = option.endDate | 
|---|
|  |  |  | this.form.lat = option.latitude | 
|---|
|  |  |  | this.form.lgt = option.longitude | 
|---|
|  |  |  | this.form.location = option.address | 
|---|
|  |  |  | this.form.workType = option.workType | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.getCateList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!this.form.linkPhone) { | 
|---|
|  |  |  | return uni.showToast({ title: '请输入联系电话', icon: 'none' }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/success/success?orderId=${res.data}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (!this.form.id) { | 
|---|
|  |  |  | this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/success/success?orderId=${res.data.id}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100  }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '编辑成功', | 
|---|
|  |  |  | icon: 'success', | 
|---|
|  |  |  | mask: true, | 
|---|
|  |  |  | duration: 2000 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | uni.navigateBack({ delta: 1 }); | 
|---|
|  |  |  | uni.$emit('refresh') | 
|---|
|  |  |  | }, 1500) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 计算金额 | 
|---|
|  |  |  | getPrice() { | 
|---|
|  |  |  | 
|---|
|  |  |  | type: this.form.type, | 
|---|
|  |  |  | workType: this.form.workType | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.modify = true | 
|---|
|  |  |  | this.form.estimatedAccount = res.data | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|