修改AI助手

This commit is contained in:
Leo_Ding 2025-07-22 16:36:38 +08:00
parent 87badbbb68
commit 48a294084b
26 changed files with 156 additions and 152 deletions

View File

@ -56,15 +56,15 @@
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/myTicketsDetail/index", "path": "pages/myTicketsDetail/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
@ -122,15 +122,15 @@
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/mySeekHelpDetail/index", "path": "pages/mySeekHelpDetail/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// - // -
{ {
@ -149,60 +149,60 @@
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/aroundList/index", "path": "pages/aroundList/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/aroundDetail/index", "path": "pages/aroundDetail/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/meetingList/index", "path": "pages/meetingList/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/meetingDetail/index", "path": "pages/meetingDetail/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
// //
{ {
"path": "pages/activeList/index", "path": "pages/activeList/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
}, },
{ {
"path": "pages/activeDetail/index", "path": "pages/activeDetail/index",
"style": { "style": {
"navigationBarTitleText": "近山社区", "navigationBarTitleText": "近山社区",
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": {} "usingComponents": {}
} }
} }
], ],
"globalStyle": { "globalStyle": {
@ -212,11 +212,10 @@
}, },
"uniIdRouter": {}, "uniIdRouter": {},
"usingComponents": { "usingComponents": {
"u-modal": "/node_modules/uview-ui/components/u-modal/u-modal.vue", "u-modal": "/node_modules/uview-ui/components/u-modal/u-modal.vue",
"u-icon": "/node_modules/uview-ui/components/u-icon/u-icon.vue", "u-icon": "/node_modules/uview-ui/components/u-icon/u-icon.vue",
"u-tabs": "/node_modules/uview-ui/components/u-tabs/u-tabs.vue", "u-tabs": "/node_modules/uview-ui/components/u-tabs/u-tabs.vue",
"u-tag": "/node_modules/uview-ui/components/u-tag/u-tag.vue", "u-tag": "/node_modules/uview-ui/components/u-tag/u-tag.vue",
"u-empty": "/node_modules/uview-ui/components/u-empty/u-empty.vue" "u-empty": "/node_modules/uview-ui/components/u-empty/u-empty.vue"
// //
// "bottom-nav": "/components/footer_common.vue", // "bottom-nav": "/components/footer_common.vue",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -137,10 +137,15 @@ __webpack_require__.r(__webpack_exports__);
"use strict"; "use strict";
/* WEBPACK VAR INJECTION */(function(uni) { /* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.default = void 0; exports.default = void 0;
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 55));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 57));
var _request = __webpack_require__(/*! @/utils/request */ 165);
var _config = __webpack_require__(/*! @/utils/config */ 166);
var Footer = function Footer() { var Footer = function Footer() {
__webpack_require__.e(/*! require.ensure | components/footer_common */ "components/footer_common").then((function () { __webpack_require__.e(/*! require.ensure | components/footer_common */ "components/footer_common").then((function () {
return resolve(__webpack_require__(/*! @/components/footer_common.vue */ 348)); return resolve(__webpack_require__(/*! @/components/footer_common.vue */ 348));
@ -155,62 +160,62 @@ var _default = {
return { return {
aiHelperTitle: 'AI智能助手', aiHelperTitle: 'AI智能助手',
aiHelperTitleBackground: '../../static/imgs/ai/title.png', aiHelperTitleBackground: '../../static/imgs/ai/title.png',
aiType: [ aiType: []
// {
// id:1,
// name:'政策解读',
// path:'policy',
// description:['您好,','我是政策解读助手!'].join('\n'),
// // text:'致力于将复杂的政策文件转化为通俗易懂的信息。我会结合政策背景、核心条款和实际案例,为您提供清晰、中立的解读,帮助您快速抓住重点,规避风险,把握机遇。',
// imgPath:'../../static/imgs/ai/zhengceijiedu.png',
// background:'../../static/imgs/ai/zhengceijiedu-background.png',
// serverUrl:''
// },
{
id: 2,
name: '膳食管家',
path: 'diet',
description: ['您好,', '我是你的膳食管家!'].join('\n'),
// text:['近来处于换季期,结合润燥、增强免疫力和营养均衡的原则,帮助身体适应气候变化,以下是我为您推荐的食谱:',
// '🌟早餐推荐(温暖脾胃,补充能量)',
// '1、南瓜小米红枣粥',
// '搭配:水煮蛋 + 凉拌菠菜......'].join('\n'),
imgPath: '../../static/imgs/ai/shanshiguanjia.png',
background: '../../static/imgs/ai/shanshiguanjia-background.png',
serverUrl: 'http://36.212.197.253:81/v1/chat-messages',
apiKey: 'app-GPvdbxhckU9MBbc2c0FOYSJC'
}, {
id: 3,
name: '穿搭顾问',
path: 'outfits',
description: ['您好,', '我是你的穿搭顾问!'].join('\n'),
// text:['🌤️ 今日天气穿搭指南 🌡️',
// '根据实时气象数据为您定制穿衣方案,助您舒适应对天气变化!',
// '通用公式',
// '气温+降水+风力 = 基础穿搭',
// '活动场景±体感偏好 = 细节调整......'].join('\n'),
imgPath: '../../static/imgs/ai/chuandaguwen.png',
background: '../../static/imgs/ai/chuandaguwen-background.png',
serverUrl: 'http://36.212.197.253:81/v1/workflows/run',
apiKey: 'app-fHYFvXZz1MUGLPEoK4lx8qWz'
}, {
id: 4,
name: '生活咨询',
path: 'lifeCounseling',
description: ['您好,', '我是你的生活小助手!'].join('\n'),
// text:'需要帮孩子制定假期计划?或是突然遇到水管漏水?随时告诉我,立刻为你支招!',
imgPath: '../../static/imgs/ai/shenghuozixun.png',
background: '../../static/imgs/ai/shenghuozixun-background.png',
serverUrl: 'http://36.212.197.253:81/v1/chat-messages',
apiKey: 'app-7BhHLjrLWenhsnFk1g4rW9F9'
}]
}; };
}, },
mounted: function mounted() {
this.getData();
},
methods: { methods: {
goAiType: function goAiType(item) { goAiType: function goAiType(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/chat/chatPage?serverUrl=".concat(item.serverUrl, "&apiKey=").concat(item.apiKey, "&id=").concat(item.id, "&name=").concat(item.name) url: "/pages/chat/chatPage?serviceUrl=".concat(item.serviceUrl, "&apiKey=").concat(item.apiKey, "&id=").concat(item.id, "&name=").concat(item.name, "&icon=").concat(item.icon)
}); });
},
getData: function getData() {
var _this = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
var params, res;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
params = {
current: 1,
pageSize: 10
};
_context.prev = 1;
_context.next = 4;
return (0, _request.get)('/api/v1/apps/ai_request', params);
case 4:
res = _context.sent;
if (!(!res || !res.success)) {
_context.next = 7;
break;
}
throw new Error('获取AI助手失败');
case 7:
if (res.data.length > 0) {
res.data.forEach(function (item) {
item.background = _config.IMAGE_BASE_URL + item.background;
item.imagePath = _config.IMAGE_BASE_URL + item.imagePath;
item.icon = _config.IMAGE_BASE_URL + item.icon;
});
}
_this.aiType = res.data;
_context.next = 14;
break;
case 11:
_context.prev = 11;
_context.t0 = _context["catch"](1);
console.error('获取AI助手失败:', _context.t0);
case 14:
case "end":
return _context.stop();
}
}
}, _callee, null, [[1, 11]]);
}))();
} }
} }
}; };

View File

@ -1 +1 @@
<view class="aiHelper data-v-3fea99d8"><view class="aiHelperContainer data-v-3fea99d8"><view class="aiHelperTitle data-v-3fea99d8" style="{{'background-image:'+('url('+aiHelperTitleBackground+')')+';'}}">{{aiHelperTitle}}</view><view class="aiBox data-v-3fea99d8"><block wx:for="{{aiType}}" wx:for-item="item" wx:for-index="index" wx:key="id"><view data-event-opts="{{[['tap',[['goAiType',['$0'],[[['aiType','id',item.id]]]]]]]}}" class="aiType data-v-3fea99d8" bindtap="__e"><view class="aiTypeContainer data-v-3fea99d8" style="{{'background-image:'+('url('+item.background+')')+';'}}"><view class="aiLeft data-v-3fea99d8" style="{{'background-image:'+('url('+item.imgPath+')')+';'}}"><view class="aiLeftTitle data-v-3fea99d8">{{item.name}}</view></view><view class="aiRight data-v-3fea99d8"><view class="aiRightTitle data-v-3fea99d8"><text class="data-v-3fea99d8">{{item.description}}</text></view><view class="aiDescription data-v-3fea99d8"><text class="data-v-3fea99d8">开始对话></text></view></view></view></view></block></view></view><view class="data-v-3fea99d8"><footer vue-id="214c3072-1" class="data-v-3fea99d8" bind:__l="__l"></footer></view></view> <view class="aiHelper data-v-3fea99d8"><view class="aiHelperContainer data-v-3fea99d8"><view class="aiHelperTitle data-v-3fea99d8" style="{{'background-image:'+('url('+aiHelperTitleBackground+')')+';'}}">{{aiHelperTitle}}</view><view class="aiBox data-v-3fea99d8"><block wx:for="{{aiType}}" wx:for-item="item" wx:for-index="index" wx:key="id"><view data-event-opts="{{[['tap',[['goAiType',['$0'],[[['aiType','id',item.id]]]]]]]}}" class="aiType data-v-3fea99d8" bindtap="__e"><view class="aiTypeContainer data-v-3fea99d8" style="{{'background-image:'+('url('+item.background+')')+';'}}"><view class="aiLeft data-v-3fea99d8" style="{{'background-image:'+('url('+item.imagePath+')')+';'}}"><view class="aiLeftTitle data-v-3fea99d8">{{item.name}}</view></view><view class="aiRight data-v-3fea99d8"><view class="aiRightTitle data-v-3fea99d8"><text class="data-v-3fea99d8">{{item.description}}</text></view><view class="aiDescription data-v-3fea99d8"><text class="data-v-3fea99d8">开始对话></text></view></view></view></view></block></view></view><view class="data-v-3fea99d8"><footer vue-id="214c3072-1" class="data-v-3fea99d8" bind:__l="__l"></footer></view></view>