vesselDetails.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. import { mapGetters } from 'vuex';
  24. export default {
  25. data() {
  26. return {
  27. tabIndex:1,
  28. item:{},
  29. };
  30. },
  31. onLoad(option) {
  32. this.id=option.id;
  33. },
  34. onShow() {
  35. this.getVesselById();
  36. },
  37. computed: {
  38. ...mapGetters(['logoimg']),
  39. },
  40. watch: {
  41. logoimg: {
  42. immediate: true, // 页面一进入就检查一次
  43. handler(val) {
  44. return val
  45. }
  46. },
  47. },
  48. //发送给朋友
  49. onShareAppMessage(res) {
  50. if(this.utils.isLogin()){
  51. return {
  52. title: this.item.vesselName,
  53. path: '/pages_index/vesselDetails?id='+this.id,
  54. imageUrl:this.logoimg//分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  55. }
  56. }
  57. },
  58. //分享到朋友圈
  59. onShareTimeline(res) {
  60. if(this.utils.isLogin()){
  61. return {
  62. title: this.item.vesselName,
  63. imageUrl: this.logoimg //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  64. }
  65. }
  66. },
  67. methods:{
  68. getVesselById(){
  69. let data = {id:this.id};
  70. getVesselById(data).then(
  71. res => {
  72. if(res.code==200){
  73. this.item=res.data;
  74. }else{
  75. uni.showToast({
  76. icon:'none',
  77. title: "请求失败",
  78. });
  79. }
  80. },
  81. rej => {}
  82. );
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. page{
  89. height: 100%;
  90. }
  91. .content{
  92. height: 100%;
  93. image{
  94. height:450rpx;
  95. width:100%;
  96. }
  97. .detail-cont{
  98. flex: 1;
  99. padding: 20upx;
  100. overflow-y: auto;
  101. .title-box{
  102. width: 100%;
  103. display: flex;
  104. justify-content: flex-start;
  105. align-items: center;
  106. .line{
  107. border-radius: 5rpx;
  108. width: 8rpx;
  109. height:30rpx;
  110. background-color: #2BC7B9;
  111. }
  112. .title{
  113. margin-left: 15rpx;
  114. font-size: 40upx;
  115. font-family: PingFang SC;
  116. font-weight: bold;
  117. color: #333;
  118. }
  119. .title-py{
  120. margin-left: 15rpx;
  121. font-size: 32upx;
  122. font-family: PingFang SC;
  123. color: #333;
  124. }
  125. }
  126. .desc{
  127. margin-top: 20rpx;
  128. font-size: 32upx;
  129. font-family: PingFang SC;
  130. color: #333;
  131. }
  132. .line-h{
  133. margin: 15rpx 0rpx;
  134. border-bottom: 1rpx dashed #d4d4d4;
  135. }
  136. .tabs{
  137. width: 100%;
  138. margin: 20rpx 0rpx;
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. // border: 1rpx solid #2BC7B9;
  143. border-radius: 30rpx;
  144. line-height: 60rpx;
  145. .tab1{
  146. border-radius: 30rpx 0rpx 0rpx 30rpx;
  147. width: 25%;
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. background-color: #fff;
  152. color: #4F575A;
  153. font-size: 28upx;
  154. font-weight: bold;
  155. font-family: PingFang SC;
  156. }
  157. .tab2{
  158. width: 25%;
  159. display: flex;
  160. justify-content: center;
  161. align-items: center;
  162. background-color: #fff;
  163. color: #4F575A;
  164. font-size: 28upx;
  165. font-weight: bold;
  166. font-family: PingFang SC;
  167. }
  168. .tab3{
  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. .tab4{
  180. border-radius: 0rpx 30rpx 30rpx 0rpx;
  181. width: 25%;
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. background-color: #fff;
  186. color: #4F575A;
  187. font-size: 28upx;
  188. font-weight: bold;
  189. font-family: PingFang SC;
  190. }
  191. .active{
  192. background-color: #2BC7B9;
  193. color: #fff;
  194. }
  195. }
  196. }
  197. }
  198. </style>