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,
"requiredPrivateInfos": ["getLocation"],
"optimization" : {
"minify": {
"js": true,
"css": true
}
},
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于获取周边服务"

View File

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

View File

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

View File

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

View File

@ -85,12 +85,18 @@
</view>
</u-modal>
<u-modal :show="showPhoneDialog" title="联系社区" confirm-text="拨打" cancel-text="取消" @confirm="callCommunityPhone"
@cancel="showPhoneDialog = false">
<view class="phone-dialog-content">
<text>社区电话</text>
<text class="phone-number">{{communityPhone}}</text>
</view>
<u-modal
:show="showPhoneDialog"
title="联系社区"
confirm-text="拨打"
cancel-text="取消"
@confirm="callCommunityPhone"
@cancel="showPhoneDialog = false"
:closeOnClickOverlay="true">
<view class="phone-dialog-content">
<text>社区电话</text>
<text class="phone-number">{{communityPhone}}</text>
</view>
</u-modal>
<Footer></Footer>
@ -157,8 +163,7 @@
{
key: 5,
url: "/static/imgs/service/service_notice.png",
name: '设置',
pageUrl: 'serviceNoticeList'
name: '设置'
},
{
key: 6,
@ -174,6 +179,9 @@
this.initData();
},
methods: {
handleCloseModal() {
this.showPhoneDialog = false;
},
//
async initData() {
const token = uni.getStorageSync('token');
@ -198,15 +206,18 @@
//
updateUserInfo(data) {
// IMAGE_BASE_URL
const avatarUrl = data.avatar ? `${IMAGE_BASE_URL}${data.avatar}` : '/static/imgs/index/nav.png';
this.userInfo = {
nickName: data.name || data.nickName || '未命名用户',
avatarUrl: data.avatar || data.avatarUrl || '/static/imgs/index/nav.png',
avatarUrl: avatarUrl,
bio: data.introduce || data.bio || '这家伙很懒,什么都没有写~',
phone: data.phone || ''
};
//
this.displayAvatar = this.userInfo.avatarUrl || '/static/imgs/index/nav.png';
this.displayAvatar = this.userInfo.avatarUrl;
this.formData = {
name: this.userInfo.nickName,
@ -368,12 +379,13 @@
async loginComplete(data) {
try {
//
this.showEditModal = false;
const res = await get('/api/v1/app_auth/mine');
if (res && res.success) {
uni.setStorageSync('userInfo', res.data);
this.updateUserInfo(res.data);
this.isLogin = true;
this.showEditModal = false;
// this.showEditModal = false;
this.showPhoneButton = false;
uni.showToast({
title: '登录成功'
@ -414,7 +426,7 @@
});
});
if (fileInfo.size > 2 * 1024 * 1024) {
if (fileInfo.size > 3 * 1024 * 1024) {
throw new Error('图片大小不能超过2MB');
}
@ -452,7 +464,7 @@
try {
const res = JSON.parse(uploadRes.data);
if (res && res.success) {
resolve(`${IMAGE_BASE_URL}${res.data}`);
resolve(res.data);
} else {
reject(new Error(res.message || '上传失败'));
}
@ -507,7 +519,12 @@
name,
bio
} = 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) {
uni.showToast({
@ -535,12 +552,13 @@
// 3.
uni.setStorageSync('userInfo', res.data);
this.updateUserInfo(res.data);
this.showEditModal = false;
uni.hideLoading();
uni.showToast({
title: '修改成功'
});
this.showEditModal = false;
} else {
throw new Error(res.message || '获取用户信息失败');
}
@ -559,10 +577,17 @@
this.showEditModal = false;
},
//
//
goPage(item) {
if (item.key === 6) { //
this.handleContactCommunity();
return;
}
if (item.key === 5) { //
this.handleEditClick(); //
return;
}
@ -581,11 +606,21 @@
//
handleContactCommunity() {
if (!this.checkLogin()) {
this.showEditModal = true;
return;
}
this.showEditModal = true;
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>
<view class="container">
<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="label">
<u-icon name="order" color="#3B8CFF" size="38"></u-icon>
@ -44,20 +79,6 @@
<text class="note">照片可识别工单内容支持分批上传但最大数量为8</text>
</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">
@ -99,17 +120,22 @@
fileList: [],
workOrderCategory: '',
workOrderCategoryID: '',
workOrderArea:'',
workOrderAreaID:'',
showSelect: false,
showTypeSelect:false,
categoryList: [],
workOrderLocation: '',
expectedTime: '',
uploadedImages: [],
uploadedVideos: [],
videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv']
videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv'],
areaList:[],
};
},
mounted() {
this.getOrderList();
this.getOrderTypeList();
},
methods: {
handleBack() {
@ -281,6 +307,7 @@
concatName: this.concatName, //
customerPhone: this.customerPhone, //
orderTypeId: this.workOrderCategoryID,
orderAreaId:this.workOrderAreaID,
address: this.workOrderLocation,
images: this.uploadedImages,
videos: this.uploadedVideos,
@ -323,6 +350,8 @@
this.fileList = [];
this.uploadedImages = [];
this.uploadedVideos = [];
this.workOrderArea = '';
this.workOrderAreaID = '';
},
handleConfirm(e) {
@ -331,6 +360,12 @@
this.showSelect = false;
},
handleTypeConfirm(e) {
this.workOrderArea = e.value[0].title;
this.workOrderAreaID = e.value[0].id;
this.showTypeSelect = false;
},
handleCancel() {
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>

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