Commit 1e5d5604ff6194dd1ccb691508f258db1db42883

Authored by vking
1 parent b1621952

rule

... ... @@ -45,6 +45,7 @@
"pages/money",
"pages/kefu",
"pages/qiye",
"pages/rule",
"pages/yuding"
]
},
... ...
... ... @@ -3,7 +3,9 @@
<view class="pages" style="background-color: {{activity.element}}">
<view class="banner">
<image mode="widthFix" src="{{activity.bgurl}}" style="width: 100%"></image>
<view class="guize">活动 规则</view>
<navigator url="/pack-activity/pages/rule?id={{activity.id}}" hover-class="navigator-hover">
<view class="guize">活动 规则</view>
</navigator>
<view class="nomoney" wx:if="{{activity.balance<=1000}}"></view>
</view>
<view class="content">
... ...
// pack-activity/pages/index.js
import util from '../../utils/util';
import App from '../../utils/api';
Page({
/**
* 页面的初始数据
*/
data: {
activity:null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.options=options
let sys=wx.getSystemInfoSync();
this.setData({
height:sys.windowHeight,
})
this.GetTaskInfos()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.GetTaskInfos()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title:this.data.activity.title,
path:'/pages/reserve/index',
imageUrl:this.data.activity.bgurl+'.share.jpg',
}
},
GetTaskInfos(){
App.Task.GetTaskInfos({
aid:this.options.id,
}).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
})
})
},
taskNextDo(e){
let index=util.attr(e,'index')
let task=this.data.activity.list[index]
let tid=task.id
,path=util.http_build_query({aid:this.data.activity.id,tid:tid},task.task_url||'/pack-activity/pages/yuding')
console.log(path)
if(task.status==0){
App.Task.SetTaskInfo({//领取任务
aid:this.data.activity.id,
tid:tid,
}).then(()=>{
this.GetTaskInfos()
wx.navigateTo({
url: path
})
})
}else if(task.status==1){
wx.navigateTo({
url: path
})
}else{
wx.navigateTo({
url: '/pack-activity/pages/money'
})
}
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pack-activity/pages/index.wxml-->
<nav hasHome>周到安排</nav>
<view class="pages"
wx:if="{{activity}}"
style="background-color: {{activity.element}};background-image:url('{{activity.bgurl}}.rule.png')">
<view class="content">
<view class="list">
<view class="header flex-cc">
<view class="header-img lt"></view>
<view class="header-txt">活动规则</view>
<view class="header-img gt"></view>
</view>
<view class="item">
<text space="nbsp" class="desc">{{activity.desc}}</text>
</view>
</view>
</view>
</view>
... ...
/* pack-activity/pages/index.wxss */
.pages{
padding: 78rpx 0 52rpx;
background-size: 100% auto;
background-repeat: no-repeat;
}
.content{
width: calc(100% - 40rpx);
margin: 0 20rpx 0;
}
.list{
background:rgba(255,255,255,1);
box-shadow:4rpx 4rpx 6rpx 4rpx rgba(218,61,69,1);
border-radius:10rpx;
padding-top: 72rpx;
padding-bottom: 44rpx;
}
.header{
margin-bottom: 40rpx;
}
.header .header-txt{
width:128rpx;
height:44rpx;
font-size:32rpx;
font-weight:600;
color:rgba(53,53,53,1);
line-height:44rpx;
margin: 0 20rpx;
}
.header-img{
background-size: 100% 100%;
width: 88rpx;
height: 8rpx;
}
.header-img.gt{
background-image: url("http://qn.colorcun.com/activity/images/rule.gt.png");
}
.header-img.lt{
background-image: url("http://qn.colorcun.com/activity/images/rule.lt.png");
}
.list .item{
margin-bottom: 60rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.list .item:last-child{
margin-bottom: 0;
}
.item .icon{
width: 94rpx;
height: 94rpx;
min-width: 94rpx;
}
.item-content{
margin-left: 10rpx;
width: 100%;
}
.desc{
font-size:28rpx;
font-weight:500;
color:rgba(53,53,53,1);
line-height:40rpx;
}
\ No newline at end of file
... ...
... ... @@ -115,7 +115,7 @@
"id": 8,
"name": "邀请进入 pages/customer/index",
"pathName": "pages/customer/index",
"query": "id=9994&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
"query": "id=9995&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
"scene": 1001
},
{
... ... @@ -632,6 +632,13 @@
"pathName": "pack-activity/pages/yuding",
"query": "id=9994&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
"scene": null
},
{
"id": -1,
"name": "pack-activity/pages/rule",
"pathName": "pack-activity/pages/rule",
"query": "id=1",
"scene": null
}
]
}
... ...