完成了登录模块

This commit is contained in:
chen-xin-zhi 2025-05-18 09:30:05 +08:00
parent f7e90b2c0b
commit 7c934ded5f
7 changed files with 264 additions and 414 deletions

View File

@ -1,11 +1,11 @@
{
"pages": [
"pages/projectModule/projectDetail/projectDetail",
"pages/projectModule/projectList/projectList",
"pages/loginModule/pwdLogin/pwdLogin",
"pages/loginModule/register/register",
"pages/projectModule/applyCode/applyCode",
"pages/projectModule/userProject/userProject",
"pages/projectModule/projectDetail/projectDetail",
"pages/projectModule/projectList/projectList",
"pages/loginModule/forgetPwd/forgetPwd",
"pages/jiedan/jiedan",
"pages/logain/logain",
@ -40,23 +40,11 @@
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/jiedan/jiedan",
"pagePath": "pages/projectModule/projectList/projectList",
"text": "接单",
"iconPath": "/image/renwu.png",
"selectedIconPath": "/image/jiedanhou.png"
},
{
"pagePath": "pages/shop/shop",
"text": "商城",
"iconPath": "/image/renwu.png",
"selectedIconPath": "/image/jiedanhou.png"
},
{
"pagePath": "pages/find/find",
"text": "招聘",
"iconPath": "/image/renwu.png",
"selectedIconPath": "/image/jiedanhou.png"
},
{
"pagePath": "pages/mypage/mypage",
"text": "我的",

View File

@ -1,4 +1,3 @@
// pages/projectModule/projectDetail/projectDetail.js
Page({
/**
@ -8,6 +7,11 @@ Page({
items: [null, null, null],
items_1: [null, null, null],
items_2: [null, null, null],
activeTab: 0
},
switchTab(e) {
const idx = +e.currentTarget.dataset.index;
this.setData({ activeTab: idx });
},
/**

View File

@ -26,16 +26,21 @@
<view class="flex-col mt-35">
<view class="flex-col group_3">
<view class="flex-row justify-between group_4">
<text class="font text_6">项目详情</text>
<text class="font text_7">我的推广码</text>
<text class="font text_6 {{ activeTab===0 ? 'tab-active' : 'tab-inactive' }}"
bindtap="switchTab"
data-index="0">项目详情</text>
<text class="font text_7 {{ activeTab===1 ? 'tab-active' : 'tab-inactive' }}"
bindtap="switchTab"
data-index="1"
>我的推广码</text>
</view>
<view class="flex-row justify-between group_5">
<view class="section_2"></view>
<view class="section_2 view"></view>
<view class="section_2 {{ activeTab===0 ? 'line-active' : 'line-hidden' }}"></view>
<view class="section_2 view {{ activeTab===1 ? 'line-active' : 'line-hidden' }}"></view>
</view>
</view>
<view class="flex-col group_6">
<view class="flex-col section_3">
<view class="flex-col group_6 ">
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_3">
<view class="flex-row items-center">
<image
class="image_3"
@ -58,7 +63,7 @@
</view>
</view>
</view>
<view class="flex-col section_4">
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_4">
<view class="flex-row items-center">
<image
class="image_4"
@ -85,7 +90,7 @@
</view>
</view>
</view>
<view class="flex-col list">
<view wx:if="{{ activeTab === 0 }}" class="flex-col list">
<view class="flex-col relative section_7">
<text class="self-start font_5 text_15">结算说明</text>
<view class="self-stretch section_8 view_2"></view>
@ -111,7 +116,8 @@
/>
</view>
</view>
<view class="flex-col list_2">
<view wx:if="{{ activeTab === 1 }}"
class="flex-col list_2">
<view
class="flex-col relative list-item_2 mt-18"
wx:for="{{items_2}}"

View File

@ -27,8 +27,7 @@
background-color: #ffffff;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
height: 100vh;
}
.group {
padding-left: 33.75rpx;
@ -108,7 +107,7 @@
line-height: 28.01rpx;
}
.group_5 {
padding: 0 21.64rpx;
padding: 0 37.64rpx;
}
.section_2 {
background-color: #000000;
@ -266,7 +265,7 @@
top: 29.06rpx;
}
.list_2 {
margin-top: 92.81rpx;
margin-top: 0;
}
.list-item_2 {
background-color: #ffffff;
@ -409,4 +408,28 @@
bottom: 0;
left: 0;
right: 0;
}
}
/* 默认非激活状态(可以跟现有 text_6/text_7 配合,也可覆盖) */
.tab-inactive {
font-weight: normal;
font-size: 30rpx; /* 原始大小 */
color: #000000; /* 原始颜色 */
}
/* 激活状态:字体变大、加粗、橙色 */
.tab-active {
font-weight: bold;
font-size: 36rpx; /* 放大后的尺寸 */
color: #ff8d1a;
}
/* 非激活时隐藏下划线 */
.line-hidden {
background-color: transparent !important;
}
/* 激活时下划线显示为橙色 */
.line-active {
background-color: #ff8d1a !important;
}

View File

@ -1,66 +1,61 @@
// pages/projectModule/projectList/projectList.js
Page({
const { baseUrl } = require('../../../request');
Page({
/**
* 页面的初始数据
*/
data: {
items: [null, null, null],
// 四张轮播图(已统一为同一 URL
banners: [
'https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3546cd30f9261498a373e044e509b14e.png',
'https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3546cd30f9261498a373e044e509b14e.png',
'https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3546cd30f9261498a373e044e509b14e.png',
'https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3546cd30f9261498a373e044e509b14e.png'
],
// 后端返回的项目列表
items: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad() {
// 从本地缓存取出 token
const token = wx.getStorageSync('token');
// 请求项目列表
wx.request({
url: baseUrl + '/project/query/card', // 请替换为真实接口
method: 'POST',
header: {
Authorization: token // 带上授权头
},
success: res => {
if (res.data.code === 1) {
// 渲染项目数据
this.setData({ items: res.data.data });
} else {
wx.showToast({
title: res.data.message || '获取项目列表失败',
icon: 'none'
});
}
},
fail: () => {
wx.showToast({ title: '网络错误,请重试', icon: 'none' });
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
* 点击参与推广
*/
onReady() {
gotoPromotion(e) {
// 从 dataset 拿到 data-id
const projectId = e.currentTarget.dataset.id;
// 带上 id 跳转到详情页(路径按你的项目结构调整)
wx.navigateTo({
url: `/pages/projectModule/projectDetail/projectDetail?id=${projectId}`
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
});

View File

@ -1,115 +1,62 @@
<view class="flex-col page">
<view class="flex-row items-center">
<image
class="shrink-0 image"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=8eafcf3d54491c51c90f97a31451bc70.png"
/>
<view class="flex-col flex-1 group_1 ml-20">
<text class="self-start font text">美团省钱包</text>
<view class="flex-row items-center self-stretch mt-7">
<text class="flex-1 font_2 text_2">不限制推广方式、不限美团新老用户,要求美团闪购新用户或...</text>
<view class="flex-row items-center shrink-0 section ml-13">
<image
class="shrink-0 image_2"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=454188c52cef0841952f46f00fe340b4.png"
/>
<text class="text_3 ml-4">结算明细</text>
<!-- 轮播图 -->
<swiper
class="swiper"
indicator-dots="true"
autoplay="true"
interval="3000"
circular="true"
indicator-color="rgba(0,0,0,0.3)"
indicator-active-color="#ffffff"
>
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
<swiper-item>
<image src="{{img}}" class="swiper-image" mode="aspectFill"/>
</swiper-item>
</block>
</swiper>
<!-- 项目列表 -->
<view class="mt-20 flex-col list">
<view
class="flex-row justify-between items-center relative list-item mt-17"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="item.id"
>
<view class="flex-row items-center">
<!-- 项目图片 -->
<image
class="image_2"
src="{{item.projectImage}}"
mode="aspectFill"
/>
<view class="ml-14 flex-row items-end">
<view class="flex-col items-start">
<!-- 项目名称 -->
<text class="font">{{item.projectName}}</text>
<!-- 结算周期 -->
<view class="mt-10 flex-col justify-start items-center text-wrapper">
<text class="font_2 text">结算T+{{item.projectSettlementCycle}}</text>
</view>
<!-- 最高价 -->
<text class="mt-10 font_4">最高价</text>
<text class="mt-10 font_5 text_3">¥{{item.projectPrice}}</text>
</view>
<view class="ml-4 flex-col items-start">
<!-- 正在推广 -->
<text class="font_4">正在推广</text>
<text class="mt-8 font_6 text_4">{{item.currentPromotionCount}}人</text>
</view>
</view>
</view>
<view class="self-start group mt-7">
<text class="font_2 text_4">最高价</text>
<text class="font_3 text_5">¥7</text>
<view
bindtap="gotoPromotion"
data-id="{{item.id}}"
class="flex-col justify-start items-center text-wrapper_2">
<text class="font_3 text_2">参与推广</text>
</view>
</view>
</view>
<view class="flex-col mt-35">
<view class="flex-col group_2">
<view class="flex-row justify-between group_3">
<text class="font text_6">项目详情</text>
<text class="font text_7">我的推广码</text>
</view>
<view class="flex-row justify-between group_4">
<view class="section_2"></view>
<view class="section_2 view"></view>
</view>
</view>
<view class="flex-col group_5">
<view class="flex-col section_3">
<view class="flex-row items-center">
<image
class="image_3"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=d8fd6b2397877af8679585f35c6c1f31.png"
/>
<text class="font text_8 ml-10">项目通知</text>
</view>
<view class="flex-col mt-13">
<view
class="flex-row justify-center items-center relative list-item_1 mt-18"
wx:for="{{items}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<view class="flex-col justify-start items-center text-wrapper pos">
<text class="font_4 text_9">最新</text>
</view>
<text class="font_5 text_10">美团省钱包-春季活动价格上调通知~</text>
</view>
</view>
</view>
<view class="flex-col section_4 mt-24">
<view class="flex-row items-center">
<image
class="image_4"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=0727e8a4ea37a7456da17de39c1b3f2a.png"
/>
<text class="font ml-10">项目政策</text>
</view>
<view class="flex-col mt-15">
<view class="flex-row justify-between section_5">
<text class="font">结算标准</text>
<text class="font text_11">结算价</text>
</view>
<view class="flex-col group_7">
<view
class="flex-row justify-between items-center section_6"
wx:for="{{items_1}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
>
<text class="font_6 text_12">3.6元购买30元券包</text>
<text class="font_3 text_13">0.30</text>
</view>
</view>
</view>
</view>
<view class="flex-col mt-24">
<view class="flex-col relative section_7">
<text class="self-start font text_15">结算说明</text>
<view class="self-stretch section_8 view_2"></view>
<image
class="image_5 pos_4"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
/>
</view>
<view class="flex-col relative section_9 mt-21">
<text class="self-start font text_1">项目说明</text>
<view class="self-stretch section_8"></view>
<image
class="image_5 pos_5"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
/>
</view>
<view class="flex-col relative section_9 mt-21">
<text class="self-start font text_1">项目说明</text>
<view class="self-stretch section_8"></view>
<image
class="image_5 pos_6"
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
/>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -1,252 +1,139 @@
.ml-13 {
margin-left: 24.38rpx;
}
.mt-7 {
margin-top: 13.13rpx;
}
.mt-35 {
margin-top: 65.63rpx;
}
.mt-13 {
margin-top: 24.38rpx;
}
.mt-15 {
margin-top: 28.13rpx;
}
.mt-21 {
margin-top: 39.38rpx;
}
/* pages/projectModule/projectList/projectList.wxss */
/* 页面整体 */
.page {
padding: 74.92rpx 32.81rpx 201.56rpx 33.75rpx;
padding-bottom: 70rpx;
background-color: #ffffff;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100vh;
}
/* 轮播图容器 */
.swiper {
width: 100vw;
height: 48vw;
}
/* 轮播图图片 */
.swiper-image {
width: 100%;
height: 100%;
}
.image {
width: 123.75rpx;
height: 123.75rpx;
/* 列表容器 */
.list {
padding: 0 26.25rpx;
}
.group_1 {
margin-right: 2.81rpx;
}
.font {
font-size: 28.13rpx;
font-family: SourceHanSansCN;
line-height: 26.04rpx;
color: #000000;
}
.text {
font-size: 30rpx;
line-height: 27.75rpx;
}
.font_2 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
color: #666666;
}
.text_2 {
font-size: 24.38rpx;
line-height: 30rpx;
}
.section {
padding: 13.13rpx 7.71rpx 11.25rpx 9.38rpx;
background-color: #a5d63f;
border-radius: 9.38rpx;
height: 54.38rpx;
}
.image_2 {
width: 30rpx;
height: 30rpx;
}
.text_3 {
color: #ffffff;
font-size: 24.38rpx;
font-family: SourceHanSansCN;
line-height: 22.72rpx;
}
.group {
line-height: 22.69rpx;
}
.text_4 {
font-size: 24.38rpx;
line-height: 22.69rpx;
}
.font_3 {
font-size: 26.25rpx;
font-family: Times New Roman;
line-height: 18.09rpx;
color: #d43030;
}
.text_5 {
color: #ff2b2b;
line-height: 19.29rpx;
}
.group_2 {
padding-left: 100.24rpx;
padding-right: 82.2rpx;
}
.group_3 {
padding-bottom: 26.42rpx;
}
.text_6 {
font-size: 30rpx;
line-height: 27.66rpx;
}
.text_7 {
font-size: 30rpx;
line-height: 28.01rpx;
}
.group_4 {
padding: 0 21.64rpx;
}
.section_2 {
background-color: #000000;
width: 73.35rpx;
height: 5.63rpx;
}
.view {
margin-right: 16.88rpx;
}
.group_5 {
padding-top: 38.44rpx;
}
.section_3 {
padding: 32.68rpx 25.2rpx 31.07rpx 28.93rpx;
background-image: linear-gradient(180deg, #ff8d1a -75.6%, #ff8d1a00 42.2%);
/* 列表项 */
.list-item {
padding: 30rpx 18.75rpx;
background-color: #ffffff;
border-radius: 18.75rpx;
border: solid 1.88rpx #ffbd7a;
box-shadow: 0rpx 0rpx 11.25rpx #00000040;
}
.image_3 {
width: 45rpx;
height: 43.13rpx;
}
.text_8 {
line-height: 25.88rpx;
}
.list-item_1 {
padding: 7.07rpx 0 5.94rpx;
}
.list-item_1:first-child {
.list-item:first-child {
margin-top: 0;
}
.text-wrapper {
padding: 9.56rpx 0 7.14rpx;
background-color: #ff5733;
border-radius: 37.5rpx;
width: 75rpx;
/* 项目缩略图 */
.image_2 {
border-radius: 18.75rpx;
width: 127.5rpx;
height: 127.5rpx;
}
.pos {
position: absolute;
left: 1.88rpx;
top: 50%;
transform: translateY(-50%);
}
.font_4 {
font-size: 22.5rpx;
/* 项目名称 */
.font {
font-size: 30rpx;
font-family: SourceHanSansCN;
line-height: 22.59rpx;
color: #ffffff;
line-height: 27.75rpx;
color: #000000;
}
.text_9 {
line-height: 20.79rpx;
/* 结算周期背景 */
.text-wrapper {
padding: 7.5rpx 0;
background-color: #ffebeb;
border-radius: 9.38rpx;
width: 112.5rpx;
}
/* 结算周期文字 */
.font_2 {
font-size: 22.5rpx;
font-family: AlibabaPuHuiTi;
line-height: 19.93rpx;
color: #ff3f3f;
}
/* 行高调整 */
.text {
line-height: 20.94rpx;
}
/* 最高价标签 */
.font_4 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.43rpx;
color: #00000080;
}
/* 最高价金额 */
.font_5 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 26.04rpx;
color: #000000;
line-height: 19.93rpx;
color: #e33c64;
}
.text_10 {
line-height: 24.49rpx;
}
.section_4 {
padding: 42.06rpx 27.07rpx 30.13rpx 30.81rpx;
background-image: linear-gradient(180deg, #ff8d1a -75.6%, #ff8d1a00 23.5%);
border-radius: 24.77rpx;
border: solid 1.88rpx #ffbd7a;
}
.image_4 {
width: 43.13rpx;
height: 43.13rpx;
}
.section_5 {
margin-right: 6.81rpx;
padding: 22.11rpx 80.4rpx 17.29rpx;
background-color: #ebebeb;
border-radius: 9.38rpx 9.38rpx 0rpx 0rpx;
border: solid 1.88rpx #e6e6e6;
}
.text_11 {
margin-right: 8.89rpx;
line-height: 26.25rpx;
}
.group_7 {
margin-right: 6.81rpx;
}
.section_6 {
padding: 21.24rpx 37.18rpx 21.79rpx;
background-color: #ffffff;
border: solid 1.88rpx #d1d1d1;
/* 价格前缀间距 */
.text_3 {
margin-left: 3.75rpx;
}
/* 推广人数标签 */
.font_6 {
font-size: 26.25rpx;
font-family: Times New Roman;
line-height: 22.59rpx;
color: #636363;
font-family: SourceHanSansCN;
line-height: 24.43rpx;
color: #e33c64;
}
.text_12 {
/* 推广人数行高 */
.text_4 {
line-height: 23.96rpx;
}
/* 参与推广按钮背景 */
.text-wrapper_2 {
padding: 18.75rpx 0;
background-color: #a5d63f;
border-radius: 9.38rpx;
width: 129.38rpx;
height: 58.13rpx;
}
/* 参与推广文字 */
.font_3 {
font-size: 26.25rpx;
font-family: SourceHanSansCN;
line-height: 24.43rpx;
color: #ffffff;
}
/* 参与推广文字行高 */
.text_2 {
font-size: 24.38rpx;
line-height: 22.8rpx;
}
.text_13 {
margin-right: 71.21rpx;
/* 间距 */
.mt-17 {
margin-top: 31.88rpx;
}
.section_7 {
padding: 40.86rpx 41.12rpx 46.99rpx;
background-image: linear-gradient(180deg, #ff800099 -75.6%, #ff8d1a00 72.6%);
border-radius: 41.18rpx;
border: solid 1.88rpx #ffbd7a;
.mt-20 {
margin-top: 20rpx;
}
.text_15 {
margin-left: 50.55rpx;
line-height: 26.21rpx;
}
.section_8 {
margin-right: 2.14rpx;
margin-top: 35.92rpx;
background-color: #ffffff00;
height: 538.13rpx;
border: solid 1.88rpx #000000;
}
.view_2 {
margin-top: 35.94rpx;
}
.image_5 {
width: 52.5rpx;
height: 52.5rpx;
}
.pos_4 {
position: absolute;
left: 34.69rpx;
top: 29.06rpx;
}
.section_9 {
padding: 41.04rpx 41.12rpx 46.99rpx;
background-image: linear-gradient(180deg, #ff800099 -75.6%, #ff8d1a00 72.6%);
border-radius: 41.18rpx;
border: solid 1.88rpx #ffbd7a;
}
.text_1 {
margin-left: 50.49rpx;
}
.pos_5 {
position: absolute;
left: 34.69rpx;
top: 29.06rpx;
}
.pos_6 {
position: absolute;
left: 34.69rpx;
top: 29.06rpx;
}