inquirySelect.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="content">
  3. <view class="bg">
  4. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/f06ec63771984f3b9f9aa65eb0c17eeb.png"></image>
  5. </view>
  6. <view class="title">20秒快速匹配{{inquiryType==1?"专家医生":"执业药师"}}</view>
  7. <view class="cont" >
  8. <view class="inquiry-item" v-if="price1!=null" @click="doInquiryForm(price1)">
  9. <view class="left" >
  10. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/939cf3ad7d1a4186a7195e84a1db84bf.png"></image>
  11. <view class="inquiry-cont" v-if="inquiryType==1">
  12. <view class="name">图文问诊 {{price1.price}}/次</view>
  13. <view class="desc">和医生1对1在线图文问诊</view>
  14. </view>
  15. <view class="inquiry-cont" v-if="inquiryType==3">
  16. <view class="name">图文咨询 {{price1.price}}/次</view>
  17. <view class="desc">和药师1对1在线图文咨询</view>
  18. </view>
  19. </view>
  20. <view class="right x-ac">
  21. <view v-if="isShare" class="btn share" @click.stop="doShare(item,price1)">分享</view>
  22. <image src="/static/images/icon_arrow_r.png"></image>
  23. </view>
  24. </view>
  25. <view class="inquiry-item" v-if="price2!=null&&inquiryType==1" @click="doInquiryForm(price2)">
  26. <view class="left" >
  27. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/cf80011807af45c9af1bea6c4cf4bb3a.png"></image>
  28. <view class="inquiry-cont" v-if="inquiryType==1">
  29. <view class="name">视频问诊 {{price2.price}}/次</view>
  30. <view class="desc">和医生1对1在线视频问诊</view>
  31. </view>
  32. <view class="inquiry-cont" v-if="inquiryType==3">
  33. <view class="name">图文咨询 {{price2.price}}/次</view>
  34. <view class="desc">和药师1对1在线视频咨询</view>
  35. </view>
  36. </view>
  37. <view class="right x-ac">
  38. <view v-if="isShare" class="btn share" @click.stop="doShare(item,price2)">分享</view>
  39. <image src="/static/images/icon_arrow_r.png"></image>
  40. </view>
  41. </view>
  42. </view>
  43. <u-popup :show="showShare" @close="showShare = false" >
  44. <share-box :shareItem="shareItem" @closeShare='showShare = false' ></share-box>
  45. </u-popup>
  46. </view>
  47. </template>
  48. <script>
  49. import {getConfigByKey} from '@/api/common.js'
  50. export default {
  51. data() {
  52. return {
  53. isShare:null,
  54. companyId:null,
  55. companyUserId:null,
  56. inquiryType:null,
  57. price1:null,
  58. price2:null,
  59. isH5:false,
  60. showShare:false,
  61. shareItem:{ imageUrl:"",title:"",path:"",isMini:true },
  62. }
  63. },
  64. onLoad(options) {
  65. if(!this.$isEmpty(options.isShare)){
  66. this.isShare=options.isShare
  67. }
  68. this.inquiryType=options.inquiryType;
  69. if(!this.$isEmpty(options.companyId)){
  70. this.companyId=options.companyId == 'undefined' || options.companyId == 'null' ? null: options.companyId
  71. }
  72. if(!this.$isEmpty(options.companyUserId)){
  73. this.companyUserId=options.companyUserId == 'undefined' || options.companyUserId == 'null'? null: options.companyUserId
  74. }
  75. //#ifdef H5
  76. this.isH5=true;
  77. //#endif
  78. this.inquiryType=options.inquiryType;
  79. if(this.inquiryType==3){
  80. uni.setNavigationBarTitle({
  81. title:"药师咨询"
  82. })
  83. this.typeText="药师"
  84. }
  85. },
  86. onShow() {
  87. if(!this.$isLogin()) {
  88. uni.navigateTo({
  89. url: '/pages/auth/loginIndex'
  90. })
  91. return
  92. }
  93. this.getConfigByKey();
  94. },
  95. onShareAppMessage(res) {
  96. //禁止二次转发--
  97. uni.showShareMenu({
  98. withShareTicket: true
  99. });
  100. wx.updateShareMenu({
  101. isPrivateMessage: true,
  102. withShareTicket: false,
  103. success(res) {
  104. console.log('updateShareMenu: ', res);
  105. },
  106. fail() {}
  107. }); //禁止二次转发--end
  108. return {
  109. title: "御君方互联网医院--健康会诊",
  110. path: "/pages/store/inquirySelect?inquiryType=3&companyId="+this.companyId+"&companyUserId="+this.companyUserId
  111. }
  112. },
  113. methods: {
  114. getConfigByKey(){
  115. let data = {key:"his.inquiryConfig"};
  116. getConfigByKey(data).then(
  117. res => {
  118. if(res.code==200){
  119. var data=JSON.parse(res.data);
  120. this.price1 = data.prices.find((item,index)=>item.type=== 1)
  121. this.price2 = data.prices.find((item,index)=>item.type=== 2)
  122. }else{
  123. uni.showToast({
  124. icon:'none',
  125. title: "请求失败",
  126. });
  127. }
  128. },
  129. rej => {}
  130. );
  131. },
  132. doInquiryForm(price){
  133. if(this.$isLogin()){
  134. if(this.inquiryType==1){
  135. uni.navigateTo({
  136. url: "/pages/store/inquiryForm1?inquiryType="+this.inquiryType+"&orderType="+price.type
  137. })
  138. }
  139. else if(this.inquiryType==3){
  140. uni.navigateTo({
  141. url: "/pages/store/inquiryForm3?inquiryType="+this.inquiryType+"&orderType="+price.type+"&companyId="+this.companyId+'&companyUserId='+this.companyUserId
  142. })
  143. }
  144. }
  145. },
  146. doShare(item,price){
  147. if(this.isH5){
  148. return;
  149. }
  150. this.shareItem.imageUrl="../../static/image/course/zyzd.png";
  151. this.shareItem.isMini=true;
  152. let url = ''
  153. if(this.inquiryType==1){
  154. this.shareItem.path="/pages_order/inquiryForm1?inquiryType="+this.inquiryType+"&orderType="+price.type;
  155. url = "/pages/store/inquiryForm1?inquiryType="+this.inquiryType+"&orderType="+price.type;
  156. this.shareItem.title="图文问诊 "+price.price+"/次";
  157. }
  158. else{
  159. this.shareItem.path="/pages_order/inquiryForm3?inquiryType="+this.inquiryType+"&orderType="+price.type+"&companyId="+this.companyId+'&companyUserId='+this.companyUserId;
  160. url = "/pages/store/inquiryForm3?inquiryType="+this.inquiryType+"&orderType="+price.type+"&companyId="+this.companyId+'&companyUserId='+this.companyUserId;
  161. this.shareItem.title="视频问诊 "+price.price+"/次";
  162. }
  163. console.log("qxj share path:"+this.shareItem.path);
  164. let cdn=uni.getStorageSync('h5Path');
  165. this.shareItem.url=cdn+url;
  166. this.showShare=true;
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. page{
  173. background: #f1f6fc;
  174. }
  175. </style>
  176. <style scoped lang="scss">
  177. .content{
  178. position: relative;
  179. .bg{
  180. display: flex;
  181. align-items: center;
  182. justify-content: center;
  183. width: 100%;
  184. }
  185. .title{
  186. margin: 30rpx;
  187. display: flex;
  188. align-items: center;
  189. justify-content: center;
  190. font-size: 32upx;
  191. font-family: PingFang SC;
  192. font-weight: bold;
  193. color: #111111;
  194. }
  195. .cont{
  196. margin: 30rpx;
  197. display: flex;
  198. flex-direction: column;
  199. align-items: center;
  200. justify-content: center;
  201. .inquiry-item{
  202. margin: 15rpx 0rpx;
  203. padding: 50rpx 30rpx;
  204. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  205. background-color: #fff;
  206. border-radius: 15rpx;
  207. width: 100%;
  208. display: flex;
  209. align-items: center;
  210. justify-content: space-between;
  211. .left{
  212. display: flex;
  213. align-items: center;
  214. justify-content: flex-start;
  215. image{
  216. width: 100rpx;
  217. height:100rpx;
  218. }
  219. .inquiry-cont{
  220. margin-left: 20rpx;
  221. display: flex;
  222. flex-direction: column;
  223. align-items: flex-start;
  224. justify-content: flex-start;
  225. .name{
  226. font-size: 32upx;
  227. font-family: PingFang SC;
  228. font-weight: bold;
  229. color: #111111;
  230. }
  231. .desc{
  232. margin-top: 15rpx;
  233. font-size: 28upx;
  234. font-family: PingFang SC;
  235. color: #9a9a9c;
  236. }
  237. }
  238. }
  239. .right{
  240. image{
  241. width: 30rpx;
  242. height:30rpx;
  243. }
  244. }
  245. }
  246. .btn{
  247. width: 100upx;
  248. height: 64upx;
  249. line-height: 64upx;
  250. font-size: 26upx;
  251. font-family: PingFang SC;
  252. font-weight: 500;
  253. text-align: center;
  254. border-radius: 30upx;
  255. margin-right: 20rpx;
  256. }
  257. .share{
  258. border:2rpx solid #FF5C03;
  259. color: #FF5C03;
  260. margin-top: 10rpx;
  261. }
  262. }
  263. }
  264. </style>