const app = getApp() var util = require("../../utils/util.js") Page({ data: { pushCont: { wc_showtime: '', wct_frequency: '', wc_type: '' }, isSetstatus: false, plindex: '-1', touchStart: 0, touchEnd: 0, showmask: false, bigimagecurrent: 0, changeAnimation: 1, //1--开启动画,0--关闭动画 showAnimation: {}, //列表动画 autoplay: true, interval: 5000, duration: 500, evaluateList: [], evaluateListNew: [], lastX: 0, //滑动开始x轴位置 lastY: 0, //滑动开始y轴位置 text: "没有滑动", currentGesture: 0, //标识手势 animationData: {}, pmshow: false, mode: "scaleToFill", mktnum: undefined, map: undefined, latitude: undefined, longitude: undefined, name: undefined, address: undefined, trafficList: [], arr: [], eqArray: [], pmArray: [], mktarr: [], leaseurl: undefined, promotionurl: undefined, userInfo: {}, hasUserInfo: false, autoplayYPTJ: false, indicatorDotsYPTJ: false, circular: false, canIUse: wx.canIUse('button.open-type.getUserInfo') }, onLoad: function(options) { if (options.skip == 1) { if (options.para == null) { wx.navigateTo({ url: options.path }) } else { wx.navigateTo({ url: options.path + '?para=' + options.para }) } } this.init(options) }, init(options) { var that = this util.getData('/getBanners') .then(res => { that.setData({ arr: res }) }) that.setData({ navH: app.globalData.navHeight }) util.getData('/getMktInfos',{ mi_branche_code: 110000 }).then(res => { that.setData({ mktarr: res }) }) that.setData({ navH: app.globalData.navHeight }) }, //点击轮播图 BhrefPm: function(e) { var index = e.currentTarget.dataset.index; if (index != null) { if (e.currentTarget.dataset.type == 1) { wx.navigateTo({ url: '/pages/promotion/promotionhref?para=' + index }) } if (e.currentTarget.dataset.type == 2) { wx.navigateTo({ url: index }) } } }, onShareAppMessage: function() { return { title: '科技强国梦 编程向未来', path: '/pages/index/index?id=888' } }, // map markertap: function(e) { wx.getLocation({ type: 'gcj02', //返回可以用于wx.openLocation的经纬度 success: function(res) { var latitude = e.currentTarget.dataset.latitude var longitude = e.currentTarget.dataset.longitude wx.openLocation({ //出发wx.openLocation API latitude: Number(latitude), //坐标纬度(从地图获取坐标) longitude: Number(longitude), //坐标经度(从地图获取坐标) name: e.currentTarget.dataset.name, //打开后显示的地址名称 address: e.currentTarget.dataset.address, //打开后显示的地址汉字 scale: 17 }) } }) }, })