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