企微端详情已调整
This commit is contained in:
81
src/components/AiEvaluation.vue
Normal file
81
src/components/AiEvaluation.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<section class="AiEvaluation">
|
||||
<AiPagePicker v-if="type=='submit'&&!hasEvaluated" type="custom" :ops="ops" nodeKey="">
|
||||
<slot v-if="$slots.default"/>
|
||||
<div v-else v-text="placeholder"/>
|
||||
</AiPagePicker>
|
||||
<div v-if="type=='show'">
|
||||
<slot v-if="$slots.default"/>
|
||||
<AiGroup description no-border labelColor="#999" v-else>
|
||||
<AiItem label="评级分数">
|
||||
<u-rate v-model="detail.score" disabled inactive-icon="star-fill" active-color="#F8B425"/>
|
||||
{{ detail.rateText || "" }}
|
||||
</AiItem>
|
||||
<AiItem label="评价详情" top-label>
|
||||
<div v-html="detail.content"/>
|
||||
</AiItem>
|
||||
<AiItem label="附件" top-label>
|
||||
<AiUploader :def="detail.files" disabled/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
</div>
|
||||
<slot name="finish" v-if="$slots.finish"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AiPagePicker from "./AiPagePicker";
|
||||
import AiGroup from "./AiGroup";
|
||||
import AiItem from "./AiItem";
|
||||
import AiUploader from "./AiUploader";
|
||||
|
||||
export default {
|
||||
name: "AiEvaluation",
|
||||
model: {
|
||||
prop: "info",
|
||||
event: "input"
|
||||
},
|
||||
props: {
|
||||
info: {default: () => ({})},
|
||||
placeholder: {default: "去评价"},
|
||||
bid: {default: ""},
|
||||
type: {default: "submit"} //可选值: submit:提交评价,show:展示评价
|
||||
},
|
||||
components: {AiUploader, AiItem, AiGroup, AiPagePicker},
|
||||
computed: {
|
||||
isShow: v => v.type == 'show',
|
||||
hasEvaluated: v => !!v.detail?.id
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {},
|
||||
ops: {
|
||||
rateTexts: ['非常不满意', '不满意', '一般', '满意', '非常满意'],
|
||||
url: "/components/pages/submitEvaluation?bid=" + this.bid
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
bid: {
|
||||
immediate: true,
|
||||
handler() {
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
const bizId = this.bid
|
||||
bizId && this.$http.post("/app/appbusinesscompletionevaluation/queryMyEvaluationByBizId", null, {
|
||||
params: {bizId}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
const info = res.data?.[0]
|
||||
this.detail = {...info, rateText: this.rateTexts?.[info.score - 1]}
|
||||
this.$emit("input", this.detail)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
62
src/components/pages/submitEvaluation.vue
Normal file
62
src/components/pages/submitEvaluation.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<section class="submitEvaluation">
|
||||
<AiGroup>
|
||||
<AiItem label="评价分数" top-label required>
|
||||
<u-rate v-model="form.score" :size="64" active-color="#F8B425" :min-count="1" inactive-icon="star-fill"/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<u-gap height="24"/>
|
||||
<AiGroup>
|
||||
<AiItem label="评价详情" top-label required>
|
||||
<u-input type="textarea" v-model="form.content" placeholder="请简要描述..."/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<u-gap height="24"/>
|
||||
<AiGroup>
|
||||
<AiItem label="附件" top-label>
|
||||
<AiUploader v-model="form.files" :limit="9" multiple/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<div class="fixed-bottom">
|
||||
<div class="bottomBtn" @click="submit">提交</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "submitEvaluation",
|
||||
appName: "提交评价",
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
files: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
if (!this.form.score) {
|
||||
return this.$u.toast("请选择评价分数!")
|
||||
}
|
||||
if (!this.form.content) {
|
||||
return this.$u.toast("请填写评价详情!")
|
||||
}
|
||||
this.$http.post("/app/appbusinesscompletionevaluation/addOrUpdate", this.form).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
setTimeout(() => uni.navigateBack({}), 1500)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(params) {
|
||||
this.form.bizId = params.bid
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.submitEvaluation {
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user