Commit 44101ab37fc4411805ef22c91e2f634674363b6a

Authored by
1 parent d3566844
Exists in master

修改调整

app.js
... ... @@ -44,9 +44,10 @@ App({
44 44 view.onShareAppMessage = function () {
45 45 //你的分享配置
46 46 return {
47   - title: name + '推荐大家都在用的升学大数据宝典',
  47 + title: name + '推荐您 一起开始自主学习之旅',
48 48 path: '/pages/index/index',
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 51 };
51 52 }
52 53 }
... ...
pages/index/achievement/achievement.js
... ... @@ -28,6 +28,8 @@ Page({
28 28 taskVo: {
29 29 allowRepairCard: 0,
30 30 hasData: 0,
  31 + statisticsUnit: "",
  32 + submitCondition: "",
31 33 id: 0,
32 34 releaseTime: "",
33 35 signTotal: 0,
... ... @@ -46,7 +48,7 @@ Page({
46 48 taskStatisticsParam: ""
47 49 }, //成果数据当天
48 50 recordVoShow: false,
49   - dayMoment: 0 , //数据月份
  51 + dayMoment: 0, //数据月份
50 52 },
51 53 /**
52 54 * 选择日期后执行的事件
... ... @@ -57,21 +59,21 @@ Page({
57 59 // let year = e.detail.year
58 60 let recordVo = this.data.resData.eventDetails[date - 1].recordVo
59 61 if (recordVo != null) {
60   - console.log('复制',recordVo)
  62 + console.log('复制', recordVo)
61 63 this.setData({
62 64 recordVo: recordVo
63 65 })
64 66 this.setData({
65 67 recordVoShow: true
66 68 })
67   - }else {
  69 + } else {
68 70 this.setData({
69 71 recordVoShow: false
70 72 })
71 73 }
72 74 },
73 75 //获取信息
74   - getInfo(doday,isOne=0) {
  76 + getInfo(doday, isOne = 0) {
75 77 request({
76 78 url: `/wx/task/getSignRecord`,
77 79 method: 'get',
... ... @@ -86,7 +88,7 @@ Page({
86 88 resData: res.data
87 89 })
88 90 this.getV2(res.data)
89   - if(isOne ==1) {
  91 + if (isOne == 1) {
90 92 let e = {
91 93 detail: {
92 94 date: moment().date(),
... ... @@ -143,6 +145,6 @@ Page({
143 145 */
144 146 onReady() {
145 147 this.initialize()
146   - this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'),1)
  148 + this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'), 1)
147 149 },
148 150 })
149 151 \ No newline at end of file
... ...
pages/index/achievement/achievement.wxml
... ... @@ -8,7 +8,7 @@
8 8 <view class="card_flex">
9 9 <view class="flex_grey">已进行 {{taskVo.signTotal +' / ' +taskVo.taskCycle}} 天</view>
10 10 <view class="flex_grey">打卡频次 : {{taskVo.taskFrequency}}</view>
11   - <view class="flex_grey">{{taskVo.hasData == 1 ?'允许补卡': '不允许补卡'}}</view>
  11 + <view class="flex_grey">{{taskVo.allowRepairCard == 1 ?'允许补卡': '不允许补卡'}}</view>
12 12 </view>
13 13 <view class="card_context">{{taskVo.taskDesc}}</view>
14 14 <view class="grey_font">
... ... @@ -20,7 +20,7 @@
20 20 <view class="grey_line"></view>
21 21 <view class="box" wx:if="{{recordVoShow}}">
22 22 <view class="box_title">打卡成果</view>
23   - <view class="box_blue">本次打卡坚持了<span>{{recordVo.taskStatisticsParam}}分钟</span></view>
  23 + <view class="box_blue" wx:if="{{recordVo.hasData==1}}">本次打卡坚持了<span>{{recordVo.taskStatisticsParam}}{{taskVo.statisticsUnit}}</span></view>
24 24 <view class="box_grey">"{{recordVo.taskRecordDesc}}"</view>
25 25 <view class="box_pic">
26 26 <view class="box_img" wx:for="{{recordVo.files}}" wx:key="index" wx:for-item="value">
... ...
pages/index/index.js
... ... @@ -56,8 +56,9 @@ Page({
56 56 },
57 57 // 去打卡
58 58 handleDetail(e){
  59 + let eData = e.currentTarget.dataset
59 60 wx.navigateTo({
60   - url: '/pages/index/punchDetail/punchDetail?valueId='+e.currentTarget.dataset.valueid ,
  61 + url: '/pages/index/punchDetail/punchDetail?valueId='+eData.valueid ,
61 62 })
62 63 },
63 64 /**
... ...
pages/index/index.wxml
... ... @@ -36,7 +36,7 @@
36 36 </view>
37 37 <view class="flex_font" wx:if="{{value.submitCondition != null}}">
38 38 <text class="grey_flex">打卡要求:</text>
39   - {{'需要' + value.submitCondition}}
  39 + {{ value.submitCondition == '无限制' ? '无限制': '需要 '+value.submitCondition}}
40 40 </view>
41 41 <view class="flex_font">
42 42 <view class="grey_flex">其他:</view>
... ...
pages/index/newPunch/newPunch.js
... ... @@ -11,8 +11,8 @@ Page({
11 11 form: {
12 12 taskTitle: '', //任务标题
13 13 taskDesc: '', //任务描述内容
14   - allowRepairCard: false, //是否允许补卡 1是 2否
15   - hasData: false, //是否需要提交数据 1是 2否
  14 + allowRepairCard: 2, //是否允许补卡 1是 2否
  15 + hasData: 2, //是否需要提交数据 1是 2否
16 16 // id: '', // 任务ID
17 17 lackNum: '', // 缺卡次数
18 18 remindTime: '', // 打卡提醒时间点
... ... @@ -45,7 +45,13 @@ Page({
45 45 },
46 46 //打卡周期
47 47 clockCycleShow: false,
48   - columnsClockCycle: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
  48 + columnsClockCycle: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10','11', '12', '13', '14', '15', '16', '17', '18', '19', '20','21', '22', '23', '24', '25', '26', '27', '28', '29', '30','31',
  49 + '32', '33', '34', '35', '36', '37', '38', '39', '40','41',
  50 + '42', '43', '44', '45', '46', '47', '48', '49', '40','51',
  51 + '52', '53', '54', '55', '56', '57', '58', '59', '60','61',
  52 + '62', '63', '64', '65', '66', '67', '68', '69', '70','71',
  53 + '72', '73', '74', '75', '76', '77', '78', '79', '80','81',
  54 + '82', '83', '84', '85', '86', '87', '88', '89', '90'],
49 55 //打卡频次
50 56 clockRateShow: false,
51 57 columnsClockRate: ['每天', '7天', '一个月'],
... ... @@ -53,7 +59,7 @@ Page({
53 59 clockRemindShow: false,
54 60 columnsClockRemind: [
55 61 {
56   - values: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
  62 + values: ['每天','周一', '周二', '周三', '周四', '周五', '周六', '周日'],
57 63 defaultIndex: 2,
58 64 },
59 65 // 第二列
... ... @@ -205,6 +211,9 @@ Page({
205 211 //创建
206 212 createTask() {
207 213 console.log(this.data.form)
  214 + if(this.data.form.hasData == 1 && !this.data.form.statisticsUnit) {
  215 + return wx.showToast({title: '请选择统计单位',icon: 'none',})
  216 + }
208 217 request({
209 218 url: `/wx/task/addCardTask`,
210 219 method: 'post',
... ...
pages/index/newPunch/newPunch.wxml
... ... @@ -36,7 +36,7 @@
36 36 <van-cell title="统计单位" value="{{ form.statisticsUnit }}" is-link label="请选择统计单位" border="{{ false }}" bindtap="openUnitShow" />
37 37 </van-cell-group>
38 38 </view>
39   - <view class="white_card" wx:if="{{form.hasData == 1}}">
  39 + <view class="white_card">
40 40 <view>允许补卡</view>
41 41 <view>
42 42 <van-switch checked="{{ form.allowRepairCard }}" size='20' bind:change="onChange" active-value='1' inactive-value='2' />
... ...
pages/index/punchDetail/punchDetail.js
... ... @@ -37,6 +37,8 @@ Page({
37 37 taskVo: {
38 38 allowRepairCard: 0,
39 39 hasData: 0,
  40 + statisticsUnit: "",
  41 + submitCondition: "",
40 42 id: 0,
41 43 releaseTime: "",
42 44 signTotal: 0,
... ... @@ -56,17 +58,36 @@ Page({
56 58 }, //成果数据当天
57 59 recordVoShow: false,
58 60 isToday:true,//是否是今天
  61 + isLarge:false, //是否大于今天
  62 + repairText: ''
59 63 },
60 64 /**
61 65 * 选择日期后执行的事件
62 66 */
63 67 afterTapDate(e) {
64 68 let date = e.detail.date
65   - let isToday = e.detail.isToday
66 69 this.setData({
67   - isToday
  70 + isToday:e.detail.isToday
  71 + })
  72 + //选择的年月日
  73 + let checkDay = e.detail.year +'-' + e.detail.month +'-' + e.detail.date
  74 + let checktimeDate= new Date(moment(checkDay).format('YYYY-MM-DD')).getTime()
  75 + //选择的日期是否大于今天
  76 + if(checktimeDate > new Date().getTime()) {
  77 + console.log('ff')
  78 + this.setData({
  79 + isLarge: true
  80 + })
  81 + }else {
  82 + this.setData({
  83 + isLarge: false
  84 + })
  85 + }
  86 + this.setData({
  87 + repairText: e.detail.todoText
68 88 })
69 89 let recordVo = this.data.resData.eventDetails[date - 1].recordVo
  90 + //匹配数据
70 91 if (recordVo != null) {
71 92 console.log('复制',recordVo)
72 93 this.setData({
... ... @@ -136,10 +157,22 @@ Page({
136 157 },
137 158 //唤起 打卡
138 159 toClock() {
  160 + this.setData({
  161 + clockShow: true
  162 + })
  163 + },
  164 + //唤起补卡
  165 + toRepairClock() {
139 166 let selectData = this.data.calendar.getSelectedDates()
140 167 let doday = selectData[0].year + '-' + selectData[0].month + '-' + selectData[0].date
141 168 console.log(doday)
142   -
  169 + let repairDate= moment(doday).format('YYYY-MM-DD')
  170 + this.setData({
  171 + 'form.isRepair':2
  172 + })
  173 + this.setData({
  174 + 'form.repairDate':repairDate
  175 + })
143 176 this.setData({
144 177 clockShow: true
145 178 })
... ... @@ -152,7 +185,14 @@ Page({
152 185 this.setData({
153 186 'form.userId': wx.getStorageSync('userInfo_id')
154 187 })
155   - console.log(this.data.form)
  188 + if(this.data.taskVo.submitCondition=='图片') {
  189 + if(this.data.form.taskFileUrl.length == 0) {
  190 + return wx.showToast({
  191 + title: '请上传图片',
  192 + icon: 'none'
  193 + })
  194 + }
  195 + }
156 196 request({
157 197 url: `/wx/task/commitCardTask`,
158 198 method: 'post',
... ... @@ -164,6 +204,7 @@ Page({
164 204 icon: 'none'
165 205 })
166 206 this.closeClockShow()
  207 + this.getInfo(moment(new Date().getTime()).format('YYYY-MM-DD'))
167 208 } else {
168 209 wx.showToast({
169 210 title: res.msg,
... ... @@ -255,6 +296,9 @@ Page({
255 296 },
256 297 //关闭
257 298 closeClockShow() {
  299 + this.setData({
  300 + clockShow: false
  301 + })
258 302 let form = {
259 303 id: '', //任务ID
260 304 isRepair: 1, //是否补卡1立即打卡2补卡
... ... @@ -267,8 +311,5 @@ Page({
267 311 this.setData({
268 312 form: form
269 313 })
270   - this.setData({
271   - clockShow: false
272   - })
273 314 }
274 315 })
275 316 \ No newline at end of file
... ...
pages/index/punchDetail/punchDetail.wxml
... ... @@ -8,7 +8,7 @@
8 8 <view class="card_flex">
9 9 <view class="flex_grey">已进行 {{taskVo.signTotal +' / ' +taskVo.taskCycle}} 天</view>
10 10 <view class="flex_grey">打卡频次 : {{taskVo.taskFrequency}}</view>
11   - <view class="flex_grey">{{taskVo.hasData == 1 ?'允许补卡': '不允许补卡'}}</view>
  11 + <view class="flex_grey">{{taskVo.allowRepairCard == 1 ?'允许补卡': '不允许补卡'}}</view>
12 12 </view>
13 13 <view class="card_context">{{taskVo.taskDesc}}</view>
14 14 <view class="grey_font">
... ... @@ -17,14 +17,15 @@
17 17 </view>
18 18 </view>
19 19 <view class="btn_box">
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>
  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>
  22 + <van-button round type="warning" bindtap='toRepairClock' wx:if="{{taskVo.allowRepairCard == 1&&repairText=='未打卡'&&!isToday&&!isLarge}}">补 卡</van-button>
22 23 </view>
23 24  
24 25 <!--打卡-->
25 26 <van-popup show="{{ clockShow }}" position="bottom" custom-style="height: 60%;" round bind:close="closeClockShow">
26   - <view class="pop_title">提交打卡成果</view>
27   - <view class="pop_flex">
  27 + <view class="pop_title">{{form.isRepair == 2? '补交打卡成果' : '提交打卡成果'}}</view>
  28 + <view class="pop_flex" wx:if="{{taskVo.hasData==1}}">
28 29 <view>提交数据</view>
29 30 <view class="pop_cell">
30 31 <view>
... ... @@ -32,10 +33,10 @@
32 33 <van-field value="{{ form.statisticsUnit }}" placeholder="请输入" border="{{ false }}" bind:change="onStatisChange" />
33 34 </van-cell-group>
34 35 </view>
35   - <view class="pop_fz">分钟</view>
  36 + <view class="pop_fz">{{taskVo.statisticsUnit}}</view>
36 37 </view>
37 38 </view>
38   - <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="填写内容(如:已完成)" autosize border="{{ false }}" bind:change="onTaskDescChange"/>
39 40 <view class="pop_tip">
40 41 <van-uploader accept='image' file-list="{{ fileList }}" deletable="{{ true }}" bind:after-read="afterRead" bind:delete="delFile">
41 42 <view class="tip_item">
... ... @@ -45,7 +46,7 @@
45 46 <!-- <image class="pop_pic" src="/img/answer/tp1.png" alt="" /> -->
46 47 </view>
47 48 <view class="pop_btn">
48   - <van-button type="info" block round bindtap="toCardTask">提 交</van-button>
  49 + <van-button type="{{form.isRepair == 2? 'warning':'info'}}" block round bindtap="toCardTask">提 交</van-button>
49 50 </view>
50 51 </van-popup>
51 52 </view>
52 53 \ No newline at end of file
... ...
pages/index/rank/rank.js
... ... @@ -83,6 +83,13 @@ Page({
83 83 * 生命周期函数--监听页面加载
84 84 */
85 85 onLoad(options) {
  86 +
  87 + },
  88 + // 统一返回
  89 + handleBack() {
  90 + wx.navigateBack()
  91 + },
  92 + onShow() {
86 93 this.setData({
87 94 'user': wx.getStorageSync('userInfo')
88 95 })
... ... @@ -91,9 +98,5 @@ Page({
91 98 })
92 99 this.getSelf()
93 100 this.getRankList()
94   - },
95   - // 统一返回
96   - handleBack() {
97   - wx.navigateBack()
98   - },
  101 + }
99 102 })
100 103 \ No newline at end of file
... ...
pages/index/rank/rank.wxss
... ... @@ -16,7 +16,7 @@
16 16 }
17 17 .white_box{
18 18 width: 90vw;
19   - min-height: 70vh;
  19 + min-height: 72vh;
20 20 margin-top: 40px;
21 21 background-color: #fff;
22 22 border-radius: 4vw;
... ...
pages/login/loginNew/loginNew.js
... ... @@ -78,9 +78,15 @@ Page({
78 78 }, () => {
79 79 wx.setStorageSync('userInfo', res.data)
80 80 wx.setStorageSync('userInfo_id', res.data.id)
81   - wx.switchTab({
82   - url: '/pages/mine/index',
83   - })
  81 + if(res.data.hasRecord == 1) {
  82 + wx.switchTab({
  83 + url: '/pages/index/rank/rank',
  84 + })
  85 + }else {
  86 + wx.switchTab({
  87 + url: '/pages/mine/index',
  88 + })
  89 + }
84 90 })
85 91 } else {
86 92 wx.showToast({
... ...
pages/login/loginNew/loginNew.wxml
... ... @@ -13,7 +13,9 @@
13 13 </view>
14 14 <view class="small_font">
15 15 <van-checkbox value="{{ checked }}" shape="square" bind:change="onChange" icon-size='15'>
16   - 已同意<text class="blue_font"> 用户协议 </text>和<text class="blue_font"> 隐私协议 </text>
  16 + <view class="small_font_tip">
  17 + 已同意 <navigator url="../protocol/protocol"><text class="blue_font"> 用户协议 </text></navigator>和<navigator url="../policy/policy"><text class="blue_font"> 隐私协议 </text></navigator>
  18 + </view>
17 19 </van-checkbox>
18 20 </view>
19 21 <van-notify id="van-notify" />
... ...
pages/login/loginNew/loginNew.wxss
... ... @@ -37,6 +37,9 @@
37 37 font-size: 12px;
38 38 margin: 10px 0 0;
39 39 }
  40 +.small_font_tip {
  41 + display: flex;
  42 +}
40 43 .blue_font {
41 44 color: #3578F9;
42 45 text-decoration:underline;
... ...
pages/login/policy/policy.json
1 1 {
2   - "usingComponents": {}
  2 + "usingComponents": {},
  3 + "navigationBarTitleText": "隐私协议"
3 4 }
4 5 \ No newline at end of file
... ...
pages/login/protocol/protocol.json
1 1 {
2   - "usingComponents": {}
  2 + "usingComponents": {},
  3 + "navigationBarTitleText": "用户协议"
3 4 }
4 5 \ No newline at end of file
... ...
pages/mine/record/record.js
... ... @@ -23,7 +23,7 @@ Page({
23 23 url: `/wx/task/cardTaskList`,
24 24 method: 'post',
25 25 data: {
26   - "oneselfFlag": this.data.tabindex + 1 ,
  26 + "oneselfFlag": this.data.tabindex + 1,
27 27 "page": 1,
28 28 "pageSize": 999,
29 29 "userId": wx.getStorageSync("userInfo_id")
... ... @@ -80,7 +80,7 @@ Page({
80 80 //选择模板
81 81 toPunch(e) {
82 82 let obj = e.currentTarget.dataset
83   - let id = obj.value ? obj.value.id :0
  83 + let id = obj.value ? obj.value.id : 0
84 84 wx.navigateTo({
85 85 url: `../../index/newPunch/newPunch?tempId=${id}`
86 86 })
... ... @@ -101,13 +101,14 @@ Page({
101 101 // 打卡成果
102 102 handleAchievement(e) {
103 103 wx.navigateTo({
104   - url: '/pages/index/achievement/achievement?valueId='+e.currentTarget.dataset.valueid ,
  104 + url: '/pages/index/achievement/achievement?valueId=' + e.currentTarget.dataset.valueid,
105 105 })
106 106 },
107 107 // 去打卡
108 108 handleDetail(e) {
  109 + let eData = e.currentTarget.dataset
109 110 wx.navigateTo({
110   - url: '/pages/index/punchDetail/punchDetail?valueId='+e.currentTarget.dataset.valueid ,
  111 + url: '/pages/index/punchDetail/punchDetail?valueId=' + eData.valueid,
111 112 })
112 113 },
113 114 // 统一返回
... ...
pages/mine/record/record.wxml
... ... @@ -31,7 +31,7 @@
31 31 </view>
32 32 <view class="flex_font" wx:if="{{value.submitCondition != null}}">
33 33 <text class="grey_flex">打卡要求:</text>
34   - {{'需要' + value.submitCondition}}
  34 + {{ value.submitCondition == '无限制' ? '无限制': '需要 '+value.submitCondition}}
35 35 </view>
36 36 <view class="flex_font">
37 37 <view class="grey_flex">其他:</view>
... ...
pages/mine/record/record.wxss
... ... @@ -12,6 +12,7 @@
12 12 }
13 13  
14 14 .grey_font {
  15 + width: 100%;
15 16 color: #999;
16 17 font-size: 14px;
17 18 margin-bottom: 15px;
... ... @@ -53,11 +54,11 @@
53 54 font-size: 4.6vw;
54 55 }
55 56  
56   -.grey_font {
  57 +/* .grey_font {
57 58 width: 100%;
58 59 color: #999;
59 60 font-size: 3.8vw;
60   -}
  61 +} */
61 62  
62 63 .day_font {
63 64 margin: 10px 0 20px;
... ...