index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const app = require('../../utils/util.js');
  2. const tools = require('../../utils/tools.js');
  3. Page({
  4. data: {
  5. // 轮播
  6. backgrounds: [{
  7. "pic": "/images/banner1.png",
  8. // link:'../aboutme/index',
  9. },
  10. {
  11. "pic": "/images/banner2.png",
  12. // link:'../aboutme/index',
  13. },
  14. {
  15. "pic": "/images/banner3.png",
  16. // link:'../aboutme/index',
  17. },
  18. ],
  19. indicatorDots: true,
  20. vertical: false,
  21. autoplay: true,
  22. interval: 5000,
  23. duration: 500
  24. },
  25. goCollect() {
  26. wx.switchTab({
  27. url: '/pages/collectInfo/collectInfo',
  28. })
  29. },
  30. goXunfang() {
  31. wx.switchTab({
  32. url: '/pages/visitandinfo/visitandinfo',
  33. })
  34. },
  35. goTongzhi() {
  36. wx.navigateTo({
  37. url: '/pages/notice/notice',
  38. })
  39. },
  40. goPaiming() {
  41. wx.navigateTo({
  42. url: '/pages/paiming/paiming',
  43. })
  44. },
  45. goSaoMa() {
  46. console.log("扫阿");
  47. var _this = this;
  48. // 允许从相机和相册扫码
  49. wx.scanCode({
  50. onlyFromCamera: true,
  51. success: (res) => {
  52. console.log(res, "打印锕");
  53. let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
  54. wx.navigateTo({
  55. url: '/pages/love/love?id=' + length,
  56. })
  57. },
  58. fail: (res) => {
  59. console.log(res, "假的");
  60. wx.showToast({
  61. title: '当前不是二维码,请扫二维码',
  62. icon: 'none',
  63. duration: 2000,
  64. })
  65. }
  66. })
  67. },
  68. onLoad() {
  69. },
  70. })