完成校友权益前端界面

dev
lynn 4 months ago
parent 3ac7562a20
commit a67f5ffb68

@ -0,0 +1,158 @@
<template>
<view class="chat-window">
<scroll-view :scroll-y="true" class="message-list" :scroll-into-view="lastMessageId">
<view v-for="message in messages" :key="message.id" :id="'msg-' + message.id"
:class="['message-item', message.from === 'me' ? 'my-message' : 'their-message']">
<u-avatar v-if="message.from !== 'me'" :src="theirAvatar" size="80"></u-avatar>
<view class="message-content">
<text>{{ message.content }}</text>
</view>
<u-avatar v-if="message.from === 'me'" :src="myAvatar" size="80"></u-avatar>
</view>
</scroll-view>
<view class="input-area">
<u-input v-model="newMessage" placeholder="输入消息..." class="input-field" :border="false" />
<u-button type="primary" size="medium" @click="sendMessage" class="send-button">发送</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
myAvatar: 'https://via.placeholder.com/80',
theirAvatar: 'https://via.placeholder.com/80',
newMessage: '',
messages: [],
lastMessageId: '',
}
},
onLoad(options) {
const userId = options.userId;
//
uni.setNavigationBarTitle({
title: `${userId} 的对话`
});
this.fetchMessages(userId);
},
methods: {
fetchMessages(userId) {
//
this.messages = [{
id: 1,
from: 'them',
content: '你好!很高兴认识你。'
},
{
id: 2,
from: 'me',
content: '你好!我也是。'
},
{
id: 3,
from: 'them',
content: '我们下周一开会讨论一下那个项目吧,你觉得怎么样?'
},
{
id: 4,
from: 'me',
content: '好啊,没问题。'
},
];
this.scrollToBottom();
},
sendMessage() {
if (this.newMessage.trim() === '') return;
const newMsg = {
id: this.messages.length + 1,
from: 'me',
content: this.newMessage.trim()
};
this.messages.push(newMsg);
this.newMessage = '';
this.scrollToBottom();
},
scrollToBottom() {
this.$nextTick(() => {
if (this.messages.length > 0) {
this.lastMessageId = `msg-${this.messages[this.messages.length - 1].id}`;
}
})
}
}
}
</script>
<style lang="scss" scoped>
.chat-window {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f5f5f5;
}
.message-list {
flex: 1;
padding: 20rpx;
overflow-y: auto;
box-sizing: border-box;
}
.message-item {
display: flex;
margin-bottom: 30rpx;
align-items: flex-start;
}
.my-message {
justify-content: flex-end;
.message-content {
background-color: #409eff;
color: #fff;
border-radius: 20rpx 20rpx 4rpx 20rpx;
margin-right: 20rpx;
}
}
.their-message {
justify-content: flex-start;
.message-content {
background-color: #fff;
color: #333;
border-radius: 20rpx 20rpx 20rpx 4rpx;
margin-left: 20rpx;
}
}
.message-content {
padding: 20rpx 25rpx;
max-width: 70%;
font-size: 30rpx;
line-height: 1.6;
}
.input-area {
display: flex;
align-items: center;
padding: 20rpx;
background-color: #fff;
border-top: 1rpx solid #e0e0e0;
}
.input-field {
flex: 1;
margin-right: 20rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
padding: 0 20rpx;
}
.send-button {
height: 70rpx;
line-height: 70rpx;
}
</style>

@ -0,0 +1,123 @@
<template>
<view class="chat-list-container">
<view v-for="chat in chatList" :key="chat.id" class="chat-item" @click="goToChat(chat.user.id)">
<u-avatar :src="chat.user.avatar" size="90"></u-avatar>
<view class="chat-content">
<view class="content-header">
<text class="user-name">{{ chat.user.name }}</text>
<text class="last-time">{{ chat.lastMessage.time }}</text>
</view>
<view class="content-body">
<text class="last-message">{{ chat.lastMessage.content }}</text>
<u-badge :is-dot="true" type="error" v-if="chat.unreadCount > 0"></u-badge>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
chatList: [{
id: 1,
user: {
id: 'user001',
name: '张云',
avatar: 'https://via.placeholder.com/90'
},
lastMessage: {
content: '好的,我们下周一开会讨论一下这个项目。',
time: '昨天'
},
unreadCount: 1
},
{
id: 2,
user: {
id: 'user002',
name: '李经理',
avatar: 'https://via.placeholder.com/90'
},
lastMessage: {
content: '资料已经发你邮箱了,请查收。',
time: '14:28'
},
unreadCount: 0
},
{
id: 3,
user: {
id: 'user003',
name: '王顾问',
avatar: 'https://via.placeholder.com/90'
},
lastMessage: {
content: '[图片]',
time: '周一'
},
unreadCount: 3
}
]
}
},
methods: {
goToChat(userId) {
uni.navigateTo({
url: `/packages/chat/chatWindow?userId=${userId}`
})
}
}
}
</script>
<style lang="scss" scoped>
.chat-list-container {
background-color: #fff;
}
.chat-item {
display: flex;
align-items: center;
padding: 25rpx 30rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.chat-content {
flex: 1;
margin-left: 20rpx;
overflow: hidden;
}
.content-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
}
.user-name {
font-size: 32rpx;
font-weight: 500;
}
.last-time {
font-size: 24rpx;
color: #999;
}
.content-body {
display: flex;
justify-content: space-between;
align-items: center;
}
.last-message {
font-size: 28rpx;
color: #999;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

@ -0,0 +1,210 @@
<template>
<view class="library-container">
<view class="search-bar">
<u-search placeholder="书名/作者/关键词/完整ISBN..." v-model="keyword" :show-action="false" bg-color="#f5f5f5"
border-color="#e0e0e0"></u-search>
</view>
<view class="tabs-container">
<u-tabs :list="tabsList" :is-scroll="true" :current="currentTab" @change="tabChange" active-color="#73685c"></u-tabs>
</view>
<view class="book-list">
<view v-for="book in bookList" :key="book.id" class="book-card">
<view class="book-item">
<view class="book-cover">
<u-image :src="book.image" width="180rpx" height="240rpx" border-radius="8"></u-image>
</view>
<view class="book-info">
<text class="book-title">{{ book.title }}</text>
<text class="book-author">{{ book.author }}</text>
<text class="book-publisher">{{ book.publisher }} · {{ book.year }}</text>
<view class="tags-container">
<u-tag v-for="(tag, index) in book.tags" :key="index" :text="tag.text" :type="tag.type"
size="mini" shape="circle" mode="light" />
</view>
</view>
</view>
<view class="card-footer">
<view class="detail-button" @click="viewDetails(book.id)"></view>
</view>
</view>
</view>
</view>
</template>
<script>
import uSearch from '@/uview-ui/components/u-search/u-search.vue';
import uTabs from '@/uview-ui/components/u-tabs/u-tabs.vue';
import uImage from '@/uview-ui/components/u-image/u-image.vue';
import uTag from '@/uview-ui/components/u-tag/u-tag.vue';
export default {
components: {
uSearch,
uTabs,
uImage,
uTag
},
data() {
return {
keyword: '',
currentTab: 0,
tabsList: [{
name: '全部'
}, {
name: '生物医药'
}, {
name: '半导体/集成电路'
}, {
name: '新能源'
}, {
name: '新材料'
}, {
name: '技术'
}],
bookList: [{
id: 1,
title: '股权激励',
author: '邱清荣著',
publisher: '中国友谊出版公司',
year: '2019',
image: 'https://via.placeholder.com/180x240.png/ffffff/000000?text=股权激励',
tags: [{
text: '技术类',
type: 'primary'
}, {
text: '图书馆 3F-A区-125',
type: 'info'
}]
},
{
id: 2,
title: '制造亚洲:一部地图上的历史',
author: '李四著',
publisher: '中国友谊出版公司',
year: '2019',
image: 'https://via.placeholder.com/180x240.png/ffffff/000000?text=制造亚洲',
tags: [{
text: '商业类',
type: 'primary'
}, {
text: '图书馆 3F-A区-125',
type: 'info'
}]
},
{
id: 3,
title: '股权金字塔',
author: '李四著',
publisher: '中国友谊出版公司',
year: '2019',
image: 'https://via.placeholder.com/180x240.png/ffffff/000000?text=股权金字塔',
tags: [{
text: '商业类',
type: 'primary'
}, {
text: '图书馆 3F-A区-125',
type: 'info'
}]
}
]
}
},
methods: {
viewDetails(id) {
console.log('View details for book ID:', id);
// uni.navigateTo({ url: `/packages/library/detail?id=${id}` });
},
tabChange(index) {
this.currentTab = index;
console.log('Tab changed to:', index);
}
}
}
</script>
<style lang="scss" scoped>
.library-container {
background-color: #f5f5f5;
min-height: 100vh;
}
.search-bar {
padding: 20rpx 30rpx;
background-color: #fff;
}
.tabs-container {
border-top: 1rpx solid #eee;
}
.book-list {
padding: 20rpx;
}
.book-card {
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.book-item {
display: flex;
margin-bottom: 20rpx;
}
.book-cover {
margin-right: 30rpx;
flex-shrink: 0;
}
.book-info {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
}
.book-title {
font-size: 34rpx;
font-weight: bold;
color: #333;
margin-bottom: 10rpx;
}
.book-author,
.book-publisher {
font-size: 26rpx;
color: #666;
margin-bottom: 10rpx;
}
.tags-container {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
margin-top: 10rpx;
}
.card-footer {
display: flex;
justify-content: center;
margin-top: 20rpx;
padding-top: 20rpx;
border-top: 1rpx solid #eee;
}
.detail-button {
height: 60rpx;
line-height: 60rpx;
display: inline-block;
padding: 0 160rpx;
border-radius: 40rpx;
color: #fff;
font-size: 30rpx;
background-image: linear-gradient(to right, #6a7dfe, #12099a);
text-align: center;
}
</style>

@ -0,0 +1,189 @@
<template>
<view class="container" v-if="detail.user">
<view class="user-info-header">
<u-avatar :text="detail.user.name.charAt(0)" size="80"></u-avatar>
<view class="user-details">
<text class="user-name">{{ detail.user.name }}</text>
<text class="post-time">{{ detail.time }}</text>
</view>
<view class="stats">
<text class="type-badge">{{ detail.type === 'supply' ? '供应' : '需求' }}</text>
<text class="views">{{ detail.messageCount }}人私信 {{ detail.viewCount }}浏览</text>
</view>
</view>
<view class="content-card">
<text class="title">{{ detail.title }}</text>
<text class="description">{{ detail.description }}</text>
<!-- <image class="content-image" :src="detail.image" mode="widthFix"></image> -->
<view class="tags">
<text v-for="tag in detail.tags" :key="tag" class="tag">{{ tag }}</text>
</view>
</view>
<view class="footer">
<view class="footer-action">
<u-icon name="star" size="40"></u-icon>
<text>收藏</text>
</view>
<u-button type="primary" shape="circle" class="message-btn">私信</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {}
}
},
onLoad(options) {
// , options.id
console.log("页面ID:", options.id)
this.fetchDetailData(options.id);
},
methods: {
fetchDetailData(id) {
//
this.detail = {
id: id,
user: {
id: 'user123',
name: '张云',
avatar: '' // avatar an be used here if available
},
time: '2小时前',
type: 'supply',
messageCount: 16,
viewCount: 265,
title: '提供企业管理咨询服务',
description: '专业企业管理咨询团队, 具有10年以上行业经验, 擅长企业战略规划、组织架构优化、流程梳理等。已服务过多家上市公司专业企业管理咨询团队, 具有10年以上行业经验, 擅长企业战略规划、组织架构优化、流程梳理等。',
image: 'https://via.placeholder.com/700x300.png/E8E8E8/A9A9A9?text=专业诚信敬业高能', // Placeholder image
tags: ['管理咨询', '战略规划', '管理咨询']
};
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: linear-gradient(to bottom, #e9f2fa, #f5f7fa);
min-height: 100vh;
}
.user-info-header {
display: flex;
align-items: center;
padding: 30rpx;
background: transparent;
}
.user-details {
display: flex;
flex-direction: column;
margin-left: 20rpx;
flex-grow: 1;
}
.user-name {
font-size: 32rpx;
font-weight: bold;
}
.post-time {
font-size: 24rpx;
color: #909399;
margin-top: 5rpx;
}
.stats {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.type-badge {
font-size: 24rpx;
background-color: #fdf3e8;
color: #C9A36D;
padding: 8rpx 15rpx;
border-radius: 10rpx;
}
.views {
font-size: 24rpx;
color: #909399;
margin-top: 10rpx;
}
.content-card {
background-color: #fff;
margin: 30rpx 30rpx 0;
padding: 30rpx;
border-radius: 20rpx;
}
.title {
font-size: 36rpx;
font-weight: bold;
display: block;
margin-bottom: 20rpx;
}
.description {
font-size: 28rpx;
color: #606266;
line-height: 1.8;
display: block;
margin-bottom: 30rpx;
}
.content-image {
width: 100%;
border-radius: 12rpx;
margin-bottom: 30rpx;
}
.tags {
display: flex;
flex-wrap: wrap;
}
.tag {
background-color: #f5f5f5;
color: #606266;
font-size: 24rpx;
padding: 10rpx 20rpx;
border-radius: 30rpx;
margin-right: 15rpx;
margin-bottom: 10rpx;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 70rpx;
background-color: #fff;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
box-sizing: border-box;
}
.footer-action {
display: flex;
flex-direction: column;
align-items: center;
color: #606266;
font-size: 24rpx;
}
.message-btn {
width: 250rpx;
}
</style>

@ -0,0 +1,261 @@
<template>
<view class="container">
<view class="search-bar">
<u-search placeholder="请输入关键词" v-model="keyword" :show-action="false"></u-search>
</view>
<u-tabs :list="tabs" :is-scroll="false" :current="currentTab" @change="changeTab"></u-tabs>
<view class="list-container">
<view v-for="item in filteredList" :key="item.id" class="list-item">
<view class="item-header">
<view :class="['type-badge', item.type === 'supply' ? 'supply' : 'demand']">{{ item.type === 'supply' ? '供应' : '需求' }}</view>
<text class="time">{{ item.time }}</text>
</view>
<text class="title">{{ item.title }}</text>
<text class="description">{{ item.description }}</text>
<view class="tags">
<text v-for="tag in item.tags" :key="tag" class="tag">{{ tag }}</text>
</view>
<u-line color="#e8e8e8" margin="20rpx 0" />
<view class="item-footer">
<view class="user-info">
<u-avatar :src="item.user.avatar" size="60"></u-avatar>
<text class="user-name">{{ item.user.name }}</text>
</view>
<view class="actions">
<view class="view-button view-button-check" @click="goToDetail(item.id)">
<text class="button-text">查看</text>
</view>
<view class="view-button view-button-msg" @click="goToChat(item.user)">
<text class="button-text">私信</text>
</view>
</view>
</view>
</view>
<u-loadmore :status="status" nomore-text="~" />
</view>
<image class="publish-image" :src="base.imgHost('publish.png')" @click="goToPublish"></image>
</view>
</template>
<script>
import uSearch from '@/uview-ui/components/u-search/u-search.vue';
import uLoadmore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
export default {
components: {
uSearch,
uLoadmore
},
data() {
return {
keyword: '',
currentTab: 0,
tabs: [{
name: '全部'
}, {
name: '供应'
}, {
name: '需求'
}],
list: [{
id: 1,
type: 'supply',
time: '2小时前',
title: '提供企业管理咨询服务',
description: '专业企业管理咨询团队具有10年以上行业经验擅长企业战略规划、组织架构优化、流程梳理等。已服务过多家上市公司...',
tags: ['管理咨询', '战略规划', '管理咨询'],
user: {
name: '张云',
avatar: 'https://via.placeholder.com/60'
}
},
{
id: 2,
type: 'demand',
time: '2小时前',
title: '提供企业管理咨询服务',
description: '我们是一家初创公司目前在开发一款AI智能客服产品需要寻找有经验的技术合作伙伴共同推进项目发展...',
tags: ['AI', '技术合作', '客服系统'],
user: {
name: '李经理',
avatar: 'https://via.placeholder.com/60'
}
}
],
status: 'nomore'
}
},
computed: {
filteredList() {
let list = this.list;
if (this.currentTab === 1) {
list = list.filter(item => item.type === 'supply');
} else if (this.currentTab === 2) {
list = list.filter(item => item.type === 'demand');
}
if (this.keyword) {
list = list.filter(item => item.title.includes(this.keyword) || item.description.includes(this.keyword));
}
return list;
}
},
methods: {
changeTab(index) {
this.currentTab = index;
},
goToPublish() {
uni.navigateTo({
url: '/packages/supply/publish'
})
},
goToDetail(id) {
uni.navigateTo({
url: `/packages/supply/detail?id=${id}`
})
},
goToChat(user) {
// id
uni.navigateTo({
url: `/packages/chat/chatWindow?userId=${user.id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #f5f5f5;
min-height: 100vh;
}
.search-bar {
padding: 20rpx;
background-color: #fff;
}
.list-container {
background: linear-gradient(to bottom, #e9f2fa, #e9f2fa);
padding: 20rpx;
min-height: calc(100vh - 180rpx);
/* Adjust as needed */
}
.list-item {
background-color: #fff;
border-radius: 20rpx;
padding: 25rpx;
margin-bottom: 20rpx;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15rpx;
}
.type-badge {
font-size: 24rpx;
padding: 8rpx 15rpx;
border-radius: 10rpx;
}
.supply {
background-color: #fff0e6;
color: #f29100;
}
.demand {
background-color: #e6f0ff;
color: #007aff;
}
.time {
font-size: 24rpx;
color: #999;
}
.title {
font-size: 32rpx;
font-weight: bold;
display: block;
margin-bottom: 10rpx;
}
.description {
font-size: 28rpx;
color: #666;
line-height: 1.6;
margin-bottom: 30rpx;
display: block;
}
.tags {
display: flex;
flex-wrap: wrap;
}
.tag {
background-color: #f5f5f5;
color: #666;
font-size: 24rpx;
padding: 8rpx 15rpx;
border-radius: 30rpx;
margin-right: 15rpx;
margin-bottom: 10rpx;
}
.item-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.user-info {
display: flex;
align-items: center;
}
.user-name {
font-size: 28rpx;
margin-left: 15rpx;
}
.actions {
display: flex;
align-items: center;
}
.view-button {
width: 150rpx;
height: 60rpx;
border-radius: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.view-button-check {
background: linear-gradient(to right, #e3ccb2, #cba579);
margin-right: 20rpx;
}
.view-button-msg {
background: linear-gradient(to right, #5d5ebc, #12099a);
}
.button-text {
color: white;
font-size: 26rpx;
}
.publish-image {
position: fixed;
bottom: 80rpx;
right: 0rpx;
width: 180rpx;
height: 140rpx;
z-index: 99;
}
</style>

@ -0,0 +1,267 @@
<template>
<view class="container">
<view class="card">
<text class="section-title">供需类型</text>
<view class="type-selector">
<view :class="['type-button', form.type === 'supply' ? 'active' : '']" @click="form.type = 'supply'">
<u-icon name="server-fill" :color="form.type === 'supply' ? '#C9A36D' : '#909399'"></u-icon>
<text class="type-text">供应</text>
</view>
<view :class="['type-button', form.type === 'demand' ? 'active' : '']" @click="form.type = 'demand'">
<u-icon name="order" :color="form.type === 'demand' ? '#C9A36D' : '#909399'"></u-icon>
<text class="type-text">需求</text>
</view>
</view>
</view>
<view class="card">
<text class="section-title">基本信息</text>
<u-form :model="form" ref="uForm">
<u-form-item label="标题" label-width="150" prop="title" :border-bottom="false">
<u-input v-model="form.title" placeholder="请输入标题, 简明扼要" :maxlength="50" type="text"
:custom-style="inputStyle('title')" @focus="activeInput = 'title'" @blur="activeInput = null" />
</u-form-item>
<u-form-item label="详细描述" label-width="150" prop="description" :border-bottom="false">
<u-input v-model="form.description" type="textarea" placeholder="请详细描述您的供需内容..." :maxlength="500" height="200"
:custom-style="inputStyle('description')" @focus="activeInput = 'description'" @blur="activeInput = null" />
</u-form-item>
<u-form-item label="行业标签" label-width="150" prop="tags" :border-bottom="false">
<u-input v-model="tagInput" type="text" placeholder="输入后按回车键确认"
:custom-style="inputStyle('tags')" @focus="activeInput = 'tags'" @blur="activeInput = null" @confirm="addTag" />
</u-form-item>
<view class="tag-container" v-if="form.tags.length > 0">
<view v-for="(tag, index) in form.tags" :key="index" class="tag-item">
<text>{{ tag }}</text>
<u-icon name="close" size="20" @click="removeTag(index)"></u-icon>
</view>
</view>
<view class="form-tip">建议添加相关行业标签, 方便其他校友找到你</view>
</u-form>
</view>
<view class="card">
<text class="section-title">联系方式 *</text>
<view class="contact-selector">
<view :class="['contact-button', form.contactType === 'wechat' ? 'active' : '']" @click="form.contactType = 'wechat'">
<u-icon name="chat-fill" :color="form.contactType === 'wechat' ? '#C9A36D' : '#909399'"></u-icon>
<text class="contact-text">微信</text>
</view>
<view :class="['contact-button', form.contactType === 'phone' ? 'active' : '']" @click="form.contactType = 'phone'">
<u-icon name="phone-fill" :color="form.contactType === 'phone' ? '#C9A36D' : '#909399'"></u-icon>
<text class="contact-text">电话</text>
</view>
<view :class="['contact-button', form.contactType === 'email' ? 'active' : '']" @click="form.contactType = 'email'">
<u-icon name="email-fill" :color="form.contactType === 'email' ? '#C9A36D' : '#909399'"></u-icon>
<text class="contact-text">邮箱</text>
</view>
</view>
<u-input v-model="form.contactValue" :placeholder="contactPlaceholder"
:custom-style="inputStyle('contact')" @focus="activeInput = 'contact'" @blur="activeInput = null" />
<text class="privacy-notice">隐私保护: 您的联系方式仅对感兴趣的校友可见, 平台内置防骚扰机制, 保护您的隐私安全</text>
</view>
<view class="footer-button">
<u-button type="primary" shape="circle" @click="submit">{{ form.type === 'supply' ? '' : '' }}</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activeInput: null,
tagInput: '',
form: {
type: 'supply', // supply or demand
title: '',
description: '',
tags: [],
contactType: 'wechat', // wechat, phone, email
contactValue: '',
},
};
},
computed:{
contactPlaceholder(){
const placeholders = {
wechat: '输入微信号',
phone: '输入电话号码',
email: '输入邮箱地址'
}
return placeholders[this.form.contactType]
}
},
methods: {
inputStyle(name) {
const style = {
backgroundColor: '#f7f8fa',
borderRadius: '16rpx',
padding: '18rpx 25rpx',
border: '1px solid #f7f8fa',
transition: 'border-color 0.2s ease',
};
if (this.activeInput === name) {
style.borderColor = '#D4C3AB';
}
return style;
},
addTag() {
if (this.tagInput && !this.form.tags.includes(this.tagInput)) {
this.form.tags.push(this.tagInput);
this.tagInput = '';
}
},
removeTag(index) {
this.form.tags.splice(index, 1);
},
submit() {
//
console.log(this.form)
uni.showToast({
title: '发布成功',
icon: 'success'
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
min-height: 100vh;
background: linear-gradient(to bottom, #e9f2fa, #f5f7fa);
padding: 30rpx 20rpx 140rpx 20rpx;
box-sizing: border-box;
}
.card {
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
}
.section-title {
font-size: 32rpx;
font-weight: bold;
display: block;
margin-bottom: 30rpx;
}
.type-selector, .contact-selector {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
}
.type-button {
width: 48%;
display: flex;
justify-content: center;
align-items: center;
background-color: #f5f5f5;
border-radius: 12rpx;
padding: 20rpx 0;
transition: all 0.3s;
&.active {
background-color: #fdf3e8;
border: 1rpx solid #e8d1b5;
.type-text {
color: #C9A36D;
}
}
}
.contact-button {
width: 31%;
display: flex;
justify-content: center;
align-items: center;
background-color: #f5f5f5;
border-radius: 12rpx;
padding: 20rpx 0;
transition: all 0.3s;
&.active {
background-color: #fdf3e8;
border: 1rpx solid #e8d1b5;
.contact-text {
color: #C9A36D;
}
}
}
.type-text, .contact-text {
font-size: 28rpx;
margin-left: 10rpx;
color: #606266;
}
.form-tip {
font-size: 24rpx;
color: #909399;
margin-top: 10rpx;
padding-left: 150rpx;
}
.tag-container {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
padding-left: 150rpx;
}
.tag-item {
background-color: #f5f5f5;
color: #606266;
padding: 10rpx 20rpx;
border-radius: 12rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
display: flex;
align-items: center;
text {
margin-right: 10rpx;
}
}
.privacy-notice {
display: block;
font-size: 24rpx;
color: #909399;
margin-top: 30rpx;
line-height: 1.6;
}
.footer-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 20rpx 40rpx;
background-color: #fff;
box-sizing: border-box;
box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05);
}
// --- Custom Input Styles ---
::v-deep .u-form-item .u-line {
display: none;
}
::v-deep .u-input__body {
background-color: #f7f8fa !important;
border-radius: 16rpx !important;
padding: 18rpx 25rpx !important;
border: 1px solid #f7f8fa !important;
transition: border-color 0.2s ease;
}
::v-deep .u-input--focus .u-input__body {
border-color: #D4C3AB !important;
}
</style>

@ -20,7 +20,7 @@
}
}, {
"path": "pages/me/index",
"style": {
"style": {
"navigationBarTitleText": "我的"
}
}],
@ -28,105 +28,135 @@
"root": "packages",
"pages": [{
"path": "my/index",
"style": {
"style": {
"navigationBarTitleText": "个人信息"
}
},{
"path": "course/detail",
"style": {
"style": {
"navigationBarTitleText": ""
}
},{
"path": "course/freeDetail",
"style": {
"style": {
"navigationBarTitleText": ""
}
},{
"path": "register/index",
"style": {
"style": {
"navigationBarTitleText": "注册"
}
},{
"path": "register/login",
"style": {
"style": {
"navigationBarTitleText": "登录",
"navigationStyle": "custom"
}
},{
"path": "apply/index",
"style": {
"style": {
"navigationBarTitleText": "在线报名"
}
},{
"path": "booksubmit/index",
"style": {
"style": {
"navigationBarTitleText": "我要预约"
}
},{
"path": "booksubmit/appointment",
"style": {
"style": {
"navigationBarTitleText": "场地预约"
}
},{
"path": "schoolmate/index",
"style": {
"style": {
"navigationBarTitleText": "校友库"
}
},{
"path": "mycourse/index",
"style": {
"style": {
"navigationBarTitleText": "我的课程"
}
},{
"path": "mycourse/detail",
"style": {
"style": {
"navigationBarTitleText": "课程详情"
}
},{
"path": "mycourse/courseStatus",
"style": {
"style": {
"navigationBarTitleText": "报名状态"
}
},{
"path": "mycourse/coursePay",
"style": {
"style": {
"navigationBarTitleText": "报名缴费"
}
},{
"path": "mycourse/courseContents",
"style": {
"style": {
"navigationBarTitleText": ""
}
},{
"path": "mycourse/courseTxl",
"style": {
"style": {
"navigationBarTitleText": "本班通讯录"
}
},{
"path": "mybook/index",
"style": {
"style": {
"navigationBarTitleText": "我的预约"
}
},{
"path": "mybook/detail",
"style": {
"style": {
"navigationBarTitleText": "预约详情"
}
},{
"path": "donate/index",
"style": {
"style": {
"navigationBarTitleText": "校友捐赠"
}
},{
"path": "webview/index",
"style": {
"style": {
"navigationBarTitleText": "苏州科技商学院"
}
},{
"path": "avatarUpload/index",
"style": {
"style": {
"navigationBarTitleText": "更换头像"
}
},{
"path": "library/index",
"style": {
"navigationBarTitleText": "图书馆"
}
},{
"path": "supply/index",
"style": {
"navigationBarTitleText": "供需发布"
}
},{
"path": "supply/publish",
"style": {
"navigationBarTitleText": "发布供需"
}
},{
"path": "supply/detail",
"style": {
"navigationBarTitleText": "供需详情"
}
},{
"path": "chat/index",
"style": {
"navigationBarTitleText": "校友私信"
}
},{
"path": "chat/chatWindow",
"style": {
"navigationBarTitleText": "校友私信"
}
}]
}],
"preloadRule": {

@ -1,14 +1,37 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('book-bg.png')"></image>
<view class="schoolmate btn">
<image mode="widthFix" @click="toUrl(2)" :src="base.imgHost('book-schoolmate1.png')"></image>
<!-- <view>加入我们</view> -->
<image class="cbg" :src="base.imgHost('alumni-benefits-bg.png')"></image>
<image class="profile-icon" src="/static/index_icon1-4.png" @click="goToProfile"></image>
<view class="button-grid">
<view class="grid-item" @click="handleButtonClick('alumni')">
<image class="item-bg" :src="base.imgHost('alumni-benefits-item2.png')"></image>
<view class="item-content">
<image class="icon" :src="base.imgHost('alumni-benefits-icon1.png')" mode="aspectFit"></image>
<text class="label-1">校友库</text>
</view>
</view>
<view class="grid-item" @click="handleButtonClick('booking')">
<image class="item-bg" :src="base.imgHost('alumni-benefits-item1.png')"></image>
<view class="item-content">
<image class="icon" :src="base.imgHost('alumni-benefits-icon2.png')" mode="aspectFit"></image>
<text class="label-2">场地预约</text>
</view>
</view>
<view class="grid-item" @click="handleButtonClick('supply-demand')">
<image class="item-bg" :src="base.imgHost('alumni-benefits-item1.png')"></image>
<view class="item-content">
<image class="icon" :src="base.imgHost('alumni-benefits-icon3.png')" mode="aspectFit"></image>
<text class="label-2">供需发布</text>
</view>
</view>
<view class="grid-item" @click="handleButtonClick('library')">
<image class="item-bg" :src="base.imgHost('alumni-benefits-item2.png')"></image>
<view class="item-content">
<image class="icon" :src="base.imgHost('alumni-benefits-icon4.png')" mode="aspectFit"></image>
<text class="label-1">图书馆查询</text>
</view>
</view>
</view>
<view class="book btn">
<image mode="widthFix" @click="toUrl(1)" :src="base.imgHost('book-book1.png')"></image>
<!-- <view>立即预约</view> -->
</view>
<tabbar :currentPage="2"></tabbar>
</view>
</template>
@ -22,22 +45,20 @@
data() {
return {
user: {},
can_appointment: false,
enter_schoolmate: 0,
door_appointments: false, //
enter_schoolmate: 0
}
},
onShareAppMessage() {
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
},
onShareTimeline() {
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
},
onShareAppMessage() {
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
},
onShareTimeline() {
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
},
onShow() {
this.getUser()
@ -49,48 +70,47 @@
this.$u.api.user().then(res => {
console.log("res", res)
this.enter_schoolmate = res.enter_schoolmate
if (res.user.appointment_total - res.user.pass_appointments > 0) {
this.can_appointment = true
} else {
this.can_appointment = false
}
// this.door_appointments = res.door_appointments ? true : false
this.$u.vuex('vuex_user', res.user)
})
},
async toUrl(type) {
if (type === 1) {
uni.navigateTo({
url: '/packages/booksubmit/appointment'
})
// await this.$u.api.user().then(res => {
// if (res.user.appointment_total - res.user.pass_appointments > 0) {
// this.can_appointment = true
// uni.navigateTo({
// url: '/packages/booksubmit/appointment'
// })
// } else {
// this.can_appointment = false
// this.base.toast("")
// }
// })
} else if (type === 2) {
if (this.enter_schoolmate) {
goToProfile() {
uni.navigateTo({
url: '/packages/chat/index'
});
},
handleButtonClick(type) {
switch (type) {
case 'alumni':
if (this.enter_schoolmate) {
uni.navigateTo({
url: '/packages/schoolmate/index'
})
} else {
this.base.toast("您还不是校友,无权查看", 1000, function() {
setTimeout(function() {
uni.switchTab({
url: '/pages/course/index'
})
}, 1000)
})
}
break;
case 'booking':
uni.navigateTo({
url: '/packages/schoolmate/index'
url: '/packages/booksubmit/appointment'
})
} else {
this.base.toast("您还不是校友,无权查看",1000,function(){
setTimeout(function(){
uni.switchTab({
url: '/pages/course/index'
})
},1000)
})
}
break;
case 'supply-demand':
uni.navigateTo({
url: '/packages/supply/index'
})
break;
case 'library':
uni.navigateTo({
url: '/packages/library/index'
})
break;
}
}
},
@ -103,6 +123,10 @@
width: 100%;
height: 100vh;
padding-bottom: 200rpx;
display: flex;
justify-content: center;
align-items: center;
position: relative;
.cbg {
position: absolute;
@ -110,34 +134,72 @@
left: 0;
width: 100%;
height: 100vh;
}
.btn{
width:320rpx;
// height:136rpx;
position: absolute;
image{
width:100%;
height:100%;
}
view{
text-align: center;
margin-top:10rpx;
color:#806e5c;
font-size:30rpx;
}
}
.schoolmate{
top: 300rpx;
left: 40rpx;
}
.book{
bottom: 300rpx;
right: 40rpx;
}
z-index: -1;
}
.profile-icon {
position: absolute;
top: 80rpx;
right: 60rpx;
width: 60rpx;
height: 60rpx;
z-index: 10;
}
.button-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20rpx;
width: 100%;
padding: 0 40rpx;
box-sizing: border-box;
}
.grid-item {
position: relative;
width: 100%;
padding-top: 127.8125%;
/* Creates a 320:409 aspect ratio */
}
.item-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.item-content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
padding: 60rpx 40rpx;
box-sizing: border-box;
}
.icon {
width: 90rpx;
height: 90rpx;
margin-bottom: 60rpx;
}
.label-1 {
font-size: 34rpx;
font-weight: bold;
color: #4f4a7b;
}
.label-2 {
font-size: 34rpx;
font-weight: bold;
color: #8f6e4d;
}
}
</style>
Loading…
Cancel
Save