Commit 16297019d087ad18d1c921a480bd8acc9e7f39cc

Authored by
1 parent 44101ab3
Exists in master

修复问题

@@ -45,7 +45,7 @@ App({ @@ -45,7 +45,7 @@ App({
45 //你的分享配置 45 //你的分享配置
46 return { 46 return {
47 title: name + '推荐您 一起开始自主学习之旅', 47 title: name + '推荐您 一起开始自主学习之旅',
48 - path: '/pages/index/index', 48 + path: '/pages/login/loginNew/loginNew',
49 // imageUrl: 'https://proxy.shunzhi.net:51315/mp_share2.jpg', 49 // imageUrl: 'https://proxy.shunzhi.net:51315/mp_share2.jpg',
50 imageUrl: 'https://szyundisk.oss-cn-hangzhou.aliyuncs.com/AdmissionsManageSys/37317060-9e67-41e1-9731-b722c83cff8a.jpg', 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,6 +21,10 @@ Page({
21 hideHeader: true, // 隐藏日历头部操作栏 21 hideHeader: true, // 隐藏日历头部操作栏
22 autoChoosedWhenJump: true, // 设置默认日期及跳转到指定日期后是否需要自动选中 22 autoChoosedWhenJump: true, // 设置默认日期及跳转到指定日期后是否需要自动选中
23 defaultDate: moment(new Date().getTime()).format('YYYY-MM-DD'), // 默认选中指定某天,如需选中需配置 autoChoosedWhenJump: true 23 defaultDate: moment(new Date().getTime()).format('YYYY-MM-DD'), // 默认选中指定某天,如需选中需配置 autoChoosedWhenJump: true
  24 + disableMode: { // 禁用某一天之前/之后的所有日期
  25 + type: 'after', // [‘before’, 'after']
  26 + // 无该属性或该属性值为假,则默认为当天
  27 + },
24 }, 28 },
25 isDisplay: false, 29 isDisplay: false,
26 calendar: {}, //日历 30 calendar: {}, //日历
@@ -57,6 +61,7 @@ Page({ @@ -57,6 +61,7 @@ Page({
57 let date = e.detail.date 61 let date = e.detail.date
58 // let month = e.detail.month 62 // let month = e.detail.month
59 // let year = e.detail.year 63 // let year = e.detail.year
  64 + this.resetV2(e.detail.year,e.detail.month,date )
60 let recordVo = this.data.resData.eventDetails[date - 1].recordVo 65 let recordVo = this.data.resData.eventDetails[date - 1].recordVo
61 if (recordVo != null) { 66 if (recordVo != null) {
62 console.log('复制', recordVo) 67 console.log('复制', recordVo)
@@ -72,8 +77,8 @@ Page({ @@ -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 request({ 82 request({
78 url: `/wx/task/getSignRecord`, 83 url: `/wx/task/getSignRecord`,
79 method: 'get', 84 method: 'get',
@@ -89,13 +94,6 @@ Page({ @@ -89,13 +94,6 @@ Page({
89 }) 94 })
90 this.getV2(res.data) 95 this.getV2(res.data)
91 if (isOne == 1) { 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 this.afterTapDate(e) 97 this.afterTapDate(e)
100 } 98 }
101 } else { 99 } else {
@@ -113,6 +111,24 @@ Page({ @@ -113,6 +111,24 @@ Page({
113 'calendar': this.selectComponent('#calendar').calendar 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 getV2(resData) { 133 getV2(resData) {
118 this.setData({ 134 this.setData({
@@ -127,6 +143,7 @@ Page({ @@ -127,6 +143,7 @@ Page({
127 showLabelAlways: true, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效 143 showLabelAlways: true, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效
128 dates: resData.eventDetails 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,6 +162,13 @@ Page({
145 */ 162 */
146 onReady() { 163 onReady() {
147 this.initialize() 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 \ No newline at end of file 175 \ No newline at end of file
pages/index/index.wxml
@@ -24,11 +24,11 @@ @@ -24,11 +24,11 @@
24 </view> 24 </view>
25 </view> 25 </view>
26 <view class="day_font">{{value.taskDesc}}</view> 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 <view> 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 </view> 32 </view>
33 <view class="flex_font"> 33 <view class="flex_font">
34 <text class="grey_flex">打卡频次:</text> 34 <text class="grey_flex">打卡频次:</text>
pages/index/punchDetail/punchDetail.js
@@ -3,11 +3,13 @@ @@ -3,11 +3,13 @@
3 import plugin from '../../../component/v2/plugins/index' 3 import plugin from '../../../component/v2/plugins/index'
4 import week from '../../../component/v2/plugins/week' 4 import week from '../../../component/v2/plugins/week'
5 import todo from '../../../component/v2/plugins/todo' 5 import todo from '../../../component/v2/plugins/todo'
  6 +import selectable from '../../../component/v2/plugins/selectable'
6 import request from '../../../api/request.js' 7 import request from '../../../api/request.js'
7 import moment from 'moment'; 8 import moment from 'moment';
8 plugin 9 plugin
9 .use(week) 10 .use(week)
10 .use(todo) 11 .use(todo)
  12 + .use(selectable)
11 Page({ 13 Page({
12 14
13 /** 15 /**
@@ -19,6 +21,10 @@ Page({ @@ -19,6 +21,10 @@ Page({
19 weekMode: true, // 周视图模式 21 weekMode: true, // 周视图模式
20 highlightToday: true, // 是否高亮显示当天 22 highlightToday: true, // 是否高亮显示当天
21 hideHeader: true, // 隐藏日历头部操作栏 23 hideHeader: true, // 隐藏日历头部操作栏
  24 + disableMode: { // 禁用某一天之前/之后的所有日期
  25 + type: 'after', // [‘before’, 'after']
  26 + // 无该属性或该属性值为假,则默认为当天
  27 + },
22 }, 28 },
23 isDisplay: false, 29 isDisplay: false,
24 clockShow: false, 30 clockShow: false,
@@ -57,28 +63,29 @@ Page({ @@ -57,28 +63,29 @@ Page({
57 taskStatisticsParam: "" 63 taskStatisticsParam: ""
58 }, //成果数据当天 64 }, //成果数据当天
59 recordVoShow: false, 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 afterTapDate(e) { 74 afterTapDate(e) {
68 let date = e.detail.date 75 let date = e.detail.date
  76 + this.resetV2(e.detail.year, e.detail.month, date)
69 this.setData({ 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 this.setData({ 85 this.setData({
79 isLarge: true 86 isLarge: true
80 }) 87 })
81 - }else { 88 + } else {
82 this.setData({ 89 this.setData({
83 isLarge: false 90 isLarge: false
84 }) 91 })
@@ -89,21 +96,21 @@ Page({ @@ -89,21 +96,21 @@ Page({
89 let recordVo = this.data.resData.eventDetails[date - 1].recordVo 96 let recordVo = this.data.resData.eventDetails[date - 1].recordVo
90 //匹配数据 97 //匹配数据
91 if (recordVo != null) { 98 if (recordVo != null) {
92 - console.log('复制',recordVo) 99 + console.log('复制', recordVo)
93 this.setData({ 100 this.setData({
94 recordVo: recordVo 101 recordVo: recordVo
95 }) 102 })
96 this.setData({ 103 this.setData({
97 recordVoShow: true 104 recordVoShow: true
98 }) 105 })
99 - }else { 106 + } else {
100 this.setData({ 107 this.setData({
101 recordVoShow: false 108 recordVoShow: false
102 }) 109 })
103 } 110 }
104 }, 111 },
105 - //获取信息  
106 - getInfo(doday) { 112 + //获取信息(第一次进来,模拟点击渲染)
  113 + getInfo(doday, isOne = 0, e) {
107 request({ 114 request({
108 url: `/wx/task/getSignRecord`, 115 url: `/wx/task/getSignRecord`,
109 method: 'get', 116 method: 'get',
@@ -118,6 +125,9 @@ Page({ @@ -118,6 +125,9 @@ Page({
118 resData: res.data 125 resData: res.data
119 }) 126 })
120 this.getV2(res.data) 127 this.getV2(res.data)
  128 + if (isOne == 1) {
  129 + this.afterTapDate(e)
  130 + }
121 } else { 131 } else {
122 wx.showToast({ 132 wx.showToast({
123 title: res.msg, 133 title: res.msg,
@@ -134,6 +144,23 @@ Page({ @@ -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 getV2(resData) { 165 getV2(resData) {
139 this.setData({ 166 this.setData({
@@ -146,13 +173,14 @@ Page({ @@ -146,13 +173,14 @@ Page({
146 dotColor: 'purple', // 待办点标记颜色 173 dotColor: 'purple', // 待办点标记颜色
147 circle: false, // 待办圆圈标记设置(如圆圈标记已签到日期),该设置与点标记设置互斥 174 circle: false, // 待办圆圈标记设置(如圆圈标记已签到日期),该设置与点标记设置互斥
148 showLabelAlways: true, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效 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 toAchieve(e) { 181 toAchieve(e) {
154 wx.navigateTo({ 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,12 +194,12 @@ Page({
166 let selectData = this.data.calendar.getSelectedDates() 194 let selectData = this.data.calendar.getSelectedDates()
167 let doday = selectData[0].year + '-' + selectData[0].month + '-' + selectData[0].date 195 let doday = selectData[0].year + '-' + selectData[0].month + '-' + selectData[0].date
168 console.log(doday) 196 console.log(doday)
169 - let repairDate= moment(doday).format('YYYY-MM-DD') 197 + let repairDate = moment(doday).format('YYYY-MM-DD')
170 this.setData({ 198 this.setData({
171 - 'form.isRepair':2 199 + 'form.isRepair': 2
172 }) 200 })
173 this.setData({ 201 this.setData({
174 - 'form.repairDate':repairDate 202 + 'form.repairDate': repairDate
175 }) 203 })
176 this.setData({ 204 this.setData({
177 clockShow: true 205 clockShow: true
@@ -185,9 +213,9 @@ Page({ @@ -185,9 +213,9 @@ Page({
185 this.setData({ 213 this.setData({
186 'form.userId': wx.getStorageSync('userInfo_id') 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 title: '请上传图片', 219 title: '请上传图片',
192 icon: 'none' 220 icon: 'none'
193 }) 221 })
@@ -203,11 +231,18 @@ Page({ @@ -203,11 +231,18 @@ Page({
203 title: '打卡成功', 231 title: '打卡成功',
204 icon: 'none' 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 this.closeClockShow() 242 this.closeClockShow()
207 - this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'))  
208 } else { 243 } else {
209 wx.showToast({ 244 wx.showToast({
210 - title: res.msg, 245 + title: res.msg + res.data,
211 icon: 'none' 246 icon: 'none'
212 }) 247 })
213 } 248 }
@@ -226,7 +261,14 @@ Page({ @@ -226,7 +261,14 @@ Page({
226 */ 261 */
227 onReady() { 262 onReady() {
228 this.initialize() 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 handleBack() { 274 handleBack() {
@@ -299,7 +341,7 @@ Page({ @@ -299,7 +341,7 @@ Page({
299 this.setData({ 341 this.setData({
300 clockShow: false 342 clockShow: false
301 }) 343 })
302 - let form = { 344 + let form = {
303 id: '', //任务ID 345 id: '', //任务ID
304 isRepair: 1, //是否补卡1立即打卡2补卡 346 isRepair: 1, //是否补卡1立即打卡2补卡
305 repairDate: '', //补卡日期,当isRepair=2时必传,格式:YYYY-MM-dd 347 repairDate: '', //补卡日期,当isRepair=2时必传,格式:YYYY-MM-dd
pages/index/punchDetail/punchDetail.wxml
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <view class="btn_box"> 19 <view class="btn_box">
20 <van-button round color="#F4F4F4" bindtap='toAchieve' custom-style="color: #000;">我 的 成 果</van-button> 20 <van-button round color="#F4F4F4" bindtap='toAchieve' custom-style="color: #000;">我 的 成 果</van-button>
21 <van-button round type="info" bindtap='toClock' wx:if="{{isToday}}">立 即 打 卡</van-button> 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 </view> 23 </view>
24 24
25 <!--打卡--> 25 <!--打卡-->
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <view class="pop_fz">{{taskVo.statisticsUnit}}</view> 36 <view class="pop_fz">{{taskVo.statisticsUnit}}</view>
37 </view> 37 </view>
38 </view> 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 <view class="pop_tip"> 40 <view class="pop_tip">
41 <van-uploader accept='image' file-list="{{ fileList }}" deletable="{{ true }}" bind:after-read="afterRead" bind:delete="delFile"> 41 <van-uploader accept='image' file-list="{{ fileList }}" deletable="{{ true }}" bind:after-read="afterRead" bind:delete="delFile">
42 <view class="tip_item"> 42 <view class="tip_item">
pages/mine/record/record.json
@@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
3 "van-icon": "@vant/weapp/icon/index", 3 "van-icon": "@vant/weapp/icon/index",
4 "van-tab": "@vant/weapp/tab/index", 4 "van-tab": "@vant/weapp/tab/index",
5 "van-tabs": "@vant/weapp/tabs/index", 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 "navigationBarTitleText":"打卡记录" 9 "navigationBarTitleText":"打卡记录"
9 } 10 }
10 \ No newline at end of file 11 \ No newline at end of file
pages/mine/record/record.wxml
@@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
19 </view> 19 </view>
20 </view> 20 </view>
21 <view class="day_font" >{{value.taskDesc}}</view> 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 <view> 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 </view> 27 </view>
28 <view class="flex_font"> 28 <view class="flex_font">
29 <text class="grey_flex">打卡频次:</text> 29 <text class="grey_flex">打卡频次:</text>