famousPrescribeDetails.vue 5.0 KB

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