91 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

2024-02-21 17:43:11 +08:00
let app = getApp()
Page({
data: {
IMG_NAME: app.IMG_NAME,
// 轮播
bannerUrls: [{
url: 'https://www.71big.com/heqing/zhaojingwang/common/images/banner1.jpg',
linkUrl: ''
},
{
url: 'https://www.71big.com/heqing/zhaojingwang/common/images/banner1.jpg',
linkUrl: ''
},
{
url: 'https://www.71big.com/heqing/zhaojingwang/common/images/banner1.jpg',
linkUrl: ''
}
],
loading: false,
noMore: 0,
loadingFailed: false,
pageNo: 1,
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 1000,
type: '1',
list: [],
myOrderList: []
},
onLoad(e) {
wx.setNavigationBarTitle({
title: '我的服务',
})
let that = this
app.AjaxRequest('get', {
'content-type': 'application/json',
'Authorization': 'Bearer ' + app.Getopenid()
}, '/manage/myOrderList', {}, function (res) {
that.setData({
myOrderList: res.data
})
})
},
bannernav(e) {
wx.navigateTo({
url: e.currentTarget.dataset.uri,
})
},
//轮播高度自适应——获取图片高度
imgHeight: function (e) {
var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
var imgh = e.detail.height; //图片高度
var imgw = e.detail.width; //图片宽度
var swiperH = winWid * imgh / imgw + "px"
this.setData({
Height: swiperH //设置高度
})
},
navapply(e) {
let data = JSON.stringify(e.currentTarget.dataset.objlist)
wx.navigateTo({
url: '/pages/enterpriseServices/serviceList/serviceList?data=' + data
})
},
navDetail(e) {
wx.navigateTo({
url: '/pages/enterpriseServices/serviceDetail/serviceDetail?id=' + e.currentTarget.dataset.id
})
},
//请求数据
getData(isPage) {
let that = this
let params = {
pageNum: that.data.pageNo,
pageSize: 10
}
that.setData({
loading: false
})
},
scrollToLower: function (e) {
if (!this.data.loading && !this.data.noMore) {
this.setData({
loading: true,
pageNo: this.data.pageNo + 1
})
this.getData(true);
}
},
})