Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
yma16_miniprogram
提交
be829878
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看板
提交
be829878
编写于
4月 10, 2023
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code copy img click qr scan
上级
2ebba9e6
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
777 addition
and
212 deletion
+777
-212
.idea/workspace.xml
.idea/workspace.xml
+57
-21
miniprogram/app.js
miniprogram/app.js
+74
-10
miniprogram/pages/blog/blog.js
miniprogram/pages/blog/blog.js
+1
-3
miniprogram/pages/blog/blog.wxss
miniprogram/pages/blog/blog.wxss
+6
-0
miniprogram/pages/future/future.js
miniprogram/pages/future/future.js
+248
-59
miniprogram/pages/future/future.wxml
miniprogram/pages/future/future.wxml
+69
-32
miniprogram/pages/future/future.wxss
miniprogram/pages/future/future.wxss
+180
-34
miniprogram/pages/home/home.js
miniprogram/pages/home/home.js
+4
-0
miniprogram/pages/home/home.wxss
miniprogram/pages/home/home.wxss
+14
-5
miniprogram/pages/homeContent/homeContent.js
miniprogram/pages/homeContent/homeContent.js
+2
-13
miniprogram/pages/homeContent/homeContent.wxss
miniprogram/pages/homeContent/homeContent.wxss
+4
-1
miniprogram/pages/index/index.js
miniprogram/pages/index/index.js
+112
-17
miniprogram/pages/index/index.wxml
miniprogram/pages/index/index.wxml
+1
-1
miniprogram/pages/life/life.js
miniprogram/pages/life/life.js
+1
-12
miniprogram/pages/life/life.wxss
miniprogram/pages/life/life.wxss
+4
-4
未找到文件。
.idea/workspace.xml
浏览文件 @
be829878
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"14febd48-e5b8-4a4f-b997-f51453650c39"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/app.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/app.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/components/base/blockInfo/blockInfo.wxml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/components/base/blockInfo/blockInfo.wxml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/components/base/blockInfo/blockInfo.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/components/base/blockInfo/blockInfo.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/geoMap/geoMap.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/geoMap/geoMap.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/lineChart/lineChart.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/lineChart/lineChart.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/lineChart/lineChart.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/components/visualComponent/lineChart/lineChart.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/blog/blog.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/blog/blog.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/future/future.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/future/future.wxss"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/home/home.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/home/home.wxss"
afterDir=
"false"
/>
<list
default=
"true"
id=
"14febd48-e5b8-4a4f-b997-f51453650c39"
name=
"Default Changelist"
comment=
"feat:可视化部分"
>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/future/future.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/future/future.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/future/future.wxml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/future/future.wxml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/home/home.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/home/home.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/homeContent/homeContent.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/homeContent/homeContent.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/
life/life.wxss"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/life/life.wxs
s"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/miniprogram/pages/
index/index.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/miniprogram/pages/index/index.j
s"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.tmp/"
/>
<ignored
path=
"$PROJECT_DIR$/temp/"
/>
...
...
@@ -25,7 +19,7 @@
</component>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/miniprogram/pages/home/home.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"342"
>
...
...
@@ -37,6 +31,15 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/miniprogram/pages/future/future.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"38"
>
<caret
line=
"301"
column=
"26"
lean-forward=
"true"
selection-start-line=
"301"
selection-start-column=
"26"
selection-end-line=
"301"
selection-end-column=
"26"
/>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component
name=
"Git.Settings"
>
...
...
@@ -46,6 +49,7 @@
<option
name=
"CHANGED_PATHS"
>
<list>
<option
value=
"$PROJECT_DIR$/miniprogram/pages/home/home.js"
/>
<option
value=
"$PROJECT_DIR$/miniprogram/pages/future/future.js"
/>
</list>
</option>
</component>
...
...
@@ -61,10 +65,9 @@
</option>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"260"
/>
<option
name=
"y"
value=
"25"
/>
<option
name=
"width"
value=
"1400"
/>
<option
name=
"height"
value=
"1000"
/>
<option
name=
"x"
value=
"-8"
/>
<option
name=
"width"
value=
"1935"
/>
<option
name=
"height"
value=
"1057"
/>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectView"
>
...
...
@@ -72,6 +75,7 @@
<foldersAlwaysOnTop
value=
"true"
/>
</navigator>
<panes>
<pane
id=
"Scope"
/>
<pane
id=
"ProjectPane"
>
<subPane>
<expand>
...
...
@@ -95,6 +99,20 @@
<item
name=
"miniprogram"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"pages"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"yma16_program"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"yma16_program"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"miniprogram"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"pages"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"blog"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"yma16_program"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"yma16_program"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"miniprogram"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"pages"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"future"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"yma16_program"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"yma16_program"
type=
"462c0819:PsiDirectoryNode"
/>
...
...
@@ -106,10 +124,10 @@
<select
/>
</subPane>
</pane>
<pane
id=
"Scope"
/>
</panes>
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"SHARE_PROJECT_CONFIGURATION_FILES"
value=
"true"
/>
<property
name=
"WebServerToolWindowFactoryState"
value=
"true"
/>
<property
name=
"WebServerToolWindowPanel.toolwindow.highlight.mappings"
value=
"true"
/>
<property
name=
"WebServerToolWindowPanel.toolwindow.highlight.symlinks"
value=
"true"
/>
...
...
@@ -147,6 +165,7 @@
<updated>
1665923387310
</updated>
<workItem
from=
"1665923390899"
duration=
"1623000"
/>
<workItem
from=
"1666014780446"
duration=
"183000"
/>
<workItem
from=
"1680446465011"
duration=
"1019000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"feat:可视化部分"
>
<created>
1665930867783
</created>
...
...
@@ -159,12 +178,12 @@
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"
1806
000"
/>
<option
name=
"totallyTimeSpent"
value=
"
2825
000"
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-8"
y=
"-8"
width=
"1936"
height=
"1066"
extended-state=
"6"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25
26652
5"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25
5330
5"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Favorites"
order=
"2"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
...
...
@@ -175,18 +194,28 @@
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
order=
"7"
/>
<window_info
a
nchor=
"bottom"
id=
"Version Control"
order=
"8
"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Version Control"
order=
"8"
visible=
"true"
weight=
"0.34251103
"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"9"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"10"
side_tool=
"true"
/>
<window_info
active=
"true"
anchor=
"right"
id=
"Remote Host"
visible=
"true"
weight=
"0.32995737"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
<window_info
anchor=
"right"
id=
"Ant Build"
order=
"1"
weight=
"0.25"
/>
<window_info
anchor=
"right"
content_ui=
"combo"
id=
"Hierarchy"
order=
"2"
weight=
"0.25"
/>
<window_info
anchor=
"right"
id=
"Remote Host"
order=
"3"
weight=
"0.32995737"
/>
</layout>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<option
name=
"version"
value=
"1"
/>
</component>
<component
name=
"Vcs.Log.History.Properties"
>
<option
name=
"COLUMN_ORDER"
>
<list>
<option
value=
"0"
/>
<option
value=
"2"
/>
<option
value=
"3"
/>
<option
value=
"1"
/>
</list>
</option>
</component>
<component
name=
"VcsManagerConfiguration"
>
<MESSAGE
value=
"feat:可视化部分"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"feat:可视化部分"
/>
...
...
@@ -202,5 +231,12 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/miniprogram/pages/future/future.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"38"
>
<caret
line=
"301"
column=
"26"
lean-forward=
"true"
selection-start-line=
"301"
selection-start-column=
"26"
selection-end-line=
"301"
selection-end-column=
"26"
/>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
miniprogram/app.js
浏览文件 @
be829878
...
...
@@ -42,7 +42,21 @@ App({
useText
:
'
使用
'
,
returnText
:
'
返回介绍
'
,
sendText
:
'
发送
'
,
searchText
:
'
关键词查询
'
searchText
:
'
关键词查询
'
,
reportText
:
'
复制数据
'
,
copyText
:
'
复制
'
,
pasteText
:
'
粘贴
'
,
upText
:
"
↑
"
,
downText
:
"
↓
"
,
errorMsg
:
'
openai的服务器异常!
'
,
emptyText
:
'
欢迎
'
,
storageKey
:
'
openAiOptionsConfig
'
,
permissionTitle
:
'
很抱歉您没有权限!
'
,
permissionContent
:
'
请联系微信号:cse-yma16
\r\n
需要1元开通权限
\r\n
1元可支持100条消息!
'
,
wxInfoImg
:
'
https://yongma16.xyz/staticFile/common/img/userInfo.png
'
,
limitMsgCount
:
10
,
confirmText
:
'
添加微信
'
,
cancelText
:
'
返回
'
}
},
aboutPageConfig
:
{
...
...
@@ -66,6 +80,31 @@ App({
},
// 引入`towxml3.0`解析方法
towxml
:
require
(
'
/towxml/index
'
),
/**
* 转换text
* @param {string} text
*/
changeMrkdownText
(
text
)
{
const
markdownText
=
this
.
towxml
(
text
,
'
markdown
'
,
{
theme
:
'
light
'
,
//主题 dark 黑色,light白色,不填默认light
events
:{
tap
:(
e
)
=>
{
console
.
log
(
'
e
'
,
e
)
if
(
e
&&
e
.
target
&&
e
.
target
.
dataset
.
data
){
const
{
attrs
,
tag
}
=
e
.
target
.
dataset
.
data
if
(
tag
===
'
img
'
){
const
{
src
}
=
attrs
wx
.
previewImage
({
current
:
src
,
// 当前显示图片的http链接
urls
:
[
src
]
// 需要预览的图片http链接列表
})
}
}
}
}
});
return
markdownText
},
getUserProfile
:
function
(
e
)
{
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
...
...
@@ -83,6 +122,9 @@ App({
console
.
log
(
'
onLaunch
'
,
options
)
// 获取配置项目
const
that
=
this
wx
.
showLoading
({
title
:
'
加载配置中
'
,
})
wx
.
request
({
url
:
'
https://yongma16.xyz/api/dictModel/index/
'
,
method
:
'
POST
'
,
...
...
@@ -90,13 +132,41 @@ App({
kind
:
'
wxConfig
'
},
success
:
function
(
res
)
{
console
.
log
(
'
res
'
,
res
)
if
(
res
.
data
.
data
)
{
console
.
log
(
'
JSON.parse(res.data.data)
'
,
JSON
.
parse
(
res
.
data
.
data
[
0
].
option
))
wx
.
hideLoading
({
success
:
(
loadRes
)
=>
{
console
.
log
(
loadRes
)
},
})
if
(
res
.
data
.
data
&&
res
.
data
.
data
[
0
].
option
)
{
that
.
wxProgramConfig
=
JSON
.
parse
(
res
.
data
.
data
[
0
].
option
)
wx
.
navigateTo
({
url
:
'
pages/index/index
'
,
success
:
function
(
res
)
{
// 通过 eventChannel 向被打开页面传送数据
console
.
log
(
'
res
'
,
res
)
}
});
}
else
{
wx
.
navigateTo
({
url
:
'
pages/index/index
'
,
success
:
function
(
res
)
{
// 通过 eventChannel 向被打开页面传送数据
console
.
log
(
'
res
'
,
res
)
}
});
}
},
fail
:
function
(
r
)
{
console
.
log
(
'
r
'
,
r
)
wx
.
hideLoading
({
success
:
(
loadRes
)
=>
{
console
.
log
(
loadRes
)
},
})
wx
.
navigateTo
({
url
:
'
pages/index/index
'
,
success
:
function
(
res
)
{
// 通过 eventChannel 向被打开页面传送数据
console
.
log
(
'
res
'
,
res
)
}
});
}
})
if
(
!
wx
.
cloud
)
{
...
...
@@ -111,13 +181,7 @@ App({
traceUser
:
true
,
});
wx
.
removeStorageSync
(
'
currentUserInfo
'
);
wx
.
navigateTo
({
url
:
'
pages/index/index
'
,
success
:
function
(
res
)
{
// 通过 eventChannel 向被打开页面传送数据
console
.
log
(
'
res
'
,
res
)
}
});
const
currentUserInfo
=
wx
.
getStorageSync
(
'
currentUserInfo
'
)
if
(
currentUserInfo
&&
currentUserInfo
.
nickName
)
{
console
.
log
(
'
success
'
)
...
...
miniprogram/pages/blog/blog.js
浏览文件 @
be829878
...
...
@@ -72,9 +72,7 @@ Component({
}
})
const
articleStr
=
data
&&
data
.
article
&&
data
.
article
[
0
]
const
markdownText
=
app
.
towxml
(
articleStr
,
'
markdown
'
,{
theme
:
'
light
'
,
//主题 dark 黑色,light白色,不填默认light
});
const
markdownText
=
app
.
changeMrkdownText
(
articleStr
)
that
.
setData
({
isLoading
:
false
,
currentTitle
:
articleTitle
&&
articleTitle
[
0
].
title
,
...
...
miniprogram/pages/blog/blog.wxss
浏览文件 @
be829878
...
...
@@ -21,12 +21,14 @@
width: 100vw;
height: calc(100vh - 110px);
overflow: auto;
user-select: text;
}
.blog-container{
margin-top:100px;
width: 100vw;
height: auto;
margin-bottom:10px;
user-select: text;
}
.blog-title{
text-align: center;
...
...
@@ -38,4 +40,8 @@
padding: 10px;
width: 100%;
min-height: 20px;
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
}
.blog-title:active,.blog-title:hover{
color:#fff;
}
\ No newline at end of file
miniprogram/pages/future/future.js
浏览文件 @
be829878
...
...
@@ -27,14 +27,18 @@ Component({
*组件的初始数据
*/
data
:
{
currenTime
:
""
,
scrollTop
:
0
,
mode
:
baseMode
,
article
:
{},
articleId
:
baseArticleId
,
isShowOenAi
:
fals
e
,
isShowOenAi
:
tru
e
,
baseUrl
:
'
https://yongma16.xyz/api/
'
,
baseCloudUrl
:
'
https://yongma16.xyz/cloudApi/
'
,
baseCloudPath
:
'
openAiRecord/add
'
,
baseCloudAddRecordPath
:
'
openAiRecord/add
'
,
baseCloudUpdateUserPath
:
'
userModel/update
'
,
baseCloudgetUserPath
:
'
userModel/info
'
,
baseCloudGetRecordCountPath
:
'
openAiRecord/count
'
,
path
:
'
article/blog/
'
,
currentUserInfo
:
{
nickName
:
''
,
...
...
@@ -50,13 +54,16 @@ Component({
reportText
:
''
,
// questions,answer,index
chatObjConfig
:
{
option
:
[{
question
:
''
,
answer
:
''
,
isEdit
:
true
,
createTime
:
''
}],
currentIndex
:
0
option
:
[
// {
// question: '',
// answer: '',
// isEdit: true,
// createTime: ''
// }
],
currentIndex
:
0
,
errorMsg
:
'
openai的服务器异常!
'
},
layoutConfig
:
{
introduceText
:
'
api介绍
'
,
...
...
@@ -65,8 +72,23 @@ Component({
sendText
:
'
发送
'
,
searchText
:
'
关键词查询
'
,
reportText
:
'
复制数据
'
,
copyText
:
'
复制
'
}
copyText
:
'
复制
'
,
pasteText
:
'
粘贴
'
,
upText
:
"
↑
"
,
downText
:
"
↓
"
,
errorMsg
:
'
openai的服务器异常!
'
,
emptyText
:
'
欢迎
'
,
storageKey
:
'
openAiOptionsConfig
'
,
permissionTitle
:
'
很抱歉您没有权限!
'
,
permissionContent
:
'
请联系微信号:cse-yma16
\r\n
需要1元开通权限
\r\n
1元可支持100条消息!
'
,
wxInfoImg
:
'
https://yongma16.xyz/staticFile/common/img/userInfo.png
'
,
limitMsgCount
:
10
,
confirmText
:
'
添加微信
'
,
cancelText
:
'
返回
'
},
msgCount
:
0
,
isVip
:
false
,
modalVisible
:
false
},
observers
:
{
mode
:
function
(
newVal
,
oldVal
)
{
...
...
@@ -89,18 +111,34 @@ Component({
lifetimes
:
{
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
attached
:
function
()
{
this
.
getUserInfo
()
this
.
getRemoteArticle
(
this
.
data
.
articleId
)
const
openAiOptions
=
wx
.
getStorageSync
(
'
openAiOptions
'
)
if
(
openAiOptions
)
{
this
.
setData
({
currenTime
:
this
.
getCurrentTime
()
})
const
key
=
app
.
wxProgramConfig
.
apiPageConfig
.
layoutConfig
.
storageKey
const
openAiOptionsConfig
=
wx
.
getStorageSync
(
key
)
if
(
openAiOptionsConfig
)
{
// if (openAiOptionsConfig.option) {
// openAiOptionsConfig.option.forEach(item => {
// item.answerMarkdown = app.changeMrkdownText(item.answer)
// })
// }
const
lauoutConfig
=
app
.
wxProgramConfig
.
apiPageConfig
.
layoutConfig
this
.
setData
(
{
chatObjConfig
:
openAiOptions
,
chatObjConfig
:
openAiOptions
Config
,
mode
:
app
.
wxProgramConfig
.
apiPageConfig
.
mode
,
layoutConfig
:
app
.
wxProgramConfig
.
apiPageConfig
.
layoutConfig
,
layoutConfig
:
lauoutConfig
,
isShowOenAi
:
lauoutConfig
.
isShowOenAi
}
)
this
.
refreshOptions
()
}
const
currentUserInfo
=
wx
.
getStorageSync
(
'
currentUserInfo
'
)
if
(
currentUserInfo
&&
currentUserInfo
.
nickName
)
{
console
.
log
(
'
currentUserInfo
'
,
currentUserInfo
)
...
...
@@ -109,19 +147,113 @@ Component({
currentUserInfo
:
currentUserInfo
}
)
this
.
setData
({
isShowOenAi
:
true
})
}
},
moved
:
function
()
{
},
// 销毁前
detached
:
function
()
{
wx
.
setStorageSync
(
'
openAiOptions
'
,
this
.
data
.
chatObjConfig
)
const
key
=
app
.
wxProgramConfig
.
apiPageConfig
.
layoutConfig
.
storageKey
wx
.
setStorageSync
(
key
,
this
.
data
.
chatObjConfig
)
this
.
getUserReadCount
()
},
},
methods
:
{
previewImage
(
e
){
console
.
log
(
'
click png
'
,
e
)
const
url
=
e
.
target
.
dataset
.
url
wx
.
previewImage
({
current
:
url
,
// 当前显示图片的http链接
urls
:
[
url
]
// 需要预览的图片http链接列表
})
},
// 获取用户
getUserInfo
()
{
const
headers
=
{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
}
const
openId
=
wx
.
getStorageSync
(
'
currentOpenid
'
)
const
wxOpenId
=
openId
&&
openId
.
openid
const
params
=
{
wx_open_id
:
wxOpenId
}
const
thisBack
=
this
wx
.
request
({
url
:
this
.
data
.
baseCloudUrl
+
this
.
data
.
baseCloudgetUserPath
,
headers
:
headers
,
data
:
params
,
method
:
'
POST
'
,
success
:
(
res
=>
{
console
.
log
(
'
cloud res userInfo
'
,
res
)
if
(
res
&&
res
.
data
&&
res
.
data
)
{
thisBack
.
setData
({
// 默认十条消息
msgCount
:
res
.
data
.
data
[
0
].
send_msg_count
||
10
,
isVip
:
res
.
data
.
data
[
0
].
is_vip
||
0
})
}
}),
fail
:
r
=>
{
console
.
log
(
'
cloud r
'
,
r
)
}
})
},
// 更新用户使用信息
updateUserInfo
()
{
const
headers
=
{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
}
const
openId
=
wx
.
getStorageSync
(
'
currentOpenid
'
)
const
wxOpenId
=
openId
&&
openId
.
openid
const
params
=
{
wx_open_id
:
wxOpenId
,
send_msg_count
:
this
.
data
.
msgCount
}
const
thisBack
=
this
wx
.
request
({
url
:
this
.
data
.
baseCloudUrl
+
this
.
data
.
baseCloudUpdateUserPath
,
headers
:
headers
,
data
:
params
,
method
:
'
PUT
'
,
success
:
(
res
=>
{
console
.
log
(
'
cloud res update
'
,
res
)
}),
fail
:
r
=>
{
console
.
log
(
'
cloud r
'
,
r
)
}
})
},
// 获取用户使用次数
getUserReadCount
()
{
const
headers
=
{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
}
const
openId
=
wx
.
getStorageSync
(
'
currentOpenid
'
)
const
wxOpenId
=
openId
&&
openId
.
openid
const
params
=
{
wx_open_id
:
wxOpenId
}
const
thisBack
=
this
wx
.
request
({
url
:
this
.
data
.
baseCloudUrl
+
this
.
data
.
baseCloudGetRecordCountPath
,
headers
:
headers
,
data
:
params
,
method
:
'
POST
'
,
success
:
(
res
=>
{
console
.
log
(
'
cloud res count
'
,
res
)
if
(
res
.
data
.
code
===
0
)
{
// 0
thisBack
.
setData
({
msgCount
:
0
})
}
else
{
thisBack
.
setData
({
msgCount
:
res
.
data
.
data
[
0
].
send_msg_count
})
}
// 更新用户
thisBack
.
updateUserInfo
()
}),
fail
:
r
=>
{
console
.
log
(
'
cloud r
'
,
r
)
}
})
},
upper
(
e
)
{
console
.
log
(
'
upper e
'
,
e
)
},
...
...
@@ -129,12 +261,15 @@ Component({
console
.
log
(
'
lower e
'
,
e
)
},
scroll
(
e
)
{
console
.
log
(
'
scroll e
'
,
e
)
//
console.log('scroll e', e)
},
createOpenRecord
(
params
)
{
const
headers
=
{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
}
const
openId
=
wx
.
getStorageSync
(
'
currentOpenid
'
)
const
wxOpenId
=
openId
&&
openId
.
openid
params
.
wx_open_id
=
wxOpenId
wx
.
request
({
url
:
this
.
data
.
baseCloudUrl
+
this
.
data
.
baseCloudPath
,
url
:
this
.
data
.
baseCloudUrl
+
this
.
data
.
baseCloud
AddRecord
Path
,
headers
:
headers
,
data
:
params
,
method
:
'
POST
'
,
...
...
@@ -146,6 +281,15 @@ Component({
}
})
},
upBtn
()
{
const
index
=
0
this
.
setData
({
toView
:
`chat-mode
${
index
}
`
})
},
downBtn
()
{
this
.
scrollToBottom
()
},
scrollToBottom
()
{
const
index
=
this
.
data
.
chatObjConfig
.
option
.
length
-
1
this
.
setData
({
...
...
@@ -184,18 +328,7 @@ Component({
success
:
(
res
)
=>
{
const
data
=
res
.
data
const
articleStr
=
data
&&
data
.
article
&&
data
.
article
const
markdownText
=
app
.
towxml
(
articleStr
,
'
markdown
'
,
{
theme
:
'
light
'
,
//主题 dark 黑色,light白色,不填默认light
base
:
baseUrl
+
path
,
events
:
{
//为元素绑定的事件方法
tap
:
e
=>
{
console
.
log
(
'
tap
'
,
e
);
},
change
:
e
=>
{
console
.
log
(
'
todo
'
,
e
);
}
}
});
const
markdownText
=
app
.
changeMrkdownText
(
articleStr
);
that
.
setData
({
isLoading
:
false
,
article
:
markdownText
...
...
@@ -210,13 +343,34 @@ Component({
mode
:
mode
})
},
refreshOptions
()
{
const
option
=
this
.
data
.
chatObjConfig
.
option
const
currentIndex
=
this
.
data
.
chatObjConfig
.
currentIndex
while
(
option
&&
option
.
length
>
100
)
{
option
.
shift
()
}
const
chatObjConfig
=
{
option
:
option
,
currentIndex
:
currentIndex
}
this
.
setData
(
{
chatObjConfig
:
chatObjConfig
}
)
},
bindKeyInput
(
e
)
{
this
.
setData
({
searchOpenAiText
:
e
.
detail
.
value
})
},
reportAnswerData
()
{
const
data
=
this
.
data
.
chatObjConfig
.
option
const
data
=
this
.
data
.
chatObjConfig
.
option
wx
.
setClipboardData
({
data
:
JSON
.
stringify
(
data
)
})
...
...
@@ -239,7 +393,53 @@ Component({
},
}))
},
pasteBtn
(
e
)
{
const
thisBack
=
this
wx
.
getClipboardData
({
success
:
(
option
)
=>
{
console
.
log
(
'
option
'
,
option
)
thisBack
.
setData
({
searchOpenAiText
:
option
.
data
})
},
})
},
clearBtn
()
{
this
.
setData
({
searchOpenAiText
:
''
})
},
modalConfirm
()
{
const
url
=
this
.
data
.
layoutConfig
.
wxInfoImg
wx
.
previewImage
({
current
:
url
,
// 当前显示图片的http链接
urls
:
[
url
]
// 需要预览的图片http链接列表
})
},
modalCandel
()
{
this
.
setData
({
modalVisible
:
false
})
},
search
(
e
)
{
if
(
this
.
data
.
layoutConfig
.
permissionStatus
)
{
const
isNotAllow
=
!
(
this
.
data
.
isVip
||
this
.
data
.
msgCount
<=
this
.
data
.
layoutConfig
.
limitMsgCount
)
console
.
log
(
'
this.data.isVip
'
,
this
.
data
.
isVip
)
console
.
log
(
'
this.data.msgCount
'
,
this
.
data
.
msgCount
)
console
.
log
(
'
isNotAllow
'
,
isNotAllow
)
if
(
isNotAllow
)
{
return
this
.
setData
({
modalVisible
:
true
})
// return wx.showModal({
// cancelColor: 'cancelColor',
// title: this.data.layoutConfig.permissionTitle,
// content: this.data.layoutConfig.permissionContent
// })
}
}
this
.
scrollToBottom
()
if
(
!
this
.
data
.
searchOpenAiText
)
{
wx
.
showModal
({
...
...
@@ -270,33 +470,20 @@ Component({
console
.
log
(
res
,
'
res
'
)
const
data
=
res
.
data
.
data
const
option
=
thisBack
.
data
.
chatObjConfig
.
option
const
currentIndex
=
thisBack
.
data
.
chatObjConfig
.
currentIndex
const
errorMsg
=
thisBack
.
data
.
layoutConfig
.
errorMsg
const
choices
=
data
.
choices
console
.
log
(
'
choices
'
,
choices
)
const
answer
=
choices
?
choices
.
map
(
choicesItem
=>
{
return
choicesItem
.
text
}).
join
(
'
\n
'
)
:
'
。。。未知
'
option
.
some
((
item
,
index
)
=>
{
if
(
currentIndex
===
index
)
{
item
.
answer
=
answer
item
.
question
=
params
.
text
item
.
createTime
=
this
.
getCurrentTime
()
item
.
isEdit
=
false
return
true
}
return
false
const
answer
=
choices
?
choices
.
map
(
choicesItem
=>
{
return
choicesItem
.
text
}).
join
(
'
\n
'
)
:
errorMsg
option
.
push
({
question
:
params
.
text
,
answer
:
answer
,
answerMarkdown
:
app
.
changeMrkdownText
(
answer
),
createTime
:
this
.
getCurrentTime
(),
isEdit
:
false
,
})
// // 只保留30 条 缓存
// if(option.length&&option.length>30){
// option.shift()
// }
const
chatObjConfig
=
{
option
:
option
,
currentIndex
:
currentIndex
+
1
option
:
option
}
// option.push({
// question: '',
// answer: '',
// isEdit: true
// })
thisBack
.
setData
(
{
isLoading
:
false
,
...
...
@@ -315,6 +502,8 @@ Component({
search_response
:
answer
})
},
10
)
console
.
log
(
'
thisBack.data.chatObjConfig.option
'
,
thisBack
.
data
.
chatObjConfig
.
option
)
thisBack
.
refreshOptions
()
},
fail
:
error
=>
{
thisBack
.
setData
({
...
...
@@ -326,4 +515,4 @@ Component({
})
}
}
})
\ No newline at end of file
})
miniprogram/pages/future/future.wxml
浏览文件 @
be829878
<!--pages/future/future.wxml-->
<view class="container-future">
<view class="form-container-introduce" wx:if="{{mode==='introduce'}}">
<view class="header-box" style="
display: flex
;">
<view
style="width: {{isShowOenAi? '50%':'100%'}}"
>
<view class="header-box" style="
width: 100%
;">
<view
wx:if="{{isShowOenAi}}" style="width: 50%;"
>
<button style="width: 100%;" type="primary" style="background: rgb(8, 183, 252);" loading="{{isLoading}}">{{layoutConfig.introduceText}}
</button>
</view>
<view style="width:50%" wx:if="{{isShowOenAi}}">
<button style="width: 100%;" type="primary" style="background: rgb(0, 114, 221);" bindtap="changeMode" loading="{{isLoading}}" data-mode='openAiUse'>{{layoutConfig.useText}}</button>
</view>
<view wx:else style="width:100%;height: 43px;line-height: 43px;text-align: center;font-weight: bold;">
<view style="width:100%;position: relative" type="primary" style="background: rgb(8, 183, 252);" loading="{{isLoading}}">{{layoutConfig.introduceText}}
</view>
</view>
</view>
<view class="loading" wx:if="{{isLoading}}">
<view class="loader-child" />
...
...
@@ -20,19 +23,16 @@
</view>
</view>
<view class="form-container-api" wx:if="{{mode==='openAiUse'}}">
<view
style="display: flex;justify-content: space-between;
">
<button style="
width: 50%
;background-color: #0758c1;" type="primary" bindtap="changeMode" loading="{{isLoading}}" data-mode='introduce'>{{layoutConfig.returnText}}</button>
<button
style="width: 50%
;" type="primary" style="background: rgb(0, 114, 221);" bindtap="reportAnswerData" loading="{{isLoading}}" data-mode='openAiUse'>{{layoutConfig.reportText}}</button>
<view
class="shadow" style="display: flex;justify-content: space-between;width:100%
">
<button style="
flex:1
;background-color: #0758c1;" type="primary" bindtap="changeMode" loading="{{isLoading}}" data-mode='introduce'>{{layoutConfig.returnText}}</button>
<button
wx:if="{{layoutConfig.isShowCopyAll}}" style="flex:1
;" type="primary" style="background: rgb(0, 114, 221);" bindtap="reportAnswerData" loading="{{isLoading}}" data-mode='openAiUse'>{{layoutConfig.reportText}}</button>
</view>
<view class="chat-container" id="chat-container-id" style="width: 100%;">
<view style="float: right;position: absolute;right:0;z-index: 10px">
</view>
<scroll-view scroll-y="true" class="scroll-answer" scroll-with-animation bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
<scroll-view scroll-y="true" class="scroll-answer" scroll-with-animation bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}" wx:if="{{ chatObjConfig.option&&chatObjConfig.option.length>0 }}">
<view wx:for="{{ chatObjConfig.option }}" wx:for-index="index" wx:for-item="item" wx:key="index" id="chat-mode{{index}}">
<view style="width: 100%;border-radius: 2px;text-align: center;color:rgb(255, 255, 255);background: rgb(0, 114, 221);width: fit-content;margin:5px auto
">
{{item.createTime}}
</view>
<view class="create-time
">
{{item.createTime}}
</view>
<view class="form-request">
<view wx:if="{{!item.isEdit}}" class='questioned'>
<view style="display: flex;text-align: right;flex-direction:row-reverse;">
...
...
@@ -43,9 +43,9 @@
<view class='questioned-box-poly'>
</view>
<view style="text-align: right;line-height: 50px;display: flex;max-height: 50px;">
<view
class='form-request-user'>
<view class='form-request-user'>
<!-- {{currentUserInfo.nickName}} -->
<image class="user-image" src="{{currentUserInfo.avatarUrl}}"></image>
<image class="user-image" src="{{currentUserInfo.avatarUrl}}"></image>
</view>
</view>
</view>
...
...
@@ -55,36 +55,73 @@
<view class="form-response" wx:if="{{!item.isEdit}}">
<view style="display: flex;">
<view style="line-height: 50px;">
<view
class='form-response-user'>
<image class="ai-image" src="{{aiConfig.avatarUrl}}"></image>
<!-- {{aiConfig.nickName}} -->
</view>
<view
class='form-response-user'>
<image class="ai-image" src="{{aiConfig.avatarUrl}}"></image>
<!-- {{aiConfig.nickName}} -->
</view>
</view>
<view class="form-response-box-poly">
</view>
<view class='form-response-box'>
{{item.answer}}
<view class='form-response-box'
style="overflow: auto;"
>
<towxml wx:key="index" nodes="{{item.answerMarkdown}}" style="position: relative;background: transparent;user-select: text;" />
</view>
</view>
<view style="display: flex;width: 100%;box-sizing: border-box;">
<view style="width: 70%;">
</view>
<view style="width: 30%;">
<button style="background-color: #0758c1;width:fit-content;border-radius: 10px;margin:5px 2px;" type="primary" bindtap="copyBtn" data-response=" {{item.answer}}">{{layoutConfig.copyText}}</button>
</view>
<view style="width: 70%;">
</view>
<view style="width: 30%;text-align: center;">
<button class="copy-btn" size="mini" bindtap="copyBtn" data-response=" {{item.answer}}">{{layoutConfig.copyText}}</button>
</view>
</view>
</view>
</view>
<view class="form-submit" wx:if="{{mode==='openAiUse'}}" style="width: 100%;">
</view>
</scroll-view>
<view>
<input class='send-btn' bindinput="bindKeyInput" placeholder="{{layoutConfig.searchText}}" bindconfirm="search" value="{{searchOpenAiText}}" disabled="{{isLoading}}" />
<view wx:else class="scroll-answer">
<view class="create-time">
{{currenTime}}
</view>
<view style="display: flex;">
<view style="line-height: 50px;">
<view class='form-response-user'>
<image class="ai-image" src="{{aiConfig.avatarUrl}}"></image>
<!-- {{aiConfig.nickName}} -->
</view>
</view>
<view class="form-response-box-poly">
</view>
<view class="form-response-box" style="padding: 0 10px;">
{{layoutConfig.emptyText}}
</view>
</view>
</view>
<view class="paste-container">
<button class="paste-btn" size="mini" bindtap="pasteBtn" data-response=" {{item.answer}}">{{layoutConfig.pasteText}}</button>
<button class="paste-btn" size="mini" bindtap="clearBtn" data-response=" {{item.answer}}">{{layoutConfig.clearText}}</button>
<view>
<button class="paste-btn-up" size="mini" bindtap="upBtn" data-response=" {{item.answer}}">{{layoutConfig.upText}}</button>
<button class="paste-btn-down" size="mini" bindtap="downBtn" data-response=" {{item.answer}}">{{layoutConfig.downText}}</button>
</view>
</view>
<view style="display: flex;width: 100%;">
<view class='submit-input'>
<textarea class='send-input' bindinput="bindKeyInput" placeholder="{{layoutConfig.searchText}}" bindconfirm="search" value="{{searchOpenAiText}}" disabled="{{isLoading||isTruth}}" />
</view>
<view class='send-btn' type="primary" bindtap="search" loading="{{isLoading}}">{{layoutConfig.sendText}}</view>
</view>
<button style="width: 100%;;background-color: #0758c1;" type="primary" bindtap="search" loading="{{isLoading}}">{{layoutConfig.sendText}}</button>
</view>
</view>
<modal wx:if="{{modalVisible}}" hidden="{{!modalVisible}}" bindconfirm="modalConfirm" confirmText="{{layoutConfig.confirmText}}" cancelText="{{layoutConfig.cancelText}}" bindcancel="modalCandel" style="padding: 0;">
<view style="text-align: center;font-weight: bold;margin:0;padding: 0;">
{{layoutConfig.permissionTitle}}
</view>
<view>
<image class="image" style="height: 230px;background-repeat: no-repeat;background-size: cover;" src="{{layoutConfig.wxInfoImg}}" data-url="{{layoutConfig.wxInfoImg}}" bindtap="previewImage"></image>
</view>
<view>{{ layoutConfig.permissionContent}}</view>
</modal>
</view>
\ No newline at end of file
miniprogram/pages/future/future.wxss
浏览文件 @
be829878
...
...
@@ -3,11 +3,12 @@
position: relative;
width: 100vw;
height: 100vh;
background: linear-gradient(to right, rgba(1, 41, 116, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(1, 41, 116, 0.1) 1px, transparent 1px);
background: rgb(245, 245, 245);
/* background: linear-gradient(to right, rgba(1, 41, 116, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(1, 41, 116, 0.1) 1px, transparent 1px);
background-repeat: repeat;
background-size: 10px 10px;
/* background-image: url('https://yongma16.xyz/media/editor/wallhaven-we1xx7_20230331165330942057.jpg');
*/
/*
background-repeat: no-repeat;
background-size: 10px 10px;
*/
/* background-image: url('https://yongma16.xyz/media/editor/wallhaven-we1xx7_20230331165330942057.jpg');
background-repeat: no-repeat;
background-size: cover; */
overflow: hidden;
box-sizing: border-box;
...
...
@@ -60,6 +61,7 @@
color: #262626;
margin: 0;
padding: 0;
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
}
.title {
...
...
@@ -78,6 +80,34 @@ button {
}
.create-time {
width: 100%;
text-align: center;
color: rgb(255, 255, 255);
background: rgb(218, 218, 218);
margin: 5px auto;
}
.header-box {
position: relative;
width: 100%;
box-shadow: 0 1rpx 5rpx 5rpx #c8c3c3;
z-index: 999;
display: flex;
}
.copy-btn {
background: rgb(0, 114, 221);
color: #ffffff;
border-radius: 5px;
margin-top: 5px;
}
.copy-btn:hover {
border: none;
background: rgb(221, 0, 66);
}
.btn-default {
color: #262626;
...
...
@@ -87,6 +117,8 @@ button {
background-color: #ffffff;
}
.actived {
color: #ffffff;
flex: 1;
...
...
@@ -100,12 +132,16 @@ button {
width: 100%;
}
.shadow {
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
}
.form-request {
display: block;
width: 100%;
color: #fff;
background-color: rgba(37, 0, 97,0);
background-color: rgba(37, 0, 97,
0);
line-height: 50px;
}
...
...
@@ -116,19 +152,19 @@ button {
display: block;
margin-bottom: 10px;
color: #fff;
background-color: rgba(0, 72, 94,0);
background-color: rgba(0, 72, 94,
0);
box-sizing: border-box;
min-height: 60px;
}
.form-response-user{
background-color: rgba(0, 72, 94,0);
color:#fff;
.form-response-user
{
background-color: rgba(0, 72, 94,
0);
color:
#fff;
}
.form-request-user{
background-color: rgba(37, 0, 97,0);
color:#fff;
.form-request-user
{
background-color: rgba(37, 0, 97,
0);
color:
#fff;
}
.form-class-submit {
...
...
@@ -144,15 +180,20 @@ button {
height: calc(100vh - 60px);
}
.container-box-article{
.container-box-article
{
position: relative;
padding-top:0px;
width: 100%;
height: calc(100vh - 100px);
height: calc(100vh - 88px);
box-shadow: inset 5px 5px #262626;
overflow: auto;
user-select: text;
}
.scroll-answer{
height: calc(100vh - 140px);
.scroll-answer {
height: calc(100vh - 180px);
}
.chat-container {
width: 100%;
height: calc(100vh - 40px);
...
...
@@ -161,6 +202,18 @@ button {
position: relative;
}
.paste-btn {
background: rgb(0, 114, 221);
color: #ffffff;
/* transform: scale(.7); */
border-radius: 5px;
}
.paste-btn:hover {
border: none;
background: rgb(221, 0, 66);
}
.user-image-box {
width: 200px;
height: 140px;
...
...
@@ -182,60 +235,153 @@ button {
border-radius: 50%;
}
.questioned-box-container{
.questioned-box-container
{
display: flex;
}
.questioned-box{
.questioned-box {
position: relative;
max-width: calc(100vw - 90px);
height: auto;
overflow-x: auto;
background-color:
rgb(0, 114, 221
);
background-color:
rgb(255, 255, 255
);
border-radius: 10px;
right: -5px;
padding:0 10px;
padding:
0 10px;
z-index: 999;
color: #333;
font-family: PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
font-weight: 300;
font-size: 32rpx;
user-select: text;
}
.questioned-box-poly{
.questioned-box-poly {
position: relative;
top:15px;
top:
15px;
width: 0;
height: 0;
border-radius: 5px;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 12px solid rgb(0, 114, 221);
border-left: 12px solid rgb(255, 255, 255);
}
.clear-paste-btn{
width:70%;
display: flex;
}
.submit-input {
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
width: 70%;
}
.send-input {
height: 60px;
background: rgba(255, 255, 255, .8);
width: 100%;
height: 100px;
position: relative;
text-indent: 8px;
/* padding-left: 5px; */
color: rgb(0, 114, 221);
}
.up-down-btn{
width:30%;
}
.send-btn{
height: 60px;background: rgba(255,255,255,.8);
color:rgb(0, 114, 221);
padding-left: 10px;
.send-btn {
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
width: 30%;
background-color: #0758c1;
height: 100px;
line-height: 100px;
text-align: center;
}
.
form-response-box
{
.
empty-reponse-msg
{
position: relative;
max-width: calc(100vw - 90px);
word-break:keep-all;
height: auto;
overflow-x: auto;
background-color: rgb(0, 114, 221);
background-color: rgb(255, 255, 255);
border-radius: 10px;
left: -5px;
padding: 0 10px;
z-index: 999;
color: #333;
font-family: PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
font-weight: 300;
font-size: 32rpx;
user-select: text;
}
.form-response-box {
position: relative;
max-width: calc(100vw - 50px);
/* word-break:keep-all; */
/* white-space: pre-wrap; */
white-space: pre-line;
height: auto;
overflow-x: auto;
background-color: rgb(255, 255, 255);
border-radius: 10px;
color: #333;
font-family: PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
font-weight: 300;
font-size: 32rpx;
left: -5px;
padding:0 10px;
box-sizing: content-box;
z-index: 999;
user-select: text;
}
.form-response-box-poly{
.form-response-box-poly
{
position: relative;
top:15px;
top:
15px;
width: 0;
height: 0;
border-radius: 5px;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 12px solid rgb(0, 114, 221);
border-right: 12px solid rgb(255, 255, 255);
}
.paste-container {
display: flex;
border: 1px solid rgb(0, 114, 221);
padding: 4px;
}
.paste-btn-up {
background: rgb(0, 114, 221);
color: #ffffff;
width: 30px !important;
height: 30px !important;
line-height: 30px !important;
text-align: center !important;
border-radius: 100%;
}
.paste-btn-up:hover {
border: none;
background: rgb(221, 0, 66);
}
.paste-btn-down:hover {
border: none;
background: rgb(221, 0, 66);
}
.paste-btn-down {
margin-left: 2px;
background: rgb(0, 114, 221);
color: #ffffff;
width: 30px !important;
height: 30px !important;
line-height: 30px !important;
text-align: center !important;
border-radius: 100%;
}
/* .loader-child:nth-of-type(1) {
...
...
miniprogram/pages/home/home.js
浏览文件 @
be829878
...
...
@@ -208,6 +208,7 @@ Page({
*/
onLoad
:
function
(
options
)
{
const
eventChannel
=
this
.
getOpenerEventChannel
()
const
thisBack
=
this
if
(
eventChannel
.
emit
)
{
eventChannel
.
emit
(
'
acceptDataFromOpenedPage
'
,
{
data
:
'
test
'
});
eventChannel
.
emit
(
'
someEvent
'
,
{
data
:
'
test
'
});
...
...
@@ -216,6 +217,9 @@ Page({
// 监听 acceptDataFromOpenerPage 事件,获取上一页面通过 eventChannel 传送到当前页面的数据
eventChannel
.
on
(
'
setHomePageData
'
,
function
(
data
)
{
console
.
log
(
'
setHomePageData
'
,
data
)
thisBack
.
setData
({
isShowBottom
:
data
.
isShowBottom
})
})
}
this
.
setData
({
...
...
miniprogram/pages/home/home.wxss
浏览文件 @
be829878
...
...
@@ -4,6 +4,10 @@ page {
width: 100vw;
height: 100vh;
bottom: 0;
background: #fff;
/* background-image: url('https://yongma16.xyz/staticFile/common/img/scene.png');
background-repeat: no-repeat;
background-size: cover; */
overflow: hidden;
}
.container{
...
...
@@ -114,6 +118,8 @@ page {
height:150px;
width: 100vw;
background-color: rgb(49, 28, 3);
box-shadow: 0 2rpx 5rpx 5rpx #c8c3c3;
z-index: 999;
}
.swiper-item{
position: relative;
...
...
@@ -147,6 +153,7 @@ page {
.container-content{
position: relative;
height: 50vh;
box-sizing: border-box;
}
.home-content-class{
position: relative;
...
...
@@ -168,8 +175,10 @@ page {
flex-wrap: nowrap;
width:100vw;
background-color: white;
border-top:2px solid rgba(0, 183, 255,.5);
/* border-top:3px solid rgba(0, 183, 255, 1); */
z-index: 999;
bottom:0;
box-shadow: 0 3rpx 5rpx 5rpx #c8c3c3;
}
.default-btn{
position: relative;
...
...
@@ -180,6 +189,7 @@ page {
/* border-right:1px solid rgb(255, 136, 0); */
text-align: center;
height:60px;
border-radius: 5px;
line-height: 60px;
}
.default-btn:active,default-btn:active:hover{
...
...
@@ -190,7 +200,6 @@ page {
color:#ffffff;
font-weight: bold;
background-color: rgb(8, 183, 252);
border:1px solid rgb(8, 183, 252);
box-shadow: 0 5px 5px 5px rgba(8, 183, 252,.5);
}
...
...
@@ -208,19 +217,19 @@ page {
left: 0%;
top: 0%;
animation: rotate-one 1.15s linear infinite;
border-bottom: 3px solid
#1c92d2
;
border-bottom: 3px solid
rgba(8, 183, 252)
;
}
.loader-child:nth-of-type(2) {
right: 0%;
top: 0%;
animation: rotate-two 1.15s linear infinite;
border-right: 3px solid
#1c92d2
;
border-right: 3px solid
rgba(8, 183, 252)
;
}
.loader-child:nth-of-type(3) {
right: 0%;
bottom: 0%;
animation: rotate-three 1.15s linear infinite;
border-top: 3px solid
#1c92d2
;
border-top: 3px solid
rgba(8, 183, 252)
;
}
@keyframes rotate-one {
0% {
...
...
miniprogram/pages/homeContent/homeContent.js
浏览文件 @
be829878
...
...
@@ -27,7 +27,7 @@ Component({
},
observers
:{
mode
:
function
(
val
){
console
.
log
(
'
val
'
,
val
)
console
.
log
(
'
val
mode
'
,
val
)
}
},
lifetimes
:
{
...
...
@@ -74,18 +74,7 @@ Component({
success
:
(
res
)
=>
{
const
data
=
res
.
data
const
articleStr
=
data
&&
data
.
article
&&
data
.
article
const
markdownText
=
app
.
towxml
(
articleStr
,
'
markdown
'
,{
theme
:
'
light
'
,
//主题 dark 黑色,light白色,不填默认light
base
:
baseUrl
+
path
,
events
:{
//为元素绑定的事件方法
tap
:
e
=>
{
console
.
log
(
'
tap
'
,
e
);
},
change
:
e
=>
{
console
.
log
(
'
todo
'
,
e
);
}
}
});
const
markdownText
=
app
.
changeMrkdownText
(
articleStr
)
that
.
setData
({
isLoading
:
false
,
article
:
markdownText
...
...
miniprogram/pages/homeContent/homeContent.wxss
浏览文件 @
be829878
...
...
@@ -20,10 +20,13 @@
.container-box{
position: relative;
height: calc(100vh - 21
2
px);
height: calc(100vh - 21
4
px);
overflow: auto;
}
.container-box-content{
position: relative;
}
...
...
miniprogram/pages/index/index.js
浏览文件 @
be829878
...
...
@@ -3,6 +3,8 @@
const
app
=
getApp
()
Page
({
data
:
{
baseUrl
:
app
.
remoteConfig
.
baseUrl
,
baseLoginCloudPath
:
'
userModel/register
'
,
detailInfo
:
'
关于:code笔记
'
,
title
:
"
yma16博客
"
,
userImageUrl
:
"
https://yongma16.xyz/staticFile/common/img/aiTop.jpg
"
,
...
...
@@ -16,7 +18,7 @@ Page({
hasUserInfo
:
false
,
isloading
:
true
,
isOldVersion
:
false
,
isShowBottom
:
true
isShowBottom
:
true
},
getUserInfoBtn
:
function
(
info
)
{
wx
.
showLoading
({
...
...
@@ -50,26 +52,117 @@ Page({
userImageUrl
:
avatarUrl
,
})
},
joinProfile
(
e
)
{
const
userInfo
=
{
nickName
:
this
.
data
.
userName
,
avatarUrl
:
this
.
data
.
userImageUrl
getOpenid
(
resolve
,
reject
)
{
wx
.
showLoading
({
title
:
'
微信登录中
'
,
})
const
baseUrl
=
this
.
data
.
baseUrl
wx
.
login
({
success
(
res
)
{
if
(
res
.
code
)
{
//发起网络请求
const
path
=
'
/common-api/wxProgramLogin/
'
wx
.
request
({
url
:
baseUrl
+
path
,
method
:
'
GET
'
,
data
:
{
code
:
res
.
code
},
success
:
(
res
=>
{
console
.
log
(
'
res
'
,
res
)
console
.
log
(
'
res.data
'
,
res
.
data
.
data
)
wx
.
setStorageSync
(
'
currentOpenid
'
,
res
&&
res
.
data
?
res
.
data
.
data
:
null
)
resolve
&&
resolve
()
wx
.
hideLoading
()
}),
fail
:
r
=>
{
console
.
log
(
'
cloud r
'
,
r
)
wx
.
hideLoading
()
reject
&&
reject
()
}
})
}
else
{
console
.
log
(
'
登录失败!
'
+
res
.
errMsg
)
wx
.
hideLoading
()
reject
&&
reject
()
}
},
fail
:
r
=>
{
console
.
log
(
'
r
'
,
r
)
wx
.
hideLoading
()
reject
&&
reject
()
// wx.hideLoading()
}
})
},
// 登录
loginSpringCloud
()
{
const
openId
=
wx
.
getStorageSync
(
'
currentOpenid
'
)
const
wxOpenId
=
openId
&&
openId
.
openid
const
headers
=
{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
}
const
params
=
{
wx_open_id
:
wxOpenId
,
wx_name
:
this
.
data
.
userName
,
wx_img
:
this
.
data
.
userImageUrl
}
if
(
!
this
.
data
.
userName
){
wx
.
showModal
({
const
baseCloudUrl
=
'
https://yongma16.xyz/cloudApi/
'
const
baseLoginCloudPath
=
'
userModel/register
'
wx
.
request
({
url
:
baseCloudUrl
+
baseLoginCloudPath
,
headers
:
headers
,
data
:
params
,
method
:
'
POST
'
,
success
:
(
res
=>
{
console
.
log
(
'
springcloud res login
'
,
res
)
}),
fail
:
r
=>
{
console
.
log
(
'
cloud login error
'
,
r
)
}
})
},
// 进入
joinProfile
(
info
)
{
const
thisBack
=
this
console
.
log
(
'
userinfo
'
,
info
)
this
.
getOpenid
((
info
)
=>
{
console
.
log
(
'
spring登录
'
)
thisBack
.
loginSpringCloud
()
if
(
info
&&
info
.
detail
)
{
const
rowData
=
info
.
detail
.
rawData
?
JSON
.
parse
(
info
.
detail
.
rawData
)
:
{
nickName
:
''
,
avatarUrl
:
''
}
this
.
setData
({
userImageUrl
:
rowData
.
avatarUrl
||
thisBack
.
data
.
userImageUrl
,
userName
:
rowData
.
nickName
||
thisBack
.
data
.
userName
,
userInfo
:
rowData
})
const
userInfo
=
{
nickName
:
rowData
.
nickName
||
thisBack
.
data
.
userName
,
avatarUrl
:
rowData
.
avatarUrl
||
thisBack
.
data
.
userImageUrl
,
userInfo
:
rowData
}
thisBack
.
setData
({
userInfo
:
userInfo
,
hasUserInfo
:
true
})
wx
.
setStorageSync
(
'
currentUserInfo
'
,
userInfo
)
console
.
log
(
'
rowData
'
,
rowData
)
}
thisBack
.
jumpTohome
()
},
()
=>
{
wx
.
setStorageSync
(
'
currentUserInfo
'
,
null
)
return
wx
.
showModal
({
cancelColor
:
'
cancelColor
'
,
title
:
'
昵称不能为空!
'
title
:
thisBack
.
data
.
loginErrorTitle
||
'
登录失败
'
,
content
:
thisBack
.
data
.
loginErrorContent
||
'
请检查网络或联系微信cse-yma16
'
})
return
}
console
.
log
(
'
userInfo
'
,
userInfo
)
wx
.
setStorageSync
(
'
currentUserInfo
'
,
userInfo
)
this
.
setData
({
userInfo
:
userInfo
,
hasUserInfo
:
true
// thisBack.jumpTohome()
})
// wx.hideLoading();
// 跳转到home
this
.
jumpTohome
()
//
this.jumpTohome()
},
getUserProfile
(
e
)
{
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
...
...
@@ -126,7 +219,9 @@ Page({
designPlaceholder
:
authorPageConfig
.
designPlaceholder
,
isOldVersion
:
authorPageConfig
.
isOldVersion
,
joinTitle
:
authorPageConfig
.
joinTitle
,
isShowBottom
:
authorPageConfig
.
isShowBottom
isShowBottom
:
authorPageConfig
.
isShowBottom
,
loginErrorTitle
:
authorPageConfig
.
loginErrorTitle
,
loginErrorContent
:
authorPageConfig
.
loginErrorContent
})
// this.jumpTohome()
// 页面创建时执行
...
...
miniprogram/pages/index/index.wxml
浏览文件 @
be829878
...
...
@@ -32,7 +32,7 @@
<view class="login-container">
<button type="primary" plain="true" bindtap="getUserProfile" class="user-login" bindgetuserinfo="getUserInfoBtn" wx:if="{{isOldVersion}}">{{loginTitle}}</button>
<button type="primary" plain="true" 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>
</view>
</view>
<view class="loading-container">
...
...
miniprogram/pages/life/life.js
浏览文件 @
be829878
...
...
@@ -114,18 +114,7 @@ Component({
console
.
log
(
'
res
'
,
res
)
const
data
=
res
.
data
const
articleStr
=
data
&&
data
.
article
&&
data
.
article
const
markdownText
=
app
.
towxml
(
articleStr
,
'
markdown
'
,{
theme
:
'
light
'
,
//主题 dark 黑色,light白色,不填默认light
base
:
baseUrl
+
path
,
events
:{
//为元素绑定的事件方法
tap
:
e
=>
{
console
.
log
(
'
tap
'
,
e
);
},
change
:
e
=>
{
console
.
log
(
'
todo
'
,
e
);
}
}
});
const
markdownText
=
app
.
changeMrkdownText
(
articleStr
)
that
.
setData
({
isLoading
:
false
,
article
:
markdownText
...
...
miniprogram/pages/life/life.wxss
浏览文件 @
be829878
...
...
@@ -3,12 +3,12 @@
position: relative;
width: 100vw;
height:calc(100vh - 60px);
color:#ff00aa;
/* color:#ff00aa; */
background: #fff; /* fallback for old browsers */
overflow: hidden;
animation-name:backdiv;
/*
animation-name:backdiv;
animation-duration: 6s;
animation-iteration-count: infinite;
animation-iteration-count: infinite;
*/
box-sizing: border-box;
}
.container-box{
...
...
@@ -16,6 +16,7 @@
width: 100vw;
height: calc(100vh - 60px);
overflow: auto;
user-select: text;
}
.blog-container{
width: 100vw;
...
...
@@ -71,7 +72,6 @@
}
.container-life-right{
position: relative;
padding-right:20px;
}
.container-life-right-font{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录