订单详情待支付订单加入支付按钮

This commit is contained in:
xiaogang 2024-07-17 18:45:20 +08:00
parent 8c282a1bb9
commit 72c7bcfcef
5 changed files with 19 additions and 5 deletions

View File

@ -25,6 +25,6 @@ uni-page-head{
display: none !important;
}
body{
font-family: 'PingFang SC','Source Han Sans';
font-family: PingFang SC , Source Han Sans;
}
</style>

View File

@ -53,7 +53,8 @@ export const stateConfig = {
5: '订单核销',
6: '退款中',
7: '退款完成',
8: '退款失败'
8: '退款失败' ,
9: '订单取消'
}
export const tabs = [{

View File

@ -108,6 +108,7 @@
function viewPwd(orderData){
const {voucher_link} = orderData
if(voucher_link){
console.log('跳转外部链接--->',voucher_link);
window.location.href = voucher_link
}else{
console.error(`${voucher_link}无有效值`);
@ -145,6 +146,8 @@
padding-bottom:30rpx
}
.order-wrapper{
display: flex;
flex-direction: column;
width:100%;
}
.no-more{

View File

@ -38,7 +38,8 @@
</view>
</view>
<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>
</view>
@ -47,7 +48,8 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app';
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 orderNo = ref('');
const orderDetail = reactive({});
@ -68,12 +70,20 @@
const viewPwd = (detailData) => {
const {voucher_link} = detailData
if(voucher_link){
console.log(`跳转外部链接-->${voucher_link}`);
window.location.href = voucher_link
}else{
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(() => {
getDetail()
})

View File

@ -40,7 +40,7 @@ function http(options) {
}else{
uni.hideLoading().then(() => {
uni.showToast({
title: '请求错误',
title: res.data.message,
icon: 'none'
});
})