C端小程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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