四端上传

This commit is contained in:
tianmo committed 2026-09-29 15:25:40 +08:00
1 parent 25bbb5f9c8
commit c6e2cb4d5b
276 files changed
+17812 -3

No files matched your search

@@ -0,0 +1,35 @@
// pages/IndexNewCourseDetails/IndexNewCourseDetails.js
const api = require('../../utils/api');
Page({
data: {
html: ' ',
courseCode: '',
courseTitle: '',
priceYuan: '',
},
onLoad(options) {
const id = options.id;
if (!id) return;
api
.getHomeCourses()
.then((list) => {
const item = (list || []).filter((c) => String(c.id) === String(id))[0];
if (!item) return;
this.setData({
html: item.content || ' ',
courseCode: item.courseCode || '',
courseTitle: item.courseTitle || '',
});
})
.catch((err) => console.error('[IndexNewCourseDetails] 加载失败', err));
},
/** 复用付费课页面完成购买:未拥有时那里会展示价格与购买按钮。 */
toBuy() {
if (!this.data.courseCode) return;
wx.navigateTo({ url: '/pages/VideoDetails/VideoDetails?code=' + this.data.courseCode });
},
});
@@ -0,0 +1,5 @@
{
"usingComponents": {
"Parser":"/Parser/index"
}
}
@@ -0,0 +1,13 @@
<!--pages/IndexNewCourseDetails/IndexNewCourseDetails.wxml-->
<Parser html="{{html}}">加载中...</Parser>
<view class="fixed-btn-wrapper">
<view class="btn-group">
<button wx:if="{{courseCode}}" class="DianJiXiangQing1" bind:tap="toBuy">
<text class="DianJiXiangQing2">立即购买</text>
</button>
<button class="DianJiXiangQing1" open-type="contact" bindcontact="handleContact">
<text class="DianJiXiangQing2">咨询客服</text>
</button>
</view>
</view>
@@ -0,0 +1,46 @@
/* pages/IndexNewCourseDetails/IndexNewCourseDetails.wxss */
@keyframes breathe {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(0.95);
}
}
.fixed-btn-wrapper {
position: fixed;
left: 0;
right: 0;
bottom: 60rpx;
padding: 0 20rpx; /* 调整为左右边距 */
display: flex;
justify-content: center; /* 水平居中 */
z-index: 999;
}
.btn-group {
display: flex;
width: 100%;
max-width: 700rpx;
justify-content: space-between;
}
.DianJiXiangQing1 {
flex: 1;
background-color: #4CAF50;
color: white;
border: none;
margin: 0 10rpx;
border-radius: 45rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
animation: breathe 1s linear infinite;
}
.DianJiXiangQing2 {
font-size: 30rpx;
}