This commit is contained in:
Leo_Ding 2025-08-04 15:12:51 +08:00
commit 98dda253ce
23 changed files with 1326 additions and 1509 deletions

View File

@ -59,6 +59,12 @@
}, },
"usingComponents" : true, "usingComponents" : true,
"requiredPrivateInfos": ["getLocation"], "requiredPrivateInfos": ["getLocation"],
"optimization" : {
"minify": {
"js": true,
"css": true
}
},
"permission" : { "permission" : {
"scope.userLocation" : { "scope.userLocation" : {
"desc" : "你的位置信息将用于获取周边服务" "desc" : "你的位置信息将用于获取周边服务"

View File

@ -203,13 +203,6 @@
"usingComponents": {} "usingComponents": {}
} }
}, },
// {
// "path" : "pages/meetingDetail/ceshi/ceshi",
// "style" :
// {
// "navigationBarTitleText" : ""
// }
// },
{ {
"path": "pages/sign/sign", "path": "pages/sign/sign",
"style": { "style": {

View File

@ -1,554 +1,451 @@
<template> <template>
<view class="activity-detail-container"> <view class="activity-detail-container">
<!-- 顶部图片轮播 --> <!-- 顶部图片轮播 -->
<swiper class="activity-banner" :autoplay="false" indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#5b9cf8"> <view class="banner-container">
<swiper-item v-for="(img, index) in bannerImages" :key="index"> <swiper class="activity-banner" :autoplay="false" indicator-dots indicator-color="rgba(255,255,255,0.5)"
<image indicator-active-color="#5b9cf8">
:src="img" <swiper-item v-for="(img, index) in bannerImages" :key="index">
mode="aspectFill" <image :src="img" class="w-full h-full" @click="previewImage(index)" />
class="w-full h-full" </swiper-item>
@click="previewImage(index)" </swiper>
/> <view class="banner-mask"></view>
</swiper-item>
</swiper>
<!-- 活动基本信息 -->
<view class="activity-base-info">
<view class="title-box">
<text class="title">{{activityInfo.title}}</text>
<view class="status-tag active" v-if="activityInfo.status === 2">
{{'未开始'}}
</view>
<view class="status-tag active" v-else-if="activityInfo.status === 3">
{{'进行中'}}
</view> </view>
<view class="status-tag active" v-else="activityInfo.status === 4">
{{'已结束'}} <!-- 活动基本信息 -->
<view class="activity-base-info">
<view class="title-box">
<text class="title">{{activityInfo.title}}</text>
<view class="status-tag active" v-if="activityInfo.status === 2">
{{'未开始'}}
</view>
<view class="status-tag active" v-else-if="activityInfo.status === 3">
{{'进行中'}}
</view>
<view class="status-tag active" v-else="activityInfo.status === 4">
{{'已结束'}}
</view>
</view>
<view class="info-grid">
<view class="info-item">
<u-icon name="star" size="26" color="#5b9cf8"></u-icon>
<view class="info-text"><text class="info-label">活动类型</text>{{activityInfo.categoryName || '待确认'}} </view>
</view>
<view class="info-item">
<u-icon name="clock" size="26" color="#5b9cf8"></u-icon>
<view class="info-text"><text class="info-label">活动时间</text>{{ activityInfo.openAt }}</view>
</view>
<view class="info-item">
<u-icon name="clock-fill" size="26" color="#ff5a5f"></u-icon>
<view class="info-text"><text class="info-label">结束时间</text>{{ formatTime(activityInfo.endAt,"YYYY-MM-DD HH:mm:ss") }}</view>
</view>
<view class="info-item highlight">
<u-icon name="warning" size="26" color="#ff9500"></u-icon>
<view class="info-text"><text class="info-label">报名截止</text>{{ formatTime(activityInfo.endSignupAt,"YYYY-MM-DD HH:mm:ss") }}</view>
</view>
</view>
</view> </view>
</view>
<!-- 活动详情卡片 -->
<view class="info-grid"> <view class="detail-card">
<view class="info-item"> <view class="detail-section">
<u-icon name="star" size="24" color="#5b9cf8"></u-icon> <view class="section-title">
<view class="info-text"><text>活动类型</text>{{activityInfo.categoryName || '待确认'}} </view> <view class="title-icon"></view>
<text>活动详情</text>
</view>
<view class="section-content rich-text">
<rich-text :nodes="activityInfo.content"></rich-text>
<!-- <image src="/static/route-map.jpg" mode="widthFix" class="route-map"
@click="previewImage(bannerImages.length)"></image> -->
</view>
</view>
</view> </view>
<view class="info-item"> <!-- 底部操作栏 -->
<u-icon name="map" size="24" color="#5b9cf8"></u-icon> <view class="action-bar safe-area-inset-bottom">
<view class="info-text"><text>活动地址</text>{{activityInfo.address || '待定'}}</view> <button class="share-btn" open-type="share">
</view> <u-icon name="share" size="32" color="#fff"></u-icon>
<view class="info-item"> <text class="share-text">分享</text>
<u-icon name="clock" size="24" color="#5b9cf8"></u-icon> </button>
<view class="info-text">{{ activityInfo.openAt }}</view> <button class="signup-btn" @click="handleSignUp">立即报名</button>
</view> </view>
<!-- <view class="info-item"> </view>
<u-icon name="account" size="18" color="#36CFC9"></u-icon>
<text class="info-text">已报名 {{activityInfo.participants}}</text>
</view> -->
</view>
</view>
<!-- 活动详情卡片 -->
<view class="detail-card">
<!-- <view class="card-header">
<view class="header-line"></view>
<text class="header-title">活动详情</text>
</view> -->
<view class="detail-section">
<view class="section-title">
<view class="title-icon"></view>
<text>活动详情</text>
</view>
<view class="section-content">
<view v-html="activityInfo.content"></view>
<image
src="/static/route-map.jpg"
mode="widthFix"
class="route-map"
@click="previewImage(bannerImages.length)"
></image>
</view>
</view>
<!-- <view class="detail-section">
<view class="section-title">
<view class="title-icon"></view>
<text>活动流程</text>
</view>
<view class="timeline">
<view class="timeline-item" v-for="(step, index) in timeline" :key="index">
<view class="timeline-dot" :style="{backgroundColor: dotColors[index]}"></view>
<view class="timeline-content">
<text class="timeline-time">{{step.time}}</text>
<text class="timeline-desc">{{step.desc}}</text>
</view>
</view>
</view>
</view> -->
<!-- <view class="detail-section">
<view class="section-title">
<view class="title-icon"></view>
<text>积分规则</text>
</view>
<view class="point-rules">
<view class="rule-item" v-for="(rule, index) in pointRules" :key="index">
<view class="rule-icon">
<text>{{index + 1}}</text>
</view>
<text class="rule-text">{{rule}}</text>
</view>
</view>
</view> -->
</view>
<!-- 温馨提示 -->
<!-- <view class="tips-card">
<view class="card-header">
<view class="header-line"></view>
<text class="header-title">温馨提示</text>
</view>
<view class="tips-content">
<text class="tip-item" v-for="(tip, index) in tips" :key="index">
{{tip}}
</text>
</view>
</view> -->
<!-- 底部操作栏 -->
<view class="action-bar">
<!-- <view class="action-btn favorite" @click="toggleFavorite">
<u-icon :name="isFavorite ? 'heart-fill' : 'heart'" size="24" :color="isFavorite ? '#FF5A5F' : '#666'"></u-icon>
<text>收藏</text>
</view> -->
<view class="action-btn share" @click="shareActivity">
<u-icon name="share" size="30" color="#666"></u-icon>
<text>分享</text>
</view>
<button class="signup-btn" @click="handleSignUp" >
立即报名
</button>
</view>
</view>
</template> </template>
<script> <script>
import { get, post } from '@/utils/request'; import {
import { IMAGE_BASE_URL, BASE_URL } from '@/utils/config'; get,
import { formatTime, formatRelativeTime } from '@/utils/timeFormat'; post
export default { } from '@/utils/request';
data() { import {
return { IMAGE_BASE_URL,
formatTime, BASE_URL
IMAGE_BASE_URL, } from '@/utils/config';
Id:null, import {
isFavorite: false, formatTime,
isSignedUp: false, formatRelativeTime
bannerImages: [], } from '@/utils/timeFormat';
activityInfo: {}, export default {
// timeline: [ data() {
// {time: '19:00-19:20', desc: ''}, return {
// {time: '19:20-19:30', desc: ''}, formatTime,
// {time: '19:30-20:15', desc: ''}, IMAGE_BASE_URL,
// {time: '20:15-20:30', desc: ''} Id: null,
// ], isFavorite: false,
// pointRules: [ isSignedUp: false,
// '50', bannerImages: [],
// '4100', activityInfo: {},
// '30', // timeline: [
// '1' // {time: '19:00-19:20', desc: ''},
// ], // {time: '19:20-19:30', desc: ''},
// tips: [ // {time: '19:30-20:15', desc: ''},
// '穿', // {time: '20:15-20:30', desc: ''}
// '1', // ],
// '', // pointRules: [
// '', // '50',
// '' // '4100',
// ], // '30',
dotColors: ['#36CFC9', '#5AC8FA', '#FF9500', '#FF5A5F'] // '1'
} // ],
}, // tips: [
onLoad(options) { // '穿',
if (options && options.Id) { // '1',
this.Id = options.Id; // '',
} // '',
}, // ''
mounted(){ // ],
this.getActivitiesDetail(); dotColors: ['#36CFC9', '#5AC8FA', '#FF9500', '#FF5A5F']
}, }
methods: { },
toggleFavorite() { onLoad(options) {
this.isFavorite = !this.isFavorite if (options && options.Id) {
uni.showToast({ this.Id = options.Id;
title: this.isFavorite ? '已收藏' : '已取消收藏', }
icon: 'none' },
}) mounted() {
}, this.getActivitiesDetail();
},
async handleSignUp(){ methods: {
try { toggleFavorite() {
const res = await get(`/api/v1/app_auth/activities/${this.Id}`); this.isFavorite = !this.isFavorite
if ( !res.success) {
uni.showToast({ uni.showToast({
title: res.msg || '报名失败', title: this.isFavorite ? '已收藏' : '已取消收藏',
icon: 'error' icon: 'none'
}) })
}else{ },
uni.showToast({
title: '报名成功!', async handleSignUp() {
icon: 'success' try {
}) const res = await get(`/api/v1/app_auth/activities/${this.Id}`);
} if (!res.success) {
uni.showToast({
} catch (err) { title: res.msg || '报名失败',
console.error('获取详情失败:', err); icon: 'error'
} })
}, } else {
shareActivity() { uni.showToast({
uni.share({ title: '报名成功!',
title: this.activityInfo.title, icon: 'success'
content: '一起来参加社区夜跑活动吧!', })
href: '/pages/activity/detail', }
imageUrl: this.bannerImages[0]
}) } catch (err) {
}, console.error('获取详情失败:', err);
previewImage(index) {
uni.previewImage({
current: index,
urls: [...this.bannerImages, '/static/route-map.jpg']
})
},
async getActivitiesDetail(){
try {
const res = await get(`/api/v1/apps/home/activities/${this.Id}`);
if (!res || !res.success) {
throw new Error('获取详情失败');
}
let imgs = res.data.images;
imgs.forEach(item => {
if (!item.startsWith('http') && !item.startsWith('https')) {
item = IMAGE_BASE_URL + item;
this.bannerImages.push(item);
} }
}); },
this.activityInfo = {...res.data}; onShareAppMessage() {
} catch (err) { return {
console.error('获取详情失败:', err); title: this.activityInfo.title,
path: `/pages/activity/detail?id=${this.Id}`,
imageUrl: this.bannerImages[0] || '/static/logo.png'
}
},
previewImage(index) {
uni.previewImage({
current: index,
urls: [...this.bannerImages, '/static/route-map.jpg']
})
},
async getActivitiesDetail() {
try {
const res = await get(`/api/v1/apps/home/activities/${this.Id}`);
if (!res || !res.success) {
throw new Error('获取详情失败');
}
let imgs = res.data.images;
imgs.forEach(item => {
if (!item.startsWith('http') && !item.startsWith('https')) {
item = IMAGE_BASE_URL + item;
this.bannerImages.push(item);
}
});
this.activityInfo = {
...res.data
};
} catch (err) {
console.error('获取详情失败:', err);
}
}
} }
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$primary-color: #5b9cf8; $primary-color: #5b9cf8;
$secondary-color: #F7F8FA; $secondary-color: #f7f8fa;
$text-color: #333; $text-color: #333;
$light-text: #666; $light-text: #666;
$border-color: #eee; $lighter-text: #999;
$border-radius: 16rpx; $border-color: #eee;
$shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.06); $border-radius: 16rpx;
$shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.08);
$highlight-color: #fff8e6;
.activity-detail-container { .activity-detail-container {
padding-bottom: 120rpx; padding-bottom: 160rpx;
background-color: $secondary-color; background-color: $secondary-color;
color: $text-color;
.activity-banner {
width: 100%; .banner-container {
height: 420rpx; position: relative;
height: 500rpx;
image { overflow: hidden;
width: 100%;
height: 100%; .activity-banner {
} width: 100%;
} height: 100%;
}
.activity-base-info {
padding: 30rpx; .activity-banner image {
background-color: #fff; width: 100%;
margin-bottom: 20rpx; height: 100%;
box-shadow: $shadow; display: block;
}
.title-box {
display: flex; .banner-mask {
align-items: center; position: absolute;
margin-bottom: 30rpx; bottom: 0;
left: 0;
.title { right: 0;
font-size: 36rpx; height: 120rpx;
font-weight: bold; background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
color: $text-color; }
margin-right: 20rpx; }
}
.status-tag {
padding: 6rpx 16rpx;
border-radius: 30rpx;
font-size: 24rpx;
&.active {
background-color: rgba($primary-color, 0.1);
color: $primary-color;
}
}
}
.info-grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
gap: 20rpx;
.info-item {
display: flex;
align-items: center;
.info-text {
font-size: 26rpx;
color: $light-text;
margin-left: 10rpx;
}
}
}
}
.detail-card, .tips-card {
background-color: #fff;
border-radius: $border-radius;
padding: 30rpx;
margin: 0 20rpx 20rpx;
box-shadow: $shadow;
.card-header {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.header-line {
width: 6rpx;
height: 32rpx;
background-color: $primary-color;
border-radius: 4rpx;
margin-right: 16rpx;
}
.header-title {
font-size: 32rpx;
font-weight: bold;
color: $text-color;
}
}
.detail-section {
margin-bottom: 40rpx;
&:last-child {
margin-bottom: 0;
}
.section-title {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.title-icon {
width: 8rpx;
height: 28rpx;
background-color: $primary-color;
border-radius: 4rpx;
margin-right: 12rpx;
}
text {
font-size: 30rpx;
font-weight: bold;
color: $text-color;
}
}
.section-content {
font-size: 28rpx;
color: $light-text;
line-height: 1.6;
.route-map {
width: 100%;
margin-top: 20rpx;
border-radius: $border-radius;
}
}
.timeline {
position: relative;
padding-left: 40rpx;
&::before {
content: '';
position: absolute;
left: 15rpx;
top: 10rpx;
bottom: 10rpx;
width: 2rpx;
background-color: $border-color;
}
.timeline-item {
position: relative;
padding-bottom: 30rpx;
&:last-child {
padding-bottom: 0;
}
.timeline-dot {
position: absolute;
left: -40rpx;
top: 4rpx;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
&::after {
content: '';
width: 10rpx;
height: 10rpx;
background-color: #fff;
border-radius: 50%;
}
}
.timeline-content {
.timeline-time {
display: block;
font-size: 26rpx;
color: $primary-color;
font-weight: bold;
margin-bottom: 6rpx;
}
.timeline-desc {
font-size: 28rpx;
color: $light-text;
}
}
}
}
.point-rules {
.rule-item {
display: flex;
align-items: flex-start;
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
.rule-icon {
width: 36rpx;
height: 36rpx;
background-color: $primary-color;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
flex-shrink: 0;
text {
color: #fff;
font-size: 22rpx;
font-weight: bold;
}
}
.rule-text {
font-size: 28rpx;
color: $light-text;
line-height: 1.5;
}
}
}
}
.tips-content {
.tip-item {
display: block;
position: relative;
padding-left: 30rpx;
font-size: 28rpx;
color: $light-text;
line-height: 1.6;
margin-bottom: 16rpx;
&::before {
content: '•';
position: absolute;
left: 0;
color: $primary-color;
}
}
}
}
.action-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
background-color: #fff;
display: flex;
align-items: center;
padding: 0 20rpx;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
.action-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 120rpx;
height: 100%;
text {
font-size: 22rpx;
color: $light-text;
margin-top: 6rpx;
}
}
.signup-btn {
flex: 1;
height: 80rpx;
background-color: #5b9cf8;
color: #fff;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
margin-left: 20rpx;
&:active {
opacity: 0.9;
}
}
}
}
@media (min-width: 768px) { .activity-base-info {
.activity-detail-container { padding: 30rpx;
max-width: 750px; margin: -40rpx 20rpx 20rpx;
margin: 0 auto; background-color: #fff;
} border-radius: $border-radius;
} box-shadow: $shadow;
position: relative;
z-index: 2;
.title-box {
display: flex;
align-items: center;
margin-bottom: 30rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid rgba($border-color, 0.8);
.title {
flex: 1;
font-size: 38rpx;
font-weight: bold;
line-height: 1.4;
margin-right: 20rpx;
}
.status-tag {
padding: 8rpx 20rpx;
border-radius: 30rpx;
font-size: 24rpx;
flex-shrink: 0;
&.active {
background-color: rgba($primary-color, 0.1);
color: $primary-color;
}
}
}
.info-grid {
display: grid;
grid-template-columns: repeat(1, 1fr);
gap: 24rpx;
.info-item {
display: flex;
align-items: center; /* 垂直居中 */
&.highlight {
background-color: #fff8e6;
padding: 16rpx;
border-radius: 12rpx;
margin:0rpx -16rpx;
}
.u-icon {
flex-shrink: 0; /* 防止图标被压缩 */
}
.info-text {
font-size: 28rpx;
line-height: 1.5;
margin-left: 12rpx;
display: flex;
align-items: center; /* 确保内部文本垂直居中 */
.info-label {
color: #999;
margin-right: 8rpx;
}
}
}
}
}
.detail-card {
background-color: #fff;
border-radius: $border-radius;
padding: 30rpx;
margin: 0 20rpx 20rpx;
box-shadow: $shadow;
.detail-section {
margin-bottom: 40rpx;
.section-title {
display: flex;
align-items: center;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid rgba($border-color, 0.5);
.title-icon {
width: 8rpx;
height: 32rpx;
background-color: $primary-color;
border-radius: 4rpx;
margin-right: 16rpx;
}
text {
font-size: 32rpx;
font-weight: bold;
}
}
.section-content {
font-size: 30rpx;
line-height: 1.8;
color: $light-text;
&.rich-text {
p {
margin-bottom: 24rpx;
line-height: 1.8;
}
img {
max-width: 100%;
border-radius: 8rpx;
margin: 20rpx 0;
}
}
.route-map {
width: 100%;
margin-top: 30rpx;
border-radius: $border-radius;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
}
}
}
.action-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 120rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.08);
z-index: 100;
// &.safe-area-inset-bottom {
// padding-bottom: env(safe-area-inset-bottom);
// }
.share-btn {
display: flex;
align-items: center;
justify-content: center;
width: 160rpx;
height: 80rpx;
background: linear-gradient(135deg, #6e8cfa, #5b9cf8);
border-radius: 40rpx;
color: #fff;
font-size: 28rpx;
margin-right: 20rpx;
border: none;
box-shadow: 0 4rpx 12rpx rgba(91, 156, 248, 0.2);
transition: all 0.2s ease;
.share-text {
margin-left: 10rpx;
}
&:active {
transform: scale(0.98);
opacity: 0.9;
}
}
.share-btn::after {
border: none;
}
.signup-btn {
flex: 1;
height: 80rpx;
background: linear-gradient(135deg, #ff7e5f, #ff5a5f);
color: #fff;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(255, 90, 95, 0.2);
transition: all 0.2s ease;
border: none;
&::after {
border: none;
}
&:active {
transform: scale(0.98);
opacity: 0.9;
}
}
}
}
@media (min-width: 768px) {
.activity-detail-container {
max-width: 750px;
margin: 0 auto;
}
}
</style> </style>

View File

@ -1,180 +1,216 @@
<template> <template>
<view class="aiHelper">
<view class="aiHelper"> <view class="aiHelperContainer">
<!-- 标题区域 -->
<view class="aiHelperContainer"> <view class="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">
{{ aiHelperTitle }}
<view class="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">{{aiHelperTitle}}</view> </view>
<view class="aiBox">
<view class="aiType" v-for="(item,index) in aiType" :key="item.id" @click="goAiType(item)"> <!-- AI类型卡片容器 -->
<view class="aiTypeContainer" :style="{'background-image': `url(${item.background})`}"> <view class="aiBox">
<view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}"> <view class="aiType" v-for="(item, index) in aiType" :key="item.id" @click="goAiType(item)">
<view class="aiLeftTitle">{{item.name}}</view> <view class="aiTypeContainer" :style="{'background-image': `url(${item.background})`}">
</view> <view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}">
<view class="aiRight"> <view class="aiLeftTitle">{{ item.name }}</view>
<view class="aiRightTitle"><text>{{item.description}}</text></view> </view>
<view class="aiDescription"><text>开始对话></text></view> <view class="aiRight">
</view> <view class="aiRightTitle"><text>{{ item.description }}</text></view>
</view> <view class="aiDescription"><text>开始对话></text></view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
<view><Footer></Footer></view>
<view><Footer></Footer></view>
</view> </view>
</template> </template>
<script> <script>
import Footer from '@/components/footer_common.vue'; import Footer from '@/components/footer_common.vue';
import {get,post} from '@/utils/request'; import { get, post } from '@/utils/request';
import {IMAGE_BASE_URL,BASE_URL} from '@/utils/config'; import { IMAGE_BASE_URL, BASE_URL } from '@/utils/config';
export default{ export default {
name:'aiHelper', name: 'aiHelper',
components:{Footer}, components: { Footer },
data(){ data() {
return{ return {
aiHelperTitle:'AI智能助手', aiHelperTitle: 'AI智能助手',
aiHelperTitleBackground:'../../static/imgs/ai/title.png', aiHelperTitleBackground: '../../static/imgs/ai/title.png',
aiType:[], aiType: [],
} }
}, },
mounted() { mounted() {
this.getData(); this.getData();
}, },
methods:{ methods: {
goAiType(item){ goAiType(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/chatPage?serviceUrl=${item.serviceUrl}&apiKey=${item.apiKey}&id=${item.id}&name=${item.name}&icon=${item.icon}` url: `/pages/chat/chatPage?serviceUrl=${item.serviceUrl}&apiKey=${item.apiKey}&id=${item.id}&name=${item.name}&icon=${item.icon}`
}); });
}, },
async getData(){ async getData() {
let params = { let params = {
current: 1, current: 1,
pageSize: 10, pageSize: 10,
}; };
try { try {
const res = await get('/api/v1/apps/ai_request', params); const res = await get('/api/v1/apps/ai_request', params);
if (!res || !res.success) { if (!res || !res.success) {
throw new Error('获取AI助手失败'); throw new Error('获取AI助手失败');
} }
if(res.data.length>0){ if (res.data.length > 0) {
res.data.forEach((item)=>{ res.data.forEach((item) => {
item.background=IMAGE_BASE_URL+item.background item.background = IMAGE_BASE_URL + item.background
item.imagePath=IMAGE_BASE_URL+item.imagePath item.imagePath = IMAGE_BASE_URL + item.imagePath
item.icon=IMAGE_BASE_URL+item.icon item.icon = IMAGE_BASE_URL + item.icon
}) })
} }
this.aiType=res.data this.aiType = res.data
} catch (err) { } catch (err) {
console.error('获取AI助手失败:', err); console.error('获取AI助手失败:', err);
} }
} }
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.aiHelper{ //
// margin-top: 90rpx; // @import "@/styles/variables.scss"; //
.aiHelperContainer {
padding: 2%; .aiHelper {
padding-bottom: 50%; // 使
padding-bottom: constant(safe-area-inset-bottom);
.aiHelperTitle { padding-bottom: env(safe-area-inset-bottom);
font-size: 1rem;
font-weight: 600; .aiHelperContainer {
letter-spacing: 0; padding: 30rpx; // 使rpx
line-height: 1.5; box-sizing: border-box; // padding
color: rgba(0, 0, 0, 1);
text-align: center; .aiHelperTitle {
vertical-align: top; font-size: 36rpx;
margin-bottom: 3%; font-weight: 600;
// background-image: url('../../static/imgs/ai/title.png'); color: #000;
background-repeat: no-repeat; text-align: center;
background-position: 50% 80%; // padding: 20rpx 0 30rpx; //
background-size: 30%; background-repeat: no-repeat;
} background-position: 50% 80%;
background-size: 30%;
.aiBox { line-height: 1.5;
.aiType { }
margin-bottom: 3%;
width: 100%; .aiBox {
height: 310rpx; //
display: flex; padding: 10rpx 0;
justify-content: center;
.aiType {
.aiTypeContainer { // 使
display: flex; margin-bottom: 30rpx;
margin: 1%; width: 100%;
border-radius: 0.5rem; display: flex;
background-size: cover; justify-content: center;
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.25);
background-position: 30% 50%; .aiTypeContainer {
background-repeat: no-repeat; display: flex;
width: 96%; border-radius: 20rpx; //
aspect-ratio: 2.1/1; background-size: cover;
background-position: 30% 50%;
.aiLeft { background-repeat: no-repeat;
border-radius: 0.5rem; width: 100%;
padding: 5% 0; // 使aspect-ratio
margin-right: 12%; height: 320rpx;
background-size: cover; box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15); //
background-position: center; overflow: hidden; //
background-repeat: no-repeat;
width: 35%; .aiLeft {
// height: 100%; border-radius: 16rpx;
/* margin-left: -5%;*/ padding: 5% 0;
position: relative; margin-right: 12%;
background-size: cover;
.aiLeftTitle { background-position: center;
font-size: 0.8rem; background-repeat: no-repeat;
font-weight: 900; width: 35%;
letter-spacing: 0; position: relative;
line-height: 1.4; //
color: rgba(255, 255, 255, 1); padding: 20rpx;
text-align: left;
position: absolute; .aiLeftTitle {
bottom: 10%; font-size: 30rpx;
left: 10%; font-weight: 900;
} color: #fff;
} text-align: left;
position: absolute;
.aiRight { bottom: 20rpx;
flex: 1; left: 20rpx;
display: flex; text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3); //
flex-direction: column; }
justify-content: normal; }
.aiRightTitle { .aiRight {
font-size: 0.8rem; flex: 1;
font-weight: 700; display: flex;
letter-spacing: 0; flex-direction: column;
line-height: 1.4; justify-content: center;
color: rgba(0, 0, 0, 1); padding-right: 30rpx; //
text-align: left;
margin-bottom: 5%; .aiRightTitle {
margin-top: 22%; font-size: 30rpx;
} font-weight: 700;
color: #000;
.aiDescription { text-align: left;
font-size: 26rpx; margin-bottom: 20rpx;
font-weight: 700; line-height: 1.5; //
letter-spacing: 0; //
line-height: 2.5; max-width: 100%;
color: #999; overflow: hidden;
text-align: right; text-overflow: ellipsis;
width: 90%; display: -webkit-box;
} -webkit-line-clamp: 2;
} -webkit-box-orient: vertical;
} }
}
} .aiDescription {
} font-size: 26rpx;
} font-weight: 700;
color: #999;
text-align: right;
width: 100%;
padding-top: 10rpx;
//
transition: color 0.3s ease;
}
}
}
// hover
&:active .aiTypeContainer {
transform: scale(0.98);
transition: transform 0.2s ease;
}
&:active .aiDescription {
color: #666;
}
}
}
}
}
//
@media screen and (min-width: 750rpx) {
.aiTypeContainer {
height: 340rpx !important;
}
}
@media screen and (max-width: 375rpx) {
.aiTypeContainer {
height: 280rpx !important;
}
.aiRightTitle {
font-size: 28rpx !important;
}
}
</style> </style>

View File

@ -85,12 +85,18 @@
</view> </view>
</u-modal> </u-modal>
<u-modal :show="showPhoneDialog" title="联系社区" confirm-text="拨打" cancel-text="取消" @confirm="callCommunityPhone" <u-modal
@cancel="showPhoneDialog = false"> :show="showPhoneDialog"
<view class="phone-dialog-content"> title="联系社区"
<text>社区电话</text> confirm-text="拨打"
<text class="phone-number">{{communityPhone}}</text> cancel-text="取消"
</view> @confirm="callCommunityPhone"
@cancel="showPhoneDialog = false"
:closeOnClickOverlay="true">
<view class="phone-dialog-content">
<text>社区电话</text>
<text class="phone-number">{{communityPhone}}</text>
</view>
</u-modal> </u-modal>
<Footer></Footer> <Footer></Footer>
@ -157,8 +163,7 @@
{ {
key: 5, key: 5,
url: "/static/imgs/service/service_notice.png", url: "/static/imgs/service/service_notice.png",
name: '设置', name: '设置'
pageUrl: 'serviceNoticeList'
}, },
{ {
key: 6, key: 6,
@ -174,6 +179,9 @@
this.initData(); this.initData();
}, },
methods: { methods: {
handleCloseModal() {
this.showPhoneDialog = false;
},
// //
async initData() { async initData() {
const token = uni.getStorageSync('token'); const token = uni.getStorageSync('token');
@ -198,15 +206,18 @@
// //
updateUserInfo(data) { updateUserInfo(data) {
// IMAGE_BASE_URL
const avatarUrl = data.avatar ? `${IMAGE_BASE_URL}${data.avatar}` : '/static/imgs/index/nav.png';
this.userInfo = { this.userInfo = {
nickName: data.name || data.nickName || '未命名用户', nickName: data.name || data.nickName || '未命名用户',
avatarUrl: data.avatar || data.avatarUrl || '/static/imgs/index/nav.png', avatarUrl: avatarUrl,
bio: data.introduce || data.bio || '这家伙很懒,什么都没有写~', bio: data.introduce || data.bio || '这家伙很懒,什么都没有写~',
phone: data.phone || '' phone: data.phone || ''
}; };
// //
this.displayAvatar = this.userInfo.avatarUrl || '/static/imgs/index/nav.png'; this.displayAvatar = this.userInfo.avatarUrl;
this.formData = { this.formData = {
name: this.userInfo.nickName, name: this.userInfo.nickName,
@ -367,13 +378,14 @@
// //
async loginComplete(data) { async loginComplete(data) {
try { try {
// //
this.showEditModal = false;
const res = await get('/api/v1/app_auth/mine'); const res = await get('/api/v1/app_auth/mine');
if (res && res.success) { if (res && res.success) {
uni.setStorageSync('userInfo', res.data); uni.setStorageSync('userInfo', res.data);
this.updateUserInfo(res.data); this.updateUserInfo(res.data);
this.isLogin = true; this.isLogin = true;
this.showEditModal = false; // this.showEditModal = false;
this.showPhoneButton = false; this.showPhoneButton = false;
uni.showToast({ uni.showToast({
title: '登录成功' title: '登录成功'
@ -414,7 +426,7 @@
}); });
}); });
if (fileInfo.size > 2 * 1024 * 1024) { if (fileInfo.size > 3 * 1024 * 1024) {
throw new Error('图片大小不能超过2MB'); throw new Error('图片大小不能超过2MB');
} }
@ -452,7 +464,7 @@
try { try {
const res = JSON.parse(uploadRes.data); const res = JSON.parse(uploadRes.data);
if (res && res.success) { if (res && res.success) {
resolve(`${IMAGE_BASE_URL}${res.data}`); resolve(res.data);
} else { } else {
reject(new Error(res.message || '上传失败')); reject(new Error(res.message || '上传失败'));
} }
@ -507,7 +519,12 @@
name, name,
bio bio
} = this.formData; } = this.formData;
const avatarUrl = this.avatarList.length > 0 ? this.avatarList[0].url : ""; console.log("====", this.avatarList)
let avatarUrl = this.avatarList.length > 0 ? this.avatarList[0].url : "";
if (avatarUrl && avatarUrl.includes(IMAGE_BASE_URL)) {
avatarUrl = avatarUrl.replace(IMAGE_BASE_URL, '');
}
if (!name) { if (!name) {
uni.showToast({ uni.showToast({
@ -535,12 +552,13 @@
// 3. // 3.
uni.setStorageSync('userInfo', res.data); uni.setStorageSync('userInfo', res.data);
this.updateUserInfo(res.data); this.updateUserInfo(res.data);
this.showEditModal = false;
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '修改成功' title: '修改成功'
}); });
this.showEditModal = false;
} else { } else {
throw new Error(res.message || '获取用户信息失败'); throw new Error(res.message || '获取用户信息失败');
} }
@ -559,10 +577,17 @@
this.showEditModal = false; this.showEditModal = false;
}, },
//
// //
goPage(item) { goPage(item) {
if (item.key === 6) { // if (item.key === 6) { //
this.handleContactCommunity(); this.handleContactCommunity();
return;
}
if (item.key === 5) { //
this.handleEditClick(); //
return; return;
} }
@ -580,12 +605,22 @@
// //
handleContactCommunity() { handleContactCommunity() {
if (!this.checkLogin()) { if (!this.checkLogin()) {
this.showEditModal = true; this.showEditModal = true;
return; return;
} }
this.showPhoneDialog = true; uni.showModal({
title: '联系社区',
content: '是否要拨打社区电话:' + this.communityPhone,
confirmText: '拨打',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
this.callCommunityPhone();
}
}
});
}, },
// //

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,41 @@
<template> <template>
<view class="container"> <view class="container">
<view class="content"> <view class="content">
<!-- 选择区域 -->
<view class="form-item">
<view class="label" @click="showTypeSelect = true" style="margin-bottom: 0;">
<u-icon name="list" color="#3B8CFF" size="38"></u-icon>
选择区域
<view class="select-box">
{{ workOrderArea || '请选择' }}
<u-icon name="arrow-down" color="#999" size="30"></u-icon>
</view>
</view>
<u-picker
:show="showTypeSelect"
:columns="areaList"
keyName="title"
@confirm="handleTypeConfirm"
@cancel="showTypeSelect = false">
</u-picker>
</view>
<!-- 工单分类 -->
<view class="form-item">
<view class="label" @click="showSelect = true" style="margin-bottom: 0;">
<u-icon name="list" color="#3B8CFF" size="38"></u-icon>
工单类型
<view class="select-box">
{{ workOrderCategory || '请选择' }}
<u-icon name="arrow-down" color="#999" size="30"></u-icon>
</view>
</view>
<u-picker :show="showSelect" :columns="categoryList" keyName="label" @confirm="handleConfirm"
@cancel="handleCancel">
</u-picker>
</view>
<view class="form-item"> <view class="form-item">
<view class="label"> <view class="label">
<u-icon name="order" color="#3B8CFF" size="38"></u-icon> <u-icon name="order" color="#3B8CFF" size="38"></u-icon>
@ -44,21 +79,7 @@
<text class="note">照片可识别工单内容支持分批上传但最大数量为8</text> <text class="note">照片可识别工单内容支持分批上传但最大数量为8</text>
</view> </view>
<!-- 工单分类 -->
<view class="form-item">
<view class="label" @click="showSelect = true">
<u-icon name="list" color="#3B8CFF" size="38"></u-icon>
工单类型
<view class="select-box">
{{ workOrderCategory || '请选择' }}
<u-icon name="arrow-down" color="#999" size="30"></u-icon>
</view>
</view>
<u-picker :show="showSelect" :columns="categoryList" keyName="label" @confirm="handleConfirm"
@cancel="handleCancel">
</u-picker>
</view>
<!-- 工单地点 --> <!-- 工单地点 -->
<view class="form-item"> <view class="form-item">
<view class="label"> <view class="label">
@ -99,17 +120,22 @@
fileList: [], fileList: [],
workOrderCategory: '', workOrderCategory: '',
workOrderCategoryID: '', workOrderCategoryID: '',
workOrderArea:'',
workOrderAreaID:'',
showSelect: false, showSelect: false,
showTypeSelect:false,
categoryList: [], categoryList: [],
workOrderLocation: '', workOrderLocation: '',
expectedTime: '', expectedTime: '',
uploadedImages: [], uploadedImages: [],
uploadedVideos: [], uploadedVideos: [],
videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv'] videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv'],
areaList:[],
}; };
}, },
mounted() { mounted() {
this.getOrderList(); this.getOrderList();
this.getOrderTypeList();
}, },
methods: { methods: {
handleBack() { handleBack() {
@ -281,6 +307,7 @@
concatName: this.concatName, // concatName: this.concatName, //
customerPhone: this.customerPhone, // customerPhone: this.customerPhone, //
orderTypeId: this.workOrderCategoryID, orderTypeId: this.workOrderCategoryID,
orderAreaId:this.workOrderAreaID,
address: this.workOrderLocation, address: this.workOrderLocation,
images: this.uploadedImages, images: this.uploadedImages,
videos: this.uploadedVideos, videos: this.uploadedVideos,
@ -323,6 +350,8 @@
this.fileList = []; this.fileList = [];
this.uploadedImages = []; this.uploadedImages = [];
this.uploadedVideos = []; this.uploadedVideos = [];
this.workOrderArea = '';
this.workOrderAreaID = '';
}, },
handleConfirm(e) { handleConfirm(e) {
@ -330,6 +359,12 @@
this.workOrderCategoryID = e.value[0].id; this.workOrderCategoryID = e.value[0].id;
this.showSelect = false; this.showSelect = false;
}, },
handleTypeConfirm(e) {
this.workOrderArea = e.value[0].title;
this.workOrderAreaID = e.value[0].id;
this.showTypeSelect = false;
},
handleCancel() { handleCancel() {
this.showSelect = false; this.showSelect = false;
@ -351,6 +386,24 @@
}); });
} }
}, },
//
async getOrderTypeList(){
try {
const res = await get('/api/v1/apps/work-order-area');
if (res?.success) {
this.areaList = [
[...res.data]
]
}
} catch (err) {
console.error('获取工作区域失败:', err);
uni.showToast({
title: '获取工作区域失败',
icon: 'none'
});
}
}
} }
}; };
</script> </script>

BIN
static/imgs/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B