123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- // customer/pages/goldeneggact/goldeneggact.js
- const app = getApp();
- const utils = require("../../../utils/http");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- activityInfo: {},
- prizesText: ''
- },
- /**
- * 获取活动详情
- */
- getActivityInfo() {
- var that = this;
- utils.$post({
- url: app.globalData.webUrl + 'api/lottery/egg_act_detail',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {},
- success: function (res) {
- if (res.data.code == '0') {
- that.setData({
- activityInfo: res.data.data,
- prizesText: res.data.data && res.data.data.good.length ? res.data.data.good.map(v => v.good_name).join('/') : '',
- })
- }
- }
- })
- },
- /**
- * 员工转发活动记录
- */
- shareCountRecord() {
- var that = this;
- utils.$post({
- url: app.globalData.webUrl + 'api/lottery/act_forward_log',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- actid: that.data.activityInfo.id
- },
- success: function (res) {
- if (res.data.code == '0') {
- console.log('成功')
- }
- }
- })
- },
- /**
- * 抽奖客户
- */
- joinCustomer() {
- wx.navigateTo({
- url: '/pages/other/other?type=29' + '&actid=' + this.data.activityInfo.id,
- })
- },
- /**
- * 我的中奖
- */
- myWinning() {
- wx.showToast({
- title: '只有客户可以查看',
- icon: 'none'
- })
- },
- /**
- * 砸金蛋
- */
- smashGoldenEgg() {
- wx.showToast({
- title: '只有客户才能参与活动',
- icon: 'none'
- })
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.getActivityInfo();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- this.shareCountRecord();
- let uid = app.globalData.currentUserId ? app.globalData.currentUserId : app.globalData.personMsg.id;
- return {
- title: this.data.activityInfo.title,
- imageUrl: '',
- path: '/share/pages/eggsactivity/eggsactivity?uid=' + uid + '&clientype=' + app.globalData.clientype + '&actid=' + this.data.activityInfo.id,
- };
- }
- })
|