123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // pages/groupPage//discount-group/discount-group.js
- import httpRequestApi from '../../../utils/APIClient';
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- recommendList: []
- },
- //点击跳转到团购详情
- groupDetail:function ({currentTarget}) {
- const productId = currentTarget.dataset.productid;
- const id = currentTarget.dataset.id;
- const groupId = currentTarget.dataset.groupid;
- const ind = currentTarget.dataset.ind;
- //const groupType = this.data.groupData.recommendList[ind].groupType;
- wx.navigateTo({
- url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
- })
- // if(groupType === "PROMOTION") {
- // wx.navigateTo({
- // url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${id}&groupId=${groupId}`
- // })
- // }else {
- // wx.navigateTo({
- // url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
- // })
- // }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- if (app.globalData.isIOS) {
- wx.redirectTo({
- url: '../../index/index'
- })
- return
- }
- wx.setNavigationBarTitle({
- title: '优惠团购'
- })
- //优惠内容
- httpRequestApi.getGroupList().success( (res) => {
- console.log('推荐团购',res.data.data)
- this.setData({
- recommendList: res.data.data
- })
- }).fail((error) => {
- console.log('错误',error)
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|