diff --git a/api/user.js b/api/user.js index fbedb0e..351eef8 100644 --- a/api/user.js +++ b/api/user.js @@ -24,7 +24,10 @@ export default { withdraw:{ add:(bank_card_id,amount)=>request.post('/api/withdraw',{bank_card_id,amount}), - list:(status)=>request.get('/api/withdraw/user',status?{status}:{}), + list:(data)=>request.get('/api/withdraw/user',data), + statusKV:{ + PENDING:"提现审核中",APPROVED:"平台受理成功",REJECTED:"被拒绝" + } }, uploadImg(file,progress){ diff --git a/app.wxss b/app.wxss index c60315b..8f8d3cd 100644 --- a/app.wxss +++ b/app.wxss @@ -1,7 +1,7 @@ page{ font-size:32rpx; line-height: 1; - --main-font-color:#222222; + --main-font-color:#000000; --main-bgclolor:#F5F5F5; --main-color:#FFC300; --main-hover-color:#fcce39; @@ -26,7 +26,6 @@ button .icon,button label{ } button:not([size=mini]){ width:auto; - /* height: 108rpx; */ padding:30rpx 25rpx; font-size: 36rpx; } @@ -38,28 +37,33 @@ button[type=primary]{ background-color:var(--main-color); color:#222222; } + +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]):not([disabled])[type=primary]:hover{ - background-color:var(--main-hover-color); -} + button[type=default]{ color: #333333; 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{ - border-color:var(--main-color); - color:var(--main-color); -} + button[loading][type=primary] { background-color:var(--main-color); color: hsla(0,0%,100%,.6); @@ -194,12 +198,14 @@ page-container .content{ } .bottom-bar{ - border-radius: 24rpx 24rpx 0 0; - padding:34rpx 40rpx; + border-top: 0.5px solid rgba(153, 153, 153, 0.2); + padding:24rpx; position:fixed; bottom:0; left:0;right:0; background-color: #fff; + padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx); + padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx); } .custom-scroll-view{ height:100vh; @@ -211,10 +217,12 @@ 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{ @@ -350,4 +358,7 @@ navigator button{ } .page-dispatch{ height:40rpx; +} +list-view{ + display: block; } \ No newline at end of file diff --git a/components/listView/index.js b/components/listView/index.js index 5178677..91f3222 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:'已经到底了' @@ -33,14 +31,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 +51,26 @@ 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` + } + console.log(heightStyle); + 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 4fe856a..427a70e 100644 --- a/components/listView/index.wxml +++ b/components/listView/index.wxml @@ -1,5 +1,7 @@ - - + + + + 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/modalView/index.js b/components/modalView/index.js new file mode 100644 index 0000000..221688b --- /dev/null +++ b/components/modalView/index.js @@ -0,0 +1,103 @@ +const app = getApp(); + +Component({ + + /** + * 组件的属性列表 + */ + properties: { + titleText:{ + type:String, + value:'' + }, + titleTextCenter:{ + type:Boolean, + value:true + }, + editable:{ + type:Boolean, + value:false + }, + editRequired:{ + type:Boolean, + value:false + }, + row:{ + type:Number, + value:4 + }, + content:{ + type:String, + value:'' + }, + contentPlaceholder:{ + type:String, + value:'请输入内容' + }, + isShowCancel:true, + cancelButtonText:{ + type:String, + value:'取消' + }, + okButtonText:{ + type:String, + value:'确定' + }, + show:{ + type:Boolean, + value:false + } + }, + /** + * 组件的初始数据 + */ + data: { + dynamicsStyle:'', + textareaHeight:124 + }, + + /** + * 组件的方法列表 + */ + methods: { + cancelButtonTap(){ + this.setData({ + show:false + }); + this.triggerEvent('cancel'); + }, + okButtonTap(){ + if(this.properties.editRequired){ + const valid = app.validateForm({ + content:{ + required:true, + message:this.properties.contentPlaceholder, + shake:true, + autoFocus:true + } + },this); + if(valid.length>0)return; + } + this.setData({ + show:false + }); + this.triggerEvent('ok',this.properties.content); + } + }, + + lifetimes:{ + attached(){ + console.log(this.properties.row); + const windowInfo = wx.getWindowInfo(); + let viewHeight = 50+96+32+48; + const textareaHeight = this.properties.row*25+24; + if(this.properties.editable){ + viewHeight+=textareaHeight; + } + this.setData({ + textareaHeight:textareaHeight, + dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;` + }) + } + } +}) \ No newline at end of file diff --git a/components/modalView/index.json b/components/modalView/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/modalView/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/modalView/index.wxml b/components/modalView/index.wxml new file mode 100644 index 0000000..8f161d7 --- /dev/null +++ b/components/modalView/index.wxml @@ -0,0 +1,17 @@ + + + + {{titleText}} + + + {{content}} + + + + + + + \ No newline at end of file diff --git a/components/modalView/index.wxss b/components/modalView/index.wxss new file mode 100644 index 0000000..bd3115a --- /dev/null +++ b/components/modalView/index.wxss @@ -0,0 +1,44 @@ +.custom-modal-view{ + border-radius: 20px; +} +.custom-modal-view .title{ + font-size: 34rpx; + font-weight: 500; + line-height: 50rpx; + padding:0 20rpx; +} +.custom-modal-view .title.center{ + text-align: center; +} +.modal-view-main{ + border-radius: 24rpx; + background-color: #fff; + padding:32rpx; +} +.custom-modal-view .textarea{ + border: 1.2px solid rgba(85, 85, 85, 0.3); + border-radius: 18px; + margin:30rpx 0; + padding:24rpx 20rpx; + font-size: 34rpx; + width:100%; + box-sizing: border-box; + line-height:50rpx; + height: 248rpx; +} +.custom-modal-view .textarea.error{ + border-color:red; +} + +.modal-view-main .btns{ + margin-top:32rpx; + display: flex; + gap: 18rpx; +} +.modal-view-main .btns .button{ + flex:1; + font-size: 32rpx; + padding:32rpx; + line-height: 1; + font-weight: 500; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index c7cef68..e7f760a 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -48,7 +48,9 @@ Page({ genderKV:userApi.genderKV, - completing:false + completing:false, + + isShowRefundConfirm:false }, onLoad(){ const windowInfo = wx.getWindowInfo(); @@ -167,8 +169,11 @@ Page({ limit:this.data.pager.limit, } const buildingId = this.data.buildingList[this.data.buildingIndex].building_id; + //有buildingId 就传 没有(全部) buildingId就传community_id 因为要过滤小区 if(buildingId){ params.building_id = buildingId; + }else{ + params.community_id = this.data.userInfo.community_id; } if(this.data.statusDetailKey=='completed'){ params.status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}` @@ -227,29 +232,29 @@ Page({ }) },400) }, - refund(event){ + showRefundConfirm(event){ const item = event.currentTarget.dataset.item; const index = event.currentTarget.dataset.index; if(item.receiving)return; - wx.showModal({ - title: '取消订单需联系客户说明原因', - content: '', - placeholderText:'请输入退款原因', - editable:true, - complete: (res) => { - if (res.confirm) { - this.setData({ - [`list[${index}].receiving`]:true - }) - orderApi.cancel(item.orderid,res.content).then((data)=>{ - wx.showToast({ - title: '取消成功', - icon:'success' - }); - this.refreshList(); - }) - } - } + this.refundOrderIndex = index; + this.setData({ + isShowRefundConfirm:true + }) + }, + refund(event){ + const index = this.refundOrderIndex; + const item = this.data.list[index]; + if(item.receiving)return; + + this.setData({ + [`list[${index}].receiving`]:true + }) + orderApi.cancel(item.orderid,event.detail).then((data)=>{ + wx.showToast({ + title: '取消成功', + icon:'success' + }); + this.refreshList(); }) }, chooseImage(){ @@ -393,5 +398,11 @@ Page({ } }) }, + concatUser(event){ + const item = event.currentTarget.dataset.item; + wx.makePhoneCall({ + phoneNumber: item.address.phone, + }) + }, emptyFun(){} }) diff --git a/pages/index/index.json b/pages/index/index.json index 1322457..be659f5 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,7 +1,8 @@ { "usingComponents": { "list-view":"/components/listView", - "swipe-button":"/components/swipeButton" + "swipe-button":"/components/swipeButton", + "modal-view":"/components/modalView" }, "navigationStyle": "custom", "navigationBarTextStyle": "white" diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 6b04a6d..5cead9b 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,87 +1,90 @@ - - - - - - - - + + + + + + + + + + - - - {{item.text}}({{item.value}}) + + + {{item.text}}({{item.value}}) + + + + + {{item.building_name}}({{item.order_count}}) + + - - - - {{item.building_name}}({{item.order_count}}) - - - - - - - - {{pItem.station_name}} - - {{pItem.pickup_codes.length}}件包裹: - - + + + + + {{pItem.station_name}} + + {{pItem.pickup_codes.length}}件包裹: + + + - - - - {{item.address.community_name}} - {{item.address.building_name}} - {{item.address.address_detail}} + + + {{item.address.community_name}} + {{item.address.building_name}} + {{item.address.address_detail}} + + + {{item.address.name}}{{genderKV[item.address.gender]}}:{{item.address.phone}}丨{{deliverStatusKV[item.delivery_method]}} + - - {{item.address.name}}{{genderKV[item.address.gender]}}:{{item.address.phone}}丨{{deliverStatusKV[item.delivery_method]}} + + + + + + + + + + + - - - + + + 暂无跑腿订单 - - - - - - - - - - - - 暂无跑腿订单 - - + + - 拍照留证 @@ -176,3 +179,6 @@ + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 9391e6f..0cd2be4 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -55,6 +55,9 @@ margin:20rpx 16rpx; position: relative; } +.building::-webkit-scrollbar{ + display: none; +} .building.loading{ overflow: hidden; } @@ -78,7 +81,6 @@ .package-list{ - margin-top:30rpx; } .package-list .item{ margin:30rpx 16rpx; @@ -99,6 +101,19 @@ left:38.5rpx;top:90rpx; bottom:250rpx; } + +.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; } @@ -200,7 +215,6 @@ } .concat-user-btn .icon{ width:28rpx;height:28rpx; - border: 1.2rpx solid rgba(85, 85, 85, 0.5); } .confirm-send-btn{ flex:1; diff --git a/pages/order-detail/index.js b/pages/order-detail/index.js index c0938f2..6d9c2c4 100644 --- a/pages/order-detail/index.js +++ b/pages/order-detail/index.js @@ -19,34 +19,29 @@ Page({ genderKV:userApi.genderKV, - orderStep:0, - scrollViewHeight:0 + orderStep:0 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - const windowInfo = wx.getWindowInfo(); - this.setData({ - scrollViewHeight:windowInfo.windowHeight - }); this.orderId = options.id; this.getOrderDetail(); }, getOrderDetail(){ orderApi.detail(this.orderId).then((data)=>{ let orderStep = 0; - if(data.order.status==this.data.orderStatus.received){ + if(data.status==this.data.orderStatus.received){ orderStep = 1; - }else if(data.order.status==this.data.orderStatus.delivering){ + }else if(data.status==this.data.orderStatus.delivering){ orderStep = 2; - }else if(data.order.status==this.data.orderStatus.unpaid||data.order.status==this.data.orderStatus.completed){ + }else if(data.status==this.data.orderStatus.unpaid||data.status==this.data.orderStatus.completed){ orderStep = 3; } - data.order.complete_time = this.formatTime(data.order.complete_time); - data.order.pickup_time = this.formatTime(data.order.pickup_time); - data.order.received_time = this.formatTime(data.order.received_time); + data.complete_time = this.formatTime(data.complete_time); + data.pickup_time = this.formatTime(data.pickup_time); + data.received_time = this.formatTime(data.received_time); data.packages.map((item)=>{ item.pickup_codes = item.pickup_codes.split(',') }) @@ -63,7 +58,7 @@ Page({ }, copyOrderId(){ wx.setClipboardData({ - data: this.data.orderDetail.order.orderid, + data: this.data.orderDetail.orderid, }) }, formatTime(time){ @@ -73,7 +68,7 @@ Page({ const current = event.currentTarget.dataset.url; wx.previewImage({ current:current, - urls: this.data.orderDetail.order.complete_images, + urls: this.data.orderDetail.complete_images, }) }, /** diff --git a/pages/order-detail/index.wxml b/pages/order-detail/index.wxml index de28d1e..7d6007c 100644 --- a/pages/order-detail/index.wxml +++ b/pages/order-detail/index.wxml @@ -1,5 +1,5 @@ + refresher-enabled scroll-y class="order-detail"> @@ -8,7 +8,7 @@ {{item.pickup_codes.length}} 件包裹: @@ -16,13 +16,13 @@ - {{orderDetail.order.community_name}} - {{orderDetail.order.building_name}} - {{orderDetail.order.address_detail}} + {{orderDetail.community_name}} + {{orderDetail.building_name}} + {{orderDetail.address_detail}} - {{orderDetail.order.address_name}} - {{genderKV[orderDetail.order.address_gender]}}:{{orderDetail.order.address_phone}}丨{{deliverStatusKV[orderDetail.order.delivery_method]}} + {{orderDetail.address_name}} + {{genderKV[orderDetail.address_gender]}}:{{orderDetail.address_phone}}丨{{deliverStatusKV[orderDetail.delivery_method]}} @@ -30,43 +30,43 @@ 接单 - {{orderDetail.order.received_time}} + {{orderDetail.received_time}} - + 取货 - {{orderDetail.order.pickup_time}} + {{orderDetail.pickup_time}} - + 送达 - {{orderDetail.order.complete_time}} + {{orderDetail.complete_time}} - + 拍照留证 - + - + 订单编号 - {{orderDetail.order.orderid}} + {{orderDetail.orderid}} 复制 下单时间 - {{orderDetail.order.create_time}} + {{orderDetail.create_time}} diff --git a/pages/order-detail/index.wxss b/pages/order-detail/index.wxss index f0b8287..b372346 100644 --- a/pages/order-detail/index.wxss +++ b/pages/order-detail/index.wxss @@ -1,3 +1,7 @@ +.order-detail{ + height:100vh; +} + .package-info{ padding:56rpx 20rpx 40rpx 20rpx; position: relative; diff --git a/pages/user/bank/index/index.js b/pages/user/bank/index/index.js index be40085..2c027cb 100644 --- a/pages/user/bank/index/index.js +++ b/pages/user/bank/index/index.js @@ -7,7 +7,8 @@ Page({ */ data: { cardList:[], - listLoading:false + listLoading:false, + isShowConfirm:false }, /** @@ -20,24 +21,21 @@ Page({ url: '/pages/user/bank/editor/index', }) }, - deleteCard(event){ + showConfirm(event){ const card = event.currentTarget.dataset.item; - const endNumber = card.card_number.substr(card.card_number.length-4,card.card_number.length); - wx.showModal({ - title: '是否确认删除此银行卡', - content: `尾号(${endNumber})`, - complete: (res) => { - if (res.confirm) { - userApi.cardList.delete(card.id).then((data)=>{ - wx.showToast({ - icon:'success', - title: '删除成功', - }) - this.getCardList(); - }); - } - } - }) + this.currentCard = card; + this.setData({ + isShowConfirm:true + }); + }, + deleteCard(){ + userApi.cardList.delete(this.currentCard.id).then((data)=>{ + wx.showToast({ + icon:'success', + title: '删除成功', + }) + this.getCardList(); + }); }, /** * 生命周期函数--监听页面初次渲染完成 diff --git a/pages/user/bank/index/index.json b/pages/user/bank/index/index.json index 02eaf29..cf58a31 100644 --- a/pages/user/bank/index/index.json +++ b/pages/user/bank/index/index.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "modal-view":"/components/modalView" + }, "navigationBarTitleText": "银行卡管理" } \ No newline at end of file diff --git a/pages/user/bank/index/index.wxml b/pages/user/bank/index/index.wxml index 017b929..ca15984 100644 --- a/pages/user/bank/index/index.wxml +++ b/pages/user/bank/index/index.wxml @@ -7,7 +7,7 @@ {{item.bank_name}} - + @@ -24,4 +24,6 @@ 暂无银行卡 - \ No newline at end of file + + + \ No newline at end of file diff --git a/pages/user/income/index.js b/pages/user/income/index.js index 73305f8..742859f 100644 --- a/pages/user/income/index.js +++ b/pages/user/income/index.js @@ -16,10 +16,6 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - const windowInfo = wx.getWindowInfo(); - this.setData({ - scrollViewHeight:windowInfo.windowHeight - }) this.loadList(); }, refreshList(){ @@ -38,7 +34,10 @@ Page({ "pager.loading":true }) - userApi.incomeList().then((data)=>{ + userApi.incomeList({ + skip:this.data.pager.limit*this.data.pager.pageIndex, + limit:this.data.pager.limit + }).then((data)=>{ if(this.data.pager.pageIndex==0){ this.data.list = data.items; }else{ @@ -61,14 +60,12 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - }, /** * 生命周期函数--监听页面显示 */ onShow() { - }, /** diff --git a/pages/user/income/index.wxml b/pages/user/income/index.wxml index 27c5b1e..5214fe6 100644 --- a/pages/user/income/index.wxml +++ b/pages/user/income/index.wxml @@ -1,15 +1,12 @@ - - - - - {{item.description}} - {{item.create_time}} - - {{item.amount}} + + + {{item.description}} + {{item.create_time}} + {{item.amount}} \ No newline at end of file diff --git a/pages/user/income/index.wxss b/pages/user/income/index.wxss index d0722f0..0782301 100644 --- a/pages/user/income/index.wxss +++ b/pages/user/income/index.wxss @@ -1,8 +1,11 @@ .income-list{ - background-color: #ffffff; - margin-top:20rpx; + height:100vh; +} +.income-list .scroll-view-content{ + padding-top:20rpx; } .income-list .item{ + background-color: #ffffff; display: flex; padding:40rpx 30rpx; border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); diff --git a/pages/withdraw/index/index.js b/pages/withdraw/index/index.js index 5479a28..37932dd 100644 --- a/pages/withdraw/index/index.js +++ b/pages/withdraw/index/index.js @@ -117,6 +117,11 @@ Page({ url: '/pages/user/bank/editor/index', }) }, + bankChange(event){ + this.setData({ + bank:event.detail.value + }) + }, /** * 生命周期函数--监听页面显示 */ diff --git a/pages/withdraw/index/index.wxml b/pages/withdraw/index/index.wxml index 056efe5..542e2e1 100644 --- a/pages/withdraw/index/index.wxml +++ b/pages/withdraw/index/index.wxml @@ -16,7 +16,7 @@ 提现方式 - +