订单详情待支付订单加入支付按钮
This commit is contained in:
parent
8c282a1bb9
commit
72c7bcfcef
|
@ -25,6 +25,6 @@ uni-page-head{
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
body{
|
body{
|
||||||
font-family: 'PingFang SC','Source Han Sans';
|
font-family: PingFang SC , Source Han Sans;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -53,7 +53,8 @@ export const stateConfig = {
|
||||||
5: '订单核销',
|
5: '订单核销',
|
||||||
6: '退款中',
|
6: '退款中',
|
||||||
7: '退款完成',
|
7: '退款完成',
|
||||||
8: '退款失败'
|
8: '退款失败' ,
|
||||||
|
9: '订单取消'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tabs = [{
|
export const tabs = [{
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
function viewPwd(orderData){
|
function viewPwd(orderData){
|
||||||
const {voucher_link} = orderData
|
const {voucher_link} = orderData
|
||||||
if(voucher_link){
|
if(voucher_link){
|
||||||
|
console.log('跳转外部链接--->',voucher_link);
|
||||||
window.location.href = voucher_link
|
window.location.href = voucher_link
|
||||||
}else{
|
}else{
|
||||||
console.error(`${voucher_link}无有效值`);
|
console.error(`${voucher_link}无有效值`);
|
||||||
|
@ -145,6 +146,8 @@
|
||||||
padding-bottom:30rpx
|
padding-bottom:30rpx
|
||||||
}
|
}
|
||||||
.order-wrapper{
|
.order-wrapper{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
.no-more{
|
.no-more{
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="btn pwd" @click="viewPwd">查看卡密</view>
|
<view class="btn pwd" @click="viewPwd(orderDetail)" v-if="[3].includes(orderDetail.state)">查看卡密</view>
|
||||||
|
<view class="btn pwd" @click="pay(orderDetail)" v-if="[1].includes(orderDetail.state)">立即付款</view>
|
||||||
<view class="btn back" @click="backIndex">返回首页</view>
|
<view class="btn back" @click="backIndex">返回首页</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -47,7 +48,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { onMounted, reactive, ref, unref } from 'vue';
|
import { onMounted, reactive, ref, unref } from 'vue';
|
||||||
import { queryOrderDetail, goPay } from '../../api/ycnc';
|
import { queryOrderDetail} from '../../api/ycnc';
|
||||||
|
import usePay from './hooks/usePay';
|
||||||
const id = ref('');
|
const id = ref('');
|
||||||
const orderNo = ref('');
|
const orderNo = ref('');
|
||||||
const orderDetail = reactive({});
|
const orderDetail = reactive({});
|
||||||
|
@ -68,12 +70,20 @@
|
||||||
const viewPwd = (detailData) => {
|
const viewPwd = (detailData) => {
|
||||||
const {voucher_link} = detailData
|
const {voucher_link} = detailData
|
||||||
if(voucher_link){
|
if(voucher_link){
|
||||||
|
console.log(`跳转外部链接-->${voucher_link}`);
|
||||||
window.location.href = voucher_link
|
window.location.href = voucher_link
|
||||||
}else{
|
}else{
|
||||||
console.error(`voucher_link无有效值`);
|
console.error(`voucher_link无有效值`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pay(orderData){
|
||||||
|
console.log(orderData);
|
||||||
|
const {order_no,notify_url,price} = orderData;
|
||||||
|
const {payFunc} = usePay();
|
||||||
|
payFunc({order_no,notify_url,TranAmt:price})
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDetail()
|
getDetail()
|
||||||
})
|
})
|
||||||
|
|
|
@ -40,7 +40,7 @@ function http(options) {
|
||||||
}else{
|
}else{
|
||||||
uni.hideLoading().then(() => {
|
uni.hideLoading().then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请求错误',
|
title: res.data.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue