Commit 1d47db29bae524ad367dffaad4abdd97f8e99e92
Merge branch 'dev' into 'test'
Dev See merge request !602
Showing
9 changed files
with
200 additions
and
91 deletions
components/full_screen/full_screen.js
| @@ -12,6 +12,7 @@ Component({ | @@ -12,6 +12,7 @@ Component({ | ||
| 12 | url:o.imghost, | 12 | url:o.imghost, |
| 13 | full_screen:0, | 13 | full_screen:0, |
| 14 | is_full_screen_men:1, | 14 | is_full_screen_men:1, |
| 15 | + hidden:0, | ||
| 15 | }, | 16 | }, |
| 16 | 17 | ||
| 17 | pageLifetimes:{ | 18 | pageLifetimes:{ |
| @@ -21,6 +22,13 @@ Component({ | @@ -21,6 +22,13 @@ Component({ | ||
| 21 | }, | 22 | }, |
| 22 | }, | 23 | }, |
| 23 | 24 | ||
| 25 | + ready: function () { | ||
| 26 | + var th=this; | ||
| 27 | + setTimeout(function(){ | ||
| 28 | + th.setData({hidden:1,}) | ||
| 29 | + },2600) | ||
| 30 | + }, | ||
| 31 | + | ||
| 24 | properties: {}, | 32 | properties: {}, |
| 25 | methods: { | 33 | methods: { |
| 26 | close_full_screen(){ | 34 | close_full_screen(){ |
components/full_screen/full_screen.wxml
| 1 | <!-- 全屏控制 --> | 1 | <!-- 全屏控制 --> |
| 2 | -<view hidden="{{!is_full_screen_men}}" class="full_screen" style="background-color: #fff;"></view> | 2 | +<view hidden="{{!is_full_screen_men || hidden}}" class="full_screen" style="background-color: #fff;"></view> |
| 3 | <view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');"> | 3 | <view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');"> |
| 4 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> | 4 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> |
| 5 | </view> | 5 | </view> |
packageA/pages/checkin/checkin.js
| @@ -12,6 +12,9 @@ Page({ | @@ -12,6 +12,9 @@ Page({ | ||
| 12 | day: '', | 12 | day: '', |
| 13 | weekArr: ['日', '一', '二', '三', '四', '五', '六'], | 13 | weekArr: ['日', '一', '二', '三', '四', '五', '六'], |
| 14 | dateArr: [], | 14 | dateArr: [], |
| 15 | + n_dateArr:[], //本月的日期 | ||
| 16 | + s_dateArr:[], //上月的日期 | ||
| 17 | + | ||
| 15 | firstDay: '', | 18 | firstDay: '', |
| 16 | lastDay: '', | 19 | lastDay: '', |
| 17 | param: null, | 20 | param: null, |
| @@ -33,11 +36,19 @@ Page({ | @@ -33,11 +36,19 @@ Page({ | ||
| 33 | loadQd(callback) { | 36 | loadQd(callback) { |
| 34 | app.request.get('/api/weshop/qdrecord/getUser/'+ app.globalData.setting.stoid + '/' + app.globalData.user_id, { | 37 | app.request.get('/api/weshop/qdrecord/getUser/'+ app.globalData.setting.stoid + '/' + app.globalData.user_id, { |
| 35 | success: function (res) { | 38 | success: function (res) { |
| 36 | - if(callback) callback(); | ||
| 37 | - self.setData({ | ||
| 38 | - res: res.data.data | ||
| 39 | - }); | ||
| 40 | - self.loadCheckedRecord(); | 39 | + if(res.data.code==0){ |
| 40 | + if(callback) callback(); | ||
| 41 | + self.setData({ | ||
| 42 | + res: res.data.data | ||
| 43 | + }); | ||
| 44 | + self.loadCheckedRecord(); | ||
| 45 | + }else{ | ||
| 46 | + wx.showToast({ | ||
| 47 | + title: "网络繁忙,请重试", | ||
| 48 | + icon: 'none', | ||
| 49 | + duration: 2000 | ||
| 50 | + }) | ||
| 51 | + } | ||
| 41 | }, | 52 | }, |
| 42 | }); | 53 | }); |
| 43 | }, | 54 | }, |
| @@ -52,10 +63,8 @@ Page({ | @@ -52,10 +63,8 @@ Page({ | ||
| 52 | this.setDate(); | 63 | this.setDate(); |
| 53 | var res = wx.getSystemInfoSync(); | 64 | var res = wx.getSystemInfoSync(); |
| 54 | this.setData({ | 65 | this.setData({ |
| 55 | - param: res.windowHeight / 12, | ||
| 56 | - | 66 | + param: res.windowHeight / 12, |
| 57 | }) | 67 | }) |
| 58 | - | ||
| 59 | 68 | ||
| 60 | // 判断会员是否授权登录, | 69 | // 判断会员是否授权登录, |
| 61 | // 没有登录则跳转到登录页, | 70 | // 没有登录则跳转到登录页, |
| @@ -103,14 +112,12 @@ Page({ | @@ -103,14 +112,12 @@ Page({ | ||
| 103 | }); | 112 | }); |
| 104 | }, | 113 | }, |
| 105 | 114 | ||
| 106 | - | ||
| 107 | // 点击"我的积分"和"去购物"进行跳转 | 115 | // 点击"我的积分"和"去购物"进行跳转 |
| 108 | goto(e) { | 116 | goto(e) { |
| 109 | let url = e.target.dataset.url; | 117 | let url = e.target.dataset.url; |
| 110 | app.goto(url); | 118 | app.goto(url); |
| 111 | }, | 119 | }, |
| 112 | 120 | ||
| 113 | - | ||
| 114 | // 点击显示签到规则 | 121 | // 点击显示签到规则 |
| 115 | showRules() { | 122 | showRules() { |
| 116 | if(this.data.isShowRules) { | 123 | if(this.data.isShowRules) { |
| @@ -127,34 +134,87 @@ Page({ | @@ -127,34 +134,87 @@ Page({ | ||
| 127 | 134 | ||
| 128 | // 加载签到记录 | 135 | // 加载签到记录 |
| 129 | loadCheckedRecord() { | 136 | loadCheckedRecord() { |
| 130 | - let newDateArr = this.data.dateArr; | 137 | + let newDateArr=[]; |
| 131 | let list; | 138 | let list; |
| 132 | let bqlist; | 139 | let bqlist; |
| 133 | - if(this.data.res.qddaylist) { | 140 | + //--判断什么日子是签到的,上个月的-- |
| 141 | + if(this.data.res && this.data.res.qdsdaylist) { | ||
| 142 | + list = this.data.res.qdsdaylist.split(','); | ||
| 143 | + for(var i in this.data.s_dateArr){ | ||
| 144 | + var item=this.data.s_dateArr[i]; | ||
| 145 | + if(this.check_is_qd(item,list)){ | ||
| 146 | + item.isCheckIn = true; | ||
| 147 | + }else{ | ||
| 148 | + item.isCheckIn = false; | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + newDateArr=newDateArr.concat(this.data.s_dateArr); | ||
| 153 | + //--判断什么日子是签到的,这个月的-- | ||
| 154 | + if(this.data.res && this.data.res.qddaylist) { | ||
| 134 | list = this.data.res.qddaylist.split(','); | 155 | list = this.data.res.qddaylist.split(','); |
| 135 | - for(let item of list) { | ||
| 136 | - newDateArr[item-1].isCheckIn = true; | ||
| 137 | - }; | 156 | + for(var i in this.data.n_dateArr){ |
| 157 | + var item=this.data.n_dateArr[i]; | ||
| 158 | + if(this.check_is_qd(item,list)){ | ||
| 159 | + item.isCheckIn = true; | ||
| 160 | + }else{ | ||
| 161 | + item.isCheckIn = false; | ||
| 162 | + } | ||
| 163 | + } | ||
| 138 | } | 164 | } |
| 139 | - if(this.data.res.curbqdaynum) { | 165 | + newDateArr=newDateArr.concat(this.data.n_dateArr); |
| 166 | + | ||
| 167 | + //--判断什么日子是要补签的-- | ||
| 168 | + if(this.data.res && this.data.res.curbqdaynum) { | ||
| 140 | bqlist = this.data.res.curbqdaynum.split(','); | 169 | bqlist = this.data.res.curbqdaynum.split(','); |
| 141 | - for(let item of bqlist) { | ||
| 142 | - var date = new Date(item); | ||
| 143 | - newDateArr[date.getDate()-1].isBq = true; | ||
| 144 | - } | 170 | + for(var i in newDateArr){ |
| 171 | + var item=newDateArr[i]; | ||
| 172 | + if(this.check_is_bq(item,bqlist)){ | ||
| 173 | + item.isBq = true; | ||
| 174 | + }else{ | ||
| 175 | + item.isBq = false; | ||
| 176 | + } | ||
| 177 | + } | ||
| 145 | } | 178 | } |
| 146 | this.setData({ | 179 | this.setData({ |
| 147 | dateArr: newDateArr | 180 | dateArr: newDateArr |
| 148 | }); | 181 | }); |
| 149 | }, | 182 | }, |
| 150 | 183 | ||
| 184 | + | ||
| 185 | + //判断是不是同一个日期,签到的 | ||
| 186 | + check_is_qd(item,bqlist){ | ||
| 187 | + for(var i in bqlist){ | ||
| 188 | + var c_item=JSON.parse(JSON.stringify(item)); | ||
| 189 | + if(c_item.num<10) c_item.num="0"+c_item.num; | ||
| 190 | + if(c_item.num==bqlist[i]){ | ||
| 191 | + return true; | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + return false; | ||
| 195 | + }, | ||
| 196 | + | ||
| 197 | + //判断是不是同一个日期,补签到的 | ||
| 198 | + check_is_bq(item,bqlist){ | ||
| 199 | + for(var i in bqlist){ | ||
| 200 | + if(item.date==bqlist[i]){ | ||
| 201 | + return true; | ||
| 202 | + } | ||
| 203 | + } | ||
| 204 | + return false; | ||
| 205 | + }, | ||
| 206 | + | ||
| 151 | // 点击签到 | 207 | // 点击签到 |
| 152 | checkInToday() { | 208 | checkInToday() { |
| 153 | const self = this; | 209 | const self = this; |
| 154 | // 获取今天的签到状态 | 210 | // 获取今天的签到状态 |
| 155 | - let isCheckInToday = this.data.dateArr[this.data.day-1].isCheckIn; | 211 | + //let isCheckInToday = this.data.dateArr[this.data.day-1].isCheckIn; |
| 212 | + var ck=this.data.day; | ||
| 213 | + if(parseInt(ck)<10) ck="0"+ck; | ||
| 214 | + var isCheckInToday=this.data.res.qddaylist.indexOf(ck); | ||
| 215 | + | ||
| 156 | // 如果还没签到, 可以点击签到 | 216 | // 如果还没签到, 可以点击签到 |
| 157 | - if(!isCheckInToday) { | 217 | + if(isCheckInToday==-1) { |
| 158 | app.request.promisePost('/api/weshop/qdrecord/saveQd', { | 218 | app.request.promisePost('/api/weshop/qdrecord/saveQd', { |
| 159 | data: { | 219 | data: { |
| 160 | store_id: app.globalData.setting.stoid, | 220 | store_id: app.globalData.setting.stoid, |
| @@ -163,8 +223,16 @@ Page({ | @@ -163,8 +223,16 @@ Page({ | ||
| 163 | }).then(res => { | 223 | }).then(res => { |
| 164 | // 改变签到状态,由false置为true | 224 | // 改变签到状态,由false置为true |
| 165 | // let newDateArr = self.data.dateArr; | 225 | // let newDateArr = self.data.dateArr; |
| 166 | - // newDateArr[self.data.day-1].isCheckIn = true; | ||
| 167 | - | 226 | + // newDateArr[self.data.day-1].isCheckIn = true; |
| 227 | + | ||
| 228 | + for(var i in self.data.dateArr) { | ||
| 229 | + self.data.dateArr[i].isCheckIn=false; | ||
| 230 | + self.data.dateArr[i].isBq=false; | ||
| 231 | + } | ||
| 232 | + self.setData({ | ||
| 233 | + dateArr: self.data.dateArr | ||
| 234 | + }); | ||
| 235 | + | ||
| 168 | self.loadQd(function() { | 236 | self.loadQd(function() { |
| 169 | wx.showToast({ | 237 | wx.showToast({ |
| 170 | title: self.data.res.qdintro, | 238 | title: self.data.res.qdintro, |
| @@ -192,26 +260,29 @@ Page({ | @@ -192,26 +260,29 @@ Page({ | ||
| 192 | data: { | 260 | data: { |
| 193 | store_id: app.globalData.setting.stoid, | 261 | store_id: app.globalData.setting.stoid, |
| 194 | user_id: app.globalData.user_id, | 262 | user_id: app.globalData.user_id, |
| 195 | - daynum: self.data.res.getBQIntegral, | 263 | + daynum: self.data.res.getBQIntegral1, |
| 196 | bqnum: self.data.res.getbqnum2, | 264 | bqnum: self.data.res.getbqnum2, |
| 197 | - bqintegral: self.data.res.getBQIntegral1, | 265 | + bqintegral: self.data.res.getBQIntegral, |
| 198 | } | 266 | } |
| 199 | }).then(res => { | 267 | }).then(res => { |
| 200 | // 改变签到状态,由false置为true | 268 | // 改变签到状态,由false置为true |
| 201 | - // let newDateArr = self.data.dateArr; | ||
| 202 | - // newDateArr[self.data.day-1].isCheckIn = true; | ||
| 203 | - var bqlist = self.data.res.curbqdaynum.split(',').sort(); | ||
| 204 | - var list = []; | 269 | + // let newDateArr = self.data.dateArr; |
| 270 | + // newDateArr[self.data.day-1].isCheckIn = true; | ||
| 271 | + //var bqlist = self.data.res.curbqdaynum.split(',').sort(); | ||
| 272 | + //var list = []; | ||
| 273 | + /*-- | ||
| 205 | for(let item of bqlist) { | 274 | for(let item of bqlist) { |
| 206 | var date = new Date(item); | 275 | var date = new Date(item); |
| 207 | list.push(date.getDate()); | 276 | list.push(date.getDate()); |
| 208 | - } | ||
| 209 | - | ||
| 210 | - self.data.dateArr[list[0]-1].isBq = false; | 277 | + }--*/ |
| 278 | + | ||
| 279 | + for(var i in self.data.dateArr) { | ||
| 280 | + self.data.dateArr[i].isCheckIn=false; | ||
| 281 | + self.data.dateArr[i].isBq=false; | ||
| 282 | + } | ||
| 211 | self.setData({ | 283 | self.setData({ |
| 212 | dateArr: self.data.dateArr | 284 | dateArr: self.data.dateArr |
| 213 | - }); | ||
| 214 | - | 285 | + }); |
| 215 | self.loadQd(function() { | 286 | self.loadQd(function() { |
| 216 | self.data.flag = true; | 287 | self.data.flag = true; |
| 217 | wx.showToast({ | 288 | wx.showToast({ |
| @@ -227,10 +298,6 @@ Page({ | @@ -227,10 +298,6 @@ Page({ | ||
| 227 | } | 298 | } |
| 228 | }, | 299 | }, |
| 229 | 300 | ||
| 230 | - | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - | ||
| 234 | getDate: function() { //获取当月日期 | 301 | getDate: function() { //获取当月日期 |
| 235 | var mydate = new Date(); | 302 | var mydate = new Date(); |
| 236 | var year = mydate.getFullYear(); | 303 | var year = mydate.getFullYear(); |
| @@ -240,7 +307,7 @@ Page({ | @@ -240,7 +307,7 @@ Page({ | ||
| 240 | this.data.month = months; | 307 | this.data.month = months; |
| 241 | this.data.day = mydate.getDate(); //获取当月日期: 1~31 | 308 | this.data.day = mydate.getDate(); //获取当月日期: 1~31 |
| 242 | var fist = new Date(year, month, 1); | 309 | var fist = new Date(year, month, 1); |
| 243 | - this.data.firstDay = fist.getDay(); //获取当月第一天 | 310 | + this.data.firstDay = fist.getDay(); //获取当月第一天 |
| 244 | var last = new Date(year, months, 0); //0表示当月最后一天 | 311 | var last = new Date(year, months, 0); //0表示当月最后一天 |
| 245 | this.data.lastDay = last.getDate(); //获取当月最后一天 | 312 | this.data.lastDay = last.getDate(); //获取当月最后一天 |
| 246 | 313 | ||
| @@ -249,22 +316,43 @@ Page({ | @@ -249,22 +316,43 @@ Page({ | ||
| 249 | month: this.data.month, | 316 | month: this.data.month, |
| 250 | day: this.data.day, | 317 | day: this.data.day, |
| 251 | firstDay: this.data.firstDay, | 318 | firstDay: this.data.firstDay, |
| 252 | - lastDay: this.data.lastDay | 319 | + lastDay: this.data.lastDay, |
| 320 | + fist:fist | ||
| 253 | }) | 321 | }) |
| 254 | console.log("今天:" + this.data.day); | 322 | console.log("今天:" + this.data.day); |
| 255 | }, | 323 | }, |
| 256 | 324 | ||
| 257 | setDate: function() { | 325 | setDate: function() { |
| 258 | var day; | 326 | var day; |
| 259 | - for (var i = 1; i < this.data.lastDay + 1; i++) { | ||
| 260 | - day = { | ||
| 261 | - num: i, | ||
| 262 | - }; | ||
| 263 | - this.data.dateArr.push(day); | 327 | + for(var i=0;i<this.data.firstDay;i++){ |
| 328 | + //获取前几天的时间数组 | ||
| 329 | + var arr_d=this.getNextDate(this.data.fist,i-this.data.firstDay) | ||
| 330 | + day = {num: arr_d[1],date:arr_d[0]}; | ||
| 331 | + this.data.s_dateArr.push(day); | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + for (var i = 1; i < this.data.lastDay + 1; i++) { | ||
| 335 | + var date=this.data.month+""; | ||
| 336 | + if(this.data.month<10) date="0"+date; | ||
| 337 | + if(i<10) { | ||
| 338 | + date=date+"-0"+i; | ||
| 339 | + }else{ | ||
| 340 | + date=date+"-"+i; | ||
| 341 | + } | ||
| 342 | + day = {num: i,date:date}; | ||
| 343 | + this.data.n_dateArr.push(day); | ||
| 264 | } | 344 | } |
| 265 | - this.setData({ | ||
| 266 | - dateArr: this.data.dateArr, | ||
| 267 | - }); | ||
| 268 | }, | 345 | }, |
| 269 | 346 | ||
| 347 | + //获取相隔是多少天的日期 | ||
| 348 | + getNextDate(date,day) { | ||
| 349 | + var dd = date; | ||
| 350 | + dd.setDate(dd.getDate() + day); | ||
| 351 | + //var y = dd.getFullYear(); | ||
| 352 | + var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1; | ||
| 353 | + var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); | ||
| 354 | + //return y + "-" + m + "-" + d; | ||
| 355 | + return [m + "-" + d,dd.getDate()]; | ||
| 356 | + } | ||
| 357 | + | ||
| 270 | }) | 358 | }) |
packageA/pages/checkin/checkin.wxml
| @@ -2,64 +2,66 @@ | @@ -2,64 +2,66 @@ | ||
| 2 | <wxs src="checkin.wxs" module="myUtil"></wxs> | 2 | <wxs src="checkin.wxs" module="myUtil"></wxs> |
| 3 | <view class="checkin-container"> | 3 | <view class="checkin-container"> |
| 4 | <view class="rule-container flex"> | 4 | <view class="rule-container flex"> |
| 5 | - <view class="points" bindtap="goto" data-url="/pages/user/integral/integral"><image class="coin" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/coins.png"></image>我的积分</view> | ||
| 6 | <view class="rule" bindtap="showRules">规则</view> | 5 | <view class="rule" bindtap="showRules">规则</view> |
| 6 | + <view class="points" bindtap="goto" data-url="/pages/user/integral/integral"><image class="coin" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/coins.png"></image>我的积分</view> | ||
| 7 | + | ||
| 7 | </view> | 8 | </view> |
| 8 | 9 | ||
| 9 | - <view class="list flex"> | ||
| 10 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 0)-1].isCheckIn ? 'active':''}}"> | 10 | + <view class="list flex" wx:if="{{res}}"> |
| 11 | + <view class="list-item active}}"> | ||
| 11 | <view class="circle">+{{res.cday1}}</view> | 12 | <view class="circle">+{{res.cday1}}</view> |
| 12 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 0)}}日</view> | 13 | + <view class="fs26">{{res.sday2}}</view> |
| 13 | </view> | 14 | </view> |
| 14 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 1)-1].isCheckIn ? 'active':''}}"> | 15 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 0,res.qddaylist)? 'active':''}}"> |
| 15 | <view class="circle">+{{res.daynum}}</view> | 16 | <view class="circle">+{{res.daynum}}</view> |
| 16 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 1)}}日</view> | 17 | + <view class="fs26">今日</view> |
| 17 | </view> | 18 | </view> |
| 18 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 2)-1].isCheckIn ? 'active':''}}"> | 19 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 1,res.qddaylist)? 'active':''}}"> |
| 19 | <view class="circle">+{{res.tdayc1}}</view> | 20 | <view class="circle">+{{res.tdayc1}}</view> |
| 20 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 2)}}日</view> | 21 | + <view class="fs26">明日</view> |
| 21 | </view> | 22 | </view> |
| 22 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 3)-1].isCheckIn ? 'active':''}}"> | 23 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 2,res.qddaylist)? 'active':''}}"> |
| 23 | <view class="circle">+{{res.tdayc2}}</view> | 24 | <view class="circle">+{{res.tdayc2}}</view> |
| 24 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 3)}}日</view> | 25 | + <view class="fs26">{{myUtil.setDate(year, res.sday3, 2)}}日</view> |
| 25 | </view> | 26 | </view> |
| 26 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 4)-1].isCheckIn ? 'active':''}}"> | 27 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 3,res.qddaylist)? 'active':''}}"> |
| 27 | <view class="circle">+{{res.tdayc3}}</view> | 28 | <view class="circle">+{{res.tdayc3}}</view> |
| 28 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 4)}}日</view> | 29 | + <view class="fs26">{{myUtil.setDate(year, res.sday3, 3)}}日</view> |
| 29 | </view> | 30 | </view> |
| 30 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 5)-1].isCheckIn ? 'active':''}}"> | 31 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 4,res.qddaylist)? 'active':''}}"> |
| 31 | <view class="circle">+{{res.tdayc4}}</view> | 32 | <view class="circle">+{{res.tdayc4}}</view> |
| 32 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 5)}}日</view> | 33 | + <view class="fs26">{{myUtil.setDate(year, res.sday3, 4)}}日</view> |
| 33 | </view> | 34 | </view> |
| 34 | - <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 6)-1].isCheckIn ? 'active':''}}"> | 35 | + <view class="list-item {{myUtil.setDate_is_act(year, res.sday3, 5,res.qddaylist)? 'active':''}}"> |
| 35 | <view class="circle">+{{res.tdayc5}}</view> | 36 | <view class="circle">+{{res.tdayc5}}</view> |
| 36 | - <view class="fs26">{{myUtil.setDate(year, res.sday2, 6)}}日</view> | 37 | + <view class="fs26">{{myUtil.setDate(year, res.sday3, 5)}}日</view> |
| 37 | </view> | 38 | </view> |
| 38 | </view> | 39 | </view> |
| 40 | + <view wx:else style="height: 100rpx;"></view> | ||
| 39 | 41 | ||
| 40 | - <view class="btn-container"> | 42 | + <view class="btn-container" wx:if="{{res}}"> |
| 41 | <view class="btn" bindtap="checkInToday" wx:if="{{isLogin}}"> | 43 | <view class="btn" bindtap="checkInToday" wx:if="{{isLogin}}"> |
| 42 | - <text class="iconfont icon-rili"></text>{{!dateArr[day-1].isCheckIn ? '立即签到':'今日已签到'}} | 44 | + <text class="iconfont icon-rili"></text>{{!myUtil.setDate_is_act(year, res.sday3, 0,res.qddaylist) ? '立即签到':'今日已签到'}} |
| 43 | </view> | 45 | </view> |
| 44 | <view class="btn" bindtap="isLogin" wx:else> | 46 | <view class="btn" bindtap="isLogin" wx:else> |
| 45 | <text class="iconfont icon-rili"></text>签到请登录 | 47 | <text class="iconfont icon-rili"></text>签到请登录 |
| 46 | </view> | 48 | </view> |
| 47 | - <view class="btn" wx:if="{{res.curbqdaynum}}" bindtap="reCheckIn"><text class="iconfont icon-buqian"></text>补签(-10分)</view> | 49 | + <view class="btn" wx:if="{{res.curbqdaynum}}" bindtap="reCheckIn"><text class="iconfont icon-buqian"></text>补签(-{{res.getBQIntegral}}分)</view> |
| 48 | </view> | 50 | </view> |
| 49 | 51 | ||
| 50 | 52 | ||
| 51 | <!-- <view class="current"> | 53 | <!-- <view class="current"> |
| 52 | <view class="f-vc">当前连续签到:<text class="days fs34">{{res.getlxnum}}</text> 天</view> | 54 | <view class="f-vc">当前连续签到:<text class="days fs34">{{res.getlxnum}}</text> 天</view> |
| 53 | <view class="f-vc">当前积分:<text class="fs34">{{integral}}</text></view> | 55 | <view class="f-vc">当前积分:<text class="fs34">{{integral}}</text></view> |
| 54 | - </view> --> | ||
| 55 | - | 56 | + </view> --> |
| 56 | <!-- <view class="goleft iconfont icon-jianzuo" bindtap="prevMonth">a</view> --> | 57 | <!-- <view class="goleft iconfont icon-jianzuo" bindtap="prevMonth">a</view> --> |
| 57 | 58 | ||
| 58 | <view class="calendar-container"> | 59 | <view class="calendar-container"> |
| 59 | <view class="calendar-wrapper"> | 60 | <view class="calendar-wrapper"> |
| 60 | <view class="calendar-title"> | 61 | <view class="calendar-title"> |
| 61 | <view>{{year}}年{{month}}月</view> | 62 | <view>{{year}}年{{month}}月</view> |
| 62 | - <view class="fs24" style="color:#999;">补签卡:{{res.getkbqnum}}</view> | 63 | + <!-- 有补签,才要补签卡 --> |
| 64 | + <view wx:if="{{res.getkbqnum}}" class="fs24" style="color:#999;font-weight:bold">补签卡:{{res.getkbqnum}}</view> | ||
| 63 | </view> | 65 | </view> |
| 64 | <view class="calendar"> | 66 | <view class="calendar"> |
| 65 | <!-- <view class="selectDate"> --> | 67 | <!-- <view class="selectDate"> --> |
| @@ -76,7 +78,7 @@ | @@ -76,7 +78,7 @@ | ||
| 76 | <view class="date"> | 78 | <view class="date"> |
| 77 | <block wx:for="{{dateArr}}" wx:for-index="index" wx:for-item="item" wx:key="key"> | 79 | <block wx:for="{{dateArr}}" wx:for-index="index" wx:for-item="item" wx:key="key"> |
| 78 | <!-- <view style="{{index ==0?'margin-left:calc(100%/7 * ' + firstDay + ');':''}}width:calc(100%/7);line-height:80rpx;" class="{{index+1==day?'today':''}} {{index+1==day&&isClock?'clockOn':''}}" ><view class="day">{{item}}</view></view> --> | 80 | <!-- <view style="{{index ==0?'margin-left:calc(100%/7 * ' + firstDay + ');':''}}width:calc(100%/7);line-height:80rpx;" class="{{index+1==day?'today':''}} {{index+1==day&&isClock?'clockOn':''}}" ><view class="day">{{item}}</view></view> --> |
| 79 | - <view style="{{index ==0?'margin-left:calc(100%/7 * ' + firstDay + ');':''}}width:calc(100%/7);line-height:80rpx;" class="{{item.isCheckIn ? 'active':''}} {{res.curbqdaynum&&item.isBq ? 'bq':''}}" bindtap="clickDay" data-day="{{item.num}}"> | 81 | + <view style="{{index ==0?'margin-left:calc(100%/7 * 0);':''}}width:calc(100%/7);line-height:80rpx;" class="{{item.isCheckIn ? 'active':''}} {{res.curbqdaynum&&item.isBq ? 'bq':''}}" bindtap="clickDay" data-day="{{item.num}}"> |
| 80 | <view class="day">{{item.num}}</view> | 82 | <view class="day">{{item.num}}</view> |
| 81 | </view> | 83 | </view> |
| 82 | </block> | 84 | </block> |
packageA/pages/checkin/checkin.wxs
| 1 | var myUtil = { | 1 | var myUtil = { |
| 2 | - setDate: function(year, startDate, num) { | 2 | + setDate_is_act: function(year, startDate, num,qdlist) { |
| 3 | var date = getDate(year + '-' + startDate); | 3 | var date = getDate(year + '-' + startDate); |
| 4 | date.setDate(date.getDate() + num); | 4 | date.setDate(date.getDate() + num); |
| 5 | date = getDate(date).getDate(); | 5 | date = getDate(date).getDate(); |
| 6 | - return date; | 6 | + if(date<10) date="0"+date; |
| 7 | + if(!qdlist) return false; | ||
| 8 | + if(qdlist.indexOf(date)!=-1){ | ||
| 9 | + return true | ||
| 10 | + } | ||
| 11 | + return false; | ||
| 7 | }, | 12 | }, |
| 8 | 13 | ||
| 9 | - // dateDiff: function(firstDate,secondDate) { | ||
| 10 | - // var firstDate = new Date(firstDate); | ||
| 11 | - // var secondDate = new Date(secondDate); | ||
| 12 | - // var diff = Math.abs(firstDate.getTime() - secondDate.getTime()); | ||
| 13 | - // var result = parseInt(diff / (1000 * 60 * 60 * 24)); | ||
| 14 | - // return result; | ||
| 15 | - // }, | 14 | + setDate:function(year, startDate, num){ |
| 15 | + var date = getDate(year + '-' + startDate); | ||
| 16 | + date.setDate(date.getDate() + num); | ||
| 17 | + date = getDate(date).getDate(); | ||
| 18 | + return date; | ||
| 19 | + } | ||
| 16 | }; | 20 | }; |
| 17 | 21 | ||
| 18 | module.exports = { | 22 | module.exports = { |
| 19 | setDate: myUtil.setDate, | 23 | setDate: myUtil.setDate, |
| 24 | + setDate_is_act: myUtil.setDate_is_act, | ||
| 20 | }; | 25 | }; |
| 21 | \ No newline at end of file | 26 | \ No newline at end of file |
packageA/pages/checkin/checkin.wxss
| @@ -25,8 +25,8 @@ page, | @@ -25,8 +25,8 @@ page, | ||
| 25 | background-color: #FFBC47; | 25 | background-color: #FFBC47; |
| 26 | color: #333; | 26 | color: #333; |
| 27 | font-size: 26rpx; | 27 | font-size: 26rpx; |
| 28 | - border-top-right-radius: 25rpx; | ||
| 29 | - border-bottom-right-radius: 25rpx; | 28 | + border-top-left-radius: 25rpx; |
| 29 | + border-bottom-left-radius: 25rpx; | ||
| 30 | display: flex; | 30 | display: flex; |
| 31 | align-items: center; | 31 | align-items: center; |
| 32 | padding-right: 20rpx; | 32 | padding-right: 20rpx; |
| @@ -34,7 +34,7 @@ page, | @@ -34,7 +34,7 @@ page, | ||
| 34 | } | 34 | } |
| 35 | .rule { | 35 | .rule { |
| 36 | padding: 10rpx 20rpx; | 36 | padding: 10rpx 20rpx; |
| 37 | - color: #FFBC47; | 37 | + color: white; |
| 38 | font-size: 26rpx; | 38 | font-size: 26rpx; |
| 39 | } | 39 | } |
| 40 | 40 |
pages/goods/goodsInfo/goodsInfo.js
| @@ -2160,6 +2160,7 @@ Page({ | @@ -2160,6 +2160,7 @@ Page({ | ||
| 2160 | 2160 | ||
| 2161 | }, | 2161 | }, |
| 2162 | 2162 | ||
| 2163 | + | ||
| 2163 | //------------处理门店--------------- | 2164 | //------------处理门店--------------- |
| 2164 | deal_pickup(e){ | 2165 | deal_pickup(e){ |
| 2165 | var th=this; | 2166 | var th=this; |
| @@ -4601,8 +4602,8 @@ Page({ | @@ -4601,8 +4602,8 @@ Page({ | ||
| 4601 | 4602 | ||
| 4602 | getApp().request.put('/api/weshop/users/update', { | 4603 | getApp().request.put('/api/weshop/users/update', { |
| 4603 | data: { | 4604 | data: { |
| 4604 | - user_id, | ||
| 4605 | - def_pickup_id | 4605 | + user_id:user_id, |
| 4606 | + def_pickup_id:def_pickup_id | ||
| 4606 | }, | 4607 | }, |
| 4607 | success: function(res) { | 4608 | success: function(res) { |
| 4608 | if (res.data.code == 0) { | 4609 | if (res.data.code == 0) { |
pages/index/index/index.js
| @@ -228,12 +228,15 @@ Page({ | @@ -228,12 +228,15 @@ Page({ | ||
| 228 | 228 | ||
| 229 | var th = this | 229 | var th = this |
| 230 | var show=getApp().globalData.isLoad_ad; | 230 | var show=getApp().globalData.isLoad_ad; |
| 231 | - if(show){ | ||
| 232 | - var full_screen = this.selectComponent("#full_screen"); //组件的id | ||
| 233 | - full_screen.get_the_full_screen(); | 231 | + var userInfo=getApp().globalData.userInfo; |
| 232 | + //有加载过一次首页,就显示.或者有会员就显示 | ||
| 233 | + if(show || userInfo || getApp().globalData.user_id){ | ||
| 234 | + var full_screen = th.selectComponent("#full_screen"); //组件的id | ||
| 235 | + full_screen.get_the_full_screen(); | ||
| 234 | }else{ | 236 | }else{ |
| 235 | getApp().globalData.isLoad_ad=1; | 237 | getApp().globalData.isLoad_ad=1; |
| 236 | - } | 238 | + } |
| 239 | + | ||
| 237 | 240 | ||
| 238 | }, | 241 | }, |
| 239 | //当隐藏的时候就关闭计时器 | 242 | //当隐藏的时候就关闭计时器 |
utils/auth.js
| @@ -48,6 +48,7 @@ module.exports = { | @@ -48,6 +48,7 @@ module.exports = { | ||
| 48 | console.log("thirdLogin"); | 48 | console.log("thirdLogin"); |
| 49 | console.log(e); | 49 | console.log(e); |
| 50 | a.request.get("/api/weshop/users/openidandkey", { | 50 | a.request.get("/api/weshop/users/openidandkey", { |
| 51 | + isShowLoading:0, | ||
| 51 | data: { | 52 | data: { |
| 52 | js_code: e, | 53 | js_code: e, |
| 53 | store_id: a.globalData.setting.stoid, | 54 | store_id: a.globalData.setting.stoid, |
| @@ -174,6 +175,7 @@ module.exports = { | @@ -174,6 +175,7 @@ module.exports = { | ||
| 174 | if (app_d.user_id != "" && app_d.user_id != null) { | 175 | if (app_d.user_id != "" && app_d.user_id != null) { |
| 175 | var ab = this.app().request; | 176 | var ab = this.app().request; |
| 176 | ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { | 177 | ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { |
| 178 | + isShowLoading:0, | ||
| 177 | success: function (e) { | 179 | success: function (e) { |
| 178 | app_d.userInfo = e.data.data; | 180 | app_d.userInfo = e.data.data; |
| 179 | "function" == typeof t && t(e.data.data); | 181 | "function" == typeof t && t(e.data.data); |