diff --git a/package/equipment/cashier/index.vue b/package/equipment/cashier/index.vue index 26bba2d..2ef37e5 100755 --- a/package/equipment/cashier/index.vue +++ b/package/equipment/cashier/index.vue @@ -302,7 +302,7 @@ } else { setTimeout(() => { this.$navTo('pages/order/index', {}, 'redirectTo') - }, 1200) + }, 1000) } }, diff --git a/pages.json b/pages.json index d49ac3c..7c0d9f5 100755 --- a/pages.json +++ b/pages.json @@ -175,7 +175,7 @@ { "path": "pages/help/xieyi", "style": { - "navigationBarTitleText": "租赁服务协议与隐私协议" + "navigationBarTitleText": "协议" } }, { @@ -378,12 +378,11 @@ "path": "pages/withdraw/log/log", "style": { "navigationBarTitleText": "提现记录", - "enablePullDownRefresh": false, + "enablePullDownRefresh": true, "disableScroll":false, "app-plus" : { "bounce" : "none" // 取消APP端iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle') - }, - "mp-alipay":{"allowsBounceVertical":"NO"} // 取消支付宝和钉钉小程序的iOS回弹,避免与下拉刷新冲突 (可统一配在 'globalStyle') + } } }, { diff --git a/pages/checkout/checkout.vue b/pages/checkout/checkout.vue index 4a69c62..60d3581 100644 --- a/pages/checkout/checkout.vue +++ b/pages/checkout/checkout.vue @@ -102,8 +102,8 @@ - 我已同意并阅读
《服务协议》
《隐私协议》
+ 我已同意并阅读
《租赁合同》
《隐私协议》
@@ -180,8 +180,8 @@ onShow() { var time = new Date().getTime() + 60 * 60 * 1000 * 24 const expirationTime = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(time)) - console.log("time: ", time); - console.log("expirationTime: ", expirationTime); + // console.log("time: ", time); + // console.log("expirationTime: ", expirationTime); payQuery(752).then(res => { console.log("res123: ", res); }) @@ -213,8 +213,8 @@ onAgree() { this.agree = !this.agree }, - showXieyi() { - this.$navTo('pages/help/xieyi') + showXieyi(xyId) { + this.$navTo('pages/help/xieyi?id=' + xyId) }, copyCode(text) { // #ifndef H5 @@ -322,25 +322,37 @@ }, complete: () => { - checkFreeze(orderId).then(() => { - app.$success("下单成功") - setTimeout(() => { - uni.redirectTo({ - url: '/pages/order/index' - }) - }, 100) + checkFreeze(orderId).then((res) => { + console.log(record.equipmentCategory + ": " + res) + if(res.code == 0){ + app.$success("下单成功") + setTimeout(() => { + uni.redirectTo({ + url: '/pages/order/index' + }) + }, 100) + } + else { + app.$error(res.errMsg) + } }) } }); } else { - checkFreeze(orderId).then(() => { - app.$success("下单成功") - setTimeout(() => { - uni.redirectTo({ - url: '/pages/order/index' - }) - }, 100) + checkFreeze(orderId).then((res) => { + console.log(res) + if(res.code == 0){ + app.$success("下单成功") + setTimeout(() => { + uni.redirectTo({ + url: '/pages/order/index' + }) + }, 100) + } + else { + app.$error(res.errMsg) + } }) } diff --git a/pages/help/xieyi.vue b/pages/help/xieyi.vue index 11df6c5..3310595 100755 --- a/pages/help/xieyi.vue +++ b/pages/help/xieyi.vue @@ -30,7 +30,7 @@ onLoad(options) { const app = this pageArticle({ - categoryId: 51 + categoryId: options.id }).then(res => { app.itemList = res.data.list }) diff --git a/pages/merchant/merchant.vue b/pages/merchant/merchant.vue index 893c377..6f3c30c 100644 --- a/pages/merchant/merchant.vue +++ b/pages/merchant/merchant.vue @@ -78,7 +78,6 @@ const app = this console.log("app.shopList.length: ",app.$store.getters.token); if(app.shopList.length == 0){ - console.log("sssss: "); app.getShopList(app.longitude,app.latitude) } }, diff --git a/pages/order/delivery.vue b/pages/order/delivery.vue index c7d9d94..aa55e41 100755 --- a/pages/order/delivery.vue +++ b/pages/order/delivery.vue @@ -11,11 +11,11 @@ 身份证信息 - + - + @@ -24,15 +24,15 @@ - + - + - + @@ -292,8 +292,12 @@ fileType: 'image', name: 'file' }).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) + } }) diff --git a/pages/order/detail.vue b/pages/order/detail.vue index 99bad3d..eefea4f 100755 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -12,11 +12,11 @@ - + - + @@ -31,13 +31,18 @@ - 已完成 - 待支付 - 待收货 - 待绑定 - 进行中 - 进行中 + 待支付 + + 退租中 + 待收货 + 待绑定 + 进行中 + 已完成 + + + + @@ -494,8 +499,8 @@ 绑定设备 --> - + + + + 确认收货 + 绑定设备 + + 我要退租 + 取消退租 + + 我要续费 + + + 换电 + + + @@ -846,13 +871,75 @@ }, // 点击去支付 - onPay(orderId) { + /* onPay(orderId) { OrderApi.getOrderPayByOrderId(orderId).then(res => { this.$navTo('pages/checkout/cashier/index', { 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 + }) + } + + }) }, // 跳转到订单评价页 diff --git a/pages/order/index.vue b/pages/order/index.vue index cd43895..c243d0b 100755 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -14,13 +14,12 @@ 待支付 - 已完成 - 待绑定 - 待收货 + 待收货 + 待绑定 - 已绑定 - - 进行中 + 进行中 + 退租中 + 已完成 @@ -49,10 +48,18 @@ 设备编号:{{ item.equipment.equipmentCode ? item.equipment.equipmentCode : ''}} 设备名称:{{ item.equipmentGoods.goodsName }} 设备型号:{{ item.equipmentGoods.batteryModel }} + 下单用户:{{ item.nickname }} 逾期状态: (已逾期{{ Math.abs(item.expirationDay) }}天) 逾期状态: 即将过期 + + + 合计:¥{{ item.totalPrice }} @@ -68,17 +75,13 @@ - - - 合计 - - {{ item.totalPrice }} - + + 去支付 取消 @@ -93,33 +96,30 @@ 取消申请中 - - - 去支付 - - - - 确认收货 - - - 绑定设备 + + 确认收货 + 绑定设备 + + 我要退租 + 取消退租 + + 我要续费 + + + 换电 + + - - 换电 - - + + 详情 - - 我要续费 - - + @@ -188,7 +188,8 @@ removeOrder, receiptOrder, addOrder, - getOrderPayByOrderId + getOrderPayByOrderId, + checkFreeze } from '@/websoft/api/order.js' /* import { bindEquipment @@ -280,7 +281,7 @@ // 选择的设备 equipment: {}, equipmentId: null, - showQRCodeBindChange: false + showQRCodeBindChange: false, } }, @@ -565,17 +566,97 @@ 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) { - + const app = this getOrderPayByOrderId(orderId).then(res => { - this.$navTo('pages/checkout/cashier/index', { - orderId: res.data.id - }) + 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: () => { + 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 { display: flex; - margin-bottom: 40rpx; + margin-bottom: 10rpx; // 商品图片 .goods-image { width: 100rpx; - height: 100rpx; + // height: 200rpx; .image { display: block; @@ -684,7 +765,7 @@ .goods-title { width: 420rpx; font-size: 26rpx; - max-height: 76rpx; + // max-height: 76rpx; line-height: 36rpx; } @@ -736,9 +817,9 @@ font-size: 26rpx; vertical-align: bottom; text-align: right; - height: 80rpx; - padding-top: 60rpx; - margin-bottom: 30rpx; + // height: 80rpx; + // padding-top: 60rpx; + // margin-bottom: 30rpx; .unit { margin-left: 8rpx; @@ -755,10 +836,9 @@ // 订单操作 .order-handle { .btn-group { - .btn-item { border-radius: 10rpx; - padding: 8rpx 20rpx; + padding: 8rpx 10rpx; margin-left: 15rpx; font-size: 26rpx; float: right; diff --git a/pages/user/user.vue b/pages/user/user.vue index b3f9e20..e2c7bd2 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -53,9 +53,9 @@ 查看明细 --> - + diff --git a/pages/withdraw/log/log.vue b/pages/withdraw/log/log.vue index 896cbf8..a6da827 100644 --- a/pages/withdraw/log/log.vue +++ b/pages/withdraw/log/log.vue @@ -4,38 +4,37 @@ {{ createTimeStart }} ~ {{ createTimeEnd }} --> - - - - - - - - {{item.applyStatusDis}} - 拒绝理由:{{ item.rejectReason }} - - 申请时间:{{ item.createTime }} - - - - ¥{{ item.money }} - + + + + + + + {{item.applyStatusDis}} + 拒绝理由:{{ item.rejectReason }} + + 申请时间:{{ item.createTime }} + + + + ¥{{ item.money }} - - + + - + + - - + @@ -45,27 +44,17 @@ } from '@/utils/util.js' import store from '@/store'; 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 { - mixins: [MescrollMixin], // 使用mixin data() { return { - upOption:{ - // page: { - // size: 5 // 每页数据的数量 - // }, - noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5 - empty:{ - tip: '~ 搜索无数据 ~', // 提示 - btnText: '去看看' - } - }, - datas: [], //列表数据 - // tabs: [{name:'全部',type:'xx'}, {name:'奶粉',type:'xx'}, {name:'面膜',type:'xx'}, {name:'图书',type:'xx'}], - // tabIndex: 0 // tab下标 - } + pageNo:1,//当前页数 + pageSize:10,//页数大小 + totalPage:"",//总页数 + pageData:[],//列表数据 + status: 'loadmore',//状态 + }; }, // onLoad(option) { // const app = this @@ -74,28 +63,6 @@ // onShow() { // }, 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() { this.show = true }, @@ -112,7 +79,40 @@ uni.showToast({ 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(); // 初次加载数据 } }