Files
coupon/pages/peihu/peihu.js
2023-03-12 21:05:54 +08:00

82 lines
1.6 KiB
JavaScript

//获取应用实例
var app = getApp();
Page({
data: {
option1: [{
text: '全部医院',
value: 0
},
{
text: '西京医院',
value: 1
},
{
text: '陕西省人民医院',
value: 2
},
{
text: '陕西省人民医院1',
value: 5
},
],
value1: 0,
version_number: '1.0',
height: '',
url: app.globalData.url,
},
onChange(e) {
this.setData({
timeData: e.detail,
});
},
//生命周期回调——监听小程序启动或切前台。
onShow: function () {
this.getBannerAndCat();
},
//首页信息
getBannerAndCat: function () {
var that = this;
wx.request({
url: app.globalData.url + '/system/hospitalUserView/list',
header: app.getRequestHeader(),
method: 'GET',
data: {
},
success: (res) => {
var resp = res.data;
if (res.data.code == 200) {
that.setData({
special_offer: resp.data,
});
}
}
});
},
// 跳转详情
details(e) {
if (e.currentTarget.dataset.item != 0) {
let item = JSON.stringify(e.currentTarget.dataset.item);
console.log("传递的item" + item);
wx.navigateTo({
url: "/shopping/pages/goddess/goddess?item=" + item,
});
}
},
back(e){
wx.navigateBack()
},
onLoad() {
var statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
this.setData({
statusBarHeight: statusBarHeight,
height: 46 + statusBarHeight,
});
},
changeDateTime1(e) {
this.setData({
dateTime1: e.detail.value
});
},
})