diff --git a/api/common.js b/api/common.js new file mode 100644 index 0000000..e7c58b9 --- /dev/null +++ b/api/common.js @@ -0,0 +1,5 @@ +import request from './request'; + +export default { + getConfig:()=>request.get('/api/config') +} \ No newline at end of file diff --git a/app.js b/app.js index a78cc8e..53e28e7 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ import userApi from './api/user'; +import commonApi from './api/common'; const token = wx.getStorageSync('accessToken'); -// console.log() -const date = new Date(); +console.log(1) App({ verifyCodeWaitingTime:60, onLaunch() { @@ -14,9 +14,6 @@ App({ }) } }, - onHide(){ - console.log('app on hide'); - }, resetUserInfoUpdateTag(){ this.globalData.userInfoGetTime = null; }, @@ -36,6 +33,16 @@ App({ return data; }, + async getAppConfig(){ + if(!this.globalData.appConfig){ + const data = await commonApi.getConfig(); + this.globalData.appConfig = {}; + data.map((item)=>{ + this.globalData.appConfig[item.key] = item.value; + }) + } + return this.globalData.appConfig; + }, forceGetSummary(){ this.globalData.summaryGetTime = null; @@ -57,7 +64,7 @@ App({ for(var key in rules){ ((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{ let valid = true; - let value = page.data[key].trim(); + let value = (page.data[key]||'').trim(); //非空 if(item.required){ if(value==''){ @@ -82,9 +89,11 @@ App({ [`${key}Message`]:'' }); }else{ - page.setData({ - [`${key}Message`]:item.message - }); + if(item.message){ + page.setData({ + [`${key}Message`]:item.message + }); + } result.push({ [key]:item.message,autoFocus:item.autoFocus,key:key,shake:item.shake }) diff --git a/app.json b/app.json index 4c5da5e..0d9b1ba 100644 --- a/app.json +++ b/app.json @@ -1,8 +1,8 @@ { "pages": [ "pages/index/index", - "pages/order-detail/index", "pages/login/index", + "pages/order-detail/index", "pages/user/info/index", "pages/withdraw/index/index", "pages/withdraw/success/index", @@ -11,11 +11,12 @@ "pages/user/bank/index/index", "pages/user/bank/editor/index", "pages/user/password/index", - "pages/withdraw/list/index" + "pages/withdraw/list/index", + "pages/browser/index" ], "window": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "Weixin", + "navigationBarTitleText": "", "navigationBarBackgroundColor": "#ffffff" }, "style": "v2", diff --git a/assets/icon/eyes-close.png b/assets/icon/eyes-close.png new file mode 100644 index 0000000..e93a573 Binary files /dev/null and b/assets/icon/eyes-close.png differ diff --git a/assets/icon/eyes-open.png b/assets/icon/eyes-open.png new file mode 100644 index 0000000..889a310 Binary files /dev/null and b/assets/icon/eyes-open.png differ diff --git a/assets/icon/fengkuai.png b/assets/icon/fengkuai.png new file mode 100644 index 0000000..68874d4 Binary files /dev/null and b/assets/icon/fengkuai.png differ diff --git a/assets/icon/logo.png b/assets/icon/logo.png new file mode 100644 index 0000000..2c6ee82 Binary files /dev/null and b/assets/icon/logo.png differ diff --git a/components/background-notice/index.js b/components/background-notice/index.js index 516bd24..47675e2 100644 --- a/components/background-notice/index.js +++ b/components/background-notice/index.js @@ -27,7 +27,7 @@ Component({ this.bgam = wx.getBackgroundAudioManager(); this.bgam.title = '后台通知'; this.bgam.audioType = 'music'; - this.bgam.coverImgUrl = 'https://dman-1311994147.cos.ap-chengdu.myqcloud.com/20250227/DoADoEhKi4U4ab75d180b27fa14b7c34ae7969762809_d7ee9018-828e-43c7-8b2b-29d4352c0277.jpg?imageMogr2/thumbnail/800x800/format/webp'; + this.bgam.coverImgUrl = 'https://dman-1311994147.cos.ap-chengdu.myqcloud.com/static/logo_large.jpg'; this.bgam.onEnded(()=>{ this.bgam.src = this.data.emptyAudio; }); diff --git a/components/listView/index.js b/components/listView/index.js index 91f3222..23b2149 100644 --- a/components/listView/index.js +++ b/components/listView/index.js @@ -5,14 +5,14 @@ Component({ * 组件的属性列表 */ properties: { - "bindrefresherrefresh":{ - type:Function - }, - "refresherTriggered":{ + refresherTriggered:{ type:Boolean, value:false }, - height:0, + height:{ + type:Number, + value:0 + }, loadMoreText:{ type:String, value:'已经到底了' diff --git a/components/modalView/index.js b/components/modalView/index.js index da6537a..dc04c14 100644 --- a/components/modalView/index.js +++ b/components/modalView/index.js @@ -34,7 +34,10 @@ Component({ type:String, value:'请输入内容' }, - isShowCancel:true, + isShowCancel:{ + type:Boolean, + value:true + }, cancelButtonText:{ type:String, value:'取消' diff --git a/components/modalView/index.wxml b/components/modalView/index.wxml index 88e54ea..13ebb74 100644 --- a/components/modalView/index.wxml +++ b/components/modalView/index.wxml @@ -9,7 +9,7 @@ {{content}} - + diff --git a/pages/browser/index.js b/pages/browser/index.js new file mode 100644 index 0000000..dd5b56d --- /dev/null +++ b/pages/browser/index.js @@ -0,0 +1,75 @@ +// pages/browser/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + webUrl:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let url = decodeURIComponent(options.url); + if(url.indexOf('?')>-1){ + url = `${url}&random=${Math.random()}` + }else{ + url = `${url}?random=${Math.random()}` + } + console.log(url); + this.setData({ + webUrl:decodeURIComponent(options.url) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/test/audio.json b/pages/browser/index.json similarity index 100% rename from pages/test/audio.json rename to pages/browser/index.json diff --git a/pages/browser/index.wxml b/pages/browser/index.wxml new file mode 100644 index 0000000..87168c3 --- /dev/null +++ b/pages/browser/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/browser/index.wxss b/pages/browser/index.wxss new file mode 100644 index 0000000..e10bd99 --- /dev/null +++ b/pages/browser/index.wxss @@ -0,0 +1 @@ +/* pages/browser/index.wxss */ \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 51da2ed..a399510 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -72,17 +72,17 @@ Page({ }); this.getUserInfo().then(()=>{ + app.getSummary().then((data)=>{ + this.setData({ + summary:data + }); + }); return this.loadStatusDetail(); }).then((data)=>{ return this.loadBuilding(); }).then((data)=>{ this.loadList(); }); - app.getSummary().then((data)=>{ - this.setData({ - summary:data - }); - }); }, findNewOrder(){ // app.forceGetUserInfo().then((data)=>{ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 71922ed..d7dd5dd 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -39,7 +39,13 @@ loading="{{pager.loading}}" load-all="{{pager.loadAll}}"> + class="item {{item.status==orderStatus.unpaid||item.status==orderStatus.completed?'no-btns':''}} {{item.is_first_order?'is-new-order':''}}"> + + 代取快递 + + 送达时间() + + {{pItem.station_name}} {{pItem.pickup_codes.length}} 件 diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 8e90934..1b11fe4 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -42,11 +42,12 @@ gap: 14rpx; font-size: 28rpx; } +.nav-bar .loop-order-switch .switch{ + width:84rpx; +} .nav-bar .loop-order-switch .switch .wx-switch-input{ width:84rpx; height: 48rpx; - --switch-checked-color:red; - --switch-node-size: 16rpx; } .head{ display: flex; @@ -112,16 +113,34 @@ } -.package-list{ -} .package-list .item{ margin:30rpx 16rpx; background-color: #ffffff; border-radius: 18rpx; color: #555555; - padding:56rpx 20rpx 20rpx; + padding:20rpx; position: relative; } +.package-list .item .item-head{ + display: flex; + align-items: center; + justify-content: space-between; + padding-bottom:50rpx; +} +.package-list .item .item-head .tag{ + background-color: rgba(153, 153, 153, 0.1); + border-radius: 12rpx; + padding:16rpx 20rpx; + font-weight: 500; + color:#555555; +} +.package-list .item .item-head .deliver-time{ + color:#222222; +} +.package-list .item .item-head .time{ + color:#ff0000; + font-weight: 500; +} .package-list .item:first-child{ margin-top:0; } @@ -130,27 +149,9 @@ position: absolute; width:1.2rpx; background-color: rgba(85, 85, 85, 0.5); - left:38.5rpx;top:90rpx; + left:38.5rpx;top:160rpx; bottom:250rpx; } -.package-list .item.is-new-order::before{ - top:145rpx; -} -.package-list .item.is-new-order{ - padding-top:110rpx; -} -.package-list .item.is-new-order::after{ - content:'新'; - position: absolute; - right:24rpx;top:0; - width:58rpx;height:58rpx; - line-height: 52rpx; - background-color: #FF0000; - border-radius: 0px 0px 40rpx 40rpx; - text-align: center; - color: #fff; - font-weight: 500; -} .package-list .item.no-btns::before{ bottom:100rpx; } @@ -228,7 +229,18 @@ } .package-list .item .address .sub-title{ font-size: 32rpx; - margin-top:24rpx + margin-top:24rpx; + display:flex; + align-items: center; +} +.package-list .item.is-new-order .address .sub-title::before{ + content:'新'; + background-color:#ff0000; + color:#fff; + font-size: 24rpx; + margin-right: 12rpx; + border-radius: 8rpx; + padding:6rpx 8rpx; } .package-list .item .btns{ diff --git a/pages/login/index.js b/pages/login/index.js index e647044..a4a22f7 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -9,7 +9,10 @@ Page({ data: { phone:'', password:'', - isAgree:false + logining:false, + isAgree:false, + isEyesOpen:false, + appConfig:{} }, /** * 生命周期函数--监听页面加载 @@ -17,15 +20,26 @@ Page({ onLoad(options) { this.validator = { phone:{type:'phone',message:'请输入正确的手机号',shake:true,autoFocus:true}, - password:{required:true,message:'请输入密码',shake:true,autoFocus:true} + password:{minLength:6,message:'请输入 6 位数密码',shake:true,autoFocus:true} } + app.getAppConfig().then((data)=>{ + this.setData({ + appConfig:data + }) + }) }, login(){ if(this.data.isAgree){ const valid = app.validateForm(this.validator,this); console.log(valid,this.validator); if(valid.length==0){ + this.setData({ + logining:true + }) userApi.login(this.data.phone,this.data.password).then((data)=>{ + this.setData({ + logining:false + }) app.globalData.userInfo = data.user; app.globalData.accessToken = data.access_token; wx.setStorage({ @@ -37,10 +51,17 @@ Page({ }) } }) + }).catch(()=>{ + console.log('catch'); + this.setData({ + logining:false + }) }) } }else{ - + app.validateForm({ + shake:{required:true,shake:true} + },this); } }, handleAgreeChange(event){ @@ -48,6 +69,21 @@ Page({ isAgree:!!event.detail }) }, + toggleEyes(){ + this.setData({ + isEyesOpen:!this.data.isEyesOpen + }) + }, + navToAgreement(){ + wx.navigateTo({ + url: `/pages/browser/index?url=${this.data.appConfig.url_user_agreement}`, + }) + }, + navToPrivacy(){ + wx.navigateTo({ + url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`, + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 367d41a..f5b35fa 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -1,19 +1,35 @@