123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- // pages/groupPage/my-group/my-group.js
- import httpRequestApi from '../../../utils/APIClient';
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- myGroupList: [],
- typeOf:'',
- title: '',
- headTextOne: '',
- headTextTwo: '',
- content: [],
- productId: '',
- orderId: '',
- groupId: ''
- },
- //跳转到团购详情页
- collageDetails: function ({currentTarget}) {
- const orderId = currentTarget.dataset.orderid;
- const num = currentTarget.dataset.num;
- console.log(num)
- if(!num) {
- wx.navigateTo({
- url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
- })
- } else {
-
-
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (option) {
- console.log(option.title);
- if (option.title) {
- wx.setNavigationBarTitle({
- title: option.title//页面标题为路由参数
- });
- this.setData({
- title: option.title
- });
- }
- httpRequestApi.getMygroup().success((res) => {
- if(!res.data.data.list){
- return
- }
- console.log('我的团', res.data.data.list)
- this.setData({
- myGroupList: res.data.data.list
- })
- res.data.data.list.forEach(element => {
- console.log(element.status)
- if(element.status == 'successed') {
- this.setData({
- productId: element.productId,
- orderId: element.id,
- groupId: element.groupId
- })
- if(wx.getStorageSync(uid) == element.organizer) {
- this.setData({
- typeOf: 'success',
- title: '恭喜 !',
- headTextOne: '您发起的团购拼团成功',
- content: [
- {
- text: "领袖体质魅力无穷!",
- color: "#000"
- },
- {
- text: " 您可以继续发起新的团购,",
- color: "#000"
- },
- {
- text: " 不再需要支付本课程费用,拼团成功,",
- color: "#FF9B00"
- },
- {
- text: " 您将得到xxx元奖励。",
- color: "#FF0000"
- }
- ],
- })
- }else {
- this.setData({
- typeOf: 'success',
- title: '拼团成功 ! ',
- headTextOne: '您参与的团购拼团成功',
- headTextTwo: '订单号:12344',
- content: [
- {
- text: "感谢团长的分享",
- color: "#000"
- },
- {
- text: " 您也可以发起新的团购分享给需要的朋友们,",
- color: "#000"
- },
- {
- text: "作为新的发起人,您无需在支付本课程费用;",
- color: "#FF0000"
- },
- {
- text: "团购成功,您将得到xxx元奖励。",
- color: "#FF0000"
- }
- ],
- })
- }
- }
- });
- }).fail( error => {
- console.log('错误', error)
- })
- },
- //再次发起团
- group: function () {
- // wx.showModal({
- // title: '提示',
- // content: '再次发起团',
- // success (res) {
- // if (res.confirm) {
- // console.log('用户点击确定')
- // } else if (res.cancel) {
- // console.log('用户点击取消')
- // }
- // }
- // })
- const productId = this.data.productId;
- const groupId = this.data.groupId;
- const id = this.data.orderId;
- wx.navigateTo({
- url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${id}&groupId=${groupId}`
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|