8.20提交

This commit is contained in:
zoujiandong 2025-08-20 17:40:56 +08:00
parent d56117c39f
commit 2051df3a52
9 changed files with 1612 additions and 5 deletions

View File

@ -93,6 +93,26 @@
}
}
},
{
"path": "videoDetail/videoDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "myFlower/myFlower",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "news/news",
"style": {
@ -134,6 +154,36 @@
}
}
},
{
"path": "pay/pay",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "buyPoint/buyPoint",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "pointGoods/pointGoods",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "msg/msg",
"style": {

View File

@ -1,14 +1,318 @@
<template>
<view class="content">
<uni-nav-bar
left-icon="left"
title="购买积分"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#eeeeee"
></uni-nav-bar>
<view class="buy-point-page">
<!-- 主要内容区域 -->
<view class="main-content">
<!-- 页面标题 -->
<view class="page-title">购买积分</view>
<!-- 积分套餐选择 -->
<view class="package-grid">
<view
class="package-item"
:class="{ active: selectedPackage === pkg.id }"
v-for="pkg in packages"
:key="pkg.id"
@click="selectPackage(pkg.id)"
>
<text class="package-points">{{ pkg.points }}</text>
</view>
</view>
<view class="bar"></view>
<!-- 所需金额显示 -->
<view class="amount-section">
<view class="amount-row">
<text class="amount-label">所需金额</text>
<text class="amount-value">¥{{ selectedPackageData.price }}</text>
</view>
</view>
</view>
<!-- 底部购买按钮 -->
<view class="bottom-actions">
<view class="buy-btn" @click="confirmPurchase">
<text class="btn-text">立即购买</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import { ref, computed } from 'vue';
// - 5
const packages = ref([
{ id: 1, points: 500, price: '45.00' },
{ id: 2, points: 1000, price: '88.00' },
{ id: 3, points: 2500, price: '198.00' },
{ id: 4, points: 5000, price: '398.00' },
{ id: 5, points: 10000, price: '758.00' }
]);
//
const selectedPackage = ref(0); //
//
const selectedPackageData = computed(() => {
if (selectedPackage.value === 0) {
return { points: 0, price: '0.00' };
}
return packages.value.find(p => p.id === selectedPackage.value) || { points: 0, price: '0.00' };
});
//
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({
url: '/pages/index/index'
});
}
});
};
const selectPackage = (packageId) => {
selectedPackage.value = packageId;
};
const confirmPurchase = () => {
if (selectedPackage.value === 0) {
uni.showToast({
title: '请选择积分套餐',
icon: 'none'
});
return;
}
const packageData = selectedPackageData.value;
uni.showModal({
title: '确认购买',
content: `确认购买${packageData.points}积分,支付金额¥${packageData.price}`,
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '购买成功',
icon: 'success'
});
}
}
});
};
</script>
<style scoped>
<style lang="scss" scoped>
//
$bg-color: #ffffff;
$text-primary: #333333;
$text-secondary: #666666;
$text-light: #999999;
$border-color: #e5e5e5;
$white: #ffffff;
$theme-color: #e74c3c;
$teal-color: #00cbc0;
$light-teal: #e6f7f6;
</style>
//
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
@mixin flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.buy-point-page {
height: calc(100vh - 140rpx);
background-color: $bg-color;
overflow: hidden; //
.bar{
width:100%;
height: 20rpx;
background:#eeeeee;
}
}
.status-bar {
height: 44rpx;
background-color: $white;
@include flex-between;
padding: 0 30rpx;
font-size: 24rpx;
color: $text-primary;
.status-left {
display: flex;
align-items: center;
gap: 20rpx;
.time {
font-weight: 500;
}
.app-icons {
display: flex;
gap: 8rpx;
.app-icon {
width: 24rpx;
height: 24rpx;
border-radius: 4rpx;
@include flex-center;
font-size: 16rpx;
color: $white;
&.blue { background-color: #007aff; }
&.red { background-color: #ff3b30; }
&.red-white { background-color: #ff3b30; }
}
}
}
.status-right {
display: flex;
align-items: center;
gap: 20rpx;
.network-info,
.signal,
.wifi,
.battery {
font-size: 22rpx;
}
}
}
.header {
height: 88rpx;
background-color: $white;
@include flex-between;
padding: 0 30rpx;
border-bottom: 1rpx solid $border-color;
.header-left {
.back-btn {
font-size: 48rpx;
color: $theme-color;
font-weight: bold;
}
}
.header-center {
.title {
font-size: 36rpx;
color: $theme-color;
font-weight: bold;
}
}
}
.main-content {
padding: 40rpx 0rpx;
.page-title {
font-size: 36rpx;
color: $text-primary;
font-weight: normal;
padding:0 30rpx;
margin-bottom: 60rpx;
text-align: left;
}
.package-grid {
display: grid;
padding:0 30rpx;
grid-template-columns: repeat(3, 1fr);
gap: 30rpx;
margin-bottom: 80rpx;
// 32
.package-item {
height: 120rpx;
border: 2rpx solid $teal-color;
border-radius: 16rpx;
@include flex-center;
background-color: $white;
transition: all 0.3s ease;
cursor: pointer;
&.active {
background-color: $teal-color;
border-color: $teal-color;
.package-points {
color: $white;
}
}
.package-points {
font-size: 36rpx;
color: $teal-color;
font-weight: normal;
}
}
}
.amount-section {
.amount-row {
@include flex-between;
padding: 30rpx;
.amount-label {
font-size: 32rpx;
color: $text-primary;
font-weight: normal;
}
.amount-value {
font-size: 36rpx;
color: $theme-color;
font-weight: normal;
}
}
}
}
.bottom-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: $white;
z-index: 100;
.buy-btn {
background-color: $teal-color;
height: 88rpx;
@include flex-center;
cursor: pointer;
.btn-text {
color: $white;
font-size: 32rpx;
}
}
}
</style>

View File

@ -0,0 +1,190 @@
<template>
<uni-nav-bar
left-icon="left"
title="我的鲜花"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#eeeeee"
/>
<view class="flower-page">
<!-- 顶部统计栏与截图一致两项 -->
<view class="stats-bar">
<view class="stat">
<text class="icon">🌸</text>
<text class="num">{{ stat.totalCount }}</text>
</view>
<view class="stat">
<text class="icon"></text>
<text class="num">{{ stat.totalAmount.toFixed(2) }}</text>
</view>
</view>
<!-- 表头条红底白字 -->
<view class="table-header">
<text class="col name">姓名</text>
<text class="col time">时间</text>
<text class="col qty">数量</text>
</view>
<!-- 表体/列表或空状态 -->
<scroll-view
class="table-body"
scroll-y
:show-scrollbar="false"
refresher-enabled
:refresher-triggered="refreshing"
@refresherrefresh="onRefresh"
@scrolltolower="onLoadMore"
lower-threshold="80"
>
<view v-if="records.length === 0" class="empty-wrap">
<image class="empty-icon" src="/static/wdfl.png" mode="aspectFit" />
<text class="empty-text">您暂未收到鲜花</text>
</view>
<view v-else class="row" v-for="(item, idx) in records" :key="idx">
<text class="cell name">{{ item.name }}</text>
<text class="cell time">{{ item.time }}</text>
<text class="cell qty" :class="{ plus: item.amount > 0, minus: item.amount < 0 }">{{ item.amount }}</text>
</view>
<view v-if="loading" class="loading">加载中...</view>
<view v-if="noMore" class="no-more">没有更多了</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref } from 'vue';
//
const stat = ref({ totalCount: 0, totalAmount: 0.0 });
// //
const records = ref([]);
//
const refreshing = ref(false);
const loading = ref(false);
const noMore = ref(false);
const page = ref(1);
const pageSize = ref(10);
const mockMore = Array.from({ length: 24 }).map((_, i) => ({
name: i % 2 ? '王医生' : '李医生',
time: `2025-06-${20 + (i % 10)} 17:1${i % 6}:2${i % 9}`,
amount: i % 2 ? +1 : +2
}));
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({ url: '/pages/index/index' });
}
});
};
const onRefresh = async () => {
if (refreshing.value) return;
refreshing.value = true;
try {
await new Promise(r => setTimeout(r, 600));
page.value = 1;
noMore.value = false;
records.value = []; //
uni.showToast({ title: '刷新成功', icon: 'success' });
} finally {
refreshing.value = false;
}
};
const onLoadMore = async () => {
if (loading.value || noMore.value) return;
loading.value = true;
try {
await new Promise(r => setTimeout(r, 600));
const start = (page.value - 1) * pageSize.value;
const chunk = mockMore.slice(start, start + pageSize.value);
if (!chunk.length) {
noMore.value = true;
} else {
records.value.push(...chunk);
page.value += 1;
}
} finally {
loading.value = false;
}
};
</script>
<style lang="scss" scoped>
$theme: #8B2316;
$bg: #ffffff;
$text: #333;
$muted: #999;
$card: #ffffff;
.flower-page { height: calc(100vh - 140rpx); background: $bg; }
.stats-bar {
display: flex;
justify-content: space-around;
align-items: center;
padding: 24rpx 0;
background: #fff;
border-bottom: 2rpx solid #eee;
.stat { display: flex; align-items: center; gap: 16rpx; }
.icon { font-size: 34rpx; }
.num { font-size: 30rpx; color: #333; }
}
.table-header {
background: #9e3a2e;
color: #fff;
display: flex;
justify-content: space-between;
padding: 22rpx 30rpx;
font-size: 30rpx;
position: sticky;
top: 140rpx; /* nav 高度 */
z-index: 5;
.col { width: 33%; }
.name { text-align: left; }
.time { text-align: center; }
.qty { text-align: right; }
}
.table-body {
height: calc(100vh - 140rpx - 88rpx - 70rpx);
/* 充满剩余高度,避免滚动穿透 */
}
.row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 26rpx 30rpx;
border-bottom: 2rpx solid #f2f2f2;
font-size: 28rpx;
color: #333;
.cell { width: 33%; }
.name { text-align: left; }
.time { text-align: center; color: #666; }
.qty { text-align: right; }
.qty.plus { color: #2dbd85; }
.qty.minus { color: #e34d4d; }
}
.empty-wrap { padding-top: 200rpx; display: flex; flex-direction: column; align-items: center; color: #bdbdbd; }
.empty-icon { width: 220rpx; height: 220rpx; opacity: .4; }
.empty-text { margin-top: 20rpx; font-size: 30rpx; }
.loading, .no-more { text-align: center; color: #9aa0a6; padding: 20rpx 0; font-size: 26rpx; }
</style>

360
pages_app/pay/pay.vue Normal file
View File

@ -0,0 +1,360 @@
<template>
<uni-nav-bar
left-icon="left"
title="在线支付"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#eeeeee"
></uni-nav-bar>
<view class="pay-page">
<!-- 主要内容区域 -->
<view class="main-content">
<!-- 购买信息 -->
<view class="purchase-summary">
<view class="summary-row">
<text class="summary-label">您购买了500积分</text>
<text class="summary-amount">11</text>
</view>
</view>
<!-- 支付方式说明 -->
<view class="payment-intro">
<text class="intro-text">通过以下方式支付</text>
</view>
<!-- 余额支付选项 -->
<view class="payment-option">
<view class="option-left">
<up-image :src="moneyImg" width="56rpx" height="56rpx" ></up-image>
</view>
<view class="option-middle">
<text class="option-title">余额支付 ¥0.00</text>
<text class="option-desc">余额不足</text>
</view>
<view class="option-right">
<radio
:checked="selectedPayment === 'balance'"
@tap="selectPayment('balance')"
color="#8B2316"
/>
</view>
</view>
<!-- 选择付款方式标题 -->
<view class="payment-method-title">
<text class="method-title-text">选择付款方式</text>
</view>
<!-- 微信支付选项 -->
<view class="payment-option">
<view class="option-left">
<up-image :src="wxImg" width="56rpx" height="56rpx" ></up-image>
</view>
<view class="option-middle">
<text class="option-title">微信支付</text>
</view>
<view class="option-right">
<radio
:checked="selectedPayment === 'wechat'"
@tap="selectPayment('wechat')"
color="#8B2316"
/>
</view>
</view>
</view>
<!-- 底部支付按钮 -->
<view class="bottom-actions">
<view class="pay-btn" @click="confirmPayment">
<text class="btn-text">立即支付</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import wxImg from "@/static/weixin.png"
import moneyImg from "@/static/yue.png"
// .png
const paymentInfo = ref({
points: 500,
amount: '11.00'
});
//
const selectedPayment = ref('');
//
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({
url: '/pages/index/index'
});
}
});
};
const selectPayment = (paymentType) => {
selectedPayment.value = paymentType;
};
const confirmPayment = () => {
if (!selectedPayment.value) {
uni.showToast({
title: '请选择支付方式',
icon: 'none'
});
return;
}
uni.showModal({
title: '确认支付',
content: `确认使用${selectedPayment.value === 'balance' ? '余额支付' : '微信支付'}支付${paymentInfo.value.amount}元购买${paymentInfo.value.points}积分?`,
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '支付成功',
icon: 'success'
});
}
}
});
};
</script>
<style lang="scss" scoped>
//
$bg-color: #e4e4e4;
$text-primary: #333333;
$text-secondary: #666666;
$text-light: #999999;
$border-color: #e0e0e0;
$white: #ffffff;
$theme-color: #e74c3c;
$green-color: #52c41a;
$light-grey: #f8f9fa;
//
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
@mixin flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.pay-page {
height: calc(100vh - 140rpx);
background-color: $bg-color;
overflow: hidden;
}
.status-bar {
height: 44rpx;
background-color: $white;
@include flex-between;
padding: 0 30rpx;
font-size: 24rpx;
color: $text-primary;
.status-left {
display: flex;
align-items: center;
gap: 20rpx;
.time {
font-weight: normal;
}
.app-icons {
display: flex;
gap: 8rpx;
.app-icon {
width: 24rpx;
height: 24rpx;
border-radius: 4rpx;
@include flex-center;
font-size: 16rpx;
color: $white;
&.blue { background-color: #007aff; }
&.purple { background-color: #8e44ad; }
&.red { background-color: #ff3b30; }
}
}
}
.status-right {
display: flex;
align-items: center;
gap: 20rpx;
.network-info,
.signal,
.wifi,
.battery {
font-size: 22rpx;
}
}
}
.header {
height: 88rpx;
background-color: $white;
@include flex-between;
padding: 0 30rpx;
border-bottom: 1rpx solid $border-color;
.header-left {
.back-btn {
font-size: 48rpx;
color: $theme-color;
font-weight: normal;
}
}
.header-center {
.title {
font-size: 36rpx;
color: $theme-color;
font-weight: normal;
}
}
}
.main-content {
padding: 0;
.purchase-summary {
background-color: $white;
padding: 30rpx;
border-bottom: 1rpx solid $border-color;
.summary-row {
@include flex-between;
.summary-label {
font-size: 32rpx;
color: $text-primary;
font-weight: normal;
}
.summary-amount {
font-size: 36rpx;
color: $theme-color;
font-weight: normal;
}
}
}
.payment-intro {
padding: 30rpx;
border-bottom: 1rpx solid $border-color;
.intro-text {
font-size: 28rpx;
color: $text-secondary;
font-weight: normal;
}
}
.payment-option {
background-color: $white;
padding: 30rpx;
border-bottom: 1rpx solid $border-color;
@include flex-between;
.option-left {
.payment-icon {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
@include flex-center;
font-size: 32rpx;
color: $white;
font-weight: normal;
&.balance-icon {
background-color: $green-color;
}
&.wechat-icon {
background-color: $green-color;
}
}
}
.option-middle {
flex: 1;
display: flex;
align-items: center;
margin-left: 30rpx;
.option-title {
font-size: 32rpx;
color: $text-primary;
font-weight: normal;
display: block;
}
.option-desc {
font-size: 24rpx;
color: $theme-color;
font-weight: normal;
margin-left: 30rpx;
}
}
.option-right {
// radio-btn使uni-appradio
}
}
.payment-method-title {
padding: 30rpx;
border-bottom: 1rpx solid $border-color;
.method-title-text {
font-size: 28rpx;
color: $text-secondary;
font-weight: normal;
}
}
}
.bottom-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: $white;
padding: 20rpx 30rpx;
border-top: 1rpx solid $border-color;
z-index: 100;
.pay-btn {
background-color: #8B2316;
border-radius: 8rpx;
height: 88rpx;
@include flex-center;
cursor: pointer;
.btn-text {
color: $white;
font-size: 32rpx;
font-weight: normal;
}
}
}
</style>

View File

@ -0,0 +1,318 @@
<template>
<uni-nav-bar
left-icon="left"
title="积分商城"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#eeeeee"
>
<template #right>
<text class="search-btn" @click="goSearch">搜索</text>
</template>
</uni-nav-bar>
<view class="goods-page">
<!-- 商品图片区域 -->
<view class="goods-image-section">
<swiper class="goods-swiper" :indicator-dots="true" :autoplay="false" indicator-color="rgba(0,0,0,.3)" indicator-active-color="#ff0000">
<swiper-item v-for="(image, index) in goodsImages" :key="index">
<up-image :src="image" width="100%" height="500rpx" mode="aspectFill"></up-image>
</swiper-item>
</swiper>
</view>
<!-- 商品信息区域 -->
<view class="goods-info-section">
<view class="goods-title">
<text class="title-text">{{ goodsInfo.title }}</text>
</view>
<view class="goods-points">
<text class="points-value">{{ goodsInfo.points }}积分</text>
<text class="points-label">已兑换83件</text>
</view>
</view>
<!-- 商品详情区域 -->
<view class="goods-detail-section">
<!-- <view class="detail-title">
<text class="detail-title-text">温馨提示</text>
</view> -->
<view class="detail-content">
<up-image :src="tipImg" width="640rpx" height="515rpx" ></up-image>
</view>
</view>
<!-- 兑换须知 -->
<view class="exchange-notice">
<view class="notice-title">
<text class="notice-title-text">物品展示</text>
</view>
<view class="notice-content">
<text class="notice-text">{{ exchangeNotice }}</text>
</view>
</view>
</view>
<!-- 底部兑换按钮 -->
<view class="bottom-exchange">
<button class="exchange-btn" @click="exchangeGoods">在线兑换</button>
</view>
</template>
<script setup>
import { ref } from 'vue';
import tipImg from "@/static/tishi.png"
//
const goodsInfo = ref({
title: '第11-12-13届全国疑难及重症肝病学术会议论文集',
points: 4490,
description: '包含全国疑难及重症肝病学术会议的最新研究成果和临床经验总结',
details: [
{ label: '商品类型', value: '医学论文集' },
{ label: '适用人群', value: '肝病科医生、研究人员' },
{ label: '出版年份', value: '2023年' },
{ label: '页数', value: '约500页' }
]
});
//
const goodsImages = ref([
'/static/book1.png',
'/static/book2.png',
'/static/book3.png'
]);
//
const exchangeNotice = ref('1. 兑换成功后不支持退换货\n2. 积分一经扣除不予退还\n3. 商品将在7个工作日内发货\n4. 如有疑问请联系客服');
//
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({
url: '/pages_app/pointMall/pointMall'
});
}
});
};
const goSearch = () => {
uni.navigateTo({
url: '/pages_app/search/search'
});
};
const exchangeGoods = () => {
uni.showModal({
title: '确认兑换',
content: `确认使用${goodsInfo.value.points}积分兑换该商品?`,
success: (res) => {
if (res.confirm) {
uni.showToast({
title: '兑换成功',
icon: 'success'
});
}
}
});
};
</script>
<style lang="scss" scoped>
//
$bg-color: #f5f5f5;
$text-primary: #333333;
$text-secondary: #666666;
$theme-color: #8B2316;
$white: #ffffff;
$border-color: #e5e5e5;
.goods-page {
min-height: calc(100vh - 140rpx - 120rpx);
background-color: $bg-color;
padding-bottom: 120rpx;
}
//
.goods-image-section {
background-color: $white;
margin-bottom: 20rpx;
.goods-swiper {
height: 500rpx;
}
}
//
.goods-info-section {
background-color: $white;
padding: 30rpx;
margin-bottom: 20rpx;
.goods-title {
margin-bottom: 20rpx;
.title-text {
font-size: 32rpx;
color: #333;
line-height: 1.5;
}
}
.goods-points {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.points-label {
font-size: 28rpx;
color: #999;
margin-right: 20rpx;
}
.points-value {
font-size: 30rpx;
color: #ff0000;
}
}
.goods-desc {
.desc-text {
font-size: 28rpx;
color: $text-secondary;
line-height: 1.6;
}
}
}
//
.goods-detail-section {
background-color: $white;
padding: 30rpx;
margin-bottom: 20rpx;
.detail-title {
margin-bottom: 30rpx;
width:100%;
justify-content: center;
display: flex;
.detail-title-text {
text-align: center;
font-size: 32rpx;
color: $text-primary;
font-weight: bold;
}
}
.detail-content {
display: flex;
justify-content: center;
.detail-item {
display: flex;
justify-content: space-between;
padding: 20rpx 0;
border-bottom: 1rpx solid $border-color;
&:last-child {
border-bottom: none;
}
.detail-label {
font-size: 28rpx;
color: $text-secondary;
}
.detail-value {
font-size: 28rpx;
color: $text-primary;
}
}
}
}
//
.exchange-notice {
background-color: $white;
padding: 30rpx;
.notice-title {
display: flex;
justify-content: center;
margin-bottom: 20rpx;
.notice-title-text {
font-size: 36rpx;
color: $text-primary;
font-weight: bold;
}
}
.notice-content {
.notice-text {
font-size: 28rpx;
color: $text-secondary;
line-height: 1.6;
}
}
}
//
.bottom-exchange {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
background-color: $white;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
.exchange-info {
display: flex;
align-items: center;
.exchange-label {
font-size: 28rpx;
color: $text-secondary;
margin-right: 20rpx;
}
.exchange-points {
font-size: 36rpx;
color: $theme-color;
font-weight: bold;
}
}
.exchange-btn {
background-color: #00cac1;
color: $white;
height: 100%;
display: flex;
border-radius: 0;
justify-content: center;
align-items: center;
width:100%;
font-size: 32rpx;
}
}
//
.search-btn {
color: $theme-color;
font-size: 28rpx;
}
</style>

View File

@ -0,0 +1,385 @@
<template>
<uni-nav-bar
left-icon="left"
title="视频详情"
@clickLeft="goBack"
fixed
color="#8B2316"
height="140rpx"
:border="false"
backgroundColor="#eeeeee"
>
<template #right>
<view class="nav-actions">
<uni-icons type="share" size="22" color="#8B2316" />
<uni-icons type="heart" size="22" color="#8B2316" />
</view>
</template>
</uni-nav-bar>
<view class="video-detail-page">
<scroll-view class="content-scroll" scroll-y :show-scrollbar="false" @scrolltolower="onScrollToLower" lower-threshold="60">
<!-- 视频区域 -->
<view class="player-wrapper">
<video class="player" :src="videoSrc" :poster="poster" controls objectFit="contain"></video>
</view>
<!-- 标签切换 -->
<view class="tabs">
<view class="tab" :class="{ active: activeTab === 'info' }" @click="switchTab('info')">视频简介</view>
<view class="tab" :class="{ active: activeTab === 'comment' }" @click="switchTab('comment')">评论</view>
</view>
<!-- 内容区 -->
<view v-if="activeTab === 'info'" class="intro">
<view class="speaker">陈煜 教授</view>
<text class="intro-text">{{ introText }}</text>
</view>
<view v-else class="comments">
<view v-if="commentList.length === 0" class="empty">暂无评论</view>
<view v-else>
<view class="comment-item" v-for="(c, idx) in commentList" :key="idx">
<image class="avatar" :src="c.avatar" mode="aspectFill" />
<view class="meta">
<view class="name">{{ c.name }}</view>
<view class="content">{{ c.content }}</view>
<view class="time">{{ c.time }}</view>
</view>
<view class="reply-btn" @click="onReply(c)">回复</view>
</view>
<!-- 加载状态/没有更多 -->
<view v-if="loading" class="list-loading">加载中...</view>
<view v-if="noMore" class="list-no-more">没有更多了</view>
</view>
</view>
<!-- 留白避免被底部按钮遮挡 -->
<!-- <view class="bottom-spacer"></view> -->
</scroll-view>
</view>
<!-- 底部区域信息页为下载条评论页为上传图片+输入+发送 -->
<view v-if="activeTab === 'info'" class="bottom-download" @click="onDownload">
<text class="download-text">点击下载(限时<text class="discount">5</text>仅需50积分)</text>
</view>
<view v-else class="bottom-comment">
<input class="comment-input" v-model="commentText" placeholder="我也说一句" confirm-type="send" @confirm="sendComment" />
<view class="send-btn" @click="sendComment">发送</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
const videoSrc = ref('');
const poster = ref('/static/livebg.png');
const activeTab = ref('info');
const introText = ref(
'首都医科大学附属北京佑安医院肝病中心四科主任疑难肝病与人工肝中心主任主任医师教授博士生导师。中华医学会肝病学分会副秘书长、委员、终末期肝病学组副组长北京医学会肝病学分会常委肝衰竭及人工肝学组副组长北京肝胆相照公益基金会副理事长等。发表论文500余篇累计SCI论文150余篇出版专著20余部获得科研奖项10余项获得发明专利7项。'
);
//
const commentList = ref([
{
avatar: '/static/icon_home_my_public.png',
name: '肝胆相照测试号4',
content: 'hhjh',
time: '2025-07-01 17:17:13'
},
{
avatar: '/static/icon_home_my_public.png',
name: '肝胆相照测试号4',
content: 'kkkk',
time: '2025-07-01 17:17:18'
},
{
avatar: '/static/icon_home_my_public.png',
name: '肝胆相照测试号4',
content: 'nnj',
time: '2025-07-01 17:17:22'
}
]);
const switchTab = (tab) => {
activeTab.value = tab;
};
const onDownload = () => {
uni.showToast({ title: '前往下载页', icon: 'none' });
};
const goBack = () => {
uni.navigateBack();
};
const onReply = (c) => {
uni.showToast({ title: `回复:${c.name}`, icon: 'none' });
};
//
const commentText = ref('');
const sendComment = () => {
if (!commentText.value.trim()) {
uni.showToast({ title: '请输入内容', icon: 'none' });
return;
}
commentList.value.unshift({
avatar: '/static/icon_home_my_public.png',
name: '我',
content: commentText.value,
time: new Date().toISOString().slice(0, 19).replace('T', ' ')
});
commentText.value = '';
};
//
const page = ref(1);
const pageSize = ref(10);
const loading = ref(false);
const noMore = ref(false);
const mockMore = Array.from({ length: 30 }).map((_, i) => ({
avatar: '/static/icon_home_my_public.png',
name: '肝胆相照测试号4',
content: `更多评论 ${i + 1}`,
time: `2025-07-01 17:${20 + Math.floor(i / 2)}:${10 + (i % 2) * 5}`
}));
const onScrollToLower = async () => {
if (activeTab.value !== 'comment' || loading.value || noMore.value) return;
loading.value = true;
try {
await new Promise(r => setTimeout(r, 600));
const start = (page.value - 1) * pageSize.value;
const chunk = mockMore.slice(start, start + pageSize.value);
if (!chunk.length) {
noMore.value = true;
} else {
commentList.value.push(...chunk);
page.value += 1;
}
} finally {
loading.value = false;
}
};
</script>
<style lang="scss" scoped>
$nav-h: 140rpx;
$bottom-h: 100rpx;
$bg-color: #f7f7f7;
$text-primary: #333;
$text-secondary: #666;
$theme-color: #8B2316;
.nav-actions {
display: flex;
align-items: center;
gap: 20rpx;
}
.video-detail-page {
height: calc(100vh - #{$nav-h} - #{$bottom-h});
background: $bg-color;
overflow: hidden;
}
.content-scroll {
height: 100%;
}
.player-wrapper {
background: #fff;
}
.player {
width: 100%;
height: 420rpx;
background: #000;
border-bottom: 1rpx solid #eee;
}
.tabs {
background: #fff;
display: flex;
justify-content: center;
gap: 240rpx;
padding: 24rpx 0 0;
position: sticky;
border-bottom:2rpx solid #cccccc;
top: 0;
z-index: 5;
.tab {
position: relative;
padding: 16rpx 0 24rpx;
color: $text-secondary;
font-size: 28rpx;
&.active {
color: $theme-color;
}
&.active::after {
content: '';
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 64rpx;
height: 6rpx;
border-radius: 6rpx;
background: $theme-color;
}
}
}
.intro {
background: #fff;
padding: 24rpx 28rpx 40rpx;
.speaker {
font-size: 32rpx;
color: $text-primary;
margin: 12rpx 0 20rpx;
}
.intro-text {
font-size: 30rpx;
line-height: 1.8;
color: $text-primary;
}
}
.comments {
background: #fff;
min-height: 300rpx;
padding: 20rpx 20rpx 40rpx;
.empty {
text-align: center;
color: $text-secondary;
padding: 60rpx 0;
}
.comment-item {
display: flex;
align-items: flex-start;
padding: 24rpx 10rpx;
border-bottom: 2rpx solid #f0f0f0;
.avatar {
width: 100rpx;
height: 100rpx;
border-radius: 20rpx;
margin-right: 20rpx;
background: #eee;
}
.meta {
flex: 1;
min-width: 0;
.name {
font-size: 30rpx;
color: #1f1f1f;
margin-bottom: 6rpx;
}
.content {
font-size: 30rpx;
color: #666;
line-height: 1.6;
margin-bottom: 12rpx;
word-break: break-word;
}
.time {
font-size: 24rpx;
color: #909399;
}
}
.reply-btn {
margin-left: 16rpx;
border: 2rpx solid #8B2316;
color: #8B2316;
border-radius: 36rpx;
padding: 10rpx 24rpx;
font-size: 26rpx;
white-space: nowrap;
}
}
.list-loading,
.list-no-more {
text-align: center;
color: #9aa0a6;
padding: 20rpx 0;
font-size: 26rpx;
}
}
.bottom-spacer {
height: 40rpx;
}
.bottom-download {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: $bottom-h;
background: #00cac1;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
.discount{
color:#d4ff00;
font-size: 40rpx;
}
.download-text {
color: #fff;
font-size: 30rpx;
}
}
.bottom-comment {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 100rpx;
background: #ffffff;
display: flex;
align-items: center;
padding: 0 20rpx;
gap: 16rpx;
z-index: 10;
.comment-input {
flex: 1;
height: 72rpx;
border-radius: 10rpx;
background: #ffffff;
border: 2rpx solid #cacaca;
padding: 0 24rpx;
font-size: 28rpx;
color: #333;
}
.send-btn {
padding: 0 28rpx;
height: 72rpx;
border-radius: 36rpx;
background: #8B2316;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
}
}
</style>

BIN
static/tishi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
static/weixin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/yue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB