|
|
|
// pack-activity/pages/index.js
|
|
|
|
import util from '../../utils/util';
|
|
|
|
import App from '../../utils/api';
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
activity:{
|
|
|
|
id:1,
|
|
|
|
background:'#F04866',
|
|
|
|
banner:'http://qn.colorcun.com/activity/images/banner.png',
|
|
|
|
list:[
|
|
|
|
{
|
|
|
|
id:1,
|
|
|
|
name:'开工专享红包',
|
|
|
|
desc:'开工福利,胡吃海喝',
|
|
|
|
money:'18.8',
|
|
|
|
icon:'http://qn.colorcun.com/activity/images/icon.png',
|
|
|
|
status:0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id:2,
|
|
|
|
name:'开工专享红包',
|
|
|
|
desc:'开工福利,胡吃海喝',
|
|
|
|
money:'18.8',
|
|
|
|
icon:'http://qn.colorcun.com/activity/images/icon.png',
|
|
|
|
status:1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id:3,
|
|
|
|
name:'开工专享红包',
|
|
|
|
desc:'开工福利,胡吃海喝',
|
|
|
|
money:'18.8',
|
|
|
|
icon:'http://qn.colorcun.com/activity/images/icon.png',
|
|
|
|
status:2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id:4,
|
|
|
|
name:'开工专享红包',
|
|
|
|
desc:'开工福利,胡吃海喝',
|
|
|
|
money:'18.8',
|
|
|
|
icon:'http://qn.colorcun.com/activity/images/icon.png',
|
|
|
|
status:0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
count:999.99.toFixed(2),
|
|
|
|
activity:null,
|
|
|
|
count:0,
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -65,7 +29,20 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
App.Task.GetTaskInfos().then(res=>{
|
|
|
|
let activity=res.data.activity
|
|
|
|
activity.list=res.data.task
|
|
|
|
let count=0
|
|
|
|
activity.list.forEach(t=>{
|
|
|
|
if(t.status==2){
|
|
|
|
count+=(t.price*1)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.setData({
|
|
|
|
count:count.toFixed(2),
|
|
|
|
activity:activity
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -100,6 +77,10 @@ Page({ |
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
return {
|
|
|
|
title:this.data.activity.title,
|
|
|
|
path:'/pages/reserve/index',
|
|
|
|
imageUrl:this.data.activity.bgurl,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|