index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <template>
  2. <view>
  3. <swiper :circular="true" @change="onChangeTab" :duration="currentDuration" :current="current"
  4. class="ezy-study-swiper" :class="'ezy-study-swiper'+ currentProduct">
  5. <swiper-item v-for="(item,index) in zhangList" :key="index">
  6. <!-- 旧的数学 -->
  7. <shuxueZhangjie v-if="currentProduct ==1&&typeId==2" @clickGradeTerm="clickGradeTerm"
  8. @handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
  9. :options="item" :youkeImage="youkeImage">
  10. </shuxueZhangjie>
  11. <!-- 旧的英语 -->
  12. <yingyuZhangjie v-if="currentProduct ==2&&typeId==2" @clickGradeTerm="clickGradeTerm"
  13. @handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
  14. :options="item" :youkeImage="youkeImage">
  15. </yingyuZhangjie>
  16. <!-- 新的数学 -->
  17. <shuxueNewZhangjie v-if="currentProduct ==1&&typeId==1" @clickGradeTerm="clickGradeTerm"
  18. @handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
  19. :options="item" :youkeImage="youkeImage">
  20. </shuxueNewZhangjie>
  21. <!-- 新的英语(人教版等等) -->
  22. <yingyuNewZhangjie v-if="currentProduct ==2&&typeId==1" @clickGradeTerm="clickGradeTerm"
  23. @handleCheckCatalogue="handleCheckCatalogue(item)" @listClick="listClick" :gradeTerm='gradeTerm'
  24. :options="item" :zhangName="zhangName" :youkeImage="youkeImage" :youkeImageBook="youkeImageBook">
  25. </yingyuNewZhangjie>
  26. </swiper-item>
  27. </swiper>
  28. <!-- 蛋 -->
  29. <egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
  30. <catalogue ref="catalogueRef" :list=zhangList @change-zhang="handleChangeZhang"
  31. @listSelectJieClick="listSelectJieClick"></catalogue>
  32. <CustomTabBar :levelId="levelId" :currentTabNumber="0" :subjectId="subjectId" :typeId="typeId"
  33. :tipFlag="tipFlag">
  34. </CustomTabBar>
  35. <tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
  36. <tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
  37. <dao-tip-dialog ref="daoTipDialogRef" v-if="showDaoTip" :productTip="productTipImg"
  38. @dao-tip-close="daoTipClose"></dao-tip-dialog>
  39. <tipMiddleDialog ref="tipDialogRef" :closeFlag='false' @confirm-btn="BanbenConfirmBtn" :title="tipTitle"
  40. :content="tipContentVersion"></tipMiddleDialog>
  41. </view>
  42. </template>
  43. <script setup>
  44. import daoTipDialog from './daoTipDialog.vue';
  45. import {
  46. userZhangInfo,
  47. userLocate,
  48. userZhangForntInfo,
  49. userZhangNextInfo,
  50. getCommonZhangInfo
  51. } from "@/api/learnPlan.js"
  52. import {
  53. getVersion
  54. } from "@/api/login.js"
  55. import {
  56. reactive,
  57. ref,
  58. nextTick,
  59. getCurrentInstance,
  60. onMounted
  61. } from "vue";
  62. import {
  63. onLoad
  64. } from '@dcloudio/uni-app';
  65. import catalogue from "@/components/catalogue/catalogue.vue";
  66. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  67. import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
  68. import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
  69. import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
  70. import dSwiper from '@/components/wSwiper/DSwiper.vue';
  71. import shuxueZhangjie from './product/shuxue.vue';
  72. import shuxueNewZhangjie from './product/shuxueNew.vue';
  73. import yingyuZhangjie from './product/yingyu.vue';
  74. import yingyuNewZhangjie from './product/yingyuNew.vue';
  75. import {
  76. useTabBarHistory
  77. } from '@/utils/emitEvents.js';
  78. import eggDialog from './eggDialog.vue'
  79. import tipDialog from '@/components/dialog/tipDialog.vue';
  80. import config from '../../config.js'
  81. import {
  82. toast,
  83. getUserIdentity
  84. } from "@/utils/common";
  85. import cacheManager from "@/utils/cacheManager.js";
  86. const tipContent = '是否前往开通付费?'; //当前产品
  87. const goPayDialogRef = ref(null);
  88. const youkeDialogRef = ref(null);
  89. const dSwiperRef = ref(null);
  90. const eggDialogRef = ref(null);
  91. const current = ref(0);
  92. const currentDuration = ref(500)
  93. const YouKeContent = '您当前的身份是游客,想要体验完整内容需注册成用户!';
  94. const tipFlag = ref(null) //游客使用
  95. const catalogueRef = ref(null);
  96. const youkeImage = ref(null);
  97. const youkeImageBook = ref(null);
  98. const currentProduct = ref(null);
  99. const localAuth = ref(null);
  100. const levelId = ref(null); //游客使用
  101. const subjectId = ref(null); //游客使用
  102. const youkeZhangId = ref(null); //游客使用
  103. const zhangName = ref(null);
  104. const typeId = ref(null);
  105. const zhangList = ref(null);
  106. const gradeTerm = ref(null);
  107. let infoData = reactive({
  108. jieList: [],
  109. haveFlag: '',
  110. number: '',
  111. zhangId: '',
  112. zhangName: '',
  113. numberStr: '',
  114. });
  115. const termMapping = {
  116. 1: ' 数学',
  117. 2: ' 英语'
  118. };
  119. const daoTipDialogRef = ref(null);
  120. const showDaoTip = ref(true);
  121. const productTipImg = ref('');
  122. const version = config.appInfo.version;
  123. const tipDialogRef = ref(null);
  124. const tipTitle = '升级提醒';
  125. const tipContentVersion = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!';
  126. onLoad((options) => {
  127. init(options);
  128. getLoginInit()
  129. })
  130. function listSelectJieClick(item, data, index) {
  131. if (cacheManager.get('auth')) {
  132. cacheManager.updateObject('auth', {
  133. currentZhang: zhangList.value.findIndex(citem => citem.zhangId == item.zhangId),
  134. zhangId: item.zhangId
  135. })
  136. }
  137. listClick(data, item, index);
  138. }
  139. function BanbenConfirmBtn() {
  140. const systemInfo = uni.getSystemInfoSync();
  141. if (systemInfo.platform == 'ios') {
  142. const appStoreUrl = 'itms-apps://itunes.apple.com/app/6741551741'
  143. plus.runtime.openURL(appStoreUrl)
  144. } else {
  145. const { brand } = systemInfo;
  146. // 处理 Android/HarmonyOS 设备
  147. let storeUrl = '';
  148. let androidPackage = 'com.llisoft.ezy'; // 安卓包名
  149. switch (brand.toLowerCase()) {
  150. case 'huawei':
  151. storeUrl = `appmarket://details?id=${androidPackage}`; // 华为/鸿蒙
  152. break;
  153. case 'xiaomi':
  154. storeUrl = `mimarket://details?id=${androidPackage}`; // 小米
  155. break;
  156. case 'oppo':
  157. storeUrl = `market://details?id=${androidPackage}`; // OPPO
  158. break;
  159. case 'vivo':
  160. storeUrl = `vivomarket://details?id=${androidPackage}`; // vivo
  161. break;
  162. case 'honor':
  163. storeUrl = `market://details?id=${androidPackage}`; // 荣耀
  164. break;
  165. default:
  166. storeUrl = `market://details?id=${androidPackage}`; // 其他安卓品牌
  167. }
  168. plus.runtime.openURL(storeUrl);
  169. }
  170. }
  171. function getLoginInit() {
  172. getVersion({}).then(res => {
  173. if (version != res.data.version) {
  174. tipDialogRef.value.handleShow();
  175. }
  176. })
  177. }
  178. function getProjectImg() {
  179. if (currentProduct.value == 1 && typeId.value == 2) {
  180. // 数学
  181. productTipImg.value = 'static/images/study/shuxue/shuxue-tip.gif';
  182. getBj('shuxue')
  183. } else if (currentProduct.value == 2 && typeId.value == 2) {
  184. // 英语
  185. productTipImg.value = 'static/images/study/yingyu/yingyu-tip.gif'
  186. getBj('yingyu');
  187. } else if (currentProduct.value == 1 && typeId.value == 1) {
  188. // 数学新(计算特训)
  189. productTipImg.value = 'static/images/study/jstx/jstx-tip.gif'
  190. getBj('shuxueNew');
  191. } else if (currentProduct.value == 2 && typeId.value == 1) {
  192. // 英语新(超级单词)
  193. productTipImg.value = 'static/images/study/jstx/yingyu-tip.gif'
  194. getBj('yingyuNew');
  195. }
  196. }
  197. function getBj(data) {
  198. let bjType = cacheManager.get('dao-tip')[data];
  199. if (cacheManager.get('auth')) {
  200. // 非游客
  201. if (bjType !== 'has') {
  202. nextTick(() => {
  203. daoTipDialogRef.value.handleShow();
  204. })
  205. }
  206. } else {
  207. // 游客
  208. if (tipFlag.value === '0') {
  209. nextTick(() => {
  210. daoTipDialogRef.value.handleShow();
  211. })
  212. }
  213. }
  214. }
  215. function daoTipClose() {
  216. if (cacheManager.get('auth')) {
  217. // 非游客 记缓存
  218. if (currentProduct.value == 1 && typeId.value == 2) {
  219. // 数学
  220. cacheManager.updateObject('dao-tip', {
  221. shuxue: 'has'
  222. })
  223. } else if (currentProduct.value == 2 && typeId.value == 2) {
  224. // 英语
  225. cacheManager.updateObject('dao-tip', {
  226. yingyu: 'has'
  227. })
  228. } else if (currentProduct.value == 1 && typeId.value == 1) {
  229. // 数学新(计算特训)
  230. cacheManager.updateObject('dao-tip', {
  231. shuxueNew: 'has'
  232. })
  233. } else if (currentProduct.value == 2 && typeId.value == 1) {
  234. // 英语新(超级单词)
  235. cacheManager.updateObject('dao-tip', {
  236. yingyuNew: 'has'
  237. })
  238. }
  239. } else {
  240. //游客
  241. tipFlag.value = '1';
  242. }
  243. }
  244. function onChangeTab(e) {
  245. console.log('e', e);
  246. console.log(e.detail.current);
  247. if (cacheManager.get('auth')) {
  248. // 新的英语人教版
  249. if (currentProduct.value == 2 && typeId.value == 1) {
  250. infoData.zhangId = cacheManager.get('zhangInfo').zhangList[0].zhangId
  251. cacheManager.updateObject('auth', {
  252. currentZhang: e.detail.current,
  253. zhangId: infoData.zhangId
  254. })
  255. } else {
  256. // 旧的数学 英语 新的数学
  257. infoData.zhangId = cacheManager.get('zhangInfo').zhangList[e.detail.current].zhangId
  258. cacheManager.updateObject('auth', {
  259. currentZhang: e.detail.current,
  260. zhangId: infoData.zhangId
  261. })
  262. }
  263. }
  264. }
  265. function init(options) {
  266. if (cacheManager.get('auth')) {
  267. localAuth.value = cacheManager.get('auth');
  268. currentProduct.value = localAuth.value.subjectId;
  269. typeId.value = localAuth.value.typeId;
  270. console.log(localAuth.value);
  271. // 已登录
  272. if (localAuth.value.firstLogin) {
  273. nextTick(() => {
  274. eggDialogRef.value.eggShow();
  275. })
  276. }
  277. if (!cacheManager.get('daoPageCache').isCache) {
  278. console.log('不实用换葱');
  279. chooseMethodNoCache()
  280. } else {
  281. console.log('shiyonghuancun');
  282. chooseMethodUseCache()
  283. }
  284. // 已登录付费未支付选择返回 -> 恢复弹窗
  285. if (options.studyWithCatalgue) {
  286. // 展开弹窗
  287. nextTick(() => {
  288. catalogueRef.value.showPopup({
  289. zhangId: infoData.zhangId
  290. });
  291. })
  292. }
  293. } else {
  294. chooseMethodYouke(options)
  295. }
  296. }
  297. function chooseMethodNoCache() {
  298. // 新的英语 (人教版 之类的 新结构)
  299. if (currentProduct.value == 2 && typeId.value == 1) {
  300. getZhangInfoNewYingyu()
  301. } else {
  302. // 之前 旧的岛 数学英语 和新的数学
  303. getZhangInfo()
  304. }
  305. }
  306. function chooseMethodUseCache() {
  307. // 新的英语 (人教版 之类的 新结构)
  308. if (currentProduct.value == 2 && typeId.value == 1) {
  309. translateData(cacheManager.get('zhangInfo'))
  310. zhangList.value = cacheManager.get('zhangInfo').zhangList[0].zList
  311. zhangName.value = cacheManager.get('zhangInfo').zhangList[0].zhangName
  312. current.value = cacheManager.get('auth').currentZhang
  313. infoData.zhangId = cacheManager.get('zhangInfo').zhangList[0].zhangId
  314. recordZhangJie()
  315. } else {
  316. // 之前 旧的岛 数学英语 和新的数学
  317. translateData(cacheManager.get('zhangInfo'))
  318. zhangList.value = cacheManager.get('zhangInfo').zhangList
  319. current.value = cacheManager.get('auth').currentZhang
  320. infoData.zhangId = cacheManager.get('zhangInfo').zhangList[current.value].zhangId
  321. recordZhangJie()
  322. }
  323. }
  324. function chooseMethodYouke(options) {
  325. subjectId.value = options.subjectId
  326. typeId.value = options.typeId
  327. levelId.value = options.levelId
  328. tipFlag.value = options.tipFlag;
  329. currentProduct.value = options.subjectId
  330. youkeZhangId.value = options.youkeZhangId
  331. if (subjectId.value == 2 && typeId.value == 1) {
  332. // 新英语
  333. getCommonZhangNewYingyu(options)
  334. } else {
  335. // 未登录 游客 旧的数学 英语 新数学
  336. getCommonZhang(options)
  337. }
  338. getProjectImg()
  339. }
  340. // 新的英语 (人教版 之类的 新结构)
  341. function getZhangInfoNewYingyu(data) {
  342. let req = {
  343. levelId: localAuth.value.levelId,
  344. // levelId: 31,
  345. zhangId: localAuth.value.zhangId
  346. // zhangId: 195
  347. }
  348. userZhangInfo(req).then(res => {
  349. cacheManager.set('zhangInfo', res.data)
  350. let zhang = cacheManager.get('zhangInfo').zhangList[0].zList.findIndex(zhang => zhang.zid == localAuth
  351. .value.zhangId);
  352. console.log('zhang', zhang);
  353. if (zhang != -1) {
  354. cacheManager.updateObject('auth', {
  355. currentZhang: zhang
  356. })
  357. } else {
  358. cacheManager.updateObject('auth', {
  359. currentZhang: 0
  360. })
  361. }
  362. cacheManager.set('daoPageCache', {
  363. isCache: true
  364. })
  365. nextTick(() => {
  366. translateData(res.data)
  367. zhangList.value = res.data.zhangList[0].zList
  368. zhangName.value = res.data.zhangList[0].zhangName
  369. current.value = cacheManager.get('auth').currentZhang
  370. infoData.zhangId = res.data.zhangList[0].zhangId
  371. recordZhangJie()
  372. })
  373. }).catch((err) => {
  374. toast('数据异常,请重新登录!')
  375. cacheManager.clearAll();
  376. uni.reLaunch({
  377. url: '/pages/login/index'
  378. });
  379. })
  380. }
  381. //旧的岛 数学英语 和新的数学
  382. function getZhangInfo(data) {
  383. let req = {
  384. levelId: localAuth.value.levelId
  385. }
  386. userZhangInfo(req).then(res => {
  387. cacheManager.set('zhangInfo', res.data)
  388. let zhang = cacheManager.get('zhangInfo').zhangList.findIndex(zhang => zhang.zhangId == localAuth
  389. .value.zhangId);
  390. console.log('zhang', zhang);
  391. if (zhang != -1) {
  392. cacheManager.updateObject('auth', {
  393. currentZhang: zhang
  394. })
  395. } else {
  396. cacheManager.updateObject('auth', {
  397. currentZhang: 0
  398. })
  399. }
  400. cacheManager.set('daoPageCache', {
  401. isCache: true
  402. })
  403. nextTick(() => {
  404. translateData(res.data)
  405. zhangList.value = res.data.zhangList
  406. current.value = cacheManager.get('auth').currentZhang
  407. infoData.zhangId = res.data.zhangList[current.value].zhangId
  408. recordZhangJie()
  409. })
  410. }).catch((err) => {
  411. toast('数据异常,请重新登录!')
  412. cacheManager.clearAll();
  413. uni.reLaunch({
  414. url: '/pages/login/index'
  415. });
  416. })
  417. }
  418. function getCommonZhangNewYingyu(data) {
  419. let req = {
  420. levelId: data.levelId,
  421. zhangId: data.youkeZhangId
  422. }
  423. getCommonZhangInfo(req).then(res => {
  424. translateData(res.data)
  425. youkeImage.value = res.data.icon
  426. youkeImageBook.value = res.data.zhangIcon
  427. zhangList.value = res.data.zhangList[0].zList
  428. zhangName.value = res.data.zhangList[0].zhangName
  429. current.value = 0
  430. }).catch((err) => {
  431. toast('数据异常,请重新登录!')
  432. cacheManager.clearAll();
  433. uni.reLaunch({
  434. url: '/pages/login/index'
  435. });
  436. })
  437. }
  438. function getCommonZhang(data) {
  439. let req = {
  440. levelId: data.levelId,
  441. }
  442. getCommonZhangInfo(req).then(res => {
  443. translateData(res.data)
  444. youkeImage.value = res.data.icon
  445. zhangList.value = res.data.zhangList
  446. current.value = 0
  447. }).catch((err) => {
  448. toast('数据异常,请重新登录!')
  449. cacheManager.clearAll();
  450. uni.reLaunch({
  451. url: '/pages/login/index'
  452. });
  453. })
  454. }
  455. function recordZhangJie() {
  456. let req = {
  457. levelId: localAuth.value.levelId,
  458. userId: localAuth.value.userId,
  459. zhangId: infoData.zhangId,
  460. subjectId: currentProduct.value
  461. }
  462. userLocate(req).then(res => {
  463. })
  464. }
  465. function goPayPage() {
  466. let zhangInfoLocal = cacheManager.get('zhangInfo')
  467. if (!zhangInfoLocal.cardId) {
  468. toast("cardId 丢失请重新选择学科LevelId");
  469. return false
  470. }
  471. uni.redirectTo({
  472. url: '/pages/mall/mallPage?cardId=' + zhangInfoLocal.cardId + '&from=daoPage' + '&subjectId=' +
  473. zhangInfoLocal.subjectId
  474. })
  475. }
  476. function handleChangeZhang(data) {
  477. console.log(data);
  478. const authCode = getUserIdentity();
  479. if (authCode !== 'Visitor') {
  480. cacheManager.updateObject('auth', {
  481. zhangId: data.zhangId,
  482. currentZhang: zhangList.value.findIndex(citem => citem.zhangId == data.zhangId),
  483. })
  484. }
  485. currentDuration.value = 0
  486. setTimeout(() => {
  487. current.value = data.number - 1
  488. nextTick(() => {
  489. currentDuration.value = 500
  490. })
  491. }, 100)
  492. // init()
  493. }
  494. function goKaoshi(data) {
  495. uni.redirectTo({
  496. // url: `/pages/unitTest/index?jieNumber=` + data.number
  497. url: `/pages/unitTest/index?jieId=` + data.jieId
  498. })
  499. }
  500. function goDanciList(data, index) {
  501. if (!cacheManager.get('auth')) {
  502. let youkeData = {
  503. subjectId: subjectId.value,
  504. typeId: typeId.value,
  505. levelId: levelId.value,
  506. tipFlag: tipFlag.value,
  507. youkeZhangId: youkeZhangId.value,
  508. jieId: data.jieId
  509. }
  510. uni.redirectTo({
  511. url: '/pages/wordList/wordList?youkePageData=' + JSON.stringify(youkeData)
  512. })
  513. } else {
  514. // uni.redirectTo({
  515. // url: '/pages/wordList/wordList?jieId=666'
  516. // })
  517. uni.redirectTo({
  518. url: '/pages/wordList/wordList?jieId=' + data.jieId
  519. })
  520. }
  521. }
  522. function goLookShipin(data, index) {
  523. if (!cacheManager.get('auth')) {
  524. console.log('zhangList.value[0].jieList', zhangList.value[0].jieList);
  525. console.log('zhangList.value[0].jieList.index', zhangList.value[0].jieList[index]);
  526. let youkeData = {
  527. levelId: levelId.value,
  528. typeId: typeId.value,
  529. subjectId: subjectId.value,
  530. tipFlag: tipFlag.value,
  531. jieList: zhangList.value[0].jieList[index],
  532. jieName: zhangList.value[0].jieList[index].jieName
  533. }
  534. if (youkeData.typeId == 1) {
  535. if (!data.videoId) {
  536. toast("videoId 丢失!");
  537. return false
  538. }
  539. uni.redirectTo({
  540. url: '/pages/study/lookShipinNew?youkePageData=' + JSON.stringify(youkeData)
  541. })
  542. } else {
  543. if (!data.videoId) {
  544. toast("videoId 丢失!");
  545. return false
  546. }
  547. uni.redirectTo({
  548. url: '/pages/study/lookShipin?youkePageData=' + JSON.stringify(youkeData)
  549. })
  550. }
  551. } else {
  552. if (typeId.value == 1) {
  553. // 1新 2旧
  554. if (!data.videoId) {
  555. toast("videoId 丢失!");
  556. return false
  557. }
  558. uni.redirectTo({
  559. url: '/pages/study/lookShipinNew?jieId=' + data.jieId
  560. })
  561. } else {
  562. if (!data.videoId) {
  563. toast("videoId 丢失!");
  564. return false
  565. }
  566. uni.redirectTo({
  567. url: '/pages/study/lookShipin?jieId=' + data.jieId
  568. })
  569. }
  570. }
  571. }
  572. function translateData(data) {
  573. // gradeTerm.value = termMapping[data.subjectId] +' · '+ data.levelName
  574. gradeTerm.value = data.levelName
  575. }
  576. function listClick(data, data2, index) {
  577. //console.log('data', data); // 节内容
  578. // console.log('data2', data2); //章内容
  579. chooseMethodListClick(data, data2, index)
  580. }
  581. function chooseMethodListClick(data, data2, index) {
  582. // console.log('data', data); // 节内容
  583. // console.log('data2', data2); //章内容
  584. const authCode = getUserIdentity();
  585. if (currentProduct.value == 2 && typeId.value == 1) {
  586. const isFirst = data.jieName == data2.jieList[0].jieName
  587. if (!cacheManager.get('auth') && !isFirst) {
  588. youkeDialogRef.value.handleShow();
  589. return false;
  590. }
  591. // console.log('authCode', authCode);
  592. if (!(authCode == 'VIP' || isFirst)) {
  593. goPayDialogRef.value.handleShow();
  594. return false
  595. }
  596. goDanciList(data, index)
  597. } else {
  598. if (!cacheManager.get('auth') && data.firstFlag != 1) {
  599. youkeDialogRef.value.handleShow();
  600. return;
  601. }
  602. console.log('authCode', authCode);
  603. if (!(authCode == 'VIP' || data.firstFlag == 1)) {
  604. // debugger
  605. goPayDialogRef.value.handleShow();
  606. return false
  607. }
  608. if (data.type == 2) {
  609. // 最后一项
  610. goKaoshi(data, index)
  611. } else {
  612. goLookShipin(data, index)
  613. }
  614. }
  615. }
  616. function handleCheckCatalogue(item) {
  617. catalogueRef.value.showPopup(item);
  618. }
  619. function clickGradeTerm() {
  620. // if(cacheManager.get('auth')){
  621. // cacheManager.updateObject('auth', {
  622. // currentZhang: 0
  623. // })
  624. // }
  625. uni.navigateTo({
  626. url: `/pages/selectGradesTerms/index?tipFlag=${tipFlag.value}&from=daoPage&productId=${levelId.value}&xuekeId=${subjectId.value}`
  627. })
  628. }
  629. // 游客弹窗---确定
  630. function ykConfirm() {
  631. uni.redirectTo({
  632. url: '/pages/login/index'
  633. });
  634. }
  635. function eggBtn() {
  636. console.log('点击:开启提分之旅');
  637. getProjectImg();
  638. cacheManager.updateObject('auth', {
  639. firstLogin: false
  640. })
  641. }
  642. </script>
  643. <style>
  644. </style>