Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
yma16_miniprogram
提交
fe15b014
Y
yma16_miniprogram
项目概览
yma16
/
yma16_miniprogram
通知
11
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yma16_miniprogram
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fe15b014
编写于
4月 03, 2024
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: aibot
上级
33851d29
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
44 addition
and
15 deletion
+44
-15
miniprogram/app.js
miniprogram/app.js
+11
-1
miniprogram/pages/aiBot/aiBot.js
miniprogram/pages/aiBot/aiBot.js
+23
-6
miniprogram/pages/aiBot/aiBot.wxml
miniprogram/pages/aiBot/aiBot.wxml
+1
-1
miniprogram/pages/index/index.js
miniprogram/pages/index/index.js
+4
-0
miniprogram/pages/index/index.wxml
miniprogram/pages/index/index.wxml
+3
-5
miniprogram/pages/index/index.wxss
miniprogram/pages/index/index.wxss
+2
-2
未找到文件。
miniprogram/app.js
浏览文件 @
fe15b014
...
@@ -4,6 +4,10 @@ App({
...
@@ -4,6 +4,10 @@ App({
homePageArticleId
:
32
,
homePageArticleId
:
32
,
lifePageArricleId
:
35
,
lifePageArricleId
:
35
,
wxProgramConfig
:
{
wxProgramConfig
:
{
"
aiBotConfig
"
:{
"
saveKey
"
:
"
aiBot
"
,
"
searchOpenAiText
"
:
"
画一只猫
"
,
},
authorPageConfig
:
{
authorPageConfig
:
{
cloudEmail
:
"
1575057249@qq.com
"
,
cloudEmail
:
"
1575057249@qq.com
"
,
cloudPwd
:
"
U2FsdGVkX1+jfEkF2OXTQ5iIG4mrYc5/TLOiIntyENU=
"
,
cloudPwd
:
"
U2FsdGVkX1+jfEkF2OXTQ5iIG4mrYc5/TLOiIntyENU=
"
,
...
@@ -12,12 +16,16 @@ App({
...
@@ -12,12 +16,16 @@ App({
loginTitle
:
'
点击授权
'
,
loginTitle
:
'
点击授权
'
,
detailInfo
:
'
关于:code笔记
'
,
detailInfo
:
'
关于:code笔记
'
,
nextPage
:
"
/pages/home/home
"
,
nextPage
:
"
/pages/home/home
"
,
basePage
:
"
/pages/home/home
"
,
userPrefix
:
'
昵称:
'
,
userPrefix
:
'
昵称:
'
,
userName
:
'
月牙天冲
'
,
userName
:
'
月牙天冲
'
,
designPlaceholder
:
'
自定义名称
'
,
designPlaceholder
:
'
自定义名称
'
,
joinTitle
:
'
微信登录
'
,
joinTitle
:
'
微信登录
'
,
shopBtnTitle
:
'
虚拟资产
'
,
shopBtnTitle
:
'
虚拟资产
'
,
isOldVersion
:
false
isOldVersion
:
false
,
"
isShowBottom
"
:
true
,
"
isShowBot
"
:
true
,
"
isShowShop
"
:
true
,
},
},
homePageConfig
:
{
homePageConfig
:
{
headBackground
:
[
headBackground
:
[
...
@@ -171,6 +179,8 @@ App({
...
@@ -171,6 +179,8 @@ App({
})
})
if
(
res
.
data
.
data
&&
res
.
data
.
data
[
0
].
option
)
{
if
(
res
.
data
.
data
&&
res
.
data
.
data
[
0
].
option
)
{
that
.
wxProgramConfig
=
JSON
.
parse
(
res
.
data
.
data
[
0
].
option
)
that
.
wxProgramConfig
=
JSON
.
parse
(
res
.
data
.
data
[
0
].
option
)
console
.
log
(
'
that.wxProgramConfig
'
,
that
.
wxProgramConfig
)
that
.
basePage
=
that
.
wxProgramConfig
.
authorPageConfig
.
basePage
||
that
.
basePage
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
that
.
basePage
,
url
:
that
.
basePage
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
...
miniprogram/pages/aiBot/aiBot.js
浏览文件 @
fe15b014
...
@@ -13,8 +13,8 @@ Page({
...
@@ -13,8 +13,8 @@ Page({
},
},
saveKey
:
'
aiBot
'
,
saveKey
:
'
aiBot
'
,
baseCloudUrl
:
app
.
remoteConfig
.
baseCloudUrl
,
baseCloudUrl
:
app
.
remoteConfig
.
baseCloudUrl
,
password
:
app
.
remoteConfig
.
cloudPwd
||
"
U2FsdGVkX1+jfEkF2OXTQ5iIG4mrYc5/TLOiIntyENU=
"
,
password
:
"
U2FsdGVkX1+jfEkF2OXTQ5iIG4mrYc5/TLOiIntyENU=
"
,
username
:
app
.
remoteConfig
.
cloudEmail
||
"
1575057249@qq.com
"
,
username
:
"
1575057249@qq.com
"
,
token
:
''
,
token
:
''
,
currenTime
:
''
,
currenTime
:
''
,
isLoading
:
false
,
isLoading
:
false
,
...
@@ -44,7 +44,7 @@ Page({
...
@@ -44,7 +44,7 @@ Page({
pasteText
:
'
粘贴
'
,
pasteText
:
'
粘贴
'
,
upText
:
"
↑
"
,
upText
:
"
↑
"
,
downText
:
"
↓
"
,
downText
:
"
↓
"
,
errorMsg
:
'
openai的
服务器异常!
'
,
errorMsg
:
'
bot ai
服务器异常!
'
,
emptyText
:
'
欢迎使用aibot
'
,
emptyText
:
'
欢迎使用aibot
'
,
storageKey
:
'
openAiOptionsConfig
'
,
storageKey
:
'
openAiOptionsConfig
'
,
permissionTitle
:
'
很抱歉您没有权限!
'
,
permissionTitle
:
'
很抱歉您没有权限!
'
,
...
@@ -112,6 +112,13 @@ Page({
...
@@ -112,6 +112,13 @@ Page({
search
(
e
)
{
search
(
e
)
{
this
.
scrollToBottom
()
this
.
scrollToBottom
()
if
(
this
.
data
.
isLoading
){
wx
.
showModal
({
cancelColor
:
'
cancelColor
'
,
title
:
'
正在响应中,请稍等...
'
})
return
}
if
(
!
this
.
data
.
searchOpenAiText
)
{
if
(
!
this
.
data
.
searchOpenAiText
)
{
wx
.
showModal
({
wx
.
showModal
({
cancelColor
:
'
cancelColor
'
,
cancelColor
:
'
cancelColor
'
,
...
@@ -143,8 +150,8 @@ Page({
...
@@ -143,8 +150,8 @@ Page({
const
data
=
res
.
data
.
data
const
data
=
res
.
data
.
data
const
option
=
that
.
data
.
chatObjConfig
.
option
const
option
=
that
.
data
.
chatObjConfig
.
option
console
.
log
(
'
data
'
,
data
)
console
.
log
(
'
data
'
,
data
)
const
choices
=
data
.
messages
[
2
]
const
choices
=
data
.
messages
?.
[
2
]
const
answer
=
choices
?.
content
const
answer
=
choices
?.
content
||
that
.
data
.
layoutConfig
.
errorMsg
option
.
push
({
option
.
push
({
question
:
that
.
data
.
searchOpenAiText
,
question
:
that
.
data
.
searchOpenAiText
,
answer
:
answer
,
answer
:
answer
,
...
@@ -181,6 +188,16 @@ Page({
...
@@ -181,6 +188,16 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
const
aiBotConfig
=
app
.
wxProgramConfig
.
aiBotConfig
console
.
log
(
'
aiBotConfig
'
,
aiBotConfig
)
this
.
setData
({
saveKey
:
aiBotConfig
.
saveKey
,
searchOpenAiText
:
aiBotConfig
.
searchOpenAiText
,
password
:
aiBotConfig
.
cloudPwd
||
"
U2FsdGVkX1+jfEkF2OXTQ5iIG4mrYc5/TLOiIntyENU=
"
,
username
:
aiBotConfig
.
cloudEmail
||
"
1575057249@qq.com
"
,
})
this
.
getUserToken
()
this
.
getUserToken
()
this
.
setData
({
this
.
setData
({
currenTime
:
this
.
getCurrentTime
()
currenTime
:
this
.
getCurrentTime
()
...
@@ -233,7 +250,7 @@ Page({
...
@@ -233,7 +250,7 @@ Page({
// 缓存
// 缓存
if
(
this
.
data
.
openAiOptionsConfig
)
{
if
(
this
.
data
.
openAiOptionsConfig
)
{
wx
.
setStorageSync
(
this
.
data
.
saveKey
,
this
.
data
.
openAiOptionsConfig
)
wx
.
setStorageSync
(
app
.
wxProgramConfig
.
aiBotConfig
.
saveKey
,
this
.
data
.
openAiOptionsConfig
)
}
}
},
},
...
...
miniprogram/pages/aiBot/aiBot.wxml
浏览文件 @
fe15b014
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
<view class='submit-input'>
<view class='submit-input'>
<textarea class='send-input' bindinput="bindKeyInput" placeholder="{{layoutConfig.searchText}}" bindconfirm="search" value="{{searchOpenAiText}}" disabled="{{isLoading||isTruth}}" />
<textarea class='send-input' bindinput="bindKeyInput" placeholder="{{layoutConfig.searchText}}" bindconfirm="search" value="{{searchOpenAiText}}" disabled="{{isLoading||isTruth}}" />
</view>
</view>
<view class='send-btn' type="primary" bindtap="search" loading="{{isLoading}}">{{layoutConfig.sendText}}</view>
<view class='send-btn' type="primary" bindtap="search" loading="{{isLoading}}"
disabled="{{isLoading}}"
>{{layoutConfig.sendText}}</view>
</view>
</view>
</view>
</view>
...
...
miniprogram/pages/index/index.js
浏览文件 @
fe15b014
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
const
app
=
getApp
()
const
app
=
getApp
()
Page
({
Page
({
data
:
{
data
:
{
isShowBot
:
true
,
isShowShop
:
true
,
baseUrl
:
app
.
remoteConfig
.
baseUrl
,
baseUrl
:
app
.
remoteConfig
.
baseUrl
,
baseCloudUrl
:
app
.
remoteConfig
.
baseCloudUrl
,
baseCloudUrl
:
app
.
remoteConfig
.
baseCloudUrl
,
baseLoginCloudPath
:
'
userModel/register
'
,
baseLoginCloudPath
:
'
userModel/register
'
,
...
@@ -262,6 +264,8 @@ Page({
...
@@ -262,6 +264,8 @@ Page({
joinTitle
:
authorPageConfig
.
joinTitle
,
joinTitle
:
authorPageConfig
.
joinTitle
,
shopBtnTitle
:
authorPageConfig
.
shopBtnTitle
,
shopBtnTitle
:
authorPageConfig
.
shopBtnTitle
,
isShowBottom
:
authorPageConfig
.
isShowBottom
,
isShowBottom
:
authorPageConfig
.
isShowBottom
,
isShowBot
:
authorPageConfig
.
isShowBot
,
isShowShop
:
authorPageConfig
.
isShowShop
,
loginErrorTitle
:
authorPageConfig
.
loginErrorTitle
,
loginErrorTitle
:
authorPageConfig
.
loginErrorTitle
,
loginErrorContent
:
authorPageConfig
.
loginErrorContent
loginErrorContent
:
authorPageConfig
.
loginErrorContent
})
})
...
...
miniprogram/pages/index/index.wxml
浏览文件 @
fe15b014
...
@@ -36,15 +36,13 @@
...
@@ -36,15 +36,13 @@
<button type="primary" plain="true" bindtap="getUserProfile" class="user-login" bindgetuserinfo="getUserInfoBtn" wx:if="{{isOldVersion}}">{{loginTitle}}</button>
<button type="primary" plain="true" bindtap="getUserProfile" class="user-login" bindgetuserinfo="getUserInfoBtn" wx:if="{{isOldVersion}}">{{loginTitle}}</button>
<button type="primary" plain="true" bindtap="getUserProfile" bindtap="joinProfile" class="user-login" wx:else>{{joinTitle}}</button>
<button type="primary" plain="true" bindtap="getUserProfile" bindtap="joinProfile" class="user-login" wx:else>{{joinTitle}}</button>
<button type="primary" plain="true"
<button type="primary" plain="true" bindtap="clickBotBtn" class="bot-btn" wx:if="{{isShowBot}}">{{botBtnTitle}}</button>
bindtap="clickBotBtn" class="bot-btn" >{{botBtnTitle}}</button>
<button type="primary" plain="true"
<button type="primary" plain="true" bindtap="clickShopBtn" class="shop-btn" wx:if="{{isShowShop}}">{{shopBtnTitle}}</button>
bindtap="clickShopBtn" class="shop-btn" >{{shopBtnTitle}}</button>
</view>
</view>
</view>
</view>
<view class="loading-container">
<view class="loading-container">
<view class="loading" wx:if="
isloading
">
<view class="loading" wx:if="
{{isloading}}
">
<view class="loader-child" />
<view class="loader-child" />
<view class="loader-child" />
<view class="loader-child" />
<view class="loader-child" />
<view class="loader-child" />
...
...
miniprogram/pages/index/index.wxss
浏览文件 @
fe15b014
...
@@ -39,7 +39,7 @@ page {
...
@@ -39,7 +39,7 @@ page {
}
}
.shop-btn{
.shop-btn{
margin-top:
16
0px;
margin-top:
8
0px;
width:120px !important;
width:120px !important;
color: #fff !important;
color: #fff !important;
border-color: #fff !important;
border-color: #fff !important;
...
@@ -47,7 +47,7 @@ page {
...
@@ -47,7 +47,7 @@ page {
.bot-btn{
.bot-btn{
margin-top:
12
0px;
margin-top:
6
0px;
width:120px !important;
width:120px !important;
color: #fff !important;
color: #fff !important;
border-color: #fff !important;
border-color: #fff !important;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录