123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- const app = require('../../utils/util.js');
- const tools = require('../../utils/tools.js');
- Page({
- data: {
- // 轮播
- backgrounds: [{
- "pic": "/images/banner1.png",
- // link:'../aboutme/index',
- },
- {
- "pic": "/images/banner2.png",
- // link:'../aboutme/index',
- },
- {
- "pic": "/images/banner3.png",
- // link:'../aboutme/index',
- },
- ],
- indicatorDots: true,
- vertical: false,
- autoplay: true,
- interval: 5000,
- duration: 500,
- number: {},
- msgList: [
- {
- url: "url",
- title: "欢迎来到吉顺致养小程序"
- },
- {
- url: "url",
- title: "欢迎来到吉顺致养小程序"
- },
- ]
- },
- goCollect() {
- wx.switchTab({
- url: '/pages/collectInfo/collectInfo',
- })
- },
- goXunfang() {
- wx.switchTab({
- url: '/pages/visitandinfo/visitandinfo',
- })
- },
- goTongzhi() {
- wx.navigateTo({
- url: '/pages/notice/notice',
- })
- },
- goPaiming() {
- wx.navigateTo({
- url: '/pages/paiming/paiming',
- })
- },
- goSaoMa() {
- console.log("扫阿");
- var _this = this;
- // 允许从相机和相册扫码
- wx.scanCode({
- onlyFromCamera: true,
- success: (res) => {
- console.log(res, "打印锕");
- let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
- wx.navigateTo({
- url: '/pages/love/love?id=' + length,
- })
- },
- fail: (res) => {
- console.log(res, "假的");
- wx.showToast({
- title: '当前不是二维码,请扫二维码',
- icon: 'none',
- duration: 2000,
- })
- }
- })
- },
- depts() {
- console.log(wx.getStorageSync('openId'), "openid的问题");
- wx.request({
- url: app.globalData.publicUrl + '/applet/homeStatistics',
- method: "GET",
- data: {
- appletsId: wx.getStorageSync('openId')
- },
- success: (res) => {
- if (res.data.code == 0) {
- this.setData({
- number: res.data.data
- })
- }
- }
- })
- },
- onLoad() {
- this.depts();
- },
- onShow() {
- this.depts();
- }
- })
|