famousPrescribeDetails.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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.prescribeName}}</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="tabs">
  17. <view @click="tabClick(1)" :class="tabIndex==1?'tab1 active':'tab1'">
  18. 基本用法
  19. </view>
  20. <view @click="tabClick(2)" :class="tabIndex==2?'tab2 active':'tab2'">
  21. 药物作用
  22. </view>
  23. <view @click="tabClick(3)" :class="tabIndex==3?'tab3 active':'tab3'">
  24. 用药方法
  25. </view>
  26. <view @click="tabClick(4)" :class="tabIndex==4?'tab4 active':'tab4'">
  27. 注意事项
  28. </view>
  29. </view>
  30. <view class="content" v-if="tabIndex==1" v-html="item.descs">
  31. </view>
  32. <view class="content" v-if="tabIndex==2" v-html="item.action">
  33. </view>
  34. <view class="content" v-if="tabIndex==3" v-html="item.usageMethod">
  35. </view>
  36. <view class="content" v-if="tabIndex==4" v-html="item.msg">
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {getFamousPrescribeById} from '@/api/index'
  43. export default {
  44. data() {
  45. return {
  46. tabIndex:1,
  47. id:null,
  48. item:{},
  49. };
  50. },
  51. onLoad(option) {
  52. this.id=option.id;
  53. },
  54. onShow() {
  55. this.getFamousPrescribeById();
  56. },
  57. onShareAppMessage(res) {
  58. if(this.utils.isLogin()){
  59. return {
  60. title: this.item.prescribeName,
  61. path: '/pages_index/famousPrescribeDetails?id='+this.id,
  62. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  63. }
  64. }
  65. },
  66. //分享到朋友圈
  67. onShareTimeline(res) {
  68. if(this.utils.isLogin()){
  69. return {
  70. title: this.item.title,
  71. imageUrl: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com/fs/20250115/1736944490230.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  72. }
  73. }
  74. },
  75. methods:{
  76. tabClick(index){
  77. this.tabIndex=index;
  78. },
  79. getFamousPrescribeById(){
  80. let data = {id:this.id};
  81. getFamousPrescribeById(data).then(
  82. res => {
  83. if(res.code==200){
  84. this.item=res.data;
  85. }else{
  86. uni.showToast({
  87. icon:'none',
  88. title: "请求失败",
  89. });
  90. }
  91. },
  92. rej => {}
  93. );
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. page{
  100. height: 100%;
  101. }
  102. .content{
  103. height: 100%;
  104. image{
  105. height:450rpx;
  106. width:100%;
  107. }
  108. .detail-cont{
  109. flex: 1;
  110. padding: 20upx;
  111. overflow-y: auto;
  112. .title-box{
  113. width: 100%;
  114. display: flex;
  115. justify-content: flex-start;
  116. align-items: center;
  117. .line{
  118. border-radius: 5rpx;
  119. width: 8rpx;
  120. height:30rpx;
  121. background-color: #018C39;
  122. }
  123. .title{
  124. margin-left: 15rpx;
  125. font-size: 40upx;
  126. font-family: PingFang SC;
  127. font-weight: bold;
  128. color: #333;
  129. }
  130. .title-py{
  131. margin-left: 15rpx;
  132. font-size: 32upx;
  133. font-family: PingFang SC;
  134. color: #333;
  135. }
  136. }
  137. .desc{
  138. margin-top: 20rpx;
  139. font-size: 32upx;
  140. font-family: PingFang SC;
  141. color: #333;
  142. }
  143. .line-h{
  144. margin: 15rpx 0rpx;
  145. border-bottom: 1rpx dashed #d4d4d4;
  146. }
  147. .tabs{
  148. width: 100%;
  149. margin: 20rpx 0rpx;
  150. display: flex;
  151. justify-content: space-between;
  152. align-items: center;
  153. // border: 1rpx solid #018C39;
  154. border-radius: 30rpx;
  155. line-height: 60rpx;
  156. .tab1{
  157. border-radius: 30rpx 0rpx 0rpx 30rpx;
  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. .tab2{
  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. .tab3{
  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. .tab4{
  191. border-radius: 0rpx 30rpx 30rpx 0rpx;
  192. width: 25%;
  193. display: flex;
  194. justify-content: center;
  195. align-items: center;
  196. background-color: #fff;
  197. color: #4F575A;
  198. font-size: 28upx;
  199. font-weight: bold;
  200. font-family: PingFang SC;
  201. }
  202. .active{
  203. background-color: #018C39;
  204. color: #fff;
  205. }
  206. }
  207. }
  208. }
  209. </style>