|
@@ -1,206 +1,369 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <u-action-sheet
|
|
|
|
- :show="showrepairType"
|
|
|
|
- :actions="repairType"
|
|
|
|
- title="请选择性别"
|
|
|
|
- description="如果选择保密会报错"
|
|
|
|
- @close="showrepairType = false"
|
|
|
|
- @select="sexSelect()">
|
|
|
|
- </u-action-sheet>
|
|
|
|
-
|
|
|
|
- <u-form
|
|
|
|
- labelPosition="left"
|
|
|
|
- :model="model1"
|
|
|
|
- :rules="rules"
|
|
|
|
- ref="uForm">
|
|
|
|
- <u-form-item
|
|
|
|
- label="接警时间"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- labelWidth="120"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairTime"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="报修人"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairName"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="联系电话"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairPhone"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="报修类型"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairType"
|
|
|
|
- disabled
|
|
|
|
- :actions="actions"
|
|
|
|
- @click="showSex = true; hideKeyboard()"
|
|
|
|
- borderBottom
|
|
|
|
- disabledColor="#ffffff"
|
|
|
|
- placeholder="请选择报修类型"
|
|
|
|
- ></u-input>
|
|
|
|
- <u-icon
|
|
|
|
- slot="right"
|
|
|
|
- name="arrow-right"
|
|
|
|
- ></u-icon>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="报修内容"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- type ="textarea"
|
|
|
|
- showWordLimit='255'
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="损坏原因"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="管线压力"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="停气方式"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="停气方式"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
-<u-form-item
|
|
|
|
- label="使用材料"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1"
|
|
|
|
- >
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
-label="维修人"
|
|
|
|
-labelWidth="120"
|
|
|
|
-borderBottom
|
|
|
|
-ref="item1">
|
|
|
|
-<u-input
|
|
|
|
-v-model="form.repairContent"
|
|
|
|
-border="none"
|
|
|
|
-></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="完成时间"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1">
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
- <u-form-item
|
|
|
|
- label="维修照片"
|
|
|
|
- labelWidth="120"
|
|
|
|
- borderBottom
|
|
|
|
- ref="item1">
|
|
|
|
- <u-input
|
|
|
|
- v-model="form.repairContent"
|
|
|
|
- border="none"
|
|
|
|
- ></u-input>
|
|
|
|
- </u-form-item>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </u-form>
|
|
|
|
-
|
|
|
|
|
|
+ <image src="/static/icon/background.png" mode="" class="background"></image>
|
|
|
|
+ <view class="project-content">
|
|
|
|
+ <u-form labelPosition="left" :model="form" :rules="rules" ref="form">
|
|
|
|
+ <u-form-item label="接警时间" borderBottom ref="item1" labelWidth="120">
|
|
|
|
+ <u-input v-model="form.repairTime" border="none" disabled @click="showtime=true"></u-input>
|
|
|
|
+ <u-picker v-model="showtime" mode="time" :params="params" @confirm="time()"></u-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="报修人" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.repairName" border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="联系电话" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.repairPhone" border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="报修类型" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="repairTypeLabel" disabled @click=" showrepairType= true;" borderBottom
|
|
|
|
+ disabledColor="#ffffff" placeholder="请选择报修类型"></u-input>
|
|
|
|
+ <u-select v-model="showrepairType" :list="typelist.repair_type" label-name="dictLabel"
|
|
|
|
+ value-name="dictValue" @confirm="repairType()"></u-select>
|
|
|
|
+ <u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="报修内容" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.repairContent" type="textarea" showWordLimit='255' border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="损坏原因" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="causesOfFamageLabel" disabled @click=" causesOfFamageType = true;"
|
|
|
|
+ borderBottom></u-input>
|
|
|
|
+ <u-select v-model="causesOfFamageType" :list="typelist.causes_of_damage" label-name="dictLabel" value-name="dictValue" @confirm="causesOfFamage()"></u-select>
|
|
|
|
+ <u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="管线压力" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="pipelinePressureLabel" disabled @click=" pipelinePressureType= true;"
|
|
|
|
+ borderBottom></u-input>
|
|
|
|
+ <u-select v-model="pipelinePressureType" :list="typelist.pipeline_pressure" label-name="dictLabel" value-name="dictValue" @confirm="pipelinePressure()"></u-select>
|
|
|
|
+ <u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="停气方式" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.stopGasMethod" border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="使用材料" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.usingMaterials" border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="维修人" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.maintenanceName" border="none"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="完成时间" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.maintenanceTime" border="none" disabled @click="showtime2=true"></u-input>
|
|
|
|
+ <u-picker v-model="showtime2" mode="time" :params="params" @confirm="time2()"></u-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="维修照片" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <view class="" style="display: flex; flex-wrap: wrap; margin: 0 55rpx;">
|
|
|
|
+ <image src="/static/icon/chooseimg.png" mode=""
|
|
|
|
+ style="width: 190rpx; height: 190rpx; margin: 0 12rpx; " @click="choose()"></image>
|
|
|
|
+ <view v-for="(item,index) in imgymxs" :key="index" style="position: relative;">
|
|
|
|
+ <view v-if="item.type == 'image'">
|
|
|
|
+ <image :src="item.url" mode="" style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"
|
|
|
|
+ @click="showPhoto(index)">
|
|
|
|
+ </image>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-else>
|
|
|
|
+ <video :src="item" style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"></video>
|
|
|
|
+ </view>
|
|
|
|
+ <view @click="remove(index)"
|
|
|
|
+ style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
|
|
|
|
+ <u-icon name="close" color="#FFFFFF" size="35"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </u-form-item>
|
|
|
|
+ <u-form-item label="备注" labelWidth="120" borderBottom ref="item1">
|
|
|
|
+ <u-input v-model="form.remarks" border="none" type="textarea"></u-input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </u-form>
|
|
|
|
+ <u-button @click="save()">确认上传</u-button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import service from '@/api/index.js'
|
|
export default {
|
|
export default {
|
|
|
|
+
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
-
|
|
|
|
- form:{},
|
|
|
|
- userInfo:{},
|
|
|
|
- showrepairType:false,
|
|
|
|
- repairType:[{
|
|
|
|
- name: '男',
|
|
|
|
|
|
+ params: {
|
|
|
|
+ year: true,
|
|
|
|
+ month: true,
|
|
|
|
+ day: true,
|
|
|
|
+ hour: true,
|
|
|
|
+ minute: true,
|
|
|
|
+ second: false
|
|
|
|
+ },
|
|
|
|
+ showtime:false,
|
|
|
|
+ action: this.$HTTP.webUrl + `/obs`,
|
|
|
|
+ causesOfFamageType: false,
|
|
|
|
+ pipelinePressureType: false,
|
|
|
|
+ repairTypeLabel: null,
|
|
|
|
+ causesOfFamageLabel: null,
|
|
|
|
+ pipelinePressureLabel: null,
|
|
|
|
+ showtime2:false,
|
|
|
|
+ headers: {
|
|
|
|
+ MAuthorization: "wxBearer " + uni.getStorageSync('token')
|
|
},
|
|
},
|
|
- {
|
|
|
|
- name: '女',
|
|
|
|
|
|
+ url: [],
|
|
|
|
+ uploading: false,
|
|
|
|
+ imgArr: [],
|
|
|
|
+ imgymxs: [],
|
|
|
|
+ causesOfDamage:null,
|
|
|
|
+ progress: 0, //图片或视频上传百分比
|
|
|
|
+ form: {
|
|
},
|
|
},
|
|
- {
|
|
|
|
- name: '保密',
|
|
|
|
- },
|
|
|
|
- ]
|
|
|
|
|
|
+ userInfo: {},
|
|
|
|
+ showrepairType: false,
|
|
|
|
+ community: null,
|
|
|
|
+ communityName:null,
|
|
|
|
+ dictlist: ['causes_of_damage', 'pipeline_pressure','repair_type'],
|
|
|
|
+ typelist: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- sexSelect(e) {
|
|
|
|
- this.form.repairType = e.name
|
|
|
|
- this.$refs.uForm.validateField('userInfo.sex')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ onLoad(e) {
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
+ title: '抢险维修单'
|
|
|
|
+ });
|
|
|
|
+ this.getdictsysinfo()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ getdictsysinfo() {
|
|
|
|
+ let _this = this
|
|
|
|
+ service.getDictInfoList({
|
|
|
|
+ type: this.dictlist
|
|
|
|
+ }).then(res => {
|
|
|
|
+ _this.typelist = res
|
|
|
|
+ console.log(res)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ time(e)
|
|
|
|
+ {
|
|
|
|
+ console.log(`${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`)
|
|
|
|
+
|
|
|
|
+ this.form.repairTime= `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
|
|
|
|
+ },
|
|
|
|
+ time2(e)
|
|
|
|
+ {
|
|
|
|
+ console.log(`${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`)
|
|
|
|
+
|
|
|
|
+ this.form.maintenanceTime= `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
|
|
|
|
+ },
|
|
|
|
+ save() {
|
|
|
|
+ let _this=this
|
|
|
|
+ // this.form.unitId=this.unit
|
|
|
|
+ this.form.photoList=this.imgArr
|
|
|
|
+ service.setemergencyRepair(this.form
|
|
|
|
+ ).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ _this.$UTILS.showPrompt('上报成功!')
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ console.log('跳')
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url:'/pages/index/index'
|
|
|
|
+ })
|
|
|
|
+ },2000)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ repairType(e) {
|
|
|
|
+ console.log(e[0])
|
|
|
|
+ this.form.repairType = e[0].value
|
|
|
|
+ this.repairTypeLabel = e[0].label
|
|
|
|
+ },
|
|
|
|
+ causesOfFamage(e) {
|
|
|
|
+
|
|
|
|
+ this.causesOfDamage=e[0].value
|
|
|
|
+ this.form.causesOfDamage = e[0].value
|
|
|
|
+ console.log(e[0])
|
|
|
|
+ this.causesOfFamageLabel = e[0].label
|
|
|
|
+ },
|
|
|
|
+ pipelinePressure(e) {
|
|
|
|
+ console.log(e[0])
|
|
|
|
+ this.form.pipelinePressure = e[0].value
|
|
|
|
+ this.pipelinePressureLabel = e[0].label
|
|
|
|
+ },
|
|
|
|
+ choose() {
|
|
|
|
+ let _this = this;
|
|
|
|
+ uni.showActionSheet({
|
|
|
|
+ title: '上传',
|
|
|
|
+ itemList: ['图片', '视频'],
|
|
|
|
+ success: (res) => {
|
|
|
|
+ // console.log(res)
|
|
|
|
+ if (res.tapIndex == 0) {
|
|
|
|
+ this.chooseimage()
|
|
|
|
+ } else {
|
|
|
|
+ this.choosevideo()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ chooseimage() {
|
|
|
|
+ console.log('图片')
|
|
|
|
+ let _this = this;
|
|
|
|
+ uni.chooseImage({
|
|
|
|
+ sizeType: ['album', 'camera'],
|
|
|
|
+ success(resp) {
|
|
|
|
+ console.log('res--uni.chooseMedia', resp);
|
|
|
|
+ resp.tempFiles.forEach((item, index) => {
|
|
|
|
+ const task = uni.uploadFile({
|
|
|
|
+ url: _this.$HTTP.webUrl + `/obs`,
|
|
|
|
+ filePath: item.path,
|
|
|
|
+ name: 'file',
|
|
|
|
+ formData: {},
|
|
|
|
+ header: _this.headers,
|
|
|
|
+ success: res => {
|
|
|
|
+ // 判断是否json字符串,将其转为json格式
|
|
|
|
+ let data = _this.$u.test.jsonString(res
|
|
|
|
+ .data) ? JSON.parse(res.data) : res.data;
|
|
|
|
+ if (![200, 201, 204].includes(res.statusCode)) {
|
|
|
|
+ // this.uploadError(index, data);
|
|
|
|
+ _this.$UTILS.showPrompt('选取失败!')
|
|
|
|
+ } else {
|
|
|
|
+ // 上传成功
|
|
|
|
+ // this.lists[index].response = data;
|
|
|
|
+ // this.lists[index].progress = 100;
|
|
|
|
+ // this.lists[index].error = false;
|
|
|
|
+ // this.$emit('on-success', data, index, this.lists, this
|
|
|
|
+ // .index);
|
|
|
|
+ if (_this.progress === 100) {
|
|
|
|
+ // console.log('_this.progress', _this.progress)
|
|
|
|
+ // console.log('data----', data)
|
|
|
|
+ // console.log('res--', res)
|
|
|
|
+ _this.imgymxs.push({
|
|
|
|
+ url: data.data.url,
|
|
|
|
+ type: 'image'
|
|
|
|
+ })
|
|
|
|
+ _this.imgArr.push(data.data.url)
|
|
|
|
+ // console.log('imgArr', _this.imgArr)
|
|
|
|
+ _this.$UTILS.showPrompt('选取成功!')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: e => {
|
|
|
|
+ _this.$UTILS.showPrompt('选取失败!')
|
|
|
|
+ this.uploadError(index, e);
|
|
|
|
+ },
|
|
|
|
+ complete: res => {
|
|
|
|
+ _this.uploading = false;
|
|
|
|
+ // _this.uploadFile(index + 1);
|
|
|
|
+ // this.$emit('on-change', res, index, this.lists, this
|
|
|
|
+ // .index);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ task.onProgressUpdate(res => {
|
|
|
|
+ // if (res.progress > 0) {
|
|
|
|
+ // this.lists[index].progress = res.progress;
|
|
|
|
+ // this.$emit('on-progress', res, index, this.lists, this.index);
|
|
|
|
+ // }
|
|
|
|
+ _this.progress = res.progress;
|
|
|
|
+ console.log('onProgressUpdate', res)
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '选取中'
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ choosevideo() {
|
|
|
|
+ let _this = this;
|
|
|
|
+ console.log('视频')
|
|
|
|
+ uni.chooseVideo({
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ maxDuration: 30,
|
|
|
|
+ success(resp) {
|
|
|
|
+ const task = uni.uploadFile({
|
|
|
|
+ url: _this.$HTTP.webUrl + `/obs`,
|
|
|
|
+ filePath: resp.tempFilePath,
|
|
|
|
+ name: 'file',
|
|
|
|
+ formData: {},
|
|
|
|
+ header: _this.headers,
|
|
|
|
+ success: res => {
|
|
|
|
+ // 判断是否json字符串,将其转为json格式
|
|
|
|
+ let data = _this.$u.test.jsonString(res
|
|
|
|
+ .data) ? JSON.parse(res.data) : res.data;
|
|
|
|
+ if (![200, 201, 204].includes(res.statusCode)) {
|
|
|
|
+ this.uploadError(index, data);
|
|
|
|
+ } else {
|
|
|
|
+ // 上传成功
|
|
|
|
+ // this.lists[index].response = data;
|
|
|
|
+ // this.lists[index].progress = 100;
|
|
|
|
+ // this.lists[index].error = false;
|
|
|
|
+ // this.$emit('on-success', data, index, this.lists, this
|
|
|
|
+ // .index);
|
|
|
|
+ if (_this.progress === 100) {
|
|
|
|
+ console.log('_this.progress', _this.progress)
|
|
|
|
+ console.log('data----', data)
|
|
|
|
+ console.log('res--', res)
|
|
|
|
+ // _this.imgArr.push(data.data.url)
|
|
|
|
+ _this.imgymxs.push({
|
|
|
|
+ url: data.data.url,
|
|
|
|
+ type: 'video'
|
|
|
|
+ })
|
|
|
|
+ _this.imgArr.push(data.data.url)
|
|
|
|
+ console.log('imgArr', _this.imgArr)
|
|
|
|
+ _this.$UTILS.showPrompt('选取成功!')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: e => {
|
|
|
|
+ _this.$UTILS.showPrompt('选取失败!')
|
|
|
|
+ this.uploadError(index, e);
|
|
|
|
+ },
|
|
|
|
+ complete: res => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ _this.uploading = false;
|
|
|
|
+ // _this.uploadFile(index + 1);
|
|
|
|
+ // this.$emit('on-change', res, index, this.lists, this
|
|
|
|
+ // .index);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ task.onProgressUpdate(res => {
|
|
|
|
+ // if (res.progress > 0) {
|
|
|
|
+ // this.lists[index].progress = res.progress;
|
|
|
|
+ // this.$emit('on-progress', res, index, this.lists, this.index);
|
|
|
|
+ // }
|
|
|
|
+ _this.progress = res.progress;
|
|
|
|
+ console.log('onProgressUpdate', res)
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '选取中'
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ remove(index) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '是否删除该图片或视频?',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.imgArr.splice(index, 1);
|
|
|
|
+ this.imgymxs.splice(index, 1);
|
|
|
|
+ console.log('this.imgarr', this.imgArr)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
|
+ .background {
|
|
|
|
+ z-index: -1;
|
|
|
|
+ position: fixed;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ }
|
|
|
|
|
|
-</style>
|
|
|
|
|
|
+ .project-content {
|
|
|
|
+ border: 4rpx solid #3857F3;
|
|
|
|
+ margin: 40rpx 55rpx 0;
|
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
|
+ border-radius: 48rpx;
|
|
|
|
+ }
|
|
|
|
+</style>
|