Commit 33707c41ce46365551646cf46aea10b25705aa9e
1 parent
47835f44
1. 等级卡 邀请明细的优化
Showing
3 changed files
with
374 additions
and
21 deletions
pages/user/Detailed/Detailed.js
| ... | ... | @@ -33,6 +33,10 @@ Page({ |
| 33 | 33 | imagePath:"", //分享的生成图片 |
| 34 | 34 | |
| 35 | 35 | canvasHidden:true, |
| 36 | + isBind:true, | |
| 37 | + isBinds:true, | |
| 38 | + | |
| 39 | + input_val:null, | |
| 36 | 40 | }, |
| 37 | 41 | |
| 38 | 42 | /** |
| ... | ... | @@ -108,20 +112,36 @@ Page({ |
| 108 | 112 | |
| 109 | 113 | selectDetailed: function() { |
| 110 | 114 | var th = this, e = th; |
| 115 | + var r_data={ | |
| 116 | + storeId: o.stoid, | |
| 117 | + userId: r.user_id, | |
| 118 | + page: th.data.page, | |
| 119 | + pageSize: th.data.pageSize | |
| 120 | + }; | |
| 121 | + | |
| 122 | + if(th.data.datet!="" && th.data.datet){ | |
| 123 | + r_data.Sdate=th.data.datet; | |
| 124 | + } | |
| 125 | + if(th.data.dates!="" && th.data.dates){ | |
| 126 | + r_data.Edate=th.data.dates; | |
| 127 | + } | |
| 128 | + if(th.data.input_val!="" && th.data.input_val){ | |
| 129 | + r_data.MobileTel=th.data.input_val; | |
| 130 | + } | |
| 131 | + | |
| 111 | 132 | getApp().request.promiseGet("/api/weshop/plus/vip/mem/referee/page", { |
| 112 | - data: { | |
| 113 | - storeId: o.stoid, | |
| 114 | - userId: r.user_id, | |
| 115 | - page: th.data.page, | |
| 116 | - pageSize: th.data.pageSize | |
| 117 | - } | |
| 133 | + data:r_data | |
| 118 | 134 | }).then(res => { |
| 119 | - | |
| 120 | - th.setData({isDetailed:1}) | |
| 135 | + | |
| 136 | + setTimeout(function () { | |
| 137 | + th.setData({isDetailed: 1 }); | |
| 138 | + },300) | |
| 121 | 139 | if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) { |
| 122 | 140 | th.data.page++;//当前页数+1 |
| 123 | 141 | var arr1 = th.data.arrayDetailed;//获取明细数组 |
| 124 | 142 | var arr2 = res.data.data.pageData;//获取当前查询数据 |
| 143 | + if(!arr1) arr1=[]; | |
| 144 | + | |
| 125 | 145 | var arr3 = [...arr1, ...arr2];//把当前查询数组拼接到原本数组后面 |
| 126 | 146 | var ismore = 0; |
| 127 | 147 | if (arr3.length == res.data.data.total) ismore = 1 //数据已加载完判断 |
| ... | ... | @@ -129,8 +149,9 @@ Page({ |
| 129 | 149 | arrayDetailed: arr3, |
| 130 | 150 | total: res.data.data.total, |
| 131 | 151 | ismore: ismore, |
| 132 | - isDetailed: 1 | |
| 133 | 152 | }) |
| 153 | + | |
| 154 | + | |
| 134 | 155 | } |
| 135 | 156 | }) |
| 136 | 157 | |
| ... | ... | @@ -152,7 +173,6 @@ Page({ |
| 152 | 173 | * 页面上拉触底事件的处理函数 |
| 153 | 174 | */ |
| 154 | 175 | onReachBottom: function() { |
| 155 | - | |
| 156 | 176 | if (this.data.total <= this.data.pageSize) return; |
| 157 | 177 | if (this.data.ismore) { |
| 158 | 178 | t.my_warnning("加载完啦!", 0, this); |
| ... | ... | @@ -183,7 +203,7 @@ Page({ |
| 183 | 203 | var privilege_o = th.data.privilege_o;//勋章图片 |
| 184 | 204 | var img_square=th.data.img_square; |
| 185 | 205 | var app = getApp(); |
| 186 | - var user=app.globalData.userInfo; | |
| 206 | + var user=app.globalData.userInfo; | |
| 187 | 207 | var unit = th.data.screenWidth / 750 * 1.35; |
| 188 | 208 | var scene = getApp().globalData.user_id; |
| 189 | 209 | var nickname = user.nickname; |
| ... | ... | @@ -368,10 +388,7 @@ Page({ |
| 368 | 388 | },300) |
| 369 | 389 | }) |
| 370 | 390 | }) |
| 371 | - | |
| 372 | - | |
| 373 | - | |
| 374 | - | |
| 391 | + | |
| 375 | 392 | } |
| 376 | 393 | |
| 377 | 394 | }) |
| ... | ... | @@ -435,9 +452,66 @@ Page({ |
| 435 | 452 | |
| 436 | 453 | }) |
| 437 | 454 | }, |
| 438 | - | |
| 439 | - | |
| 440 | - | |
| 441 | - | |
| 442 | - | |
| 455 | + | |
| 456 | + | |
| 457 | + //起始时间 | |
| 458 | + bindDateChenge: function(e) { | |
| 459 | + var isBind = false; | |
| 460 | + this.setData({ | |
| 461 | + datet: e.detail.value, | |
| 462 | + isBind: isBind | |
| 463 | + }); | |
| 464 | + }, | |
| 465 | + // 结束时间 | |
| 466 | + bindDateChenges: function(e) { | |
| 467 | + var isBinds = false; | |
| 468 | + this.setData({ | |
| 469 | + dates: e.detail.value, | |
| 470 | + isBinds: isBinds | |
| 471 | + }); | |
| 472 | + }, | |
| 473 | + //catchtap阻止冒泡,点击清除开始时间的按钮 | |
| 474 | + eliminate: function() { | |
| 475 | + var isBind = true; | |
| 476 | + var data = ""; | |
| 477 | + this.setData({ | |
| 478 | + datet: data, | |
| 479 | + isBind: isBind | |
| 480 | + }) | |
| 481 | + }, | |
| 482 | + //catchtap阻止冒泡,点击清除结束时间的按钮 | |
| 483 | + eliminates: function() { | |
| 484 | + var isBinds = true; | |
| 485 | + var dates = ""; | |
| 486 | + this.setData({ | |
| 487 | + dates: dates, | |
| 488 | + isBinds: isBinds | |
| 489 | + }) | |
| 490 | + }, | |
| 491 | + | |
| 492 | + get_input:function (e) { | |
| 493 | + this.data.input_val=e.detail.value; | |
| 494 | + }, | |
| 495 | + | |
| 496 | + //点击的搜索事件 | |
| 497 | + get_search:function () { | |
| 498 | + var th=this; | |
| 499 | + | |
| 500 | + if(th.data.datet && th.data.dates){ | |
| 501 | + var oDate1 = new Date(th.data.datet); | |
| 502 | + var oDate2 = new Date(th.data.dates); | |
| 503 | + if(oDate2<oDate1){ | |
| 504 | + getApp().my_warnning("结束时间不能小于开始时间",0,th); | |
| 505 | + return false; | |
| 506 | + } | |
| 507 | + } | |
| 508 | + this.data.total = 0; | |
| 509 | + this.data.page = 1; | |
| 510 | + this.data.ismore = 0; | |
| 511 | + this.setData({isDetailed:0}); | |
| 512 | + th.setData({arrayDetailed:[]}); | |
| 513 | + th.selectDetailed(); | |
| 514 | + } | |
| 515 | + | |
| 516 | + | |
| 443 | 517 | }) |
| 444 | 518 | \ No newline at end of file | ... | ... |
pages/user/Detailed/Detailed.wxml
| 1 | +<view class="big-rim"> | |
| 2 | + <form bindsubmit='get_search'> | |
| 3 | + <view class="min-rim"> | |
| 4 | + <view class="rq">日期:</view> | |
| 5 | + | |
| 6 | + <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> | |
| 7 | + <view class="rq-rim"> | |
| 8 | + <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> | |
| 9 | + <!-- 清除输入框中的内容--> | |
| 10 | + <view hidden='{{isBind}}' class="qc-rim"> | |
| 11 | + <button class="empty" catchtap="eliminate">x</button> | |
| 12 | + </view> | |
| 13 | + </view> | |
| 14 | + </picker> | |
| 15 | + | |
| 16 | + <view class="zi">至 </view> | |
| 17 | + <picker class="pis"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'> | |
| 18 | + <view class="kssj"> | |
| 19 | + <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text> | |
| 20 | + </view> | |
| 21 | + <!-- 清除输入框中的内容 --> | |
| 22 | + <view class="end-rim" hidden="{{isBinds}}"> | |
| 23 | + <button class="end" catchtap="eliminates">x</button> | |
| 24 | + </view> | |
| 25 | + </picker> | |
| 26 | + </view> | |
| 27 | + | |
| 28 | + <view class="xknr-rim"> | |
| 29 | + <view class="cxnr">查询内容 </view> | |
| 30 | + <view class='top'> | |
| 31 | + <input class="input" maxlength="13" bindinput="get_input" placeholder="输入手机号"/> | |
| 32 | + </view> | |
| 33 | + </view> | |
| 34 | + <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button> | |
| 35 | + </form> | |
| 36 | +</view> | |
| 37 | + | |
| 1 | 38 | <view wx:if="{{arrayDetailed.length>0}}"> |
| 2 | 39 | <view class="flex-space-between fs28 title"> |
| 3 | 40 | <view class="flex-vertical Nickname"> | ... | ... |
pages/user/Detailed/Detailed.wxss
| ... | ... | @@ -14,7 +14,6 @@ |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | |
| 17 | - | |
| 18 | 17 | .phone { |
| 19 | 18 | width: 250rpx; |
| 20 | 19 | } |
| ... | ... | @@ -59,4 +58,247 @@ |
| 59 | 58 | height: 56rpx; |
| 60 | 59 | background-color: rgb(255, 72, 72); |
| 61 | 60 | border-radius: 40rpx; |
| 61 | +} | |
| 62 | + | |
| 63 | + | |
| 64 | +.big-rim{ | |
| 65 | + margin-top: 15rpx; | |
| 66 | + width: 100%; | |
| 67 | + height: 305rpx; | |
| 68 | + border-bottom: 8px solid #EEEEEE; | |
| 69 | +} | |
| 70 | +/* 单据时间 */ | |
| 71 | +.time{ | |
| 72 | + | |
| 73 | + font-size: 25rpx; | |
| 74 | + color: #999999; | |
| 75 | + width: 100%; | |
| 76 | +} | |
| 77 | +.min-rim{ | |
| 78 | + display: flex; | |
| 79 | + width: 100%; | |
| 80 | + height: auto; | |
| 81 | + margin-left: 30rpx; | |
| 82 | +} | |
| 83 | +/* 日期 */ | |
| 84 | +.rq{ | |
| 85 | + height: 25rpx; | |
| 86 | + font-size: 28rpx; | |
| 87 | + margin-top:12rpx; | |
| 88 | + font-family:'SimHei',Arial; | |
| 89 | +} | |
| 90 | +/* 日期控件 */ | |
| 91 | +.pi{ | |
| 92 | + width:200rpx; | |
| 93 | + height:auto; | |
| 94 | + margin-left:10rpx; | |
| 95 | + | |
| 96 | +} | |
| 97 | +.pis{ | |
| 98 | + width:200rpx; | |
| 99 | + height:auto; | |
| 100 | + margin-left:30rpx; | |
| 101 | +} | |
| 102 | +/* 日期边框 */ | |
| 103 | +.rq-rim{ | |
| 104 | + position:relative; | |
| 105 | + left:0; | |
| 106 | + top:0 | |
| 107 | +} | |
| 108 | +/* 开始时间边框*/ | |
| 109 | +.kssj{ | |
| 110 | + display: inline-block; | |
| 111 | + height: 50rpx; | |
| 112 | + background-color: #EEEEEE; | |
| 113 | + border: 1px solid #DADADA; | |
| 114 | + width:200rpx; | |
| 115 | + border-radius: 3px; | |
| 116 | + line-height:40rpx; | |
| 117 | + position:relative; | |
| 118 | + top:0rpx; | |
| 119 | + left:0rpx; | |
| 120 | + | |
| 121 | +} | |
| 122 | +/* 开始时间的文字 */ | |
| 123 | +.wz{ | |
| 124 | + display: inline-block; | |
| 125 | + font-size: 25rpx; | |
| 126 | + color: #333; | |
| 127 | +} | |
| 128 | + | |
| 129 | +/* 开始清空按钮的 边框*/ | |
| 130 | +.qc-rim{ | |
| 131 | + position:absolute; | |
| 132 | + top:10rpx; | |
| 133 | + left:173rpx; | |
| 134 | + | |
| 135 | +} | |
| 136 | +/* 结束时间清空输入框的按钮的边框 */ | |
| 137 | +.end-rim{ | |
| 138 | + position: absolute; | |
| 139 | + top: 23rpx; | |
| 140 | + left:547rpx; | |
| 141 | + width: 25rpx; | |
| 142 | + height: 25rpx; | |
| 143 | +} | |
| 144 | +/* 查询内容 */ | |
| 145 | +.cxnr{ | |
| 146 | + margin-left:30rpx; | |
| 147 | + font-size:28rpx; | |
| 148 | + font-family: 'SimHei',Arial; | |
| 149 | +} | |
| 150 | +/* 至 */ | |
| 151 | +.zi{ | |
| 152 | + margin-top:14rpx; | |
| 153 | + font-weight:600; | |
| 154 | + font-size:28rpx; | |
| 155 | + font-family: 'SimHei',Arial; | |
| 156 | + margin-left:30rpx; | |
| 157 | +} | |
| 158 | +/* 结束时间 */ | |
| 159 | + | |
| 160 | +.jssj{ | |
| 161 | + padding-left: 10rpx; | |
| 162 | + margin-left: 30rpx; | |
| 163 | + padding-bottom: 10rpx; | |
| 164 | + height: 35rpx; | |
| 165 | + font-size: 25rpx; | |
| 166 | + color: #333; | |
| 167 | + background-color: #EEEEEE; | |
| 168 | + border: 1px solid #DADADA; | |
| 169 | + width:85%; | |
| 170 | + border-radius: 5px; | |
| 171 | + | |
| 172 | +} | |
| 173 | +/* 查询内容的备考的边框 */ | |
| 174 | +.xknr-rim{ | |
| 175 | + display: flex; | |
| 176 | + width: 100%; | |
| 177 | + height: 55rpx; | |
| 178 | + line-height:105rpx; | |
| 179 | + margin-top:20rpx; | |
| 180 | +} | |
| 181 | +/* 明细查询 */ | |
| 182 | +.botton{ | |
| 183 | + margin-left: 30rpx; | |
| 184 | + margin-top: 50rpx; | |
| 185 | + background-color: #C4182E; | |
| 186 | + width: 95%; | |
| 187 | + border-radius:10rpx; | |
| 188 | + text-align: center; | |
| 189 | + height: 70rpx; | |
| 190 | + line-height: 70rpx; | |
| 191 | + color: #FFF; | |
| 192 | + font-size: 29rpx; | |
| 193 | + border: none; | |
| 194 | + font-family: 'SimHei',Arial; | |
| 195 | +} | |
| 196 | + | |
| 197 | +/*开始时间清空输入框的按钮*/ | |
| 198 | +.empty{ | |
| 199 | + width: 25rpx; | |
| 200 | + height: 25rpx; | |
| 201 | + border-radius:50%; | |
| 202 | + background: #767676; | |
| 203 | + color: #fff; | |
| 204 | + font-size: 25rpx; | |
| 205 | + text-align: center; | |
| 206 | + line-height:19rpx; | |
| 207 | +} | |
| 208 | +/*结束时间清空输入框的按钮*/ | |
| 209 | +.end{ | |
| 210 | + width: 25rpx; | |
| 211 | + height: 25rpx; | |
| 212 | + border-radius:50%; | |
| 213 | + background: #767676; | |
| 214 | + color: #fff; | |
| 215 | + font-size: 25rpx; | |
| 216 | + text-align: center; | |
| 217 | + line-height:19rpx; | |
| 218 | +} | |
| 219 | + | |
| 220 | +/* 顶部 */ | |
| 221 | +.top{ | |
| 222 | + width: 170rpx; | |
| 223 | + height: 50rpx; | |
| 224 | + padding: 0 10rpx; | |
| 225 | + line-height: 50rpx; | |
| 226 | + font-size: 34rpx; | |
| 227 | + margin-top: 25rpx; | |
| 228 | + border-radius:3rpx; | |
| 229 | +} | |
| 230 | +.images{ | |
| 231 | + width:35rpx; | |
| 232 | + height:35rpx; | |
| 233 | + margin-left:-9rpx; | |
| 234 | + margin-top:6rpx; | |
| 235 | +} | |
| 236 | +.rim-images{ | |
| 237 | + width: 62rpx; | |
| 238 | + height: 46rpx; | |
| 239 | + line-height: 37rpx; | |
| 240 | + /* border-style: inset;padding:4rpx;text-align: center; */ | |
| 241 | + background: #f1f1f1; | |
| 242 | + border-color:#000000; | |
| 243 | + border-width: 1rpx; | |
| 244 | + transform:translateX(28%); | |
| 245 | + margin-top:-3rpx; | |
| 246 | + border-radius:5rpx; | |
| 247 | +} | |
| 248 | +/* 下拉框 */ | |
| 249 | +.top-selected{ | |
| 250 | + width: 100%; | |
| 251 | + display: flex; | |
| 252 | + align-items: center; | |
| 253 | + justify-content: space-between; | |
| 254 | + border: 1px solid #ccc; | |
| 255 | + padding: 0 10rpx; | |
| 256 | + font-size: 30rpx; | |
| 257 | + background:#eeeeee; | |
| 258 | + height:50rpx; | |
| 259 | + border-radius:6rpx; | |
| 260 | + | |
| 261 | +} | |
| 262 | +.texts{ | |
| 263 | + margin:0 auto; | |
| 264 | + font-size: 25rpx; | |
| 265 | +} | |
| 266 | + | |
| 267 | +/* 下拉内容 */ | |
| 268 | +.select-box { | |
| 269 | + background-color: #eeeeee; | |
| 270 | + width:190rpx; | |
| 271 | + position: relative; | |
| 272 | + z-index:1; | |
| 273 | + overflow: hidden; | |
| 274 | + text-align: left; | |
| 275 | + animation: myfirst 0.5s; | |
| 276 | + font-size: 25rpx; | |
| 277 | + border: 1px solid #DADADA; | |
| 278 | +} | |
| 279 | +.select_one { | |
| 280 | + padding-left: 20rpx; | |
| 281 | + width: 100%; | |
| 282 | + height: 60rpx; | |
| 283 | + line-height: 60rpx; | |
| 284 | +} | |
| 285 | +/* 注释 */ | |
| 286 | +.zs{ | |
| 287 | + margin-left: 30rpx; | |
| 288 | + font-size: 25rpx; | |
| 289 | + color: #999999; | |
| 290 | + font-family: 'SimHei',Arial; | |
| 291 | + margin-top: 42rpx; | |
| 292 | + margin-bottom: 30rpx; | |
| 293 | +} | |
| 294 | + | |
| 295 | +.input{ | |
| 296 | + width: 300rpx; | |
| 297 | + background-color: #EEEEEE; | |
| 298 | + border-radius: 10rpx; | |
| 299 | + font-size: 24rpx; | |
| 300 | + text-indent: 5rpx; | |
| 301 | + height: 56rpx; | |
| 302 | + border: 1rpx solid #ccc; | |
| 303 | + | |
| 62 | 304 | } |
| 63 | 305 | \ No newline at end of file | ... | ... |