2022-11-25 10:58:46 +08:00
|
|
|
<template>
|
|
|
|
|
<view class='app'>
|
|
|
|
|
<view class="rate">
|
|
|
|
|
<view class="images">
|
|
|
|
|
<view class="itemimgs" v-for="(item,index) in file">
|
2022-12-27 09:22:42 +08:00
|
|
|
<image class="delimg" src="../../static/gb2.png" mode="" style="color: red;" @tap='delimg(item)'>
|
|
|
|
|
</image>
|
2022-11-25 10:58:46 +08:00
|
|
|
<image class="itemimg" :src="item" mode=""></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="shot item" @tap='updataImage'>
|
|
|
|
|
<image src="../../static/paishe.png" mode=""></image>
|
|
|
|
|
<view class="title">
|
|
|
|
|
拍摄
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="videotape item">
|
|
|
|
|
<image src="../../static/video.png" mode=""></image>
|
|
|
|
|
<view class="title">
|
|
|
|
|
录像
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="score">
|
|
|
|
|
<view class="title">
|
|
|
|
|
综合评分
|
|
|
|
|
</view>
|
|
|
|
|
<u-rate :count="count" v-model="countvalue" size='46'></u-rate>
|
|
|
|
|
<view class="text">
|
|
|
|
|
<u-input v-model="text" type="textarea" :clearable='false' />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="updata" @tap='updata'>
|
|
|
|
|
提交评价
|
|
|
|
|
</view>
|
|
|
|
|
<u-toast ref="uToast" />
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import baseurl from '@/api/baseurl.js'
|
|
|
|
|
import {
|
|
|
|
|
insertGoodsEvaluate,
|
|
|
|
|
uploadEvaluatePictureUrl
|
|
|
|
|
} from '@/api/goodsorderRate/index.js'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
orderlist: {},
|
|
|
|
|
count: 5,
|
|
|
|
|
countvalue: 0,
|
|
|
|
|
text: '',
|
|
|
|
|
baseurl: null,
|
|
|
|
|
file: [],
|
|
|
|
|
imgs: [],
|
|
|
|
|
patientId: null,
|
|
|
|
|
openid: null,
|
2022-12-27 09:22:42 +08:00
|
|
|
timer: null,
|
|
|
|
|
delta: null,
|
2022-11-25 10:58:46 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-12-27 09:22:42 +08:00
|
|
|
delimg(item) {
|
|
|
|
|
this.file = this.file.filter(e => e != item)
|
|
|
|
|
},
|
|
|
|
|
updata() {
|
2022-11-25 10:58:46 +08:00
|
|
|
let that = this
|
2022-12-27 09:22:42 +08:00
|
|
|
if (this.file.length > 0) {
|
|
|
|
|
this.file.forEach(e => {
|
|
|
|
|
uni.uploadFile({
|
|
|
|
|
url: baseurl + '/nurseApp/orderEvaluate/uploadEvaluatePictureUrl',
|
|
|
|
|
filePath: e,
|
|
|
|
|
name: 'file',
|
|
|
|
|
formData: {
|
|
|
|
|
'orderNo': that.orderlist.goOrderNo
|
|
|
|
|
},
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
success(res) {
|
|
|
|
|
var img = {
|
|
|
|
|
evaluatePictureUrl: JSON.parse(res.data).imgUrl
|
|
|
|
|
}
|
|
|
|
|
that.imgs.push(img)
|
|
|
|
|
if (that.imgs.length == that.file.length) {
|
|
|
|
|
that.info();
|
|
|
|
|
}
|
2022-11-25 10:58:46 +08:00
|
|
|
}
|
2022-12-27 09:22:42 +08:00
|
|
|
})
|
2022-11-25 10:58:46 +08:00
|
|
|
})
|
2022-12-27 09:22:42 +08:00
|
|
|
} else {
|
|
|
|
|
that.info();
|
|
|
|
|
}
|
2022-11-25 10:58:46 +08:00
|
|
|
},
|
|
|
|
|
info() {
|
|
|
|
|
var that = this
|
|
|
|
|
var obj = {
|
|
|
|
|
"patientId": that.patientId,
|
|
|
|
|
"openid": that.openid,
|
|
|
|
|
"orderNo": that.orderlist.goOrderNo,
|
|
|
|
|
"evaluateChannel": "WE_CHAT_APPLET",
|
|
|
|
|
"evaluateContent": that.text,
|
|
|
|
|
"compositeScore": that.countvalue,
|
|
|
|
|
"orderEvaluatePictureInfoList": that.imgs
|
|
|
|
|
}
|
|
|
|
|
insertGoodsEvaluate(obj).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
2022-12-27 09:22:42 +08:00
|
|
|
uni.setStorageSync("Refresh", 'Refresh')
|
2022-11-25 10:58:46 +08:00
|
|
|
that.$refs.uToast.show({
|
|
|
|
|
title: '评价成功',
|
|
|
|
|
type: 'success',
|
|
|
|
|
duration: '1500'
|
|
|
|
|
})
|
|
|
|
|
if (that.timer) {
|
|
|
|
|
clearTimeout(that.timer)
|
|
|
|
|
}
|
|
|
|
|
that.timer = setTimeout(e => {
|
|
|
|
|
that.imgs = []
|
2022-12-27 09:22:42 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/ratesuccess/ratesuccess?delta=${that.delta}`
|
2022-11-25 10:58:46 +08:00
|
|
|
})
|
|
|
|
|
}, 1500)
|
|
|
|
|
} else {
|
|
|
|
|
that.imgs = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
updataImage() {
|
|
|
|
|
var that = this;
|
|
|
|
|
uni.chooseImage({
|
|
|
|
|
count: 9,
|
|
|
|
|
success(res) {
|
|
|
|
|
res.tempFilePaths.forEach(e => {
|
|
|
|
|
that.file.push(e)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.orderlist = JSON.parse(options.item)
|
2022-12-27 09:22:42 +08:00
|
|
|
this.delta = options.delta
|
2022-11-25 10:58:46 +08:00
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.baseurl = baseurl
|
|
|
|
|
var that = this
|
|
|
|
|
try {
|
|
|
|
|
const value = uni.getStorageSync('openid');
|
|
|
|
|
if (value) {
|
|
|
|
|
that.openid = value
|
|
|
|
|
} else {}
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
try {
|
|
|
|
|
const value = uni.getStorageSync('patientId');
|
|
|
|
|
if (value) {
|
|
|
|
|
that.patientId = value
|
|
|
|
|
} else {}
|
|
|
|
|
} catch (e) {}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import './goodsorderRate.scss';
|
|
|
|
|
</style>
|