若干 bug

This commit is contained in:
2025-02-20 19:34:09 +08:00
parent e6ec7ecd96
commit fa443237c7
26 changed files with 287 additions and 127 deletions

View File

@ -18,11 +18,12 @@ export default {
}, },
buildingList:(community_id,status)=>request.get('/api/order/community_building/count',{community_id,status}), buildingList:(community_id,status)=>request.get('/api/order/community_building/count',{community_id,status}),
list:(data)=>request.get('/api/order/deliveryman/list',data,{delayLoading:true}), list:(data)=>request.get('/api/order/deliveryman/list',data),
detail:(orderid)=>request.get(`/api/order/${orderid}`), detail:(orderid)=>request.get(`/api/order/${orderid}`),
statusDetail:(community_id)=>request.get('/api/order/status/count',{community_id}), statusDetail:(community_id)=>request.get('/api/order/status/count',{community_id}),
receive:(orderid)=>request.post(`/api/order/${orderid}/deliveryman/receive`), receive:(orderid)=>request.post(`/api/order/${orderid}/deliveryman/receive`),
pickup:(orderid)=>request.post(`/api/order/${orderid}/deliveryman/pickup`), pickup:(orderid)=>request.post(`/api/order/${orderid}/deliveryman/pickup`),
complete:(orderid,images)=>request.post(`/api/order/${orderid}/deliveryman/complete`,{images:images}) complete:(orderid,images)=>request.post(`/api/order/${orderid}/deliveryman/complete`,{images:images}),
cancel:(orderid,reason)=>request.post(`/api/order/${orderid}/deliveryman/cancel`,{reason})
} }

View File

@ -3,22 +3,16 @@ let app = getApp();
const sendRequest = (options)=>{ const sendRequest = (options)=>{
if(!app)app = getApp(); if(!app)app = getApp();
let timer; if(options.method!='get'){
if(options.options.delayLoading){ wx.showLoading({
timer = setTimeout(()=>{ title: '请等待...',
wx.showLoading({ })
title: '加载中...',
})
},800)
} }
return new Promise((rs,rj)=>{ return new Promise((rs,rj)=>{
wx.request({ wx.request({
url: `${baseUrl}${options.url}`, url: `${baseUrl}${options.url}`,
success:(result)=>{ success:(result)=>{
if(timer){ wx.hideLoading();
clearTimeout(timer);
wx.hideLoading();
}
if(result.statusCode==200){ if(result.statusCode==200){
if(result.data.code==200){ if(result.data.code==200){
rs(result.data.data); rs(result.data.data);
@ -27,7 +21,7 @@ const sendRequest = (options)=>{
if(!options.options.noTips){ if(!options.options.noTips){
wx.showToast({ wx.showToast({
icon:'error', icon:'error',
title: result.data.message, title: result.data.message||'发生错误',
}); });
} }
rj(result.data); rj(result.data);
@ -38,6 +32,12 @@ const sendRequest = (options)=>{
}) })
}else{ }else{
rj(result.data); rj(result.data);
if(!options.options.noTips){
wx.showToast({
icon:'error',
title: result.data.message||'发生错误',
});
}
} }
}, },
@ -48,6 +48,7 @@ const sendRequest = (options)=>{
"content-type":options.data&&options.data.file?'application/x-www-form-urlencoded':'application/json' "content-type":options.data&&options.data.file?'application/x-www-form-urlencoded':'application/json'
}, },
fail:(res)=>{ fail:(res)=>{
wx.hideLoading();
wx.showToast({ wx.showToast({
title: 'Request Error', title: 'Request Error',
}) })

View File

@ -11,7 +11,7 @@ export default {
summary:()=>request.get('/api/account/summary'), summary:()=>request.get('/api/account/summary'),
orderSummary:()=>request.get('/api/order/deliveryman/summary'), orderSummary:()=>request.get('/api/order/deliveryman/summary'),
incomeList:(data)=>request.get('/api/account/details',data), incomeList:(data)=>request.get('/api/account/details',data),
getRNAuth:()=>request.get('/api/user/auth',{noTips:true}), getRNAuth:()=>request.get('/api/user/auth',{},{noTips:true}),
setRNAuth:(data)=>request.post('/api/user/auth',data), setRNAuth:(data)=>request.post('/api/user/auth',data),
bankCard:{ bankCard:{

55
app.js
View File

@ -6,7 +6,7 @@ App({
verifyCodeWaitingTime:60, verifyCodeWaitingTime:60,
onLaunch() { onLaunch() {
if(!token){ if(!token){
wx.navigateTo({ wx.reLaunch({
url: '/pages/login/index', url: '/pages/login/index',
}) })
} }
@ -16,6 +16,9 @@ App({
} }
}) })
}, },
resetUserInfoUpdateTag(){
this.globalData.userInfoGetTime = null;
},
forceGetUserInfo(){ forceGetUserInfo(){
this.globalData.userInfoGetTime = null; this.globalData.userInfoGetTime = null;
return this.getUserInfo(); return this.getUserInfo();
@ -53,16 +56,25 @@ App({
for(var key in rules){ for(var key in rules){
((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{ ((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{
let valid = true; let valid = true;
let value = page.data[key].trim();
//非空 //非空
if(item.required){ if(item.required){
if(page.data[key].trim()==''){ if(value==''){
valid = false; valid = false;
} }
}else if(item.length){ }else if(item.length){
//绝对长度 //绝对长度
if(page.data[key].trim().length!=item.length){ if(value.length!=item.length){
valid = false; 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.length<item.minLength||0){
valid = false
}
} }
if(valid){ if(valid){
page.setData({ page.setData({
@ -73,23 +85,36 @@ App({
[`${key}Message`]:item.message [`${key}Message`]:item.message
}); });
result.push({ result.push({
[key]:item.message [key]:item.message,autoFocus:item.autoFocus,key:key,shake:item.shake
}) })
} }
}) })
} }
return result; const focusInput = result.find((item)=>item.autoFocus);
}, if(focusInput){
validateInput(rule,page){ page.setData({
if(rule.required){ [`${focusInput.key}Focus`]:true
if(page.data[key].trim()==''){ })
page.setData({
[`${key}Message`]:rule.message
});
return false;
}
} }
return 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;
}, },
globalData: { globalData: {
userInfo: null, userInfo: null,

View File

@ -9,6 +9,9 @@ page{
background-color:var(--main-bgclolor); background-color:var(--main-bgclolor);
overflow: hidden; overflow: hidden;
} }
.main-color{
color:var(--main-color);
}
button{ button{
border-radius: 12rpx; border-radius: 12rpx;

View File

@ -1,4 +1,4 @@
<scroll-view scroll-y refresher-enabled="true" bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="height:{{height*2}}rpx;" bindscroll="scrolling"> <scroll-view scroll-y refresher-enabled="true" bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="height:{{height}}px;" bindscroll="scrolling">
<slot/> <slot/>
<view class="load-more" wx:if="{{showLoadMore}}"> <view class="load-more" wx:if="{{showLoadMore}}">
<label class="text" wx:if="{{loadAll}}">{{loadMoreText}}</label> <label class="text" wx:if="{{loadAll}}">{{loadMoreText}}</label>

View File

@ -46,14 +46,16 @@ Page({
deliverStatusKV:orderApi.deliverStatusKV, deliverStatusKV:orderApi.deliverStatusKV,
genderKV:userApi.genderKV genderKV:userApi.genderKV,
completing:false
}, },
onLoad(){ onLoad(){
const windowInfo = wx.getWindowInfo(); const windowInfo = wx.getWindowInfo();
this.setData({ this.setData({
statusBarHeight:windowInfo.statusBarHeight, statusBarHeight:windowInfo.statusBarHeight,
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44 - 125 scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44 - 91
}); });
this.getUserInfo().then(()=>{ this.getUserInfo().then(()=>{
@ -117,6 +119,9 @@ Page({
}, },
async loadStatusDetail(){ async loadStatusDetail(){
const data = await orderApi.statusDetail(this.data.userInfo.community_id); const data = await orderApi.statusDetail(this.data.userInfo.community_id);
this.data.statusDetail.created.value = 0;
this.data.statusDetail.received.value = 0;
this.data.statusDetail.delivering.value = 0;
this.data.statusDetail.completed.value = 0; this.data.statusDetail.completed.value = 0;
data.map((item)=>{ data.map((item)=>{
if(item.status==this.data.orderStatus.unpaid||item.status==this.data.orderStatus.completed){ if(item.status==this.data.orderStatus.unpaid||item.status==this.data.orderStatus.completed){
@ -132,6 +137,7 @@ Page({
statusDetail:this.data.statusDetail statusDetail:this.data.statusDetail
}) })
}, },
//加载楼栋
async loadBuilding(){ async loadBuilding(){
const cid = this.data.userInfo.community_id; const cid = this.data.userInfo.community_id;
const status = this.data.statusDetail[this.data.statusDetailKey]; const status = this.data.statusDetail[this.data.statusDetailKey];
@ -139,7 +145,12 @@ Page({
if(status.key==this.data.orderStatus.completed){ if(status.key==this.data.orderStatus.completed){
_status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}`; _status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}`;
} }
const data = await orderApi.buildingList(cid,_status); let data = await orderApi.buildingList(cid,_status);
let totalCount = 0;
(data||[]).map((item)=>{
totalCount+=item.order_count;
})
data = [{building_name:'全部',order_count:totalCount}].concat(data);
this.setData({ this.setData({
buildingList:data buildingList:data
}); });
@ -152,10 +163,13 @@ Page({
"pager.loading":true "pager.loading":true
}); });
let params = { let params = {
building_id:this.data.buildingList[this.data.buildingIndex].building_id,
skip:this.data.pager.pageIndex*this.data.pager.limit, skip:this.data.pager.pageIndex*this.data.pager.limit,
limit:this.data.pager.limit, limit:this.data.pager.limit,
} }
const buildingId = this.data.buildingList[this.data.buildingIndex].building_id;
if(buildingId){
params.building_id = buildingId;
}
if(this.data.statusDetailKey=='completed'){ if(this.data.statusDetailKey=='completed'){
params.status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}` params.status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}`
}else{ }else{
@ -191,6 +205,7 @@ Page({
openLeftPanel(){ openLeftPanel(){
this.getUserInfo();
this.setData({ this.setData({
isShowLeftPanel:true, isShowLeftPanel:true,
}); });
@ -212,7 +227,10 @@ Page({
}) })
},400) },400)
}, },
refund(){ refund(event){
const item = event.currentTarget.dataset.item;
const index = event.currentTarget.dataset.index;
if(item.receiving)return;
wx.showModal({ wx.showModal({
title: '取消订单需联系客户说明原因', title: '取消订单需联系客户说明原因',
content: '', content: '',
@ -220,7 +238,16 @@ Page({
editable:true, editable:true,
complete: (res) => { complete: (res) => {
if (res.confirm) { if (res.confirm) {
this.setData({
[`list[${index}].receiving`]:true
})
orderApi.cancel(item.orderid,res.content).then((data)=>{
wx.showToast({
title: '取消成功',
icon:'success'
});
this.refreshList();
})
} }
} }
}) })
@ -248,7 +275,11 @@ Page({
//接单 //接单
getOrder(event){ getOrder(event){
const item = event.currentTarget.dataset.item; const item = event.currentTarget.dataset.item;
const index = event.currentTarget.dataset.index;
if(item.receiving)return;
this.setData({
[`list[${index}].receiving`]:true
})
orderApi.receive(item.orderid).then((data)=>{ orderApi.receive(item.orderid).then((data)=>{
wx.showToast({ wx.showToast({
icon:'success', icon:'success',
@ -277,7 +308,6 @@ Page({
}, },
//完成配送 //完成配送
uploadAndConfirmSend(){ uploadAndConfirmSend(){
console.log(this.currentOrder);
if(this.data.tempImgs.length==0){ if(this.data.tempImgs.length==0){
wx.showToast({ wx.showToast({
icon:'error', icon:'error',
@ -285,6 +315,9 @@ Page({
}) })
return; return;
} }
this.setData({
completing:true
})
this.uploadImages().then(()=>{ this.uploadImages().then(()=>{
let urls = []; let urls = [];
this.data.tempImgs.map((item)=>{ this.data.tempImgs.map((item)=>{
@ -292,7 +325,9 @@ Page({
}) })
orderApi.complete(this.currentOrder.orderid,urls).then((data)=>{ orderApi.complete(this.currentOrder.orderid,urls).then((data)=>{
this.setData({ this.setData({
isShowConfirm:false isShowConfirm:false,
completing:false,
tempImgs:[]
}) })
this.refreshList(); this.refreshList();
wx.showToast({ wx.showToast({
@ -300,6 +335,10 @@ Page({
title: '订单已完成', title: '订单已完成',
}) })
}) })
}).catch(()=>{
this.setData({
completing:false
})
}); });
}, },
async uploadImages(){ async uploadImages(){
@ -353,5 +392,6 @@ Page({
}) })
} }
}) })
} },
emptyFun(){}
}) })

View File

@ -53,12 +53,18 @@
</view> </view>
</view> </view>
<view class="btns" wx:if="{{item.status==orderStatus.created}}"> <view class="btns" wx:if="{{item.status==orderStatus.created}}">
<button class="button refund-btn" plain capture-catch:tap="refund" data-item="{{item}}">退单</button> <button disabled="{{item.receiving}}" class="button refund-btn" plain
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="getOrder" data-item="{{item}}" button-text="我要接单" button-loading-text="接单中..."/> capture-catch:tap="refund" data-item="{{item}}" data-index="{{index}}">退单</button>
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="getOrder"
data-item="{{item}}" data-index="{{index}}" button-text="我要接单"
button-loading-text="接单中..." capture-catch:tap="emptyFun"/>
</view> </view>
<view class="btns" wx:if="{{item.status==orderStatus.received}}"> <view class="btns" wx:if="{{item.status==orderStatus.received}}">
<button class="button refund-btn" plain capture-catch:tap="refund" data-item="{{item}}">退单</button> <button disabled="{{item.receiving}}" class="button refund-btn" capture-catch:tap="refund"
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="receivedOrder" data-item="{{item}}" button-text="我已取货" button-loading-text="取货中..."/> plain data-index="{{index}}" data-item="{{item}}">退单</button>
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="receivedOrder"
data-item="{{item}}" data-index="{{index}}" button-text="我已取货"
button-loading-text="取货中..." capture-catch:tap="emptyFun"/>
</view> </view>
<view class="btns" wx:if="{{item.status==orderStatus.delivering}}"> <view class="btns" wx:if="{{item.status==orderStatus.delivering}}">
<button class="button concat-user-btn"> <button class="button concat-user-btn">
@ -84,7 +90,7 @@
<view class="photos"> <view class="photos">
<view class="item {{item.loading?'current':''}}" wx:for="{{tempImgs}}" wx:key="index"> <view class="item {{item.loading?'current':''}}" wx:for="{{tempImgs}}" wx:key="index">
<image class="image" src="{{item.tempFilePath}}"/> <image class="image" src="{{item.tempFilePath}}"/>
<progress wx:if="{{!item.uploaded}}" class="progress" percent="{{item.progress}}" show-info stroke-width="5" show-info="{{false}}"/> <progress wx:if="{{!item.uploaded}}" class="progress" percent="{{item.progress}}" stroke-width="5"/>
</view> </view>
<!-- <view class="item loading"> <!-- <view class="item loading">
<progress class="progress" percent="20" show-info stroke-width="5" show-info="{{false}}"/> <progress class="progress" percent="20" show-info stroke-width="5" show-info="{{false}}"/>
@ -96,7 +102,7 @@
<view class="title">点击拍照</view> <view class="title">点击拍照</view>
</view> </view>
</view> </view>
<button class="button" type="primary" bind:tap="uploadAndConfirmSend">我已送达</button> <button disabled="{{completing}}" class="button" type="primary" bind:tap="uploadAndConfirmSend">我已送达</button>
</view> </view>
</page-container> </page-container>

View File

@ -184,6 +184,10 @@
padding:30rpx 40rpx; padding:30rpx 40rpx;
margin:0; margin:0;
} }
.package-list .item .btns .refund-btn[disabled]{
color:#999;
border-color:rgb(221, 219, 219);
}
.package-list .item .btns .swipe-button{ .package-list .item .btns .swipe-button{
height:96rpx; height:96rpx;
flex:1; flex:1;

View File

@ -7,32 +7,38 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
phone:'13438370499', phone:'',
password:'6x9vw9s2', password:'',
isAgree:false isAgree:false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.validator = {
phone:{type:'phone',message:'请输入正确的手机号',shake:true,autoFocus:true},
password:{required:true,message:'请输入密码',shake:true,autoFocus:true}
}
}, },
login(){ login(){
if(this.data.isAgree){ if(this.data.isAgree){
userApi.login(this.data.phone,this.data.password).then((data)=>{ const valid = app.validateForm(this.validator,this);
app.globalData.userInfo = data.user; console.log(valid,this.validator);
app.globalData.accessToken = data.access_token; if(valid.length==0){
wx.setStorage({ userApi.login(this.data.phone,this.data.password).then((data)=>{
key:'accessToken', app.globalData.userInfo = data.user;
data:data.access_token, app.globalData.accessToken = data.access_token;
success:()=>{ wx.setStorage({
wx.reLaunch({ key:'accessToken',
url: '/pages/index/index', data:data.access_token,
}) success:()=>{
} wx.reLaunch({
url: '/pages/index/index',
})
}
})
}) })
}) }
}else{ }else{
} }

View File

@ -4,17 +4,17 @@
<view class="title">欢迎使用蜂快到家</view> <view class="title">欢迎使用蜂快到家</view>
</view> </view>
<view class="input-area"> <view class="input-area">
<input class="input" model:value="{{phone}}"/> <input class="input" model:value="{{phone}}" placeholder="请输入手机号" animation="{{phoneAnimation}}" focus="{{phoneFocus}}"/>
<input class="input" model:value="{{password}}" type="password"/> <input class="input" model:value="{{password}}" type="password" animation="{{passwordAnimation}}" focus="{{passwordFocus}}" placeholder="请输入密码"/>
<button bind:tap="login" type="primary" class="button">登录</button> <button bind:tap="login" type="primary" class="button">登录</button>
<radio-group bindchange="handleAgreeChange" class="agree"> <radio-group bindchange="handleAgreeChange" class="agree">
<label class="policy"> <label class="policy">
<radio class="radio" value="agree" checked="{{false}}"></radio> <radio class="radio" value="agree"></radio>
<label>我已阅读并同意</label> <label>我已阅读并同意</label>
<label class="yellow">《用户协议》</label>与 <label class="yellow">《用户协议》</label>与
<label class="yellow">《隐私政策》</label> <label class="yellow">《隐私政策》</label>
</label> </label>
</radio-group> </radio-group>
</view> </view>
</view> </view>

View File

@ -32,6 +32,9 @@
padding:0 30rpx; padding:0 30rpx;
margin-bottom:24rpx; margin-bottom:24rpx;
} }
.login .input-area .input.error{
background-color: rgb(252, 198, 198);
}
.login .input-area .button{ .login .input-area .button{
margin-top:50rpx; margin-top:50rpx;
border-radius: 20rpx; border-radius: 20rpx;
@ -48,4 +51,5 @@
.agree .policy{ .agree .policy{
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }

View File

@ -1,12 +1,4 @@
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "订单详情", "navigationBarTitleText": "订单详情"
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "title",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light",
"enablePullDownRefresh": true
}
} }

View File

@ -46,7 +46,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="page-container photos" wx:if="{{orderDetail.order.complete_images}}"> <view class="page-container photos" wx:if="{{orderDetail.order.complete_images&&orderDetail.order.complete_images.length>0}}">
<view class="title">拍照留证</view> <view class="title">拍照留证</view>
<view class="imgs"> <view class="imgs">
<image class="image" src="{{item}}" wx:for="{{orderDetail.order.complete_images}}" wx:key="index" bind:tap="preview" data-url="{{item}}"/> <image class="image" src="{{item}}" wx:for="{{orderDetail.order.complete_images}}" wx:key="index" bind:tap="preview" data-url="{{item}}"/>

View File

@ -1,4 +1,5 @@
import userApi from '../../../../api/user'; import userApi from '../../../../api/user';
const app = getApp();
Page({ Page({
@ -10,7 +11,11 @@ Page({
bankName:'', bankName:'',
cardNumber:'',//16-19 cardNumber:'',//16-19
}, },
validator:{
name:{minLength:2,message:'持卡人姓名至少 2 个字',autoFocus:true,shake:true},
bankName:{required:true,message:'请输入开户银行',autoFocus:true,shake:true},
cardNumber:{minLength:16,maxLength:19,message:'银行卡号 16-19 位数字',autoFocus:true,shake:true}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -19,20 +24,23 @@ Page({
}, },
addCard(){ addCard(){
userApi.bankCard.add({ const valid = app.validateForm(this.validator,this);
name:this.data.name, if(valid.length==0){
card_number:this.data.cardNumber, userApi.bankCard.add({
bank_name:this.data.bankName name:this.data.name,
}).then(()=>{ card_number:this.data.cardNumber,
wx.navigateBack({ bank_name:this.data.bankName
success(){ }).then(()=>{
wx.showToast({ wx.navigateBack({
icon:'success', success(){
title: '添加成功', wx.showToast({
}) icon:'success',
} title: '添加成功',
}); })
}) }
});
})
}
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

View File

@ -3,19 +3,25 @@
<view class="cell"> <view class="cell">
<view class="cell-hd">持卡姓名</view> <view class="cell-hd">持卡姓名</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请输入持卡姓名" model:value="{{name}}"/> <input placeholder="请输入持卡姓名" model:value="{{name}}"
animation="{{nameAnimation}}" focus="{{nameFocus}}"/>
<view class="error">{{nameMessage}}</view>
</view> </view>
</view> </view>
<view class="cell"> <view class="cell">
<view class="cell-hd">开户银行</view> <view class="cell-hd">开户银行</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请输入开户银行" model:value="{{bankName}}"/> <input placeholder="请输入开户银行" model:value="{{bankName}}"
animation="{{bankNameAnimation}}" focus="{{bankNameFocus}}"/>
<view class="error">{{bankNameMessage}}</view>
</view> </view>
</view> </view>
<view class="cell"> <view class="cell">
<view class="cell-hd">银行卡号</view> <view class="cell-hd">银行卡号</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请输入银行卡号" model:value="{{cardNumber}}"/> <input placeholder="请输入银行卡号" model:value="{{cardNumber}}" type="number"
animation="{{cardNumberAnimation}}" focus="{{cardNumberFocus}}"/>
<view class="error">{{cardNumberMessage}}</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -8,7 +8,8 @@ Page({
*/ */
data: { data: {
summary:{}, summary:{},
refreshTrigger:false refreshTrigger:false,
isAuth:false
}, },
/** /**
@ -37,6 +38,11 @@ Page({
*/ */
onShow() { onShow() {
this.refreshSummary(); this.refreshSummary();
app.getUserInfo().then((data)=>{
this.setData({
isAuth:data.is_auth
})
})
}, },
/** /**

View File

@ -12,7 +12,7 @@
</navigator> </navigator>
</view> </view>
<view class="cells"> <view class="cells cells-access">
<navigator url="/pages/user/income/index" class="cell" hover-class="cell-active"> <navigator url="/pages/user/income/index" class="cell" hover-class="cell-active">
<view class="cell-bd invite-cell"> <view class="cell-bd invite-cell">
<view>交易明细</view> <view>交易明细</view>
@ -30,7 +30,9 @@
<view class="cell-bd"> <view class="cell-bd">
<view>实名认证</view> <view>实名认证</view>
</view> </view>
<view class="cell-ft"></view> <view class="cell-ft">
<label class="main-color">{{isAuth?'已认证':''}}</label>
</view>
</navigator> </navigator>
<navigator url="/pages/user/bank/index/index" class="cell" hover-class="cell-active"> <navigator url="/pages/user/bank/index/index" class="cell" hover-class="cell-active">
<view class="cell-bd"> <view class="cell-bd">

View File

@ -18,11 +18,11 @@ Page({
}, },
validator:{ validator:{
verifyCode:[ verifyCode:[
{required:true,message:'请输入验证码'}, {required:true,message:'请输入验证码',shake:true,autoFocus:true},
{length:6,message:'请输入 6 位数验证码'} {length:6,message:'请输入 6 位数验证码',shake:true,autoFocus:true}
], ],
password:{required:true,message:'请输入新密码'}, password:{minLength:6,message:'请输入至少 6 位新密码',shake:true,autoFocus:true},
rePassword:{required:true,message:'请输入确认新密码'}, rePassword:{minLength:true,message:'请输入确认新密码',shake:true,autoFocus:true},
}, },
/** /**

View File

@ -6,7 +6,8 @@
<view class="cell"> <view class="cell">
<view class="cell-hd">验证码</view> <view class="cell-hd">验证码</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请输入验证码" model:value="{{verifyCode}}"/> <input placeholder="请输入验证码" model:value="{{verifyCode}}"
animation="{{verifyCodeAnimation}}" focus="{{verifyCodeFocus}}"/>
<view class="error">{{verifyCodeMessage}}</view> <view class="error">{{verifyCodeMessage}}</view>
</view> </view>
<view class="cell-ft"> <view class="cell-ft">
@ -19,14 +20,16 @@
<view class="cell"> <view class="cell">
<view class="cell-hd">新密码</view> <view class="cell-hd">新密码</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请输入新密码" model:value="{{password}}"/> <input placeholder="请输入新密码" model:value="{{password}}"
animation="{{passwordAnimation}}" focus="{{passwordFocus}}"/>
<view class="error">{{passwordMessage}}</view> <view class="error">{{passwordMessage}}</view>
</view> </view>
</view> </view>
<view class="cell"> <view class="cell">
<view class="cell-hd">确认新密码</view> <view class="cell-hd">确认新密码</view>
<view class="cell-bd"> <view class="cell-bd">
<input placeholder="请确认新密码" model:value="{{rePassword}}"/> <input placeholder="请确认新密码" model:value="{{rePassword}}"
animation="{{rePasswordAnimation}}" focus="{{rePasswordFocus}}"/>
<view class="error">{{rePasswordMessage}}</view> <view class="error">{{rePasswordMessage}}</view>
</view> </view>
</view> </view>

View File

@ -1,5 +1,5 @@
import user from '../../../api/user';
import userApi from '../../../api/user'; import userApi from '../../../api/user';
const app = getApp();
Page({ Page({
@ -28,9 +28,18 @@ Page({
}, },
save(){ save(){
app.resetUserInfoUpdateTag();
userApi.setRNAuth({ userApi.setRNAuth({
name:this.data.name, name:this.data.name,
id_number:this.data.idCard id_number:this.data.idCard
}).then((data)=>{
wx.navigateBack({
success(){
wx.showToast({
title: '保存成功',
})
}
})
}) })
}, },
/** /**

View File

@ -80,6 +80,38 @@ Page({
}) })
} }
}, },
amountInput(event){
console.log(event.detail);
let amount = event.detail.value;
if(amount&&isNaN(parseFloat(amount))){
amount = 0;
}else{
let a = amount.split('.');
if(a.length>1&&a[1]==''){
}else{
if(a.length>1){
amount = parseFloat(amount).toFixed(1);
}else if(a.length==1&&a[0]!=''){
amount = `${parseInt(amount)}`;
}
if(amount>this.data.summary.balance){
amount = this.data.summary.balance;
}
}
}
this.setData({
amount:amount
});
},
amountBlur(){
const a = this.data.amount.split('.');
if(a[1]==''){
this.setData({
amount:parseInt(a)
})
}
},
navToAddCard(){ navToAddCard(){
wx.navigateTo({ wx.navigateTo({
url: '/pages/user/bank/editor/index', url: '/pages/user/bank/editor/index',

View File

@ -4,7 +4,7 @@
<view class="value">24小时到账</view> <view class="value">24小时到账</view>
</view> </view>
<view class="input-area"> <view class="input-area">
<input class="input" placeholder="请输入提现金额" type="digit" focus="{{inputFocus}}" model:value="{{amount}}"/> <input class="input" placeholder="请输入提现金额" type="digit" focus="{{inputFocus}}" value="{{amount}}" bindinput="amountInput" bindblur="amountBlur"/>
<view class="error">{{amountMessage}}</view> <view class="error">{{amountMessage}}</view>
</view> </view>
<view class="bottom"> <view class="bottom">

View File

@ -17,8 +17,9 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
const windowInfo = wx.getWindowInfo(); const windowInfo = wx.getWindowInfo();
console.log(windowInfo);
this.setData({ this.setData({
scrollViewHeight:windowInfo.windowHeight scrollViewHeight:windowInfo.windowHeight - windowInfo.statusBarHeight - 44
}) })
this.loadList(); this.loadList();
}, },

View File

@ -3,13 +3,16 @@
refresher-triggered="{{pager.refreshTrigger}}" refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(list.length==0&&pager.loadAll)}}" show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}"> loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view class="income-list"> <view class="withdraw-list">
<view class="item" wx:for="{{list}}"> <view class="item" wx:for="{{list}}" wx:key="index">
<view class="content"> <view class="title">
<view class="title">{{item.description}}</view> <view class="left">{{item.description||"招商银行"}}</view>
<view class="sub-title">{{item.create_time}}</view> <view class="right money">{{item.amount}}</view>
</view>
<view class="sub-title">
<view class="left">{{item.create_time}}</view>
<view class="status {{item.status}}">平台受理成功</view>
</view> </view>
<view class="money">{{item.amount}}</view>
</view> </view>
</view> </view>
</list-view> </list-view>

View File

@ -1,24 +1,32 @@
.income-list{ .withdraw-list{
background-color: #ffffff; background-color: #ffffff;
margin-top:20rpx; margin-top:20rpx;
} }
.income-list .item{ .withdraw-list .item{
display: flex;
padding:40rpx 30rpx; padding:40rpx 30rpx;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2); border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
} }
.income-list .item .content{
.withdraw-list .item .title{
display: flex;
}
.withdraw-list .item .left{
flex:1; flex:1;
} }
.income-list .item .title{ .withdraw-list .item .sub-title{
font-size: 32rpx; display: flex;
} margin-top:38rpx;
.income-list .item .sub-title{ color: #999999;
margin-top:32rpx;
color: #888888;
} }
.income-list .item .money{ .withdraw-list .item .money{
color:var(--main-font-color);
font-size: 36rpx;
font-weight: 500;
}
.withdraw-list .item .status{
font-size: 27rpx;
}
.withdraw-list .item .status.PENDING{
color:var(--main-color); color:var(--main-color);
} }