C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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