乱七八糟

This commit is contained in:
weicw
2023-10-23 15:21:33 +08:00
parent 0256bd355d
commit 686c1ae304
29 changed files with 2571 additions and 294 deletions

View File

@@ -76,7 +76,7 @@
PayStatusEnum
} from '@/common/enum/order'
import {
getOrder,
getOrderPay,
setPayStatus
} from '@/websoft/api/order.js'
import {
@@ -181,7 +181,7 @@
} = this
app.isLoading = true
// 加载订单
getOrder(orderId)
getOrderPay(orderId)
.then(res => {
app.order = res.data
app.isLoading = false
@@ -271,7 +271,7 @@
handleSubmit() {
const app = this
const {
orderId
id
} = app.order
// 判断是否选择了支付方式
if (!app.curPaymentItem) {
@@ -284,10 +284,10 @@
// .js
console.log("curPaymentItem: ",app.curPaymentItem);
if(app.curPaymentItem.method == '余额支付'){
balance(orderId).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
balance(id).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
}
if(app.curPaymentItem.method == '支付宝'){
alipay(orderId).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
alipay(id).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
}
@@ -334,7 +334,7 @@
payQuery(app.orderId).then(result => {
if(result.code == 0) {
app.$success('支付成功')
app.$navTo('pages/order/index')
uni.navigateBack()
}
})
@@ -348,7 +348,7 @@
// })
}
if (res.resultCode == "6001") {
app.$navTo('pages/order/index')
uni.navigateBack()
}
// my.alert({
// content: JSON.stringify(res),
@@ -441,7 +441,7 @@
if (lastPage && inArray(lastPage.route, backRoutes)) {
uni.navigateBack()
} else {
this.$navTo('pages/order/index', {}, 'redirectTo')
uni.navigateBack()
}
}, 1200)
},

View File

@@ -63,10 +63,14 @@
<text>{{ (record.batteryRent + record.batteryDeposit + record.batteryInsurance).toFixed(2) }}</text>
</view>
<u-cell-group>
<u-cell-item :title="`租金(按${record.periodsType == 0 ? '周' : '月'})`" :border-bottom="false" hover-class="none" :value="record.batteryRent"></u-cell-item>
<u-cell-item title="分期期数" :border-bottom="false" hover-class="none" :value="record.periods"></u-cell-item>
<u-cell-item title="押金" :border-bottom="false" hover-class="none" :value="record.batteryDeposit"></u-cell-item>
<u-cell-item title="保险" :border-bottom="false" hover-class="none" :value="record.batteryInsurance"></u-cell-item>
<u-cell-item :title="`租金(按${record.periodsType == 0 ? '周' : '月'})`" :border-bottom="false"
hover-class="none" :value="record.batteryRent"></u-cell-item>
<u-cell-item title="分期期数" :border-bottom="false" hover-class="none"
:value="record.periods"></u-cell-item>
<u-cell-item title="押金" :border-bottom="false" hover-class="none"
:value="record.batteryDeposit"></u-cell-item>
<u-cell-item title="保险" :border-bottom="false" hover-class="none"
:value="record.batteryInsurance"></u-cell-item>
</u-cell-group>
</block>
<block v-if="record.equipmentCategory === '40'">
@@ -87,7 +91,7 @@
<view class="name">电动车保险</view>
{{ record.batteryInsurance }}
</view>
</view>
<!-- <u-cell-group>
<u-cell-item title="电动车租金" :border-bottom="false" hover-class="none" :value="`¥${record.batteryRent} 元`"></u-cell-item>
@@ -95,10 +99,11 @@
<u-cell-item title="电动车保险" :border-bottom="false" hover-class="none" :value="record.batteryInsurance"></u-cell-item>
</u-cell-group> -->
</block>
<view class="xieyi">
<checkbox-group @change="onAgree" style="display: flex; align-items: center;">
<checkbox :checked="agree" />我已同意并阅读<div class="xieyi-text" @click="showXieyi">服务协议</div><div class="xieyi-text" @click="showXieyi">隐私协议</div>
<checkbox :checked="agree" />我已同意并阅读<div class="xieyi-text" @click="showXieyi">服务协议</div><div
class="xieyi-text" @click="showXieyi">隐私协议</div>
</checkbox-group>
</view>
</view>
@@ -106,7 +111,8 @@
<u-input v-model="dealerPhone" :disabled="disabled" placeholder="请输入推荐人手机号" />
</view>
<view class="submit">
<u-button type="primary" :disabled="!agree" @click="onBuy">立即下单</u-button>
<image style="width: 7rem;margin: 0 auto;" @click="onBuy" src="@/static/zhimamianya.png" mode="widthFix"></image>
<!-- <u-button type="primary" :disabled="!agree" @click="onBuy">立即下单</u-button> -->
</view>
<!-- <view class="submit">
<u-button type="success" :disabled="agree" @click="copyCode(record.equipmentCode)">复制设备编号</u-button>
@@ -115,14 +121,27 @@
</template>
<script>
import { userId } from '@/config.js';
import {
userId
} from '@/config.js';
import {
getEquipmentGoods
} from '@/websoft/api/equipment-goods.js'
import { getUser } from '@/websoft/api/user.js'
import { addOrder } from '@/websoft/api/order.js'
import { dateFormat } from '@/utils/util.js'
import { createOrderNo } from '@/utils/util.js'
import {
getUser
} from '@/websoft/api/user.js'
import {
addOrder,
freeze,
removeOrder,
checkFreeze
} from '@/websoft/api/order.js'
import {
dateFormat
} from '@/utils/util.js'
import {
createOrderNo
} from '@/utils/util.js'
import store from '../../store';
import {
payQuery
@@ -148,7 +167,7 @@
batteryDeposit: 300,
batteryInsurance: 0
},
}
},
onLoad(option) {
@@ -158,14 +177,16 @@
// 获取设备列表
app.getEquipment()
},
onShow(){
var time = new Date().getTime() + 60*60*1000*24
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);
console.log("res123: ", res);
})
},
methods: {
getEquipment() {
@@ -178,7 +199,9 @@
console.log("res: ", app.record);
})
},
onChangeStepper({ value }) {
onChangeStepper({
value
}) {
this.month = value
},
change(e) {
@@ -187,15 +210,15 @@
onInput(month) {
this.month = month
},
onAgree(){
onAgree() {
this.agree = !this.agree
},
showXieyi(){
showXieyi() {
this.$navTo('pages/help/xieyi')
},
copyCode(text){
copyCode(text) {
// #ifndef H5
console.log("text: ",text);
console.log("text: ", text);
uni.setClipboardData({
text: text,
success: (result) => {
@@ -211,7 +234,7 @@
textarea.select() // 选中文本内容
textarea.setSelectionRange(0, info.length)
uni.showToast({ //提示
title: '复制成功'
title: '复制成功'
})
result = document.execCommand("copy")
textarea.remove()
@@ -229,34 +252,47 @@
// }
// });
// // #endif
// }
},
onBuy(){
async onBuy() {
const app = this
const { record,dealerPhone } = this
const {
record,
dealerPhone
} = this
let total = 0.0
uni.showLoading({
})
// 未登录状态
if(!uni.getStorageSync('userId')) {
app.$error('请先登录',function(){
if (!uni.getStorageSync('userId')) {
app.$error('请先登录', function() {
app.$navTo('pages/login/login');
});
return false;
}
if(record.equipmentCategory == '10'){
total = (record.batteryPrice).toFixed(2)
}
if(record.equipmentCategory == '20'){
total = (record.downPayment).toFixed(2)
}
if(record.equipmentCategory == '40' || record.equipmentCategory == '30'){
total = (record.batteryDeposit + record.batteryRent + record.batteryInsurance).toFixed(2)
const userRes = await getUser()
const user = userRes.data
if(record.equipmentCategory == 10) {
total = record.batteryPrice
}else if(record.equipmentCategory == 20) {
total = record.downPayment + record.serviceCharges
}else if(record.equipmentCategory == 30 || record.equipmentCategory == 40){
total = record.batteryRent
}
total = total.toFixed(2)
const testTotal = 0.01
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))
app.expirationTime = expirationTime
addOrder({
orderNo: createOrderNo(),
merchantCode: record.merchantCode,
@@ -272,12 +308,43 @@
orderSource: record.equipmentCategory,
orderSourceId: record.goodsId,
dealerPhone
}).then(res => {
const { orderId } = res.data
app.$success("下单成功")
setTimeout(() => {
this.$navTo('pages/checkout/cashier/index', { orderId })
}, 100)
}).then(res => {
const {
orderId
} = res.data
if (record.equipmentCategory != 10) {
my.tradePay({
orderStr: res.data.orderStr, // 完整的支付参数拼接成的字符串,从服务端获取
success: (res) => {
},
fail: (res) => {
},
complete: () => {
checkFreeze(orderId).then(() => {
app.$success("下单成功")
setTimeout(() => {
uni.redirectTo({
url: '/pages/order/index'
})
}, 100)
})
}
});
} else {
checkFreeze(orderId).then(() => {
app.$success("下单成功")
setTimeout(() => {
uni.redirectTo({
url: '/pages/order/index'
})
}, 100)
})
}
})
}
@@ -311,11 +378,13 @@
font-size: 34rpx;
margin-bottom: 10rpx;
}
.goods-desc {
font-size: 28rpx;
color: #999999;
}
.selling-point{
.selling-point {
padding: 5px 0;
color: #e6760e;
}
@@ -362,17 +431,20 @@
margin: 20rpx auto;
padding: 10rpx 0;
}
.xieyi-text{
.xieyi-text {
color: #0000ff;
}
.fenqi{
.fenqi {
padding: 30rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
.item{
.item {
display: flex;
justify-content: space-between;
padding: 20rpx 0;
}
}
</style>
</style>

View File

@@ -372,6 +372,8 @@
uni.$on('syncSelectedId', selectedId => {
this.selectedShopId = selectedId
})
},
/**
@@ -388,6 +390,7 @@
onShow() {
// 获取当前订单信息
this.getOrderData()
},
methods: {

View File

@@ -176,7 +176,15 @@
onBuy(){
const app = this
const { equipmentId } = this
this.$navTo('pages/merchant/merchant', { equipmentId })
if(this.record.userId > 0) {
uni.showToast({
title: '该电池已经被别人租走了',
icon: 'none'
})
}else {
this.$navTo('pages/merchant/merchant', { equipmentId })
}
},
onReplace() {
console.log("点击更换电池");

View File

@@ -8,6 +8,11 @@
</view>
<map id="map" class="map" :scale="scale" :show-location="true" :latitude="latitude" :longitude="longitude"></map>
<view class="bottom-bar" @click="scan()">扫码设备二维码下单租赁</view>
<u-modal @confirm="showNotice = false" @cancel="hideNotice" v-model="showNotice" title="注意事项" :content='content' showCancelButton cancel-text="不再提醒">
<view class="slot-content">
<text> {{content}}</text>
</view>
</u-modal>
</view>
</template>
@@ -34,9 +39,23 @@
// #ifdef MP-ALIPAY
canIUseAuthButton: my.canIUse('button.open-type.getAuthorize'),
// #endif
showNotice: false,
content: `△禁止将电池浸入水中或投入火中,请将电池远离热源及儿童触及不到的地方
△禁止将锂电池正负极端口与金属物质接触,以避免短路和发生危险
△出现充电器外观损坏、充电器无法正常工作的情况,请客户及时归还交回,并联系我司更换
△禁止私自拆解电池组
△请在使用锂电池前检查其外观是否有任何损坏,如变形、裂纹或漏液等
△使用锂电池时,请确保不要过度放电或充电,以避免电池损坏
△请使用本公司适配的专用充电器放电后让电池冷却30分钟再充电
△充电位置严禁阻碍人员疏散及逃生的路线
△在使用期间如出现任何问题,请立即通知租赁服务商
△当不再需要使用锂电池时,请将其归还给租赁服务商,并确保其在运输过程中保证安全
△因个人原因使用不当引起的事故及电池故障租赁服务商不承担任何责任
如果您有任何疑问或需要进一步的支持请随时联系我们的微信或电话17776499804,我们将竭诚为您解答并提供解决方案。`
}
},
onLoad() {
const app = this
app.getLocation(res => {
if(res.latitude &&res.longitude){
@@ -46,11 +65,18 @@
}
})
const hideNotice = uni.getStorageSync("hideNotice");
this.showNotice = !hideNotice
},
onShow(){
this.getUserInfo()
},
methods: {
hideNotice() {
uni.setStorageSync("hideNotice", true)
this.showNotice = false
},
getUserInfo() {
const { form } = this
const app = this
@@ -192,4 +218,8 @@
opacity: 1;
}
}
.slot-content{
padding: 30rpx;
}
</style>

View File

@@ -116,7 +116,20 @@
// 表单提交
handleSubmit() {
const app = this
this.$navTo('pages/order/index')
const { orderId,orderSourceData } = app
if(orderSourceData.length < 5) {
return
}
receiptOrder({
orderId,
orderSourceData: JSON.stringify(orderSourceData)
}).then(result => {
app.$success("上传成功")
uni.navigateBack()
}).catch(err => {
app.$toast(err.message)
})
},
// 上传图片
@@ -139,14 +152,7 @@
}).then(res => {
console.log("res: ", res);
app.orderSourceData.push(res.data.url)
receiptOrder({
orderId,
orderSourceData: JSON.stringify(app.orderSourceData)
}).then(result => {
app.$success("上传成功")
// 刷新订单列表
app.getData()
})
})
}

View File

@@ -21,7 +21,7 @@
</block>
</block>
<!-- 已完成 -->
<block v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value">
<block v-if="order.orderStatus == 40">
<image class="image" src="/static/order/status/received.png" mode="aspectFit"></image>
</block>
<!-- 已取消/待取消 -->
@@ -31,7 +31,8 @@
</block>
</view>
<view class="status-text">
<text class="state-text" v-if="order.payStatus == 20 && (order.receiptStatus == 30 || order.currPeriods >= order.periods)">已完成</text>
<text class="state-text"
v-if="order.payStatus == 20 && (order.receiptStatus == 30 || ( order.equipmentGoods.equipmentCategory != 10 && order.currPeriods >= order.periods))">已完成</text>
<text class="state-text" v-else-if="order.payStatus == 10">待支付</text>
<text class="state-text" v-else-if="order.payStatus == 20 && order.receiptStatus == 10">待绑定</text>
<text class="state-text" v-else-if="order.orderStatus == 30 && order.receiptStatus == 20">进行中</text>
@@ -199,36 +200,6 @@
</view>
</view>
</block>
<block v-if="equipmentGoods.equipmentCategory == '20'">
<view class="info-item">
<view class="item-lable">下单方式</view>
<view class="item-content">
<text>分期</text>
</view>
</view>
</block>
<block v-if="equipmentGoods.equipmentCategory == '30'">
<view class="info-item">
<view class="item-lable">下单方式</view>
<view class="item-content">
<text>已租代购</text>
</view>
</view>
</block>
<view class="info-item">
<view class="item-lable">可用天数</view>
<view class="item-content">
<text>{{ Math.abs(order.expirationDay) }}天</text>
</view>
</view>
<block v-if="equipmentGoods.equipmentCategory == '40'">
<view class="info-item">
<view class="item-lable">下单方式</view>
<view class="item-content">
<text>租赁</text>
</view>
</view>
</block>
<view class="info-item">
<view class="item-lable">所属门店</view>
<view class="item-content">
@@ -247,25 +218,19 @@
<text>{{ equipment.batteryModel }}</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">订单金额</view>
<view class="item-content">
<text>¥{{ order.totalPrice }} 元</text>
</view>
</view>
<!-- <view class="info-item">
<view class="item-lable">商品编号</view>
<view class="info-item">
<view class="item-lable">设备押金</view>
<view class="item-content">
<text>{{ equipmentGoods.goodsId }}</text>
<text>+¥{{ equipmentGoods.batteryDeposit }}</text>
</view>
</view> -->
<!-- <view class="info-item" v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value">
<view class="item-lable">到期时间</view>
<view class="item-content">
<text>{{ order.expirationTime }}</text>
</view>
</view> -->
</view>
<block v-if="equipmentGoods.equipmentCategory == '20'">
<view class="info-item">
<view class="item-lable">销售价格</view>
@@ -373,83 +338,8 @@
</view>
</view>
<!-- 续费订单 -->
<view class="trade-info i-card">
<view class="info-item" v-if="order.orderSource != 10">
<view class="item-lable">当前期数</view>
<view class="item-content">
<text v-if="order.orderSource == 20">首期</text>
<text v-else>第 1 期</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">订单金额</view>
<view class="item-content">
<text>¥{{ orderPrice }}</text>
</view>
</view>
<view v-if="order.couponMoney > 0" class="info-item">
<view class="item-lable">优惠券抵扣</view>
<view class="item-content">
<text>-¥{{ order.couponMoney }}</text>
</view>
</view>
<view v-if="order.pointsMoney > 0" class="info-item">
<view class="item-lable">{{ setting.pointsName }}抵扣</view>
<view class="item-content">
<text>-¥{{ order.pointsMoney }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle1">
<view class="item-lable">{{ priceTitle1 }}</view>
<view class="item-content">
<text>+¥{{ orderPrice1 }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle2">
<view class="item-lable">{{ priceTitle2 }}</view>
<view class="item-content">
<text>+¥{{ orderPrice2 }}</text>
</view>
</view>
<view class="info-item" v-if="priceTitle3">
<view class="item-lable">{{ priceTitle3 }}</view>
<view class="item-content">
<text>+¥{{ orderPrice3 }}</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">付款时间</view>
<view class="item-content">{{ order.payTime }}</view>
</view>
<view class="info-item"
v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && equipmentGoods.equipmentCategory != '10'">
<view class="item-lable">到期时间</view>
<view class="item-content">
<text>{{ order.expirationTime }}</text>
<text class="yuqi-text" v-if="order.expirationDay < 0">(已逾期
{{ Math.abs(order.expirationDay) }}天)</text>
</view>
</view>
<!-- <view v-if="order.updatePrice.value != '0.00'" class="info-item">
<view class="item-lable">后台改价</view>
<view class="item-content">
<text>{{ order.updatePrice.symbol }}</text>
<text>¥{{ order.updatePrice.value }}</text>
</view>
</view> -->
<view class="divider"></view>
<view class="trade-total">
<text class="lable" alt="续费金额">{{ freeTitle }}</text>
<view class="goods-price">
<text class="unit">¥</text>
<text class="value">{{ orderPrice }}</text>
</view>
</view>
</view>
<view class="renew-divider">-- 续费订单 --</view>
<view v-if="equipmentGoods.equipmentCategory != '10'" class="renew-divider">-- 缴费记录 --</view>
<view class="renew-order" v-if="renewOrderList.length > 0 && equipmentGoods.equipmentCategory != '10' ">
<!-- 首付 -->
<!-- <view class="trade-info i-card " v-for="(item,index) in renewOrderList" :key="index" v-if="index == 0">
@@ -494,8 +384,9 @@
<view class="info-item" v-if="order.orderSource != 10">
<view class="item-lable">当前期数</view>
<view class="item-content">
<text v-if="order.orderSource == 20">第 {{ index + 1}} 期</text>
<text v-else>第 {{ index + 2}} 期</text>
<text v-if="order.orderSource == 20 && index == 0">首期</text>
<text v-if="order.orderSource == 20 && index != 0">第 {{index}} 期</text>
<text v-if="order.orderSource == 30 || order.orderSource == 40">第 {{ index + 1}} 期</text>
</view>
</view>
<view class="info-item">
@@ -534,6 +425,10 @@
<text>+¥{{ orderPrice3 }}</text>
</view>
</view>
<view class="info-item">
<view class="item-lable">付款状态</view>
<view class="item-content">{{ item.payStatus == 20 ? '已支付': '未支付' }}</view>
</view>
<view class="info-item">
<view class="item-lable">付款时间</view>
<view class="item-content">{{ item.payTime }}</view>
@@ -547,9 +442,9 @@
</view>
</view>
</view>
<view class="info-item" v-if="item.expirationDay < 0">
<view class="info-item" v-if="item.expirationDay > 0">
<view class="item-lable">逾期天数</view>
<view class="item-content"><text class="yuqi-text">{{ Math.abs(item.expirationDay) }}天</text>
<view class="item-content"><text class="yuqi-text">{{ item.expirationDay }}天</text>
</view>
</view>
</view>
@@ -588,10 +483,10 @@
<view class="btn-item active" @click="onPay(order.orderId)">去支付</view>
</block>
<!-- 确认收货 -->
<block
v-if="order.deliveryStatus == DeliveryStatusEnum.DELIVERED.value && order.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
<view class="btn-item active" @click="onReceipt(order.orderId)">确认收货</view>
</block>
<!-- <block
v-if="order.payStatus == 20 && order.receiptStatus == 10">
<view class="btn-item active" @click="onReceipt(order.orderId)">绑定设备</view>
</block> -->
<!-- 订单评价 -->
<block
v-if="order.orderStatus == OrderStatusEnum.COMPLETED.value && order.isComment == 0 && order.receiptStatus != 30">
@@ -810,14 +705,14 @@
const {
orderId
} = app.order
listOrder({
OrderApi.getOrderPayList({
rentOrderId: orderId,
payStatus: 20
})
.then(res => {
console.log(res);
res.data.sort((a,b) => {
return new Date(a.createTime.replace(/-/gi, '/')) - new Date(b.createTime.replace(/-/gi, '/'))
res.data.sort((a, b) => {
return new Date(a.createTime.replace(/-/gi, '/')) - new Date(b.createTime.replace(
/-/gi, '/'))
})
app.renewOrderList = res.data;
if (res.data.length >= app.equipmentGoods.periods && (this.order.orderSource == 20 || this
@@ -943,9 +838,12 @@
// 点击去支付
onPay(orderId) {
this.$navTo('pages/checkout/cashier/index', {
orderId
OrderApi.getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
},
// 跳转到订单评价页
@@ -960,7 +858,7 @@
title: '提示',
content: '是否退租',
success: (result) => {
if(result.confirm) {
if (result.confirm) {
const {
orderId,
equipmentId
@@ -980,7 +878,7 @@
}
}
})
},
// 跳转到设备详情页
@@ -990,51 +888,12 @@
})
},
handleHireEquipment(orderId) {
const app = this
const {
order
} = this
const orderNo = createOrderNo()
var time = new Date().getTime() + 60 * 60 * 1000 * 24
const expirationTime = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(time))
addOrder({
orderNo: createOrderNo(),
merchantCode: order.merchantCode,
goodsId: app.goodsId,
totalPrice: app.orderPrice,
orderPrice: app.orderPrice,
payPrice: app.orderPrice,
month: app.month,
expirationTime,
isRenew: 1,
rentOrderId: orderId,
batteryRent: order.batteryRent,
batteryDeposit: order.batteryDeposit,
batteryInsurance: order.batteryInsurance,
orderSource: order.orderSource,
orderSourceId: order.goodsId,
equipmentId: order.equipmentId,
dealerPhone: order.dealerPhone,
comments: '续租订单' + order.orderNo
}).then(res => {
const {
orderId
} = res.data
app.$success("下单成功")
setTimeout(() => {
this.$navTo('pages/checkout/cashier/index', {
orderId
})
}, 100)
OrderApi.getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
// alipayReLet({
// orderId,
// orderNo,
// tenantId,
// payPrice: 0.01,
// merchantName: app.order.merchantName,
// userId: app.order.userId
// }).then(result => app.onSubmitCallback(result)).catch(err => app.$error(err.message))
},
// 订单提交成功后回调
onSubmitCallback(result) {

View File

@@ -13,12 +13,14 @@
<text class="order-time">{{ item.merchantName }}</text>
</view>
<view class="item-top-right">
<text class="state-text" v-if="item.payStatus == 20 && (item.receiptStatus == 30 || item.currPeriods >= item.periods)">已完成</text>
<text class="state-text" v-if="item.orderStatus == 40">已完成</text>
<text class="state-text" v-else-if="item.payStatus == 10">待支付</text>
<text class="state-text" v-else-if="item.payStatus == 20 && item.receiptStatus == 10">待绑定</text>
<text class="state-text" v-else-if="item.orderStatus == 30 && item.receiptStatus == 20">进行中</text>
<text class="state-text"
v-else-if="item.payStatus == 20 && item.receiptStatus == 10">待绑定</text>
<text class="state-text"
v-else-if="item.orderStatus == 30 && item.receiptStatus == 20">进行中</text>
<text class="state-text" v-else-if="item.receiptStatus == 21">进行中</text>
</view>
</view>
<!-- 商品列表 -->
@@ -48,8 +50,10 @@
v-if="item.orderStatus == 30">设备编号{{ item.equipment.equipmentCode }}</text>
<text class="twoline-hide">设备名称{{ item.equipmentGoods.goodsName }}</text>
<text class="twoline-hide">设备型号{{ item.equipmentGoods.batteryModel }}</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 0">逾期状态: (已逾期{{ Math.abs(item.expirationDay) }})</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
<text class="twoline-hide yuqi-text" v-if="item.expirationDay < 0">逾期状态:
(已逾期{{ Math.abs(item.expirationDay) }})</text>
<text class="twoline-hide yuqi-text"
v-if="item.expirationDay < 7 && item.expirationDay > 0">逾期状态: 即将过期</text>
</view>
<view class="goods-props clearfix">
<!-- <view class="goods-props-item">
@@ -106,7 +110,9 @@
<!-- 确认收货 -->
<block
v-if="item.payStatus == PayStatusEnum.SUCCESS.value && item.deliveryStatus == DeliveryStatusEnum.NOT_DELIVERED.value && item.receiptStatus == ReceiptStatusEnum.NOT_RECEIVED.value">
<view class="btn-item active" v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'" @click="onBind(item)">绑定设备</view>
<view class="btn-item active"
v-if="(item.orderSourceData && JSON.parse(item.orderSourceData).length == 5) || item.equipmentGoods.equipmentCategory == '10'"
@click="onBind(item)">绑定设备</view>
<view class="btn-item active" v-else @click="chooseImage(item.orderId)">确认收货</view>
</block>
<!-- 订单评价 -->
@@ -120,7 +126,7 @@
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">我要续费 </view>
</block>
</view>
</view>
@@ -189,7 +195,8 @@
pageOrder,
removeOrder,
receiptOrder,
addOrder
addOrder,
getOrderPayByOrderId
} from '@/websoft/api/order.js'
import {
bindEquipment
@@ -197,33 +204,37 @@
import {
uploadFile
} from '@/websoft/api/upload.js'
import { fileUrl } from '@/config.js';
import {
createOrderNo,dateFormat
import {
fileUrl
} from '@/config.js';
import {
createOrderNo,
dateFormat
} from '@/utils/util.js'
// 每页记录数量
const pageSize = 15
// tab栏数据
const tabs = [{
name: `全部`,
value: 'all'
}, {
name: `待支付`,
value: 'payment'
},
{
name: `待绑定`,
value: 'delivery'
},
{
name: `进行中`,
value: 'comment'
},
{
name: `已完成`,
value: 'refund'
}]
name: `全部`,
value: 'all'
}, {
name: `待支付`,
value: 'payment'
},
{
name: `待绑定`,
value: 'delivery'
},
{
name: `进行中`,
value: 'comment'
},
{
name: `已完成`,
value: 'refund'
}
]
export default {
components: {
@@ -319,7 +330,7 @@ import {
app.curTab = index > -1 ? index : 0
}
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
@@ -367,20 +378,21 @@ import {
app.where.userId = uni.getStorageSync('userId');
app.where.isRenew = 0;
app.where.isApp = true;
app.where.isFreeze = 1;
pageOrder(app.where).then(res => {
app.list = res.data.list
const curPageLen = res.data.list.length
const totalSize = res.data.count
console.log("totalSize: ", totalSize);
app.mescroll.endBySize(curPageLen, totalSize)
app.list.map((d,index) => {
app.list.map((d, index) => {
const setTime = new Date(d.expirationTime);
const nowTime = new Date();
const restSec = setTime.getTime() - nowTime.getTime();
// 剩余天数
const day = parseInt(restSec / (60*60*24*1000));
console.log("逾期天数: ",Math.abs(day));
const day = parseInt(restSec / (60 * 60 * 24 * 1000));
console.log("逾期天数: ", Math.abs(day));
app.list[index].expirationDay = day
})
})
@@ -561,9 +573,14 @@ import {
// 点击去支付
onPay(orderId) {
this.$navTo('pages/checkout/cashier/index', {
orderId
getOrderPayByOrderId(orderId).then(res => {
this.$navTo('pages/checkout/cashier/index', {
orderId: res.data.id
})
})
},
// 跳转到订单详情页
@@ -821,8 +838,8 @@ import {
margin-top: 30rpx;
}
}
.yuqi-text{
.yuqi-text {
color: #ff0000;
}
</style>
</style>

View File

@@ -120,7 +120,8 @@
getEquipmentList() {
const app = this
EquipmentApi.pageEquipment({
userId: storage.get("userId")
userId: storage.get("userId"),
equipmentId: app.options.equipmentId
}).then(res => {
this.list = res.data.list
console.log(res);