bulletinMessage.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="container ask-container-message">
  3. <view class="advice-ipt-cont">
  4. <u-input v-model="advice_content" type="textarea" maxlength="100" :clearable="false" :placeholder="titlePlaceholder" height="300" class="ipt" />
  5. <text class="num-tag">{{ advice_content.length }}/100</text>
  6. </view>
  7. <view class="btn-cont" @click="submitHandle"> 提交 </view>
  8. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  9. <Loading />
  10. </view>
  11. </template>
  12. <script>
  13. import { Reports } from "@/config/api.js";
  14. import freeCharge from "@/components/freeCharge";
  15. export default {
  16. data() {
  17. return {
  18. advice_content: "",
  19. id: "",
  20. type: "",
  21. };
  22. },
  23. components: {
  24. freeCharge,
  25. },
  26. computed: {
  27. titlePlaceholder() {
  28. return "请描述您的专题需求";
  29. },
  30. },
  31. methods: {
  32. async submitHandle() {
  33. if (!this.advice_content)
  34. return uni.showToast({
  35. title: "内容不能为空",
  36. icon: "none",
  37. duration: 2000,
  38. });
  39. const res = await Reports.collectionApplyAdd({
  40. Content: this.advice_content,
  41. });
  42. if (res.Ret === 200) {
  43. this.$util.toast("提交成功");
  44. this.advice_content = "";
  45. setTimeout(() => {
  46. uni.navigateBack();
  47. }, 500);
  48. }
  49. },
  50. },
  51. onLoad(option) {},
  52. };
  53. </script>
  54. <style scoped lang="scss">
  55. .ask-container-message {
  56. background-color: #fff;
  57. padding: 30rpx 34rpx;
  58. .advice-ipt-cont {
  59. height: 420rpx;
  60. border: 1rpx solid #d0cfd5;
  61. border-radius: 8rpx;
  62. padding: 30rpx;
  63. position: relative;
  64. font-size: 28rpx;
  65. color: #d0cfd5;
  66. .num-tag {
  67. position: absolute;
  68. bottom: 30rpx;
  69. right: 30rpx;
  70. }
  71. }
  72. .btn-cont {
  73. width: 500rpx;
  74. height: 52rpx;
  75. background: $uni-color-new;
  76. color: #fff;
  77. font-size: 24rpx;
  78. font-weight: 600;
  79. border-radius: 8rpx;
  80. margin: 80rpx auto;
  81. text-align: center;
  82. line-height: 52rpx;
  83. }
  84. }
  85. </style>