C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

650 line
29 KiB

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