homeIndex.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. <template>
  2. <view class="home-content">
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" top="0" bottom="20" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
  4. <!-- 搜索 -->
  5. <view class="search-box" v-if="false">
  6. <view class="left">
  7. <image src="@/static/image/home1/search_icon.png" mode=""></image>
  8. <input class="input-text" disabled="true" type="text" placeholder-class="place-hold" value="输入疾病 | 科室 | 医生 | 知识" placeholder=""/>
  9. </view>
  10. <view class="right">
  11. <button class="button" @click="showQidai()">搜索</button>
  12. </view>
  13. </view>
  14. <!-- banner -->
  15. <view class="swiper-box">
  16. <swiper class="swiper" style="height: 233rpx;" circular :indicator-dots="true" :autoplay="true" :interval="3000"
  17. :duration="1000">
  18. <swiper-item v-for="(url,index) in advImgs" :key="index" class="swiper-item" @click="handleAdvClick(index)">
  19. <image style="width: 100%;height: 100%;" :src="url" mode="aspectFill"></image>
  20. </swiper-item>
  21. </swiper>
  22. </view>
  23. <!-- ai舌诊 -->
  24. <view class="nav" id="indexguide1">
  25. <view class="grid-item" v-for="(item ,index) in navList" :key="index">
  26. <view class="grid-item-box" @tap="topNavTo(item.pageUrl,index)">
  27. <image class="image" :src="item.img" mode="aspectFill" />
  28. <text class="text">{{item.name}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 横向banner 1分钱起 -->
  33. <scroll-view scroll-x="true" class="scroll-X">
  34. <view class="scroll-item zyss_bg" v-for="(item,index) in midAdvs" :key="index" @tap="midAvTap(item,index)">
  35. <image class="bg_img" :src="item.imageUrl" mode="widthFix"></image>
  36. </view>
  37. </scroll-view>
  38. <!-- 快速问诊 -->
  39. <!-- <view class="banner-nav" id="indexguide2">
  40. <view class="banner-nav-item kswz-bg" @tap="loginNavTo('/pages/doctor/doctorList')">
  41. <view class="title">快速问诊</view>
  42. <view>专业医师快速</view>
  43. </view>
  44. <view class="banner-nav-item jkhz-bg" @tap="loginNavTo('/pages/store/inquirySelectType?isShare=1')">
  45. <view class="title">健康会诊</view>
  46. <view>权威专家为您</view>
  47. <view class="jkhz">答疑解惑</view>
  48. </view>
  49. <view class="banner-nav-item yyzx-bg" @click="loginNavTo('/pages/store/inquirySelect?inquiryType=3&isShare=1')">
  50. <view class="title">用药咨询</view>
  51. <view>执业药师提供</view>
  52. <view class="yyzx">用药指导</view>
  53. </view>
  54. <view class="banner-nav-item zjyz-bg" @tap="loginNavTo('/pages/doctor/doctorList')">
  55. <view class="title">专家约诊</view>
  56. <view>在线预约专家</view>
  57. <view class="zjyz">诊疗服务</view>
  58. </view>
  59. </view> -->
  60. <!-- 百事通 -->
  61. <template v-if='ailist&&ailist.length>0'>
  62. <view class="box-nav">
  63. <view class="title">百事通</view>
  64. <view class="box-nav-right" @click="loginNavTo('/pages/ai/list')">
  65. <text>更多</text>
  66. <image class="right-arrow" src="@/static/image/home1/my_right_arrow.png" mode="aspectFill"></image>
  67. </view>
  68. </view>
  69. <view class="ai-banner">
  70. <swiper class="ai-banner-swiper" :current="current" :style="{height: swHeight + 'rpx'}" :autoplay="true" circular interval="3000" duration="1000" @animationfinish="animationfinish">
  71. <swiper-item class="ai-banner-swiper-item" v-for="(group, index) in ailist" :key="index">
  72. <image class="ai-banner-img" v-for="(item,idx) in group" :key="idx" :src="item.recommendImgUrl" mode="aspectFill" @click="loginNavTo('/pages/ai/chat?roleId='+item.roleId+'&roleName='+item.roleName+'&sessionId='+item.sessionId || '')"></image>
  73. </swiper-item>
  74. </swiper>
  75. </view>
  76. </template>
  77. <!-- 健康自测 -->
  78. <!-- <view id="indexguide3">
  79. <view class="box-nav">
  80. <view class="title">健康自测</view>
  81. <view class="box-nav-right" @click="navTo('/pages/article/testList')">
  82. <text>更多自测</text>
  83. <image class="right-arrow" src="@/static/image/home1/my_right_arrow.png" mode="aspectFill"></image>
  84. </view>
  85. </view>
  86. <view class="selfrated-health">
  87. <view class="selfrated-health-item" @click="navTo('/pages/article/testDetails?tempId=5')">
  88. <image src="@/static/image/home1/icon/zytz_icon.png" mode="aspectFill"></image>
  89. <view>中医体质</view>
  90. </view>
  91. <view class="selfrated-health-item" @click="navTo('/pages/article/testDetails?tempId=8')">
  92. <image src="@/static/image/home1/icon/xnxg_icon.png" mode="aspectFill"></image>
  93. <view>心脑血管</view>
  94. </view>
  95. <view class="selfrated-health-item" @click="navTo('/pages/article/testDetails?tempId=14')">
  96. <image src="@/static/image/home1/icon/nxjk_icon.png" mode="aspectFill"></image>
  97. <view>男性健康</view>
  98. </view>
  99. <view class="selfrated-health-item" @click="navTo('/pages/article/testDetails?tempId=18')">
  100. <image src="@/static/image/home1/icon/nvxjk_icon.png" mode="aspectFill"></image>
  101. <view>女性健康</view>
  102. </view>
  103. </view>
  104. </view>
  105. -->
  106. <!-- 推荐医生 -->
  107. <!-- <view class="box-nav">
  108. <view class="title">推荐医生</view>
  109. <view class="box-nav-right" @tap="navTo('/pages/doctor/doctorList')">
  110. <text>更多医生</text>
  111. <image class="right-arrow" src="@/static/image/home1/my_right_arrow.png" mode="aspectFill"></image>
  112. </view>
  113. </view>
  114. <swiper class="swiper-doctor" circular :autoplay="true" interval="3000" duration="1000" display-multiple-items='2' next-margin="20px">
  115. <swiper-item v-for="(item,index) in doctors" :key="index">
  116. <docterItem class="gapitem" :item="item" @click.native="navTo('/pages/doctor/doctorDetails?doctorId='+item.doctorId)"></docterItem>
  117. </swiper-item>
  118. </swiper> -->
  119. <!-- 养生干货 -->
  120. <template v-if="articles.length>0">
  121. <view class="box-nav">
  122. <view class="title">养生干货</view>
  123. <view class="box-nav-right" @click="navTo('/pages/article/articleList')">
  124. <text>更多</text>
  125. <image class="right-arrow" src="@/static/image/home1/my_right_arrow.png" mode="aspectFill"></image>
  126. </view>
  127. </view>
  128. <view style="padding: 0 24rpx;">
  129. <view class="article-box">
  130. <view class="item" @click="navTo('/pages/article/articleDetails?articleId='+item.articleId)" v-for="(item,index) in articles" :key="index">
  131. <view class="left">
  132. <view class="title textTwo">
  133. {{item.title}}
  134. </view>
  135. <view class="views">
  136. 浏览量 {{item.views}}
  137. </view>
  138. </view>
  139. <view class="right">
  140. <image :src="item.imageUrl"></image>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <!-- 健康疗法 -->
  147. <!-- <view class="box-nav" id="indexguide4">
  148. <view class="title">健康疗法</view>
  149. <view class="box-nav-right" @click="navTo('/pages/store/packageList')">
  150. <text>更多疗法</text>
  151. <image class="right-arrow" src="@/static/image/home1/my_right_arrow.png" mode="aspectFill"></image>
  152. </view>
  153. </view>
  154. <view class="box-goods">
  155. <goodsItem v-if="packages.length>0" class="gapitem indexguide4-child" v-for="(item,index) in packages" :key="index" :item=item @click.native="navTo('/pages/store/packageDetails?packageId='+item.packageId)" ></goodsItem>
  156. <view v-else class="es x-c es-h-200 indexguide4-child" style="width: 100%;">
  157. <view class="y-bc flex">
  158. <image src="../../../static/image/nodata.png" class="es-w-148 es-h-96 es-mt-20"></image>
  159. <view class="es-c-33 es-fs-26 x-c es-mt-20 es-mb-40">暂无疗法</view>
  160. </view>
  161. </view>
  162. </view> -->
  163. <!-- 签到弹窗 -->
  164. <signPop ref="signPop" :userSign="userSign" />
  165. <!-- <healthButlerPop :show="showMask" @close="closeAct" /> -->
  166. </mescroll-body>
  167. </view>
  168. </template>
  169. <script>
  170. import {getArticleList} from "@/api/article.js"
  171. import {getDoctorList} from '@/api/doctor.js'
  172. import {getPackageList} from '@/api/package.js'
  173. import docterItem from "../components/docterItem.vue";
  174. import goodsItem from "../components/goodsItem.vue"
  175. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  176. import mescrollBody from "@/uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.vue";
  177. // import permision from "@/js_sdk/wa-permission/permission.js"
  178. import { getAdvList,getAppAdvList} from '@/api/adv.js'
  179. import { getNewcomerBenefits,getUserSign} from '@/api/integral';
  180. import { getLocation } from '@/api/index.js'
  181. import { getRecommendRoleList } from "@/api/ai.js"
  182. // #ifdef APP-PLUS
  183. const idCode = uni.requireNativePlugin('Ba-IdCode')
  184. // #endif
  185. // const idCode = uni.requireNativePlugin('Ba-IdCode')
  186. export default {
  187. mixins: [MescrollMixin], // 使用mixin
  188. components: {
  189. mescrollBody,
  190. docterItem,
  191. goodsItem,
  192. },
  193. data() {
  194. return {
  195. keyword:"",
  196. advImgs:[],
  197. advs:[],
  198. midAdvs:[],
  199. doctors:[],
  200. packages:[],
  201. company:null,
  202. newCustomerCounts:0,
  203. fullCustomerCounts:0,
  204. myCustomerCounts:0,
  205. dayOrderCounts:0,
  206. doBuyOrderCounts:0,
  207. mescroll: null,
  208. downOption: { //下拉刷新
  209. use:true,
  210. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  211. },
  212. upOption: { //上拉加载
  213. auto: false, // 不自动加载
  214. page: {
  215. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  216. size: 10 // 每页数据的数量
  217. },
  218. noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  219. empty: {
  220. tip: '~ 暂无疗法 ~' // 提示
  221. // btnText: '去看看'
  222. },
  223. use:false
  224. },
  225. tdlist: [],
  226. show:false,
  227. user:{
  228. avatar:"",
  229. userName:this.$qconfig.appName,
  230. mobile:""
  231. },
  232. userScrollTop: 0,
  233. fixedTop: false, // 是否固定头部
  234. connectStatus: '未链接',
  235. deviceToken: '',
  236. udid: '',
  237. registrationID: '',
  238. appkey: '',
  239. imageList:["../../../static/image/home/banner.png"],
  240. userBenefits:{},
  241. userSign:{},
  242. navList: [
  243. // {
  244. // img: "/static/image/home1/icon/aiTongue.png",
  245. // name: "AI舌诊",
  246. // pageUrl:"/pages/user/tongue/index"
  247. // },
  248. {
  249. img: "/static/image/home1/icon/yssl_icon.png",
  250. name: "药膳食疗",
  251. pageUrl:"/pages/article/medicatedFoodList"
  252. },
  253. {
  254. img: "/static/image/home1/icon/jlxw_icon.png",
  255. name: "经络穴位",
  256. pageUrl:"/pages/article/vesselList"
  257. },
  258. // {
  259. // img: "/static/image/home1/icon/wdzq_icon.png",
  260. // name: "问答专区",
  261. // pageUrl:"/pages/article/questionsList"
  262. // },
  263. // {
  264. // img: "/static/image/home1/icon/jkzc_icon.png",
  265. // name: "健康自测",
  266. // pageUrl:"/pages/article/testList"
  267. // },
  268. {
  269. img: "/static/image/home1/icon/jb_icon.png",
  270. name: "疾病",
  271. pageUrl:"/pages/article/diseaseList"
  272. }, {
  273. img: "/static/image/home1/icon/zytj_icon1.png",
  274. name: "中医图解",
  275. pageUrl:"/pages/article/chineseMedicineList"
  276. },
  277. {
  278. img: "/static/image/home1/icon/mfjy_icon.png",
  279. name: "名方今用",
  280. pageUrl:"/pages/article/famousPrescribeList"
  281. }, {
  282. img:"/static/image/home1/icon/ys_icon.png",
  283. name: "养生科普",
  284. pageUrl:"/pages/doctor/doctorArticleList"
  285. }
  286. , {
  287. img: "/static/image/home1/icon/yssp_icon.png",
  288. name: "讲堂",
  289. pageUrl:"/pages/course/index"
  290. }
  291. ],
  292. step: {
  293. name: 'indexguide',
  294. guideList: [{
  295. el: '',
  296. tips: '上下滑动,了解中康未来',
  297. next: '',
  298. },{
  299. el: '#indexguide1',
  300. tips: '药膳、经络、疾病医学百科知识快速查询',
  301. next: '下一步',
  302. },{
  303. el: '#indexguide2',
  304. tips: '权威医生、药师实时在线咨询',
  305. next: '下一步',
  306. },{
  307. el: '#indexguide3',
  308. tips: '免费健康自测,了解自身健康情况',
  309. next: '下一步',
  310. },{
  311. el: '#indexguide4',
  312. childEl: ".indexguide4-child",
  313. tips: '购买健康疗法享健康',
  314. next: '完成',
  315. }]
  316. },
  317. guideIndex:null,
  318. showMask:true,
  319. ailist: [],
  320. current: 0,
  321. swHeight: 0,
  322. articles:[],
  323. }
  324. },
  325. created() {
  326. this.guideIndex=uni.getStorageSync("indexguide");
  327. if(this.$isLogin()){
  328. this.getUserSign();
  329. }else{
  330. let signStr="[{\"signNum\":10,\"sort\":1,\"day\":\"第1天\"},{\"signNum\":20,\"sort\":2,\"day\":\"第2天\"},{\"signNum\":30,\"sort\":3,\"day\":\"第3天\"},{\"signNum\":40,\"sort\":4,\"day\":\"第4天\"},{\"signNum\":50,\"sort\":5,\"day\":\"第5天\"},{\"signNum\":50,\"sort\":6,\"day\":\"第6天\"},{\"signNum\":50,\"sort\":7,\"day\":\"第7天\"}]";
  331. this.$nextTick(()=>{
  332. this.userSign={"signNum":0,"isDaySign":0,"integral":0,"sign":JSON.parse(signStr) };
  333. if(this.guideIndex){
  334. this.$refs.signPop.open();
  335. }
  336. });
  337. }
  338. uni.$on('getIndexScanCode',(data)=>{
  339. this.$handleBindCompanyFsUser(data)
  340. })
  341. },
  342. beforeDestroy() {
  343. uni.$off("getIndexScanCode")
  344. },
  345. methods: {
  346. closeAct(){
  347. this.showMask=false;
  348. },
  349. initReady() {
  350. },
  351. initShow() {
  352. this.getAdvList();
  353. this.getAppAdvList();
  354. // this.getDoctorList();
  355. this.getArticleList();
  356. // this.getPackageList(1);
  357. this.getAiTui()
  358. },
  359. mescrollInit(mescroll) {
  360. this.mescroll = mescroll;
  361. },
  362. /*下拉刷新的回调 */
  363. downCallback(mescroll) {
  364. this.getAiTui()
  365. setTimeout(()=>{
  366. this.mescroll.endSuccess();
  367. }, 500)
  368. },
  369. getAiTui() {
  370. getRecommendRoleList().then((res=>{
  371. if(res.code == 200) {
  372. const result = [];
  373. while (res.list&&res.list.length) {
  374. result.push(res.list.splice(0, 4)); // 提取前 groupSize 个元素并存储
  375. }
  376. this.ailist = result
  377. this.updateSwiperHeight()
  378. }
  379. }))
  380. },
  381. animationfinish(event) {
  382. this.current = event.detail.current
  383. this.updateSwiperHeight()
  384. },
  385. updateSwiperHeight() {
  386. if(this.ailist[this.current].length >2 ) {
  387. this.swHeight=340;
  388. } else {
  389. this.swHeight=160;
  390. }
  391. },
  392. groupArray(arr, groupSize) {
  393. const result = [];
  394. for (let i = 0; i < arr.length; i += groupSize) {
  395. const group = arr.slice(i, i + groupSize);
  396. const groupName = `arry${Math.floor(i / groupSize) + 1}`; // 生成动态键名
  397. const groupObject = {};
  398. groupObject[groupName] = group;
  399. result.push(groupObject);
  400. }
  401. return result;
  402. },
  403. getAdvList() {
  404. //联网加载数据
  405. var that = this;
  406. var data = {
  407. advType:1
  408. };
  409. getAdvList(data).then(res => {
  410. if(res.code==200){
  411. that.advImgs=[];
  412. that.advs=[];
  413. res.data.forEach(function(element) {
  414. if(element.imageUrl!=null&&element.imageUrl!=""){
  415. that.advs.push(element);
  416. that.advImgs.push(element.imageUrl);
  417. }
  418. });
  419. //that.advImgs=["https://zkzh-2025.oss-cn-beijing.aliyuncs.com/fs/20250823/c33ae9d16c994b8a8a96742a872194f3.jpg"];
  420. }else{
  421. uni.showToast({
  422. icon:'none',
  423. title: "请求失败",
  424. });
  425. }
  426. });
  427. },
  428. getAppAdvList() {
  429. getAppAdvList().then(res => {
  430. if(res.code==200){
  431. this.midAdvs=res.data;
  432. }else{
  433. uni.showToast({icon:'none',title: "请求失败"});
  434. }
  435. });
  436. },
  437. getDoctorList() {
  438. //联网加载数据
  439. var that = this;
  440. var data = {
  441. isTui:1,
  442. pageNum:1,
  443. pageSize:10,
  444. };
  445. getDoctorList(data).then(res => {
  446. if(res.code==200){
  447. this.doctors=res.data.list;
  448. this.doctors.forEach(function(value,index,array){
  449. value.prices=JSON.parse(value.priceJson)
  450. });
  451. }else{
  452. uni.showToast({
  453. icon:'none',
  454. title: "请求失败",
  455. });
  456. }
  457. });
  458. },
  459. getArticleList() {
  460. let param = {
  461. isTui:1,
  462. pageNum:1,
  463. pageSize:10,
  464. };
  465. getArticleList(param).then(res => {
  466. if(res.code==200){
  467. this.articles=res.data.list;
  468. }else{
  469. uni.showToast({
  470. icon:'none',
  471. title: "请求失败",
  472. });
  473. }
  474. });
  475. },
  476. getPackageList(pageNum){
  477. //联网加载数据
  478. var that = this;
  479. var data = {
  480. isShow:1,
  481. pageNum:pageNum,
  482. pageSize:10
  483. };
  484. getPackageList(data).then(res => {
  485. if(res.code==200){
  486. this.packages=res.data.list;
  487. }else{
  488. uni.showToast({
  489. icon:'none',
  490. title: "请求失败"
  491. });
  492. }
  493. });
  494. },
  495. getUserSign(){
  496. getUserSign().then(res => {
  497. if(res.code==200){
  498. this.userSign={"signNum":res.signNum,"isDaySign":res.isDaySign,"integral":res.integral,"sign":JSON.parse(res.sign)};
  499. this.$nextTick(()=>{
  500. if(this.guideIndex && !res.isDaySign){
  501. this.$refs.signPop.open();
  502. }
  503. });
  504. }
  505. },
  506. rej => {}
  507. );
  508. },
  509. midAvTap(item,index){
  510. if(index==0){
  511. this.navToMinProgram();
  512. return;
  513. }
  514. // #ifndef MP-WEIXIN
  515. if(!this.$isEmpty(item.appAdvUrl)){
  516. this.navTo(item.appAdvUrl);
  517. }
  518. // #endif
  519. // #ifdef MP-WEIXIN
  520. if(!this.$isEmpty(item.advUrl)){
  521. this.navTo(item.advUrl);
  522. }
  523. // #endif
  524. },
  525. // 页面跳转
  526. navTo(url) {
  527. console.log("qxj navTo url:"+url);
  528. uni.navigateTo({
  529. url: url
  530. })
  531. },
  532. loginNavTo(url){
  533. if(!this.$isLogin()){
  534. this.$showLoginPage();
  535. return;
  536. }
  537. uni.navigateTo({
  538. url: url
  539. });
  540. },
  541. navVideo(){
  542. console.log("navVideo");
  543. uni.navigateTo({
  544. url: "/pages/course/video/living-app"
  545. });
  546. },
  547. showQidai(){
  548. //uni.showToast({title: "功能完善中,敬请期待...",icon:"none"});
  549. },
  550. handleAdvClick(index){
  551. var ad=this.advs[index];
  552. console.log(ad.appAdvUrl);
  553. if(ad.showType==1){
  554. uni.setStorageSync('url',ad.appAdvUrl);
  555. uni.navigateTo({
  556. url:"h5"
  557. })
  558. }
  559. else if(ad.showType==3){
  560. uni.setStorageSync('content',ad.content);
  561. uni.navigateTo({
  562. url:"content"
  563. })
  564. }
  565. else{
  566. uni.navigateTo({
  567. url:ad.appAdvUrl
  568. })
  569. }
  570. },
  571. search() {
  572. },
  573. topNavTo(url,index){
  574. if(index==0){
  575. //this.navTo(url);
  576. this.loginNavTo(url);
  577. }else{
  578. this.navTo(url);
  579. }
  580. },
  581. navToMinProgram(){
  582. // #ifdef APP-PLUS
  583. plus.share.getServices(res => {
  584. let sweixin = null;
  585. sweixin = res.find(i => i.id === 'weixin')
  586. if (sweixin) {
  587. // 分享跳转到微信小程序
  588. sweixin.launchMiniProgram({
  589. id: "gh_ed2db1ca5891",//零利润药房小程序原生id
  590. path:"pages/common/launch", // 打开小程序的页面路径,不传默认跳转首页
  591. type: 0 // 微信小程序版本类型,可取值: 0-正式版; 1-测试版; 2-体验版。 默认值为0。
  592. });
  593. }
  594. else {
  595. uni.showToast({title: '请安装微信',icon: 'none'})
  596. }
  597. }, err => {
  598. console.log("分享失败"); // 获取分享服务列表失败
  599. });
  600. // #endif
  601. }
  602. }
  603. }
  604. </script>
  605. <style scoped lang="scss">
  606. @mixin u-flex($flexD, $alignI, $justifyC) {
  607. display: flex;
  608. flex-direction: $flexD;
  609. align-items: $alignI;
  610. justify-content: $justifyC;
  611. }
  612. .bg-img{
  613. position: fixed;
  614. width: 100%;
  615. height: 524rpx;
  616. top: 0;
  617. left: 0;
  618. right: 0;
  619. bottom: 0;
  620. z-index: 0;
  621. }
  622. .bgConent{
  623. background-image: url("@/static/image/home/home_top_bg.png");
  624. background-repeat: no-repeat;
  625. background-size: 100%;
  626. background-color: #F4F7FA;
  627. position: absolute;
  628. width: 100%;
  629. height: 524rpx;
  630. top: 0;
  631. left: 0;
  632. right: 0;
  633. bottom: 0;
  634. z-index: 0;
  635. }
  636. .grace-page-header {
  637. position: fixed;
  638. width: 100%;
  639. left: 0;
  640. top: 0;
  641. z-index: 98;
  642. border-bottom: 0px solid #FFFFFF;
  643. .grace-page-status-bar {
  644. width: 100%;
  645. height: var(--status-bar-height);
  646. }
  647. .grace-page-header-nav {
  648. width: 100%;
  649. display: flex;
  650. flex-direction: row;
  651. flex-wrap: nowrap;
  652. align-items: center;
  653. justify-content: space-between;
  654. }
  655. }
  656. .nav_box{
  657. width: 100%;
  658. .status_bar {
  659. height: var(--status-bar-height);
  660. width: 100%;
  661. }
  662. .nav_bar {
  663. height: 44px;
  664. width: 100%;
  665. }
  666. }
  667. .title {
  668. font-family: PingFang SC, PingFang SC;
  669. font-weight: 500;
  670. font-size: 32rpx;
  671. color: #222222;
  672. line-height: 44rpx;
  673. }
  674. .home-content {
  675. width: 100%;
  676. box-sizing: border-box;
  677. // overflow: hidden;
  678. // margin-top: var(--status-bar-height);
  679. // padding-top: 24rpx;
  680. font-family: PingFang SC, PingFang SC;
  681. font-weight: 400;
  682. font-size: 24rpx;
  683. color: #999999;
  684. // background-image: url("@/static/image/home/home_top_bg.png");
  685. background-repeat: no-repeat;
  686. background-size: 100%;
  687. // box-sizing: border-box;
  688. padding-top: calc(var(--status-bar-height) + 44px);
  689. // padding-bottom: var(--window-bottom);
  690. // font-family: PingFang SC, PingFang SC;
  691. // font-weight: 400;
  692. // font-size: 24rpx;
  693. // color: #999999;
  694. position: relative;
  695. // z-index: 2;
  696. }
  697. .content-header {
  698. height: 80rpx;
  699. padding: 0 24rpx;
  700. @include u-flex(row, center, space-between);
  701. &-l {
  702. font-family: PingFang SC, PingFang SC;
  703. font-weight: 500;
  704. font-size: 26rpx;
  705. color: #FFFFFF;
  706. line-height: 28rpx;
  707. @include u-flex(row, center, flex-start);
  708. .address {
  709. width: 38rpx;
  710. height: 38rpx;
  711. margin-right: 6rpx;
  712. }
  713. .arrow_down {
  714. width: 24rpx;
  715. height: 24rpx;
  716. margin-left: 8rpx;
  717. }
  718. }
  719. &-r {
  720. @include u-flex(row, center, flex-start);
  721. view {
  722. font-family: PingFang SC, PingFang SC;
  723. font-weight: 400;
  724. font-size: 22rpx;
  725. color: #FFFFFF;
  726. line-height: 24rpx;
  727. @include u-flex(column, center, space-between);
  728. width: 80rpx;
  729. height: 80rpx;
  730. padding-top:2rpx;
  731. padding-bottom: 6rpx;
  732. }
  733. image {
  734. width: 40rpx;
  735. height: 40rpx;
  736. }
  737. }
  738. }
  739. .search-box {
  740. width: calc(100% - 60rpx);
  741. height: 70rpx;
  742. display: flex;
  743. flex-direction: row;
  744. align-items: center;
  745. justify-content: space-between;
  746. background: rgba(255, 255, 255, 0.3);
  747. border-radius: 34rpx;
  748. border: 2rpx solid #FFFFFF;
  749. border-right: none;
  750. margin:30rpx;
  751. margin-top: 10rpx;
  752. margin-bottom: 10rpx;
  753. padding-left: 30rpx;
  754. position: relative;
  755. z-index: 10;
  756. .left{
  757. display: flex;
  758. flex-direction: row;
  759. align-items: center;
  760. justify-content: flex-start;
  761. flex: 1;
  762. }
  763. image{
  764. width: 28upx;
  765. height: 28upx;
  766. margin-right: 16upx;
  767. }
  768. .input-text{
  769. color: #fff;
  770. font-size: 24rpx;
  771. height: 70rpx;
  772. line-height:70rpx ;
  773. width: 100%;
  774. }
  775. .button{
  776. background: #2583EB;
  777. border-radius: 29rpx;
  778. width: 108rpx;
  779. height: 54rpx;
  780. line-height: 54rpx;
  781. color: #fff;
  782. font-size: 26rpx;
  783. margin-right: 10rpx;
  784. }
  785. }
  786. ::v-deep .uni-searchbar__text-placeholder, .uni-input-placeholder{
  787. color: #fff;
  788. font-weight: 400;
  789. font-size: 24rpx;
  790. }
  791. .place-hold{
  792. color: #ffffff;
  793. font-weight: 400;
  794. font-size: 24rpx;
  795. }
  796. .search-box1 {
  797. height: 68rpx;
  798. margin: 26rpx 24rpx 10rpx 24rpx;
  799. background: rgba(255, 255, 255, 0.3);
  800. border-radius: 34rpx;
  801. border: 2rpx solid #FFFFFF;
  802. border-right: none;
  803. background-color: blue;
  804. overflow: hidden;
  805. @include u-flex(row, center, space-between);
  806. .search {
  807. flex: 1;
  808. padding: 0 0 0 12rpx;
  809. background-color: transparent;
  810. font-weight: 400;
  811. font-size: 24rpx;
  812. }
  813. image {
  814. width: 24rpx;
  815. height: 24rpx;
  816. }
  817. ::v-deep .uni-searchbar__text-placeholder, .uni-input-placeholder{
  818. color: #fff;
  819. font-weight: 400;
  820. font-size: 24rpx;
  821. }
  822. .search-text {
  823. flex-shrink: 0;
  824. width: 144rpx;
  825. height: 68rpx;
  826. background: #FFFFFF;
  827. border-radius: 34rpx 34rpx 34rpx 34rpx;
  828. font-family: PingFang SC, PingFang SC;
  829. font-weight: 600;
  830. font-size: 24rpx;
  831. color: #2583EB;
  832. line-height: 68rpx;
  833. text-align: center;
  834. }
  835. }
  836. .swiper-box {
  837. padding: 22rpx 0;
  838. padding-bottom: 0;
  839. .swiper {
  840. width: 702rpx;
  841. height: 228rpx;
  842. margin: 0 auto;
  843. // background: #E75848;
  844. border-radius: 20rpx;
  845. .swiper-item {
  846. width: 702rpx;
  847. height: 228rpx;
  848. image{
  849. border-radius: 20rpx;
  850. }
  851. }
  852. }
  853. ::v-deep {
  854. .uni-swiper-dot {
  855. width: 10rpx;
  856. height: 10rpx;
  857. background: rgba(255,255,255,0.5);
  858. }
  859. .uni-swiper-dot-active {
  860. width: 24rpx;
  861. height: 10rpx;
  862. background-color: #FFFFFF;
  863. border-radius: 5rpx 5rpx 5rpx 5rpx;
  864. }
  865. }
  866. }
  867. .nav {
  868. background: #FFFFFF;
  869. border-radius: 20rpx 20rpx 20rpx 20rpx;
  870. padding-top: 24rpx;
  871. margin: 24rpx 24rpx 0 24rpx;
  872. position: relative;
  873. z-index: 2;
  874. @include u-flex(row, center, flex-start);
  875. flex-wrap: wrap;
  876. .grid-item {
  877. width: 25%;
  878. }
  879. .grid-item-box {
  880. @include u-flex(column, center, flex-start);
  881. font-family: PingFang SC, PingFang SC;
  882. font-weight: 400;
  883. font-size: 24rpx;
  884. color: #222222;
  885. line-height: 28rpx;
  886. margin-bottom: 24rpx;
  887. .image {
  888. height: 88rpx;
  889. width: 88rpx;
  890. margin-bottom: 24rpx;
  891. }
  892. }
  893. }
  894. .scroll-X {
  895. white-space: nowrap;
  896. width: 100%;
  897. padding-left: 24rpx;
  898. box-sizing: border-box;
  899. margin-top: 24rpx;
  900. font-family: PingFang SC, PingFang SC;
  901. font-weight: 400;
  902. font-size: 24rpx;
  903. color: #757575;
  904. line-height: 28rpx;
  905. .scroll-item {
  906. display: inline-block;
  907. width: 216rpx;
  908. height: 132rpx;
  909. padding: 20rpx 24rpx 20rpx 20rpx;
  910. box-sizing: border-box;
  911. margin-right: 16rpx;
  912. border-radius: 16rpx 16rpx 16rpx 16rpx;
  913. border: 2rpx solid #FFFFFF;
  914. position: relative;
  915. .bg_img{
  916. position: absolute;
  917. width: calc(100% - 2rpx);
  918. height: 132rpx;
  919. left:0;
  920. right: 0;
  921. top:0;
  922. bottom:0;
  923. z-index: 0;
  924. }
  925. &-title {
  926. margin-bottom: 6rpx;
  927. }
  928. &-desc {
  929. width: 100%;
  930. @include u-flex(row, center, space-between)
  931. }
  932. .arrow_icon {
  933. height: 24rpx;
  934. width: 24rpx;
  935. }
  936. }
  937. .zyss_bg {
  938. background: url("@/static/image/home1/index_zyss_bg.png") no-repeat right top / 132rpx 132rpx,linear-gradient( 270deg, #FFF9F8 0%, #FFF3EF 100%);
  939. }
  940. .gjmz_bg {
  941. background: url("@/static/image/home1/index_gjmz_bg.png") no-repeat right top / 132rpx 132rpx,linear-gradient( 270deg, #FFFCF3 0%, #FFF9E8 100%);
  942. }
  943. .pfgl_bg {
  944. background: url("@/static/image/home1/index_pfgl_bg.png") no-repeat right top / 132rpx 132rpx,linear-gradient( 270deg, #F0F7FF 0%, #E0EEFF 100%);
  945. }
  946. .zytl_bg {
  947. background: url("@/static/image/home1/index_zytl_bg.png") no-repeat right top / 132rpx 132rpx,linear-gradient( 270deg, #EFFAF9 0%, #E7FFFD 100%);
  948. }
  949. }
  950. .banner-nav {
  951. padding: 20rpx 24rpx;
  952. display: flex;
  953. flex-wrap: wrap;
  954. margin-right: -16rpx;
  955. margin-bottom: -16rpx;
  956. &-item {
  957. width: 343rpx;
  958. height: 200rpx;
  959. box-sizing: border-box;
  960. background: #fff;
  961. border-radius: 16rpx 16rpx 16rpx 16rpx;
  962. padding: 26rpx 0 0 24rpx;
  963. margin-right: 16rpx;
  964. margin-bottom: 16rpx;
  965. font-family: PingFang SC, PingFang SC;
  966. font-weight: 400;
  967. font-size: 24rpx;
  968. color: #757575;
  969. line-height: 32rpx;
  970. background-repeat: no-repeat;
  971. background-size: 208rpx 148rpx;
  972. background-position: right bottom;
  973. .kswz {
  974. color: #4FA59C;
  975. }
  976. .jkhz {
  977. color: #2583EB;
  978. }
  979. .yyzx {
  980. color: #E69A22;
  981. }
  982. .zjyz {
  983. color: #3A76D0;
  984. }
  985. }
  986. .kswz-bg {
  987. background-image: url("@/static/image/home1/index_kswz_bg.png");
  988. }
  989. .jkhz-bg {
  990. background-image: url("@/static/image/home1/index_jkhz_bg.png");
  991. }
  992. .yyzx-bg {
  993. background-image: url("@/static/image/home1/index_yyzx_bg.png");
  994. }
  995. .zjyz-bg {
  996. background-image: url("@/static/image/home1/index_zjyz_bg.png");
  997. }
  998. }
  999. .box-nav {
  1000. width: 100%;
  1001. padding: 16rpx 24rpx;
  1002. box-sizing: border-box;
  1003. display: flex;
  1004. justify-content: space-between;
  1005. &-right {
  1006. @include u-flex(row, center, flex-start);
  1007. }
  1008. .right-arrow {
  1009. height: 48rpx;
  1010. width: 48rpx;
  1011. }
  1012. }
  1013. .selfrated-health {
  1014. @include u-flex(row, center, space-around);
  1015. padding: 34rpx 0;
  1016. background-color: #fff;
  1017. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1018. margin: 0 24rpx 20rpx 24rpx;
  1019. &-item {
  1020. width: 144rpx;
  1021. height: 144rpx;
  1022. @include u-flex(column, center, center);
  1023. flex-wrap: wrap;
  1024. image {
  1025. width: 72rpx;
  1026. height: 72rpx;
  1027. margin-bottom: 28rpx;
  1028. }
  1029. }
  1030. }
  1031. .scroll-container {
  1032. white-space: nowrap; /* 确保子元素不换行 */
  1033. display: flex; /* 使用flex布局 */
  1034. padding-left: 24rpx;
  1035. }
  1036. .box-goods {
  1037. @include u-flex(row, center, flex-start);
  1038. flex-wrap: wrap;
  1039. margin-right: -18rpx;
  1040. margin-bottom: -18rpx;
  1041. padding: 8rpx 24rpx 20rpx 24rpx;
  1042. }
  1043. .box-doctor {
  1044. @include u-flex(row, center, flex-start);
  1045. flex-wrap: wrap;
  1046. margin-right: -18rpx;
  1047. margin-bottom: -18rpx;
  1048. padding: 8rpx 24rpx 20rpx 0rpx;
  1049. display: inline-flex; /* 确保子元素水平排列 */
  1050. }
  1051. .gapitem {
  1052. margin: 0 18rpx 18rpx 0;
  1053. }
  1054. .swiper-doctor {
  1055. min-height: 410rpx;
  1056. padding-left: 24rpx;
  1057. }
  1058. .ai-banner {
  1059. // box-sizing: border-box;
  1060. // padding: 12rpx 17rpx;
  1061. &-swiper-item {
  1062. @include u-flex(row, flex-start, flex-start);
  1063. flex-wrap: wrap;
  1064. margin: 0 22rpx;
  1065. margin-right: -20rpx;
  1066. margin-bottom: -20rpx;
  1067. }
  1068. .ai-banner-img {
  1069. width: 343rpx;
  1070. height: 160rpx;
  1071. overflow: hidden;
  1072. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1073. margin-right: 20rpx;
  1074. margin-bottom: 20rpx;
  1075. }
  1076. }
  1077. .article-box{
  1078. background-color: #fff;
  1079. padding: 24rpx;
  1080. margin-bottom: 20rpx;
  1081. border-radius: 16rpx;
  1082. display: flex;
  1083. flex-direction: column;
  1084. align-items: flex-start;
  1085. justify-content: flex-start;
  1086. .item{
  1087. width: 100%;
  1088. margin-bottom: 20rpx;
  1089. display: flex;
  1090. align-items: flex-start;
  1091. justify-content: flex-start;
  1092. &:last-child{
  1093. margin-bottom: 0rpx;
  1094. }
  1095. .left{
  1096. flex:1;
  1097. height:160rpx;
  1098. margin-right: 15rpx;
  1099. display: flex;
  1100. flex-direction: column;
  1101. align-items: flex-start;
  1102. justify-content: space-between;
  1103. .title{
  1104. font-size: 28upx;
  1105. font-family: PingFang SC;
  1106. font-weight: bold;
  1107. color: #111111;
  1108. }
  1109. .views{
  1110. font-size: 24upx;
  1111. font-family: PingFang SC;
  1112. color: #9a9a9c;
  1113. }
  1114. }
  1115. .right{
  1116. image{
  1117. border-radius: 10rpx;
  1118. width:220rpx;
  1119. height:160rpx;
  1120. border: 1px solid #eeeeee;
  1121. }
  1122. }
  1123. }
  1124. }
  1125. </style>