Merge branch 'main' of https://gitlab.guxuan.icu/Leo_Ding/JinShan_uniapp
@ -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" : "你的位置信息将用于获取周边服务"
|
||||||
|
|||||||
@ -203,13 +203,6 @@
|
|||||||
"usingComponents": {}
|
"usingComponents": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// "path" : "pages/meetingDetail/ceshi/ceshi",
|
|
||||||
// "style" :
|
|
||||||
// {
|
|
||||||
// "navigationBarTitleText" : ""
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
"path": "pages/sign/sign",
|
"path": "pages/sign/sign",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@ -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 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>
|
</view>
|
||||||
|
|
||||||
<view class="info-item">
|
<!-- 活动基本信息 -->
|
||||||
<u-icon name="map" size="24" color="#5b9cf8"></u-icon>
|
<view class="activity-base-info">
|
||||||
<view class="info-text"><text>活动地址:</text>{{activityInfo.address || '待定'}}</view>
|
<view class="title-box">
|
||||||
</view>
|
<text class="title">{{activityInfo.title}}</text>
|
||||||
<view class="info-item">
|
<view class="status-tag active" v-if="activityInfo.status === 2">
|
||||||
<u-icon name="clock" size="24" color="#5b9cf8"></u-icon>
|
{{'未开始'}}
|
||||||
<view class="info-text">{{ activityInfo.openAt }}</view>
|
</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 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="action-bar safe-area-inset-bottom">
|
||||||
<!-- <view class="card-header">
|
<button class="share-btn" open-type="share">
|
||||||
<view class="header-line"></view>
|
<u-icon name="share" size="32" color="#fff"></u-icon>
|
||||||
<text class="header-title">活动详情</text>
|
<text class="share-text">分享</text>
|
||||||
</view> -->
|
</button>
|
||||||
|
<button class="signup-btn" @click="handleSignUp">立即报名</button>
|
||||||
<view class="detail-section">
|
</view>
|
||||||
<view class="section-title">
|
</view>
|
||||||
<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: [],
|
||||||
// '连续参加4次额外奖励100积分',
|
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积分',
|
||||||
// '未成年人需家长陪同参加'
|
// '连续参加4次额外奖励100积分',
|
||||||
// ],
|
// '邀请好友参加每人奖励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() {
|
|
||||||
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) {
|
onLoad(options) {
|
||||||
console.error('获取详情失败:', err);
|
if (options && options.Id) {
|
||||||
}
|
this.Id = options.Id;
|
||||||
},
|
|
||||||
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('获取详情失败');
|
|
||||||
}
|
}
|
||||||
let imgs = res.data.images;
|
},
|
||||||
imgs.forEach(item => {
|
mounted() {
|
||||||
if (!item.startsWith('http') && !item.startsWith('https')) {
|
this.getActivitiesDetail();
|
||||||
item = IMAGE_BASE_URL + item;
|
},
|
||||||
this.bannerImages.push(item);
|
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>
|
</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 {
|
.banner-container {
|
||||||
width: 100%;
|
position: relative;
|
||||||
height: 420rpx;
|
height: 500rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
image {
|
.activity-banner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.activity-base-info {
|
.activity-banner image {
|
||||||
padding: 30rpx;
|
width: 100%;
|
||||||
background-color: #fff;
|
height: 100%;
|
||||||
margin-bottom: 20rpx;
|
display: block;
|
||||||
box-shadow: $shadow;
|
}
|
||||||
|
|
||||||
.title-box {
|
.banner-mask {
|
||||||
display: flex;
|
position: absolute;
|
||||||
align-items: center;
|
bottom: 0;
|
||||||
margin-bottom: 30rpx;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 120rpx;
|
||||||
|
background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.activity-base-info {
|
||||||
font-size: 36rpx;
|
padding: 30rpx;
|
||||||
font-weight: bold;
|
margin: -40rpx 20rpx 20rpx;
|
||||||
color: $text-color;
|
background-color: #fff;
|
||||||
margin-right: 20rpx;
|
border-radius: $border-radius;
|
||||||
}
|
box-shadow: $shadow;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
.status-tag {
|
.title-box {
|
||||||
padding: 6rpx 16rpx;
|
display: flex;
|
||||||
border-radius: 30rpx;
|
align-items: center;
|
||||||
font-size: 24rpx;
|
margin-bottom: 30rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
border-bottom: 1rpx solid rgba($border-color, 0.8);
|
||||||
|
|
||||||
&.active {
|
.title {
|
||||||
background-color: rgba($primary-color, 0.1);
|
flex: 1;
|
||||||
color: $primary-color;
|
font-size: 38rpx;
|
||||||
}
|
font-weight: bold;
|
||||||
}
|
line-height: 1.4;
|
||||||
}
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.info-grid {
|
.status-tag {
|
||||||
display: grid;
|
padding: 8rpx 20rpx;
|
||||||
grid-template-columns: repeat(1, 1fr);
|
border-radius: 30rpx;
|
||||||
gap: 20rpx;
|
font-size: 24rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
.info-item {
|
&.active {
|
||||||
display: flex;
|
background-color: rgba($primary-color, 0.1);
|
||||||
align-items: center;
|
color: $primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.info-text {
|
.info-grid {
|
||||||
font-size: 26rpx;
|
display: grid;
|
||||||
color: $light-text;
|
grid-template-columns: repeat(1, 1fr);
|
||||||
margin-left: 10rpx;
|
gap: 24rpx;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-card, .tips-card {
|
.info-item {
|
||||||
background-color: #fff;
|
display: flex;
|
||||||
border-radius: $border-radius;
|
align-items: center; /* 垂直居中 */
|
||||||
padding: 30rpx;
|
|
||||||
margin: 0 20rpx 20rpx;
|
|
||||||
box-shadow: $shadow;
|
|
||||||
|
|
||||||
.card-header {
|
&.highlight {
|
||||||
display: flex;
|
background-color: #fff8e6;
|
||||||
align-items: center;
|
padding: 16rpx;
|
||||||
margin-bottom: 30rpx;
|
border-radius: 12rpx;
|
||||||
|
margin:0rpx -16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.header-line {
|
.u-icon {
|
||||||
width: 6rpx;
|
flex-shrink: 0; /* 防止图标被压缩 */
|
||||||
height: 32rpx;
|
}
|
||||||
background-color: $primary-color;
|
|
||||||
border-radius: 4rpx;
|
|
||||||
margin-right: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-title {
|
.info-text {
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
line-height: 1.5;
|
||||||
color: $text-color;
|
margin-left: 12rpx;
|
||||||
}
|
display: flex;
|
||||||
}
|
align-items: center; /* 确保内部文本垂直居中 */
|
||||||
|
|
||||||
.detail-section {
|
.info-label {
|
||||||
margin-bottom: 40rpx;
|
color: #999;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child {
|
.detail-card {
|
||||||
margin-bottom: 0;
|
background-color: #fff;
|
||||||
}
|
border-radius: $border-radius;
|
||||||
|
padding: 30rpx;
|
||||||
|
margin: 0 20rpx 20rpx;
|
||||||
|
box-shadow: $shadow;
|
||||||
|
|
||||||
.section-title {
|
.detail-section {
|
||||||
display: flex;
|
margin-bottom: 40rpx;
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.title-icon {
|
.section-title {
|
||||||
width: 8rpx;
|
display: flex;
|
||||||
height: 28rpx;
|
align-items: center;
|
||||||
background-color: $primary-color;
|
margin-bottom: 24rpx;
|
||||||
border-radius: 4rpx;
|
padding-bottom: 16rpx;
|
||||||
margin-right: 12rpx;
|
border-bottom: 1rpx solid rgba($border-color, 0.5);
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
.title-icon {
|
||||||
font-size: 30rpx;
|
width: 8rpx;
|
||||||
font-weight: bold;
|
height: 32rpx;
|
||||||
color: $text-color;
|
background-color: $primary-color;
|
||||||
}
|
border-radius: 4rpx;
|
||||||
}
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.section-content {
|
text {
|
||||||
font-size: 28rpx;
|
font-size: 32rpx;
|
||||||
color: $light-text;
|
font-weight: bold;
|
||||||
line-height: 1.6;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.route-map {
|
.section-content {
|
||||||
width: 100%;
|
font-size: 30rpx;
|
||||||
margin-top: 20rpx;
|
line-height: 1.8;
|
||||||
border-radius: $border-radius;
|
color: $light-text;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeline {
|
&.rich-text {
|
||||||
position: relative;
|
p {
|
||||||
padding-left: 40rpx;
|
margin-bottom: 24rpx;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
&::before {
|
img {
|
||||||
content: '';
|
max-width: 100%;
|
||||||
position: absolute;
|
border-radius: 8rpx;
|
||||||
left: 15rpx;
|
margin: 20rpx 0;
|
||||||
top: 10rpx;
|
}
|
||||||
bottom: 10rpx;
|
}
|
||||||
width: 2rpx;
|
|
||||||
background-color: $border-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeline-item {
|
.route-map {
|
||||||
position: relative;
|
width: 100%;
|
||||||
padding-bottom: 30rpx;
|
margin-top: 30rpx;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child {
|
.action-bar {
|
||||||
padding-bottom: 0;
|
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 {
|
// &.safe-area-inset-bottom {
|
||||||
position: absolute;
|
// padding-bottom: env(safe-area-inset-bottom);
|
||||||
left: -40rpx;
|
// }
|
||||||
top: 4rpx;
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
&::after {
|
.share-btn {
|
||||||
content: '';
|
display: flex;
|
||||||
width: 10rpx;
|
align-items: center;
|
||||||
height: 10rpx;
|
justify-content: center;
|
||||||
background-color: #fff;
|
width: 160rpx;
|
||||||
border-radius: 50%;
|
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 {
|
.share-text {
|
||||||
.timeline-time {
|
margin-left: 10rpx;
|
||||||
display: block;
|
}
|
||||||
font-size: 26rpx;
|
|
||||||
color: $primary-color;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeline-desc {
|
&:active {
|
||||||
font-size: 28rpx;
|
transform: scale(0.98);
|
||||||
color: $light-text;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.point-rules {
|
.share-btn::after {
|
||||||
.rule-item {
|
border: none;
|
||||||
display: flex;
|
}
|
||||||
align-items: flex-start;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
&:last-child {
|
.signup-btn {
|
||||||
margin-bottom: 0;
|
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 {
|
&::after {
|
||||||
width: 36rpx;
|
border: none;
|
||||||
height: 36rpx;
|
}
|
||||||
background-color: $primary-color;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-right: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
text {
|
&:active {
|
||||||
color: #fff;
|
transform: scale(0.98);
|
||||||
font-size: 22rpx;
|
opacity: 0.9;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.rule-text {
|
@media (min-width: 768px) {
|
||||||
font-size: 28rpx;
|
.activity-detail-container {
|
||||||
color: $light-text;
|
max-width: 750px;
|
||||||
line-height: 1.5;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@ -1,180 +1,216 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view class="aiHelper">
|
||||||
|
<view class="aiHelperContainer">
|
||||||
|
<!-- 标题区域 -->
|
||||||
|
<view class="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">
|
||||||
|
{{ aiHelperTitle }}
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="aiHelper">
|
<!-- AI类型卡片容器 -->
|
||||||
|
<view class="aiBox">
|
||||||
<view class="aiHelperContainer">
|
<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="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">{{aiHelperTitle}}</view>
|
<view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}">
|
||||||
<view class="aiBox">
|
<view class="aiLeftTitle">{{ item.name }}</view>
|
||||||
<view class="aiType" v-for="(item,index) in aiType" :key="item.id" @click="goAiType(item)">
|
</view>
|
||||||
<view class="aiTypeContainer" :style="{'background-image': `url(${item.background})`}">
|
<view class="aiRight">
|
||||||
<view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}">
|
<view class="aiRightTitle"><text>{{ item.description }}</text></view>
|
||||||
<view class="aiLeftTitle">{{item.name}}</view>
|
<view class="aiDescription"><text>开始对话></text></view>
|
||||||
</view>
|
</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><Footer></Footer></view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
<view><Footer></Footer></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%;
|
|
||||||
padding-bottom: 50%;
|
|
||||||
|
|
||||||
.aiHelperTitle {
|
.aiHelper {
|
||||||
font-size: 1rem;
|
// 使用安全区域适配,避免底部被遮挡
|
||||||
font-weight: 600;
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
letter-spacing: 0;
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
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%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aiBox {
|
.aiHelperContainer {
|
||||||
.aiType {
|
padding: 30rpx; // 使用rpx单位适配不同屏幕
|
||||||
margin-bottom: 3%;
|
box-sizing: border-box; // 确保padding不会增加总宽度
|
||||||
width: 100%;
|
|
||||||
height: 310rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.aiTypeContainer {
|
.aiHelperTitle {
|
||||||
display: flex;
|
font-size: 36rpx;
|
||||||
margin: 1%;
|
font-weight: 600;
|
||||||
border-radius: 0.5rem;
|
color: #000;
|
||||||
background-size: cover;
|
text-align: center;
|
||||||
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.25);
|
// padding: 20rpx 0 30rpx; // 增加底部内边距
|
||||||
background-position: 30% 50%;
|
background-repeat: no-repeat;
|
||||||
background-repeat: no-repeat;
|
background-position: 50% 80%;
|
||||||
width: 96%;
|
background-size: 30%;
|
||||||
aspect-ratio: 2.1/1;
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
.aiLeft {
|
.aiBox {
|
||||||
border-radius: 0.5rem;
|
// 增加容器内边距,避免卡片贴边
|
||||||
padding: 5% 0;
|
padding: 10rpx 0;
|
||||||
margin-right: 12%;
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
width: 35%;
|
|
||||||
// height: 100%;
|
|
||||||
/* margin-left: -5%;*/
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.aiLeftTitle {
|
.aiType {
|
||||||
font-size: 0.8rem;
|
// 关键优化:使用固定间距代替百分比,确保不同设备一致
|
||||||
font-weight: 900;
|
margin-bottom: 30rpx;
|
||||||
letter-spacing: 0;
|
width: 100%;
|
||||||
line-height: 1.4;
|
display: flex;
|
||||||
color: rgba(255, 255, 255, 1);
|
justify-content: center;
|
||||||
text-align: left;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10%;
|
|
||||||
left: 10%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.aiRight {
|
.aiTypeContainer {
|
||||||
flex: 1;
|
display: flex;
|
||||||
display: flex;
|
border-radius: 20rpx; // 更大的圆角更美观
|
||||||
flex-direction: column;
|
background-size: cover;
|
||||||
justify-content: normal;
|
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 {
|
.aiLeft {
|
||||||
font-size: 0.8rem;
|
border-radius: 16rpx;
|
||||||
font-weight: 700;
|
padding: 5% 0;
|
||||||
letter-spacing: 0;
|
margin-right: 12%;
|
||||||
line-height: 1.4;
|
background-size: cover;
|
||||||
color: rgba(0, 0, 0, 1);
|
background-position: center;
|
||||||
text-align: left;
|
background-repeat: no-repeat;
|
||||||
margin-bottom: 5%;
|
width: 35%;
|
||||||
margin-top: 22%;
|
position: relative;
|
||||||
}
|
// 增加内边距,避免内容贴边
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
.aiDescription {
|
.aiLeftTitle {
|
||||||
font-size: 26rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 700;
|
font-weight: 900;
|
||||||
letter-spacing: 0;
|
color: #fff;
|
||||||
line-height: 2.5;
|
text-align: left;
|
||||||
color: #999;
|
position: absolute;
|
||||||
text-align: right;
|
bottom: 20rpx;
|
||||||
width: 90%;
|
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>
|
</style>
|
||||||
@ -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,
|
||||||
@ -368,12 +379,13 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,11 +606,21 @@
|
|||||||
// 处理联系社区点击
|
// 处理联系社区点击
|
||||||
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 拨打社区电话
|
// 拨打社区电话
|
||||||
|
|||||||
@ -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,20 +79,6 @@
|
|||||||
<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">
|
||||||
@ -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) {
|
||||||
@ -331,6 +360,12 @@
|
|||||||
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
BIN
static/imgs/ai/.DS_Store
vendored
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 822 B |
|
Before Width: | Height: | Size: 559 B |
|
Before Width: | Height: | Size: 703 B |
|
Before Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 736 B |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 647 B |
|
Before Width: | Height: | Size: 746 B |