fa-replys.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <u-popup v-model="value" :popup="false" mode="bottom" @close="close" border-radius="20" :closeable="true">
  4. <view class="u-p-30">
  5. <view class="u-text-center u-tips-color">
  6. 回复评论
  7. </view>
  8. <view class="u-m-t-30"><u-input height="200" v-model="content" type="textarea" /></view>
  9. <view class="u-p-t-30 u-flex u-row-center">
  10. <u-button
  11. size="medium"
  12. type="primary"
  13. hover-class="none"
  14. :custom-style="{ width: '80vw', backgroundColor: theme.bgColor, color: theme.color }"
  15. shape="circle"
  16. @click="submit"
  17. >
  18. 提交
  19. </u-button>
  20. </view>
  21. </view>
  22. </u-popup>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'fa-replys',
  28. props: {
  29. value: {
  30. type: Boolean,
  31. default: false
  32. },
  33. pid:{
  34. type:[Number,String],
  35. default:''
  36. }
  37. },
  38. data() {
  39. return {
  40. content: ''
  41. };
  42. },
  43. methods: {
  44. close() {
  45. this.$emit('input', false);
  46. },
  47. submit(){
  48. if(!this.content.trim()){
  49. this.$u.toast('请输入回复内容');
  50. return;
  51. }
  52. this.$api.commentReply({
  53. pid:this.pid,
  54. content:this.content
  55. }).then(res=>{
  56. this.content = '';
  57. this.$u.toast(res.msg);
  58. this.close();
  59. this.$emit('success')
  60. })
  61. }
  62. }
  63. };
  64. </script>
  65. <style lang="scss"></style>