index.vue 20 KB

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