detail.vue 2.2 KB
Newer Older
芊里 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
<template>
	<view class="container">
		<unicloud-db ref="udb" v-slot:default="{data, loading, error, options}" :options="options"
			collection="opendb-feedback"
			field="user_id,create_date,content,imgs,is_reply,feedback_id,contact,mobile,reply_count" :where="queryWhere"
			:getone="true" :manual="true">
			<view v-if="error">{{error.message}}</view>
			<view v-else-if="loading">
				<uni-load-more :contentText="loadMore" status="loading"></uni-load-more>
			</view>
			<view v-else-if="data">
				
				<uni-forms-item name="content" label="反馈内容">
					<uni-easyinput :disabled="true" placeholder="请输入反馈内容" type="textarea" v-model="data.content" trim="right" />
				</uni-forms-item>
				<uni-forms-item v-if="data.imgs.length>0" name="imgs" label="反馈截图">
					<feedback-imgs :imgs="data.imgs"></feedback-imgs>
				</uni-forms-item>
				<uni-forms-item name="contact" label="联系人">
					<uni-easyinput :disabled="true" placeholder="请输入联系人" v-model="data.contact" trim="both" />
				</uni-forms-item>
				<uni-forms-item name="mobile" label="联系方式">
					<uni-easyinput :disabled="true" placeholder="请输入手机号/邮箱" v-model="data.mobile" trim="both" />
				</uni-forms-item>
			</view>
		</unicloud-db>
	</view>
</template>

<script>
	// 由schema2code生成,包含校验规则和enum静态数据
	import {
		enumConverter
	} from '../../js_sdk/validator/opendb-feedback.js';
	import feedbackImgs from '../../components/feedback-imgs';

	export default {
		components:{feedbackImgs},
		data() {
			return {
				queryWhere: '',
				loadMore: {
					contentdown: '',
					contentrefresh: '',
					contentnomore: ''
				},
				options: {
					// 将scheme enum 属性静态数据中的value转成text
					...enumConverter
				}
			}
		},
		onLoad(e) {
			this._id = e.id
		},
		onReady() {
			if (this._id) {
				this.queryWhere = '_id=="' + this._id + '"'
			}
		}
	}
</script>

<style>
	.container {
		padding: 10px;
	}

	.btns {
		margin-top: 10px;
		display: flex;
		flex-direction: row;
	}

	.btns button {
		flex: 1;
	}

	.btn-delete {
		margin-left: 10px;
	}
</style>