Commit 16297019d087ad18d1c921a480bd8acc9e7f39cc
1 parent
44101ab3
Exists in
master
修复问题
Showing
7 changed files
with
115 additions
and
48 deletions
Show diff stats
app.js
... | ... | @@ -45,7 +45,7 @@ App({ |
45 | 45 | //你的分享配置 |
46 | 46 | return { |
47 | 47 | title: name + '推荐您 一起开始自主学习之旅', |
48 | - path: '/pages/index/index', | |
48 | + path: '/pages/login/loginNew/loginNew', | |
49 | 49 | // imageUrl: 'https://proxy.shunzhi.net:51315/mp_share2.jpg', |
50 | 50 | imageUrl: 'https://szyundisk.oss-cn-hangzhou.aliyuncs.com/AdmissionsManageSys/37317060-9e67-41e1-9731-b722c83cff8a.jpg', |
51 | 51 | }; | ... | ... |
pages/index/achievement/achievement.js
... | ... | @@ -21,6 +21,10 @@ Page({ |
21 | 21 | hideHeader: true, // 隐藏日历头部操作栏 |
22 | 22 | autoChoosedWhenJump: true, // 设置默认日期及跳转到指定日期后是否需要自动选中 |
23 | 23 | defaultDate: moment(new Date().getTime()).format('YYYY-MM-DD'), // 默认选中指定某天,如需选中需配置 autoChoosedWhenJump: true |
24 | + disableMode: { // 禁用某一天之前/之后的所有日期 | |
25 | + type: 'after', // [‘before’, 'after'] | |
26 | + // 无该属性或该属性值为假,则默认为当天 | |
27 | + }, | |
24 | 28 | }, |
25 | 29 | isDisplay: false, |
26 | 30 | calendar: {}, //日历 |
... | ... | @@ -57,6 +61,7 @@ Page({ |
57 | 61 | let date = e.detail.date |
58 | 62 | // let month = e.detail.month |
59 | 63 | // let year = e.detail.year |
64 | + this.resetV2(e.detail.year,e.detail.month,date ) | |
60 | 65 | let recordVo = this.data.resData.eventDetails[date - 1].recordVo |
61 | 66 | if (recordVo != null) { |
62 | 67 | console.log('复制', recordVo) |
... | ... | @@ -72,8 +77,8 @@ Page({ |
72 | 77 | }) |
73 | 78 | } |
74 | 79 | }, |
75 | - //获取信息 | |
76 | - getInfo(doday, isOne = 0) { | |
80 | + //获取信息(第一次进来,模拟点击渲染) | |
81 | + getInfo(doday, isOne = 0,e) { | |
77 | 82 | request({ |
78 | 83 | url: `/wx/task/getSignRecord`, |
79 | 84 | method: 'get', |
... | ... | @@ -89,13 +94,6 @@ Page({ |
89 | 94 | }) |
90 | 95 | this.getV2(res.data) |
91 | 96 | if (isOne == 1) { |
92 | - let e = { | |
93 | - detail: { | |
94 | - date: moment().date(), | |
95 | - month: moment().month() + 1, | |
96 | - year: moment().year() | |
97 | - } | |
98 | - } | |
99 | 97 | this.afterTapDate(e) |
100 | 98 | } |
101 | 99 | } else { |
... | ... | @@ -113,6 +111,24 @@ Page({ |
113 | 111 | 'calendar': this.selectComponent('#calendar').calendar |
114 | 112 | }) |
115 | 113 | }, |
114 | + //重置日历 | |
115 | + resetV2(year,month,date) { | |
116 | + console.log(year,month,date) | |
117 | + if(this.data.dayMoment == month) { | |
118 | + }else { | |
119 | + let e = { | |
120 | + detail: { | |
121 | + date: date, | |
122 | + month: month, | |
123 | + year: year | |
124 | + } | |
125 | + } | |
126 | + this.setData({ | |
127 | + dayMoment:month | |
128 | + }) | |
129 | + this.getInfo(moment(year + '-' + month +'-' + date).format('YYYY-MM-DD'),1,e) | |
130 | + } | |
131 | + }, | |
116 | 132 | //显示日历 |
117 | 133 | getV2(resData) { |
118 | 134 | this.setData({ |
... | ... | @@ -127,6 +143,7 @@ Page({ |
127 | 143 | showLabelAlways: true, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效 |
128 | 144 | dates: resData.eventDetails |
129 | 145 | }) |
146 | + this.data.calendar.enableArea([this.data.taskVo.startDate, moment(new Date().getTime()).format('YYYY-MM-DD')]) | |
130 | 147 | }, |
131 | 148 | /** |
132 | 149 | * 生命周期函数--监听页面加载 |
... | ... | @@ -145,6 +162,13 @@ Page({ |
145 | 162 | */ |
146 | 163 | onReady() { |
147 | 164 | this.initialize() |
148 | - this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'), 1) | |
165 | + let e = { | |
166 | + detail: { | |
167 | + date: moment().date(), | |
168 | + month: moment().month() + 1, | |
169 | + year: moment().year() | |
170 | + } | |
171 | + } | |
172 | + this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'), 1,e) | |
149 | 173 | }, |
150 | 174 | }) |
151 | 175 | \ No newline at end of file | ... | ... |
pages/index/index.wxml
... | ... | @@ -24,11 +24,11 @@ |
24 | 24 | </view> |
25 | 25 | </view> |
26 | 26 | <view class="day_font">{{value.taskDesc}}</view> |
27 | - <!-- <view class="day_font2">已坚持打卡 | |
28 | - <text class="day_font2_large">1/50 </text>天 | |
29 | - </view> --> | |
27 | + <view class="day_font2">打卡已进行 | |
28 | + <text class="day_font2_large">{{value.signDayNum}} </text>天 | |
29 | + </view> | |
30 | 30 | <view> |
31 | - <van-progress percentage="50" color='#3F5EFF' stroke-width="13" pivot-text=' ' /> | |
31 | + <van-progress percentage="{{value.signDayNum/value.taskCycle*100}}" color='#3F5EFF' stroke-width="13" pivot-text=' ' /> | |
32 | 32 | </view> |
33 | 33 | <view class="flex_font"> |
34 | 34 | <text class="grey_flex">打卡频次:</text> | ... | ... |
pages/index/punchDetail/punchDetail.js
... | ... | @@ -3,11 +3,13 @@ |
3 | 3 | import plugin from '../../../component/v2/plugins/index' |
4 | 4 | import week from '../../../component/v2/plugins/week' |
5 | 5 | import todo from '../../../component/v2/plugins/todo' |
6 | +import selectable from '../../../component/v2/plugins/selectable' | |
6 | 7 | import request from '../../../api/request.js' |
7 | 8 | import moment from 'moment'; |
8 | 9 | plugin |
9 | 10 | .use(week) |
10 | 11 | .use(todo) |
12 | + .use(selectable) | |
11 | 13 | Page({ |
12 | 14 | |
13 | 15 | /** |
... | ... | @@ -19,6 +21,10 @@ Page({ |
19 | 21 | weekMode: true, // 周视图模式 |
20 | 22 | highlightToday: true, // 是否高亮显示当天 |
21 | 23 | hideHeader: true, // 隐藏日历头部操作栏 |
24 | + disableMode: { // 禁用某一天之前/之后的所有日期 | |
25 | + type: 'after', // [‘before’, 'after'] | |
26 | + // 无该属性或该属性值为假,则默认为当天 | |
27 | + }, | |
22 | 28 | }, |
23 | 29 | isDisplay: false, |
24 | 30 | clockShow: false, |
... | ... | @@ -57,28 +63,29 @@ Page({ |
57 | 63 | taskStatisticsParam: "" |
58 | 64 | }, //成果数据当天 |
59 | 65 | recordVoShow: false, |
60 | - isToday:true,//是否是今天 | |
61 | - isLarge:false, //是否大于今天 | |
62 | - repairText: '' | |
66 | + isToday: true, //是否是今天 | |
67 | + isLarge: false, //是否大于今天 | |
68 | + repairText: '', | |
69 | + dayMoment: '' | |
63 | 70 | }, |
64 | - /** | |
71 | + /** | |
65 | 72 | * 选择日期后执行的事件 |
66 | 73 | */ |
67 | 74 | afterTapDate(e) { |
68 | 75 | let date = e.detail.date |
76 | + this.resetV2(e.detail.year, e.detail.month, date) | |
69 | 77 | this.setData({ |
70 | - isToday:e.detail.isToday | |
78 | + isToday: e.detail.isToday | |
71 | 79 | }) |
72 | 80 | //选择的年月日 |
73 | - let checkDay = e.detail.year +'-' + e.detail.month +'-' + e.detail.date | |
74 | - let checktimeDate= new Date(moment(checkDay).format('YYYY-MM-DD')).getTime() | |
81 | + let checkDay = e.detail.year + '-' + e.detail.month + '-' + e.detail.date | |
82 | + let checktimeDate = new Date(moment(checkDay).format('YYYY-MM-DD')).getTime() | |
75 | 83 | //选择的日期是否大于今天 |
76 | - if(checktimeDate > new Date().getTime()) { | |
77 | - console.log('ff') | |
84 | + if (checktimeDate > new Date().getTime()) { | |
78 | 85 | this.setData({ |
79 | 86 | isLarge: true |
80 | 87 | }) |
81 | - }else { | |
88 | + } else { | |
82 | 89 | this.setData({ |
83 | 90 | isLarge: false |
84 | 91 | }) |
... | ... | @@ -89,21 +96,21 @@ Page({ |
89 | 96 | let recordVo = this.data.resData.eventDetails[date - 1].recordVo |
90 | 97 | //匹配数据 |
91 | 98 | if (recordVo != null) { |
92 | - console.log('复制',recordVo) | |
99 | + console.log('复制', recordVo) | |
93 | 100 | this.setData({ |
94 | 101 | recordVo: recordVo |
95 | 102 | }) |
96 | 103 | this.setData({ |
97 | 104 | recordVoShow: true |
98 | 105 | }) |
99 | - }else { | |
106 | + } else { | |
100 | 107 | this.setData({ |
101 | 108 | recordVoShow: false |
102 | 109 | }) |
103 | 110 | } |
104 | 111 | }, |
105 | - //获取信息 | |
106 | - getInfo(doday) { | |
112 | + //获取信息(第一次进来,模拟点击渲染) | |
113 | + getInfo(doday, isOne = 0, e) { | |
107 | 114 | request({ |
108 | 115 | url: `/wx/task/getSignRecord`, |
109 | 116 | method: 'get', |
... | ... | @@ -118,6 +125,9 @@ Page({ |
118 | 125 | resData: res.data |
119 | 126 | }) |
120 | 127 | this.getV2(res.data) |
128 | + if (isOne == 1) { | |
129 | + this.afterTapDate(e) | |
130 | + } | |
121 | 131 | } else { |
122 | 132 | wx.showToast({ |
123 | 133 | title: res.msg, |
... | ... | @@ -134,6 +144,23 @@ Page({ |
134 | 144 | }) |
135 | 145 | |
136 | 146 | }, |
147 | + //重置日历 | |
148 | + resetV2(year, month, date) { | |
149 | + console.log(year, month, date) | |
150 | + if (this.data.dayMoment == month) {} else { | |
151 | + let e = { | |
152 | + detail: { | |
153 | + date: date, | |
154 | + month: month, | |
155 | + year: year | |
156 | + } | |
157 | + } | |
158 | + this.setData({ | |
159 | + dayMoment: month | |
160 | + }) | |
161 | + this.getInfo(moment(year + '-' + month + '-' + date).format('YYYY-MM-DD'), 1, e) | |
162 | + } | |
163 | + }, | |
137 | 164 | //显示日历 |
138 | 165 | getV2(resData) { |
139 | 166 | this.setData({ |
... | ... | @@ -146,13 +173,14 @@ Page({ |
146 | 173 | dotColor: 'purple', // 待办点标记颜色 |
147 | 174 | circle: false, // 待办圆圈标记设置(如圆圈标记已签到日期),该设置与点标记设置互斥 |
148 | 175 | showLabelAlways: true, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效 |
149 | - dates: resData.eventDetails | |
176 | + dates: resData.eventDetails, | |
150 | 177 | }) |
178 | + this.data.calendar.enableArea([this.data.taskVo.startDate, moment(new Date().getTime()).format('YYYY-MM-DD')]) | |
151 | 179 | }, |
152 | 180 | //成果 |
153 | 181 | toAchieve(e) { |
154 | 182 | wx.navigateTo({ |
155 | - url: '../achievement/achievement?valueId='+this.data.valueId, | |
183 | + url: '../achievement/achievement?valueId=' + this.data.valueId, | |
156 | 184 | }) |
157 | 185 | }, |
158 | 186 | //唤起 打卡 |
... | ... | @@ -166,12 +194,12 @@ Page({ |
166 | 194 | let selectData = this.data.calendar.getSelectedDates() |
167 | 195 | let doday = selectData[0].year + '-' + selectData[0].month + '-' + selectData[0].date |
168 | 196 | console.log(doday) |
169 | - let repairDate= moment(doday).format('YYYY-MM-DD') | |
197 | + let repairDate = moment(doday).format('YYYY-MM-DD') | |
170 | 198 | this.setData({ |
171 | - 'form.isRepair':2 | |
199 | + 'form.isRepair': 2 | |
172 | 200 | }) |
173 | 201 | this.setData({ |
174 | - 'form.repairDate':repairDate | |
202 | + 'form.repairDate': repairDate | |
175 | 203 | }) |
176 | 204 | this.setData({ |
177 | 205 | clockShow: true |
... | ... | @@ -185,9 +213,9 @@ Page({ |
185 | 213 | this.setData({ |
186 | 214 | 'form.userId': wx.getStorageSync('userInfo_id') |
187 | 215 | }) |
188 | - if(this.data.taskVo.submitCondition=='图片') { | |
189 | - if(this.data.form.taskFileUrl.length == 0) { | |
190 | - return wx.showToast({ | |
216 | + if (this.data.taskVo.submitCondition == '图片') { | |
217 | + if (this.data.form.taskFileUrl.length == 0) { | |
218 | + return wx.showToast({ | |
191 | 219 | title: '请上传图片', |
192 | 220 | icon: 'none' |
193 | 221 | }) |
... | ... | @@ -203,11 +231,18 @@ Page({ |
203 | 231 | title: '打卡成功', |
204 | 232 | icon: 'none' |
205 | 233 | }) |
234 | + let e = { | |
235 | + detail: { | |
236 | + date: moment(this.data.form.repairDate).format('DD'), | |
237 | + month: moment(this.data.form.repairDate).format('MM'), | |
238 | + year: moment(this.data.form.repairDate).format('YYYY') | |
239 | + } | |
240 | + } | |
241 | + this.getInfo(moment(this.data.form.repairDate).format('YYYY-MM-DD'), 1, e) | |
206 | 242 | this.closeClockShow() |
207 | - this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD')) | |
208 | 243 | } else { |
209 | 244 | wx.showToast({ |
210 | - title: res.msg, | |
245 | + title: res.msg + res.data, | |
211 | 246 | icon: 'none' |
212 | 247 | }) |
213 | 248 | } |
... | ... | @@ -226,7 +261,14 @@ Page({ |
226 | 261 | */ |
227 | 262 | onReady() { |
228 | 263 | this.initialize() |
229 | - this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD')) | |
264 | + let e = { | |
265 | + detail: { | |
266 | + date: moment().date(), | |
267 | + month: moment().month() + 1, | |
268 | + year: moment().year() | |
269 | + } | |
270 | + } | |
271 | + this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'), 1, e) | |
230 | 272 | }, |
231 | 273 | // 统一返回 |
232 | 274 | handleBack() { |
... | ... | @@ -299,7 +341,7 @@ Page({ |
299 | 341 | this.setData({ |
300 | 342 | clockShow: false |
301 | 343 | }) |
302 | - let form = { | |
344 | + let form = { | |
303 | 345 | id: '', //任务ID |
304 | 346 | isRepair: 1, //是否补卡1立即打卡2补卡 |
305 | 347 | repairDate: '', //补卡日期,当isRepair=2时必传,格式:YYYY-MM-dd | ... | ... |
pages/index/punchDetail/punchDetail.wxml
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | <view class="btn_box"> |
20 | 20 | <van-button round color="#F4F4F4" bindtap='toAchieve' custom-style="color: #000;">我 的 成 果</van-button> |
21 | 21 | <van-button round type="info" bindtap='toClock' wx:if="{{isToday}}">立 即 打 卡</van-button> |
22 | - <van-button round type="warning" bindtap='toRepairClock' wx:if="{{taskVo.allowRepairCard == 1&&repairText=='未打卡'&&!isToday&&!isLarge}}">补 卡</van-button> | |
22 | + <van-button round type="warning" bindtap='toRepairClock' wx:if="{{taskVo.allowRepairCard == 1&&repairText=='缺卡'&&!isToday&&!isLarge}}">补 卡</van-button> | |
23 | 23 | </view> |
24 | 24 | |
25 | 25 | <!--打卡--> |
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | <view class="pop_fz">{{taskVo.statisticsUnit}}</view> |
37 | 37 | </view> |
38 | 38 | </view> |
39 | - <van-field value="{{ form.taskDesc }}" label="" type="textarea" placeholder="填写内容(如:已完成)" autosize border="{{ false }}" bind:change="onTaskDescChange"/> | |
39 | + <van-field value="{{ form.taskDesc }}" label="" type="textarea" placeholder="填写内容(如:已完成)" border="{{ false }}" bind:change="onTaskDescChange"/> | |
40 | 40 | <view class="pop_tip"> |
41 | 41 | <van-uploader accept='image' file-list="{{ fileList }}" deletable="{{ true }}" bind:after-read="afterRead" bind:delete="delFile"> |
42 | 42 | <view class="tip_item"> | ... | ... |
pages/mine/record/record.json
... | ... | @@ -3,7 +3,8 @@ |
3 | 3 | "van-icon": "@vant/weapp/icon/index", |
4 | 4 | "van-tab": "@vant/weapp/tab/index", |
5 | 5 | "van-tabs": "@vant/weapp/tabs/index", |
6 | - "van-popup": "@vant/weapp/popup/index" | |
6 | + "van-popup": "@vant/weapp/popup/index", | |
7 | + "van-progress": "@vant/weapp/progress/index" | |
7 | 8 | }, |
8 | 9 | "navigationBarTitleText":"打卡记录" |
9 | 10 | } |
10 | 11 | \ No newline at end of file | ... | ... |
pages/mine/record/record.wxml
... | ... | @@ -19,11 +19,11 @@ |
19 | 19 | </view> |
20 | 20 | </view> |
21 | 21 | <view class="day_font" >{{value.taskDesc}}</view> |
22 | - <!-- <view class="day_font2">已坚持打卡 | |
23 | - <text class="day_font2_large">1/50 </text>天 | |
24 | - </view> --> | |
22 | + <view class="day_font2">打卡已进行 | |
23 | + <text class="day_font2_large">{{value.signDayNum}} </text>天 | |
24 | + </view> | |
25 | 25 | <view> |
26 | - <van-progress percentage="50" color='#3F5EFF' stroke-width="13" pivot-text=' ' /> | |
26 | + <van-progress percentage="{{ value.signDayNum/value.taskCycle *100}}" color='#3F5EFF' stroke-width="13" pivot-text=' ' /> | |
27 | 27 | </view> |
28 | 28 | <view class="flex_font"> |
29 | 29 | <text class="grey_flex">打卡频次:</text> | ... | ... |