整理订单状态显示及功能按钮
This commit is contained in:
@@ -302,7 +302,7 @@
|
|||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$navTo('pages/order/index', {}, 'redirectTo')
|
this.$navTo('pages/order/index', {}, 'redirectTo')
|
||||||
}, 1200)
|
}, 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/help/xieyi",
|
"path": "pages/help/xieyi",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "租赁服务协议与隐私协议"
|
"navigationBarTitleText": "协议"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -378,12 +378,11 @@
|
|||||||
"path": "pages/withdraw/log/log",
|
"path": "pages/withdraw/log/log",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "提现记录",
|
"navigationBarTitleText": "提现记录",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": true,
|
||||||
"disableScroll":false,
|
"disableScroll":false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"bounce" : "none" // 取消APP端iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
|
"bounce" : "none" // 取消APP端iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
|
||||||
},
|
}
|
||||||
"mp-alipay":{"allowsBounceVertical":"NO"} // 取消支付宝和钉钉小程序的iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,8 +102,8 @@
|
|||||||
|
|
||||||
<view class="xieyi">
|
<view class="xieyi">
|
||||||
<checkbox-group @change="onAgree" style="display: flex; align-items: center;">
|
<checkbox-group @change="onAgree" style="display: flex; align-items: center;">
|
||||||
<checkbox :checked="agree" />我已同意并阅读<div class="xieyi-text" @click="showXieyi">《服务协议》</div>与<div
|
<checkbox :checked="agree" />我已同意并阅读<div class="xieyi-text" @click="showXieyi(64)">《租赁合同》</div>与<div
|
||||||
class="xieyi-text" @click="showXieyi">《隐私协议》</div>
|
class="xieyi-text" @click="showXieyi(51)">《隐私协议》</div>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -180,8 +180,8 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
var time = new Date().getTime() + 60 * 60 * 1000 * 24
|
var time = new Date().getTime() + 60 * 60 * 1000 * 24
|
||||||
const expirationTime = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(time))
|
const expirationTime = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(time))
|
||||||
console.log("time: ", time);
|
// console.log("time: ", time);
|
||||||
console.log("expirationTime: ", expirationTime);
|
// console.log("expirationTime: ", expirationTime);
|
||||||
payQuery(752).then(res => {
|
payQuery(752).then(res => {
|
||||||
console.log("res123: ", res);
|
console.log("res123: ", res);
|
||||||
})
|
})
|
||||||
@@ -213,8 +213,8 @@
|
|||||||
onAgree() {
|
onAgree() {
|
||||||
this.agree = !this.agree
|
this.agree = !this.agree
|
||||||
},
|
},
|
||||||
showXieyi() {
|
showXieyi(xyId) {
|
||||||
this.$navTo('pages/help/xieyi')
|
this.$navTo('pages/help/xieyi?id=' + xyId)
|
||||||
},
|
},
|
||||||
copyCode(text) {
|
copyCode(text) {
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
@@ -322,25 +322,37 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
checkFreeze(orderId).then(() => {
|
checkFreeze(orderId).then((res) => {
|
||||||
app.$success("下单成功")
|
console.log(record.equipmentCategory + ": " + res)
|
||||||
setTimeout(() => {
|
if(res.code == 0){
|
||||||
uni.redirectTo({
|
app.$success("下单成功")
|
||||||
url: '/pages/order/index'
|
setTimeout(() => {
|
||||||
})
|
uni.redirectTo({
|
||||||
}, 100)
|
url: '/pages/order/index'
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(res.errMsg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
checkFreeze(orderId).then(() => {
|
checkFreeze(orderId).then((res) => {
|
||||||
app.$success("下单成功")
|
console.log(res)
|
||||||
setTimeout(() => {
|
if(res.code == 0){
|
||||||
uni.redirectTo({
|
app.$success("下单成功")
|
||||||
url: '/pages/order/index'
|
setTimeout(() => {
|
||||||
})
|
uni.redirectTo({
|
||||||
}, 100)
|
url: '/pages/order/index'
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(res.errMsg)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const app = this
|
const app = this
|
||||||
pageArticle({
|
pageArticle({
|
||||||
categoryId: 51
|
categoryId: options.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
app.itemList = res.data.list
|
app.itemList = res.data.list
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
const app = this
|
const app = this
|
||||||
console.log("app.shopList.length: ",app.$store.getters.token);
|
console.log("app.shopList.length: ",app.$store.getters.token);
|
||||||
if(app.shopList.length == 0){
|
if(app.shopList.length == 0){
|
||||||
console.log("sssss: ");
|
|
||||||
app.getShopList(app.longitude,app.latitude)
|
app.getShopList(app.longitude,app.latitude)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
<view class="page-title">身份证信息</view>
|
<view class="page-title">身份证信息</view>
|
||||||
<view class="form-wrapper">
|
<view class="form-wrapper">
|
||||||
<u-form-item label="正面" prop="img1">
|
<u-form-item label="正面" prop="img1">
|
||||||
<image :src="orderSourceData[0]" v-if="orderSourceData[0]" mode="aspectFill" style="width: 300rpx;height: 200rpx"></image>
|
<image :src="orderSourceData[0]" v-if="orderSourceData[0]" mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(1)"></image>
|
||||||
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(1)"></image>
|
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(1)"></image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="反面" prop="img2">
|
<u-form-item label="反面" prop="img2">
|
||||||
<image :src="orderSourceData[1]" v-if="orderSourceData[1]" mode="aspectFill" style="width: 300rpx;height: 200rpx"></image>
|
<image :src="orderSourceData[1]" v-if="orderSourceData[1]" mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(2)"></image>
|
||||||
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(2)"></image>
|
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(2)"></image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
@@ -24,15 +24,15 @@
|
|||||||
<!-- 表单组件 -->
|
<!-- 表单组件 -->
|
||||||
<view class="form-wrapper">
|
<view class="form-wrapper">
|
||||||
<u-form-item label="人车合照" prop="img3">
|
<u-form-item label="人车合照" prop="img3">
|
||||||
<image :src="orderSourceData[2]" v-if="orderSourceData[2]" mode="aspectFill" style="width: 300rpx;height: 200rpx"></image>
|
<image :src="orderSourceData[2]" v-if="orderSourceData[2]" mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(3)"></image>
|
||||||
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(3)"></image>
|
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(3)"></image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="车子照片" prop="img4">
|
<u-form-item label="车子照片" prop="img4">
|
||||||
<image :src="orderSourceData[3]" v-if="orderSourceData[3]" mode="aspectFill" style="width: 300rpx;height: 200rpx"></image>
|
<image :src="orderSourceData[3]" v-if="orderSourceData[3]" mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(4)"></image>
|
||||||
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(4)"></image>
|
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(4)"></image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="安装照片" prop="img5">
|
<u-form-item label="安装照片" prop="img5">
|
||||||
<image :src="orderSourceData[4]" v-if="orderSourceData[4]" mode="aspectFill" style="width: 300rpx;height: 200rpx"></image>
|
<image :src="orderSourceData[4]" v-if="orderSourceData[4]" mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(5)"></image>
|
||||||
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(5)"></image>
|
<image src="../../static/not-dealer.png" v-else mode="aspectFill" style="width: 300rpx;height: 200rpx" @click="chooseImage(5)"></image>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
@@ -292,8 +292,12 @@
|
|||||||
fileType: 'image',
|
fileType: 'image',
|
||||||
name: 'file'
|
name: 'file'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log("res: ", res);
|
// app.orderSourceData.push(res.data.url)
|
||||||
app.orderSourceData.push(res.data.url)
|
if(app.orderSourceData[id-1]){
|
||||||
|
app.orderSourceData.splice(id-1, 1, res.data.url)
|
||||||
|
} else {
|
||||||
|
app.orderSourceData.push(res.data.url)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,11 @@
|
|||||||
<image class="image" src="/static/order/status/wait_pay.png" mode="aspectFit"></image>
|
<image class="image" src="/static/order/status/wait_pay.png" mode="aspectFit"></image>
|
||||||
</block>
|
</block>
|
||||||
<!-- 待发货 -->
|
<!-- 待发货 -->
|
||||||
<block v-else-if="order.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value">
|
<!-- <block v-else-if="order.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value">
|
||||||
<image class="image" src="/static/order/status/wait_deliver.png" mode="aspectFit"></image>
|
<image class="image" src="/static/order/status/wait_deliver.png" mode="aspectFit"></image>
|
||||||
</block>
|
</block> -->
|
||||||
<!-- 待收货 -->
|
<!-- 待收货 -->
|
||||||
<block v-else-if="order.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
|
<block v-else-if="order.payStatus == 20 && order.deliveryStatus <= 20 && order.receiptStatus == 10">
|
||||||
<image class="image" src="/static/order/status/wait_receipt.png" mode="aspectFit"></image>
|
<image class="image" src="/static/order/status/wait_receipt.png" mode="aspectFit"></image>
|
||||||
</block>
|
</block>
|
||||||
</block>
|
</block>
|
||||||
@@ -31,13 +31,18 @@
|
|||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<view class="status-text">
|
<view class="status-text">
|
||||||
<text class="state-text"
|
<text class="state-text" v-if="order.payStatus == 10">待支付</text>
|
||||||
v-if="order.payStatus == 20 && (order.receiptStatus == 30 || ( order.equipmentGoods.equipmentCategory != 10 && order.currPeriods >= order.periods))">已完成</text>
|
<block v-if="order.payStatus == 20">
|
||||||
<text class="state-text" v-else-if="order.payStatus == 10">待支付</text>
|
<text class="state-text" v-if="order.receiptStatus == 21">退租中</text>
|
||||||
<text class="state-text" v-else-if="order.orderStatus == 30 && order.payStatus == 20 && order.deliveryStatus == 10">待收货</text>
|
<text class="state-text" v-else-if="order.deliveryStatus <= 20 && order.receiptStatus == 10">待收货</text>
|
||||||
<text class="state-text" v-else-if="order.orderStatus == 30 && order.payStatus == 20 && order.deliveryStatus == 20">待绑定</text>
|
<text class="state-text" v-else-if="order.deliveryStatus == 20 && order.receiptStatus == 20">待绑定</text>
|
||||||
<text class="state-text" v-else-if="order.orderStatus == 30 && order.deliveryStatus == 20">进行中</text>
|
<text class="state-text" v-else-if="order.deliveryStatus == 40 && order.receiptStatus == 20">进行中</text>
|
||||||
<text class="state-text" v-else-if="order.receiptStatus == 21">进行中</text>
|
<text class="state-text"
|
||||||
|
v-else-if="order.receiptStatus == 30 || ( order.equipmentGoods.equipmentCategory != 10 && order.currPeriods >= order.periods)">已完成</text>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <text>{{ order.stateText }}</text> -->
|
<!-- <text>{{ order.stateText }}</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -494,8 +499,8 @@
|
|||||||
<view class="btn-item active" @click="onReceipt(order.orderId)">绑定设备</view>
|
<view class="btn-item active" @click="onReceipt(order.orderId)">绑定设备</view>
|
||||||
</block> -->
|
</block> -->
|
||||||
<!-- 订单评价 -->
|
<!-- 订单评价 -->
|
||||||
<block
|
<!-- <block
|
||||||
v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0 && order.receiptStatus != 30">
|
v-if="order.payStatus == PayStatusEnum.SUCCESS.value && order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0 && order.receiptStatus != 30">
|
||||||
<view class="btn-item" @click="handleTargetEquipment(order.equipmentId)">查看电池</view>
|
<view class="btn-item" @click="handleTargetEquipment(order.equipmentId)">查看电池</view>
|
||||||
<view class="btn-item" @click="handleHireEquipment(order.orderId)"
|
<view class="btn-item" @click="handleHireEquipment(order.orderId)"
|
||||||
v-if="equipmentGoods.equipmentCategory != '10' && !orderEnd && order.orderId >= 28804">我要续费</view>
|
v-if="equipmentGoods.equipmentCategory != '10' && !orderEnd && order.orderId >= 28804">我要续费</view>
|
||||||
@@ -504,7 +509,27 @@
|
|||||||
<view class="btn-item" @click="handleRentingOut(order)"
|
<view class="btn-item" @click="handleRentingOut(order)"
|
||||||
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租
|
v-if="equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租
|
||||||
</view>
|
</view>
|
||||||
|
</block> -->
|
||||||
|
|
||||||
|
<block v-if="order.payStatus == PayStatusEnum.SUCCESS.value">
|
||||||
|
<view class="btn-item" v-if="order.deliveryStatus <= 20 && order.receiptStatus == 10" @click="onReceipt(order.orderId)">确认收货</view>
|
||||||
|
<view class="btn-item" v-else-if="order.orderStatus == 30 && order.deliveryStatus == 20 && order.receiptStatus == 20" @click="onBind(item)">绑定设备</view>
|
||||||
|
|
||||||
|
<view class="btn-item" @click="handleRentingOut(order)"
|
||||||
|
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 21 && order.receiptStatus != 30">我要退租</view>
|
||||||
|
<view class="btn-item" @click="handleRentingOut(order)"
|
||||||
|
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus == 21 && !orderEnd">取消退租</view>
|
||||||
|
|
||||||
|
<view class="btn-item" @click="handleTargetDetail(item.orderId)"
|
||||||
|
v-if="order.equipmentGoods.equipmentCategory != '10' && order.receiptStatus != 30 && order.receiptStatus != 21 && !orderEnd && order.orderId >= 28804">我要续费</view>
|
||||||
|
|
||||||
|
<block v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0">
|
||||||
|
<view class="btn-item" v-if="order.equipmentGoods.equipmentCategory == '40' && order.deliveryStatus == DeliveryStatusEnum.ACCEPT.value"
|
||||||
|
@click="handleChangeEquipment(order.orderId,order.equipment.equipmentId)">换电</view>
|
||||||
|
<!-- <view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '锂电池租赁' || item.equipmentGoods.equipmentCategory == '电动车租赁'" @click="handleTargetDetail(item.orderId)">续费</view> -->
|
||||||
|
</block>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -846,13 +871,75 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 点击去支付
|
// 点击去支付
|
||||||
onPay(orderId) {
|
/* onPay(orderId) {
|
||||||
OrderApi.getOrderPayByOrderId(orderId).then(res => {
|
OrderApi.getOrderPayByOrderId(orderId).then(res => {
|
||||||
this.$navTo('pages/checkout/cashier/index', {
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
orderId: res.data.id
|
orderId: res.data.id
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}, */
|
||||||
|
|
||||||
|
// 点击去支付
|
||||||
|
onPay(orderId) {
|
||||||
|
const app = this
|
||||||
|
OrderApi.getOrderPayByOrderId(orderId).then(res => {
|
||||||
|
if(res.data.isRenew == 0 && res.data.hasFreeze == 0){
|
||||||
|
if (res.data.equipmentCategory != 10 && res.data.orderStr) {
|
||||||
|
my.tradePay({
|
||||||
|
orderStr: res.data.orderStr, // 完整的支付参数拼接成的字符串,从服务端获取
|
||||||
|
success: (res) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
OrderApi.checkFreeze(orderId).then((res) => {
|
||||||
|
if(res.code == 0){
|
||||||
|
// app.$success("下单成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/pages/order/index'
|
||||||
|
// })
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: res.data.id
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(res.errMsg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
OrderApi.checkFreeze(orderId).then((r) => {
|
||||||
|
if(r.code == 0){
|
||||||
|
app.$success("下单成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/pages/order/index'
|
||||||
|
// })
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: r.data.id
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(r.errMsg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: res.data.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到订单评价页
|
// 跳转到订单评价页
|
||||||
|
|||||||
@@ -14,13 +14,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item-top-right">
|
<view class="item-top-right">
|
||||||
<text class="state-text" v-if="item.payStatus == 10">待支付</text>
|
<text class="state-text" v-if="item.payStatus == 10">待支付</text>
|
||||||
<text class="state-text" v-else-if="item.orderStatus == 40">已完成</text>
|
<text class="state-text" v-if="item.payStatus == 20 && item.deliveryStatus <= 20 && item.receiptStatus == 10">待收货</text>
|
||||||
<text class="state-text" v-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 20">待绑定</text>
|
<text class="state-text" v-if="item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 20">待绑定</text>
|
||||||
<text class="state-text" v-else-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 10">待收货</text>
|
|
||||||
<!-- <text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text> -->
|
<!-- <text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text> -->
|
||||||
<text class="state-text" v-else-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 40 && item.receiptStatus == 20">已绑定</text>
|
<text class="state-text" v-if="item.payStatus == 20 && item.deliveryStatus == 40 && item.receiptStatus == 20">进行中</text>
|
||||||
|
<text class="state-text" v-else-if="item.payStatus == 20 && item.receiptStatus == 21">退租中</text>
|
||||||
<text class="state-text" v-else-if="item.payStatus == 20 && item.receiptStatus == 21">进行中</text>
|
<text class="state-text" v-else-if="item.payStatus == 20 && item.orderStatus == 40">已完成</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
@@ -49,10 +48,18 @@
|
|||||||
<text class="twoline-hide">设备编号:{{ item.equipment.equipmentCode ? item.equipment.equipmentCode : ''}}</text>
|
<text class="twoline-hide">设备编号:{{ item.equipment.equipmentCode ? item.equipment.equipmentCode : ''}}</text>
|
||||||
<text class="twoline-hide">设备名称:{{ item.equipmentGoods.goodsName }}</text>
|
<text class="twoline-hide">设备名称:{{ item.equipmentGoods.goodsName }}</text>
|
||||||
<text class="twoline-hide">设备型号:{{ item.equipmentGoods.batteryModel }}</text>
|
<text class="twoline-hide">设备型号:{{ item.equipmentGoods.batteryModel }}</text>
|
||||||
|
<text class="twoline-hide">下单用户:{{ item.nickname }}</text>
|
||||||
<text class="twoline-hide yuqi-text" v-if="item.payStatus == 10 && item.expirationDay < 0">逾期状态:
|
<text class="twoline-hide yuqi-text" v-if="item.payStatus == 10 && item.expirationDay < 0">逾期状态:
|
||||||
(已逾期{{ Math.abs(item.expirationDay) }}天)</text>
|
(已逾期{{ Math.abs(item.expirationDay) }}天)</text>
|
||||||
<text class="twoline-hide yuqi-text"
|
<text class="twoline-hide yuqi-text"
|
||||||
v-if="item.payStatus == 10 && item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
|
v-if="item.payStatus == 10 && item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
|
||||||
|
<!-- <view class="order-total">
|
||||||
|
<text>合计:</text>
|
||||||
|
<text class="unit" style="color: #ff0000;">¥</text>
|
||||||
|
<text class="money">{{ item.totalPrice }}</text>
|
||||||
|
</view> -->
|
||||||
|
<!-- <text class="twoline-hide">合计:{{ item.equipmentGoods.batteryModel }}</text> -->
|
||||||
|
<text class="twoline-hide" style="padding-left: 52rpx;">合计:<span style="color: #ff0000;">¥{{ item.totalPrice }}</span></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 交易信息 -->
|
<!-- 交易信息 -->
|
||||||
@@ -68,17 +75,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 订单合计 -->
|
<!-- 订单合计 -->
|
||||||
<view class="order-total">
|
|
||||||
<!-- <text>押金¥{{ item.batteryDeposit }}, 保险¥{{ item.batteryInsurance }}, 订单金额</text> -->
|
|
||||||
<text>合计</text>
|
|
||||||
<text class="unit" style="color: #ff0000;">¥</text>
|
|
||||||
<text class="money">{{ item.totalPrice }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- 订单操作 -->
|
<!-- 订单操作 -->
|
||||||
<view v-if="item.orderStatus != OrderStatusEnum.CANCELLED.value" class="order-handle">
|
<view v-if="item.orderStatus != OrderStatusEnum.CANCELLED.value" class="order-handle">
|
||||||
<view class="btn-group clearfix">
|
<view class="btn-group clearfix">
|
||||||
<!-- 未支付取消订单 -->
|
<!-- 未支付取消订单 -->
|
||||||
<block v-if="item.payStatus == PayStatusEnum.PENDING.value">
|
<block v-if="item.payStatus == PayStatusEnum.PENDING.value">
|
||||||
|
<view class="btn-item active" @click="onPay(item.orderId)">去支付</view>
|
||||||
<view class="btn-item" @click="onCancel(item.orderId)">取消</view>
|
<view class="btn-item" @click="onCancel(item.orderId)">取消</view>
|
||||||
</block>
|
</block>
|
||||||
<!-- 已支付进行中的订单 -->
|
<!-- 已支付进行中的订单 -->
|
||||||
@@ -93,33 +96,30 @@
|
|||||||
</block>
|
</block>
|
||||||
<!-- 已申请取消 -->
|
<!-- 已申请取消 -->
|
||||||
<view v-else class="f-28 col-8">取消申请中</view>
|
<view v-else class="f-28 col-8">取消申请中</view>
|
||||||
<!-- 未支付的订单 -->
|
|
||||||
<block v-if="item.payStatus == PayStatusEnum.PENDING.value">
|
|
||||||
<view class="btn-item active" @click="onPay(item.orderId)">去支付</view>
|
|
||||||
</block>
|
|
||||||
<!-- 确认收货 -->
|
<!-- 确认收货 -->
|
||||||
<block v-if="item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.DELIVERED.value && item.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
|
<block v-if="item.payStatus == PayStatusEnum.SUCCESS.value">
|
||||||
<!-- <view class="btn-item active"
|
<view v-if="item.deliveryStatus <= 20 && item.receiptStatus == 10" class="btn-item active" @click="onReceipt(item.orderId)">确认收货</view>
|
||||||
v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'"
|
<view v-else-if="item.orderStatus == 30 && item.deliveryStatus == 20 && item.receiptStatus == 20" class="btn-item active" @click="onBind(item)">绑定设备</view>
|
||||||
@click="onBind(item)">绑定设备</view> -->
|
|
||||||
<view class="btn-item active" @click="onReceipt(item.orderId)">确认收货</view>
|
<view class="btn-item" @click="handleRentingOut(order)"
|
||||||
</block>
|
v-if="item.equipmentGoods.equipmentCategory != '10' && item.receiptStatus != 21 && item.receiptStatus != 30">我要退租</view>
|
||||||
<block v-if="item.orderStatus == 30 && item.payStatus == 20 && item.deliveryStatus == 20 && item.receiptStatus == 20">
|
<view class="btn-item" @click="handleRentingOut(order)"
|
||||||
<view class="btn-item active" @click="onBind(item)">绑定设备</view>
|
v-if="item.equipmentGoods.equipmentCategory != '10' && item.receiptStatus == 21 && !orderEnd">取消退租</view>
|
||||||
|
|
||||||
|
<view class="btn-item" @click="handleTargetDetail(item.orderId)"
|
||||||
|
v-if="item.equipmentGoods.equipmentCategory != '10' && item.receiptStatus != 30 && item.receiptStatus != 21 && !orderEnd && item.orderId >= 28804">我要续费</view>
|
||||||
|
|
||||||
|
<block v-if="item.orderStatus == OrderStatusEnum.COMPLETED.value && item.isComment == 0">
|
||||||
|
<view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '40' && item.deliveryStatus == DeliveryStatusEnum.ACCEPT.value"
|
||||||
|
@click="handleChangeEquipment(item.orderId,item.equipment.equipmentId)">换电</view>
|
||||||
|
<!-- <view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '锂电池租赁' || item.equipmentGoods.equipmentCategory == '电动车租赁'" @click="handleTargetDetail(item.orderId)">续费</view> -->
|
||||||
|
</block>
|
||||||
</block>
|
</block>
|
||||||
<!-- 订单评价 -->
|
<!-- 订单评价 -->
|
||||||
<block v-if="item.orderStatus == OrderStatusEnum.COMPLETED.value && item.isComment == 0">
|
|
||||||
<view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '40' && item.deliveryStatus == DeliveryStatusEnum.ACCEPT.value"
|
|
||||||
@click="handleChangeEquipment(item.orderId,item.equipment.equipmentId)">换电</view>
|
|
||||||
<!-- <view class="btn-item" v-if="item.equipmentGoods.equipmentCategory == '锂电池租赁' || item.equipmentGoods.equipmentCategory == '电动车租赁'" @click="handleTargetDetail(item.orderId)">续费</view> -->
|
|
||||||
</block>
|
|
||||||
<view class="btn-item" @click="handleTargetDetail(item.orderId)">详情</view>
|
<view class="btn-item" @click="handleTargetDetail(item.orderId)">详情</view>
|
||||||
<block
|
|
||||||
v-if="item.orderStatus == OrderStatusEnum.COMPLETED.value && item.isComment == 0 && item.receiptStatus != 30">
|
|
||||||
<view class="btn-item" @click="handleTargetDetail(item.orderId)"
|
|
||||||
v-if="item.equipmentGoods.equipmentCategory != '10' && !orderEnd && item.orderId >= 28804">我要续费 </view>
|
|
||||||
|
|
||||||
</block>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -188,7 +188,8 @@
|
|||||||
removeOrder,
|
removeOrder,
|
||||||
receiptOrder,
|
receiptOrder,
|
||||||
addOrder,
|
addOrder,
|
||||||
getOrderPayByOrderId
|
getOrderPayByOrderId,
|
||||||
|
checkFreeze
|
||||||
} from '@/websoft/api/order.js'
|
} from '@/websoft/api/order.js'
|
||||||
/* import {
|
/* import {
|
||||||
bindEquipment
|
bindEquipment
|
||||||
@@ -280,7 +281,7 @@
|
|||||||
// 选择的设备
|
// 选择的设备
|
||||||
equipment: {},
|
equipment: {},
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
showQRCodeBindChange: false
|
showQRCodeBindChange: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -565,17 +566,97 @@
|
|||||||
app.showQRCodePopup = true
|
app.showQRCodePopup = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleRentingOut(order) {
|
||||||
|
const app = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否退租',
|
||||||
|
success: (result) => {
|
||||||
|
if (result.confirm) {
|
||||||
|
const {
|
||||||
|
orderId,
|
||||||
|
equipmentId
|
||||||
|
} = order
|
||||||
|
EquipmentApi.rentingOut({
|
||||||
|
orderId,
|
||||||
|
equipmentId
|
||||||
|
}).then(res => {
|
||||||
|
this.$success(res.message)
|
||||||
|
setTimeout(() => {
|
||||||
|
// 刷新当前订单数据
|
||||||
|
app.onRefreshList()
|
||||||
|
}, 1000)
|
||||||
|
}).catch(err => {
|
||||||
|
this.$success(err.message)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// 点击去支付
|
// 点击去支付
|
||||||
onPay(orderId) {
|
onPay(orderId) {
|
||||||
|
const app = this
|
||||||
getOrderPayByOrderId(orderId).then(res => {
|
getOrderPayByOrderId(orderId).then(res => {
|
||||||
this.$navTo('pages/checkout/cashier/index', {
|
if(res.data.isRenew == 0 && res.data.hasFreeze == 0){
|
||||||
orderId: res.data.id
|
if (res.data.equipmentCategory != 10 && res.data.orderStr) {
|
||||||
})
|
my.tradePay({
|
||||||
|
orderStr: res.data.orderStr, // 完整的支付参数拼接成的字符串,从服务端获取
|
||||||
|
success: (res) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
checkFreeze(orderId).then((r) => {
|
||||||
|
if(r.code == 0){
|
||||||
|
// app.$success("押金校验成功!")
|
||||||
|
setTimeout(() => {
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/pages/order/index'
|
||||||
|
// })
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: r.data.id
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(r.message)
|
||||||
|
app.onRefreshList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
checkFreeze(orderId).then((r) => {
|
||||||
|
if(r.code == 0){
|
||||||
|
app.$success("押金校验成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/pages/order/index'
|
||||||
|
// })
|
||||||
|
// app.onRefreshList()
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: r.data.id
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app.$error(r.message)
|
||||||
|
app.onRefreshList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$navTo('pages/checkout/cashier/index', {
|
||||||
|
orderId: res.data.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到订单详情页
|
// 跳转到订单详情页
|
||||||
@@ -660,12 +741,12 @@
|
|||||||
// 商品项
|
// 商品项
|
||||||
.goods-item {
|
.goods-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
// 商品图片
|
// 商品图片
|
||||||
.goods-image {
|
.goods-image {
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
height: 100rpx;
|
// height: 200rpx;
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -684,7 +765,7 @@
|
|||||||
.goods-title {
|
.goods-title {
|
||||||
width: 420rpx;
|
width: 420rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
max-height: 76rpx;
|
// max-height: 76rpx;
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,9 +817,9 @@
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
height: 80rpx;
|
// height: 80rpx;
|
||||||
padding-top: 60rpx;
|
// padding-top: 60rpx;
|
||||||
margin-bottom: 30rpx;
|
// margin-bottom: 30rpx;
|
||||||
|
|
||||||
.unit {
|
.unit {
|
||||||
margin-left: 8rpx;
|
margin-left: 8rpx;
|
||||||
@@ -755,10 +836,9 @@
|
|||||||
// 订单操作
|
// 订单操作
|
||||||
.order-handle {
|
.order-handle {
|
||||||
.btn-group {
|
.btn-group {
|
||||||
|
|
||||||
.btn-item {
|
.btn-item {
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
padding: 8rpx 20rpx;
|
padding: 8rpx 10rpx;
|
||||||
margin-left: 15rpx;
|
margin-left: 15rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
float: right;
|
float: right;
|
||||||
|
|||||||
@@ -53,9 +53,9 @@
|
|||||||
<u-button shape="circle" size="mini"
|
<u-button shape="circle" size="mini"
|
||||||
@click="navTo('package/dealer/withdraw/apply')">查看明细</u-button>
|
@click="navTo('package/dealer/withdraw/apply')">查看明细</u-button>
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- <view class="asset-left-item" style="display: flex;align-items: center;">
|
<view class="asset-left-item" style="display: flex;align-items: center;">
|
||||||
<u-button shape="circle" type="primary" size="mini" @click="onApply">去提现</u-button>
|
<u-button shape="circle" type="primary" size="mini" @click="onApply">去提现</u-button>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="my-service">
|
<view class="my-service">
|
||||||
|
|||||||
@@ -4,38 +4,37 @@
|
|||||||
<u-icon class="icon" size="22" name="calendar"></u-icon>
|
<u-icon class="icon" size="22" name="calendar"></u-icon>
|
||||||
<text v-if="createTimeStart && createTimeEnd">{{ createTimeStart }} ~ {{ createTimeEnd }}</text>
|
<text v-if="createTimeStart && createTimeEnd">{{ createTimeStart }} ~ {{ createTimeEnd }}</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<mescroll-uni @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
|
<view class="order" v-for="(item,index) in pageData" :key="index">
|
||||||
<view class="order" v-for="(item,index) in datas" :key="index">
|
<view class="fenqi">
|
||||||
<view class="fenqi">
|
<block>
|
||||||
<block>
|
<view class="item">
|
||||||
<view class="item">
|
<view class="goods-info">
|
||||||
<view class="goods-info">
|
<view class="goods-name">
|
||||||
<view class="goods-name">
|
<text class="name">{{item.applyStatusDis}}</text>
|
||||||
<text class="name">{{item.applyStatusDis}}</text>
|
<text v-if="item.rejectReason" class="selling-point">拒绝理由:{{ item.rejectReason }}</text>
|
||||||
<text v-if="item.rejectReason" class="selling-point">拒绝理由:{{ item.rejectReason }}</text>
|
<image v-if="item.image" :src="item.image" mode="widthFix" style="width: 100px;" @click="proView(item.image)"></image>
|
||||||
<image v-if="item.image" :src="item.image" mode="widthFix" style="width: 100px;" @click="proView(item.image)"></image>
|
<text class="selling-point">申请时间:{{ item.createTime }}</text>
|
||||||
<text class="selling-point">申请时间:{{ item.createTime }}</text>
|
</view>
|
||||||
</view>
|
<view class="goods-price">
|
||||||
<view class="goods-price">
|
<!-- <text class="add-price"
|
||||||
<!-- <text class="add-price"
|
v-if="item.scene == 10 || item.scene == 40">+¥{{ item.money }}</text>
|
||||||
v-if="item.scene == 10 || item.scene == 40">+¥{{ item.money }}</text>
|
<text class="sub-price" v-if="item.scene == 20">-¥{{ item.money }}</text>
|
||||||
<text class="sub-price" v-if="item.scene == 20">-¥{{ item.money }}</text>
|
<block v-if="item.scene == 30">
|
||||||
<block v-if="item.scene == 30">
|
<text class="add-price" v-if="item.money > 0">+¥{{ item.money }}</text>
|
||||||
<text class="add-price" v-if="item.money > 0">+¥{{ item.money }}</text>
|
<text class="sub-price" v-else>-¥{{ Math.abs(item.money) }}</text>
|
||||||
<text class="sub-price" v-else>-¥{{ Math.abs(item.money) }}</text>
|
</block> -->
|
||||||
</block> -->
|
<text class="num">¥{{ item.money }}</text>
|
||||||
<text class="num">¥{{ item.money }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</view>
|
||||||
</view>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</mescroll-uni>
|
</view>
|
||||||
|
<!-- <uni-pagination @change="handlePageChange"></uni-pagination> -->
|
||||||
|
|
||||||
<!-- <u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/car.png" text="暂无提现记录" v-if="list.length == 0">
|
<!-- <u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/car.png" text="暂无提现记录" v-if="pageData.length == 0">
|
||||||
</u-empty> -->
|
</u-empty> -->
|
||||||
<!-- <mescroll-empty v-if="dataList.length==0"></mescroll-empty> -->
|
<u-loadmore :status="status" v-if="pageData.length > 0" line icon-color="#028BF7" marginBottom="20" @loadmore="onLoadMoreData()"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -45,27 +44,17 @@
|
|||||||
} from '@/utils/util.js'
|
} from '@/utils/util.js'
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins';
|
import { withdrawPage } from '@/websoft/api/merchant.js';
|
||||||
import { withdrawPage } from '@/websoft/api/merchant.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [MescrollMixin], // 使用mixin
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
upOption:{
|
pageNo:1,//当前页数
|
||||||
// page: {
|
pageSize:10,//页数大小
|
||||||
// size: 5 // 每页数据的数量
|
totalPage:"",//总页数
|
||||||
// },
|
pageData:[],//列表数据
|
||||||
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
status: 'loadmore',//状态
|
||||||
empty:{
|
};
|
||||||
tip: '~ 搜索无数据 ~', // 提示
|
|
||||||
btnText: '去看看'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
datas: [], //列表数据
|
|
||||||
// tabs: [{name:'全部',type:'xx'}, {name:'奶粉',type:'xx'}, {name:'面膜',type:'xx'}, {name:'图书',type:'xx'}],
|
|
||||||
// tabIndex: 0 // tab下标
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// onLoad(option) {
|
// onLoad(option) {
|
||||||
// const app = this
|
// const app = this
|
||||||
@@ -74,28 +63,6 @@
|
|||||||
// onShow() {
|
// onShow() {
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
upCallback(page) {
|
|
||||||
console.log(page)
|
|
||||||
const app = this
|
|
||||||
page.size = 5
|
|
||||||
withdrawPage({page:page.num,limit:page.size}).then(res=>{
|
|
||||||
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
||||||
// this.mescroll.endSuccess(res.data.count);
|
|
||||||
// app.mescroll.endBySize(page.size, res.data.count);
|
|
||||||
|
|
||||||
//设置列表数据
|
|
||||||
if(page.num == 1) app.datas = []; //如果是第一页需手动制空列表
|
|
||||||
app.datas=app.datas.concat(res.data.list); //追加新数据
|
|
||||||
// app.mescroll.endBySize(res.data.list.length, res.data.count);
|
|
||||||
|
|
||||||
let totalPage = res.data.count / page.size + (res.data.count % page.size == 0 ? 0 : 1);
|
|
||||||
let hasNext = (totalPage - page.num > 0);
|
|
||||||
app.mescroll.endSuccess(res.data.count, true);
|
|
||||||
}).catch(()=>{
|
|
||||||
//联网失败, 结束加载
|
|
||||||
this.mescroll.endErr();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
openCalendar() {
|
openCalendar() {
|
||||||
this.show = true
|
this.show = true
|
||||||
},
|
},
|
||||||
@@ -112,7 +79,40 @@
|
|||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'点击了按钮,具体逻辑自行实现'
|
title:'点击了按钮,具体逻辑自行实现'
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
loadData() {
|
||||||
|
const app = this
|
||||||
|
withdrawPage({page:app.pageNo,limit:app.pageSize}).then(res=>{
|
||||||
|
if(app.pageNo == 1) app.pageData = []
|
||||||
|
app.pageData = app.pageData.concat(res.data.list)
|
||||||
|
app.totalPage = Math.ceil(res.data.count / app.pageSize)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onLoadMoreData() {
|
||||||
|
if (this.pageNo < this.totalPage) {
|
||||||
|
this.pageNo++
|
||||||
|
this.loadData()
|
||||||
|
} else {
|
||||||
|
this.status = ''
|
||||||
|
uni.showToast({ title: '没有更多数据', icon: 'none' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('上拉刷新')
|
||||||
|
this.onLoadMoreData();//修改页数后,重新获取数据
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
console.log('下拉刷新')
|
||||||
|
// 调用加载更多数据的方法
|
||||||
|
|
||||||
|
this.onLoadMoreData();
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadData(); // 初次加载数据
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user