第一次上传

This commit is contained in:
Ls
2026-03-09 16:39:03 +08:00
commit 3d9efaf15c
924 changed files with 326227 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
<template>
<view style="padding: 20rpx;">
<up-search placeholder="搜索相关内容..." :showAction='false' v-model="search"></up-search>
<view class="" style=" margin: 25rpx 0; display: flex; align-items: center; justify-content: space-between;" >
<view @click="changetab(index)" v-for="(item,index) in tag" :key="index" :class="{active:index!=currentIndex,actived:index==currentIndex}" class="tag" style=" padding: 14rpx 36rpx; border-radius: 46rpx; " >
{{item}}
</view>
</view>
</view>
<view class="" style="padding: 30rpx 40rpx; border-bottom: 1rpx solid #e2e2e2; border-top: 1rpx solid #e2e2e2; " >
<view class="" style="font-weight: 600; font-size: 32rpx;" >
精品推荐
</view>
<view class="" @click="Service.GoPage('/pages/article/news')" style="margin-top: 20rpx; position: relative; ">
<image :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" mode="aspectFill" style=" border-radius: 20rpx; width: 100%; height: 350rpx;" alt="" />
<view class="" style="position: absolute; left: 20rpx; bottom: 50rpx; color: #fff; " >
<view class="" style="font-size: 34rpx;" >
城市漫步:寻找完美咖啡馆
</view>
<view class="" style=" margin: 15rpx 0; font-size: 26rpx;" >
探索城市中隐藏的咖啡珍宝,感受不同的咖啡文化
</view>
<view class="" style="font-size: 22rpx; display: flex; align-items: center;" >
<img :src="Service.GetIconImg('/static/article/time.png')" style="width: 24rpx; height: 24rpx;" alt="" />
<text style="margin-left: 10rpx;" >2小时前</text>
</view>
</view>
</view>
</view>
<view class="" style="padding: 20rpx; border-bottom: 1rpx solid #e2e2e2;" >
<view class="" @click="Service.GoPage('/pages/article/news')" style="display: flex; margin-top: 20rpx; border-radius: 20rpx; " >
<image :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" mode="aspectFill" style=" border-radius: 20rpx; width: 190rpx; height: 150rpx;" alt="" />
<view class="" style=" flex: 1; margin-left: 20rpx; display: flex; flex-direction: column; justify-content: space-between; " >
<view class="" style=" " >
<view class="" style="font-weight: 700; font-size: 32rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" >
老北京炸酱面
</view>
</view>
<view class="" style=" margin: 8rpx 0; color: #666666; font-size: 26rpx; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; " >
老北京炸酱面是北京市传统小吃,属北京菜系,在京津冀地区广为流传。该菜品以面条为主料,搭配炸酱与时令菜码拌制而成,核心酱料选用肥瘦相间的五花肉丁,配以干黄酱和甜面酱混合炒制,经慢火熬煮形成深褐色酱料
</view>
<view class="" style=" display: flex; align-items: center; " >
<img :src="Service.GetIconImg('/static/article/date.png')" style="width: 24rpx; height: 24rpx;" alt="" />
<text style="color: #666666; margin-left: 10rpx; font-size: 26rpx;" >2026-10-15</text>
</view>
</view>
</view>
</view>
<up-loadmore :status="status" />
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { Service } from "@/Service/Service"
let search = ref()
let status=ref('nomore')
let currentIndex=ref(0)
let tag=ref([
'全部',
'热门',
'推荐',
'最近'
])
onLoad(() => {
});
onShow(() => {
});
const changetab=(e:number)=>{
currentIndex.value=e
}
</script>
<style lang="scss">
.active{
background-color: #F3F4F6;
color: #4B5563;
}
.actived{
background-color: #FF6B35;
color: #fff;
}
.tag{
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
font-size: 28rpx;
margin-left: 10rpx;
}
</style>

View File

@@ -0,0 +1,575 @@
<template>
<view class="settings-page">
<!-- 沉浸式状态栏 -->
<view class="status-bar"></view>
<!-- 顶部导航 -->
<view class="nav-bar">
<image class="back-icon" src="/static/icons/back.svg" @click="goBack" mode="aspectFit" />
<text class="nav-title">设置</text>
<view class="nav-placeholder"></view>
</view>
<!-- 主要内容区域 -->
<view class="content">
<!-- 个人信息卡片 -->
<view class="profile-card">
<view class="card-title">
<text class="ri-user-line title-icon"></text>
<text class="title-text">个人信息</text>
</view>
<!-- 头像 -->
<view class="setting-item" @click="uploadFImg(140,140,'Avatar','headimg')">
<view class="item-left">
<text class="item-label">头像</text>
</view>
<view class="item-right">
<image class="avatar-preview" :src="Service.GetMateUrlByImg(userInfo.headImg)"
mode="aspectFill" />
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
<!-- 昵称 -->
<view class="setting-item" @click="changeNickname">
<view class="item-left">
<text class="item-label">昵称</text>
</view>
<view class="item-right">
<text class="item-value">{{ userInfo.nick }}</text>
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
<!-- 手机号 -->
<view class="setting-item">
<view class="item-left">
<text class="item-label">手机号</text>
</view>
<view class="item-right">
<text class="item-value">{{ userInfo.phone }}</text>
</view>
</view>
<!-- 会员ID -->
<view class="setting-item">
<view class="item-left">
<text class="item-label">会员ID</text>
</view>
<view class="item-right">
<text class="item-value">{{ userInfo.userNo }}</text>
</view>
</view>
</view>
<!-- 其他设置 -->
<!-- <view class="other-settings-card">
<view class="card-title">
<text class="ri-settings-4-line title-icon"></text>
<text class="title-text">其他设置</text>
</view>
<view class="setting-item" @click="clearCache">
<view class="item-left">
<text class="item-label">清除缓存</text>
</view>
<view class="item-right">
<text class="item-value">23.5MB</text>
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
<view class="setting-item" @click="checkUpdate">
<view class="item-left">
<text class="item-label">检查更新</text>
</view>
<view class="item-right">
<text class="item-value">当前版本 v1.0.0</text>
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
<view class="setting-item" @click="viewPrivacy">
<view class="item-left">
<text class="item-label">隐私政策</text>
</view>
<view class="item-right">
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
<view class="setting-item" @click="viewAgreement">
<view class="item-left">
<text class="item-label">用户协议</text>
</view>
<view class="item-right">
<text class="ri-arrow-right-s-line item-arrow"></text>
</view>
</view>
</view> -->
<!-- <view class="logout-section">
<button class="logout-btn" @click="logout">
<text class="btn-text">退出登录</text>
</button>
</view> -->
</view>
<!-- 修改昵称弹窗 -->
<view v-if="showNicknameModal" class="modal-overlay" @click="closeNicknameModal">
<view class="modal-content" @click.stop>
<view class="modal-header">
<text class="modal-title">修改昵称</text>
<text class="ri-close-line modal-close" @click="closeNicknameModal"></text>
</view>
<view class="modal-body">
<input class="nickname-input" v-model="tempNickname" placeholder="请输入新昵称" maxlength="20" />
</view>
<view class="modal-footer">
<button class="modal-btn cancel" @click="closeNicknameModal">取消</button>
<button class="modal-btn confirm" @click="saveNickname">确定</button>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { Service } from '@/Service/Service';
import { ref } from "vue";
import { vpUserService } from '@/Service/vp/vpUserService';
import ImageCropperFunc from "@/components/ImageCropper";
const userInfo = ref<any>({
nick: '',
sex: '',
phone: '',
headImg: ''
})
// 临时昵称
const tempNickname = ref('')
onLoad(() => {
getUserinfo()
});
onShow(() => {
});
const getUserinfo = () => {
vpUserService.GetUserInfo().then(res => {
userInfo.value = res.data.userInfo
})
}
const uploadFImg = (width : any, height : any, Type : any, Name : any) => {
uni.chooseImage({
count: 1, // 最多选择3张图片
sizeType: ['original', 'compressed'], // 支持原图和压缩图
sourceType: ['album', 'camera'], // 可从相册选择或使用相机拍照
success: function (res) {
let path = res.tempFiles[0].path
let arr = path.split('.')
let name = arr[arr.length - 1]
Service.UpLoadMedia('Avatar', name, '', path).then(res => {
userInfo.value.headImg = res.data.file
})
},
fail: function (err) {
console.error('选择失败:', err.errMsg);
}
})
}
// 修改昵称
const changeNickname = () => {
tempNickname.value = userInfo.value.nick
showNicknameModal.value = true
}
// 关闭昵称弹窗
const closeNicknameModal = () => {
showNicknameModal.value = false
}
// 保存昵称
const saveNickname = () => {
if (!tempNickname.value.trim()) {
uni.showToast({
title: '昵称不能为空',
icon: 'none'
})
return
}
vpUserService.UpdateUser(userInfo.value.headImg,tempNickname.value,userInfo.value.sex,'').then(res=>{
if(res.code==0){
Service.Msg('修改成功!')
showNicknameModal.value = false
userInfo.value.nick = tempNickname.value
}else{
Service.Msg(res.msg)
}
})
}
// 用户信息
const user = ref({
nickname: '美食达人',
avatar: 'https://picsum.photos/200/200?random=100',
phone: '138****8888',
memberId: '8888888'
})
// 显示昵称弹窗
const showNicknameModal = ref(false)
// 返回
const goBack = () => {
uni.navigateBack({
delta: 1
})
}
// 修改头像
const changeAvatar = () => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
// 这里应该上传到服务器,现在暂时直接使用本地路径
user.value.avatar = res.tempFilePaths[0]
uni.showToast({
title: '头像已更新',
icon: 'success'
})
}
})
}
// 清除缓存
const clearCache = () => {
uni.showModal({
title: '清除缓存',
content: '确定要清除缓存吗?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '清除中...'
})
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '缓存已清除',
icon: 'success'
})
}, 1000)
}
}
})
}
// 检查更新
const checkUpdate = () => {
uni.showLoading({
title: '检查中...'
})
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '已是最新版本',
icon: 'success'
})
}, 1500)
}
// 查看隐私政策
const viewPrivacy = () => {
uni.showToast({
title: '隐私政策页面',
icon: 'none'
})
}
// 查看用户协议
const viewAgreement = () => {
uni.showToast({
title: '用户协议页面',
icon: 'none'
})
}
// 退出登录
const logout = () => {
uni.showModal({
title: '退出登录',
content: '确定要退出登录吗?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '退出中...'
})
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '已退出登录',
icon: 'success'
})
// 这里可以跳转到登录页面
}, 1000)
}
}
})
}
</script>
<style lang="scss" scoped>
.settings-page {
min-height: 100vh;
background: #F5F5F5;
display: flex;
flex-direction: column;
}
/* 状态栏 */
.status-bar {
background: linear-gradient(135deg, #FF6B00, #FF9500);
height: var(--status-bar-height);
width: 100%;
}
/* 导航栏 */
.nav-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 60rpx 24rpx 20rpx 24rpx;
background: linear-gradient(135deg, #FF6B00, #FF9500);
}
.back-icon {
width: 48rpx;
height: 48rpx;
padding: 8rpx;
}
.nav-title {
font-size: 36rpx;
font-weight: 600;
color: #FFFFFF;
}
.nav-placeholder {
width: 48rpx;
}
/* 内容区域 */
.content {
flex: 1;
padding: 32rpx 24rpx;
}
/* 卡片通用样式 */
.profile-card,
.other-settings-card {
background: #FFFFFF;
border-radius: 24rpx;
padding: 32rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
margin-bottom: 20rpx;
}
.card-title {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 2rpx solid #F5F5F5;
}
.title-icon {
font-size: 32rpx;
color: #FF6B00;
}
.title-text {
font-size: 28rpx;
font-weight: 600;
color: #222222;
}
/* 设置项 */
.setting-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 1rpx solid #F5F5F5;
}
.setting-item:last-child {
border-bottom: none;
}
.item-left {
display: flex;
align-items: center;
}
.item-label {
font-size: 28rpx;
color: #222222;
font-weight: 500;
}
.item-right {
display: flex;
align-items: center;
gap: 8rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.item-arrow {
font-size: 28rpx;
color: #CCCCCC;
}
.avatar-preview {
width: 80rpx;
height: 80rpx;
border-radius: 40rpx;
}
/* 退出登录按钮 */
.logout-section {
margin-top: 32rpx;
}
.logout-btn {
width: 100%;
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #F44336;
border-radius: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.btn-text {
font-size: 32rpx;
font-weight: 600;
color: #F44336;
}
/* 弹窗样式 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.modal-content {
width: 560rpx;
background: #FFFFFF;
border-radius: 24rpx;
padding: 32rpx;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 32rpx;
}
.modal-title {
font-size: 32rpx;
font-weight: 600;
color: #222222;
}
.modal-close {
font-size: 40rpx;
color: #999999;
}
.modal-body {
margin-bottom: 32rpx;
}
.nickname-input {
width: 100%;
height: 80rpx;
padding: 0 20rpx;
background: #F5F5F5;
border-radius: 12rpx;
font-size: 28rpx;
color: #222222;
}
.modal-footer {
display: flex;
gap: 16rpx;
}
.modal-btn {
flex: 1;
height: 80rpx;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 600;
border: none;
}
.modal-btn.cancel {
background: #F5F5F5;
color: #666666;
}
.modal-btn.confirm {
background: linear-gradient(135deg, #FF6B00, #FF9500);
color: #FFFFFF;
}
</style>