particulars.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 44px;">
  5. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="详情"></uni-nav-bar>
  6. <u-swiper :list="list" height="428"></u-swiper>
  7. <view class="quiz">
  8. <view class="quiz_username">
  9. <image src="../../static/image/expertDiagnosis/6940a11a251770f1b0d8b7b10ebdf9b.png" mode="" v-if="Number(quizdata.heat)==1"></image>
  10. <span>{{quizdata.title}}</span>
  11. </view>
  12. <view class="quiz_usertime">
  13. <view style="display: flex;align-items: center;">
  14. <image src="../../static/image/fourMoodBase/touxiang.png" mode=""></image>
  15. <span>{{quizdata.username}}</span>
  16. </view>
  17. <view>
  18. <span>{{quizdata.adtime|timeFormat()}}</span>
  19. </view>
  20. </view>
  21. <view class="quiz_usercontert" v-html="quizdata.content"></view>
  22. </view>
  23. <view class="comment">
  24. <p class="comment_title">评论</p>
  25. <view class="comment_unit" v-for="(item,index) in commentdata" :key="index">
  26. <view class="comment_unit_user">
  27. <view class="username">
  28. <image :src="item.image" mode=""></image>
  29. <span style="font-size: 26rpx;color:#C1C1C1;">{{item.username}}</span>
  30. <p v-if="Number(item.user_type) == 1">专家</p>
  31. </view>
  32. <view>
  33. <span style="font-size: 26rpx;color:#C1C1C1;">{{item.uptime|timeFormat()}}</span>
  34. </view>
  35. </view>
  36. <view class="comment_unit_con">
  37. <p v-html="item.content"></p>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="issue_box">
  42. <view class="issue">
  43. <input type="text" v-model="issuedata" />
  44. <p @click="issue">发布</p>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. list: [{}],
  55. quizdata: {},
  56. commentdata: [],
  57. issuedata: '',
  58. defaultimg: '/images/expertDiagnosis/img01.png',
  59. }
  60. },
  61. methods: { //
  62. async getParticulars(data) {
  63. const res = await this.$myRequest({
  64. url: '/api/api_gateway?method=pest.pests.pests_answers_list',
  65. data: {
  66. lower: data.lower
  67. }
  68. })
  69. this.commentdata = res.data
  70. console.log(this.commentdata)
  71. },
  72. async getDiscuss(data) {
  73. const res = await this.$myRequest({
  74. url: '/api/api_gateway?method=pest.pests.pests_new_idea',
  75. data: {
  76. lower: data.lower,
  77. content: data.content
  78. }
  79. })
  80. console.log(res)
  81. },
  82. clickLeft() {
  83. uni.navigateTo({
  84. url: "exchangeShare"
  85. })
  86. },
  87. issue() { //发布评论
  88. let obj = {}
  89. obj.lower = this.quizdata.lower
  90. obj.content = this.issuedata
  91. if (this.issuedata != '') {
  92. this.getDiscuss(obj)
  93. uni.navigateTo({
  94. url: "particulars?items=" + JSON.stringify(this.quizdata)
  95. })
  96. }
  97. }
  98. },
  99. onLoad(option) {
  100. this.quizdata = JSON.parse(option.items)
  101. console.log(this.quizdata.img_urls)
  102. if (this.quizdata.img_urls == '' || this.quizdata.img_urls == null) {
  103. this.list[0].image = 'http://static.yfpyx.com/projectimg' + this.defaultimg
  104. } else {
  105. this.list[0].image = this.quizdata.img_urls
  106. }
  107. let data = {}
  108. data.lower = this.quizdata.lower
  109. this.getParticulars(data)
  110. }
  111. }
  112. </script>
  113. <style lang="scss">
  114. .u-swiper-wrap {
  115. width: 95%;
  116. margin: 20rpx auto;
  117. }
  118. .quiz {
  119. width: 95%;
  120. margin: 20rpx auto;
  121. border-bottom: 4rpx dashed #E8E8E8;
  122. .quiz_username {
  123. width: 100%;
  124. image {
  125. width: 40rpx;
  126. height: 40rpx;
  127. vertical-align: middle;
  128. margin-right: 20rpx;
  129. }
  130. span {
  131. font-weight: 700;
  132. font-size: 32rpx;
  133. }
  134. }
  135. .quiz_usertime {
  136. width: 100%;
  137. margin-top: 15rpx;
  138. display: flex;
  139. justify-content: space-between;
  140. image {
  141. width: 50rpx;
  142. height: 50rpx;
  143. margin-right: 20rpx;
  144. }
  145. span {
  146. font-size: 24rpx;
  147. color: #C1C1C1;
  148. font-weight: 700;
  149. }
  150. }
  151. .quiz_usercontert {
  152. padding: 20rpx;
  153. margin-bottom: 20rpx;
  154. }
  155. }
  156. .comment {
  157. width: 95%;
  158. margin: 20rpx auto 0;
  159. .comment_title {
  160. font-weight: 700;
  161. font-size: 32rpx;
  162. }
  163. .comment_unit {
  164. .comment_unit_user {
  165. display: flex;
  166. justify-content: space-between;
  167. margin-top: 20rpx;
  168. .username {
  169. display: flex;
  170. align-items: center;
  171. image {
  172. width: 50rpx;
  173. height: 50rpx;
  174. margin-right: 20rpx;
  175. border-radius: 50%;
  176. }
  177. p {
  178. width: 60rpx;
  179. height: 30rpx;
  180. color: white;
  181. background-color: #5CA348;
  182. font-size: 24rpx;
  183. text-align: center;
  184. line-height: 30rpx;
  185. padding: 0 10rpx;
  186. margin-left: 20rpx;
  187. border-radius: 8rpx;
  188. }
  189. }
  190. }
  191. .comment_unit_con {
  192. padding-left: 60rpx;
  193. /deep/p {
  194. margin-top: 20rpx;
  195. img {
  196. margin-top: 20rpx;
  197. display: block;
  198. width: 180rpx !important;
  199. height: 180rpx !important;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. .issue_box {
  206. width: 100%;
  207. position: fixed;
  208. bottom: 0;
  209. background-color: #FFFFFF;
  210. }
  211. .issue {
  212. width: 95%;
  213. margin: 0 auto;
  214. display: flex;
  215. padding-bottom: 20rpx;
  216. input {
  217. width: 90%;
  218. background-color: #F3F3F3;
  219. height: 60rpx;
  220. text-indent: 1em;
  221. }
  222. p {
  223. width: 10%;
  224. text-align: right;
  225. line-height: 60rpx;
  226. color: #7a7a7a;
  227. }
  228. }
  229. </style>