|
@@ -38,9 +38,9 @@
|
|
|
</view>
|
|
|
<!-- 最多三张 -->
|
|
|
<view class="picture-item" v-if="true">
|
|
|
- <uni-file-picker class="file-picker" limit="3" :auto-upload="false" del-icon="true"
|
|
|
- file-extname='png,git,jpeg,pdf,jpg' file-mediatype="image" v-model="fileList"
|
|
|
- @select="onSelectFile" @delete="onDelFile">
|
|
|
+ <uni-file-picker class="file-picker" limit="3" :auto-upload="false" :del-icon="true"
|
|
|
+ file-extname='png,git,jpeg,pdf,jpg' file-mediatype="image" v-model="fileList" @select="onSelectFile"
|
|
|
+ @delete="onDelFile">
|
|
|
<view class="cf-appraise-edit-add">
|
|
|
<text class="iconfont"></text>
|
|
|
</view>
|
|
@@ -70,19 +70,19 @@
|
|
|
import rest from '@/stores/rest'
|
|
|
|
|
|
import CfAppraiseStar from './CfAppraiseStar.vue'
|
|
|
-
|
|
|
+
|
|
|
|
|
|
const props = defineProps({
|
|
|
ptwybh: {
|
|
|
type: String,
|
|
|
default: ""
|
|
|
},
|
|
|
- isEdit : {
|
|
|
+ isEdit: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
|
|
|
const loaded = ref(false)
|
|
|
const starText = [
|
|
@@ -104,16 +104,15 @@
|
|
|
|
|
|
// 上传图片
|
|
|
const onSelectFile = async (res) => {
|
|
|
- console.log("上传",res)
|
|
|
+ console.log("上传", res)
|
|
|
if (!res.tempFilePaths.length) return;
|
|
|
uni.showLoading({
|
|
|
title: '',
|
|
|
mask: true
|
|
|
});
|
|
|
for (var i = 0; i < res.tempFilePaths.length; i++) {
|
|
|
- let blobUrl = res.tempFiles[i].file;
|
|
|
- console.log("上传",blobUrl)
|
|
|
- let uploadedFile = await rest.upload(blobUrl);
|
|
|
+ let uploadedFile = await rest.upload(res.tempFilePaths[i]);
|
|
|
+
|
|
|
if (!uploadedFile) {
|
|
|
dlg.error("上传失败,请重试!");
|
|
|
uni.hideLoading();
|
|
@@ -140,33 +139,33 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- const onApply = async() => {
|
|
|
+ const onApply = async () => {
|
|
|
const formData = {
|
|
|
orderId: props.ptwybh,
|
|
|
- zhpj: info.value.comprehensiveVal,
|
|
|
- jyxg: info.value.starVal[0],
|
|
|
- kfys: info.value.starVal[1],
|
|
|
- jyzl: info.value.starVal[2],
|
|
|
- wlfw: info.value.starVal[3],
|
|
|
- content: info.value.text,
|
|
|
- image: info.value.imgList,
|
|
|
- anonymity: info.value.anonymous ? 1 : 0
|
|
|
+ zhpj: info.value.comprehensiveVal,
|
|
|
+ jyxg: info.value.starVal[0],
|
|
|
+ kfys: info.value.starVal[1],
|
|
|
+ jyzl: info.value.starVal[2],
|
|
|
+ wlfw: info.value.starVal[3],
|
|
|
+ content: info.value.text,
|
|
|
+ image: info.value.imgList,
|
|
|
+ anonymity: info.value.anonymous ? 1 : 0
|
|
|
}
|
|
|
let fields = {
|
|
|
'orderId': '订单ID不能为空',
|
|
|
- 'zhpj': '综合评价不能为空',
|
|
|
- 'jyxg': '就医效果不能为空',
|
|
|
- 'kfys': '开方医生不能为空',
|
|
|
- 'jyzl': '煎药质量不能为空',
|
|
|
- 'wlfw': '物流服务不能为空'
|
|
|
+ 'zhpj': '综合评价不能为空',
|
|
|
+ 'jyxg': '就医效果不能为空',
|
|
|
+ 'kfys': '开方医生不能为空',
|
|
|
+ 'jyzl': '煎药质量不能为空',
|
|
|
+ 'wlfw': '物流服务不能为空'
|
|
|
};
|
|
|
for (let key in fields) {
|
|
|
- if (!formData[key]) {
|
|
|
- dlg.error(fields[key]);
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (!formData[key]) {
|
|
|
+ dlg.error(fields[key]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
- console.log("processedData", formData)
|
|
|
+ console.log("processedData", formData, files.value)
|
|
|
// await rest.post('/zyyp/prescription-evaluate/create',formData)
|
|
|
dlg.success('操作成功')
|
|
|
}
|