index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. <template>
  2. <view class="container">
  3. <image class="home_top_bg" src="@//static/image/hall/home_top_bg.png" mode="widthFix"></image>
  4. <view class="tabbox">
  5. <view ref="tabbar" class="tabbar">
  6. <view :id="index" :class="activeTab == index ? 'active tabbar-item':'tabbar-item'"
  7. v-for="(tab,index) in tabList" :key="tab.id" @click="handleTab(index)">{{tab.name}}</view>
  8. </view>
  9. <view ref="underline" class="tabbar-tabline tabbar-tabline-animation"
  10. :style="{left: indicatorLineLeft + 'px', width: indicatorLineWidth + 'px'}">
  11. <image class="tabbar-tabline-image" src="@/static/image/hall/hall_on_icon.png" mode="aspectFill">
  12. </image>
  13. </view>
  14. </view>
  15. <!-- 新手指引 -->
  16. <view class="guidebox" v-if="showGuide" @touchmove.stop.prevent @click="closeGuide('mask')">
  17. <view class="guide" :style="guideStyle" @click.stop.prevent>
  18. <!-- 学习中心新手指引 -->
  19. <!-- <view class="guide-step-tips" :style="tipPosition" v-if="activeTab == 1">
  20. <image class="Frame2612" src="@/static/images/guide/Frame2612.png" mode="aspectFill"></image>
  21. 你可以在这里查询在学课程、学习笔记、收藏课程,对你学习进度进行跟踪。
  22. </view> -->
  23. <!-- 健康讲堂新手指引 -->
  24. <view class="guide3-step-tips2" :style="tipPosition" v-if="activeTab == 0">
  25. <view class="guide3-toptip">
  26. <view class="guide3-toptip-head">
  27. <image class="Frame2611" src="@/static/images/guide/Frame2611.png" mode="aspectFill">
  28. </image>
  29. <text>知名中医大师、达人亲自授课</text>
  30. <image class="guide3-toptip-headbg" src="@/static/images/guide/Frame2614.png"
  31. mode="widthFix"></image>
  32. </view>
  33. <view>分享他们在各自专业领域的丰富经验和独到见解。 </view>
  34. </view>
  35. <view :style="tipsCenter"></view>
  36. <view class="guide3-btn" @click="closeGuide()">我知道啦</view>
  37. </view>
  38. </view>
  39. <!-- 健康讲堂新手指引(图片模式) -->
  40. <!-- <view class="guide" v-if="activeTab != 1" @click.stop.prevent>
  41. <view class="guide3-step-tips">
  42. <view class="guide3-step-tipsbox">
  43. <view class="guide3-toptip">
  44. <view class="guide3-toptip-head">
  45. <image class="Frame2611" src="@/static/images/guide/Frame2611.png" mode="aspectFill"></image>
  46. <text>知名中医大师、达人亲自授课</text>
  47. <image class="guide3-toptip-headbg" src="@/static/images/guide/Frame2614.png" mode="widthFix"></image>
  48. </view>
  49. <view>分享他们在各自专业领域的丰富经验和独到见解。 </view>
  50. </view>
  51. <image class="Frame2291" src="@/static/images/guide/Frame2291.png" mode="widthFix"></image>
  52. </view>
  53. <view class="guide3-btn" @click="closeGuide()">我知道啦</view>
  54. </view>
  55. </view> -->
  56. </view>
  57. <!-- 内容 -->
  58. <swiper :current="activeTab" @change="onSwiperChange" :style="'height:' + clientHeight + 'px;'">
  59. <swiper-item>
  60. <scroll-view scroll-y="true" :style="'height:' + clientHeight + 'px;'" :scroll-top="scrollTopStudy"
  61. @scroll="scroll($event,'scrollTopStudy')">
  62. <studyCenter ref="studyCenter" />
  63. </scroll-view>
  64. </swiper-item>
  65. <swiper-item>
  66. <scroll-view scroll-y="true" :style="'height:' + clientHeight + 'px;'" :scroll-top="scrollTopHall"
  67. @scroll="scroll($event,'scrollTopHall')">
  68. <doctorHall ref="doctorHall" :swiperAutoplay="swiperAutoplay"
  69. @loadFamousCourse="loadFamousCourse(0)" />
  70. </scroll-view>
  71. </swiper-item>
  72. <swiper-item>
  73. <scroll-view
  74. scroll-y="true"
  75. :style="'height:' + clientHeight + 'px;'"
  76. :scroll-top="scrollTopGoods"
  77. @scrolltolower="scrolltolower"
  78. @scroll="scroll($event,'scrollTopGoods')"
  79. :refresher-enabled="true"
  80. :refresher-triggered="triggered"
  81. @refresherrefresh="handleRefresher">
  82. <integralGoods ref="integralGoods"></integralGoods>
  83. <view class="back-top" v-show="scrollTopGoods>clientHeight" @click="goTop">
  84. <image src="https://www.mescroll.com/img/mescroll-totop.png" mode="aspectFill"></image>
  85. </view>
  86. </scroll-view>
  87. </swiper-item>
  88. </swiper>
  89. <!-- 新用户72h内弹免费领礼品弹窗 -->
  90. <giftPopup ref="giftPopup"></giftPopup>
  91. </view>
  92. </template>
  93. <script>
  94. import integralGoods from './components/integralGoods.vue';
  95. import doctorHall from './components/doctorHall.vue';
  96. import studyCenter from './components/studyCenter.vue';
  97. import giftPopup from './components/giftPopup.vue';
  98. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  99. import mescrollBody from "@/uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.vue";
  100. import {
  101. getDictByKey
  102. } from '@/api/common'
  103. import {
  104. getCourseCate,
  105. getCourseList
  106. } from '@/api/course'
  107. import {
  108. getAdvList
  109. } from '@/api/adv.js'
  110. import {
  111. isCreateAd
  112. } from '@/api/user.js'
  113. import {
  114. Igexin
  115. } from '@/pages_im/util/common.js';
  116. export default {
  117. mixins: [MescrollMixin], // 使用mixin
  118. components: {
  119. mescrollBody,
  120. doctorHall,
  121. studyCenter,
  122. giftPopup,
  123. integralGoods
  124. },
  125. data() {
  126. return {
  127. headerHeight: 44,
  128. statusBarBG: "none",
  129. headerIndex: 98,
  130. downOption: { //下拉刷新
  131. auto: true // 不自动加载 (mixin已处理第一个tab触发downCallback)
  132. },
  133. upOption: { //上拉加载
  134. auto: false, // 不自动加载
  135. page: {
  136. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  137. size: 10 // 每页数据的数量
  138. },
  139. noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  140. empty: {
  141. tip: '~ 空空如也 ~' // 提示
  142. // btnText: '去看看'
  143. }
  144. },
  145. //imageList:["../../static/image/home/banner.png"],
  146. imageList: [],
  147. advs: [],
  148. mtabs: [],
  149. tabIndex: 0, // 当前tab的下标
  150. fixedTop: false,
  151. top: 0,
  152. cateId: 0,
  153. isBest: false,
  154. dataList: [],
  155. recommendList: [],
  156. swHeightArr: {},
  157. swHeight: "400px",
  158. keyWord: "",
  159. dataItem: {},
  160. swiperAutoplay: true,
  161. famousItemHei: 0,
  162. scrollTopHall: 0,
  163. scrollTopStudy: 0,
  164. scrollTopGoods: 0,
  165. old: {
  166. scrollTopStudy: 0,
  167. scrollTopHall: 0,
  168. scrollTopGoods: 0
  169. },
  170. activeTab: 0,
  171. indicatorLineLeft: 0,
  172. indicatorLineWidth: 0,
  173. tabList: [{
  174. id: "tab01",
  175. name: '学习中心'
  176. }, {
  177. id: "tab02",
  178. name: '健康讲堂'
  179. }, {
  180. id: "tab03",
  181. name: '商城'
  182. // name: '福币兑换'
  183. }],
  184. clientHeight: 0,
  185. scrollViewId: 'scrollView0',
  186. showGuide: false, // 是否显示引导
  187. guideStyle: "",
  188. tipPosition: "",
  189. tipsCenter: "",
  190. isShowGiftPopup: false,
  191. triggered: false,
  192. statusBarHeight: 0,
  193. haveFamousCourse: false
  194. }
  195. },
  196. onPageScroll(e) {
  197. this.top = e.scrollTop;
  198. this.scrollTopGoods = e.scrollTop;
  199. },
  200. computed: {
  201. // 计算属性的 getter
  202. headerBG: function() {
  203. var top = this.top / 88;
  204. return 'rgba(37, 131, 235, ' + top + ')';
  205. },
  206. },
  207. onReady() {
  208. uni.getSystemInfo({
  209. success: (res) => {
  210. this.clientHeight = res.windowHeight - uni.upx2px(120) - res.statusBarHeight;
  211. }
  212. })
  213. this.tabListSize = {};
  214. this.selectorQuery();
  215. },
  216. onShow() {
  217. if (!this.$isLogin()) {
  218. uni.reLaunch({
  219. url: '/pages/auth/loginIndex'
  220. })
  221. return;
  222. }
  223. this.$updateMsgDot()
  224. this.swiperAutoplay = true;
  225. this.getCreateAd()
  226. if (this.activeTab == 1) {
  227. this.$nextTick(() => {
  228. this.$refs['studyCenter'].onShowFun()
  229. });
  230. }
  231. },
  232. onHide() {
  233. this.swiperAutoplay = false;
  234. },
  235. onLoad() {
  236. // #ifdef APP-PLUS
  237. if (plus.runtime.isAgreePrivacy()) {
  238. if (plus.runtime.channel == "baidu") { //获取渠道标识
  239. let bdCmdType = uni.getStorageSync("bdCmdType");
  240. console.log("qxj bdCmdType:" + bdCmdType);
  241. if (this.$isEmpty(bdCmdType)) {
  242. this.$registerIdCode("activate", 0, 0);
  243. }
  244. }
  245. }
  246. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
  247. // #endif
  248. },
  249. mounted() {
  250. try {
  251. const system = uni.getSystemInfoSync();
  252. let itemWid = (system.windowWidth - 40 - 32) * 0.5 * 0.95;
  253. let tempHei = itemWid * 0.5;
  254. tempHei = uni.upx2px(tempHei) + 30;
  255. this.famousItemHei = tempHei;
  256. } catch (e) {
  257. }
  258. },
  259. methods: {
  260. goTop() {
  261. setTimeout(() => {
  262. this.old.scrollTopGoods = 0
  263. this.scrollTopGoods = 0
  264. })
  265. },
  266. scroll(e, type) {
  267. this.old[type] = e.detail.scrollTop
  268. this.scrollTopGoods = this.old[type]
  269. },
  270. handleTab(activeTab) {
  271. this.activeTab = activeTab
  272. if (this.haveFamousCourse) {
  273. // 防止在没有健康讲堂数据的时候有指引弹窗
  274. this.changeGuide(activeTab);
  275. }
  276. this.$nextTick(() => {
  277. this.selectorQuery()
  278. })
  279. },
  280. loadFamousCourse(val) {
  281. this.haveFamousCourse = true
  282. this.changeGuide(val, 'ee');
  283. },
  284. updateIndicator(left, width) {
  285. this.indicatorLineLeft = left;
  286. this.indicatorLineWidth = width;
  287. },
  288. selectorQuery() {
  289. uni.createSelectorQuery().in(this).selectAll('.tabbar-item').boundingClientRect((rects) => {
  290. rects.forEach((rect) => {
  291. this.tabListSize[rect.id] = rect;
  292. })
  293. this.updateIndicator(this.tabListSize[this.activeTab].left, this.tabListSize[this.activeTab]
  294. .width);
  295. }).exec();
  296. },
  297. // swiper划动
  298. onSwiperChange(e) {
  299. this.changeIdx(e.detail.current);
  300. },
  301. // 更新当前页
  302. changeIdx(index) {
  303. if (this.activeTab === index) return;
  304. this.activeTab = index;
  305. this.scrollViewId = 'scrollView' + this.activeTab;
  306. this.$nextTick(() => {
  307. this.selectorQuery()
  308. });
  309. },
  310. /*下拉刷新的回调 */
  311. downCallback() {
  312. this.mescroll.resetUpScroll(true);
  313. var that = this;
  314. this.requestData();
  315. },
  316. /*上拉加载的回调*/
  317. upCallback(page) {
  318. this.mescroll.endByPage(1, 1);
  319. },
  320. requestData() {
  321. //this.getCourseCate();
  322. },
  323. getCourseCate: function() {
  324. let that = this;
  325. getCourseCate().then(res => {
  326. if (res.code == 200) {
  327. this.mtabs = res.data;
  328. let findIdx = this.mtabs.findIndex(item => item.dictLabel == '精选');
  329. // console.log("qxj findIdx:"+findIdx);
  330. if (findIdx == -1) {
  331. let dictItem = {
  332. "dictValue": 0,
  333. "dictLabel": "精选"
  334. };
  335. this.mtabs.unshift(dictItem);
  336. }
  337. this.isBest = true;
  338. if (this.mtabs.length > 0) {
  339. this.cateId = this.mtabs[0].dictValue;
  340. for (let i = 0; i < this.mtabs.length; i++) {
  341. if (i <= 4) {
  342. this.tabChange(i);
  343. }
  344. }
  345. //this.tabIndex=0;
  346. //this.dataItem=this.dataList[this.tabIndex.toString()]
  347. this.tabChange(0);
  348. }
  349. }
  350. },
  351. rej => {}
  352. );
  353. },
  354. getFamousCourseList: function(index) {
  355. let that = this;
  356. let params = {};
  357. if (this.isBest) {
  358. params = {
  359. "isBest": 1
  360. };
  361. } else {
  362. params = {
  363. "cateId": this.cateId
  364. };
  365. }
  366. if (this.dataList.hasOwnProperty(index + "")) {
  367. this.updateSwiperHeight(index);
  368. return;
  369. }
  370. getCourseList(params, 1, 6).then(res => {
  371. if (res.code == 200) {
  372. this.dataList[index + ""] = res.data.list;
  373. //this.$nextTick(() => {
  374. this.updateSwiperHeight(index);
  375. //});
  376. }
  377. },
  378. rej => {}
  379. );
  380. },
  381. getRecommendList: function() {
  382. let that = this;
  383. const params = {
  384. "isTui": 1
  385. };
  386. getCourseList(params, 1, 10).then(res => {
  387. if (res.code == 200) {
  388. this.recommendList = res.data.list;
  389. }
  390. },
  391. rej => {}
  392. );
  393. },
  394. swiperChange(e) {
  395. this.tabIndex = e.detail.current;
  396. this.tabChange(this.tabIndex);
  397. },
  398. tabChange(index) {
  399. this.tabIndex = index;
  400. const item = this.mtabs[index];
  401. if (item) {
  402. if (item.dictLabel == '精选') {
  403. this.isBest = true;
  404. } else {
  405. this.isBest = false;
  406. }
  407. this.cateId = item.dictValue;
  408. this.getFamousCourseList(index);
  409. }
  410. },
  411. onTransition() {},
  412. animationfinish() {
  413. this.updateSwiperHeight();
  414. },
  415. onSwiperResize() {
  416. //console.log("qxj onSwiperResize");
  417. },
  418. updateSwiperHeight() {
  419. let dataArr = this.dataList[this.tabIndex.toString()];
  420. if (dataArr == undefined || dataArr.length == 0) {
  421. this.swHeight = 150;
  422. } else {
  423. uni.createSelectorQuery().in(this).select('#swiper-content').boundingClientRect(rect => {
  424. //console.log("qxj swHeight:"+this.swHeight);
  425. if (rect != null) {
  426. this.swHeight = rect.height + 20;
  427. }
  428. if (this.swHeight <= 100) {
  429. //所以(total + pagesize -1) / pagesize就得到总页数
  430. // console.log("qxj famousItemHei:"+this.famousItemHei);
  431. this.swHeight = (dataArr.length + 1) / 2 * this.famousItemHei;
  432. return;
  433. }
  434. }).exec();
  435. }
  436. },
  437. getAdvList() {
  438. //联网加载数据
  439. var that = this;
  440. var data = {
  441. advType: 12,
  442. status: 1
  443. }
  444. getAdvList(data).then(res => {
  445. if (res.code == 200) {
  446. that.imageList = [];
  447. that.advs = [];
  448. res.data.forEach(function(element) {
  449. if (element.imageUrl != null && element.imageUrl != "") {
  450. that.advs.push(element);
  451. that.imageList.push(element.imageUrl);
  452. }
  453. });
  454. } else {
  455. uni.showToast({
  456. icon: 'none',
  457. title: "请求失败"
  458. });
  459. }
  460. });
  461. },
  462. goToMsg() {
  463. if (!this.$isLogin()) {
  464. this.$showLoginPage();
  465. return;
  466. } else {
  467. let registrationID = uni.getStorageSync("registrationID");
  468. let token = uni.getStorageSync('AppToken');
  469. }
  470. },
  471. // 页面跳转
  472. navTo(url) {
  473. uni.navigateTo({
  474. url: url
  475. });
  476. },
  477. loginNavTo(url) {
  478. if (!this.$isLogin()) {
  479. this.$showLoginPage();
  480. return;
  481. }
  482. this.$navTo(url);
  483. },
  484. changeImg() {
  485. },
  486. handleAdvClick(index) {
  487. var ad = this.advs[index];
  488. if (ad.showType == 1) {
  489. uni.setStorageSync('url', ad.appAdvUrl);
  490. uni.navigateTo({
  491. url: "h5"
  492. });
  493. } else if (ad.showType == 2) {
  494. // console.log(ad.appAdvUrl);
  495. uni.navigateTo({
  496. url: ad.appAdvUrl
  497. });
  498. } else if (ad.showType == 3) {
  499. uni.setStorageSync('content', ad.content);
  500. uni.navigateTo({
  501. url: "content"
  502. });
  503. }
  504. },
  505. changeGuide(val, type) {
  506. let guide = ''
  507. let ele = ""
  508. if (val == 1) {
  509. // guide = uni.getStorageSync("studyCenterGuide");
  510. // ele = "#guide4"
  511. }
  512. if (val == 0) {
  513. guide = uni.getStorageSync("doctorHallGuide");
  514. ele = "#guide3";
  515. }
  516. if ((guide != undefined && !guide) && ele) {
  517. console.log("qxj dataList", this.$refs.doctorHall.dataList);
  518. if ((this.$refs.doctorHall.dataList[0]).length == 0) {
  519. return;
  520. }
  521. setTimeout(e => {
  522. if (this.showGuide) return
  523. //this.showGuide = true;
  524. this.getGuideInfo(ele, 1);
  525. }, val == 0 ? 1000 : 500);
  526. } else {
  527. this.showGuide = false;
  528. }
  529. },
  530. getGuideInfo(el, type) {
  531. const refname = this.activeTab == 1 ? 'studyCenter' : this.activeTab == 0 ? 'doctorHall' : 'integralGoods'
  532. const query = uni.createSelectorQuery().in(this.$refs[refname]);
  533. this.$nextTick(function() {
  534. query.select(el).boundingClientRect()
  535. let _this = this;
  536. query.exec(function(res) {
  537. if (!res) return
  538. const {
  539. width,
  540. height,
  541. left,
  542. top,
  543. style = 'border-radius: 12rpx;margin: 0'
  544. } = res[0]
  545. if (el == '#guide3') {
  546. // 滑动至顶部(减去导航栏高度)
  547. _this.scrollTopHall = top - uni.upx2px(220) - 44 - _this.statusBarHeight
  548. _this.getGuide3item(res[0], _this.scrollTopHall)
  549. } else {
  550. _this.scrollTopStudy = _this.old.scrollTopStudy
  551. _this.scrollTopGoods = _this.old.scrollTopGoods
  552. _this.$nextTick(() => {
  553. _this.scrollTopStudy = 0
  554. _this.scrollTopGoods = 0
  555. });
  556. // 减去我的评价宽度
  557. const relwidth = width
  558. let newstyle = "width:" + relwidth + "px;";
  559. newstyle += "height:" + height + "px;";
  560. newstyle += "left:" + uni.upx2px(24) + "px;";
  561. newstyle += "top:" + top + "px;";
  562. newstyle += style;
  563. _this.guideStyle = newstyle
  564. let tipsTop = height + uni.upx2px(20);
  565. _this.tipPosition = "top:" + tipsTop + 'px;left:' + uni.upx2px(88) + "px;";
  566. }
  567. })
  568. });
  569. },
  570. getGuide3item(res, scrollTopHall) {
  571. const {
  572. width,
  573. height,
  574. left,
  575. top,
  576. style = 'border-radius: 12rpx;margin: 0'
  577. } = res
  578. const refname = this.activeTab == 1 ? 'studyCenter' : this.activeTab == 0 ? 'doctorHall' : 'integralGoods'
  579. const query = uni.createSelectorQuery().in(this.$refs[refname]);
  580. let _this = this;
  581. query.select(".guide3item").boundingClientRect((data) => {
  582. if (!data) {
  583. this.showGuide = false;
  584. return
  585. }
  586. if (data.height < 80) data.height = uni.upx2px(538)
  587. const relwidth = width + uni.upx2px(24)
  588. const relheight = height + data.height + uni.upx2px(30)
  589. const reltop = top - _this.scrollTopHall
  590. let newstyle = "width:" + relwidth + "px;";
  591. newstyle += "height:" + relheight + "px;";
  592. newstyle += "left:" + uni.upx2px(14) + "px;";
  593. newstyle += "top:" + reltop + "px;";
  594. newstyle += style;
  595. console.log("qxj guide3Style:" + newstyle);
  596. _this.guideStyle = newstyle
  597. const tipsCenter = relheight + uni.upx2px(50)
  598. _this.tipsCenter = "height:" + tipsCenter + "px";
  599. let tipsTop = -uni.upx2px(180);
  600. _this.tipPosition = "top:" + tipsTop + 'px;left:' + uni.upx2px(66) + "px;";
  601. }).exec();
  602. },
  603. closeGuide(type) {
  604. if (type == 'mask' && this.activeTab == 0) {
  605. return
  606. }
  607. this.showGuide = false;
  608. if (this.activeTab == 1) {
  609. uni.setStorageSync("studyCenterGuide", true);
  610. // setTimeout(e=>{
  611. // uni.switchTab({url: '/pages/course/video/living-app' });
  612. // },500);
  613. } else if (this.activeTab == 0) {
  614. uni.setStorageSync("doctorHallGuide", true);
  615. // this.handleTab(1);
  616. setTimeout(e => {
  617. uni.switchTab({
  618. url: '/pages/course/video/living-app',
  619. complete: () => {
  620. this.getCreateAd()
  621. }
  622. });
  623. }, 500);
  624. }
  625. this.scrollTopHall = this.old.scrollTopHall
  626. this.scrollTopStudy = this.old.scrollTopStudy
  627. this.scrollTopGoods = this.old.scrollTopGoods
  628. this.$nextTick(() => {
  629. this.scrollTopHall = 0
  630. this.scrollTopStudy = 0
  631. this.scrollTopGoods = 0
  632. });
  633. },
  634. // 礼品弹窗
  635. getCreateAd() {
  636. // #ifdef APP-PLUS
  637. if (plus.runtime.isAgreePrivacy()) {
  638. if (plus.runtime.channel == "yyb" || plus.runtime.channel == "yybadv" || plus.runtime.channel ==
  639. "yybadv1") {
  640. let guide = uni.getStorageSync("doctorHallGuide");
  641. let ele = "#guide3"
  642. if (guide && ele) {
  643. isCreateAd().then(res => {
  644. if (res.code == 200 && res.isCreate) {
  645. this.$nextTick(() => {
  646. this.$refs.giftPopup.openPop()
  647. })
  648. } else {
  649. this.$nextTick(() => {
  650. this.$refs.giftPopup.closePop()
  651. })
  652. }
  653. })
  654. }
  655. }
  656. }
  657. // #endif
  658. },
  659. scrolltolower() {
  660. this.$refs.integralGoods && this.$refs.integralGoods.scrolltolower()
  661. },
  662. handleRefresher() {
  663. this.triggered = true;
  664. this.$nextTick(() => {
  665. this.$refs.integralGoods && this.$refs.integralGoods.initData()
  666. })
  667. setTimeout(() => {
  668. this.triggered = false;
  669. }, 500);
  670. },
  671. }
  672. }
  673. </script>
  674. <style scoped lang="scss">
  675. .back-top {
  676. border-radius: 50%;
  677. overflow: hidden;
  678. background-color: transparent;
  679. width: 40px;
  680. height: 40px;
  681. position: fixed;
  682. right: 24rpx;
  683. bottom: 100rpx;
  684. image {
  685. width: 40px;
  686. height: 40px;
  687. }
  688. }
  689. @mixin u-flex($flexD, $alignI, $justifyC) {
  690. display: flex;
  691. flex-direction: $flexD;
  692. align-items: $alignI;
  693. justify-content: $justifyC;
  694. }
  695. .guidebox {
  696. position: fixed;
  697. left: 0;
  698. top: 0;
  699. width: 100%;
  700. height: 100%;
  701. z-index: 1000;
  702. .guide {
  703. position: absolute;
  704. z-index: 10001;
  705. box-shadow: rgba(33, 33, 33, 0.8) 0px 0px 0px 0px, rgba(33, 33, 33, 0.5) 0px 0px 0px 5000px;
  706. }
  707. .guide-step-tips {
  708. position: absolute;
  709. top: 0;
  710. left: 0;
  711. z-index: 10001;
  712. padding: 18rpx 18rpx 18rpx 90rpx;
  713. box-sizing: border-box;
  714. border-radius: 24rpx;
  715. font-family: PingFang SC, PingFang SC;
  716. font-weight: 400;
  717. font-size: 26rpx;
  718. color: #FFFFFF;
  719. line-height: 40rpx;
  720. background: linear-gradient(90deg, #FCAC34, #F9622F);
  721. }
  722. .Frame2612 {
  723. height: 158rpx;
  724. width: 158rpx;
  725. position: absolute;
  726. left: -66rpx;
  727. top: -102rpx;
  728. }
  729. .guide3-step-tips2 {
  730. display: flex;
  731. flex-direction: column;
  732. align-items: center;
  733. justify-content: center;
  734. position: absolute;
  735. }
  736. .guide3-step-tips {
  737. width: 100vw;
  738. display: flex;
  739. flex-direction: column;
  740. align-items: center;
  741. justify-content: center;
  742. height: 100vh;
  743. position: absolute;
  744. }
  745. .guide3-step-tipsbox {
  746. display: flex;
  747. flex-direction: column;
  748. align-items: flex-end;
  749. }
  750. .guide3-btn {
  751. width: 272rpx;
  752. height: 84rpx;
  753. margin: 0 auto;
  754. background: #2583EB;
  755. border-radius: 42rpx 42rpx 42rpx 42rpx;
  756. font-family: PingFang SC, PingFang SC;
  757. font-weight: 500;
  758. font-size: 32rpx;
  759. color: #FFFFFF;
  760. line-height: 84rpx;
  761. text-align: center;
  762. }
  763. .guide3-toptip {
  764. width: 640rpx;
  765. height: 160rpx;
  766. padding: 26rpx;
  767. box-sizing: border-box;
  768. position: relative;
  769. font-family: PingFang SC, PingFang SC;
  770. font-weight: 400;
  771. font-size: 26rpx;
  772. color: #FFFFFF;
  773. line-height: 30rpx;
  774. }
  775. .guide3-toptip-head {
  776. // position: relative;
  777. margin-bottom: 8rpx;
  778. font-family: PingFang SC, PingFang SC;
  779. font-weight: 600;
  780. font-size: 34rpx;
  781. color: #FFFFFF;
  782. line-height: 40rpx;
  783. }
  784. .guide3-toptip-headbg {
  785. width: 640rpx;
  786. height: 160rpx;
  787. position: absolute;
  788. top: 0;
  789. left: 0;
  790. z-index: -1;
  791. }
  792. .Frame2611 {
  793. width: 188rpx;
  794. height: 184rpx;
  795. position: absolute;
  796. top: -90rpx;
  797. right: 0;
  798. }
  799. .Frame2291 {
  800. width: 702rpx;
  801. // height: 684rpx;
  802. margin: 24rpx 0 40rpx 0;
  803. }
  804. }
  805. .container {
  806. font-family: PingFang SC, PingFang SC;
  807. padding-top: var(--status-bar-height);
  808. position: relative;
  809. z-index: 2;
  810. }
  811. .home_top_bg {
  812. width: 100%;
  813. height: auto;
  814. position: absolute;
  815. top: 0;
  816. left: 0;
  817. z-index: -1;
  818. }
  819. .tabbox {
  820. position: relative;
  821. margin-bottom: 22rpx;
  822. position: relative;
  823. .tabbar {
  824. height: 88rpx;
  825. @include u-flex(row, center, center);
  826. font-weight: 600;
  827. font-size: 32rpx;
  828. color: #222222;
  829. line-height: 88rpx;
  830. position: relative;
  831. .tabbar-item {
  832. margin: 0 24rpx;
  833. }
  834. .active {
  835. font-weight: 600;
  836. font-size: 40rpx;
  837. color: #2583EB;
  838. position: relative;
  839. }
  840. }
  841. .tabbar-tabline-image {
  842. width: 36rpx;
  843. height: 12rpx;
  844. }
  845. .tabbar-tabline {
  846. position: absolute;
  847. bottom: 0;
  848. width: 0;
  849. height: 12rpx;
  850. display: flex;
  851. align-items: center;
  852. justify-content: center;
  853. }
  854. .tabbar-tabline-animation {
  855. transition-duration: 0.2s;
  856. transition-property: left;
  857. }
  858. }
  859. </style>