diff --git a/.cloudbase/container/debug.json b/.cloudbase/container/debug.json new file mode 100644 index 0000000..0d44458 --- /dev/null +++ b/.cloudbase/container/debug.json @@ -0,0 +1 @@ +{"containers":[],"config":{}} \ No newline at end of file diff --git a/api/common.js b/api/common.js index addad33..edb7e7f 100644 --- a/api/common.js +++ b/api/common.js @@ -20,21 +20,13 @@ export default { delete:(address_id)=>request.delete(`/api/address/${address_id}`) }, building:{ - list(community_id){ - if(!app){ - app = getApp(); - } - const data = { - community_id, - user_id:app.globalData.userInfo.userid - } - return request.get('/api/community/building/list',{community_id}) - } + list:(community_id)=>request.get('/api/community/building/list',{community_id}) }, station:{ list:(community_id)=>request.get('/api/station',{community_id}) }, uploadImg(file){ + if(!app)app = getApp(); return new Promise((rs,rj)=>{ wx.uploadFile({ filePath: file.tempFilePath, diff --git a/api/request.js b/api/request.js index 41c6d12..2e02806 100644 --- a/api/request.js +++ b/api/request.js @@ -7,20 +7,26 @@ const sendRequest = (options)=>{ wx.request({ url: `${baseUrl}${options.url}`, success:(result)=>{ + //Http Request的状态 if(result.statusCode==200){ + //后端的自定义状态 if(result.data.code==200){ rs(result.data.data); }else{ - wx.showToast({ - icon:'error', - title: result.data.message, - }); + if(!options.options.noTips){ + wx.showToast({ + icon:'error', + title: result.data.message, + }); + } rj(result.data); } }else if(result.statusCode==401){ wx.navigateTo({ url: '/pages/login/login', }) + }else{ + rj(result.data); } }, @@ -42,16 +48,16 @@ const sendRequest = (options)=>{ export default { baseUrl:baseUrl, - get(url,data){ - return sendRequest({url,method:'get',data}); + get(url,data,options){ + return sendRequest({url,method:'get',data,options:options||{}}); }, - post(url,data){ - return sendRequest({url,method:'post',data}); + post(url,data,options){ + return sendRequest({url,method:'post',data,options:options||{}}); }, - put(url,data){ - return sendRequest({url,method:'put',data}); + put(url,data,options){ + return sendRequest({url,method:'put',data,options:options||{}}); }, - delete(url,data){ - return sendRequest({url,method:'delete',data}); + delete(url,data,options){ + return sendRequest({url,method:'delete',data,options:options||{}}); } } \ No newline at end of file diff --git a/api/user.js b/api/user.js index 74116c6..487843f 100644 --- a/api/user.js +++ b/api/user.js @@ -35,7 +35,10 @@ export default { DELIVERY_AT_DOORSTEP:"放在门口", DELIVERY_TO_ROOM:"敲门递件" }, - pre:(data)=>request.post('/api/order/pre-order',data), + /** + * noTips:存在未支付的订单,不需要 toast,然后弹窗跳转订单详情 + * */ + pre:(data)=>request.post('/api/order/pre-order',data,{noTips:true}), real:(data)=>request.post('/api/order',data), list:(data)=>request.get('/api/order/user/list',data), cancel:(orderid)=>request.post(`/api/order/${orderid}/user/cancel`), diff --git a/app.js b/app.js index 297dec2..edfd2ce 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,8 @@ import commonApi from './api/common'; let token = wx.getStorageSync('accessToken'); console.log(12); App({ - onLaunch() { + onLaunch(options) { + console.log(options); wx.getStorage({ key:'accessToken', success:(res)=>{ @@ -12,7 +13,7 @@ App({ }) }, navToLogin(){ - wx.navigateTo({ + wx.reLaunch({ url: '/pages/login/login', }) }, @@ -98,6 +99,71 @@ App({ }, } }, + validateForm(rules,page){ + const result = []; + for(var key in rules){ + ((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{ + let valid = true; + let value = (page.data[key]+'').trim(); + //非空 + if(item.required){ + if(value==''){ + valid = false; + } + }else if(item.length){ + //绝对长度 + if(value.length!=item.length){ + valid = false; + } + }else if(item.type=='phone'){ + if(value.length!=11){ + valid = false; + } + }else if(item.maxLength||item.minLength){ + if(value.length>(item.maxLength||Infinity)||value.lengthitem.autoFocus); + if(focusInput){ + page.setData({ + [`${focusInput.key}Focus`]:true + }) + } + const shakeInput = result.find((item)=>item.shake); + if(shakeInput){ + if(!shakeInput.animation){ + shakeInput.animation = wx.createAnimation({ + duration: 20, + }) + } + shakeInput.animation.translateX(10).step(); + shakeInput.animation.translateX(-10).step(); + shakeInput.animation.translateX(10).step(); + shakeInput.animation.translateX(-10).step(); + shakeInput.animation.translateX(5).step(); + shakeInput.animation.translateX(0).step(); + // needSetData[`${key}Animation`] = item.animation.export(); + page.setData({ + [`${shakeInput.key}Animation`]:shakeInput.animation.export() + }) + } + return result; + }, getAddressList(){ } diff --git a/app.json b/app.json index 7340bb6..421a8f2 100644 --- a/app.json +++ b/app.json @@ -4,7 +4,6 @@ "pages/shop/index/index", "pages/order/index/index", "pages/my/index/index", - "pages/index/index", "pages/login/login", "pages/logs/logs", "pages/help/package/index", @@ -20,9 +19,10 @@ "pages/my/coupon/index", "pages/my/money/index", "pages/my/firend/index", - "pages/my/setting/index", + "pages/my/setting/index/index", "pages/shop/bill/index", - "pages/shop/bill_success/index" + "pages/shop/bill_success/index", + "pages/my/setting/name/index" ], "window": { "navigationBarTextStyle": "black", @@ -33,31 +33,25 @@ "color": "#222222", "selectedColor": "#FFC300", "backgroundColor": "#ffffff", - "borderStyle": "white", + "borderStyle": "black", "list": [ { "pagePath": "pages/help/index/index", - "text": "帮忙", - "iconPath": "assets/icon/tabs/tab1@3x.png", - "selectedIconPath": "assets/icon/tabs/tab1-active@3x.png" - }, - { - "pagePath": "pages/shop/index/index", - "text": "省钱", - "iconPath": "assets/icon/tabs/tab2@3x.png", - "selectedIconPath": "assets/icon/tabs/tab2-active@3x.png" + "text": "蜂快", + "iconPath": "assets/icon/tabs/tab1.png", + "selectedIconPath": "assets/icon/tabs/tab1-active.png" }, { "pagePath": "pages/order/index/index", "text": "订单", - "iconPath": "assets/icon/tabs/tab3@3x.png", - "selectedIconPath": "assets/icon/tabs/tab3-active@3x.png" + "iconPath": "assets/icon/tabs/tab3.png", + "selectedIconPath": "assets/icon/tabs/tab3-active.png" }, { "pagePath": "pages/my/index/index", "text": "我的", - "iconPath": "assets/icon/tabs/tab4@3x.png", - "selectedIconPath": "assets/icon/tabs/tab4-active@3x.png" + "iconPath": "assets/icon/tabs/tab4.png", + "selectedIconPath": "assets/icon/tabs/tab4-active.png" } ] }, @@ -67,8 +61,10 @@ "lazyCodeLoading": "requiredComponents", "permission": { "scope.userLocation": { - "desc": "你的位置信息将用于小程序位置接口的效果展示" + "desc": "将获取你的位置,用于为你提供配送服务" } }, - "requiredPrivateInfos": ["getLocation"] + "requiredPrivateInfos": [ + "getLocation" + ] } \ No newline at end of file diff --git a/app.wxss b/app.wxss index c1860e7..fab7292 100644 --- a/app.wxss +++ b/app.wxss @@ -1,14 +1,15 @@ -@import '/assets/style/weui.wxss'; page{ font-size:32rpx; line-height: 1; - --main-font-color:#222222; + --main-font-color:#000000; --main-bgclolor:#F5F5F5; --main-color:#FEC400; --main-hover-color:#fcce39; color:var(--main-font-color); background-color:var(--main-bgclolor); overflow: hidden; + min-height: 100vh; + box-sizing: border-box; } button{ @@ -34,30 +35,40 @@ button:not([size=mini]) .icon{ button[type=primary]{ background-color:var(--main-color); - color:#222222; + color:var(--main-font-color); } + +button[type=primary]:not([disabled]).button-hover{ + background-color: var(--main-hover-color); + color:var(--main-font-color); +} + button[plain]{ border: 1rpx solid rgba(255, 195, 0, 0.5); color: #FFC300; } -button:not([plain])[type=primary]:hover{ +/* button:not([plain])[type=primary]:hover{ background-color:var(--main-hover-color); -} + color:var(--main-font-color); +} */ button[type=default]{ - color: #333333; + color:var(--main-font-color); font-size:32rpx; line-height: 1; } +button[type=default].button-hover{ + color:#666; +} button[type=primary][plain]{ border-color: var(--main-color); color:var(--main-color); padding:28rpx 25rpx; } -button[type=primary][plain]:hover{ +/* button[type=primary][plain]:hover{ border-color:var(--main-color); color:var(--main-color); -} +} */ button[loading][type=primary] { background-color:var(--main-color); color: hsla(0,0%,100%,.6); @@ -84,8 +95,8 @@ radio-group label+label{ } radio{ - width: 34rpx; - height: 34rpx; + width: 17px; + height: 17px; position: relative; } radio .wx-radio-input{ @@ -94,7 +105,6 @@ radio .wx-radio-input{ box-sizing: border-box; width: 100%; height: 100%; - line-height: 20px; position: absolute; top: 0;left:0; } @@ -102,16 +112,16 @@ radio .wx-radio-input.wx-radio-input-checked{ background-color:transparent; border-color: var(--main-color); } -radio .wx-radio-input.wx-radio-input-checked::before{ +radio .wx-radio-input.wx-radio-input-checked::after{ content: ''; position: absolute; - width: 22rpx; - height:22rpx; - left:4rpx;top:4rpx; + width: 11px; + height:11px; + left:2px;top:2px; border-radius: 50%; background: var(--main-color); transform: none; - -webkit-transform:none + -webkit-transform:none; } checkbox .wx-checkbox-input{ width: 40rpx; @@ -132,7 +142,7 @@ page-container .content{ padding:30rpx; margin:20rpx; } -.page-container.shadow{ +.page-container.shadow,.cells.shadow{ box-shadow: 0px 6px 6px 1px rgba(0, 0, 0, 0.05); } @@ -153,10 +163,10 @@ page-container .content{ border-color:#FFC300; } .spliter{ - border-bottom: 1px solid rgba(153, 153, 153, 0.2); + border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); } .spliter.dashed{ - border-bottom: 1px dashed rgba(153, 153, 153, 0.2); + border-bottom: 1rpx dashed rgba(153, 153, 153, 0.2); } .money,.money-promation,.money-normal,.money-disable{ font-size: 36rpx; @@ -192,12 +202,14 @@ page-container .content{ } .bottom-bar{ - border-radius: 24rpx 24rpx 0 0; - padding:34rpx 40rpx; + padding:24rpx; position:fixed; bottom:0; left:0;right:0; background-color: #fff; + border-top: 0.5px solid rgba(153, 153, 153, 0.2); + padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx); + padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx); } .custom-scroll-view{ height:100vh; @@ -209,10 +221,11 @@ page-container .content{ overflow: auto; } .bottom-bar-v2{ - border-radius: 24rpx 24rpx 0 0; - padding:34rpx 40rpx; + padding:24rpx; background-color: #fff; - text-align: right; + border-top: 0.5px solid rgba(153, 153, 153, 0.2); + padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx); + padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx); } .cells{ @@ -225,7 +238,6 @@ page-container .content{ display: flex; align-items: center; padding:0 40rpx; - min-height: 116rpx; font-size: 30rpx; position: relative; } @@ -234,30 +246,50 @@ page-container .content{ } .cells .cell::after{ content: ''; - border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); + border-bottom: 1.2rpx solid rgba(153, 153, 153, 0.1); position: absolute; bottom:0; left:40rpx; right:40rpx; } -.cells .cell:last-child::after{ +.cells .cell:last-child::after,.cells .cell.no-border::after{ border:0; } .cells .cell-hd{ margin-right:20rpx; } +.cells .cell-hd.not-empty::before{ + content: '*'; + color: #EB0000 +} .cells .cell-hd .icon{ width:40rpx;height:40rpx; vertical-align: middle; } .cells .cell-bd{ flex:1; + display: flex; + align-items: center; + position:relative; + min-height: 116rpx; } -.cells .cell-ft{ +.cells .cell-bd .error{ + color:red; + position: absolute; + left:0;bottom:10rpx; + font-size: 24rpx; +} +.cells .cell-bd input{ + height:100rpx; +} +.cells .cell-ft,.right-arrow{ position: relative; - padding-right:40rpx; + color:#999; } -.cells .cell-ft::after{ +.cells.cells-access .cell-ft,.right-arrow{ + padding-right: 40rpx; +} +.cells.cells-access .cell-ft::after,.cells .cell.cell-access .cell-ft::after,.right-arrow::after{ content:" "; width:24rpx;height:48rpx; -webkit-mask-position:0 0; @@ -333,4 +365,10 @@ navigator button{ } .page-dispatch{ height:40rpx; + width:100%; +} + +.navigator-hover{ + background-color: transparent; + opacity: 1; } \ No newline at end of file diff --git a/assets/icon/help/arrow-down.png b/assets/icon/help/arrow-down.png new file mode 100644 index 0000000..5b4095c Binary files /dev/null and b/assets/icon/help/arrow-down.png differ diff --git a/assets/icon/help/arrow-down@2x.png b/assets/icon/help/arrow-down@2x.png deleted file mode 100644 index da14477..0000000 Binary files a/assets/icon/help/arrow-down@2x.png and /dev/null differ diff --git a/assets/icon/help/delete.png b/assets/icon/help/delete.png new file mode 100644 index 0000000..03fc5d1 Binary files /dev/null and b/assets/icon/help/delete.png differ diff --git a/assets/icon/help/delete@2x.png b/assets/icon/help/delete@2x.png deleted file mode 100644 index 8c524c4..0000000 Binary files a/assets/icon/help/delete@2x.png and /dev/null differ diff --git a/assets/icon/help/house.png b/assets/icon/help/house.png new file mode 100644 index 0000000..dfed73a Binary files /dev/null and b/assets/icon/help/house.png differ diff --git a/assets/icon/help/house@2x.png b/assets/icon/help/house@2x.png deleted file mode 100644 index 913e97e..0000000 Binary files a/assets/icon/help/house@2x.png and /dev/null differ diff --git a/assets/icon/help/icon1.png b/assets/icon/help/icon1.png index d532ac7..bd843f9 100644 Binary files a/assets/icon/help/icon1.png and b/assets/icon/help/icon1.png differ diff --git a/assets/icon/help/icon2.png b/assets/icon/help/icon2.png index df6bf7d..0e89c14 100644 Binary files a/assets/icon/help/icon2.png and b/assets/icon/help/icon2.png differ diff --git a/assets/icon/help/icon3.png b/assets/icon/help/icon3.png index 06a2af7..5eb5699 100644 Binary files a/assets/icon/help/icon3.png and b/assets/icon/help/icon3.png differ diff --git a/assets/icon/help/images.png b/assets/icon/help/images.png new file mode 100644 index 0000000..87bbd45 Binary files /dev/null and b/assets/icon/help/images.png differ diff --git a/assets/icon/help/plus.png b/assets/icon/help/plus.png new file mode 100644 index 0000000..22fa391 Binary files /dev/null and b/assets/icon/help/plus.png differ diff --git a/assets/icon/help/plus@2x.png b/assets/icon/help/plus@2x.png deleted file mode 100644 index d7a6a90..0000000 Binary files a/assets/icon/help/plus@2x.png and /dev/null differ diff --git a/assets/icon/my/avatar.png b/assets/icon/my/avatar.png new file mode 100644 index 0000000..3a2ce32 Binary files /dev/null and b/assets/icon/my/avatar.png differ diff --git a/assets/icon/my/friend-empty.png b/assets/icon/my/friend-empty.png new file mode 100644 index 0000000..b381d5f Binary files /dev/null and b/assets/icon/my/friend-empty.png differ diff --git a/assets/icon/my/login-bg.png b/assets/icon/my/login-bg.png new file mode 100644 index 0000000..b815fcb Binary files /dev/null and b/assets/icon/my/login-bg.png differ diff --git a/assets/icon/tabs/tab1-active@3x.png b/assets/icon/tabs/_tab1-active@3x.png similarity index 100% rename from assets/icon/tabs/tab1-active@3x.png rename to assets/icon/tabs/_tab1-active@3x.png diff --git a/assets/icon/tabs/tab1@3x.png b/assets/icon/tabs/_tab1@3x.png similarity index 100% rename from assets/icon/tabs/tab1@3x.png rename to assets/icon/tabs/_tab1@3x.png diff --git a/assets/icon/tabs/tab1-active.png b/assets/icon/tabs/tab1-active.png new file mode 100644 index 0000000..b0a8abf Binary files /dev/null and b/assets/icon/tabs/tab1-active.png differ diff --git a/assets/icon/tabs/tab1-active@2x.png b/assets/icon/tabs/tab1-active@2x.png deleted file mode 100644 index 2187bdd..0000000 Binary files a/assets/icon/tabs/tab1-active@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab1.png b/assets/icon/tabs/tab1.png new file mode 100644 index 0000000..c6f438c Binary files /dev/null and b/assets/icon/tabs/tab1.png differ diff --git a/assets/icon/tabs/tab1@2x.png b/assets/icon/tabs/tab1@2x.png deleted file mode 100644 index 531ece3..0000000 Binary files a/assets/icon/tabs/tab1@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab2-active@3x.png b/assets/icon/tabs/tab2-active.png similarity index 100% rename from assets/icon/tabs/tab2-active@3x.png rename to assets/icon/tabs/tab2-active.png diff --git a/assets/icon/tabs/tab2-active@2x.png b/assets/icon/tabs/tab2-active@2x.png deleted file mode 100644 index 7a23c6f..0000000 Binary files a/assets/icon/tabs/tab2-active@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab2@3x.png b/assets/icon/tabs/tab2.png similarity index 100% rename from assets/icon/tabs/tab2@3x.png rename to assets/icon/tabs/tab2.png diff --git a/assets/icon/tabs/tab2@2x.png b/assets/icon/tabs/tab2@2x.png deleted file mode 100644 index a4f9c1e..0000000 Binary files a/assets/icon/tabs/tab2@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab3-active@3x.png b/assets/icon/tabs/tab3-active.png similarity index 100% rename from assets/icon/tabs/tab3-active@3x.png rename to assets/icon/tabs/tab3-active.png diff --git a/assets/icon/tabs/tab3-active@2x.png b/assets/icon/tabs/tab3-active@2x.png deleted file mode 100644 index 3b351b9..0000000 Binary files a/assets/icon/tabs/tab3-active@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab3@3x.png b/assets/icon/tabs/tab3.png similarity index 100% rename from assets/icon/tabs/tab3@3x.png rename to assets/icon/tabs/tab3.png diff --git a/assets/icon/tabs/tab3@2x.png b/assets/icon/tabs/tab3@2x.png deleted file mode 100644 index fb9df43..0000000 Binary files a/assets/icon/tabs/tab3@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab4-active@3x.png b/assets/icon/tabs/tab4-active.png similarity index 100% rename from assets/icon/tabs/tab4-active@3x.png rename to assets/icon/tabs/tab4-active.png diff --git a/assets/icon/tabs/tab4-active@2x.png b/assets/icon/tabs/tab4-active@2x.png deleted file mode 100644 index 5b6759f..0000000 Binary files a/assets/icon/tabs/tab4-active@2x.png and /dev/null differ diff --git a/assets/icon/tabs/tab4@3x.png b/assets/icon/tabs/tab4.png similarity index 100% rename from assets/icon/tabs/tab4@3x.png rename to assets/icon/tabs/tab4.png diff --git a/assets/icon/tabs/tab4@2x.png b/assets/icon/tabs/tab4@2x.png deleted file mode 100644 index 3949d2e..0000000 Binary files a/assets/icon/tabs/tab4@2x.png and /dev/null differ diff --git a/components/address/index.js b/components/address/index.js deleted file mode 100644 index a1eeb6b..0000000 --- a/components/address/index.js +++ /dev/null @@ -1,148 +0,0 @@ -import commonApi from '../../api/common'; -const app = getApp(); - -Component({ - - /** - * 组件的属性列表 - */ - properties: { - saveText:{ - type:String, - value:"保存" - }, - deleteText:{ - type:String, - value:'' - }, - communityId:{ - type:Number, - value:null - } - }, - - /** - * 组件的初始数据 - */ - data: { - buildingList:[], - buildingIndex:0, - communityList:[], - communityIndex:0, - - currentEditAddress:{}, - name:'', - gender:'', - phone:'', - community_building_id:'', - address_detail:'' - }, - lifetimes:{ - attached(){ - if(app.globalData.tempAddress){ - this.setData({ - currentEditAddress:app.globalData.tempAddress, - name:app.globalData.tempAddress.name, - gender:app.globalData.tempAddress.gender, - phone:app.globalData.tempAddress.phone, - community_building_id:app.globalData.tempAddress.community_building_id, - address_detail:app.globalData.tempAddress.address_detail - }) - } - commonApi.community.list().then((data)=>{ - let communityIndex; - this.setData({ - communityList:data.items - }); - data.items.map((item,index)=>{ - if(item.id==this.data.currentEditAddress.id){ - communityIndex = index; - } - }) - - //没有找到 id 就是新增,就去找默认的社区进行填充 - if(communityIndex){ - this.getBuildingList(); - }else{ - for(let [index,item] of data.items.entries()){ - if(item.id==this.properties.communityId){ - this.setData({ - communityIndex:index - }); - } - } - this.getBuildingList(); - } - }); - // console.log(app.globalData.tempAddress); - } - }, - /** - * 组件的方法列表 - */ - methods: { - save(){ - - - this.triggerEvent('save'); - let data = { - community_id:this.data.communityList[this.data.communityIndex].id, - community_building_id:this.data.buildingList[this.data.buildingIndex].id, - address_detail:this.data.address_detail, - name:this.data.name, - gender:this.data.gender, - phone:this.data.phone - } - console.log(data); - if(this.data.currentEditAddress&&this.data.currentEditAddress.id){ - //编辑 - data.id = this.data.currentEditAddress.id; - commonApi.address.update(data); - }else{ - //新增 - data.is_default = true; - commonApi.address.add(data).then((data)=>{ - const pages = getCurrentPages(); - const prePage = pages[pages.length-2]; - prePage.changeAddress(data); - wx.navigateBack({ - success(){ - wx.showToast({ - title: '新增成功', - icon:'success' - }); - } - }); - }); - } - }, - getBuildingList(){ - const current = this.data.communityList[this.data.communityIndex]; - commonApi.building.list(current.id).then((data)=>{ - let buildingIndex = 0; - data.items.map((item,index)=>{ - item.displayText = `${item.community_name} ${item.building_name}`; - if(item.id==this.data.currentEditAddress.id){ - buildingIndex = index; - } - }); - this.setData({ - buildingList:data.items, - buildingIndex - }) - }); - }, - del(){ - this.triggerEvent('delete') - }, - chooseCommonity(event){ - this.setData({ - communityIndex:event.detail.value - }) - }, - buildingChange(event){ - const buildingIndex = event.detail.value; - this.setData({buildingIndex}); - } - } -}) \ No newline at end of file diff --git a/components/address/index.json b/components/address/index.json deleted file mode 100644 index c07b0d2..0000000 --- a/components/address/index.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "component": true, - "usingComponents": {}, - "styleIsolation": "shared" -} \ No newline at end of file diff --git a/components/address/index.wxml b/components/address/index.wxml deleted file mode 100644 index c3566cc..0000000 --- a/components/address/index.wxml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/components/address/index.wxss b/components/address/index.wxss deleted file mode 100644 index 4edea08..0000000 --- a/components/address/index.wxss +++ /dev/null @@ -1,42 +0,0 @@ -.page-container.editor{ - padding-top:0; - font-size: 30rpx; -} -.editor .item{ - display: flex; - align-items: center; - border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); - min-height: 130rpx; -} -.editor .item.no-border{ - border:none; -} - -.editor .item .key{ -} -.editor .item .key::before{ - content: '*'; - color: #EB0000; -} -.editor .item label.value{ - line-height: 1.5; - height: auto; - align-self: center; -} -.editor .item .value{ - flex:1; - margin-left: 30rpx; - height: 100%; - padding:15rpx 0; - box-sizing: border-box; -} -.editor .item .right-icon{ - width:34rpx;height:34rpx; -} - -.editor .radio-group{ - font-size: 24rpx; -} -.editor button+button{ - margin-top:30rpx; -} \ No newline at end of file diff --git a/components/listView/index.js b/components/listView/index.js index 5178677..bbbc8b6 100644 --- a/components/listView/index.js +++ b/components/listView/index.js @@ -12,9 +12,7 @@ Component({ type:Boolean, value:false }, - "height":{ - type:Number - }, + height:0, loadMoreText:{ type:String, value:'已经到底了' @@ -26,6 +24,10 @@ Component({ loadAll:{ type:Boolean, value:false + }, + class:{ + type:String, + value:'' } }, @@ -33,14 +35,15 @@ Component({ * 组件的初始数据 */ data: { - defaultHeight:'' + heightStyle:'', + scrollHeight:0 }, lifetimes:{ attached(){ + this.createSelectorQuery().select('#scrollView').boundingClientRect((res)=>{ + this.data.scrollHeight = res.height; + }).exec(); const windowInfo = wx.getWindowInfo(); - this.setData({ - defaultHeight:`calc(100vh)` - }) } }, /** @@ -52,10 +55,25 @@ Component({ }, scrolling(event){ //scrollTop scrollHeight - const bottomHeight = event.detail.scrollHeight-event.detail.scrollTop-this.properties.height; + const bottomHeight = event.detail.scrollHeight-event.detail.scrollTop-this.data.scrollHeight; if(bottomHeight<100){ this.triggerEvent('loadMore'); } } + }, + observers:{ + height(h){ + let heightStyle = ''; + if(h){ + if(typeof h == 'string'){ + heightStyle = `height:${h}` + }else{ + heightStyle = `height:${this.properties.height*2}rpx` + } + this.setData({ + heightStyle:heightStyle + }) + } + } } }) \ No newline at end of file diff --git a/components/listView/index.json b/components/listView/index.json index e8cfaaf..8b37bbf 100644 --- a/components/listView/index.json +++ b/components/listView/index.json @@ -1,4 +1,5 @@ { "component": true, - "usingComponents": {} + "usingComponents": {}, + "styleIsolation": "apply-shared" } \ No newline at end of file diff --git a/components/listView/index.wxml b/components/listView/index.wxml index 3b044a7..3fc1a33 100644 --- a/components/listView/index.wxml +++ b/components/listView/index.wxml @@ -1,4 +1,4 @@ - + diff --git a/components/listView/index.wxss b/components/listView/index.wxss index 6c9d683..b83fa71 100644 --- a/components/listView/index.wxss +++ b/components/listView/index.wxss @@ -1,5 +1,8 @@ +.scroll-view{ + height:100%; +} .load-more{ - padding:100rpx 0; + padding:56rpx 0 80rpx 0; text-align: center; color: #888888; font-size:24rpx; @@ -14,8 +17,8 @@ .load-more::before{ content: ''; position: absolute; - left:0;top:112rpx; - width:100%;height:1.5rpx; + left:0;top:68rpx; + width:100%;height:1rpx; background-color: rgba(136, 136, 136, 0.25); z-index: -1; } \ No newline at end of file diff --git a/components/navbar/index.js b/components/navbar/index.js index 28d0974..14aeef4 100644 --- a/components/navbar/index.js +++ b/components/navbar/index.js @@ -49,5 +49,8 @@ Component({ }, share(){ }, + getHeight(){ + return this.data.statusBarHeight + this.data.navBarHeight; + } } }) \ No newline at end of file diff --git a/pages/help/address/edit/index.js b/pages/help/address/edit/index.js index 709ae58..3a433a8 100644 --- a/pages/help/address/edit/index.js +++ b/pages/help/address/edit/index.js @@ -1,5 +1,5 @@ import commonApi from '../../../../api/common'; - +const app = getApp(); Page({ @@ -21,6 +21,12 @@ Page({ community_building_id:'', address_detail:'' }, + validator:{ + name:{required:true,message:'请输入姓名',shake:true,autoFocus:true}, + phone:{type:'phone',message:'请输入正确的手机号',shake:true,autoFocus:true}, + buildingIndex:{required:true,message:'请选择楼栋',shake:true,autoFocus:true}, + address_detail:{required:true,message:'请输入详细地址',shake:true,autoFocus:true} + }, deleteAddress(){ wx.showModal({ title: '确定删除此地址吗', @@ -80,6 +86,11 @@ Page({ } }, save(){ + const valid = app.validateForm(this.validator,this); + console.log(valid); + if(valid.length!=0){ + return; + } let data = { community_id:this.data.communityId, community_building_id:this.data.buildingList[this.data.buildingIndex].id, diff --git a/pages/help/address/edit/index.json b/pages/help/address/edit/index.json index 82cadae..9bbacbe 100644 --- a/pages/help/address/edit/index.json +++ b/pages/help/address/edit/index.json @@ -1,6 +1,5 @@ { "usingComponents": { - "address-editor":"/components/address" }, "navigationBarTitleText": "编辑地址" } \ No newline at end of file diff --git a/pages/help/address/edit/index.wxml b/pages/help/address/edit/index.wxml index ada1aef..b894923 100644 --- a/pages/help/address/edit/index.wxml +++ b/pages/help/address/edit/index.wxml @@ -1,45 +1,64 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + 用户姓名 + + + {{nameMessage}} + + + + + + - - - - - - + + + + 手机号码 + + + {{phoneMessage}} + + + + + 选择楼栋 + + + {{buildingIndexMessage}} + + + + + + 详细地址 + + + {{address_detailMessage}} + + + + + + \ No newline at end of file diff --git a/pages/help/address/edit/index.wxss b/pages/help/address/edit/index.wxss index 9985e68..13d98de 100644 --- a/pages/help/address/edit/index.wxss +++ b/pages/help/address/edit/index.wxss @@ -2,43 +2,19 @@ padding-top:0; font-size: 30rpx; } -.editor .item{ - display: flex; - align-items: center; - border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); - min-height: 130rpx; -} -.editor .item.no-border{ - border:none; -} - -.editor .item .key{ -} -.editor .item .key::before{ - content: '*'; - color: #EB0000; -} -.editor .item label.value{ - line-height: 1.5; - height: auto; - align-self: center; -} -.editor .item .value{ - flex:1; - margin-left: 30rpx; - height: 100%; - box-sizing: border-box; -} -.editor .item .value .input{ - padding:15rpx 0; -} -.editor .item .right-icon{ - width:34rpx;height:34rpx; -} - .editor .radio-group{ font-size: 24rpx; } -.editor button+button{ - margin-top:30rpx; +.radio-group{ + color:var(--main-font-color); +} +.radio-group .item{ + padding:20rpx 0; +} +.button{ + margin:30rpx!important; +} +.picker input{ + width:100%; + flex: 1; } \ No newline at end of file diff --git a/pages/help/address/index/index.js b/pages/help/address/index/index.js index c9f9702..7488e77 100644 --- a/pages/help/address/index/index.js +++ b/pages/help/address/index/index.js @@ -10,7 +10,8 @@ Page({ addressList:[], communityId:null, communityName:'', - genderKV:userApi.genderKV + genderKV:userApi.genderKV, + loading:true }, /** @@ -34,9 +35,12 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { + wx.showNavigationBarLoading(); commonApi.address.list(this.data.communityId).then((data)=>{ + wx.hideNavigationBarLoading(); this.setData({ - addressList:data + addressList:data, + loading:false }) }); }, diff --git a/pages/help/address/index/index.json b/pages/help/address/index/index.json index 8252772..7473e22 100644 --- a/pages/help/address/index/index.json +++ b/pages/help/address/index/index.json @@ -1,6 +1,5 @@ { "usingComponents": { - "address-editor":"/components/address" }, "navigationBarTitleText": "收件人信息" } \ No newline at end of file diff --git a/pages/help/address/index/index.wxml b/pages/help/address/index/index.wxml index 6b72dfb..0b4af2c 100644 --- a/pages/help/address/index/index.wxml +++ b/pages/help/address/index/index.wxml @@ -1,8 +1,6 @@ - - 常用地址 - + {{item.community_name}} {{item.community_building_name}} {{item.address_detail}} @@ -12,7 +10,8 @@ capture-catch:tap="goToAddressEditor" data-item="{{item}}"/> - + 加载中... + 该小区暂无常用地址 使用过的地址会在这里显示 diff --git a/pages/help/address/index/index.wxss b/pages/help/address/index/index.wxss index 3d7bc6f..8a46214 100644 --- a/pages/help/address/index/index.wxss +++ b/pages/help/address/index/index.wxss @@ -35,4 +35,9 @@ } .add-button{ margin: 40rpx 20rpx!important; +} +.loading{ + padding:50rpx; + text-align: center; + color: #999999; } \ No newline at end of file diff --git a/pages/help/community/index.js b/pages/help/community/index.js index 10bdaf6..a95c24a 100644 --- a/pages/help/community/index.js +++ b/pages/help/community/index.js @@ -61,7 +61,8 @@ Page({ }); const data = { skip:this.data.pager.limit*this.data.pager.pageIndex, - limit:this.data.pager.limit + limit:this.data.pager.limit, + status:'OPENING' } if(this.data.lng&&this.data.lat){ data.longitude = this.data.lng; diff --git a/pages/help/community/index.wxml b/pages/help/community/index.wxml index 1500ce2..d26f9f4 100644 --- a/pages/help/community/index.wxml +++ b/pages/help/community/index.wxml @@ -1,12 +1,11 @@ - + diff --git a/pages/help/community/index.wxss b/pages/help/community/index.wxss index 8086726..86bd698 100644 --- a/pages/help/community/index.wxss +++ b/pages/help/community/index.wxss @@ -1,4 +1,9 @@ -.community-list{} +.community-list{ + position:absolute; + left:0;top:0; + width: 100%; + height:100vh; +} .community-list .item{ border-radius: 18rpx; background-color: #fff; diff --git a/pages/help/index/index.js b/pages/help/index/index.js index 2a1f764..67246ce 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -27,13 +27,18 @@ Page({ preOrdering:false, ordering:false, - genderKV:userApi.genderKV + genderKV:userApi.genderKV, + navBarHeight:0 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { + let height = this.selectComponent("#navBar").getHeight(); + this.setData({ + navBarHeight:height + }) this.setData({ isLogin:!!app.globalData.accessToken }) @@ -130,6 +135,21 @@ Page({ }) }, preOrder(event){ + let msg = ''; + if(!(this.data.currentCommunity&&this.data.currentCommunity.id)){ + msg = '选择小区'; + } + if(!(this.data.currentAddress&&this.data.currentAddress.id)){ + msg = '选择送达地址'; + } + if(msg){ + wx.showToast({ + title:msg, + duration:1000, + icon:'none' + }); + return; + } if(this.data.preOrdering)return; wx.getStorage({ key:'pre-order', @@ -143,12 +163,31 @@ Page({ preOrdering:false, preOrder:data }); + }).catch((data)=>{ + if(data.code==400&&data.data&&data.data.orderid){ + wx.showModal({ + title: '你有订单未支付', + content: '', + confirmText:'去支付', + complete: (res) => { + if (res.confirm) { + wx.navigateTo({ + url: `/pages/order/detail/index?id=${data.data.orderid}`, + }) + } + } + }) + } + this.setData({ + preOrdering:false + }); }) }, fail(){ wx.showToast({ - icon:'error', - title: '请选择驿站' + icon:'none', + duration:1000, + title: '选择取件驿站' }) } }) diff --git a/pages/help/index/index.wxml b/pages/help/index/index.wxml index a11fa8c..19ad3a6 100644 --- a/pages/help/index/index.wxml +++ b/pages/help/index/index.wxml @@ -1,6 +1,8 @@ - - + + + + @@ -9,15 +11,17 @@ currentCommunity.id?currentCommunity.name:'请选择小区' }} - + - + + {{currentAddress.community_name}} + {{currentAddress.community_building_name}} {{currentAddress.address_detail}} @@ -32,13 +36,14 @@ - + + {{package.name}} 共计 {{package.count}} 个包裹 - 选择驿站 + 选择取件驿站 @@ -54,7 +59,7 @@ - 蜂蜜抵扣 + 安全保障 @@ -113,6 +118,6 @@ {{preOrder.price_detail_text}} - + \ No newline at end of file diff --git a/pages/help/index/index.wxss b/pages/help/index/index.wxss index 1f24355..5e7e512 100644 --- a/pages/help/index/index.wxss +++ b/pages/help/index/index.wxss @@ -5,6 +5,14 @@ position:absolute; z-index:-1; } +.bg .image{ + width: 396rpx; + height:140rpx; + position: absolute; + right:20rpx; + top:260rpx; + padding-top:90rpx; +} .nav-bar .logo{ width:168rpx; height:42rpx; @@ -42,7 +50,19 @@ } .address-panel .ap-item .icon{ width:40rpx;height:40rpx; - margin-top:4rpx + margin-top:4rpx; + color:#fff; + border-radius: 50%; + font-size: 24rpx; + font-weight: 500; + text-align: center; + line-height: 40rpx; +} +.address-panel .ap-item .icon.send{ + background-color: #000000; +} +.address-panel .ap-item .icon.get{ + background-color: var(--main-color); } .address-panel .ap-item .text{ flex:1; @@ -56,7 +76,7 @@ font-weight: 500; } .address-panel .ap-item .text .sub-title{ - color:#7C8695; + color: #999999; font-size: 28rpx; margin-top:22rpx; min-height: 28rpx; @@ -82,7 +102,7 @@ vertical-align: middle; } .address-panel .bottom .text{ - color: #7C8695; + color: #999999; font-size: 24rpx; margin-left: 8rpx; display: inline-block; @@ -114,7 +134,7 @@ .promotion-panel .text .sub-title{ font-size: 28rpx; - color: #7C8695; + color: #999999; margin-top:26rpx; } .promotion-panel .button{ diff --git a/pages/help/package/index.js b/pages/help/package/index.js index e04ccbd..d1de686 100644 --- a/pages/help/package/index.js +++ b/pages/help/package/index.js @@ -13,18 +13,16 @@ Page({ bottomBarButtonTap(){ const data = []; - let hasPackage = false; this.data.stationList.map((item)=>{ if(item.package.length>0&&item.package[0]!=''){ - hasPackage = true; + data.push({ + station_id:item.id, + station_name:item.name, + pickup_codes:item.package.filter((item)=>item!='').join(',') + }); } - data.push({ - station_id:item.id, - station_name:item.name, - pickup_codes:item.package.filter((item)=>item!='').join(',') - }); }) - if(hasPackage){ + if(data.length>0){ wx.setStorage({ key:'pre-order', data:{ @@ -52,9 +50,13 @@ Page({ if(!this.data.stationList[index].package){ this.data.stationList[index].package = []; } - this.data.stationList[index].package.push(''); + let hasEmptyInput = this.data.stationList[index].package.find((item)=>item=='')==undefined; + if(hasEmptyInput){ + this.data.stationList[index].package.push(''); + } + this.data.stationList[index].focus = true; this.setData({ - stationList:this.data.stationList + [`stationList[${index}]`]:this.data.stationList[index] }); }, deletePackage(event){ @@ -62,7 +64,7 @@ Page({ const packageIndex = event.currentTarget.dataset.p_index; this.data.stationList[itemIndex].package.splice(packageIndex,1); this.setData({ - stationList:this.data.stationList + [`stationList[${itemIndex}].package`]:this.data.stationList[itemIndex].package }) }, setPackageCode(event){ @@ -79,22 +81,29 @@ Page({ wx.getStorage({ key:'pre-order', success:(res)=>{ - data.items.map((item)=>{ + data.items.map((item,index)=>{ const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id); - item.package = __item.pickup_codes.split(',')||['']; + if(__item){ + item.package = __item.pickup_codes.split(',')||[]; + } }); this.setData({ sendType:res.data.delivery_method, stationList:data.items - }) + }); } }); data.items.map((item)=>{ - item.package = ['']; + item.package = []; }); this.setData({ stationList:data.items - }) + }); + wx.nextTick(()=>{ + this.setData({ + [`stationList[0].focus`]:true + }) + }); }); }, diff --git a/pages/help/package/index.wxml b/pages/help/package/index.wxml index df8590b..ed4dd3f 100644 --- a/pages/help/package/index.wxml +++ b/pages/help/package/index.wxml @@ -1,42 +1,58 @@ + + + + + 快捷下单 + + + 上传取件信息图片时,图片需清晰显示取件位置信息 + + + + - - - {{item.name}} - {{item.service_text}} + + + {{item.name}} + + + {{item.service_text}} - + - + + 投递方式 - - + \ No newline at end of file diff --git a/pages/help/package/index.wxss b/pages/help/package/index.wxss index 18b383f..151c31e 100644 --- a/pages/help/package/index.wxss +++ b/pages/help/package/index.wxss @@ -2,32 +2,42 @@ } .page-container .head{ - display: flex; padding-bottom:14rpx; } .page-container .head .icon{ width:40rpx;height:40rpx; - -} -.page-container .head .text{ - flex:1; - padding-left:10rpx; + margin-right: 20rpx; } .page-container .head .title{ - font-size: 34rpx; + font-size: 36rpx; + font-weight: 500; + display: flex; + align-items: center; } .page-container .head .sub-title{ font-size:26rpx; color: #888888; margin-top:24rpx; + padding-left:60rpx; } .page-container>.button{ margin-top:20rpx; + border-radius: 12rpx; + background: rgba(124, 134, 149, 0.08); } -.page-container .radio{ +.send-way .radio{ display: flex; - justify-content: space-around; + justify-content: space-between; + padding-top:30rpx; +} + +.send-way .title{ + font-size: 34prx; + font-weight: 500; +} +.send-way .radio .item{ + padding:14rpx 30rpx; } @@ -65,4 +75,8 @@ .package-list .item .icon{ width:36rpx;height:36rpx; +} + +.img-area.page-container .head .sub-title{ + padding-left:0; } \ No newline at end of file diff --git a/pages/help/success/index.wxml b/pages/help/success/index.wxml index 5e0890d..41fdf3d 100644 --- a/pages/help/success/index.wxml +++ b/pages/help/success/index.wxml @@ -2,5 +2,5 @@ 恭喜下单成功 {{successText}} - + \ No newline at end of file diff --git a/pages/help/success/index.wxss b/pages/help/success/index.wxss index c97fd36..a4490b1 100644 --- a/pages/help/success/index.wxss +++ b/pages/help/success/index.wxss @@ -10,9 +10,9 @@ page{ margin-top:320rpx; } .title{ - font-size: 40rpx; + font-size: 44rpx; font-weight: 500; - color:#222222; + color:var(--main-color); margin-top:50rpx; } .sub-title{ @@ -21,7 +21,11 @@ page{ margin-top:40rpx; } .button{ + border: 1.2rpx solid #999999!important; + color:var(--main-font-color)!important; + font-weight: normal; border-radius: 60rpx; padding:19rpx!important; - margin:90rpx!important; + margin:90rpx auto!important; + width:438rpx!important; } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js deleted file mode 100644 index a8d6aa5..0000000 --- a/pages/index/index.js +++ /dev/null @@ -1,49 +0,0 @@ -// index.js -const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0' - -Page({ - data: { - motto: 'Hello World', - userInfo: { - avatarUrl: defaultAvatarUrl, - nickName: '', - }, - hasUserInfo: false, - canIUseGetUserProfile: wx.canIUse('getUserProfile'), - canIUseNicknameComp: wx.canIUse('input.type.nickname'), - }, - bindViewTap() { - wx.navigateTo({ - url: '../logs/logs' - }) - }, - onChooseAvatar(e) { - const { avatarUrl } = e.detail - const { nickName } = this.data.userInfo - this.setData({ - "userInfo.avatarUrl": avatarUrl, - hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, - }) - }, - onInputChange(e) { - const nickName = e.detail.value - const { avatarUrl } = this.data.userInfo - this.setData({ - "userInfo.nickName": nickName, - hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, - }) - }, - getUserProfile(e) { - // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 - wx.getUserProfile({ - desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - console.log(res) - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - }, -}) diff --git a/pages/index/index.json b/pages/index/index.json deleted file mode 100644 index b55b5a2..0000000 --- a/pages/index/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": { - } -} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml deleted file mode 100644 index 5116494..0000000 --- a/pages/index/index.wxml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - 昵称1 - - - - - - 请使用2.10.4及以上版本基础库 - - - - {{userInfo.nickName}} - - - - {{motto}} - - - - - 123 - 123 - 123 - - diff --git a/pages/index/index.wxss b/pages/index/index.wxss deleted file mode 100644 index 1ebed4b..0000000 --- a/pages/index/index.wxss +++ /dev/null @@ -1,62 +0,0 @@ -/**index.wxss**/ -page { - height: 100vh; - display: flex; - flex-direction: column; -} -.scrollarea { - flex: 1; - overflow-y: hidden; -} - -.userinfo { - display: flex; - flex-direction: column; - align-items: center; - color: #aaa; - width: 80%; -} - -.userinfo-avatar { - overflow: hidden; - width: 128rpx; - height: 128rpx; - margin: 20rpx; - border-radius: 50%; -} - -.usermotto { - margin-top: 200px; -} - -.avatar-wrapper { - padding: 0; - width: 56px !important; - border-radius: 8px; - margin-top: 40px; - margin-bottom: 40px; -} - -.avatar { - display: block; - width: 56px; - height: 56px; -} - -.nickname-wrapper { - display: flex; - width: 100%; - padding: 16px; - box-sizing: border-box; - border-top: .5px solid rgba(0, 0, 0, 0.1); - border-bottom: .5px solid rgba(0, 0, 0, 0.1); - color: black; -} - -.nickname-label { - width: 105px; -} - -.nickname-input { - flex: 1; -} diff --git a/pages/login/login.js b/pages/login/login.js index 6c0657b..1a927ba 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -4,27 +4,18 @@ const app = getApp(); Page({ data: { isAgree: false, - loging:false + loging:false, + animation:null }, - - handleAgreeChange(e) { + radioChange(event){ this.setData({ - isAgree: e.detail.value.length > 0 + isAgree:event.detail.value!='' }) }, - - onLogin() { - if (!this.data.isAgree) { - wx.showToast({ - title: '请先同意用户协议和隐私政策', - icon: 'none' - }) - return - } - + preLogin(){ + this.shake(); }, getPhoneNumber(event){ - console.log(event); if(!event.detail.code){ //未接受 return; @@ -61,5 +52,22 @@ Page({ } }) }) + }, + shake(){ + if(!this.animation){ + this.animation = wx.createAnimation({ + duration: 20, + }) + } + this.animation.translateX(10).step(); + this.animation.translateX(-10).step(); + this.animation.translateX(10).step(); + this.animation.translateX(-10).step(); + this.animation.translateX(5).step(); + this.animation.translateX(0).step(); + // needSetData[`${key}Animation`] = item.animation.export(); + this.setData({ + animation:this.animation.export() + }) } -}) \ No newline at end of file +}) \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml index dacd383..9873c7e 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -2,12 +2,15 @@ - + - - - @@ -20,7 +19,7 @@ {{item.coupon_name}} 有效期至 {{item.expire_time}} - {{item.coupon_amount}} + {{item.coupon_amount}} @@ -29,8 +28,7 @@ - @@ -39,7 +37,7 @@ {{item.coupon_name}} 有效期至 {{item.expire_time}} - {{item.coupon_amount}} + {{item.coupon_amount}} @@ -48,8 +46,7 @@ - @@ -58,7 +55,7 @@ {{item.coupon_name}} 有效期至 {{item.expire_time}} - {{item.coupon_amount}} + {{item.coupon_amount}} diff --git a/pages/my/coupon/index.wxss b/pages/my/coupon/index.wxss index d1958e3..ada7f9e 100644 --- a/pages/my/coupon/index.wxss +++ b/pages/my/coupon/index.wxss @@ -1,3 +1,9 @@ +.coupon-list{ + position: absolute; + top:114rpx; + left:0;height:calc(100vh - 114rpx); + width:100%; +} .coupon-list .item{ display: flex; margin:20rpx; @@ -12,13 +18,11 @@ flex:1; } .coupon-list .item .name{ - font-size: 34rpx; - font-weight: 500; + font-size: 36rpx; } .coupon-list .item .desc{ - font-weight: 26rpx; color: #888888; - margin-top:40rpx; + margin-top:44rpx; } .coupon-list .item .money{ font-size:54rpx; diff --git a/pages/my/firend/index.wxml b/pages/my/firend/index.wxml index 356c67e..9e3e9c3 100644 --- a/pages/my/firend/index.wxml +++ b/pages/my/firend/index.wxml @@ -1,5 +1,4 @@ - @@ -14,6 +13,7 @@ + 暂无邻友 \ No newline at end of file diff --git a/pages/my/firend/index.wxss b/pages/my/firend/index.wxss index 59a56ae..8fb4666 100644 --- a/pages/my/firend/index.wxss +++ b/pages/my/firend/index.wxss @@ -1,4 +1,9 @@ +.firend-list{ + position:absolute; + top:0;left:0; + width:100%;height:100vh; +} .firend-list .item{ display: flex; margin:20rpx; @@ -26,4 +31,12 @@ } .firend-list .item .status{ color:var(--main-color) +} + +.list-empty{ + padding-top:480rpx; +} +.list-empty .sub-title{ + margin-top:30rpx; + font-size: 30rpx; } \ No newline at end of file diff --git a/pages/my/index/index.wxml b/pages/my/index/index.wxml index cc0b446..c230d08 100644 --- a/pages/my/index/index.wxml +++ b/pages/my/index/index.wxml @@ -3,13 +3,15 @@ bindrefresherpulling="scrollViewPulling" bindrefresherrestore="scrollViewPullingOver" refresher-background="var(--main-color)"> @@ -23,17 +25,29 @@ - - + + + + + 邀请好友下单 + + + 邀请邻友领券下单,自己再得1张跑腿券 + + diff --git a/pages/my/index/index.wxss b/pages/my/index/index.wxss index aa71a53..d62c719 100644 --- a/pages/my/index/index.wxss +++ b/pages/my/index/index.wxss @@ -10,13 +10,13 @@ .user-info .content{ display: flex; align-items: center; - margin:218rpx 40rpx 0 46rpx; + margin:218rpx 40rpx 0 40rpx; position: relative; z-index: 1; } .user-info .content .avatar{ - width:112rpx;height:112rpx; + width:120rpx;height:120rpx; border: 2px solid #FFFFFF; border-radius: 50%; } @@ -27,7 +27,7 @@ margin-left:30rpx; } .user-info .content .setting{ - background-color: #fff; + background: rgba(255, 255, 255, 0.9); width:66rpx;height:66rpx; border-radius: 50%; display: flex; @@ -58,30 +58,35 @@ } .property .item .value{ font-size:56rpx; - font-weight: bold; + font-weight: 600; } .invite-cell{ - display:flex; - justify-content: space-between; + padding:40rpx 40rpx 36rpx 40rpx; + background-color: #fff; + margin:20rpx; + border-radius: 20rpx; } -.invite-cell .spec{ +.invite-cell .title{ + display: flex; + align-items: center; +} +.invite-cell .title .text{ + margin-left:20rpx; + flex:1; +} +.invite-cell .icon{ + width:40rpx;height:40rpx; +} +.invite-cell .sub-title{ font-size: 26rpx; - position: relative; - color:var(--main-color); -} -.invite-cell .spec::before{ - content:''; - position: absolute; - bottom: -16rpx; - background: rgba(153, 153, 153, 0.2); - width:100%; - height: 8rpx; + color: #888888; + margin-top:30rpx; + padding-left:60rpx; } .cell.is-button{ background-color: #fff; font-weight: normal; - text-align: left; } .cell.is-button:hover{ background-color: #fff; diff --git a/pages/my/money/index.wxml b/pages/my/money/index.wxml index 5fdad46..fb21a19 100644 --- a/pages/my/money/index.wxml +++ b/pages/my/money/index.wxml @@ -1,24 +1,25 @@ - - 蜂蜜 (克) - {{userInfo.points}} - 取快递自动抵扣 - + + + 蜂蜜 (克) + {{userInfo.points}} + 取快递自动抵扣 + - - - - {{item.description}} - {{item.create_time}} + + + + {{item.description}} + {{item.create_time}} + + {{item.points}} - {{item.points}} - - - - 暂无蜂蜜 - - \ No newline at end of file + + + 暂无蜂蜜 + + + \ No newline at end of file diff --git a/pages/my/money/index.wxss b/pages/my/money/index.wxss index e54e958..0846f15 100644 --- a/pages/my/money/index.wxss +++ b/pages/my/money/index.wxss @@ -13,6 +13,7 @@ .consume .point{ font-size: 70rpx; margin-top:40rpx; + font-weight: 600; } .consume .tips{ position:absolute; @@ -24,9 +25,6 @@ padding:0 16rpx; } -.money-list{ - margin-top:46rpx; -} .money-list .item{ display: flex; margin:20rpx; diff --git a/pages/my/setting/index.js b/pages/my/setting/index/index.js similarity index 75% rename from pages/my/setting/index.js rename to pages/my/setting/index/index.js index db9d5e1..bde0b26 100644 --- a/pages/my/setting/index.js +++ b/pages/my/setting/index/index.js @@ -1,6 +1,6 @@ const app = getApp(); -import userApi from '../../../api/user'; -import commonApi from '../../../api/common'; +import userApi from '../../../../api/user'; +import commonApi from '../../../../api/common'; Page({ @@ -18,12 +18,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.setData({ - isShowPopup:false, - name:app.globalData.userInfo.nickname, - inputName:app.globalData.userInfo.nickname, - avatar:app.globalData.userInfo.avatar - }) }, saveName(){ this.saveUser(); @@ -54,9 +48,17 @@ Page({ count:1, mediaType:'image', success:(res)=>{ - commonApi.uploadImg(res.tempFiles[0]).then((data)=>{ - this.saveUser(data.url); - }); + console.log(res); + wx.cropImage({ + cropScale: '1:1', + src: res.tempFiles[0].tempFilePath, + success:(_res)=>{ + commonApi.uploadImg(_res).then((data)=>{ + this.saveUser(data.url); + }); + } + }) + return; } }); }, @@ -65,6 +67,16 @@ Page({ isShowPopup:true }); }, + logout(){ + wx.removeStorage({ + key: 'accessToken', + success(){ + wx.reLaunch({ + url: '/pages/login/login', + }) + } + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ @@ -76,7 +88,12 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + this.setData({ + isShowPopup:false, + name:app.globalData.userInfo.nickname, + inputName:app.globalData.userInfo.nickname, + avatar:app.globalData.userInfo.avatar + }) }, /** diff --git a/pages/my/setting/index.json b/pages/my/setting/index/index.json similarity index 100% rename from pages/my/setting/index.json rename to pages/my/setting/index/index.json diff --git a/pages/my/setting/index.wxml b/pages/my/setting/index/index.wxml similarity index 72% rename from pages/my/setting/index.wxml rename to pages/my/setting/index/index.wxml index 9ad4ba6..23a8171 100644 --- a/pages/my/setting/index.wxml +++ b/pages/my/setting/index/index.wxml @@ -1,17 +1,19 @@ - + 修改头像 - + 修改昵称 - {{name}} - + + {{name}} + + - + 隐私政策 @@ -21,6 +23,7 @@ + diff --git a/pages/my/setting/index.wxss b/pages/my/setting/index/index.wxss similarity index 51% rename from pages/my/setting/index.wxss rename to pages/my/setting/index/index.wxss index e6218ef..44c2efb 100644 --- a/pages/my/setting/index.wxss +++ b/pages/my/setting/index/index.wxss @@ -17,4 +17,17 @@ height:88rpx; line-height: 88rpx; flex: 1; +} +.cells .cell-ft .text{ + color:var(--main-font-color); +} + +.logout-btn{ + margin:40rpx 20rpx 20rpx!important; + padding:38rpx 0!important; + line-height: 1; + background-color: rgba(153, 153, 153, 0.15)!important; + font-size: 32rpx; + font-weight: normal; + color: #666666!important; } \ No newline at end of file diff --git a/pages/my/setting/name/index.js b/pages/my/setting/name/index.js new file mode 100644 index 0000000..6d4a887 --- /dev/null +++ b/pages/my/setting/name/index.js @@ -0,0 +1,95 @@ +import userApi from '../../../../api/user'; +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + name:'', + userInfo:{}, + loading:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + app.getUserInfo().then((data)=>{ + this.setData({ + userInfo:data, + name:data.nickname + }) + }) + }, + save(){ + if(this.data.name==this.data.userInfo.nickname||this.data.name==''){ + return; + } + if(this.data.loading)return; + this.setData({ + loading:true + }) + userApi.updateUser({nickname:this.data.name}).then((data)=>{ + return app.forceGetUserInfo(); + }).then((data)=>{ + console.log(app.globalData.userInfo); + wx.navigateBack({ + success(){ + wx.showToast({ + title: '更新成功', + }); + } + }); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/my/setting/name/index.json b/pages/my/setting/name/index.json new file mode 100644 index 0000000..ed2289c --- /dev/null +++ b/pages/my/setting/name/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "修改昵称" +} \ No newline at end of file diff --git a/pages/my/setting/name/index.wxml b/pages/my/setting/name/index.wxml new file mode 100644 index 0000000..1d038c8 --- /dev/null +++ b/pages/my/setting/name/index.wxml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/pages/my/setting/name/index.wxss b/pages/my/setting/name/index.wxss new file mode 100644 index 0000000..e2a9adf --- /dev/null +++ b/pages/my/setting/name/index.wxss @@ -0,0 +1,14 @@ +.page-container{ + height:160rpx; + display: flex; + align-items: center; + padding:0 40rpx; +} +.page-container .input{ + height:100rpx; + flex: 1; + font-size: 36rpx; +} +.save-btn{ + margin:40rpx 20rpx!important; +} \ No newline at end of file diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index a525229..42e280a 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -14,7 +14,8 @@ Page({ scrollViewHeight:0, - refresherTriggered:true + refresherTriggered:true, + genderKV:userApi.genderKV }, /** @@ -49,19 +50,38 @@ Page({ title: '你确定取消此订单吗?', complete: (res) => { if (res.confirm) { - userApi.order.cancel(this.data.orderDetail.order.orderid).then(()=>{ - this.getOrderDetail(this.data.orderDetail.order.orderid); + userApi.order.cancel(this.data.orderDetail.orderid).then(()=>{ + wx.showToast({ + title: '取消成功', + }) + this.getOrderDetail(); const pages = getCurrentPages(); const prePage = pages[pages.length-2]; - prePage.loadOrderList(); + prePage.refreshList(); }); } } }) }, + //订单更改后上一个页面如果是订单列表,就刷新 + refreshOrderList(){ + const pages = getCurrentPages(); + const prePage = pages[pages.length-2]; + if(prePage&&prePage.refreshList){ + prePage.refreshList(); + } + }, + pay(){ + const merchantPay = this.selectComponent('#merchantOrderComponent'); + merchantPay.createPayment(this.data.orderDetail.orderid,true); + }, + paySuccess(){ + this.refreshOrderList(); + this.getOrderDetail(); + }, copyOrderId(){ wx.setClipboardData({ - data: this.data.orderDetail.order.orderid, + data: this.data.orderDetail.orderid, }) }, handleContact(e){ @@ -71,7 +91,19 @@ Page({ }, makePhoneCall(){ wx.makePhoneCall({ - phoneNumber: this.data.orderDetail.order.deliveryman_phone, + phoneNumber: this.data.orderDetail.deliveryman_phone, + }) + }, + preview(event){ + const current = event.currentTarget.dataset.url; + wx.previewImage({ + current:current, + urls: this.data.orderDetail.complete_images, + }) + }, + orderAgain(){ + wx.switchTab({ + url: '/pages/help/index/index', }) }, /** diff --git a/pages/order/detail/index.json b/pages/order/detail/index.json index 781f718..11e155f 100644 --- a/pages/order/detail/index.json +++ b/pages/order/detail/index.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "merchant-order":"/components/merchantOrder" + }, "navigationBarTitleText": "订单详情" } \ No newline at end of file diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml index 18c1bce..fcc857c 100644 --- a/pages/order/detail/index.wxml +++ b/pages/order/detail/index.wxml @@ -1,86 +1,115 @@ - - {{orderStatusKV[orderDetail.order.status]}} - - 跑腿员 - - - - - {{orderDetail.order.deliveryman_nickname}} - 已安全送达{{orderDetail.order.delivery_count}}件 - - - - - - 送货地址 - - {{orderDetail.order.community_name}}{{orderDetail.order.address_detail}} - {{orderDetail.order.address_name}} {{orderDetail.order.address_phone}} - - - - 取件信息 - - - - - - + + + {{orderStatusKV[orderDetail.status]}} + + 配送员 - - {{item.station_name}} 共{{item.pickup_codes.length}}件包裹 - - {{package}} + + + + {{orderDetail.deliveryman_nickname}} + 已安全送达{{orderDetail.delivery_count}}件 + + + + + + 送货地址 + + + {{orderDetail.community_name}} + {{orderDetail.building_name}} + {{orderDetail.address_detail}} + + + {{orderDetail.address_name}} + {{genderKV[orderDetail.address_gender]}} + {{orderDetail.address_phone}} + + + + + 取件信息 + + + - - - - - 送达方式 - {{orderDeliverStatusKV[orderDetail.order.delivery_method]}} + + + + {{item.station_name}} 共{{item.pickup_codes.length}}件包裹 + + {{package}} + + + + + + + 送达方式 + {{orderDeliverStatusKV[orderDetail.delivery_method]}} + - - - 订单信息 - - - 订单编号 - {{orderDetail.order.orderid}} - - 复制 + + + 送达图片 + + + + - - 提交时间 - {{orderDetail.order.create_time}} - - - 取件数量 - {{orderDetail.totalPackage}} - - - 跑腿费用 - - - {{orderDetail.order.original_amount-orderDetail.order.coupon_discount_amount}} + + + 订单信息 + + + 订单编号 + {{orderDetail.orderid}} + + 复制 + + + + 提交时间 + {{orderDetail.create_time}} + + + 取件数量 + {{orderDetail.totalPackage}} + + + 跑腿费用 + + + {{orderDetail.original_amount-orderDetail.coupon_discount_amount}} + + 先享后付 - 先享后付 + + + + + + + + + - - - - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss index 2efb9e2..9ffda18 100644 --- a/pages/order/detail/index.wxss +++ b/pages/order/detail/index.wxss @@ -48,6 +48,7 @@ } .sender .info .avatar{ width:100rpx;height:100rpx; + border-radius: 50%; } .sender .info .center{ margin-left:24rpx; @@ -136,28 +137,45 @@ padding:0 10rpx; margin-left: 32rpx; } -.bottom-bar{ - text-align: right; +.bottom-bar-v2{ } -.bottom-bar .button{ +.bottom-bar-v2 .btns{ + display: flex; + gap: 30rpx; + align-items: center; + justify-content:flex-end; +} +.bottom-bar-v2 .pay{ + flex:1 +} +.bottom-bar-v2 .button{ line-height: 72rpx; padding:0 36rpx; font-weight: normal; border-radius: 18rpx; + margin:0; } -.bottom-bar .button1{ +.bottom-bar-v2 .button1{ color: #555555; border: 1rpx solid rgba(153, 153, 153, 0.5); font-size: 32rpx; } -.bottom-bar .button2{ +.bottom-bar-v2 .button2{ font-size: 32rpx; - margin-left:30rpx; -} -.patch{ - padding-bottom:200rpx; } .send-way .left{ padding:10rpx 0; +} + +.photos .spliter{ + margin:24rpx 0; +} +.photos .imgs{ + display: flex; + gap: 16rpx; +} +.photos .imgs .image{ + width:140rpx;height:140rpx; + border-radius: 10rpx; } \ No newline at end of file diff --git a/pages/order/index/index.js b/pages/order/index/index.js index c7a9484..dfa1de6 100644 --- a/pages/order/index/index.js +++ b/pages/order/index/index.js @@ -72,12 +72,6 @@ Page({ this.loadOrderList(); this.loadMerchantOrderList(); this.loadMerchantPayOrderList(); - - const windowInfo = wx.getWindowInfo(); - this.setData({ - scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44-57 - }) - }, refreshList(){ if(this.data.tabIndex==0){ @@ -229,7 +223,6 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - }, /** diff --git a/pages/order/index/index.json b/pages/order/index/index.json index d68591d..a9b8806 100644 --- a/pages/order/index/index.json +++ b/pages/order/index/index.json @@ -4,5 +4,5 @@ "merchant-order":"/components/merchantOrder", "list-view":"/components/listView" }, - "navigationStyle": "custom" + "navigationBarTitleText": "我的订单" } \ No newline at end of file diff --git a/pages/order/index/index.wxml b/pages/order/index/index.wxml index ba95dca..ed337d6 100644 --- a/pages/order/index/index.wxml +++ b/pages/order/index/index.wxml @@ -1,6 +1,6 @@ - + - + + @@ -133,4 +134,4 @@ - \ No newline at end of file + diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index e2f728c..b46de85 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -1,6 +1,11 @@ .nav-bar{ background-color: #fff; } +.order-list{ + position:absolute; + top:0;height:100vh; + width:100%; +} .order-list .item{ background-color: #fff; border-radius: 18rpx; @@ -193,4 +198,4 @@ font-size: 36rpx; font-weight: 500; color:var(--main-color) -} \ No newline at end of file +}