add-remark.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">{{form.title}}</text>
  6. </view>
  7. </view>
  8. <view class="box" style="margin-top: 50px;">
  9. <view class="item">
  10. <view class="l">
  11. <text style="color: red;" v-if="form.mustRemark==1">*</text>
  12. 备注:
  13. </view>
  14. <view class="r">
  15. <u-textarea placeholder="备注" v-model="form.remark" clearable>
  16. </u-textarea>
  17. </view>
  18. </view>
  19. </view>
  20. <view style="margin-top: 50px;">
  21. <u-button type="primary" text="确定" @click="saveFn"></u-button>
  22. <u-button type="info" text="重置" @click="form.remark=''" style="margin-top: 20rpx;"></u-button>
  23. </view>
  24. <!-- ---------------------------------------------------------- -->
  25. <view class="bottom-safety"></view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. form: {
  33. itemId: '',
  34. title: '',
  35. remark: '',
  36. mustRemark: 1
  37. }
  38. }
  39. },
  40. onLoad(options) {
  41. this.form = options;
  42. },
  43. methods: {
  44. saveFn() {
  45. let data=this.form;
  46. if(data.mustRemark==1&&!data.remark){
  47. this.$common.toast('请填写备注')
  48. return false;
  49. }
  50. uni.navigateBack({
  51. delta: 1,
  52. success: function(resp) {
  53. uni.$emit('getRemark', data) //触发事件
  54. }
  55. })
  56. }
  57. },
  58. }
  59. </script>
  60. <style lang="scss">
  61. page {
  62. background-color: #fff;
  63. }
  64. .hj {
  65. padding: 50rpx;
  66. font-size: 40rpx;
  67. color: red;
  68. font-weight: bold;
  69. }
  70. .save-btn {
  71. background-color: #ff4200;
  72. height: 88rpx;
  73. display: flex;
  74. justify-content: center;
  75. align-items: center;
  76. margin: 60rpx;
  77. color: #fff;
  78. font-size: 30rpx;
  79. font-weight: bold;
  80. border-radius: 10rpx;
  81. }
  82. @import '@/common/common.scss'
  83. </style>