vesselDetails.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="content" v-if="item!=null">
  3. <view class="image">
  4. <image mode="aspectFill" :src="item.imgUrl"></image>
  5. </view>
  6. <view class="detail-cont">
  7. <view class="title-box">
  8. <view class="line"></view>
  9. <view class="title">{{item.vesselName}}</view>
  10. <view class="title-py">{{item.pinyin}}</view>
  11. </view>
  12. <view class="desc">
  13. {{item.actionTitle}}
  14. </view>
  15. <view class="line-h"></view>
  16. <view class="content" v-html="item.descs">
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {getVesselById} from '@/api/index'
  23. export default {
  24. data() {
  25. return {
  26. tabIndex:1,
  27. item:{},
  28. };
  29. },
  30. onLoad(option) {
  31. this.id=option.id;
  32. },
  33. onShow() {
  34. this.getVesselById();
  35. },
  36. //发送给朋友
  37. onShareAppMessage(res) {
  38. if(this.utils.isLogin()){
  39. return {
  40. title: this.item.vesselName,
  41. path: '/pages_index/vesselDetails?id='+this.id,
  42. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  43. }
  44. }
  45. },
  46. //分享到朋友圈
  47. onShareTimeline(res) {
  48. if(this.utils.isLogin()){
  49. return {
  50. title: this.item.vesselName,
  51. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  52. }
  53. }
  54. },
  55. methods:{
  56. getVesselById(){
  57. let data = {id:this.id};
  58. getVesselById(data).then(
  59. res => {
  60. if(res.code==200){
  61. this.item=res.data;
  62. }else{
  63. uni.showToast({
  64. icon:'none',
  65. title: "请求失败",
  66. });
  67. }
  68. },
  69. rej => {}
  70. );
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. page{
  77. height: 100%;
  78. }
  79. .content{
  80. height: 100%;
  81. image{
  82. height:450rpx;
  83. width:100%;
  84. }
  85. .detail-cont{
  86. flex: 1;
  87. padding: 20upx;
  88. overflow-y: auto;
  89. .title-box{
  90. width: 100%;
  91. display: flex;
  92. justify-content: flex-start;
  93. align-items: center;
  94. .line{
  95. border-radius: 5rpx;
  96. width: 8rpx;
  97. height:30rpx;
  98. background-color: #018C39;
  99. }
  100. .title{
  101. margin-left: 15rpx;
  102. font-size: 40upx;
  103. font-family: PingFang SC;
  104. font-weight: bold;
  105. color: #333;
  106. }
  107. .title-py{
  108. margin-left: 15rpx;
  109. font-size: 32upx;
  110. font-family: PingFang SC;
  111. color: #333;
  112. }
  113. }
  114. .desc{
  115. margin-top: 20rpx;
  116. font-size: 32upx;
  117. font-family: PingFang SC;
  118. color: #333;
  119. }
  120. .line-h{
  121. margin: 15rpx 0rpx;
  122. border-bottom: 1rpx dashed #d4d4d4;
  123. }
  124. .tabs{
  125. width: 100%;
  126. margin: 20rpx 0rpx;
  127. display: flex;
  128. justify-content: space-between;
  129. align-items: center;
  130. // border: 1rpx solid #018C39;
  131. border-radius: 30rpx;
  132. line-height: 60rpx;
  133. .tab1{
  134. border-radius: 30rpx 0rpx 0rpx 30rpx;
  135. width: 25%;
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. background-color: #fff;
  140. color: #4F575A;
  141. font-size: 28upx;
  142. font-weight: bold;
  143. font-family: PingFang SC;
  144. }
  145. .tab2{
  146. width: 25%;
  147. display: flex;
  148. justify-content: center;
  149. align-items: center;
  150. background-color: #fff;
  151. color: #4F575A;
  152. font-size: 28upx;
  153. font-weight: bold;
  154. font-family: PingFang SC;
  155. }
  156. .tab3{
  157. width: 25%;
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. background-color: #fff;
  162. color: #4F575A;
  163. font-size: 28upx;
  164. font-weight: bold;
  165. font-family: PingFang SC;
  166. }
  167. .tab4{
  168. border-radius: 0rpx 30rpx 30rpx 0rpx;
  169. width: 25%;
  170. display: flex;
  171. justify-content: center;
  172. align-items: center;
  173. background-color: #fff;
  174. color: #4F575A;
  175. font-size: 28upx;
  176. font-weight: bold;
  177. font-family: PingFang SC;
  178. }
  179. .active{
  180. background-color: #018C39;
  181. color: #fff;
  182. }
  183. }
  184. }
  185. }
  186. </style>