Showing
7 changed files
with
224 additions
and
2 deletions
| @@ -3,7 +3,9 @@ | @@ -3,7 +3,9 @@ | ||
| 3 | <view class="pages" style="background-color: {{activity.element}}"> | 3 | <view class="pages" style="background-color: {{activity.element}}"> |
| 4 | <view class="banner"> | 4 | <view class="banner"> |
| 5 | <image mode="widthFix" src="{{activity.bgurl}}" style="width: 100%"></image> | 5 | <image mode="widthFix" src="{{activity.bgurl}}" style="width: 100%"></image> |
| 6 | - <view class="guize">活动 规则</view> | 6 | + <navigator url="/pack-activity/pages/rule?id={{activity.id}}" hover-class="navigator-hover"> |
| 7 | + <view class="guize">活动 规则</view> | ||
| 8 | + </navigator> | ||
| 7 | <view class="nomoney" wx:if="{{activity.balance<=1000}}"></view> | 9 | <view class="nomoney" wx:if="{{activity.balance<=1000}}"></view> |
| 8 | </view> | 10 | </view> |
| 9 | <view class="content"> | 11 | <view class="content"> |
pack-activity/pages/rule.js
0 → 100644
| 1 | +// pack-activity/pages/index.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +Page({ | ||
| 5 | + | ||
| 6 | + /** | ||
| 7 | + * 页面的初始数据 | ||
| 8 | + */ | ||
| 9 | + data: { | ||
| 10 | + activity:null, | ||
| 11 | + }, | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * 生命周期函数--监听页面加载 | ||
| 15 | + */ | ||
| 16 | + onLoad: function (options) { | ||
| 17 | + this.options=options | ||
| 18 | + let sys=wx.getSystemInfoSync(); | ||
| 19 | + this.setData({ | ||
| 20 | + height:sys.windowHeight, | ||
| 21 | + }) | ||
| 22 | + this.GetTaskInfos() | ||
| 23 | + }, | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 27 | + */ | ||
| 28 | + onReady: function () { | ||
| 29 | + | ||
| 30 | + }, | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 生命周期函数--监听页面显示 | ||
| 34 | + */ | ||
| 35 | + onShow: function () { | ||
| 36 | + this.GetTaskInfos() | ||
| 37 | + }, | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 生命周期函数--监听页面隐藏 | ||
| 41 | + */ | ||
| 42 | + onHide: function () { | ||
| 43 | + | ||
| 44 | + }, | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 生命周期函数--监听页面卸载 | ||
| 48 | + */ | ||
| 49 | + onUnload: function () { | ||
| 50 | + | ||
| 51 | + }, | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 55 | + */ | ||
| 56 | + onPullDownRefresh: function () { | ||
| 57 | + | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 页面上拉触底事件的处理函数 | ||
| 62 | + */ | ||
| 63 | + onReachBottom: function () { | ||
| 64 | + | ||
| 65 | + }, | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 用户点击右上角分享 | ||
| 69 | + */ | ||
| 70 | + onShareAppMessage: function () { | ||
| 71 | + return { | ||
| 72 | + title:this.data.activity.title, | ||
| 73 | + path:'/pages/reserve/index', | ||
| 74 | + imageUrl:this.data.activity.bgurl+'.share.jpg', | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + GetTaskInfos(){ | ||
| 78 | + App.Task.GetTaskInfos({ | ||
| 79 | + aid:this.options.id, | ||
| 80 | + }).then(res=>{ | ||
| 81 | + let activity=res.data.activity | ||
| 82 | + activity.list=res.data.task | ||
| 83 | + let count=0 | ||
| 84 | + activity.list.forEach(t=>{ | ||
| 85 | + if(t.status==2){ | ||
| 86 | + count+=(t.price*1) | ||
| 87 | + } | ||
| 88 | + }) | ||
| 89 | + this.setData({ | ||
| 90 | + count:count.toFixed(2), | ||
| 91 | + activity:activity | ||
| 92 | + }) | ||
| 93 | + }) | ||
| 94 | + }, | ||
| 95 | + taskNextDo(e){ | ||
| 96 | + let index=util.attr(e,'index') | ||
| 97 | + let task=this.data.activity.list[index] | ||
| 98 | + let tid=task.id | ||
| 99 | + ,path=util.http_build_query({aid:this.data.activity.id,tid:tid},task.task_url||'/pack-activity/pages/yuding') | ||
| 100 | + console.log(path) | ||
| 101 | + if(task.status==0){ | ||
| 102 | + App.Task.SetTaskInfo({//领取任务 | ||
| 103 | + aid:this.data.activity.id, | ||
| 104 | + tid:tid, | ||
| 105 | + }).then(()=>{ | ||
| 106 | + this.GetTaskInfos() | ||
| 107 | + wx.navigateTo({ | ||
| 108 | + url: path | ||
| 109 | + }) | ||
| 110 | + }) | ||
| 111 | + }else if(task.status==1){ | ||
| 112 | + wx.navigateTo({ | ||
| 113 | + url: path | ||
| 114 | + }) | ||
| 115 | + }else{ | ||
| 116 | + wx.navigateTo({ | ||
| 117 | + url: '/pack-activity/pages/money' | ||
| 118 | + }) | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | +}) |
pack-activity/pages/rule.json
0 → 100644
pack-activity/pages/rule.wxml
0 → 100644
| 1 | +<!--pack-activity/pages/index.wxml--> | ||
| 2 | +<nav hasHome>周到安排</nav> | ||
| 3 | +<view class="pages" | ||
| 4 | + wx:if="{{activity}}" | ||
| 5 | + style="background-color: {{activity.element}};background-image:url('{{activity.bgurl}}.rule.png')"> | ||
| 6 | + <view class="content"> | ||
| 7 | + <view class="list"> | ||
| 8 | + <view class="header flex-cc"> | ||
| 9 | + <view class="header-img lt"></view> | ||
| 10 | + <view class="header-txt">活动规则</view> | ||
| 11 | + <view class="header-img gt"></view> | ||
| 12 | + </view> | ||
| 13 | + <view class="item"> | ||
| 14 | + <text space="nbsp" class="desc">{{activity.desc}}</text> | ||
| 15 | + </view> | ||
| 16 | + </view> | ||
| 17 | + </view> | ||
| 18 | +</view> |
pack-activity/pages/rule.wxss
0 → 100644
| 1 | +/* pack-activity/pages/index.wxss */ | ||
| 2 | +.pages{ | ||
| 3 | + padding: 78rpx 0 52rpx; | ||
| 4 | + background-size: 100% auto; | ||
| 5 | + background-repeat: no-repeat; | ||
| 6 | +} | ||
| 7 | +.content{ | ||
| 8 | + width: calc(100% - 40rpx); | ||
| 9 | + margin: 0 20rpx 0; | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +.list{ | ||
| 13 | + background:rgba(255,255,255,1); | ||
| 14 | + box-shadow:4rpx 4rpx 6rpx 4rpx rgba(218,61,69,1); | ||
| 15 | + border-radius:10rpx; | ||
| 16 | + padding-top: 72rpx; | ||
| 17 | + padding-bottom: 44rpx; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +.header{ | ||
| 21 | + margin-bottom: 40rpx; | ||
| 22 | +} | ||
| 23 | +.header .header-txt{ | ||
| 24 | + width:128rpx; | ||
| 25 | + height:44rpx; | ||
| 26 | + font-size:32rpx; | ||
| 27 | + font-weight:600; | ||
| 28 | + color:rgba(53,53,53,1); | ||
| 29 | + line-height:44rpx; | ||
| 30 | + margin: 0 20rpx; | ||
| 31 | +} | ||
| 32 | +.header-img{ | ||
| 33 | + background-size: 100% 100%; | ||
| 34 | + width: 88rpx; | ||
| 35 | + height: 8rpx; | ||
| 36 | +} | ||
| 37 | +.header-img.gt{ | ||
| 38 | + background-image: url("http://qn.colorcun.com/activity/images/rule.gt.png"); | ||
| 39 | +} | ||
| 40 | +.header-img.lt{ | ||
| 41 | + background-image: url("http://qn.colorcun.com/activity/images/rule.lt.png"); | ||
| 42 | +} | ||
| 43 | +.list .item{ | ||
| 44 | + margin-bottom: 60rpx; | ||
| 45 | + padding: 0 20rpx; | ||
| 46 | + box-sizing: border-box; | ||
| 47 | +} | ||
| 48 | +.list .item:last-child{ | ||
| 49 | + margin-bottom: 0; | ||
| 50 | +} | ||
| 51 | +.item .icon{ | ||
| 52 | + width: 94rpx; | ||
| 53 | + height: 94rpx; | ||
| 54 | + min-width: 94rpx; | ||
| 55 | +} | ||
| 56 | +.item-content{ | ||
| 57 | + margin-left: 10rpx; | ||
| 58 | + width: 100%; | ||
| 59 | +} | ||
| 60 | +.desc{ | ||
| 61 | + font-size:28rpx; | ||
| 62 | + font-weight:500; | ||
| 63 | + color:rgba(53,53,53,1); | ||
| 64 | + line-height:40rpx; | ||
| 65 | +} |
| @@ -115,7 +115,7 @@ | @@ -115,7 +115,7 @@ | ||
| 115 | "id": 8, | 115 | "id": 8, |
| 116 | "name": "邀请进入 pages/customer/index", | 116 | "name": "邀请进入 pages/customer/index", |
| 117 | "pathName": "pages/customer/index", | 117 | "pathName": "pages/customer/index", |
| 118 | - "query": "id=9994&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", | 118 | + "query": "id=9995&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", |
| 119 | "scene": 1001 | 119 | "scene": 1001 |
| 120 | }, | 120 | }, |
| 121 | { | 121 | { |
| @@ -632,6 +632,13 @@ | @@ -632,6 +632,13 @@ | ||
| 632 | "pathName": "pack-activity/pages/yuding", | 632 | "pathName": "pack-activity/pages/yuding", |
| 633 | "query": "id=9994&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", | 633 | "query": "id=9994&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1", |
| 634 | "scene": null | 634 | "scene": null |
| 635 | + }, | ||
| 636 | + { | ||
| 637 | + "id": -1, | ||
| 638 | + "name": "pack-activity/pages/rule", | ||
| 639 | + "pathName": "pack-activity/pages/rule", | ||
| 640 | + "query": "id=1", | ||
| 641 | + "scene": null | ||
| 635 | } | 642 | } |
| 636 | ] | 643 | ] |
| 637 | } | 644 | } |
-
Please register or login to post a comment