3.9提交
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">支付方式:</text>
|
||||
<text class="info-value">{{ detail.payType || "--" }}</text>
|
||||
<text class="info-value">{{ detail.payType}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">支付时间:</text>
|
||||
@@ -77,7 +77,7 @@ const formatAmount = (value) => {
|
||||
if (value === undefined || value === null || value === "") return "";
|
||||
const num = Number(value);
|
||||
if (Number.isNaN(num)) return "";
|
||||
const amount = num > 1000 ? num / 100 : num;
|
||||
const amount = num / 100;
|
||||
return `${amount.toFixed(2)}元`;
|
||||
};
|
||||
|
||||
@@ -90,13 +90,15 @@ const formatStatus = (raw) => {
|
||||
};
|
||||
|
||||
const formatPayType = (raw) => {
|
||||
if (raw === undefined || raw === null || raw === "") return "免费";
|
||||
const text = String(raw).toLowerCase();
|
||||
if (text === "0" || text === "free") return "免费";
|
||||
if (text === "1" || text.includes("wx") || text.includes("wechat")) return "微信";
|
||||
if (text === "2" || text.includes("ali")) return "支付宝";
|
||||
if (text === "3" || text.includes("balance")) return "余额";
|
||||
return String(raw);
|
||||
if(raw=='balance'){
|
||||
return '余额支付';
|
||||
}else if(raw=='FREE'){
|
||||
return '免费'
|
||||
}else if(raw=='USEWELFARENUM'){
|
||||
return '免费次数';
|
||||
}else if(raw=='wx'){
|
||||
return '微信支付';
|
||||
}
|
||||
};
|
||||
|
||||
const fetchCoursewareDetail = async () => {
|
||||
@@ -115,10 +117,11 @@ const fetchCoursewareDetail = async () => {
|
||||
author: data.provider_name || data.author || data.nickname || "",
|
||||
amountText: formatAmount(data.pay_amount || data.total_fee || data.amount || data.price || 0),
|
||||
createTime: formatDateTime(data.create_date || data.create_time || data.order_time || ""),
|
||||
payType: formatPayType(data.pay_type_name || data.pay_type || data.payment_method || ""),
|
||||
payType: formatPayType(data.pay_channel),
|
||||
payTime: formatDateTime(data.pay_date || data.pay_time || ""),
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
uni.showToast({
|
||||
title: "获取详情失败",
|
||||
icon: "none",
|
||||
@@ -152,8 +155,8 @@ onLoad((options) => {
|
||||
}
|
||||
|
||||
.download-no {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.pay-status {
|
||||
@@ -192,8 +195,8 @@ onLoad((options) => {
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 18rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
|
||||
@@ -49,12 +49,15 @@
|
||||
<scroll-view
|
||||
scroll-y
|
||||
class="courseware-list"
|
||||
:scroll-top="listScrollTop"
|
||||
:scroll-into-view="scrollIntoViewId"
|
||||
refresher-enabled
|
||||
@refresherrefresh="onRefresh"
|
||||
:refresher-triggered="refreshing"
|
||||
@scrolltolower="onLoadMore"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<view id="courseware-top"></view>
|
||||
<!-- 空状态 -->
|
||||
<view v-if="coursewareList.length === 0 && !loading" class="empty-state">
|
||||
<text>{{ activeTab === 'download' ? '暂无下载数据' : '暂无分享数据' }}</text>
|
||||
@@ -62,21 +65,22 @@
|
||||
|
||||
<view class="courseware-item" v-for="(item, index) in coursewareList" :key="index" @click="onItemClick(item)">
|
||||
<view class="item-content">
|
||||
<view class="courseware-provider" v-if="activeTab === 'share'">
|
||||
<text class="label">下载医生:</text>
|
||||
<text class="value">{{ item.providername }}</text>
|
||||
</view>
|
||||
<view class="courseware-name">
|
||||
<text class="label">课件名称:</text>
|
||||
<text class="value">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="courseware-provider" v-if="item.providername">
|
||||
<text class="label">{{ activeTab === 'download' ? '提供者' : '下载者' }}:</text>
|
||||
<text class="value">{{ item.providername }}</text>
|
||||
</view>
|
||||
|
||||
<view class="courseware-time">
|
||||
<text class="label">时间:</text>
|
||||
<text class="value">{{ item.time }}</text>
|
||||
</view>
|
||||
<view class="courseware-status" v-if="activeTab === 'download'">
|
||||
<text class="label">状态:</text>
|
||||
<text class="value status-paid">{{ item.status }}</text>
|
||||
<text class="value status-paid">{{item.status}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -95,13 +99,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, nextTick } from 'vue';
|
||||
import api from '@/api/api';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import { onLoad,onBackPress } from '@dcloudio/uni-app';
|
||||
import downLoadImg from "@/static/course_download.png"
|
||||
import moneyImg from "@/static/course_yuan.png"
|
||||
const activeTab = ref('download');
|
||||
const listScrollTop = ref(0);
|
||||
const scrollIntoViewId = ref('');
|
||||
const refreshing = ref(false);
|
||||
const loading = ref(false);
|
||||
const noMore = ref(false);
|
||||
@@ -126,7 +132,16 @@ onLoad((options) => {
|
||||
onMounted(() => {
|
||||
onRefresh();
|
||||
});
|
||||
|
||||
const getStatusText = (status) => {
|
||||
console.log(status);
|
||||
if(status === 'paid'){
|
||||
return '已支付';
|
||||
}else if(status === 'unpaid'){
|
||||
return '未支付';
|
||||
}else{
|
||||
return '已分享';
|
||||
}
|
||||
};
|
||||
const goBack = () => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
@@ -143,6 +158,11 @@ onLoad((options) => {
|
||||
})
|
||||
const switchTab = (tab) => {
|
||||
activeTab.value = tab;
|
||||
listScrollTop.value = 0;
|
||||
scrollIntoViewId.value = '';
|
||||
nextTick(() => {
|
||||
scrollIntoViewId.value = 'courseware-top';
|
||||
});
|
||||
// 切换标签时重置数据
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
@@ -182,7 +202,7 @@ const onRefresh = () => {
|
||||
uuid: item.uuid,
|
||||
order_id: item.order_id,
|
||||
type: item.type,
|
||||
providername: item.providername
|
||||
providername: item.downloadername
|
||||
}));
|
||||
|
||||
// 判断是否还有更多数据
|
||||
@@ -354,7 +374,7 @@ const onLoadMore = () => {
|
||||
.courseware-list {
|
||||
// height: calc(100vh - 180rpx - 116rpx - 80rpx);
|
||||
position: fixed;
|
||||
top: 336rpx; // 调整顶部位置,为固定的摘要栏腾出空间
|
||||
top: calc(var(--status-bar-height) + 44px + 124rpx + 80rpx); // 调整顶部位置,为固定的摘要栏腾出空间
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user