commission--yt-commit

This commit is contained in:
2025-06-25 15:45:25 +08:00
parent 1a8bcbec9f
commit 53d0cc6767
20 changed files with 1012 additions and 0 deletions

View File

@ -0,0 +1,160 @@
// pages/course/applyPromotion/applyPromotion.js
Page({
data: {
showCode: false,
buttonText: '生成推广码',
codeImageUrl: 'https://img.picui.cn/free/2025/06/24/685a8953cae83.png'
},
// 点击“生成推广码”或“查看推荐的用户”
handleGenerate() {
if (!this.data.showCode) {
// 1. 显示带遮罩的 loading防止用户点击其他地方
wx.showLoading({
title: '生成中...',
mask: true
});
// 2. 调用后端接口生成推广码图片
wx.request({
url: 'https://your-backend.com/api/generatePromotionCode', // TODO: 替换成你真实的接口地址
method: 'POST',
data: {
// 如果需要传用户信息或参数,在这里补充
},
success: res => {
if (1) {
// 3. 接口返回正确,更新图片地址并显示
this.setData({
codeImageUrl: res.data.imageUrl,
showCode: true,
buttonText: '查看推荐的用户'
});
} else {
wx.showToast({
title: '生成失败,请重试',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({
title: '网络错误,请检查连接',
icon: 'none'
});
},
complete: () => {
// 4. 隐藏 loading
wx.hideLoading();
}
});
} else {
// 已生成时,跳转到查看推荐用户页(如有)
wx.navigateTo({
url: '/pages/course/recommendUser/recommendUser',
})
}
},
// 保存图片到相册(与之前一致)
saveImage() {
const {
codeImageUrl
} = this.data;
wx.showLoading({
title: '保存中...',
mask: true
});
wx.downloadFile({
url: codeImageUrl,
success: res => {
if (res.statusCode === 200) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
wx.hideLoading();
wx.showToast({
title: '保存成功',
icon: 'success'
});
},
fail: err => {
wx.hideLoading();
wx.showToast({
title: '保存失败',
icon: 'none'
});
console.error('saveImageToPhotosAlbum 失败', err);
}
});
}
},
fail: err => {
wx.hideLoading();
wx.showToast({
title: '下载失败',
icon: 'none'
});
console.error('downloadFile 失败', err);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,36 @@
<!-- pages/course/applyPromotion/applyPromotion.wxml -->
<view class="flex-col page">
<view class="flex-col items-center group">
<!-- 生成推广码按钮,文字垂直居中,点击触发 handleGenerate -->
<view class="flex-col justify-center items-center text-wrapper" bindtap="handleGenerate">
<text class="font text">{{buttonText}}</text>
</view>
<!-- 只有当 showCode 为 true 时才显示推广码图片 -->
<image
wx:if="{{showCode}}"
class="mt-12 image"
src="{{codeImageUrl}}"
/>
<!-- 只有当 showCode 为 true 时才显示保存图片按钮,且垂直居中 -->
<view
wx:if="{{showCode}}"
class="mt-12 flex-col justify-center items-center text-wrapper_2"
bindtap="saveImage"
>
<text class="font">保存图片</text>
</view>
</view>
<view class="flex-col section">
<view class="flex-row items-center group_2">
<image
class="image_2"
src="./image/wenhao.png"
/>
<text class="ml-6 font text_2">推广码说明</text>
</view>
<view class="section_2"></view>
</view>
</view>

View File

@ -0,0 +1,61 @@
/* pages/course/applyPromotion/applyPromotion.wxss */
.page {
background-color: #f6f7f9;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.group {
padding: 69.38rpx 0 52.5rpx;
}
/* 上下居中改由 justify-center 控制,无需修改原有 padding */
.text-wrapper {
padding: 30rpx 0 30rpx;
background-color: #a5d63f;
border-radius: 46.07rpx;
width: 395.63rpx;
}
.image {
width: 667.5rpx;
height: 763.13rpx;
}
.text-wrapper_2 {
padding: 30rpx 0 30rpx;
background-color: #ff8d1a;
border-radius: 46.07rpx;
width: 395.63rpx;
}
.section {
padding: 0 30rpx 60rpx;
background-color: #ffffff;
}
.group_2 {
padding: 35.63rpx 0 30rpx;
}
.image_2 {
width: 45rpx;
height: 45rpx;
}
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.99rpx;
color: #ffffff;
}
.text {
line-height: 28.29rpx;
}
.text_2 {
color: #000000;
font-size: 28.13rpx;
line-height: 26.19rpx;
}
.section_2 {
background-color: #ffffff00;
height: 813.75rpx;
border-left: solid 1.88rpx #000000;
border-right: solid 1.88rpx #000000;
border-top: solid 1.88rpx #000000;
border-bottom: solid 1.88rpx #000000;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,88 @@
// pages/course/courseOrderList/courseOrderList.js
Page({
/**
* 页面的初始数据
*/
data: {
items: [null, null, null],
countDown: 30 * 60 , // 初始倒计时
countDownStr: '' // 用于在视图中渲染的倒计时文本
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.startCountDown();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
clearInterval(this.intervalId);
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
clearInterval(this.intervalId);
},
/**
* 启动倒计时
*/
startCountDown() {
this.updateCountDownStr();
this.intervalId = setInterval(() => {
let cd = this.data.countDown;
if (cd <= 1) {
clearInterval(this.intervalId);
this.setData({
countDown: 0,
countDownStr: '00分00秒'
});
} else {
cd--;
this.setData({ countDown: cd });
this.updateCountDownStr();
}
}, 1000);
},
/**
* 更新倒计时显示字符串
*/
updateCountDownStr() {
const minutes = Math.floor(this.data.countDown / 60);
const seconds = this.data.countDown % 60;
const str = `${minutes}${seconds < 10 ? '0' + seconds : seconds}`;
this.setData({ countDownStr: str });
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,25 @@
<!-- pages/course/courseOrderList/courseOrderList.wxml -->
<view class="flex-col justify-start page">
<view class="flex-col group_1">
<view class="flex-col list-item mt-17" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="flex-row self-stretch group">
<text class="font text">订单号202506191307440406460485418</text>
<text class="font_2 ml-37">待支付</text>
</view>
<text class="self-stretch font_3 text_2">区块链和加密数字货币(随报随学认证班)(随报随学认证班)</text>
<text class="self-end font_4 text_3">¥999.00</text>
<text class="self-end font_5 text_4">请在 {{countDownStr}} 内完成支付</text>
<view class="flex-row justify-between items-center self-stretch group_2">
<text class="font_6 text_5">2025-06-17 13:00:33</text>
<view class="flex-row">
<view class="flex-col justify-start items-center text-wrapper">
<text class="font_7">取消订单</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_2 ml-11">
<text class="font_8">支付</text>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,125 @@
/* pages/course/courseOrderList/courseOrderList.wxss */
.mt-17 {
margin-top: 31.88rpx;
}
.ml-37 {
margin-left: 69.38rpx;
}
.ml-11 {
margin-left: 20.63rpx;
}
.page {
padding: 26.25rpx 0 350.63rpx;
background-color: #f8f8f8;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.group_1 {
margin-left: 20.63rpx;
margin-right: 18.77rpx;
}
.list-item {
padding-left: 22.5rpx;
padding-right: 3.51rpx;
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
background-color: #ffffff;
border-radius: 9.66rpx;
}
.list-item:first-child {
margin-top: 0;
}
.group {
padding: 32.51rpx 0 25.82rpx;
border-bottom: solid 1.88rpx #e3e3e3;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #696969;
}
.text {
line-height: 24.02rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #f84947;
}
.font_3 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 35.63rpx;
color: #000000;
}
.text_2 {
margin-top: 25.69rpx;
}
.font_4 {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #3d3d3d;
}
.text_3 {
margin-top: 58.09rpx;
line-height: 22.76rpx;
margin-right: 50rpx; /* 向左移动:增加右侧间距 */
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 26.32rpx;
color: #f84947;
}
.text_4 {
margin-right: 7.13rpx;
margin-top: 34.91rpx;
font-size: 28.13rpx;
}
.group_2 {
margin-right: 20.87rpx;
margin-top: 30.30rpx;
padding: 15.94rpx 0 17.81rpx;
border-top: solid 1.88rpx #e3e3e3;
}
.font_6 {
font-size: 22.5rpx;
font-family: SourceHanSansCN;
line-height: 26.25rpx;
color: #a1a1a1;
}
.text_5 {
width: 206.25rpx;
}
.text-wrapper {
padding: 10.8rpx 0 8.16rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
width: 142.5rpx;
height: 46.88rpx;
border: solid 1.88rpx #ff8d1a;
}
.font_7 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #ff8d1a;
}
.text-wrapper_2 {
padding: 11.89rpx 0 8.94rpx;
background-color: #ff8d1a;
border-radius: 9.38rpx;
width: 140.63rpx;
height: 45rpx;
}
.font_8 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.17rpx;
color: #ffffff;
}

View File

@ -0,0 +1,66 @@
// pages/course/courseSettlementRecord/courseSettlementRecord.js
Page({
/**
* 页面的初始数据
*/
data: {
items: [null,null,null]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,55 @@
<!-- pages/course/courseSettlementRecord/courseSettlementRecord.wxml -->
<view class="flex-col page">
<text class="self-center text">结算记录</text>
<view class="mt-14 flex-col self-stretch">
<view class="flex-row items-center section">
<image
class="image"
src="https://ide.code.fun/api/image?token=685b63c64ae84d0012336c74&name=1e77401cdad84f355f02111ca86729e8.png"
/>
<text class="text_2 ml-3">请输入下单用户</text>
</view>
<view class="flex-col list">
<view class="flex-col list-item mt-13" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- 课程标题区保持不变 -->
<view class="flex-row group">
<image
class="shrink-0 image_2"
src="https://ide.code.fun/api/image?token=685b63c64ae84d0012336c74&name=6ea8ffd561d2d1408e5cbb4f5ee10374.png"
/>
<text class="flex-1 self-start font text_3 ml-11">【早鸟42折】掌握CAD技能实战技能实战技能实战工作训练营</text>
</view>
<!-- 重新拆分为单行对齐 -->
<view class="flex-row justify-between group_row">
<text class="font_2">下单用户</text>
<text class="font text_5">{{item.user || 'user_cxz'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">课程价格</text>
<text class="font_3">{{item.price || '¥168'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">下单数量</text>
<text class="font_4">{{item.count || '×1'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">下单时间</text>
<text class="font text_11 nowrap">{{item.orderTime || '2025-06-14 18:30:00'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">抽成比例</text>
<text class="font_5 text_13">{{item.rate || '%10'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">抽成补贴</text>
<text class="font text_14">{{item.subsidy || '¥16.8'}}</text>
</view>
<view class="flex-row justify-between group_row">
<text class="font_2">结算时间</text>
<text class="font text_11 nowrap">{{item.settlementTime || '2025-06-20 18:30:00'}}</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,117 @@
/* pages/course/courseSettlementRecord/courseSettlementRecord.wxss */
/* 新增统一行样式 */
.group_row {
margin-top: 22.5rpx;
/* 左右对齐 */
padding: 0 3.75rpx;
}
/* 取消 time 文本的宽度限制并防止换行 */
.text_11 {
/* 去掉原先 width: 240rpx; */
width: auto !important;
}
/* 防止文本换行 */
.nowrap {
white-space: nowrap;
}
/* 以下为原样式,未作改动 */
.ml-3 {
margin-left: 5.63rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
.ml-11 {
margin-left: 20.63rpx;
}
.page {
padding: 30rpx 37.5rpx 785.63rpx;
background-image: linear-gradient(180deg, #ff8d1a 0%, #ff8d1a00 31.5%);
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.text {
color: #ffffff;
font-size: 33.75rpx;
font-family: SourceHanSansCN;
line-height: 31.29rpx;
}
.section {
padding: 15rpx 18.75rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.image {
width: 35.63rpx;
height: 35.63rpx;
}
.text_2 {
color: #b0b0b0;
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 27.94rpx;
}
.list {
padding-top: 22.5rpx;
}
.list-item {
padding: 22.5rpx 7.5rpx 22.5rpx 18.75rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.list-item:first-child {
margin-top: 0;
}
.group {
margin-left: 3.75rpx;
margin-right: 22.5rpx;
}
.image_2 {
border-radius: 9.38rpx;
width: 196.88rpx;
height: 125.63rpx;
}
.font {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 31.88rpx;
color: #000000;
}
.text_3 {
margin-top: 3.75rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.34rpx;
color: #000000;
}
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 21.49rpx;
color: #fc2f35;
}
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 19.24rpx;
color: #000000;
}
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 21.49rpx;
color: #0ed062;
}
.text_13 {
/* margin-right: 15rpx; */
font-size: 28.13rpx;
}
.text_14 {
font-size: 28.13rpx;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -0,0 +1,67 @@
// pages/course/recommendUser/recommendUser.js
Page({
/**
* 页面的初始数据
*/
data: {
items: [null, null, null],
items_1: [null, null, null],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,78 @@
<view class="flex-col page">
<view class="flex-col">
<text class="self-center text">我推荐的用户</text>
<!-- 直推用户 -->
<text class="self-start font text_2">直推用户</text>
<view class="flex-col self-stretch section view">
<!-- 表头 -->
<view class="flex-row justify-between group">
<text class="font_2 text_3">用户名</text>
<text class="font_2">给我创造的收益</text>
<text class="font_2 text_4">绑定时间</text>
<text class="font_2 text_5">联系</text>
</view>
<!-- 列表项 -->
<view class="flex-col mt-13">
<view
class="list-item mt-13"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-row justify-between">
<!-- 用户名:固定宽度、任意字符处断行 -->
<text class="font_3 name">{{item.userName || 'user_cxzsdfdfs'}}</text>
<view class="flex-row items-center">
<text class="font_4">¥{{item.revenue || '160.00'}}</text>
<view class="flex-row items-center shrink-0 ml-35">
<text class="font_4">{{item.bindTime || '2025-06-20'}}</text>
<image
class="shrink-0 image ml-27"
src="./image/right.png"
/>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 间推用户 -->
<view class="mt-36 flex-col">
<text class="self-start font text_6">间推用户</text>
<view class="mt-14 flex-col self-stretch section">
<view class="flex-row justify-between group">
<text class="font_2 text_3">用户名</text>
<text class="font_2">给我创造的收益</text>
<text class="font_2 text_4">绑定时间</text>
<text class="font_2 text_5">联系</text>
</view>
<view class="flex-col mt-13">
<view
class="list-item_2 mt-13"
wx:for="{{items_1}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-row justify-between">
<text class="font_3 name">{{item.userName || 'user_cxzsdfdfs'}}</text>
<view class="flex-row items-center">
<text class="font_4">¥{{item.revenue || '160.00'}}</text>
<view class="flex-row items-center shrink-0 ml-35">
<text class="font_4">{{item.bindTime || '2025-06-20'}}</text>
<image
class="shrink-0 image ml-27"
src="./image/right.png"
/>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,122 @@
/*=========== 公共间距 ===========*/
.ml-35 {
margin-left: 65.63rpx;
}
.ml-27 {
margin-left: 50.63rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
/*=========== 页面整体 ===========*/
.page {
padding: 37.76rpx 41.25rpx 980.63rpx;
background-image: linear-gradient(180deg, #ff8d1a 0%, #ff8d1a00 27%);
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
/*=========== 文本样式,均放大一号 ===========*/
/* 主标题 “我推荐的用户” */
.text {
color: #ffffff;
font-size: 36rpx; /* 原 33.75rpx → 36rpx */
line-height: 34rpx; /* 对应行高 */
font-family: SourceHanSansCN;
}
/* 次级标题 “直推用户”/“间推用户” */
.text_2 {
margin-top: 40.42rpx;
color: #ffffff;
font-size: 36rpx; /* 新增字号 */
line-height: 34rpx;
font-family: SourceHanSansCN;
}
/* 通用白字 */
.font {
font-size: 33rpx; /* 原 30rpx → 33rpx */
line-height: 30rpx;
color: #ffffff;
font-family: SourceHanSansCN;
}
/* 卡片容器 */
.section {
padding: 27.66rpx 27.09rpx 22.67rpx;
background-color: #ffffff;
border-radius: 9.38rpx;
}
.view {
margin-top: 25.58rpx;
}
.group {
padding-left: 14.06rpx;
}
/* 表头文字 */
.font_2 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 28rpx;
color: #323232;
font-family: SourceHanSansCN;
}
/* 表格内容:收益、时间 */
.font_4 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 23rpx;
color: #323232;
font-family: SourceHanSansCN;
}
/* 小图标 */
.image {
width: 30rpx;
height: 30rpx;
}
/* “间推用户”前缀 */
.text_6 {
margin-left: 2.74rpx;
color: #323232;
font-size: 30rpx; /* 新增字号 */
line-height: 28rpx;
font-family: SourceHanSansCN;
}
/* 用户名文字,放大一号 */
.font_3 {
font-size: 30rpx; /* 原 26.25rpx → 30rpx */
line-height: 36rpx; /* 支持两行 */
color: #323232;
font-family: SourceHanSansCN;
}
/*=========== 新增:用户名自动换行 ===========*/
/* 固定宽度在“sdfdfs”处自动断行 */
.name {
flex: none; /* 关闭 flex 自动拉伸 */
width: 127rpx; /* 根据字符长度微调200rpx 在 “user_cxz” 后换行 */
word-break: break-all; /* 任意字符处断行 */
white-space: normal; /* 允许多行 */
margin-right: 50rpx;
}
/* 列表条目顶部对齐,支持多行用户名 */
.list-item,
.list-item_2 {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
margin-right: 12.28rpx;
}
.list-item:first-child,
.list-item_2:first-child {
margin-top: 0;
}