You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
8.2 KiB

11 months ago
<template>
8 months ago
<view class="detail-page">
<!-- 顶部导航 -->
<u-navbar title="查看详情" :is-back="true" back-icon-color="#fff" :background="{'background':'#1479ff'}"
title-color="#fff" :border-bottom="false"></u-navbar>
<view class="b-border"></view>
<!-- 订单信息 -->
<view class="order-info">
<view class="info-item">
<text class="label">订单号</text>
<text class="value">{{orderInfo.no}}</text>
11 months ago
</view>
8 months ago
<view class="info-item">
<text class="label">服务项目</text>
<text class="value">{{orderInfo.accompany_product?orderInfo.accompany_product.name:''}}</text>
11 months ago
</view>
8 months ago
<view class="info-item">
<text class="label">服务时间</text>
<text class="value">{{orderInfo.time}}</text>
</view>
8 months ago
8 months ago
<view class="info-item" v-if="orderInfo.type === 2">
<text class="label">服务地址</text>
<text class="value">{{item.city?item.city:'' }}</text>
</view>
8 months ago
<view class="info-item" v-else>
<text class="label">就诊医院</text>
<text class="value">{{orderInfo.hospital?orderInfo.hospital.name:''}}</text>
</view>
<view class="info-item">
<text class="label">联系人</text>
<text class="value">{{orderInfo.appoint_name?orderInfo.appoint_name:''}}</text>
</view>
<view class="info-item">
<text class="label">联系方式</text>
<text class="value">{{orderInfo.appoint_mobile?orderInfo.appoint_mobile:''}}</text>
</view>
<view class="info-item">
<text class="label">被服务人</text>
<text class="value">{{orderInfo.user_archive?orderInfo.user_archive.name:''}}</text>
</view>
<view class="info-item">
<text class="label">是否可以自理</text>
<text class="value">{{orderInfo.my_provide===1?'可以自理':'不能自理'}}</text>
</view>
<view class="info-item info-item-reason">
<text class="label">就诊资料</text>
<view class="value">
<view class="order-item-img">
<image v-for="(item,index) in imgs" :src="item" @click="imgPreview(index)"></image>
</view>
</view>
8 months ago
</view>
8 months ago
<view class="info-item info-item-reason">
<text class="label">其他需求</text>
<text class="value">{{orderInfo.content?orderInfo.content:''}}</text>
</view>
8 months ago
<view class="info-item">
<text class="label">订单金额</text>
<text class="value">¥{{orderInfo.price}}</text>
11 months ago
</view>
8 months ago
<view class="info-item">
<text class="label">原始金额</text>
<text class="value">¥{{orderInfo.from_price}}</text>
11 months ago
</view>
8 months ago
<view class="info-item" v-if="orderInfo.status===3||orderInfo.status===4">
<text class="label">待付金额</text>
<text class="value price">¥{{orderInfo.diff_price}}</text>
</view>
<view class="info-item info-item-reason">
<text class="label">修改原因</text>
8 months ago
<text class="value reason">{{orderInfo.update_price_reason?orderInfo.update_price_reason:''}}</text>
8 months ago
</view>
</view>
8 months ago
<!-- 服务记录 -->
<!-- <view class="order-info" v-if="orderInfo.accompany_order_log && orderInfo.accompany_order_log.length>0">
<view class="info-item info-item-reason">
<text class="label">服务记录</text>
<view class="value">
<view class="">
<view v-for="item in orderInfo.accompany_order_log">
<view>备注{{item.remark}}</view>
<view class="order-item-img">
<image v-for="(i,index) in item.files" :src="i.url"
@click="imgPreviewList(item.files,index)"></image>
</view>
</view>
</view>
</view>
</view>
11 months ago
8 months ago
</view> -->
8 months ago
<!-- 支付二维码 -->
<view class="payment-popup" v-if="orderInfo.status===3">
<view class="title">付款二维码</view>
<view class="amount">
<text class="symbol">¥</text>
<text class="number">{{orderInfo.diff_price}}</text>
11 months ago
</view>
8 months ago
<view class="qr-code">
8 months ago
<!-- <image :src="qrCodeUrl" mode="aspectFit"></image> -->
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'"
:size="200" :options="{
margin: 10,
8 months ago
}"></uqrcode>
11 months ago
</view>
8 months ago
<view class="tips">
<text>请扫码支付差额</text>
<text class="sub-tips">支付完成后订单将自动完成</text>
8 months ago
</view>
<view class="close-btn">
<u-button size="mini" shape="circle" type="default" :custom-style="parStyle"
@click="isPayCode">我已支付</u-button>
11 months ago
</view>
</view>
8 months ago
11 months ago
</view>
</template>
8 months ago
<script>
8 months ago
import uqrcode from '@/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue'
8 months ago
export default {
components: {
uqrcode
8 months ago
},
11 months ago
data() {
8 months ago
return {
myQrcode: '',
imgs: [],
orderId: '',
orderInfo: {},
parStyle: {
'background': 'linear-gradient(to right, #476de4, #7bb9f7)',
'color': '#fff',
'font-size': '28rpx',
'padding': '0 30rpx',
'margin-left': '15rpx'
11 months ago
},
}
},
onLoad(options) {
8 months ago
// 获取订单详情
8 months ago
this.orderId = options.id
this.getOrderDetail(options.id);
11 months ago
},
8 months ago
methods: {
imgPreview(index) {
uni.previewImage({
current: index, // 当前显示图片索引
urls: this.imgs // 需要预览的图片http链接列表
});
11 months ago
},
8 months ago
async getOrderDetail(orderId) {
// 调用接口获取订单详情
11 months ago
const res = await this.$u.api.orderDetail({
8 months ago
id: orderId
11 months ago
})
8 months ago
this.orderInfo = res
let _arr = []
if (res.files.length > 0) {
res.files.map(item => {
_arr.push(item.url)
})
this.imgs = _arr
}
if (res.status === 3) {
await this.getCode(res.no)
11 months ago
}
8 months ago
},
async getCode(no) {
const res = await this.$u.api.payCode({
no: no
})
if (res.result.return_code === 'SUCCESS') {
if (res.result.code_url) {
this.myQrcode = res.result.code_url
} else {
uni.showToast({
icon: 'none',
title: res.result.err_code_des || '获取失败'
})
}
} else {
uni.showToast({
icon: 'none',
title: '获取失败'
})
}
},
isPayCode() {
this.myQrcode = ''
this.getOrderDetail(this.orderId)
11 months ago
},
}
}
</script>
<style lang="scss" scoped>
8 months ago
.detail-page {
min-height: 100vh;
background: #f5f5f5;
padding-bottom: 40rpx;
11 months ago
8 months ago
.b-border {
width: 100%;
height: 30rpx;
border-radius: 0 0 120rpx 120rpx;
background-color: #1479ff;
11 months ago
}
8 months ago
.order-info {
background: #fff;
border-radius: 20rpx;
margin: 30rpx;
box-shadow: 0 4rpx 16rpx #e6eaf1;
padding: 0 30rpx;
.info-item {
padding: 30rpx;
display: flex;
justify-content: space-between;
// margin-bottom: 30rpx;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
.label {
color: #666;
font-size: 28rpx;
}
.value {
color: #333;
font-size: 28rpx;
// &.price {
// color: #f56c6c;
// font-weight: bold;
// }
&.reason {
color: #999;
}
}
}
11 months ago
8 months ago
.info-item-reason {
flex-wrap: wrap;
11 months ago
8 months ago
&>text {
width: 100%
}
8 months ago
}
.order-item-img {
display: flex;
flex-wrap: wrap;
image {
width: 140rpx;
height: 140rpx;
margin: 10rpx;
}
11 months ago
}
}
8 months ago
.payment-popup {
background: #fff;
border-radius: 20rpx;
margin: 30rpx;
box-shadow: 0 4rpx 16rpx #e6eaf1;
padding: 30rpx;
11 months ago
8 months ago
.title {
font-size: 32rpx;
color: #333;
text-align: center;
font-weight: 500;
margin-bottom: 20rpx;
11 months ago
}
8 months ago
.amount {
text-align: center;
margin-bottom: 20rpx;
11 months ago
8 months ago
.symbol {
font-size: 36rpx;
color: #000;
11 months ago
}
8 months ago
.number {
font-size: 48rpx;
color: #d80808;
font-weight: bold;
11 months ago
}
8 months ago
}
11 months ago
8 months ago
.qr-code {
width: 200rpx;
height: 200rpx;
margin: 0 auto 20rpx;
image {
width: 100%;
height: 100%;
11 months ago
}
}
8 months ago
.tips {
text-align: center;
margin-bottom: 20rpx;
text {
display: block;
color: #333;
font-size: 28rpx;
line-height: 1.8;
}
11 months ago
8 months ago
.sub-tips {
color: #999;
font-size: 24rpx;
11 months ago
}
8 months ago
}
.close-btn {
width: 80%;
margin: 0 auto;
display: flex;
justify-content: center;
11 months ago
}
}
}
</style>