2022-05-21 23:49:53 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 报价/客户支付模态框 -->
|
|
|
|
|
|
<view class="cu-modal" :class="show?'show':''">
|
|
|
|
|
|
<view class="cu-dialog">
|
|
|
|
|
|
<view class="cu-bar bg-white justify-end solid-bottom">
|
|
|
|
|
|
<view class="content">发送急报</view>
|
|
|
|
|
|
<view class="action" data-modal="sendUrgentMsgModal" @click="hideModal">
|
|
|
|
|
|
<text class="cuIcon-close text-red"></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="padding padding-lr-xl bg-white text-left">
|
|
|
|
|
|
<view>
|
|
|
|
|
|
<text>TO:</text>
|
|
|
|
|
|
<button class="cu-btn" :class="toWho === 0 ? 'bg-main-color' : ''" @click="changeToWho(0)">商家</button>
|
|
|
|
|
|
<button class="cu-btn margin-left-sm" :class="toWho === 1 ? 'bg-main-color' : ''" @click="changeToWho(1)">平台</button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="margin-top-sm">
|
|
|
|
|
|
<textarea style="width: 100%;" class="solid radius text-left padding-sm" v-model="detailDesc" maxlength="-1"
|
|
|
|
|
|
placeholder="请输入需报商家或平台的情况,申请厂家配件请以“申请配件”开头"></textarea>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="margin-top-sm">
|
|
|
|
|
|
<view class="margin-bottom-sm">上传照片</view>
|
|
|
|
|
|
<view class="grid col-4 grid-square flex-sub">
|
|
|
|
|
|
<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="viewImage($event, imgList)"
|
|
|
|
|
|
:data-url="item">
|
|
|
|
|
|
<image :src="item" mode="aspectFill"></image>
|
|
|
|
|
|
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
|
|
|
|
|
<text class='cuIcon-close'></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="solids" @tap="chooseImgList" v-if="imgList.length<9">
|
|
|
|
|
|
<text class='cuIcon-cameraadd'></text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="cu-bar bg-white solid-top">
|
|
|
|
|
|
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="sendUrgentMsgModal"
|
|
|
|
|
|
@tap="hideModal" @click="sendUrgentMsg">发送急报</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
|
|
|
|
|
nama: 'new-serv-price',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
show: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false
|
|
|
|
|
|
},
|
|
|
|
|
|
data: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: {}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
toWho: 0,
|
|
|
|
|
|
detailDesc: '',
|
|
|
|
|
|
imgList: []
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
hideModal(e) {
|
|
|
|
|
|
this.$emit(this.$globalFun.HIDE_MODAL, e);
|
|
|
|
|
|
},
|
|
|
|
|
|
sendUrgentMsg(e) {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
changeToWho(toWho) {
|
|
|
|
|
|
this.toWho = toWho;
|
|
|
|
|
|
},
|
|
|
|
|
|
chooseImgList(e) {
|
2023-11-29 22:05:04 +08:00
|
|
|
|
uni.chooseMedia({
|
2022-05-21 23:49:53 +08:00
|
|
|
|
count: 9, //默认9
|
2023-11-29 22:05:04 +08:00
|
|
|
|
mediaType: ['image'],
|
2022-05-21 23:49:53 +08:00
|
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
|
|
sourceType: ['album'], //从相册选择
|
|
|
|
|
|
success: (res) => {
|
2023-11-29 22:05:04 +08:00
|
|
|
|
let tempFilePaths = [];
|
|
|
|
|
|
res.tempFiles.forEach((fileObj) => {
|
|
|
|
|
|
tempFilePaths.push(fileObj.tempFilePath);
|
|
|
|
|
|
})
|
2022-05-21 23:49:53 +08:00
|
|
|
|
if (this.imgList.length != 0) {
|
2023-11-29 22:05:04 +08:00
|
|
|
|
this.imgList = this.imgList.concat(tempFilePaths)
|
2022-05-21 23:49:53 +08:00
|
|
|
|
} else {
|
2023-11-29 22:05:04 +08:00
|
|
|
|
this.imgList = tempFilePaths
|
2022-05-21 23:49:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
viewImage(e, imgList) {
|
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
|
urls: imgList,
|
|
|
|
|
|
current: e.currentTarget.dataset.url
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
delImg(e, imgList) {
|
|
|
|
|
|
uni.showModal({
|
|
|
|
|
|
title: '',
|
|
|
|
|
|
content: '确定要删除这张图片吗?',
|
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
|
confirmText: '确定',
|
|
|
|
|
|
success: res => {
|
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
|
imgList.splice(e.currentTarget.dataset.index, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
</style>
|