questionsDetails.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="content">
  3. <view class="detail-cont">
  4. <view class="title">{{item.title}}</view>
  5. <view class="info">
  6. <view class="reads">阅读数:{{item.views}}</view>
  7. <view class="time">{{item.createTime}}</view>
  8. </view>
  9. <!-- 正文 -->
  10. <view class="full-text">
  11. <view v-html="item.answers"></view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {getQuestionsById} from '@/api/index'
  18. export default {
  19. data() {
  20. return {
  21. id:null,
  22. item:{},
  23. };
  24. },
  25. onLoad(option) {
  26. this.id=option.id;
  27. },
  28. onShow() {
  29. this.getQuestionsById();
  30. },
  31. onShareAppMessage(res) {
  32. if(this.utils.isLogin()){
  33. return {
  34. title: this.item.vesselName,
  35. path: '/pages_index/questionsDetails?id='+this.id,
  36. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  37. }
  38. }
  39. },
  40. //分享到朋友圈
  41. onShareTimeline(res) {
  42. if(this.utils.isLogin()){
  43. return {
  44. title: this.item.title,
  45. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  46. }
  47. }
  48. },
  49. methods:{
  50. getQuestionsById(){
  51. let data = {id:this.id};
  52. getQuestionsById(data).then(
  53. res => {
  54. if(res.code==200){
  55. this.item=res.data;
  56. }else{
  57. uni.showToast({
  58. icon:'none',
  59. title: "请求失败",
  60. });
  61. }
  62. },
  63. rej => {}
  64. );
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. page{
  71. height: 100%;
  72. }
  73. .content{
  74. height: 100%;
  75. display: flex;
  76. flex-direction: column;
  77. }
  78. .detail-cont{
  79. flex: 1;
  80. padding: 40upx;
  81. overflow-y: auto;
  82. .title{
  83. font-size: 40upx;
  84. font-family: PingFang SC;
  85. // font-weight: bold;
  86. color: #222222;
  87. line-height: 70upx;
  88. }
  89. .info{
  90. display: flex;
  91. align-items: center;
  92. font-size: 24upx;
  93. font-family: PingFang SC;
  94. font-weight: 500;
  95. color: #999999;
  96. line-height: 48upx;
  97. margin: 23upx 0;
  98. .reads{
  99. margin-right: 30upx;
  100. }
  101. }
  102. .full-text{
  103. font-size: 36upx;
  104. font-family: PingFang SC;
  105. // font-weight: 500;
  106. color: #222222;
  107. line-height: 60upx;
  108. }
  109. }
  110. .recent-reads{
  111. flex-shrink: 0;
  112. box-sizing: border-box;
  113. height: 121upx;
  114. background: #FFFFFF;
  115. border-top: 1px solid #F0F0F0;
  116. padding: 0 40upx 0 37upx;
  117. display: flex;
  118. align-items: center;
  119. justify-content: space-between;
  120. .left{
  121. display: flex;
  122. align-items: center;
  123. .label{
  124. font-size: 28upx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #666666;
  128. line-height: 1;
  129. margin-right: 20upx;
  130. }
  131. .peop-box{
  132. display: flex;
  133. align-items: center;
  134. .head-box{
  135. margin-right: 28upx;
  136. display: flex;
  137. align-items: center;
  138. .head{
  139. width: 48upx;
  140. height: 48upx;
  141. border-radius: 50%;
  142. overflow: hidden;
  143. box-shadow: 0 0 0 1px #fff;
  144. margin-right: -10upx;
  145. image{
  146. width: 100%;
  147. height: 100%;
  148. }
  149. }
  150. }
  151. .arrow{
  152. width: 13upx;
  153. height: 23upx;
  154. }
  155. }
  156. }
  157. .share-btn{
  158. position: relative;
  159. width: 240upx;
  160. height: 80upx;
  161. line-height: 80upx;
  162. font-size: 30upx;
  163. font-family: PingFang SC;
  164. font-weight: 500;
  165. color: #FFFFFF;
  166. background: #018C39;
  167. border-radius: 40upx;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. image{
  172. width: 32upx;
  173. height: 32upx;
  174. margin-right: 15upx;
  175. }
  176. .share{
  177. position: absolute;
  178. width: 100%;
  179. height: 100%;
  180. opacity: 0;
  181. }
  182. }
  183. }
  184. .inquiry{
  185. width: 131upx;
  186. height: 131upx;
  187. position: fixed;
  188. right: 22upx;
  189. bottom: 193upx;
  190. z-index: 99;
  191. .content{
  192. position: relative;
  193. image{
  194. width: 100%;
  195. height: 100%;
  196. position: absolute;
  197. top: 0;
  198. left: 0;
  199. z-index: 9;
  200. }
  201. .text{
  202. position: absolute;
  203. top: 70upx;
  204. left: 50%;
  205. transform: translateX(-50%);
  206. z-index: 10;
  207. font-size: 22upx;
  208. font-family: PingFang SC;
  209. font-weight: bold;
  210. color: #018C39;
  211. line-height: 1;
  212. }
  213. }
  214. }
  215. .contact-btn{
  216. display: inline-block;
  217. position: absolute;
  218. top: 0;
  219. left: 0;
  220. width: 100%;
  221. height: 100%;
  222. opacity: 0;
  223. z-index: 9999;
  224. }
  225. </style>