123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <view class="write-back-page">
- <scroll-view class="scroll-y" scroll-y="true" >
- <view class="item-box">
- <view class="label-view">
- <text>回复内容</text>
- </view>
- <textarea class="textarea"
- placeholder="请输入"
- placeholder-style="color: #B8BECC"
- :maxlength="500"
- :disabled="disabled"
- auto-height
- :value="disabled ? values['textarea'] : value"
- @input="changeValue"
- />
- </view>
- <tm-upload-img
- :filePaths="filePath"
- :isMultiple="true"
- :disabled="disabled"
- @changeFilePaths="changeFilePaths"
- />
- </scroll-view>
- <view class="fixed-buttom-btn"
- v-if="!disabled"
- @click="sure">
- <text class="btn-text">确定</text>
- </view>
- </view>
- </template>
- <script>
- // 改善回复
- export default {
- props: {
- // 是否禁用
- disabled: {
- type: Boolean,
- default: false
- },
- // 详情回显的数据
- values: {
- type: Object,
- default: () => {
- return {}
- }
- },
- // 按钮信息 (包过请求的key)
- btnInfo: {
- type: Object,
- default: () => {
- return {}
- }
- },
- // 任务详情
- missionDetails: {
- type: Object,
- default: () => {
- return {}
- }
- }
- },
- data() {
- return {
- value: '',
- filePath: []
- }
- },
- created() {
- uni.setNavigationBarTitle({
- title: '原因'
- });
- if(this.disabled) {
- this.value = this.values['textarea'];
- this.filePath = this.values['filePath'] ? this.values['filePath'].split(',') : [];
- }
- },
- methods: {
- changeValue(e) {
- this.value = e.detail.value;
- },
- changeFilePaths(filePath) {
- this.filePath = filePath;
- },
- sure() {
- let requestParams = {};
- this.btnInfo.params.map(item => {
- if(item.valueKey){
- requestParams[item.paramsKey] = (
- item.isOutvalueKey
- ? this.missionDetails
- : this.btnInfo
- )[item.valueKey];
- }else if(item.value){
- requestParams[item.paramsKey] = item.value;
- }else {
- switch(item.paramsKey){
- case 'imgPath': // 上传图片
- requestParams[item.paramsKey] = this.filePath.join(',');
- break;
- case 'textarea': // 回复内容
- requestParams[item.paramsKey] = this.value;
- break;
- default:
- requestParams[item.paramsKey] = '';
- break;
- }
- }
- });
- this.$emit('comRequest', requestParams);
- }
- }
- }
- </script>
- <style lang="less">
- .write-back-page {
- height: 100%;
- padding-top: 15rpx;
- .scroll-y {
- height: calc(100% - 102rpx);
- .item-box {
- display: flex;
- background-color: #FFFFFF;
- border-bottom: 0.62rpx solid #DADEE6;
- padding: 25rpx 0;
- padding-left: 25rpx;
- .label-view {
- width: 175rpx;
- line-height: 37.5rpx;
- >text {
- font-size: 22.5rpx;
- color: #666F80;
- }
- }
- .textarea {
- width: 100%;
- min-height: 587.5rpx;
- background-color: #fff;
- padding: 0 25rpx;
- line-height: 37.5rpx;
- font-size: 22.5rpx;
- color: #525866;
- box-sizing: border-box;
- }
- }
- }
- }
- </style>
|