indexOld.vue 30 KB

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