若干 bug
This commit is contained in:
parent
e6ec7ecd96
commit
fa443237c7
@ -18,11 +18,12 @@ export default {
|
||||
},
|
||||
|
||||
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}`),
|
||||
|
||||
statusDetail:(community_id)=>request.get('/api/order/status/count',{community_id}),
|
||||
receive:(orderid)=>request.post(`/api/order/${orderid}/deliveryman/receive`),
|
||||
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})
|
||||
}
|
||||
@ -3,22 +3,16 @@ let app = getApp();
|
||||
|
||||
const sendRequest = (options)=>{
|
||||
if(!app)app = getApp();
|
||||
let timer;
|
||||
if(options.options.delayLoading){
|
||||
timer = setTimeout(()=>{
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
})
|
||||
},800)
|
||||
if(options.method!='get'){
|
||||
wx.showLoading({
|
||||
title: '请等待...',
|
||||
})
|
||||
}
|
||||
return new Promise((rs,rj)=>{
|
||||
wx.request({
|
||||
url: `${baseUrl}${options.url}`,
|
||||
success:(result)=>{
|
||||
if(timer){
|
||||
clearTimeout(timer);
|
||||
wx.hideLoading();
|
||||
}
|
||||
wx.hideLoading();
|
||||
if(result.statusCode==200){
|
||||
if(result.data.code==200){
|
||||
rs(result.data.data);
|
||||
@ -27,7 +21,7 @@ const sendRequest = (options)=>{
|
||||
if(!options.options.noTips){
|
||||
wx.showToast({
|
||||
icon:'error',
|
||||
title: result.data.message,
|
||||
title: result.data.message||'发生错误',
|
||||
});
|
||||
}
|
||||
rj(result.data);
|
||||
@ -38,6 +32,12 @@ const sendRequest = (options)=>{
|
||||
})
|
||||
}else{
|
||||
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'
|
||||
},
|
||||
fail:(res)=>{
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: 'Request Error',
|
||||
})
|
||||
|
||||
@ -11,7 +11,7 @@ export default {
|
||||
summary:()=>request.get('/api/account/summary'),
|
||||
orderSummary:()=>request.get('/api/order/deliveryman/summary'),
|
||||
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),
|
||||
|
||||
bankCard:{
|
||||
|
||||
55
app.js
55
app.js
@ -6,7 +6,7 @@ App({
|
||||
verifyCodeWaitingTime:60,
|
||||
onLaunch() {
|
||||
if(!token){
|
||||
wx.navigateTo({
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/index',
|
||||
})
|
||||
}
|
||||
@ -16,6 +16,9 @@ App({
|
||||
}
|
||||
})
|
||||
},
|
||||
resetUserInfoUpdateTag(){
|
||||
this.globalData.userInfoGetTime = null;
|
||||
},
|
||||
forceGetUserInfo(){
|
||||
this.globalData.userInfoGetTime = null;
|
||||
return this.getUserInfo();
|
||||
@ -53,16 +56,25 @@ App({
|
||||
for(var key in rules){
|
||||
((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{
|
||||
let valid = true;
|
||||
let value = page.data[key].trim();
|
||||
//非空
|
||||
if(item.required){
|
||||
if(page.data[key].trim()==''){
|
||||
if(value==''){
|
||||
valid = false;
|
||||
}
|
||||
}else if(item.length){
|
||||
//绝对长度
|
||||
if(page.data[key].trim().length!=item.length){
|
||||
if(value.length!=item.length){
|
||||
valid = false;
|
||||
}
|
||||
}else if(item.type=='phone'){
|
||||
if(value.length!=11){
|
||||
valid = false;
|
||||
}
|
||||
}else if(item.maxLength||item.minLength){
|
||||
if(value.length>(item.maxLength||Infinity)||value.length<item.minLength||0){
|
||||
valid = false
|
||||
}
|
||||
}
|
||||
if(valid){
|
||||
page.setData({
|
||||
@ -73,23 +85,36 @@ App({
|
||||
[`${key}Message`]:item.message
|
||||
});
|
||||
result.push({
|
||||
[key]:item.message
|
||||
[key]:item.message,autoFocus:item.autoFocus,key:key,shake:item.shake
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
return result;
|
||||
},
|
||||
validateInput(rule,page){
|
||||
if(rule.required){
|
||||
if(page.data[key].trim()==''){
|
||||
page.setData({
|
||||
[`${key}Message`]:rule.message
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const focusInput = result.find((item)=>item.autoFocus);
|
||||
if(focusInput){
|
||||
page.setData({
|
||||
[`${focusInput.key}Focus`]:true
|
||||
})
|
||||
}
|
||||
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: {
|
||||
userInfo: null,
|
||||
|
||||
3
app.wxss
3
app.wxss
@ -9,6 +9,9 @@ page{
|
||||
background-color:var(--main-bgclolor);
|
||||
overflow: hidden;
|
||||
}
|
||||
.main-color{
|
||||
color:var(--main-color);
|
||||
}
|
||||
|
||||
button{
|
||||
border-radius: 12rpx;
|
||||
|
||||
@ -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/>
|
||||
<view class="load-more" wx:if="{{showLoadMore}}">
|
||||
<label class="text" wx:if="{{loadAll}}">{{loadMoreText}}</label>
|
||||
|
||||
@ -46,14 +46,16 @@ Page({
|
||||
|
||||
deliverStatusKV:orderApi.deliverStatusKV,
|
||||
|
||||
genderKV:userApi.genderKV
|
||||
genderKV:userApi.genderKV,
|
||||
|
||||
completing:false
|
||||
},
|
||||
onLoad(){
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
|
||||
this.setData({
|
||||
statusBarHeight:windowInfo.statusBarHeight,
|
||||
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44 - 125
|
||||
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44 - 91
|
||||
});
|
||||
|
||||
this.getUserInfo().then(()=>{
|
||||
@ -117,6 +119,9 @@ Page({
|
||||
},
|
||||
async loadStatusDetail(){
|
||||
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;
|
||||
data.map((item)=>{
|
||||
if(item.status==this.data.orderStatus.unpaid||item.status==this.data.orderStatus.completed){
|
||||
@ -132,6 +137,7 @@ Page({
|
||||
statusDetail:this.data.statusDetail
|
||||
})
|
||||
},
|
||||
//加载楼栋
|
||||
async loadBuilding(){
|
||||
const cid = this.data.userInfo.community_id;
|
||||
const status = this.data.statusDetail[this.data.statusDetailKey];
|
||||
@ -139,7 +145,12 @@ Page({
|
||||
if(status.key==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({
|
||||
buildingList:data
|
||||
});
|
||||
@ -152,10 +163,13 @@ Page({
|
||||
"pager.loading":true
|
||||
});
|
||||
let params = {
|
||||
building_id:this.data.buildingList[this.data.buildingIndex].building_id,
|
||||
skip:this.data.pager.pageIndex*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'){
|
||||
params.status = `${this.data.orderStatus.unpaid},${this.data.orderStatus.completed}`
|
||||
}else{
|
||||
@ -191,6 +205,7 @@ Page({
|
||||
|
||||
|
||||
openLeftPanel(){
|
||||
this.getUserInfo();
|
||||
this.setData({
|
||||
isShowLeftPanel:true,
|
||||
});
|
||||
@ -212,7 +227,10 @@ Page({
|
||||
})
|
||||
},400)
|
||||
},
|
||||
refund(){
|
||||
refund(event){
|
||||
const item = event.currentTarget.dataset.item;
|
||||
const index = event.currentTarget.dataset.index;
|
||||
if(item.receiving)return;
|
||||
wx.showModal({
|
||||
title: '取消订单需联系客户说明原因',
|
||||
content: '',
|
||||
@ -220,7 +238,16 @@ Page({
|
||||
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();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -248,7 +275,11 @@ Page({
|
||||
//接单
|
||||
getOrder(event){
|
||||
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)=>{
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
@ -277,7 +308,6 @@ Page({
|
||||
},
|
||||
//完成配送
|
||||
uploadAndConfirmSend(){
|
||||
console.log(this.currentOrder);
|
||||
if(this.data.tempImgs.length==0){
|
||||
wx.showToast({
|
||||
icon:'error',
|
||||
@ -285,6 +315,9 @@ Page({
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
completing:true
|
||||
})
|
||||
this.uploadImages().then(()=>{
|
||||
let urls = [];
|
||||
this.data.tempImgs.map((item)=>{
|
||||
@ -292,7 +325,9 @@ Page({
|
||||
})
|
||||
orderApi.complete(this.currentOrder.orderid,urls).then((data)=>{
|
||||
this.setData({
|
||||
isShowConfirm:false
|
||||
isShowConfirm:false,
|
||||
completing:false,
|
||||
tempImgs:[]
|
||||
})
|
||||
this.refreshList();
|
||||
wx.showToast({
|
||||
@ -300,6 +335,10 @@ Page({
|
||||
title: '订单已完成',
|
||||
})
|
||||
})
|
||||
}).catch(()=>{
|
||||
this.setData({
|
||||
completing:false
|
||||
})
|
||||
});
|
||||
},
|
||||
async uploadImages(){
|
||||
@ -353,5 +392,6 @@ Page({
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
emptyFun(){}
|
||||
})
|
||||
|
||||
@ -53,12 +53,18 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns" wx:if="{{item.status==orderStatus.created}}">
|
||||
<button class="button refund-btn" plain capture-catch:tap="refund" data-item="{{item}}">退单</button>
|
||||
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="getOrder" data-item="{{item}}" button-text="我要接单" button-loading-text="接单中..."/>
|
||||
<button disabled="{{item.receiving}}" class="button refund-btn" plain
|
||||
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 class="btns" wx:if="{{item.status==orderStatus.received}}">
|
||||
<button class="button refund-btn" plain capture-catch:tap="refund" data-item="{{item}}">退单</button>
|
||||
<swipe-button class="swipe-button" loading="{{item.receiving}}" bind:done="receivedOrder" data-item="{{item}}" button-text="我已取货" button-loading-text="取货中..."/>
|
||||
<button disabled="{{item.receiving}}" class="button refund-btn" capture-catch:tap="refund"
|
||||
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 class="btns" wx:if="{{item.status==orderStatus.delivering}}">
|
||||
<button class="button concat-user-btn">
|
||||
@ -84,7 +90,7 @@
|
||||
<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}}" show-info stroke-width="5" show-info="{{false}}"/>
|
||||
<progress wx:if="{{!item.uploaded}}" class="progress" percent="{{item.progress}}" stroke-width="5"/>
|
||||
</view>
|
||||
<!-- <view class="item loading">
|
||||
<progress class="progress" percent="20" show-info stroke-width="5" show-info="{{false}}"/>
|
||||
@ -96,7 +102,7 @@
|
||||
<view class="title">点击拍照</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="button" type="primary" bind:tap="uploadAndConfirmSend">我已送达</button>
|
||||
<button disabled="{{completing}}" class="button" type="primary" bind:tap="uploadAndConfirmSend">我已送达</button>
|
||||
</view>
|
||||
</page-container>
|
||||
|
||||
|
||||
@ -184,6 +184,10 @@
|
||||
padding:30rpx 40rpx;
|
||||
margin:0;
|
||||
}
|
||||
.package-list .item .btns .refund-btn[disabled]{
|
||||
color:#999;
|
||||
border-color:rgb(221, 219, 219);
|
||||
}
|
||||
.package-list .item .btns .swipe-button{
|
||||
height:96rpx;
|
||||
flex:1;
|
||||
|
||||
@ -7,32 +7,38 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
phone:'13438370499',
|
||||
password:'6x9vw9s2',
|
||||
phone:'',
|
||||
password:'',
|
||||
isAgree:false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
this.validator = {
|
||||
phone:{type:'phone',message:'请输入正确的手机号',shake:true,autoFocus:true},
|
||||
password:{required:true,message:'请输入密码',shake:true,autoFocus:true}
|
||||
}
|
||||
},
|
||||
login(){
|
||||
if(this.data.isAgree){
|
||||
userApi.login(this.data.phone,this.data.password).then((data)=>{
|
||||
app.globalData.userInfo = data.user;
|
||||
app.globalData.accessToken = data.access_token;
|
||||
wx.setStorage({
|
||||
key:'accessToken',
|
||||
data:data.access_token,
|
||||
success:()=>{
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
const valid = app.validateForm(this.validator,this);
|
||||
console.log(valid,this.validator);
|
||||
if(valid.length==0){
|
||||
userApi.login(this.data.phone,this.data.password).then((data)=>{
|
||||
app.globalData.userInfo = data.user;
|
||||
app.globalData.accessToken = data.access_token;
|
||||
wx.setStorage({
|
||||
key:'accessToken',
|
||||
data:data.access_token,
|
||||
success:()=>{
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
@ -4,17 +4,17 @@
|
||||
<view class="title">欢迎使用蜂快到家</view>
|
||||
</view>
|
||||
<view class="input-area">
|
||||
<input class="input" model:value="{{phone}}"/>
|
||||
<input class="input" model:value="{{password}}" type="password"/>
|
||||
<input class="input" model:value="{{phone}}" placeholder="请输入手机号" animation="{{phoneAnimation}}" focus="{{phoneFocus}}"/>
|
||||
<input class="input" model:value="{{password}}" type="password" animation="{{passwordAnimation}}" focus="{{passwordFocus}}" placeholder="请输入密码"/>
|
||||
<button bind:tap="login" type="primary" class="button">登录</button>
|
||||
|
||||
<radio-group bindchange="handleAgreeChange" class="agree">
|
||||
<label class="policy">
|
||||
<radio class="radio" value="agree" checked="{{false}}"></radio>
|
||||
<radio class="radio" value="agree"></radio>
|
||||
<label>我已阅读并同意</label>
|
||||
<label class="yellow">《用户协议》</label>与
|
||||
<label class="yellow">《隐私政策》</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -32,6 +32,9 @@
|
||||
padding:0 30rpx;
|
||||
margin-bottom:24rpx;
|
||||
}
|
||||
.login .input-area .input.error{
|
||||
background-color: rgb(252, 198, 198);
|
||||
}
|
||||
.login .input-area .button{
|
||||
margin-top:50rpx;
|
||||
border-radius: 20rpx;
|
||||
@ -48,4 +51,5 @@
|
||||
.agree .policy{
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "订单详情",
|
||||
"window": {
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "title",
|
||||
"backgroundColor": "#eeeeee",
|
||||
"backgroundTextStyle": "light",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
@ -46,7 +46,7 @@
|
||||
</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="imgs">
|
||||
<image class="image" src="{{item}}" wx:for="{{orderDetail.order.complete_images}}" wx:key="index" bind:tap="preview" data-url="{{item}}"/>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import userApi from '../../../../api/user';
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
||||
@ -10,7 +11,11 @@ Page({
|
||||
bankName:'',
|
||||
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(){
|
||||
userApi.bankCard.add({
|
||||
name:this.data.name,
|
||||
card_number:this.data.cardNumber,
|
||||
bank_name:this.data.bankName
|
||||
}).then(()=>{
|
||||
wx.navigateBack({
|
||||
success(){
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
title: '添加成功',
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
const valid = app.validateForm(this.validator,this);
|
||||
if(valid.length==0){
|
||||
userApi.bankCard.add({
|
||||
name:this.data.name,
|
||||
card_number:this.data.cardNumber,
|
||||
bank_name:this.data.bankName
|
||||
}).then(()=>{
|
||||
wx.navigateBack({
|
||||
success(){
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
title: '添加成功',
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
|
||||
@ -3,19 +3,25 @@
|
||||
<view class="cell">
|
||||
<view class="cell-hd">持卡姓名</view>
|
||||
<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 class="cell">
|
||||
<view class="cell-hd">开户银行</view>
|
||||
<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 class="cell">
|
||||
<view class="cell-hd">银行卡号</view>
|
||||
<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>
|
||||
|
||||
@ -8,7 +8,8 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
summary:{},
|
||||
refreshTrigger:false
|
||||
refreshTrigger:false,
|
||||
isAuth:false
|
||||
},
|
||||
|
||||
/**
|
||||
@ -37,6 +38,11 @@ Page({
|
||||
*/
|
||||
onShow() {
|
||||
this.refreshSummary();
|
||||
app.getUserInfo().then((data)=>{
|
||||
this.setData({
|
||||
isAuth:data.is_auth
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view class="cells">
|
||||
<view class="cells cells-access">
|
||||
<navigator url="/pages/user/income/index" class="cell" hover-class="cell-active">
|
||||
<view class="cell-bd invite-cell">
|
||||
<view>交易明细</view>
|
||||
@ -30,7 +30,9 @@
|
||||
<view class="cell-bd">
|
||||
<view>实名认证</view>
|
||||
</view>
|
||||
<view class="cell-ft"></view>
|
||||
<view class="cell-ft">
|
||||
<label class="main-color">{{isAuth?'已认证':''}}</label>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator url="/pages/user/bank/index/index" class="cell" hover-class="cell-active">
|
||||
<view class="cell-bd">
|
||||
|
||||
@ -18,11 +18,11 @@ Page({
|
||||
},
|
||||
validator:{
|
||||
verifyCode:[
|
||||
{required:true,message:'请输入验证码'},
|
||||
{length:6,message:'请输入 6 位数验证码'}
|
||||
{required:true,message:'请输入验证码',shake:true,autoFocus:true},
|
||||
{length:6,message:'请输入 6 位数验证码',shake:true,autoFocus:true}
|
||||
],
|
||||
password:{required:true,message:'请输入新密码'},
|
||||
rePassword:{required:true,message:'请输入确认新密码'},
|
||||
password:{minLength:6,message:'请输入至少 6 位新密码',shake:true,autoFocus:true},
|
||||
rePassword:{minLength:true,message:'请输入确认新密码',shake:true,autoFocus:true},
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -6,7 +6,8 @@
|
||||
<view class="cell">
|
||||
<view class="cell-hd">验证码</view>
|
||||
<view class="cell-bd">
|
||||
<input placeholder="请输入验证码" model:value="{{verifyCode}}"/>
|
||||
<input placeholder="请输入验证码" model:value="{{verifyCode}}"
|
||||
animation="{{verifyCodeAnimation}}" focus="{{verifyCodeFocus}}"/>
|
||||
<view class="error">{{verifyCodeMessage}}</view>
|
||||
</view>
|
||||
<view class="cell-ft">
|
||||
@ -19,14 +20,16 @@
|
||||
<view class="cell">
|
||||
<view class="cell-hd">新密码</view>
|
||||
<view class="cell-bd">
|
||||
<input placeholder="请输入新密码" model:value="{{password}}"/>
|
||||
<input placeholder="请输入新密码" model:value="{{password}}"
|
||||
animation="{{passwordAnimation}}" focus="{{passwordFocus}}"/>
|
||||
<view class="error">{{passwordMessage}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="cell-hd">确认新密码</view>
|
||||
<view class="cell-bd">
|
||||
<input placeholder="请确认新密码" model:value="{{rePassword}}"/>
|
||||
<input placeholder="请确认新密码" model:value="{{rePassword}}"
|
||||
animation="{{rePasswordAnimation}}" focus="{{rePasswordFocus}}"/>
|
||||
<view class="error">{{rePasswordMessage}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import user from '../../../api/user';
|
||||
import userApi from '../../../api/user';
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
||||
@ -28,9 +28,18 @@ Page({
|
||||
},
|
||||
|
||||
save(){
|
||||
app.resetUserInfoUpdateTag();
|
||||
userApi.setRNAuth({
|
||||
name:this.data.name,
|
||||
id_number:this.data.idCard
|
||||
}).then((data)=>{
|
||||
wx.navigateBack({
|
||||
success(){
|
||||
wx.showToast({
|
||||
title: '保存成功',
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
||||
@ -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(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/user/bank/editor/index',
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<view class="value">24小时到账</view>
|
||||
</view>
|
||||
<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>
|
||||
<view class="bottom">
|
||||
|
||||
@ -17,8 +17,9 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
console.log(windowInfo);
|
||||
this.setData({
|
||||
scrollViewHeight:windowInfo.windowHeight
|
||||
scrollViewHeight:windowInfo.windowHeight - windowInfo.statusBarHeight - 44
|
||||
})
|
||||
this.loadList();
|
||||
},
|
||||
|
||||
@ -3,13 +3,16 @@
|
||||
refresher-triggered="{{pager.refreshTrigger}}"
|
||||
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
|
||||
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
|
||||
<view class="income-list">
|
||||
<view class="item" wx:for="{{list}}">
|
||||
<view class="content">
|
||||
<view class="title">{{item.description}}</view>
|
||||
<view class="sub-title">{{item.create_time}}</view>
|
||||
<view class="withdraw-list">
|
||||
<view class="item" wx:for="{{list}}" wx:key="index">
|
||||
<view class="title">
|
||||
<view class="left">{{item.description||"招商银行"}}</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 class="money">{{item.amount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</list-view>
|
||||
@ -1,24 +1,32 @@
|
||||
.income-list{
|
||||
.withdraw-list{
|
||||
background-color: #ffffff;
|
||||
margin-top:20rpx;
|
||||
}
|
||||
.income-list .item{
|
||||
display: flex;
|
||||
.withdraw-list .item{
|
||||
padding:40rpx 30rpx;
|
||||
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;
|
||||
|
||||
}
|
||||
.income-list .item .title{
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.income-list .item .sub-title{
|
||||
margin-top:32rpx;
|
||||
color: #888888;
|
||||
.withdraw-list .item .sub-title{
|
||||
display: flex;
|
||||
margin-top:38rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.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);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user