C端小程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

61 líneas
1.5 KiB

  1. const Http = require("../../utils/HttpBasics")
  2. //获取应用实例
  3. const app = getApp()
  4. Page({
  5. data: {
  6. market: app.globalData.market,
  7. imgUrls: [
  8. 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
  9. 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
  10. 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
  11. ],
  12. swiperCurrent: 0,
  13. scrollTop: 0
  14. },
  15. swiperChange: function (e) {
  16. this.setData({
  17. swiperCurrent: e.detail.current
  18. })
  19. },
  20. /**
  21. * 生命周期函数--监听页面初次渲染完成
  22. */
  23. onReady: function () {
  24. },
  25. onLoad: function (options) {
  26. var that = this;
  27. if (app.globalData.token && app.globalData.token != null) {
  28. console.log("index ++ " + app.globalData.token);
  29. } else {
  30. // 由于是网络请求,可能会在 Page.onLoad 之后才返回
  31. // 所以此处加入 callback 以防止这种情况
  32. app.tokenCallback = token => {
  33. console.log("index + " + token);
  34. }
  35. }
  36. wx.showLoading({
  37. title: '加载中',
  38. })
  39. var scene = decodeURIComponent(options.scene);
  40. var that = this;
  41. setTimeout(function () {
  42. wx.hideLoading()
  43. }, 2200)
  44. },
  45. // 用户点击右上角分享
  46. onShareAppMessage: function () {
  47. return {
  48. title: '富茂链客',
  49. desc: '分享个小程序,希望你喜欢',
  50. success: function (res) {
  51. wx.showToast({
  52. title: "分享成功",
  53. duration: 1000,
  54. icon: "success"
  55. })
  56. }
  57. }
  58. }
  59. })