common_reply.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <uni-popup ref="popup" type="bottom" background-color="#fff" @touchmove.stop.prevent>
  3. <view class="reply_box">
  4. <view class="fllow_area">
  5. <view class="fllo_list">
  6. <view class="area_head key">{{i18n['评论内容']}}:</view>
  7. </view>
  8. <textarea v-model="content" :class="content ? 'valueActive' : '' " :placeholder="i18n['评论内容']"
  9. placeholder-style="color:#999" />
  10. </view>
  11. <view class="button" @click="$noMultipleClicks(sureSub)">{{i18n['确定']}}</view>
  12. </view>
  13. </uni-popup>
  14. </template>
  15. <script>
  16. import { netAddComment } from '@/api/api.js'
  17. export default{
  18. props:{
  19. show:{
  20. type:Boolean,
  21. default:false
  22. }
  23. },
  24. computed:{
  25. i18n() {
  26. return this.$t("progress")
  27. }
  28. },
  29. data() {
  30. return{
  31. noClick:true, //防止重复点击
  32. record_id:'',
  33. relation_type:'workorder',
  34. content:''
  35. }
  36. },
  37. methods:{
  38. init(id) {
  39. this.$refs.popup.open()
  40. this.record_id = id
  41. },
  42. sureSub() {
  43. let params = {
  44. record_id:this.record_id,
  45. relation_type:this.relation_type,
  46. content:this.content
  47. }
  48. netAddComment(params).then(res=>{
  49. uni.showToast({
  50. title:res.msg,
  51. icon:'none'
  52. })
  53. setTimeout(()=>{
  54. this.content = ''
  55. this.$refs.popup.close()
  56. this.$emit('replySuccess')
  57. },2000)
  58. })
  59. },
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .reply_box{
  65. padding:50rpx 0;
  66. z-index:10000;
  67. .fllow_area {
  68. background: #fff;
  69. padding:30rpx 40rpx;
  70. border-bottom:1rpx solid #f5f5f5;
  71. .fllo_list{
  72. display: flex;
  73. justify-content: space-between;
  74. align-items: center;
  75. .area_head {
  76. margin-bottom: 20rpx;
  77. font-size:26rpx;
  78. }
  79. }
  80. textarea {
  81. width: 660rpx;
  82. padding: 20rpx;
  83. border-radius: 10rpx;
  84. margin: 24rpx auto;
  85. box-sizing: border-box;
  86. font-size:26rpx;
  87. background:rgba(202, 202, 202, 0.2);
  88. }
  89. }
  90. }
  91. </style>