vesselDetails.vue 4.3 KB

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