disagree.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="disagree-page">
  3. <scroll-view class="scroll-y" scroll-y="true">
  4. <view class="textarea-box">
  5. <view class="label-view">
  6. <text>原因</text>
  7. </view>
  8. <textarea class="textarea"
  9. placeholder="请输入"
  10. placeholder-style="color: #B8BECC"
  11. :maxlength="-1"
  12. :disabled="disabled"
  13. auto-height
  14. :value="value"
  15. @input="changeValue"
  16. />
  17. </view>
  18. </scroll-view>
  19. <view class="fixed-buttom-btn"
  20. v-if="!disabled"
  21. @click="sure">
  22. <text class="btn-text">确定</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. // 不认可原因
  28. export default {
  29. props: {
  30. // 是否禁用
  31. disabled: {
  32. type: Boolean,
  33. default: false
  34. },
  35. // 详情回显的数据
  36. values: {
  37. type: Object,
  38. default: () => {
  39. return {}
  40. }
  41. },
  42. // 按钮信息 (包过请求的key)
  43. btnInfo: {
  44. type: Object,
  45. default: () => {
  46. return {}
  47. }
  48. },
  49. // 任务详情
  50. missionDetails: {
  51. type: Object,
  52. default: () => {
  53. return {}
  54. }
  55. }
  56. },
  57. data(){
  58. return {
  59. value: ''
  60. }
  61. },
  62. created() {
  63. uni.setNavigationBarTitle({
  64. title: '原因'
  65. });
  66. if(this.disabled) {
  67. this.value = this.values['textarea'];
  68. }
  69. },
  70. methods: {
  71. changeValue(e) {
  72. this.value = e.detail.value;
  73. },
  74. sure() {
  75. const { params } = this.btnInfo;
  76. let requestParams = {};
  77. this.btnInfo.params.map(item => {
  78. if(item.valueKey){
  79. requestParams[item.paramsKey] = (
  80. item.isOutvalueKey
  81. ? this.missionDetails
  82. : this.btnInfo
  83. )[item.valueKey];
  84. }else {
  85. requestParams[item.paramsKey] = this.value;
  86. }
  87. });
  88. this.$emit('comRequest', requestParams);
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="less">
  94. .disagree-page {
  95. height: 100%;
  96. .scroll-y {
  97. height: calc(100% - 87.5rpx);
  98. padding-top: 15rpx;
  99. .textarea-box {
  100. display: flex;
  101. width: 100%;
  102. background-color: #fff;
  103. padding: 25rpx 0;
  104. padding-left: 25rpx;
  105. .label-view {
  106. width: 175rpx;
  107. line-height: 37.5rpx;
  108. >text {
  109. font-size: 22.5rpx;
  110. color: #666F80;
  111. }
  112. }
  113. .textarea {
  114. flex: 1;
  115. min-height: 768.75rpx;
  116. padding: 0 25rpx;
  117. line-height: 37.5rpx;
  118. font-size: 22.5rpx;
  119. color: #525866;
  120. box-sizing: border-box;
  121. }
  122. }
  123. }
  124. }
  125. </style>