Files
coupon/pages/institutions/institutions.js
2023-02-22 23:52:12 +08:00

105 lines
1.9 KiB
JavaScript

//获取应用实例
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
id:options.id
})
this.getMechanismIndex()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 跳转详情
itemgodetail(e){
if (e.currentTarget.dataset.id != 0) {
console.log("你选择的课程id是"+e.currentTarget.dataset.id);
wx.navigateTo({
url: "/shopping/pages/goddess/goddess?id=" + e.currentTarget.dataset.id,
});
}
},
//机构详情
getMechanismIndex: function () {
var that = this;
wx.request({
url: app.buildUrl("/app/Goddesswechat/getMechanismIndex"),
header: app.getRequestHeader(),
method:'POST',
data: {
version_number: this.data.version_number,
uid:wx.getStorageSync('uid'),
token:wx.getStorageSync('token'),
id:this.data.id
},
success: function (res) {
var resp = res.data;
if(resp.erro==0){
that.setData({
infor:resp.infor,
goods:resp.goods,
activity:resp.activity,
});
}
}
});
},
})