problem_detail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666666"></navbar>
  4. <view class="detail">
  5. <view class="title">
  6. {{detail.problemTitle}}
  7. </view>
  8. <view class="postMessage">
  9. <!-- <view> -->
  10. <!-- <view class="">
  11. <text class="iconfont2 icon-img">&#xe643;</text>
  12. <text>发布者:{{detail.informationAuthor}}</text>
  13. </view>
  14. <view class="">
  15. <text class="iconfont2 icon-img">&#xe66c;</text>
  16. <text>{{detail.createTime}}</text>
  17. </view> -->
  18. <!-- </view> -->
  19. <!-- <view @click="shareHandler">
  20. <text class="iconfont2 icon-img">&#xe615;</text>
  21. <text>分享</text>
  22. </view> -->
  23. </view>
  24. <view class="content">
  25. <view class="ql-editor-box" v-html="detail.replyContent">
  26. </view>
  27. </view>
  28. <!-- <view class="browse">
  29. <view class="look-box">
  30. <text class="iconfont3 look-icon">&#xe63b;</text>
  31. <text>浏览量:{{detail.browse_sum||0}}</text>
  32. </view>
  33. </view> -->
  34. </view>
  35. </view>
  36. <!-- <share ref="shares" :contentHeight="580"></share> -->
  37. </view>
  38. </template>
  39. <script>
  40. import share from "@/pages/public/share";
  41. import rate from "@/components/rate.vue"
  42. export default {
  43. components: {
  44. share,
  45. rate
  46. },
  47. data() {
  48. return {
  49. config: {
  50. back: true,
  51. title: '问题详情',
  52. color: 'black',
  53. backgroundColor: [1, "#fff"],
  54. statusBarFontColor: '#1A1A1A',
  55. leftSlot: true
  56. },
  57. detail: {},
  58. }
  59. },
  60. onLoad(options) {
  61. if (options && options.id) {
  62. this.getDetail(options.id)
  63. }
  64. },
  65. methods: {
  66. getDetail(id) {
  67. this.$yghttp.get(`/common/problem/info/${id}`).then(res => {
  68. if (res.code === 200) {
  69. this.detail = res.data
  70. }
  71. })
  72. },
  73. shareHandler() {
  74. if (!token) {
  75. uni.navigateTo({
  76. url: "/pages/login/index",
  77. });
  78. } else {
  79. // 咨询分享
  80. // this.$http.post(`/information/share/${this.detail.id}`).then(res => {})
  81. this.$nextTick(() => {
  82. this.$refs.shares.shareInfo("/?&shareId=" + user.id, null, null, null, null, this.detail.id);
  83. });
  84. }
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .detail {
  91. padding: 20rpx 20rpx 40rpx 30rpx;
  92. .title {
  93. margin-bottom: 14rpx;
  94. font-size: 35rpx;
  95. font-family: PingFang SC, PingFang SC-Bold;
  96. font-weight: 700;
  97. color: #1a1a1a;
  98. line-height: 52rpx;
  99. letter-spacing: -0.7rpx;
  100. }
  101. .postMessage {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. padding: 0 10rpx;
  106. margin-bottom: 30rpx;
  107. font-size: 24rpx;
  108. font-family: PingFang SC, PingFang SC-Medium;
  109. font-weight: 500;
  110. color: #999999;
  111. & view {
  112. display: flex;
  113. align-items: center;
  114. width: 50%;
  115. text:last-child {
  116. flex: 1;
  117. overflow: hidden;
  118. white-space: nowrap;
  119. text-overflow: ellipsis;
  120. }
  121. // margin-right: 50rpx;
  122. }
  123. .mb20 {
  124. margin-bottom: 20rpx;
  125. }
  126. .icon-img {
  127. margin-right: 8rpx;
  128. color: #3775F6;
  129. font-size: 36rpx;
  130. }
  131. }
  132. .look-box {
  133. display: flex;
  134. align-items: center;
  135. .look-icon {
  136. font-size: 36rpx;
  137. margin-right: 8rpx;
  138. margin-top: 8rpx;
  139. }
  140. }
  141. * {
  142. word-break: break-all;
  143. }
  144. .content /deep/ img {
  145. max-width: 100%;
  146. }
  147. .content /deep/ .ql-align-center {
  148. text-align: center;
  149. }
  150. .content /deep/ .ql-align-right {
  151. text-align: right;
  152. }
  153. .content /deep/ blockquote {
  154. display: block;
  155. border-left: 8px solid #d0e5f2;
  156. padding: 5px 10px;
  157. margin: 10px 0;
  158. line-height: 1.4;
  159. font-size: 100%;
  160. background-color: #f1f1f1;
  161. }
  162. .content /deep/ .ql-indent-1 {
  163. margin-left: 60rpx;
  164. }
  165. .content /deep/ .ql-indent-2 {
  166. margin-left: 120rpx;
  167. }
  168. .content /deep/ .ql-indent-3 {
  169. margin-left: 180rpx;
  170. }
  171. .content /deep/ .ql-indent-4 {
  172. margin-left: 240rpx;
  173. }
  174. .content /deep/ .ql-indent-5 {
  175. margin-left: 300rpx;
  176. }
  177. .content {
  178. /deep/ .ql-editor-box {
  179. .ql-video {
  180. width: 100%;
  181. // height: 45vw;
  182. }
  183. }
  184. }
  185. .browse {
  186. margin-top: 30rpx;
  187. font-size: 24rpx;
  188. font-family: PingFang SC, PingFang SC-Medium;
  189. font-weight: 500;
  190. color: #999999;
  191. view {
  192. display: flex;
  193. align-items: center;
  194. }
  195. .icon-img {
  196. margin-right: 8rpx;
  197. color: #3775F6;
  198. font-size: 36rpx;
  199. }
  200. }
  201. }
  202. </style>