抖音c端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
1 yıl önce
1 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. const Http = require("../../utils/HttpBasics");
  2. const imgurl = require("../../utils/imgurl");
  3. const config = require("../../config/config");
  4. let app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {},
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. getCongig() { //获取小程序是否开通授权手机号
  14. Http.get({
  15. url: config.api.getConfig,
  16. data: {
  17. key: "douyinPhoneStatus"
  18. }
  19. }).then(res => {
  20. app.globalData.ifCongPh = res.data ? res.data : 1
  21. }).catch(err => {
  22. app.globalData.ifCongPh = 1
  23. })
  24. },
  25. onLoad: function (options) {
  26. let that = this;
  27. console.log(options, "跳转地址栏");
  28. tt.showToast({
  29. title: '加载中',
  30. icon: "loading",
  31. duration: 1000
  32. })
  33. /**
  34. * 根据接收到的参数的值,判断跳转到哪个页面
  35. */
  36. if (options && options.type) {
  37. app.globalData.type = options.type;
  38. }
  39. if (decodeURIComponent(options.scene) == "undefined") {
  40. that.setData({
  41. scene: 0
  42. })
  43. app.globalData.scene = 0;
  44. } else {
  45. that.setData({
  46. scene: decodeURIComponent(options.scene)
  47. });
  48. app.globalData.scene = decodeURIComponent(options.scene)
  49. that.setData({
  50. newArr: this.data.scene.split(':')
  51. })
  52. console.log(this.data.newArr);
  53. //// 大屏-二维码-start
  54. if (this.data.newArr[0] == 'JC') {
  55. // 跳转券详情
  56. options.couponChannelId = this.data.newArr[1];
  57. } else if (this.data.newArr[0] == 'JG') {
  58. // 跳转拼团详情
  59. options.couponChannelId = this.data.newArr[1];
  60. options.path = 'daping'
  61. } else if (this.data.newArr[0] == 't') {
  62. // 普通二维码
  63. options.type = this.data.newArr[1];
  64. app.globalData.type = options.type;
  65. if (options.type == 'cd') {
  66. options.couponChannelId = this.data.newArr[2];
  67. options.tenantId = this.data.newArr[3] || "";
  68. } else if (options.type == 'bd') {
  69. options.bt = this.data.newArr[2];
  70. options.id = this.data.newArr[3];
  71. options.tenantId = this.data.newArr[4] || "";
  72. } else if (options.type == 'gm') {
  73. options.id = this.data.newArr[2];
  74. } else if (options.type == 'sd') {
  75. options.couponChannelId = this.data.newArr[2];
  76. } else if (options.type == 'td') {
  77. // 专题活动页
  78. options.id = this.data.newArr[2];
  79. } else if (options.type == 'md') {
  80. // 门店详情
  81. options.id = this.data.newArr[2];
  82. options.tenantId = this.data.newArr[3] || "";
  83. } else if (options.type == 'ra') {
  84. //活动详情
  85. options.id = this.data.newArr[2];
  86. } else if (options.type == 'si') {
  87. //活动签到
  88. options.id = this.data.newArr[2];
  89. } else if (options.type == 'wj') {
  90. options.id = this.data.newArr[2];
  91. } else if (options.type == 'wjLsit') {
  92. options.id = this.data.newArr[2];
  93. } else if (options.type == 'scanIn') {
  94. options.tenantId = this.data.newArr[2] || "";
  95. }
  96. }
  97. }
  98. tt.setStorageSync('options', JSON.stringify(options))
  99. tt.setStorageSync('imgurl', imgurl);
  100. if (app.globalData.token) {
  101. that.getCongig()
  102. // this.updateUserInfo();
  103. if (options.couponChannelId || options.orderId || options.id) {
  104. that.userStatus(options);
  105. } else {
  106. that.userStatus(options);
  107. }
  108. } else {
  109. // 由于 token 是网络请求,可能会在 Page.onLoad 之后才返回
  110. // 所以此处加入 callback 以防止这种情况
  111. app.tokenCallback = token => {
  112. that.getCongig()
  113. // this.updateUserInfo();
  114. if (options.couponChannelId || options.orderId || options.id) {
  115. that.userStatus(options);
  116. } else {
  117. that.userStatus(options);
  118. }
  119. }
  120. }
  121. },
  122. /**
  123. * 检查用户的状态
  124. */
  125. userStatus: function (options) {
  126. var that = this;
  127. console.log(options, 'userStatus');
  128. if (options && (options.couponChannelId || options.orderId || options.id)) {
  129. that.checkuserstatus(options);
  130. } else {
  131. that.checkuserstatus(options);
  132. }
  133. },
  134. /**
  135. * 获取手机信息
  136. */
  137. // updateUserInfo() {
  138. // tt.getSystemInfo({
  139. // success: function(res) {
  140. // Http.post({
  141. // url: config.api.updateUserInfo,
  142. // data: {
  143. // systemInfo: JSON.stringify(res)
  144. // }
  145. // }).then(res => {
  146. // console.log(res)
  147. // })
  148. // }
  149. // })
  150. // },
  151. checkuserstatus(options) {
  152. console.log(options, 'checkuserstatus');
  153. let that = this;
  154. if (options && options.couponChannelId && options.type == 'orderAffirm') {
  155. tt.redirectTo({
  156. url: `/pages/coupon/confirmation/confirmation?couponChannelId=${options.couponChannelId}`
  157. })
  158. }
  159. if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') {
  160. if (options.cuserId) {
  161. tt.redirectTo({
  162. url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}&mallTenantId=${options.tenantId}`,
  163. })
  164. } else {
  165. // 跳转普通券/消费卡/限时秒杀/砍价详情
  166. tt.redirectTo({
  167. url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&mallTenantId=${options.tenantId}`,
  168. })
  169. }
  170. } else {
  171. let dataX = {
  172. token: app.globalData.token,
  173. }
  174. if (options && options.tenantId) {
  175. dataX.mallTenantId = options.tenantId
  176. }
  177. console.log(dataX, 'dataX');
  178. Http.get({
  179. url: config.api.checkUserStatus,
  180. dataX
  181. })
  182. .then(res => {
  183. // res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}')
  184. //参与拼团
  185. if (options && options.orderId && app.globalData.type == 'dt') {
  186. //订单详情
  187. tt.redirectTo({
  188. url: `/pages/order/detail/index?orderId=${options.orderId}&mallTenantId=${options.tenantId}`
  189. })
  190. } else if (options && options.orderGroupId) {
  191. tt.redirectTo({
  192. url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
  193. })
  194. }
  195. //来自大屏的跳转拼团券详情
  196. else if (options && options.couponChannelId && options.path == 'daping') {
  197. /**
  198. * 主要是为了拿couponId
  199. */
  200. Http.get({
  201. url: config.api.couponDetail,
  202. data: {
  203. couponChannelId: options.couponChannelId
  204. }
  205. }).then(res => {
  206. let data = res.data;
  207. tt.redirectTo({
  208. url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}&couponId=${data.couponId}`
  209. })
  210. })
  211. } else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') {
  212. // 转赠判断
  213. if (options.cuserId) {
  214. tt.redirectTo({
  215. url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`,
  216. })
  217. } else {
  218. // 跳转普通券/消费卡/限时秒杀/砍价详情
  219. tt.redirectTo({
  220. url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`,
  221. })
  222. }
  223. }
  224. // 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口)
  225. else if ((options && options.couponChannelId && app.globalData.type == 'sd') || (options && options.couponChannelId && options.spellGroup)) {
  226. tt.redirectTo({
  227. url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`,
  228. })
  229. }
  230. // 游戏页面
  231. else if (options && options.id && app.globalData.type == 'gm') {
  232. that.getGameOne(app.globalData.token, options.id)
  233. }
  234. // 报名活动页面
  235. else if (options && options.id && app.globalData.type == 'ra') {
  236. tt.redirectTo({
  237. url: `/pages/radetail/index?id=${options.id}`,
  238. })
  239. }
  240. //活动签到
  241. else if (options && options.id && app.globalData.type == 'si') {
  242. tt.redirectTo({
  243. url: `/pages/acSignIn/index?id=${options.id}`,
  244. })
  245. } else if (app.globalData.type == 'wjLsit') { //问卷调查
  246. tt.redirectTo({
  247. url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
  248. })
  249. }
  250. //问卷答题
  251. else if (options && options.id && app.globalData.type == 'wj') {
  252. tt.redirectTo({
  253. url: `/pages/questionnaire/questionnaire?id=${options.id}`,
  254. })
  255. }
  256. // 宣传页详情
  257. else if (options && options.bt && options.id && app.globalData.type == 'bd') {
  258. if (options.bt == '2') {
  259. // 自由图文
  260. tt.redirectTo({
  261. url: `/pages/freeBannerDetail/index?id=${options.id}`,
  262. })
  263. } else {
  264. // 标准格式
  265. tt.redirectTo({
  266. url: `/pages/bannerdetail/index?id=${options.id}`,
  267. })
  268. }
  269. }
  270. // 专题
  271. else if (options && options.id && app.globalData.type == 'td') {
  272. tt.redirectTo({
  273. url: `/pages/topicDetail/index?id=${options.id}`
  274. });
  275. }
  276. // 门店详情
  277. else if (options && options.id && app.globalData.type == 'md') {
  278. tt.redirectTo({
  279. url: `/pages/index/searchbar/detail/index?id=${options.id}&tenantId=${options.tenantId}`
  280. });
  281. }
  282. // 参与砍价
  283. else if (options && options.orderId) {
  284. tt.redirectTo({
  285. url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`,
  286. })
  287. }
  288. // 我的
  289. else if (app.globalData.type == 'uc') {
  290. tt.navigateTo({
  291. url: '/index/user'
  292. });
  293. }
  294. // 积分
  295. else if (app.globalData.type == 'jf') {
  296. tt.redirectTo({
  297. url: '/pages/integralmall/index'
  298. });
  299. }
  300. // 首页
  301. else if (app.globalData.type == 'in') {
  302. tt.reLaunch({
  303. url: '/index/index'
  304. });
  305. }
  306. // 停车
  307. else if (app.globalData.type == 'pc') {
  308. // 停车
  309. tt.navigateTo({
  310. url: '/index/passCar'
  311. });
  312. }
  313. // 我的券包
  314. else if (app.globalData.type == 'mc') {
  315. // 我的券包
  316. tt.redirectTo({
  317. url: '/pages/couponorder/index/index'
  318. });
  319. }
  320. // 我的订单
  321. else if (app.globalData.type == 'mo') {
  322. // 我的订单
  323. tt.redirectTo({
  324. url: '/pages/order/index/index?id=all'
  325. });
  326. }
  327. // 我的卡包
  328. else if (app.globalData.type == 'ca') {
  329. // 我的卡包
  330. tt.redirectTo({
  331. url: '/pages/cardorder/index/index'
  332. });
  333. }
  334. // 特享礼遇
  335. else if (app.globalData.type == 'sc') {
  336. // 特享礼遇
  337. tt.redirectTo({
  338. url: '/pages/specialcourtesy/specialcourtesy'
  339. });
  340. }
  341. // 限时秒杀
  342. else if (app.globalData.type == 'rb') {
  343. // 限时秒杀
  344. tt.redirectTo({
  345. url: '/pages/rushToBuy/index'
  346. })
  347. }
  348. // 砍价专场
  349. else if (app.globalData.type == 'bl') {
  350. // 砍价专场
  351. tt.redirectTo({
  352. url: '/pages/bargain/bargain'
  353. })
  354. }
  355. // 我的砍价
  356. else if (app.globalData.type == 'mb') {
  357. // 我的砍价
  358. tt.redirectTo({
  359. url: '/pages/bargain/bargain?from=myhtml'
  360. })
  361. }
  362. // 拼团专场
  363. else if (app.globalData.type == 'sl') {
  364. // 拼团专场
  365. tt.redirectTo({
  366. url: '/pages/spellGroup/spellGroup'
  367. })
  368. }
  369. // 我的拼团
  370. else if (app.globalData.type == 'ms') {
  371. // 我的拼团
  372. tt.redirectTo({
  373. url: '/pages/spellGroup/spellGroup?from=myhtml'
  374. })
  375. }
  376. // 消费卡
  377. else if (app.globalData.type == 'dc') {
  378. // 消费卡
  379. tt.redirectTo({
  380. url: '/pages/discountCardList/discountCardList'
  381. })
  382. }
  383. // 门店
  384. else if (app.globalData.type == 'ml') {
  385. tt.navigateTo({
  386. url: '/index/searchbar'
  387. })
  388. }
  389. // 兑换
  390. else if (app.globalData.type == 'ec') {
  391. tt.redirectTo({
  392. url: '/pages/exchange/exchange'
  393. })
  394. }
  395. // 兑换
  396. else if (app.globalData.type == 'zb') {
  397. tt.redirectTo({
  398. url: '/pages/liveLsit/liveLsit'
  399. })
  400. }
  401. // 通过分享进入的门店详情
  402. else if (options && options.id && options.frommd == 'md') {
  403. tt.redirectTo({
  404. url: `/pages/index/searchbar/detail/index?id=${options.id}`
  405. });
  406. }
  407. // 通过扫码进入首页
  408. else if (app.globalData.type == 'scanIn') {
  409. console.log('scanIn!!!!!!!');
  410. tt.navigateTo({
  411. url: `/index/index?type=in&tenantId=${options.tenantId}`
  412. })
  413. } else {
  414. console.log('/index/index');
  415. // 主页
  416. tt.reLaunch({
  417. url: '/index/index'
  418. })
  419. }
  420. })
  421. .catch(err => {
  422. console.log(err)
  423. if (err.code == 11004) {
  424. // 用户昵称未授权
  425. if (options && options.orderGroupId) {
  426. tt.redirectTo({
  427. url: `/pages/getuserinfo/getuserinfo?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
  428. })
  429. }
  430. /**
  431. * spellGroup
  432. * 区分是通过拼团详情分享过来的还是从普通券分享过来的
  433. * 注意:拼团券和普通券是两个页面
  434. */
  435. if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) {
  436. tt.redirectTo({
  437. url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}`
  438. })
  439. } else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) {
  440. tt.redirectTo({
  441. url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}`
  442. })
  443. } else if (options && options.couponChannelId && options.cuserId) {
  444. /**
  445. * 转赠判断
  446. */
  447. tt.redirectTo({
  448. url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`
  449. })
  450. } else if (options && options.orderId) {
  451. tt.redirectTo({
  452. url: `/pages/getuserinfo/getuserinfo?orderId=${options.orderId}&from='${"discount"}`
  453. })
  454. }
  455. // 通过分享进入的门店详情
  456. else if (options && options.id && options.frommd == 'md') {
  457. tt.redirectTo({
  458. url: `/pages/getuserinfo/getuserinfo?id=${options.id}&frommd=md`
  459. });
  460. } // 门店详情
  461. else if (options && options.id && app.globalData.type == 'md') {
  462. tt.redirectTo({
  463. url: `/pages/index/searchbar/detail/index?id=${options.id}`
  464. });
  465. } else if (app.globalData.type == 'wjLsit') { //问卷调查
  466. tt.redirectTo({
  467. url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
  468. })
  469. }
  470. // 答题问卷
  471. else if (options && options.id && app.globalData.type == 'wj') {
  472. tt.redirectTo({
  473. url: `/pages/questionnaire/questionnaire?id=${options.id}`,
  474. })
  475. }
  476. // 报名活动页面
  477. else if (options && options.id && app.globalData.type == 'ra') {
  478. tt.redirectTo({
  479. url: `/pages/radetail/index?id=${options.id}`,
  480. })
  481. } else if (app.globalData.type == 'uc') {
  482. tt.navigateTo({
  483. url: '/index/user'
  484. });
  485. }
  486. // 积分
  487. else if (app.globalData.type == 'jf') {
  488. tt.redirectTo({
  489. url: '/pages/integralmall/index'
  490. });
  491. }
  492. // 专题
  493. else if (options && options.id && app.globalData.type == 'td') {
  494. tt.redirectTo({
  495. url: `/pages/topicDetail/index?id=${options.id}`
  496. });
  497. }
  498. // 首页
  499. else if (app.globalData.type == 'in') {
  500. tt.reLaunch({
  501. url: '/index/index'
  502. });
  503. }
  504. // 停车
  505. else if (app.globalData.type == 'pc') {
  506. // 停车
  507. tt.navigateTo({
  508. url: '/index/passCar'
  509. });
  510. }
  511. // 我的券包
  512. else if (app.globalData.type == 'mc') {
  513. // 我的券包
  514. tt.redirectTo({
  515. url: '/pages/couponorder/index/index'
  516. });
  517. }
  518. // 我的订单
  519. else if (app.globalData.type == 'mo') {
  520. // 我的订单
  521. tt.redirectTo({
  522. url: '/pages/order/index/index?id=all'
  523. });
  524. }
  525. // 我的卡包
  526. else if (app.globalData.type == 'ca') {
  527. // 我的卡包
  528. tt.redirectTo({
  529. url: '/pages/cardorder/index/index'
  530. });
  531. }
  532. // 特享礼遇
  533. else if (app.globalData.type == 'sc') {
  534. // 特享礼遇
  535. tt.redirectTo({
  536. url: '/pages/specialcourtesy/specialcourtesy'
  537. });
  538. }
  539. // 限时秒杀
  540. else if (app.globalData.type == 'rb') {
  541. // 限时秒杀
  542. tt.redirectTo({
  543. url: '/pages/rushToBuy/index'
  544. })
  545. }
  546. // 砍价专场
  547. else if (app.globalData.type == 'bl') {
  548. // 砍价专场
  549. tt.redirectTo({
  550. url: '/pages/bargain/bargain'
  551. })
  552. }
  553. // 我的砍价
  554. else if (app.globalData.type == 'mb') {
  555. // 我的砍价
  556. tt.redirectTo({
  557. url: '/pages/bargain/bargain?from=myhtml'
  558. })
  559. }
  560. // 拼团专场
  561. else if (app.globalData.type == 'sl') {
  562. // 拼团专场
  563. tt.redirectTo({
  564. url: '/pages/spellGroup/spellGroup'
  565. })
  566. }
  567. // 我的拼团
  568. else if (app.globalData.type == 'ms') {
  569. tt.redirectTo({
  570. url: '/pages/spellGroup/spellGroup?from=myhtml'
  571. })
  572. }
  573. // 消费卡
  574. else if (app.globalData.type == 'dc') {
  575. // 消费卡
  576. tt.redirectTo({
  577. url: '/pages/discountCardList/discountCardList'
  578. })
  579. }
  580. // 兑换
  581. else if (app.globalData.type == 'ec') {
  582. tt.redirectTo({
  583. url: '/pages/exchange/exchange'
  584. })
  585. }
  586. // 门店
  587. else if (app.globalData.type == 'ml') {
  588. tt.navigateTo({
  589. url: '/index/searchbar'
  590. })
  591. }
  592. // 首页
  593. else if (app.globalData.type == 'scanIn') {
  594. tt.navigateTo({
  595. url: `/index/index?type=in&tenantId=${options.tenantId}`
  596. })
  597. } else {
  598. tt.reLaunch({
  599. url: '/index/index',
  600. })
  601. }
  602. }
  603. })
  604. }
  605. },
  606. getGameOne: function (token, id) {
  607. let _this = this;
  608. Http.get({
  609. url: config.api.getOneGame,
  610. data: {
  611. token: token,
  612. id: id
  613. }
  614. }).then(res => {
  615. tt.redirectTo({
  616. url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId,
  617. })
  618. })
  619. .catch(err => {
  620. tt.showModal({
  621. title: '提示',
  622. content: err.message,
  623. showCancel: false,
  624. success: function (res) {
  625. // 如果游戏下架或者找不到,重启首页
  626. if (res.confirm) {
  627. tt.reLaunch({
  628. url: '/pages/index/index',
  629. })
  630. }
  631. }
  632. })
  633. this.alphaClick();
  634. })
  635. },
  636. })