// pages/main/main.js const app = getApp() const api = require("../../utils/request.js"); Page({ /** * 页面的初始数据 */ data: { Hei:0, background: [app.globalData.mediahost + '/media/banner/1.jpg'], indicatorDots: true, vertical: false, autoplay: true, interval: 7000, duration: 1500, nowWork:null, msgList: [ { title: "欢迎使用中科辐射学堂!" }, { title: "如有疑问,请致电课程顾问师老师:18355135390" },] }, imgH: function (e) { let winWid = wx.getSystemInfoSync().windowWidth; console.log(e) //获取当前屏幕的宽度 let imgh = e.detail.height;                //图片高度 let imgw = e.detail.width; let swiperH = winWid * imgh / imgw + "px"; this.setData({ Hei: swiperH        //设置高度 }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that = this api.request('/examtest/banner/', 'GET').then(res => { let images = [] for(var i=0;i { wx.hideLoading() try { wx.setStorageSync('examtest', res.data) } catch (e) { } wx.navigateTo({ url: '/pages/moni/note', }) }) }, })