Commit d79f002b authored by 高铭波's avatar 高铭波

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents 87bc1c2b 030b1690
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="u-flex u-row-between picker-common"> <view class="u-flex u-row-between picker-common">
<picker mode="selector" :value="index" range-key="label" :range="settings" @click="show = true" @change="pickerChange" class="u-flex-1"> <picker mode="selector" :value="index" range-key="label" :range="settings" @click="show = true" @change="pickerChange" class="u-flex-1">
<view class="txt">{{text}}</view> <view class="txt">{{text || '请选择'}}</view>
</picker> </picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
}, },
data() { data() {
return { return {
show: false show: false,
index: ''
} }
}, },
computed: { computed: {
...@@ -89,8 +90,8 @@ ...@@ -89,8 +90,8 @@
this.valueChange(id) this.valueChange(id)
}, },
pickerChange(data) { pickerChange(data) {
const index = data.detail.value this.index = data.detail.value
const id = this.item.fieldsOptions[index].key const id = this.item.fieldsOptions[this.index].key
this.dataValue = id this.dataValue = id
this.valueChange(id) this.valueChange(id)
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<u-picker v-model="showPicker" range-key="label" @columnchange="columnchange" :mode="isNotMulti?'selector':'multiSelector'" @confirm="pickerConfirm" :range="settings"></u-picker> --> <u-picker v-model="showPicker" range-key="label" @columnchange="columnchange" :mode="isNotMulti?'selector':'multiSelector'" @confirm="pickerConfirm" :range="settings"></u-picker> -->
<view class="u-flex u-row-between picker-common"> <view class="u-flex u-row-between picker-common">
<picker :mode="isNotMulti?'selector':'multiSelector'" :value="index" range-key="label" :range="settings" @click="showPicker = true" @change="pickerChange" class="txt u-flex-1"> <picker :mode="isNotMulti?'selector':'multiSelector'" :value="index" range-key="label" :range="settings" @click="showPicker = true" @change="pickerChange" class="txt u-flex-1">
<view>{{text}}</view> <view>{{text || '请选择'}}</view>
</picker> </picker>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
......
...@@ -17,7 +17,7 @@ uni.hideTabBar() ...@@ -17,7 +17,7 @@ uni.hideTabBar()
### Props ### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 | | 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| update | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 | | upload | Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 | | num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** | | currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** |
...@@ -67,10 +67,12 @@ uni.hideTabBar() ...@@ -67,10 +67,12 @@ uni.hideTabBar()
```javascript ```javascript
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index' // upload为false时需加上
export default { export default {
components: { components: {
'take-photo': takePhoto 'take-photo': takePhoto
}, },
mixins: [baseFile], // upload为false时需加上
data() { data() {
return { return {
takeStatus: false, takeStatus: false,
...@@ -86,6 +88,11 @@ export default { ...@@ -86,6 +88,11 @@ export default {
// 拍照完成或关闭相机 // 拍照完成或关闭相机
closeTake(images) { closeTake(images) {
this.takeStatus = false this.takeStatus = false
// upload为false时处理
const files = images.map(v => v.path)
const value = await this.saveToTask(files)
console.log("value", value)
} }
} }
} }
......
...@@ -29,56 +29,56 @@ ...@@ -29,56 +29,56 @@
id_card: { id_card: {
name: "身份证", name: "身份证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "id_card", keyName: "id_card",
color: "#999999" color: "#999999"
}, },
electrician_certificate: { electrician_certificate: {
name: "电工证", name: "电工证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "electrician_certificate", keyName: "electrician_certificate",
color: "#999999" color: "#999999"
}, },
driver_license: { driver_license: {
name: "驾驶证", name: "驾驶证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "driver_license", keyName: "driver_license",
color: "#999999" color: "#999999"
}, },
driving_license: { driving_license: {
name: "行驶证", name: "行驶证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "driving_license", keyName: "driving_license",
color: "#999999" color: "#999999"
}, },
vehicle: { vehicle: {
name: "车辆照", name: "车辆照",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "vehicle", keyName: "vehicle",
color: "#999999" color: "#999999"
}, },
high_sky_license: { high_sky_license: {
name: "高空证", name: "高空证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "high_sky_license", keyName: "high_sky_license",
color: "#999999" color: "#999999"
}, },
refrigeration_license: { refrigeration_license: {
name: "制冷证", name: "制冷证",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "refrigeration_license", keyName: "refrigeration_license",
color: "#999999" color: "#999999"
}, },
business_license: { business_license: {
name: "营业执照", name: "营业执照",
isUpload: false, isUpload: false,
isUploadName: "", isUploadName: "未上传",
keyName: "business_license", keyName: "business_license",
color: "#999999" color: "#999999"
}, },
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
this.orderId = option.id this.orderId = option.id
} }
this.loadOrderDetail() this.loadOrderDetail()
this.getLocation()
if (option && option.isFromMine) { if (option && option.isFromMine) {
this.isFromMine = true this.isFromMine = true
// 获取结算信息 // 获取结算信息
...@@ -279,7 +280,6 @@ ...@@ -279,7 +280,6 @@
} else { } else {
this.loadOrderRecord() this.loadOrderRecord()
this.getLocation()
this.getSignDistance() this.getSignDistance()
} }
......
...@@ -245,24 +245,26 @@ ...@@ -245,24 +245,26 @@
this.takeStatus = true this.takeStatus = true
}, },
async closeTake(img) { async closeTake(img) {
const files = img.map(v => v.path) if(img !==undefined){
const value = await this.saveToTask(files) const files = img.map(v => v.path)
console.log("value", value) const value = await this.saveToTask(files)
if(img !==undefined ){
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = [] if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
// step1 添加图片 // 复制一份 用于保存
img.forEach(v => { let saveList = this.currentItemDate.orderImages.concat();
this.currentItemDate.orderImages.push(v.key) value.map(item =>{
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
// 文件key添加保存数组中
saveList.push(item.key)
}) })
// step2 保存图片 // step2 保存图片
var data={ var data={
type : this.currentItemDate.type, type : this.currentItemDate.type,
images : Array.from(this.currentItemDate.orderImages), images : Array.from(saveList),
fieldsName:this.currentItemDate.fieldName fieldsName:this.currentItemDate.fieldName
} }
this.$u.api.saveImage(data,this.orderId).then((res) => { this.$u.api.saveImage(data,this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log("===", res.data)
} else { } else {
console.log("保存图片异常",res.data.message) console.log("保存图片异常",res.data.message)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment