diff --git a/api/common.js b/api/common.js index f1b802d..addad33 100644 --- a/api/common.js +++ b/api/common.js @@ -40,7 +40,7 @@ export default { filePath: file.tempFilePath, name: 'file', header:{ - Authorization: `Bearer ${token}` + Authorization: `Bearer ${token||app.globalData.accessToken}` }, url: request.baseUrl+'/api/upload/image', success:(res)=>{ diff --git a/api/request.js b/api/request.js index 1df8e60..41c6d12 100644 --- a/api/request.js +++ b/api/request.js @@ -7,10 +7,20 @@ const sendRequest = (options)=>{ wx.request({ url: `${baseUrl}${options.url}`, success:(result)=>{ - if(result.data.code==200){ - rs(result.data.data); - }else{ - rj(result.data) + if(result.statusCode==200){ + if(result.data.code==200){ + rs(result.data.data); + }else{ + wx.showToast({ + icon:'error', + title: result.data.message, + }); + rj(result.data); + } + }else if(result.statusCode==401){ + wx.navigateTo({ + url: '/pages/login/login', + }) } }, diff --git a/api/shop.js b/api/shop.js index 02bda2e..677174b 100644 --- a/api/shop.js +++ b/api/shop.js @@ -29,7 +29,7 @@ export default { merchantPay:(merchant_id,amount)=>request.post('/api/merchant-pay',{merchant_id,amount}), merchantOrderStatusKV:{ - CREATED:'已下单',UNVERIFIED:'未核销',VERIFIED:'已核销',REFUNDING:'退款中',REFUNDED:'已退款' + CREATED:'待支付',UNVERIFIED:'待核销',VERIFIED:'已核销',REFUNDING:'退款中',REFUNDED:'已退款' }, merchantOrderStatus:{ created:'CREATED',unverified:'UNVERIFIED',verified:'VERIFIED',refunding:'REFUNDING',refunded:'REFUNDED' diff --git a/api/user.js b/api/user.js index 4927cf8..74116c6 100644 --- a/api/user.js +++ b/api/user.js @@ -1,6 +1,9 @@ import request from './request'; export default { + genderKV:{ + MALE:'先生',FEMALE:'女士' + }, getPhoneByCode(code){ return request.post('/api/user/send-code',{}) }, @@ -21,13 +24,17 @@ export default { }, order:{ statusKV:{ - CREATED:'已创建',CANCELLED:'已取消',RECEIVED:'已接单', + CREATED:'待接单',CANCELLED:'已取消',RECEIVED:'已接单', DELIVERING:'配送中',UNPAID:'未支付',COMPLETED:'已完成' }, status:{ created:'CREATED',cancelled:'CANCELLED',received:'RECEIVED', delivering:'DELIVERING',unpaid:'UNPAID',completed:'COMPLETED' }, + orderDeliverStatusKV:{ + DELIVERY_AT_DOORSTEP:"放在门口", + DELIVERY_TO_ROOM:"敲门递件" + }, pre:(data)=>request.post('/api/order/pre-order',data), real:(data)=>request.post('/api/order',data), list:(data)=>request.get('/api/order/user/list',data), @@ -42,7 +49,8 @@ export default { return request.get(`/api/merchant/order/${order_id}`,data); }, orderQRCode:(order_id)=>request.get(`/api/merchant/order/${order_id}/verify-qrcode`), - detail:(orderid)=>request.get(`/api/order/${orderid}`) + detail:(orderid)=>request.get(`/api/order/${orderid}`), + merchantRefund:(order_id)=>request.post(`/api/merchant/order/${order_id}/refund/apply`) }, coupon:{ status:{ diff --git a/app.js b/app.js index 35458cb..297dec2 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,7 @@ import userApi from './api/user'; import commonApi from './api/common'; let token = wx.getStorageSync('accessToken'); +console.log(12); App({ onLaunch() { wx.getStorage({ diff --git a/app.json b/app.json index 45e2a8e..7340bb6 100644 --- a/app.json +++ b/app.json @@ -38,26 +38,26 @@ { "pagePath": "pages/help/index/index", "text": "帮忙", - "iconPath": "assets/icon/tabs/tab1@2x.png", - "selectedIconPath": "assets/icon/tabs/tab1-active@2x.png" + "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@2x.png", - "selectedIconPath": "assets/icon/tabs/tab2-active@2x.png" + "iconPath": "assets/icon/tabs/tab2@3x.png", + "selectedIconPath": "assets/icon/tabs/tab2-active@3x.png" }, { "pagePath": "pages/order/index/index", "text": "订单", - "iconPath": "assets/icon/tabs/tab3@2x.png", - "selectedIconPath": "assets/icon/tabs/tab3-active@2x.png" + "iconPath": "assets/icon/tabs/tab3@3x.png", + "selectedIconPath": "assets/icon/tabs/tab3-active@3x.png" }, { "pagePath": "pages/my/index/index", "text": "我的", - "iconPath": "assets/icon/tabs/tab4@2x.png", - "selectedIconPath": "assets/icon/tabs/tab4-active@2x.png" + "iconPath": "assets/icon/tabs/tab4@3x.png", + "selectedIconPath": "assets/icon/tabs/tab4-active@3x.png" } ] }, diff --git a/app.wxss b/app.wxss index fd44146..c1860e7 100644 --- a/app.wxss +++ b/app.wxss @@ -193,13 +193,27 @@ page-container .content{ .bottom-bar{ border-radius: 24rpx 24rpx 0 0; - padding:24rpx 24rpx 84rpx; + padding:34rpx 40rpx; position:fixed; bottom:0; left:0;right:0; background-color: #fff; } - +.custom-scroll-view{ + height:100vh; + display: flex; + flex-direction: column; +} +.custom-scroll-view .main{ + flex:1; + overflow: auto; +} +.bottom-bar-v2{ + border-radius: 24rpx 24rpx 0 0; + padding:34rpx 40rpx; + background-color: #fff; + text-align: right; +} .cells{ margin:20rpx; @@ -316,4 +330,7 @@ navigator button{ .scroll-view-dispatch{ height:100rpx; +} +.page-dispatch{ + height:40rpx; } \ No newline at end of file diff --git a/assets/icon/navbar/lanfeng@2x.png b/assets/icon/navbar/lanfeng@2x.png index 3a22197..882086b 100644 Binary files a/assets/icon/navbar/lanfeng@2x.png and b/assets/icon/navbar/lanfeng@2x.png differ diff --git a/assets/icon/tabs/tab1-active@3x.png b/assets/icon/tabs/tab1-active@3x.png new file mode 100644 index 0000000..0e44315 Binary files /dev/null and b/assets/icon/tabs/tab1-active@3x.png differ diff --git a/assets/icon/tabs/tab1@3x.png b/assets/icon/tabs/tab1@3x.png new file mode 100644 index 0000000..0ce5f8f Binary files /dev/null and b/assets/icon/tabs/tab1@3x.png differ diff --git a/assets/icon/tabs/tab2-active@3x.png b/assets/icon/tabs/tab2-active@3x.png new file mode 100644 index 0000000..0a7eb0e Binary files /dev/null and b/assets/icon/tabs/tab2-active@3x.png differ diff --git a/assets/icon/tabs/tab2@3x.png b/assets/icon/tabs/tab2@3x.png new file mode 100644 index 0000000..470d7e1 Binary files /dev/null and b/assets/icon/tabs/tab2@3x.png differ diff --git a/assets/icon/tabs/tab3-active@3x.png b/assets/icon/tabs/tab3-active@3x.png new file mode 100644 index 0000000..27a4713 Binary files /dev/null and b/assets/icon/tabs/tab3-active@3x.png differ diff --git a/assets/icon/tabs/tab3@3x.png b/assets/icon/tabs/tab3@3x.png new file mode 100644 index 0000000..180b106 Binary files /dev/null and b/assets/icon/tabs/tab3@3x.png differ diff --git a/assets/icon/tabs/tab4-active@3x.png b/assets/icon/tabs/tab4-active@3x.png new file mode 100644 index 0000000..0806571 Binary files /dev/null and b/assets/icon/tabs/tab4-active@3x.png differ diff --git a/assets/icon/tabs/tab4@3x.png b/assets/icon/tabs/tab4@3x.png new file mode 100644 index 0000000..315ffc4 Binary files /dev/null and b/assets/icon/tabs/tab4@3x.png differ diff --git a/assets/imgs/for_test/1.jpg b/assets/imgs/for_test/1.jpg deleted file mode 100644 index fe33050..0000000 Binary files a/assets/imgs/for_test/1.jpg and /dev/null differ diff --git a/assets/imgs/for_test/2.jpg b/assets/imgs/for_test/2.jpg deleted file mode 100644 index 4f1e914..0000000 Binary files a/assets/imgs/for_test/2.jpg and /dev/null differ diff --git a/assets/imgs/for_test/avatar.png b/assets/imgs/for_test/avatar.png deleted file mode 100644 index 397dc49..0000000 Binary files a/assets/imgs/for_test/avatar.png and /dev/null differ diff --git a/assets/imgs/for_test/jd.png b/assets/imgs/for_test/jd.png deleted file mode 100644 index 282503d..0000000 Binary files a/assets/imgs/for_test/jd.png and /dev/null differ diff --git a/assets/imgs/for_test/woman.png b/assets/imgs/for_test/woman.png deleted file mode 100644 index e25b8d2..0000000 Binary files a/assets/imgs/for_test/woman.png and /dev/null differ diff --git a/assets/imgs/login/main.jpg b/assets/imgs/login/main.jpg new file mode 100644 index 0000000..05a4284 Binary files /dev/null and b/assets/imgs/login/main.jpg differ diff --git a/assets/imgs/login/text1.png b/assets/imgs/login/text1.png new file mode 100644 index 0000000..3b21057 Binary files /dev/null and b/assets/imgs/login/text1.png differ diff --git a/assets/imgs/login/text2.png b/assets/imgs/login/text2.png new file mode 100644 index 0000000..0b96b6d Binary files /dev/null and b/assets/imgs/login/text2.png differ diff --git a/components/merchantOrder/index.js b/components/merchantOrder/index.js index 6d798db..239933e 100644 --- a/components/merchantOrder/index.js +++ b/components/merchantOrder/index.js @@ -33,35 +33,38 @@ Component({ }, getOrder(){ shopApi.order(this.data.product.id).then((data)=>{ - userApi.createPayment(data.order_id,'PRODUCT').then((data)=>{ - this.triggerEvent('orderCreated'); - wx.requestPayment({ - timeStamp:data.payment_params.timeStamp, - nonceStr:data.payment_params.nonceStr, - package:data.payment_params.package, - signType:data.payment_params.signType, - paySign:data.payment_params.paySign, - success:(res)=>{ - wx.navigateTo({ - url: '/pages/shop/success/index', - }) - }, - fail:(res)=>{ - console.log(res); - } - }) + this.setData({ + isShowConfirm:false }); + this.triggerEvent('orderCreated'); + this.createPayment(data.order_id); }).catch((error)=>{ this.setData({ isShowConfirm:false }) - wx.showModal({ - title: error.message, - showCancel:false, - complete: (res) => { + }); + }, + createPayment(orderId,needStay){ + userApi.createPayment(orderId,'PRODUCT').then((data)=>{ + wx.requestPayment({ + timeStamp:data.payment_params.timeStamp, + nonceStr:data.payment_params.nonceStr, + package:data.payment_params.package, + signType:data.payment_params.signType, + paySign:data.payment_params.paySign, + success:(res)=>{ + this.triggerEvent('paySuccess'); + if(!needStay){ + wx.navigateTo({ + url: '/pages/shop/success/index', + }) + } + }, + fail:(res)=>{ + console.log(res); } }) }); - }, + } } }) \ No newline at end of file diff --git a/components/shopItem/index.wxml b/components/shopItem/index.wxml index 627e198..c8de064 100644 --- a/components/shopItem/index.wxml +++ b/components/shopItem/index.wxml @@ -9,7 +9,7 @@ - + diff --git a/components/shopItem/index.wxss b/components/shopItem/index.wxss index f5ee4a0..f3f6aba 100644 --- a/components/shopItem/index.wxss +++ b/components/shopItem/index.wxss @@ -3,6 +3,7 @@ } .shop-item .logo{ width:180rpx;height:180rpx; + border-radius: 18rpx; } .shop-item .content{ flex:1; diff --git a/pages/help/address/edit/index.js b/pages/help/address/edit/index.js index e86e31a..709ae58 100644 --- a/pages/help/address/edit/index.js +++ b/pages/help/address/edit/index.js @@ -16,7 +16,7 @@ Page({ addressDetail:{}, name:'', - gender:'', + gender:'MALE', phone:'', community_building_id:'', address_detail:'' @@ -28,6 +28,7 @@ Page({ complete: (res) => { if (res.confirm) { commonApi.address.delete(this.data.addressDetail.id).then(()=>{ + this.updateAddressIndex(); wx.navigateBack({ success(){ wx.showToast({ @@ -91,6 +92,7 @@ Page({ //编辑 data.id = this.data.addressDetail.id; commonApi.address.update(data).then((data)=>{ + this.updateAddressIndex(); wx.navigateBack({ success(){ wx.showToast({ @@ -102,12 +104,8 @@ Page({ }); }else if(this.data.editType=='add'){ //新增 - data.is_default = true; - commonApi.address.add(data).then((data)=>{ - // const pages = getCurrentPages(); - // const prePage = pages[pages.length-2]; - // prePage.changeAddress(data); + this.updateAddressIndex(); wx.navigateBack({ delta:2, success(){ @@ -120,6 +118,11 @@ Page({ }); } }, + updateAddressIndex(){ + const pages = getCurrentPages(); + const prePage = pages[pages.length-3]; + prePage.data.manuallyChangedCommunity = false; + }, getBuildingList(){ commonApi.building.list(this.data.communityId).then((data)=>{ let buildingIndex = 0; diff --git a/pages/help/address/edit/index.wxml b/pages/help/address/edit/index.wxml index 8d35f21..ada1aef 100644 --- a/pages/help/address/edit/index.wxml +++ b/pages/help/address/edit/index.wxml @@ -9,7 +9,9 @@ - + + + - - + diff --git a/pages/help/address/edit/index.wxss b/pages/help/address/edit/index.wxss index 4edea08..9985e68 100644 --- a/pages/help/address/edit/index.wxss +++ b/pages/help/address/edit/index.wxss @@ -27,9 +27,11 @@ flex:1; margin-left: 30rpx; height: 100%; - padding:15rpx 0; box-sizing: border-box; } +.editor .item .value .input{ + padding:15rpx 0; +} .editor .item .right-icon{ width:34rpx;height:34rpx; } diff --git a/pages/help/address/index/index.js b/pages/help/address/index/index.js index 0882174..c9f9702 100644 --- a/pages/help/address/index/index.js +++ b/pages/help/address/index/index.js @@ -1,4 +1,5 @@ import commonApi from '../../../../api/common'; +import userApi from '../../../../api/user'; const app = getApp(); Page({ @@ -8,7 +9,8 @@ Page({ data: { addressList:[], communityId:null, - communityName:'' + communityName:'', + genderKV:userApi.genderKV }, /** diff --git a/pages/help/address/index/index.wxml b/pages/help/address/index/index.wxml index beb3358..6b72dfb 100644 --- a/pages/help/address/index/index.wxml +++ b/pages/help/address/index/index.wxml @@ -5,8 +5,8 @@ - {{item.address_detail}} - {{item.name}} {{item.phone}} + {{item.community_name}} {{item.community_building_name}} {{item.address_detail}} + {{item.name}} {{genderKV[item.gender]}} {{item.phone}} @@ -17,4 +17,4 @@ 使用过的地址会在这里显示 - \ No newline at end of file + \ No newline at end of file diff --git a/pages/help/address/index/index.wxss b/pages/help/address/index/index.wxss index ad57cfa..3d7bc6f 100644 --- a/pages/help/address/index/index.wxss +++ b/pages/help/address/index/index.wxss @@ -2,15 +2,21 @@ .address-list{ - padding-top:36rpx + padding-top:36rpx; + padding-bottom:20rpx; } .address-list .head{ font-size:34rpx; font-weight:500; + padding-bottom:20rpx; } .address-list .item{ display: flex; - margin-top:60rpx; + padding:40rpx 0; + border-bottom: 1.2rpx solid rgba(153, 153, 153, 0.2); +} +.address-list .item:last-child{ + border-bottom:0; } .address-list .item .text{ flex:1; diff --git a/pages/help/community/index.js b/pages/help/community/index.js index 561ba7b..10bdaf6 100644 --- a/pages/help/community/index.js +++ b/pages/help/community/index.js @@ -43,6 +43,14 @@ Page({ this.loadList(); }) }, + refreshList(){ + this.data.pager.loadAll = false; + this.data.pager.pageIndex = 0; + this.setData({ + pager:this.data.pager + }); + this.loadList(); + }, loadList(){ if(this.data.pager.loading||this.data.pager.loadAll){ return; diff --git a/pages/help/index/index.js b/pages/help/index/index.js index da082d1..2a1f764 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -22,7 +22,12 @@ Page({ isShowOrderConfirm:false, preOrder:{}, - manuallyChangedCommunity:false + manuallyChangedCommunity:false, + + preOrdering:false, + ordering:false, + + genderKV:userApi.genderKV }, /** @@ -70,6 +75,7 @@ Page({ }) } }); + console.log('manuallyChangedCommunity',this.data.manuallyChangedCommunity); if(!this.data.manuallyChangedCommunity){ app.forceGetUserInfo().then((data)=>{ if(data.default_address){ @@ -80,6 +86,10 @@ Page({ }, currentAddress:data.default_address }) + }else{ + this.setData({ + currentAddress:null + }) } }) } @@ -108,6 +118,9 @@ Page({ manuallyChangedCommunity:true }); this.getAddress(community.id); + wx.removeStorage({ + key: 'pre-order', + }) }, changeAddress(address){ //手动设置地址之后,由于同时设置了默认地址,所以标记改为 false 便于找当前显示的地址 @@ -116,41 +129,64 @@ Page({ manuallyChangedCommunity:false }) }, - preOrder(){ + preOrder(event){ + if(this.data.preOrdering)return; wx.getStorage({ key:'pre-order', success:(res)=>{ + this.setData({preOrdering:true}); userApi.order.pre({ packages:res.data.price_request.packages }).then((data)=>{ this.setData({ isShowOrderConfirm:true, + preOrdering:false, preOrder:data }); }) + }, + fail(){ + wx.showToast({ + icon:'error', + title: '请选择驿站' + }) } }) }, getOrder(){ + if(this.data.ordering)return; + this.setData({ordering:true}); wx.getStorage({ key:'pre-order', success:(res)=>{ res.data.addressid = this.data.currentAddress.id; userApi.order.real(res.data).then((data)=>{ this.setData({ - isShowOrderConfirm:false + isShowOrderConfirm:false, + ordering:false }); wx.removeStorage({ key: 'pre-order', }); - wx.navigateTo({ - url: `/pages/help/success/index?id=${data.order.orderid}&success_text=${data.success_text}`, - }) + wx.showTabBar({ + success(){ + wx.navigateTo({ + url: `/pages/help/success/index?id=${data.order.orderid}&success_text=${data.success_text}`, + }) + } + }); }); } }); }, - + enterPageContainer(){ + console.log('enterPageContainer'); + wx.hideTabBar(); + }, + leavePageContainer(){ + console.log('leavePageContainer'); + wx.showTabBar(); + }, /** * 生命周期函数--监听页面隐藏 */ @@ -186,9 +222,16 @@ Page({ }, goToAddPackage(){ - wx.navigateTo({ - url: `/pages/help/package/index?communityId=${this.data.currentCommunity.id}`, - }) + if(this.data.currentCommunity&&this.data.currentCommunity.id){ + wx.navigateTo({ + url: `/pages/help/package/index?communityId=${this.data.currentCommunity.id}`, + }) + }else{ + wx.showToast({ + icon:'error', + title: '请先选择小区', + }) + } }, goToCommunity(){ wx.navigateTo({ diff --git a/pages/help/index/index.wxml b/pages/help/index/index.wxml index 492725c..a11fa8c 100644 --- a/pages/help/index/index.wxml +++ b/pages/help/index/index.wxml @@ -16,16 +16,17 @@ - + {{currentAddress.community_name}} {{currentAddress.address_detail}} - {{currentAddress.name}} {{currentAddress.phone}} + {{currentAddress.name}} {{genderKV[currentAddress.gender]}} {{currentAddress.phone}} - 请录入配送地址 + 送达地址 + @@ -33,15 +34,15 @@ - {{package.name}} + {{package.name}} 共计 {{package.count}} 个包裹 - 送达地址 + 选择驿站 + - @@ -49,22 +50,22 @@ - 方便快捷 + 先享后付 - 方便快捷 + 蜂蜜抵扣 - - + + 您有免费跑腿券待领取 @@ -74,7 +75,7 @@ - + @@ -112,6 +113,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 b3294e4..1f24355 100644 --- a/pages/help/index/index.wxss +++ b/pages/help/index/index.wxss @@ -31,20 +31,18 @@ box-shadow: 0px 4px 8px 2px rgba(0, 0, 0, 0.05); border-radius: 20rpx; margin:0 20rpx; - padding:0 30rpx 0 48rpx; + padding:25rpx 30rpx 0 48rpx; } .address-panel .ap-item{ display:flex; - align-items: center; color:#222222; line-height: 1.7; - padding:34rpx 0; + padding:35rpx 0; } .address-panel .ap-item .icon{ width:40rpx;height:40rpx; - align-self: flex-start; - margin-top:3px + margin-top:4rpx } .address-panel .ap-item .text{ flex:1; @@ -54,18 +52,18 @@ .address-panel .ap-item .text .title{ line-height: 48rpx; } +.address-panel .ap-item .text .title.bold{ + font-weight: 500; +} .address-panel .ap-item .text .sub-title{ color:#7C8695; - font-size: 14px; + font-size: 28rpx; margin-top:22rpx; + min-height: 28rpx; } .address-panel .arrow{ width: 30rpx;height:30rpx; -} -.address-panel .line{ - border-bottom: 0.5px dashed rgba(124, 134, 149, 0.3); - margin-top:26rpx; - margin-right:10rpx; + margin-top:9rpx; } .address-panel .bottom{ diff --git a/pages/help/package/index.js b/pages/help/package/index.js index 537895f..e04ccbd 100644 --- a/pages/help/package/index.js +++ b/pages/help/package/index.js @@ -8,30 +8,43 @@ Page({ */ data: { stationList:[], - sendType:'' + sendType:'DELIVERY_AT_DOORSTEP' }, 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(',') }); }) - wx.setStorage({ - key:'pre-order', - data:{ - price_request:{ - packages:data + if(hasPackage){ + wx.setStorage({ + key:'pre-order', + data:{ + price_request:{ + packages:data + }, + delivery_method:this.data.sendType }, - delivery_method:this.data.sendType - }, - success(){ - wx.navigateBack(); - } - }) + success(){ + wx.navigateBack(); + } + }) + }else{ + wx.removeStorage({ + key: 'pre-order', + success(){ + wx.navigateBack(); + } + }) + } }, addPackage(event){ @@ -68,14 +81,17 @@ Page({ success:(res)=>{ data.items.map((item)=>{ const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id); - item.package = __item.pickup_codes.split(','); + item.package = __item.pickup_codes.split(',')||['']; }); this.setData({ + sendType:res.data.delivery_method, stationList:data.items }) } }); - + data.items.map((item)=>{ + item.package = ['']; + }); this.setData({ stationList:data.items }) diff --git a/pages/help/package/index.wxml b/pages/help/package/index.wxml index 17e5a42..df8590b 100644 --- a/pages/help/package/index.wxml +++ b/pages/help/package/index.wxml @@ -1,53 +1,42 @@ - - - - - {{item.name}} - {{item.service_text}} - - - - - - - + + + + + + + + + - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index 2b40302..6c0657b 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -24,6 +24,11 @@ Page({ }, getPhoneNumber(event){ + console.log(event); + if(!event.detail.code){ + //未接受 + return; + } this.setData({ loging:true }); @@ -31,6 +36,11 @@ Page({ success: (res) => { // 实现登录逻辑 this.sendLogin(res.code,event.detail.code); + }, + fail:()=>{ + this.setData({ + loging:false + }); } }) }, diff --git a/pages/login/login.json b/pages/login/login.json index e97850b..3e34882 100644 --- a/pages/login/login.json +++ b/pages/login/login.json @@ -1,4 +1,4 @@ { - "navigationStyle": "custom", - "backgroundColor": "#4555FF" + "backgroundColor": "#4555FF", + "navigationBarTitleText": "登录" } \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 614e190..dacd383 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -1,14 +1,17 @@ - - - - - - - + \ No newline at end of file diff --git a/pages/login/login.wxss b/pages/login/login.wxss index 5cd6ac9..843aacb 100644 --- a/pages/login/login.wxss +++ b/pages/login/login.wxss @@ -1,28 +1,39 @@ -.head{ - height:554rpx; - background-color: #F4BD00; -} -.bottom{ +.login{ + text-align: center; background-color: #fff; - position: absolute; - bottom: 0; - top:530rpx; - left:0;right:0; - border-radius: 24rpx 24rpx 0 0; - padding:60rpx 40rpx; + padding-top:120rpx; + height:100vh; } -.bottom .yellow{ +.text1{ + width:590rpx; + height:56rpx; +} +.text2{ + width:348rpx; + height:40rpx; + margin-top:40rpx; +} +.main{ + width:678rpx; + height:500rpx; + margin-top:70rpx; +} +.agree .yellow{ color:#FEC400; margin-left:0; } .policy{ font-size: 26rpx; - display: flex; + display: inline-flex; align-items: center; } .policy .radio{ margin-right:10rpx; } .button{ - margin-top:40rpx; + margin:30rpx 64rpx 60rpx 64rpx!important; +} +.button[disabled]{ + background-color:#e4e4e4!important; + color: #fff!important; } \ No newline at end of file diff --git a/pages/my/index/index.js b/pages/my/index/index.js index 5c7df53..ef35d17 100644 --- a/pages/my/index/index.js +++ b/pages/my/index/index.js @@ -6,7 +6,10 @@ Page({ * 页面的初始数据 */ data: { - userInfo:{} + userInfo:{}, + scrollViewHeight:0, + refresherTriggered:true, + bgHeight:'100%' }, goToCouponList(){ @@ -24,8 +27,21 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + const windowInfo = wx.getWindowInfo(); + this.setData({ + scrollViewHeight:windowInfo.windowHeight + }); + }, + scrollViewPulling(event){ + // this.setData({ + // bgHeight:`calc(100% + ${event.detail.dy*1.5}px)` + // }); + }, + scrollViewPullingOver(){ + // this.setData({ + // bgHeight:'100%' + // }); }, - /** * 生命周期函数--监听页面初次渲染完成 */ @@ -37,9 +53,13 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - app.getUserInfo().then((data)=>{ + this.getUserInfo(); + }, + getUserInfo(){ + app.forceGetUserInfo().then((data)=>{ this.setData({ - userInfo:data + userInfo:data, + refresherTriggered:false }); }) }, diff --git a/pages/my/index/index.wxml b/pages/my/index/index.wxml index 6cb799c..cc0b446 100644 --- a/pages/my/index/index.wxml +++ b/pages/my/index/index.wxml @@ -1,51 +1,56 @@ - - + + {{merchantOrderStatusKV[item.status]}} + {{item.product_name}} @@ -111,8 +120,9 @@ {{item.order_amount}} - - + 下单时间:{{item.create_time}} + + @@ -121,5 +131,6 @@ 暂无相关订单 - + \ No newline at end of file diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index 473995a..e2f728c 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -91,7 +91,7 @@ .group-list .item{ background-color: #fff; border-radius: 18rpx; - padding: 20rpx 40rpx; + padding:40rpx 30rpx 20rpx 40rpx; margin:24rpx 0; } .group-list .item .status{ @@ -109,16 +109,17 @@ flex:1; display: flex; align-items: center; - padding:10rpx 0; } .group-list .head .name .icon{ width:28rpx;height:28rpx; margin-left:4rpx; } +.group-list .item .spliter{ + margin:32rpx 0; +} .group-list .content{ display: flex; - margin-top:20rpx; } .group-list .content .image{ width:160rpx;height:160rpx; @@ -130,7 +131,14 @@ margin-top:22rpx; } .group-list .btns{ - text-align: right; + display: flex; + align-items: center; + margin-top:50rpx; +} +.group-list .btns .time{ + flex:1; + font-size: 26rpx; + color: #888888; } .group-list .btns .button{ font-size: 27rpx; diff --git a/pages/order/success/index.js b/pages/order/success/index.js index 12bf488..cbd8e3f 100644 --- a/pages/order/success/index.js +++ b/pages/order/success/index.js @@ -5,14 +5,18 @@ Page({ * 页面的初始数据 */ data: { - + name:'', + price:'' }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.setData({ + name:options.name, + price:options.price + }) }, back(){ wx.navigateBack(); diff --git a/pages/order/success/index.wxml b/pages/order/success/index.wxml index d43bf36..3090072 100644 --- a/pages/order/success/index.wxml +++ b/pages/order/success/index.wxml @@ -2,8 +2,8 @@ 扫码核销成功 - - + + \ No newline at end of file diff --git a/pages/shop/index/index.js b/pages/shop/index/index.js index 9c63579..a61f668 100644 --- a/pages/shop/index/index.js +++ b/pages/shop/index/index.js @@ -44,11 +44,13 @@ Page({ }); const cid = this.data.categories.length>0?this.data.categories[this.data.tabIndex].id:0; const params = { - longitude:this.data.lng, - latitude:this.data.lat, skip:this.data.pager.pageIndex*this.data.pager.limit, limit:this.data.pager.limit } + if(this.data.lng&&this.data.lat){ + params.longitude = this.data.lng; + params.latitude = this.data.lat; + } if(cid){ params.category_id = cid; } diff --git a/pages/shop/index/index.wxml b/pages/shop/index/index.wxml index a5fa238..dd05a07 100644 --- a/pages/shop/index/index.wxml +++ b/pages/shop/index/index.wxml @@ -1,9 +1,9 @@ - + 蜂蜜 (克) {{userInfo.points}} - 买券自动抵扣 - + 取快递自动抵扣 +