This commit is contained in:
2025-02-27 22:15:09 +08:00
parent 0695c3ab34
commit 391f4d3c14
30 changed files with 530 additions and 154 deletions

View File

@ -1,4 +1,11 @@
const baseUrl = 'https://api-dev.beefast.co';
const { miniProgram } = wx.getAccountInfoSync();
const envVersion = miniProgram.envVersion;
let baseUrl = '';
if(envVersion=='develop'){
baseUrl = 'https://api-dev.beefast.co';
}else{
baseUrl = 'https://api.beefast.co'
}
let app = getApp();
const sendRequest = (options)=>{
@ -12,7 +19,9 @@ const sendRequest = (options)=>{
wx.request({
url: `${baseUrl}${options.url}`,
success:(result)=>{
if(options.method!='get'){
wx.hideLoading();
}
if(result.statusCode==200){
if(result.data.code==200){
rs(result.data.data);
@ -48,7 +57,9 @@ const sendRequest = (options)=>{
"content-type":options.data&&options.data.file?'application/x-www-form-urlencoded':'application/json'
},
fail:(res)=>{
if(options.method!='get'){
wx.hideLoading();
}
wx.showToast({
title: 'Request Error',
})

View File

@ -26,7 +26,7 @@ export default {
add:(bank_card_id,amount)=>request.post('/api/withdraw',{bank_card_id,amount}),
list:(data)=>request.get('/api/withdraw/user',data),
statusKV:{
PENDING:"提现审核中",APPROVED:"平台受理成功",REJECTED:"被拒绝"
PENDING:"提现审核中",APPROVED:"平台受理成功",REJECTED:"审核未通过"
}
},
@ -48,7 +48,10 @@ export default {
rj(res);
}
});
if(progress){
progress.task = task;
task.onProgressUpdate(progress);
}
});
}
}

View File

@ -90,8 +90,8 @@ radio-group label+label{
}
radio{
width: 34rpx;
height: 34rpx;
width: 17px;
height: 17px;
position: relative;
}
radio .wx-radio-input{
@ -100,7 +100,6 @@ radio .wx-radio-input{
box-sizing: border-box;
width: 100%;
height: 100%;
line-height: 20px;
position: absolute;
top: 0;left:0;
}
@ -111,9 +110,9 @@ radio .wx-radio-input.wx-radio-input-checked{
radio .wx-radio-input.wx-radio-input-checked::before{
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;
@ -122,8 +121,17 @@ radio .wx-radio-input.wx-radio-input-checked::before{
checkbox .wx-checkbox-input{
width: 40rpx;
height: 40rpx;
border: 2px solid #999999;
border-radius: 50%;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked{
border-color: var(--main-font-color);
border: 2px solid #000000;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
color: var(--main-font-color);
/* font-size: 30px; */
}
page-container .content{
border-radius: 24rpx 24rpx 0 0;
@ -274,6 +282,7 @@ page-container .content{
}
.cells .cell-bd input{
height:100rpx;
width: 100%;
}
.cells .cell-ft{
position: relative;
@ -345,7 +354,7 @@ navigator button{
}
.list-empty .icon{
width:160rpx;height:160rpx;
margin-top:360rpx;
padding-top:360rpx;
}
.list-empty .title{
font-size: 30rpx;

BIN
assets/icon/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/icon/back-black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

BIN
assets/icon/close-btn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

BIN
assets/icon/img-default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -73,7 +73,7 @@ Component({
required:true,
message:this.properties.contentPlaceholder,
shake:true,
autoFocus:true
// autoFocus:true //textarea 有 bug
}
},this);
if(valid.length>0)return;
@ -87,17 +87,23 @@ Component({
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;
}
},
observers:{
"show"(show){
if(show){
const windowInfo = wx.getWindowInfo();
// this.setData({
// textareaHeight:this.properties.row*25+24,
// })
this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{
const viewHeight = res.height;
this.setData({
textareaHeight:textareaHeight,
dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;`
})
}).exec();
}
}
}
})

View File

@ -1,17 +1,16 @@
<page-container show="{{show}}" position="center" class="custom-modal-view"
custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}">
<view class="modal-view-main">
<view class="modal-view-main" id="modalViewMain">
<view class="title {{titleTextCenter?'center':''}}">{{titleText}}</view>
<textarea class="textarea {{contentMessage?'error':''}}" model:value="{{content}}" row="3" wx:if="{{editable}}"
placeholder="{{contentPlaceholder}}" style="height:{{textareaHeight*2}}rpx"
focus="{{contentFocus}}" animation="{{contentAnimation}}"></textarea>
placeholder="{{contentPlaceholder}}" focus="{{contentFocus}}" animation="{{contentAnimation}}" cursor-spacing="200rpx"></textarea>
<view class="text" wx:else>{{content}}</view>
<view class="btns">
<button class="button" plain vx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
<button class="button" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
<button class="button cancel" plain vx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
<button class="button confirm" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
</view>
</view>
</page-container>

View File

@ -24,7 +24,7 @@
width:100%;
box-sizing: border-box;
line-height:50rpx;
height: 248rpx;
height: 214rpx;
}
.custom-modal-view .textarea.error{
border-color:red;
@ -37,8 +37,19 @@
}
.modal-view-main .btns .button{
flex:1;
font-size: 32rpx;
padding:32rpx;
font-size: 16px;
padding:16px;
line-height: 1;
font-weight: 500;
border-width: 2rpx;/* 边框显示不完整 bug */
}
.modal-view-main .btns .button.cancel{
border-color:rgba(153, 153, 153, 0.5);
background-color: rgba(153, 153, 153, 0.1);
color:var(--main-font-color);
}
.modal-view-main .btns .button.confirm{
font-weight: bold;
}

View File

@ -20,6 +20,10 @@ Component({
background:{
type:String,
value:''
},
black:{
type:Boolean,
value:false
}
},

View File

@ -2,7 +2,7 @@
<view class="nav-bar-content" style="height:{{navBarHeight}}px;">
<view class="left">
<view class="btns {{(back||backTitle)&&share?'border':''}}" wx:if="{{share||back||backTitle}}">
<image src="/assets/icon/back.png" class="back" wx:if="{{back||backTitle}}" bind:tap="back"/>
<image src="{{black?'/assets/icon/back-black.png':'/assets/icon/back.png'}}" class="back" wx:if="{{back||backTitle}}" bind:tap="back"/>
<view class="spliter" wx:if="{{share&&back}}"></view>
<image src="/assets/icon/navbar/share@2x.png" class="share" wx:if="{{share}}" bind:tap="share"/>
</view>

View File

@ -28,7 +28,7 @@ Component({
textOpacity:1,
textRight:120,
textRight:80,
moveViewX:0
},
@ -45,7 +45,7 @@ Component({
}
let x = this.data.moveEvent.detail.x;
let opacity = 1 - x/(this.data.moveAreaWidth - this.data.moveViewWidth);
let right = opacity*120;
let right = opacity*80;
this.setData({
textOpacity:opacity,
textRight:right
@ -59,13 +59,14 @@ Component({
if((this.data.moveAreaWidth - this.data.moveViewWidth)/3*2 < x){
viewX = this.data.moveAreaWidth - this.data.moveViewWidth;
loading = true;
this.triggerEvent('done');
}
console.log(viewX,this.data.moveAreaWidth,this.data.moveViewWidth,x);
this.setData({
moveViewX:viewX,
loading:loading
});
if(loading){
this.triggerEvent('done');
}
}
},
@ -78,6 +79,7 @@ Component({
},
observers:{
"loading"(l){
console.log('loading',l);
if(!l){
this.setData({
moveViewX:0,

View File

@ -1,5 +1,6 @@
import orderApi from '../../api/order';
import userApi from '../../api/user';
import {hidePhoneNumber,getStatusNavBarHeight} from '../../utils/util';
const app = getApp();
@ -7,6 +8,7 @@ Page({
currentOrder:null,
data: {
statusBarHeight:0,
snBarHeight:0,
list:[],
leftPanelEvent:null,
@ -53,11 +55,10 @@ Page({
isShowRefundConfirm:false
},
onLoad(){
const windowInfo = wx.getWindowInfo();
const snHeight = getStatusNavBarHeight();
this.setData({
statusBarHeight:windowInfo.statusBarHeight,
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44 - 91
statusBarHeight:snHeight.statusBar,
snBarHeight:snHeight.navBar+snHeight.statusBar
});
this.getUserInfo().then(()=>{
@ -99,6 +100,7 @@ Page({
this.loadBuilding().then((data)=>{
this.data.pager.pageIndex = 0;
this.data.pager.loadAll = false;
this.data.buildingIndex = 0;
this.loadList();
})
},
@ -181,6 +183,7 @@ Page({
params.status = this.data.statusDetail[this.data.statusDetailKey].key;
}
orderApi.list(params).then((data)=>{
const date = new Date();
if(this.data.pager.pageIndex==0){
this.data.list = data.items;
}else{
@ -192,10 +195,12 @@ Page({
if(data.items.length<this.data.pager.limit){
this.data.pager.loadAll = true;
}
data.items.map((item)=>{
if(item.status==this.data.orderStatus.created||item.status==this.data.orderStatus.completed||item.status==this.data.orderStatus.unpaid){
item.address.phone = hidePhoneNumber(item.address.phone);
}
item.packages.map((pItem)=>{
pItem.pickup_codes = pItem.pickup_codes.split(',');
pItem.receivedAll = this.getPackageReceiveStatus(item.orderid,pItem);
})
})
this.setData({
@ -204,7 +209,6 @@ Page({
statusDetailKey:this.data.statusDetailKey,
buildingIndex:this.data.buildingIndex
});
console.log(this.data.list);
})
},
@ -217,7 +221,7 @@ Page({
wx.nextTick(()=>{
this.setData({
isShowLeftPanelMask:true,
leftPanelMoveViewX:560
leftPanelMoveViewX:510
})
})
},
@ -263,10 +267,13 @@ Page({
mediaType:['image'],
sourceType:['camera'],
success:(res)=>{
console.log(res);
this.setData({
tempImgs:this.data.tempImgs.concat(res.tempFiles)
});
wx.nextTick(()=>{
console.log('nextTick');
this.uploadImages();
})
}
});
},
@ -295,13 +302,28 @@ Page({
},
//取货完毕
receivedOrder(event){
const index = event.currentTarget.dataset.index;
const item = event.currentTarget.dataset.item;
const hasUnReceive = !!item.packages.find((p)=>!p.receivedAll);
if(hasUnReceive){
this.setData({
[`list[${index}].receiving`]:false
})
wx.showToast({
icon:'none',
title: '请先取件',
})
return;
}
orderApi.pickup(item.orderid).then((data)=>{
wx.showToast({
icon:'success',
title: '取货成功',
})
this.refreshList();
wx.removeStorage({
key: item.orderid,
})
})
},
//完成配送 选择图片
@ -328,6 +350,10 @@ Page({
this.data.tempImgs.map((item)=>{
urls.push(item.serverUrl);
})
//需求改成选择了就上图图片,所以传完就设置了 false这里要发请求再次改成true
this.setData({
completing:true
})
orderApi.complete(this.currentOrder.orderid,urls).then((data)=>{
this.setData({
isShowConfirm:false,
@ -353,15 +379,31 @@ Page({
return !item.uploaded;
});
if(!file){
this.setData({
completing:false
})
return;
}
const uploadResult = await userApi.uploadImg(file,(res)=>{
console.log(this.data.tempImgs);
this.setData({
completing:true
})
let onProgress = (res)=>{
//进度
this.setData({
[`tempImgs[${imgIndex}].progress`]:res.progress
})
});
console.log(uploadResult);
}
//无奈之举不大范围改动代码的同时我需要获取到上传任务task来中断上传操作不然要出问题task在上传时被附加到了onProgress
this.data.tempImgs[imgIndex].onProgress = onProgress;
let uploadResult = {};
try {
uploadResult = await userApi.uploadImg(file,onProgress);
} catch (error) {
await this.uploadImages();
console.log(new Date().getTime());
return;
}
if(uploadResult.url){
this.setData({
[`tempImgs[${imgIndex}].uploaded`]:true,
@ -373,6 +415,17 @@ Page({
return new Error('失败')
}
},
removeImage(event){
const index = event.currentTarget.dataset.index;
if(this.data.tempImgs[index].onProgress&&this.data.tempImgs[index].onProgress.task){
this.data.tempImgs[index].onProgress.task.abort();
}
console.log('remove',new Date().getTime());
this.data.tempImgs.splice(index,1);
this.setData({
tempImgs:this.data.tempImgs
});
},
leftPanelMove(event){
this.setData({
leftPanelEvent:event
@ -384,7 +437,7 @@ Page({
this.closeLeftPanel();
}else{
this.setData({
leftPanelMoveViewX:560
leftPanelMoveViewX:510
})
}
},
@ -404,5 +457,25 @@ Page({
phoneNumber: item.address.phone,
})
},
emptyFun(){}
emptyFun(){},
onShow(){
if(this.data.statusDetailKey==this.data.statusDetail.received.key.toLowerCase()){
let needRefreshData = {}
this.data.list.map((item,index)=>{
item.packages.map((pItem,pIndex)=>{
let reveivedAll = this.getPackageReceiveStatus(item.orderid,pItem);
needRefreshData[`list[${index}].packages[${pIndex}].receivedAll`] = reveivedAll;
})
})
this.setData(needRefreshData);
}
},
getPackageReceiveStatus(orderId,pkg){
let receivedInfo = wx.getStorageSync(orderId);
let codes = receivedInfo[pkg.id];
if(codes&&pkg.pickup_codes.length==codes.length){
return true;
}
return false;
}
})

View File

@ -27,20 +27,21 @@
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view wx:for="{{list}}" wx:key="index" bind:tap="navToOrderDetail" data-id="{{item.orderid}}"
<view wx:for="{{list}}" wx:key="index" bind:tap="navToOrderDetail"
data-id="{{item.orderid}}"
class="item {{item.status==orderStatus.unpaid||item.status==orderStatus.completed?'no-btns':''}} {{item.is_first_order?'is-new-order':''}}" >
<view class="station-list">
<view class="sl-item" wx:for="{{item.packages}}" wx:key="index" wx:for-item="pItem" wx:for-index="pIndex">
<view class="name">{{pItem.station_name}}</view>
<view class="package">
<view class="key">{{pItem.pickup_codes.length}}件包裹:</view>
<view class="value">
<label wx:for="{{pItem.pickup_codes}}" wx:key="index" class="code-item"
wx:for-item="code">
{{item.status==orderStatus.created?'******':code}}
</label>
<view class="name">{{pItem.station_name}} {{pItem.pickup_codes.length}} 件</view>
<view class="received-status {{item.status==orderStatus.received&&!pItem.receivedAll?'done':''}}" wx:if="{{item.status!=orderStatus.created}}">
{{
item.status==orderStatus.received?(pItem.receivedAll?'已取件':'待取件'):
item.status==orderStatus.delivering?'已取件':''
}}
</view>
</view>
<view class="sl-item" wx:if="{{item.pickup_images&&item.pickup_images.length>0}}">
<view class="name">图片取件 {{item.pickup_images_count}} 件</view>
</view>
</view>
<view class="address">
@ -93,12 +94,11 @@
<view class="photos">
<view class="item {{item.loading?'current':''}}" wx:for="{{tempImgs}}" wx:key="index">
<image class="image" src="{{item.tempFilePath}}"/>
<progress wx:if="{{!item.uploaded}}" class="progress" percent="{{item.progress}}" stroke-width="5"/>
<progress wx:if="{{!item.uploaded}}" class="progress" percent="{{item.progress}}" stroke-width="4"/>
<view class="close-area" bind:tap="removeImage" data-index="{{index}}">
<image src="/assets/icon/close-btn.png" class="icon"/>
</view>
</view>
<!-- <view class="item loading">
<progress class="progress" percent="20" show-info stroke-width="5" show-info="{{false}}"/>
<image class="image" src="/assets/img/login-bg.png"/>
</view> -->
<view class="take-photo item" bind:tap="chooseImage"
wx:if="{{tempImgs.length<maxChooseImgCount}}">
<image class="icon" src="/assets/icon/camera.png"/>
@ -113,15 +113,16 @@
style="opacity:{{isShowLeftPanelMask?1:0}};" bind:tap="closeLeftPanel"></view>
<movable-area class="left-move-view" wx:if="{{isShowLeftPanel}}">
<movable-view class="left-panel" x="{{leftPanelMoveViewX}}rpx"
style="padding-top:{{statusBarHeight}}px;"
style="padding-top:{{snBarHeight}}px;"
direction="horizontal" damping="50" bindchange="leftPanelMove"
capture-catch:touchcancel="leftPanelMoveCancel"
capture-catch:touchend="leftPanelMoveCancel">
<scroll-view scroll-y style="height:calc(100vh - {{statusBarHeight}}px)" refresher-enabled
bindrefresherrefresh="getUserInfo" refresher-triggered="{{userInfoTrigger}}">
<scroll-view scroll-y style="height:calc(100vh - {{snBarHeight}}px)" refresher-enabled
bindrefresherrefresh="getUserInfo" refresher-triggered="{{userInfoTrigger}}" class="scroll-view"
show-scrollbar="{{false}}" enhanced>
<view class="page-container user-info">
<image class="avatar" src="{{userInfo.optimized_avatar}}" bind:tap="navToUserInfo"/>
<image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/avatar.png'}}" bind:tap="navToUserInfo"/>
<view class="name">{{userInfo.nickname}}</view>
<view class="phone">{{userInfo.phone}}</view>
<view class="community-name">{{userInfo.community_name}}</view>

View File

@ -77,6 +77,7 @@
.building .item.current{
background-color: var(--main-color);
color:var(--main-font-color);
font-weight: 500;
}
@ -101,7 +102,12 @@
left:38.5rpx;top:90rpx;
bottom:250rpx;
}
.package-list .item.is-new-order::before{
top:145rpx;
}
.package-list .item.is-new-order{
padding-top:110rpx;
}
.package-list .item.is-new-order::after{
content:'新';
position: absolute;
@ -120,16 +126,27 @@
.package-list .item .name{
font-size: 40rpx;
font-weight: 600;
flex: 1;
}
.package-list .item .package{
.package-list .item .received-status{
border-left: 1rpx solid #999999;
padding-left:18rpx;
color:var(--main-color);
}
.package-list .item .received-status.done{
color:unset;
}
/* .package-list .item .package{
font-size:32rpx;
margin-top:24rpx;
display: flex;
}
} */
.package-list .item .station-list .sl-item{
position: relative;
padding-left:64rpx;
padding-bottom:50rpx;
padding-bottom:80rpx;
display: flex;
align-items: center;
}
.package-list .item .station-list .sl-item:first-child::before{
content: '取';
@ -149,12 +166,12 @@
border-radius: 50%;
display: inline-block;
}
.package-list .item .package .value{
/* .package-list .item .package .value{
flex:1;
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
} */
.package-list .item .address{
padding-left:64rpx;
@ -199,6 +216,9 @@
padding:30rpx 40rpx;
margin:0;
}
.package-list .item .btns .refund-btn{
width:200rpx;
}
.package-list .item .btns .refund-btn[disabled]{
color:#999;
border-color:rgb(221, 219, 219);
@ -255,6 +275,17 @@
width:100%;
z-index: 1;
}
.confirm-sending .photos .item .close-area{
position: absolute;
right:-16rpx;top:-16rpx;
z-index: 2;
padding:5rpx;
display: flex;
align-items: center;
}
.confirm-sending .photos .item .close-area .icon{
width:28rpx;height:28rpx;
}
.confirm-sending .photos .item.loading::after{
content: '';
position: absolute;
@ -265,6 +296,7 @@
}
.confirm-sending .photos .item .image{
width:100%;height:100%;
border-radius: 12rpx;
}
.confirm-sending .photos .take-photo .icon{
width:36rpx;height:36rpx;
@ -281,21 +313,22 @@
}
.left-move-view{
width:1120rpx;height:100vh;
left: -560rpx;top:0;
width:1070rpx;height:100vh;
left: -510rpx;top:0;
position: fixed;
}
.left-panel{
width:560rpx;
width:510rpx;
background-color: #fff;
height:100vh;
/* position: fixed; */
/* left:0;top:0; */
/* transition-duration: .3s; */
}
.left-panel-mask{
position: fixed;
width:calc(100vw + 560rpx);
width:calc(100vw + 510rpx);
height:100vh;
right:0;top:0;
transition-duration: .4s;
@ -310,11 +343,11 @@
.left-panel .user-info{
text-align: center;
padding-bottom:0;
padding-top:140rpx;
}
.left-panel .user-info .avatar{
width:120rpx;height:120rpx;
border-radius: 50%;
margin-top:40rpx;
}
.left-panel .user-info .name{
margin-top:30rpx;
@ -322,23 +355,24 @@
}
.left-panel .user-info .phone{
color: #888888;
margin-top:24rpx;
margin-top:30rpx;
}
.left-panel .user-info .community-name{
margin-top:24rpx;
margin-top:60rpx;
font-size: 34rpx;
}
.left-panel .user-info .spliter{
margin-top:40rpx;
margin-top:82rpx;
}
.left-panel .user-info .order-info{
display: flex;
justify-content: space-between;
}
.left-panel .user-info .order-info .item{
padding:30rpx 24rpx;
padding:30rpx 0;
}
.left-panel .user-info .order-info .key{
font-size:24rpx;
font-size:22rpx;
}
.left-panel .user-info .order-info .value{
font-size: 36rpx;
@ -388,11 +422,17 @@
}
.left-panel .logout-btn{
position: absolute;
bottom:80rpx;
left:20rpx;right:20rpx;
position: fixed;
bottom:calc(constant(safe-area-inset-bottom) + 20rpx);
bottom:calc(env(safe-area-inset-bottom) + 20rpx);
left:0;right:0;
margin:30rpx 20rpx;
background-color: #fff;
font-weight: normal;
color: #888888;
font-size: 24rpx;
padding:30rpx;
line-height: 1;
}
.left-panel .logout-btn:hover{
background-color: #fff!important;

View File

@ -1,5 +1,7 @@
import orderApi from '../../api/order';
import userApi from '../../api/user';
import {hidePhoneNumber} from '../../utils/util';
Page({
@ -42,15 +44,27 @@ Page({
data.complete_time = this.formatTime(data.complete_time);
data.pickup_time = this.formatTime(data.pickup_time);
data.received_time = this.formatTime(data.received_time);
const receivedStatusCode = wx.getStorageSync(data.orderid);
data.packages.map((item)=>{
item.pickup_codes = item.pickup_codes.split(',')
if(receivedStatusCode){
if(item.pickup_codes.length==(receivedStatusCode[item.id]||[]).length){
item.receivedAll = true;
}
(receivedStatusCode[item.id]||[]).map((code)=>{
item[code] = true;
})
}
});
if(data.status==this.data.orderStatus.created||data.status==this.data.orderStatus.completed||data.status==this.data.orderStatus.unpaid){
data.address_phone = hidePhoneNumber(data.address_phone);
}
this.setData({
orderDetail:data,
refreshTrigger:false,
orderStep
})
}).catch(()=>{
}).catch((res)=>{
console.log(res);
this.setData({
refreshTrigger:false
})
@ -71,6 +85,32 @@ Page({
urls: this.data.orderDetail.complete_images,
})
},
previewPackageImage(event){
const current = event.currentTarget.dataset.item;
wx.previewImage({
current:current,
urls: this.data.orderDetail.pickup_images,
})
},
selectPackageCode(event){
const index = event.currentTarget.dataset.index;
const item = this.data.orderDetail.packages[index];
let receviedStatus = wx.getStorageSync(item.orderid)||{};
const checkedCode = event.detail.value;
item.pickup_codes.map((code)=>{
item[code] = !!checkedCode.find((c)=>c==code);
})
let receivedAll = item.pickup_codes.length==checkedCode.length;
item.receivedAll = receivedAll
this.setData({
[`orderDetail.packages[${index}]`]:item
});
receviedStatus[item.id] = checkedCode;
wx.setStorage({
key:item.orderid,
data:receviedStatus
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -1,6 +1,53 @@
<scroll-view refresher-triggered="{{refreshTrigger}}" bindrefresherrefresh="getOrderDetail"
refresher-enabled scroll-y class="order-detail">
<view class="page-container package-info">
<view class="page-container address-info">
<view class="title">
{{orderDetail.community_name}}
{{orderDetail.building_name}}
{{orderDetail.address_detail}}
</view>
<view class="sub-title">
{{orderDetail.address_name}}
{{genderKV[orderDetail.address_gender]}}{{orderDetail.address_phone}}丨{{deliverStatusKV[orderDetail.delivery_method]}}
</view>
</view>
<view class="page-container station-info" wx:for="{{orderDetail.packages}}" wx:key="index">
<view class="title">
<view class="name">{{item.station_name}}</view>
<view class="received-status {{orderDetail.status==orderStatus.received&&!item.receivedAll?'done':''}}"
wx:if="{{item.status!=orderStatus.created}}">
<!-- {{item.receivedAll?'已取件':'待取件'}} -->
{{
orderDetail.status==orderStatus.received?(item.receivedAll?'已取件':'待取件'):
orderDetail.status==orderStatus.delivering?'已取件':''
}}
</view>
</view>
<checkbox-group value="{{receivedCodes}}" bindchange="selectPackageCode"
data-index="{{index}}">
<label class="code-item" wx:for="{{item.pickup_codes}}" wx:key="index" wx:for-item="code">
<view class="code {{orderDetail.status==orderStatus.created||(orderDetail.status==orderStatus.received&&!item[code])?'':'checked'}}">
{{orderDetail.status==orderStatus.created?'*********':code}}
</view>
<checkbox checked="{{!!item[code]}}" value="{{code}}" wx:if="{{orderDetail.status==orderStatus.received}}"/>
</label>
</checkbox-group>
</view>
<view class="page-container station-info" wx:if="{{orderDetail.pickup_images&&orderDetail.pickup_images.length>0}}">
<view class="title">
<view class="name">图片取件 {{orderDetail.pickup_images_count}} 件</view>
</view>
<view class="images" wx:if="{{orderDetail.status==orderStatus.created}}">
<view class="image empty-img" wx:for="{{orderDetail.pickup_images}}" wx:key="index" src="{{item}}">
<image class="icon" src="/assets/icon/img-default.png"/>
</view>
</view>
<view class="images" wx:else="">
<image class="image" wx:for="{{orderDetail.pickup_images}}" wx:key="index"
src="{{item}}" bind:tap="previewPackageImage" data-item="{{item}}"/>
</view>
</view>
<!-- <view class="page-container package-info">
<view class="station-list" bind:tap="navToOrderDetail">
<view class="sl-item" wx:for="{{orderDetail.packages}}" wx:key="index">
<view class="name">{{item.station_name}}</view>
@ -12,6 +59,7 @@
</label>
</view>
</view>
<view class="received-status" wx:if="{{item.status!=orderStatus.created}}">待取件</view>
</view>
</view>
<view class="address">
@ -25,7 +73,7 @@
{{genderKV[orderDetail.address_gender]}}{{orderDetail.address_phone}}丨{{deliverStatusKV[orderDetail.delivery_method]}}
</view>
</view>
</view>
</view> -->
<view class="page-container steps">
<view class="item {{orderStep>0?'night':''}}">
<view class="content">
@ -68,6 +116,17 @@
<view class="key">下单时间</view>
<view class="value">{{orderDetail.create_time}}</view>
</view>
<view class="row">
<view class="key">取件数量</view>
<view class="value">{{orderDetail.package_count}}</view>
</view>
<view class="row">
<view class="key">订单金额</view>
<view class="value money money-normal">{{orderDetail.original_amount}}</view>
</view>
</view>
<view class="scroll-view-dispatch"></view>
</scroll-view>

View File

@ -1,8 +1,76 @@
.order-detail{
height:100vh;
}
.package-info{
.address-info .title{
font-size: 40rpx;
font-weight: 600;
}
.address-info .sub-title{
font-size: 32rpx;
margin-top:36rpx;
}
.station-info{
padding-bottom:0;
}
.station-info .title{
display: flex;
align-items: center;
padding-bottom:32rpx;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.3);
}
.station-info .title .name{
font-size: 40rpx;
color: #555555;
font-weight: 500;
flex: 1;
}
.station-info .title .received-status{
font-size: 32rpx;
border-left: 1rpx solid #999999;
padding-left:18rpx;
color:var(--main-color);
}
.station-info .title .received-status.done{
color: #555555;
}
.station-info .code-item{
height:132rpx;
display: flex;
align-items: center;
border-top: 0.5px solid rgba(153, 153, 153, 0.2);
}
.station-info .code-item:first-child{
border: 0;
}
.station-info .code-item .code{
font-size: 52rpx;
font-weight: 600;
flex:1;
color: #888888;
}
.station-info .code-item .code.checked{
color:var(--main-font-color);
}
.station-info .images{
display: flex;
align-items: center;
gap: 20rpx;
padding:40rpx 0;
}
.station-info .images .empty-img{
background: rgba(153, 153, 153, 0.1);
display: flex;
align-items: center;
justify-content: center;
}
.station-info .images .empty-img .icon{
width:84rpx;height:84rpx;
}
.station-info .image{
width:160rpx;height:160rpx;
border-radius: 12rpx;
}
/* .package-info{
padding:56rpx 20rpx 40rpx 20rpx;
position: relative;
color: #555555;
@ -15,26 +83,29 @@
background-color: rgba(85, 85, 85, 0.5);
left:38.5rpx;top:90rpx;
bottom:130rpx;
}
} */
.package-info .name{
/* .package-info .name{
font-size: 40rpx;
font-weight: 600;
flex: 1;
}
.package-info .package{
.package-info .received-status{
border-left: 1rpx solid #999999;
padding-left:18rpx;
} */
/* .package-info .package{
font-size:32rpx;
margin-top:24rpx;
display: flex;
}
.package-info .package{
font-size:32rpx;
margin-top:24rpx;
display: flex;
}
.package-info .station-list .sl-item{
} */
/* .package-info .station-list .sl-item{
position: relative;
padding-left:64rpx;
padding-bottom:50rpx;
display: flex;
align-items: center;
}
.package-info .station-list .sl-item:first-child::before{
content: '取';
@ -56,15 +127,15 @@
}
.package-list .item .station-list .sl-item{
padding-bottom:50rpx;
}
.package-info .package .value{
} */
/* .package-info .package .value{
flex:1;
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
} */
.package-info .address{
/* .package-info .address{
padding-left:64rpx;
position: relative;
}
@ -88,7 +159,7 @@
.package-info .address .sub-title{
font-size: 32rpx;
margin-top:24rpx
}
} */
.steps{
display: flex;

View File

@ -1,4 +1,3 @@
<view class="cells">
<view class="cell">
<view class="cell-hd">持卡姓名</view>
@ -25,7 +24,6 @@
</view>
</view>
</view>
<view class="bottom-bar">
<button type="primary" class="save-btn" bind:tap="addCard">提交并认证</button>
</view>

View File

@ -19,10 +19,6 @@
<view class="value card-no">{{item.card_number}}</view>
</view>
</view>
<view class="list-empty" wx:if="{{cardList.length==0&&!listLoading}}">
<image class="icon" src="/assets/icon/list-empty.png"/>
<view class="title">暂无银行卡</view>
</view>
<button bind:tap="navToAdd" class="add-card-btn">添加银行卡</button>
</view>

View File

@ -1,4 +1,5 @@
import userApi from '../../../api/user';
const app = getApp();
Page({
@ -9,7 +10,8 @@ Page({
data: {
scrollViewHeight:0,
pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false},
list:[]
list:[],
summary:{}
},
/**
@ -17,6 +19,11 @@ Page({
*/
onLoad(options) {
this.loadList();
app.getSummary().then((data)=>{
this.setData({
summary:data
})
})
},
refreshList(){
this.data.pager.pageIndex = 0;

View File

@ -1,5 +1,10 @@
<list-view bind:refresh="refreshList" bind:loadMore="loadList"
refresher-triggered="{{pager.refreshTrigger}}" class="income-list"
<view class="custom-scroll-view">
<view class="total">
<view class="title">今日收益(元)</view>
<view class="num">{{summary.total_income}}</view>
</view>
<list-view bind:refresh="refreshList" bind:loadMore="loadList"
refresher-triggered="{{pager.refreshTrigger}}" class="income-list main"
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view class="item" wx:for="{{list}}" wx:key="index">
@ -7,6 +12,7 @@
<view class="title">{{item.description}}</view>
<view class="sub-title">{{item.create_time}}</view>
</view>
<view class="money">{{item.amount}}</view>
<view class="money money-normal">{{item.amount}}</view>
</view>
</list-view>
</list-view>
</view>

View File

@ -1,14 +1,31 @@
.custom-scroll-view .total{
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
background: #FFC300;
border-radius: 18rpx;
padding:30rpx;
margin:20rpx;
}
.custom-scroll-view .total .title{
font-size: 32rpx;
}
.custom-scroll-view .total .num{
font-size: 68rpx;
font-weight: 600;
margin-top:40rpx;
}
.income-list{
height:100vh;
}
.income-list .scroll-view-content{
padding-top:20rpx;
margin: 0 20rpx;
}
.income-list .item{
background-color: #ffffff;
display: flex;
padding:40rpx 30rpx;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
margin:20rpx 0;
border-radius: 18rpx;
}
.income-list .item:first-child{
margin-top:0;
}
.income-list .item .content{
flex:1;
@ -21,7 +38,3 @@
margin-top:32rpx;
color: #888888;
}
.income-list .item .money{
color:var(--main-color);
}

View File

@ -1,5 +1,5 @@
<view class="bg">
<nav-bar back/>
<nav-bar back black/>
</view>
<scroll-view scroll-y class="scroll-view" refresher-enabled
bindrefresherrefresh="refreshSummary" refresher-triggered="{{refreshTrigger}}">
@ -31,7 +31,7 @@
<view>实名认证</view>
</view>
<view class="cell-ft">
<label class="main-color">{{isAuth?'已认证':''}}</label>
<label class="main-color">{{isAuth?'已认证':'未认证'}}</label>
</view>
</navigator>
<navigator url="/pages/user/bank/index/index" class="cell" hover-class="cell-active">

View File

@ -11,6 +11,10 @@ Page({
idCard:'',
already:false
},
validator:{
name:{minLength:2,message:'请输入真实的姓名',autoFocus:true,shake:true},
idCard:{length:18,message:'请输入正确的身份证号码',autoFocus:true,shake:true}
},
/**
* 生命周期函数--监听页面加载
@ -29,6 +33,8 @@ Page({
save(){
app.resetUserInfoUpdateTag();
const valid = app.validateForm(this.validator,this);
if(valid.length==0){
userApi.setRNAuth({
name:this.data.name,
id_number:this.data.idCard
@ -41,6 +47,7 @@ Page({
}
})
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -4,14 +4,16 @@
<view class="cell-hd">真实姓名</view>
<view class="cell-bd">
<label wx:if="{{already}}">{{name}}</label>
<input placeholder="请输入真实姓名" model:value="{{name}}" wx:else/>
<input focus="{{nameFocus}}" animation="{{nameAnimation}}" placeholder="请输入真实姓名" model:value="{{name}}" wx:else/>
<view class="error">{{nameMessage}}</view>
</view>
</view>
<view class="cell">
<view class="cell-hd">身份证号</view>
<view class="cell-bd">
<label wx:if="{{already}}">{{idCard}}</label>
<input placeholder="请输入身份证号" model:value="{{idCard}}" wx:else/>
<input focus="{{idCardFocus}}" animation="{{idCardAnimation}}" placeholder="请输入身份证号" model:value="{{idCard}}" wx:else/>
<view class="error">{{idCardMessage}}</view>
</view>
</view>
<!-- <view class="cell">

View File

@ -13,4 +13,8 @@
<view class="status {{item.status}}">{{statusKV[item.status]}}</view>
</view>
</view>
<view class="list-empty">
<image src="/assets/icon/list-empty.png" class="icon"/>
<view class="title">暂无记录</view>
</view>
</list-view>

View File

@ -14,6 +14,20 @@ const formatNumber = n => {
return n[1] ? n : `0${n}`
}
module.exports = {
formatTime
const getStatusNavBarHeight = ()=>{
const windowInfo = wx.getWindowInfo();
return {
statusBar:windowInfo.statusBarHeight,
navBar:44
};
}
const hidePhoneNumber = phone=>{
return `${phone.substr(0,3)}****${phone.substr(phone.length-4,4)}`
}
module.exports = {
formatTime,
hidePhoneNumber,
getStatusNavBarHeight
}