jiehuo-pl.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="">
  3. <view class="flztoa jhbbre">
  4. <view class="fzctob">
  5. <image :src="info.avatarUrl"
  6. style="width: 92rpx;min-width: 92rpx;height: 92rpx;border-radius: 200rpx;margin-right: 30rpx;"
  7. mode=""></image>
  8. <view class="">
  9. <text>{{info.nickName}}</text>
  10. </view>
  11. </view>
  12. <!-- <image src="/static/index/ind1.png" style="width: 116rpx;height: 48rpx;min-width: 116rpx;" mode=""></image> -->
  13. </view>
  14. <view class="jhwdmmt">
  15. <view class="shidongt">
  16. <view class="shibbert">
  17. <view class="shikwer">
  18. <text>{{info.content}}</text>
  19. <!-- <text class="fyctoc" style="color: #374B6E;">展开</text> -->
  20. </view>
  21. <view class="flztoa" style="margin-top: 46rpx;">
  22. <view class="fzctob" >
  23. <image @click="like" :src="info.is_like == 1?'/static/index/w1.png':'/static/index/w2.png'" style="width: 48rpx;height: 48rpx;min-width: 48rpx;" mode=""></image>
  24. <text class="shitxty">{{info.like_num}}</text>
  25. <view style="margin-left: 40rpx;" @click="focus=true">
  26. <image src="/static/index/w3.png" style="width: 48rpx;height: 48rpx;min-width: 48rpx;"
  27. mode=""></image>
  28. </view>
  29. </view>
  30. <view class="">
  31. <text class="shitxtya">{{$u.timeFormat(info.create_time, 'yyyy:mm:dd hh:MM:ss')}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="jhwdmmt">
  38. <view class="indhuyr">
  39. <view class="indjbrr"></view>
  40. <text>全部评论({{info.comment_num}})</text>
  41. </view>
  42. <view class="shidongt" v-for="(item,index) in info.comment" :key="index">
  43. <view class="shibbert">
  44. <view class="hfikwer">
  45. <view class="hfuyerrt"><text>{{item.nickName}}</text></view>
  46. <text>{{item.content}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="flztoa hfddwevde">
  52. <view class="hfddwerr">
  53. <input type="text" :focus="focus" value="" placeholder-style="color:#333333;font-size: 28rpx;"
  54. placeholder="您好!请问有什么可以帮助您的。" v-model="content" />
  55. </view>
  56. <view class="hfddwett" @click="addcomment">
  57. <text>发送</text>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <style>
  63. page {
  64. background: #FAFAFA;
  65. }
  66. </style>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. xqaxuye: false,
  72. info: {},
  73. user_id:'',
  74. content:'',
  75. focus:false
  76. }
  77. },
  78. onLoad(e) {
  79. this.getinfo(e.id, e.user_id)
  80. this.user_id = e.user_id
  81. },
  82. methods: {
  83. getinfo(id, user_id) {
  84. this.$post({
  85. data: {
  86. do: 'QuestionIndex',
  87. data: {
  88. id: id,
  89. user_id: user_id
  90. }
  91. }
  92. }).then(res => {
  93. this.info = res.message
  94. })
  95. },
  96. //点赞
  97. like(){
  98. let that = this;
  99. that.$post({
  100. data: {
  101. do: 'QuestionLike',
  102. data: {
  103. question_id: that.info.id,
  104. user_id: that.user_id
  105. }
  106. }
  107. }).then(res => {
  108. that.getinfo(that.info.id,that.user_id);
  109. })
  110. },
  111. //添加评论
  112. addcomment(){
  113. let that = this;
  114. that.$post({
  115. data: {
  116. do: 'QuestionComment',
  117. data: {
  118. questions_id: that.info.id,
  119. user_id: that.user_id,
  120. content:that.content,
  121. msg_id:0
  122. }
  123. }
  124. }).then(res => {
  125. that.getinfo(that.info.id,that.user_id);
  126. that.content = '';
  127. })
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .jhbbre {
  134. padding: 20rpx 24rpx;
  135. background: #FFFFFF;
  136. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(0, 0, 0, 0.10196078431372549);
  137. font-size: 36rpx;
  138. font-weight: 400;
  139. color: #333333;
  140. }
  141. </style>