提交 994999f9 编写于 作者: yma16's avatar yma16

openai

上级 8b18f523
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="remoteHost">
<serverData>
<paths name="remoteHost">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/yma16_program.iml" filepath="$PROJECT_DIR$/.idea/yma16_program.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="00555708-3c7d-43c9-8c19-94a9c84a9787" name="remoteHost" url="http://yongm16.xyz">
<fileTransfer host="yongm16.xyz" port="22" accessType="SFTP">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
<option name="port" value="22" />
</fileTransfer>
</webServer>
</option>
</component>
</project>
\ No newline at end of file
<?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" />
<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.wxss" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
<ignored path="$PROJECT_DIR$/tmp/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/miniprogram/pages/home/home.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="18" column="19" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/miniprogram/pages/home/home.js" />
</list>
</option>
</component>
<component name="ProjectConfigurationFiles">
<option name="files">
<list>
<option value="$PROJECT_DIR$/.idea/yma16_program.iml" />
<option value="$PROJECT_DIR$/.idea/misc.xml" />
<option value="$PROJECT_DIR$/.idea/modules.xml" />
<option value="$PROJECT_DIR$/.idea/vcs.xml" />
<option value="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
</list>
</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" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="yma16_program" type="b2602c69:ProjectViewProjectNode" />
<item name="yma16_program" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="yma16_program" type="b2602c69:ProjectViewProjectNode" />
<item name="yma16_program" type="462c0819:PsiDirectoryNode" />
<item name="cloudfunctions" 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" />
</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" />
</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="home" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="true" />
<property name="WebServerToolWindowPanel.toolwindow.highlight.mappings" value="true" />
<property name="WebServerToolWindowPanel.toolwindow.highlight.symlinks" value="true" />
<property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
<property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
<property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="14febd48-e5b8-4a4f-b997-f51453650c39" name="Default Changelist" comment="" />
<created>1665923387310</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1665923387310</updated>
<workItem from="1665923390899" duration="1623000" />
<workItem from="1666014780446" duration="183000" />
</task>
<task id="LOCAL-00001" summary="feat:可视化部分">
<created>1665930867783</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1665930867784</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="1806000" />
</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.25266525" />
<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" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<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 anchor="bottom" id="Version Control" order="8" />
<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" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="feat:可视化部分" />
<option name="LAST_COMMIT_MESSAGE" value="feat:可视化部分" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/miniprogram/pages/home/home.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="18" column="19" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -11,7 +11,7 @@ App({
* @type object[{name:'',adcode:''}]
*/
geoAdcodeMap:[],
targetItem:{}
targetItem:{},
},
remoteConfig:{
baseUrl:'https://yongma16.xyz'
......@@ -53,6 +53,7 @@ App({
this.setData({
globalData:{userInfo: res.userInfo,hasUserInfo: true},
})
wx.setStorageSync('currentUserInfo', res.userInfo)
}
})
......
......@@ -4,7 +4,7 @@
flex-direction: column;
align-items: center;
box-sizing: border-box;
color: #fff;
color: rgb(255, 255, 255);
}
button {
......
/* components/base/blockInfo/blockInfo.wxss */
.container-block{
width: 100vw;
width: 100%;
margin-top: 30px;
background: rgba(255,255,255,0.8);
padding: 10px;
background: rgba(255,255,255,0);
padding: 30px 0;
text-align: center;
}
.total-container{
display: flex;
width: 100vw;
width: 100%;
font-weight: bold;
}
.block{
......@@ -24,6 +24,7 @@
}
.block-title{
font-weight: bold;
margin:20px 0 5px 0;
background: cornflowerblue;
}
.block-uni-title{
......
......@@ -5,5 +5,5 @@
margin-top: 50px;
width:100vw;
height:300px;
background: rgba(255,255,255,0.8);
background: rgba(255,255,255,0);
}
// components/visualComponent/lineChart/lineChart.js
import * as echarts from '../../../ec-canvas/ec-canvas/echarts';
const app=getApp();
const app = getApp();
function initChart(canvas, width, height, dpr) {
const geoAdcodeMap = [...app.globalData.geoAdcodeMap]
const targetItem = {...app.globalData.hotData.targetItem};
const targetItem = { ...app.globalData.hotData.targetItem };
/**
* @type object data热力值 max最大值
*/
......@@ -33,13 +33,14 @@ function initChart(canvas, width, height, dpr) {
devicePixelRatio: dpr
});
canvas.setChart(chart);
const lineObj={
labelArray:[],
totalData:[],
todayData:[]
const lineObj = {
labelArray: [],
totalData: [],
todayData: []
}
hotObj.data.forEach(item=>{
lineObj.labelArray.push(item.name)
hotObj.data.forEach(item => {
const name = item.name.toString().includes('黔南') ? '黔南' : item.name.toString().substring(0, 3);
lineObj.labelArray.push(name)
lineObj.totalData.push(item.totalConfirm)
lineObj.todayData.push(item.todayConfirm)
})
......@@ -54,13 +55,13 @@ function initChart(canvas, width, height, dpr) {
},
legend: {
data: ['累计确诊', '新增确诊'],
},
toolbox: {
show: false,
orient: 'vertical',
left: 'right',
top: 'center',
show: true,
feature: {
// dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] },
......@@ -72,13 +73,18 @@ function initChart(canvas, width, height, dpr) {
xAxis: [
{
type: 'category',
// prettier-ignore
data: lineObj.labelArray
data: lineObj.labelArray,
axisLabel: {
show: true,
formatter: function (value) {
return value.split("").join("\n");
}
}
}
],
yAxis: [
{
type: 'value'
type: 'value',
}
],
series: [
......
......@@ -4,5 +4,5 @@
margin-top: 30px;
width: 100vw;
height: 350px;
background: rgba(255,255,255,0.8);
background: rgba(255,255,255,0);
}
\ No newline at end of file
......@@ -101,7 +101,6 @@ Component({
* @param {*} title
*/
setArticleNode(articleStr,title){
console.log('接受',articleStr,title)
const markdownText = app.towxml(articleStr,'markdown',{
       theme:'light', //主题 dark 黑色,light白色,不填默认light
events:{ //为元素绑定的事件方法
......@@ -119,6 +118,12 @@ Component({
currentTitle:title
})
},
clearArticleNode(){
this.setData({
article:null,
currentTitle:'加载中...'
})
},
onMyButtonTap: function(){
this.setData({
// 更新属性和数据的方法与更新页面数据的方法类似
......
<!--pages/blog/blog.wxml-->
<view class="container-blog">
<view class="blog-title">
{{currentTitle}}
</view>
<view class="loading" wx:if="{{isLoading}}">
<view class="loader-child"/>
<view class="loader-child"/>
<view class="loader-child"/>
</view>
<view class="blog-title">
{{currentTitle}}
<view class="blog-container-box">
<towxml nodes="{{article}}" class="blog-container"/>
</view>
<towxml nodes="{{article}}" class="blog-container"/>
</view>
......@@ -2,9 +2,9 @@
.container-blog{
position: relative;
width: 100vw;
height:100vh;
height:90vh;
background: rgba(255,255,255,0.8); /* fallback for old browsers */
overflow: auto;
overflow: hidden;
}
.loading{
......@@ -13,21 +13,29 @@
height: 100px;
perspective: 780px;
position: relative;
top:25%;
top:20%;
left:50%;
transform: translate(-50%,-25%);
transform: translate(-50%,-20%);
}
.blog-container-box{
width: 100vw;
height: calc(100vh - 110px);
overflow: auto;
}
.blog-container{
margin-top:30px;
margin-top:100px;
width: 100vw;
height: 100vh;
height: auto;
margin-bottom:10px;
}
.blog-title{
text-align: center;
font-weight: bold;
background: rgb(114, 158, 240);
position: absolute;
background: rgba(114, 158, 240);
color: #ffffff;
position: relative;
margin:0;
padding:0;
padding: 10px;
width: 100%;
min-height: 20px;
}
\ No newline at end of file
......@@ -9,15 +9,40 @@ Component({
options: {
addGlobalClass: true,
},
// 属性定义
properties: {
// 用户信息
userInfo: {
type: Object,
value: ()=>{
return {
}
},
observer: function(newVal, oldVal) {
// 属性值变化时执行
console.log(newVal,oldVal,'change')
}
}
},
/**
*组件的初始数据
*/
data: {
content: '子组件的content',
btnType:'map',
homeHeaderItem: '',
isLoading: false,
article: { 'key': 12 },
mode:'introduce',
article:{},
articleId:44,
baseUrl:'https://yongma16.xyz/api/',
path:'article/blog/',
currentUserInfo:{
nickName:'',
avatarUrl:''
},
aiConfig:{
avatarUrl:'https://yongma16.xyz/staticFile/common/img/aiTop.jpg',
bgUrl:'https://yongma16.xyz/staticFile/common/img/aiBg.jpg'
},
searchOpenAiText:'',
responseText:'',
// questions,answer,index
......@@ -29,13 +54,11 @@ Component({
}],
currentIndex:0
}
},
observers: {
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
attached: function () {
this.getRemoteArticle(this.data.articleId)
if(wx.getStorageSync('openAiOptions')){
this.setData(
{
......@@ -43,6 +66,16 @@ Component({
}
)
}
if(wx.getStorageSync('currentUserInfo')){
console.log('currentUserInfo',wx.getStorageSync('currentUserInfo'))
this.setData(
{
currentUserInfo:wx.getStorageSync('currentUserInfo')
}
)
}
},
moved: function () { },
detached: function () {
......@@ -50,20 +83,52 @@ Component({
},
},
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
// attached: function () { }, // 此处 attached 的声明会被 lifetimes 字段中的声明覆盖
// ready: function() { },
pageLifetimes: {
// 组件所在页面的生命周期函数
show: function () {
console.log('pageLifetimes')
},
hide: function () { },
resize: function () { },
},
methods: {
getRemoteArticle:function(id){
this.setData({
isLoading:true
})
const baseUrl=this.data.baseUrl
const path=this.data.path
const headers = {'Content-Type':'application/json;charset=UTF-8'}
const that=this
const params={
id:id
}
wx.request({
url: baseUrl+path,
headers:headers,
data:params,
method:'POST',
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);
}
}
});
that.setData({
isLoading:false,
article:markdownText
})
}
});
},
changeMode(e){
const {mode}=e.currentTarget.dataset
console.log(mode,'mode')
this.setData({
mode:mode
})
},
bindKeyInput(e) {
const {columnIndex}=e.currentTarget.dataset
console.log('this.data.chatObjConfig',this.data.chatObjConfig)
......@@ -91,6 +156,7 @@ Component({
cancelColor: 'cancelColor',
title:'请输入!'
})
return
}
wx.showLoading({
title: '加载中',
......@@ -138,117 +204,21 @@ Component({
thisBack.setData(
{
isLoading: false,
searchOpenAiText:'',
chatObjConfig:chatObjConfig
}
)
setTimeout(function () {
wx.hideLoading()
}, 2000)
wx.hideLoading()
resolve(res)
},
fail: error => {
thisBack.setData({
isLoading: false
})
setTimeout(function () {
wx.hideLoading()
}, 2000)
reject(error)
wx.hideLoading()
}
});
})
},
clickHeadBtn(e){
console.log(e)
const {btnType}=e.currentTarget.dataset
this.setData(
{btnType:btnType}
)
},
async initData() {
await this.getGeoJson()
await this.getOutBreakData()
this.setData({
isLoading: false
})
},
getGeoJson() {
if(app.globalData.geoJson){
return new Promise(resolve=>{
resolve()
})
}
const path = '/common-api/mapApp/getGeoJson/'
const headers = { 'Content-Type': 'application/json;charset=UTF-8' }
return new Promise((resolve, reject) => {
wx.request({
url: baseUrl + path,
headers: headers,
method: 'GET',
success: (res) => {
app.globalData.geoJson = res.data.data
const geoAdcodeMap = []
app.globalData.geoJson.features.map(item => {
const { properties } = item
geoAdcodeMap.push({
name: properties.name,
adcode: properties.adcode
})
})
app.globalData.geoAdcodeMap = [...geoAdcodeMap]
resolve(res.data.data)
},
fail: error => {
reject(error)
}
});
})
},
getOutBreakData() {
if(app.globalData.hotData){
return new Promise(resolve=>{
resolve()
})
}
const path = '/common-api/mapApp/outBreak/'
const headers = { 'Content-Type': 'application/json;charset=UTF-8' }
return new Promise((resolve, reject) => {
wx.request({
url: baseUrl + path,
headers: headers,
method: 'GET',
success: (res) => {
app.globalData.hotData = res.data.data
/**
* @type {string} 贵州省 adcode
*/
const targetAdcode = "520000"
const targetItem = app.globalData.hotData.areaTree[0].children.find(item => { return item.adcode === targetAdcode })
app.globalData.hotData.targetItem={...targetItem}
resolve(res.data.data)
},
fail: error => {
reject(error)
}
});
})
},
onMyButtonTap: function () {
this.setData({
// 更新属性和数据的方法与更新页面数据的方法类似
})
},
// 内部方法建议以下划线开头
_myPrivateMethod: function () {
// 这里将 data.A[0].B 设为 'myPrivateData'
// this.setData({
// 'A[0].B': 'myPrivateData'
// })
},
_propertyChange: function (newVal, oldVal) {
}
}
})
\ No newline at end of file
......@@ -2,6 +2,7 @@
"usingComponents": {
"geoMap":"/components/visualComponent/geoMap/geoMap",
"lineChart":"/components/visualComponent/lineChart/lineChart",
"blockInfo":"/components/base/blockInfo/blockInfo"
"blockInfo":"/components/base/blockInfo/blockInfo",
"towxml":"/towxml/towxml"
}
}
\ No newline at end of file
}
<!--pages/future/future.wxml-->
<view class="container-future">
<view class="container-future" style="background: {{currentUserInfo.bgUrl}};">
<!-- <view class="header-container"> -->
<!-- <view >
<view class="flex-container">
......@@ -8,28 +8,49 @@
<view class="header-btn" class="{{btnType==='line'? 'actived':'btn-default'}}" bindtap="clickHeadBtn" data-btn-type='line'>折线图</view>
<view class="header-btn" class="{{btnType==='blockInfo'? 'actived':'btn-default'}}" bindtap="clickHeadBtn" data-btn-type='blockInfo'>分类信息</view>
</view> -->
<view class="form-container-api">
<view class="form-container-introduce" wx:if="{{mode==='introduce'}}">
<view class="header-box" style="display: flex;">
<view style="width: 50%;">
<button style="width: 100%;" type="primary" style="background: rgb(8, 183, 252);" loading="{{isLoading}}">api介绍</button>
</view>
<view style="width:50%">
<button style="width: 100%;" type="primary" style="background: rgb(0, 114, 221);" bindtap="changeMode" loading="{{isLoading}}" data-mode='openAiUse'>使用</button>
</view>
</view>
<view class="container-box-article">
<towxml nodes="{{article}}"/>
</view>
</view>
<view class="form-container-api" wx:if="{{mode==='openAiUse'}}">
<view>
<button style="width: 100%;" type="primary" formType="submit">openai调用</button>
<button style="width: 100%;" type="primary" bindtap="changeMode" loading="{{isLoading}}" data-mode='introduce'>返回介绍</button>
</view>
<view class="chat-container">
<view wx:for="{{ chatObjConfig.option }}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="form-request">
<view wx:if="{{item.isEdit}}">问:$ <input bindinput="bindKeyInput" placeholder="输入关键词" data-column-index="{{index}}" disabled="{{isLoading}}" /></view>
<view wx:else class='questioned'>
<view>
问:$ {{item.question}}
<view wx:if="{{item.isEdit}}">
<image class="user-image" src="{{currentUserInfo.avatarUrl}}"></image>
<view style="display: inline;">({{currentUserInfo.nickName}}): </view>
<input bindinput="bindKeyInput" style="display: inline;" placeholder="关键词查询" data-column-index="{{index}}" disabled="{{isLoading}}" />
</view>
<view wx:else class='questioned'>
<view>
<image class="user-image" src="{{currentUserInfo.avatarUrl}}"></image> ({{currentUserInfo.nickName}}):$ {{item.question}}
</view>
</view>
</view>
<view class="form-response">
<view class='questioned'>openai回答:$ {{item.answer}}</view>
<view class='questioned'>
<image class="ai-image" src="{{aiConfig.avatarUrl}}"></image>
(openai):$ {{item.answer}}
</view>
</view>
</view>
</view>
<view class="form-submit">
<button style="width: 100%;" type="primary" bindtap="search" loading="{{isLoading}}" disabled="{{isLoading}}">发送</button>
<view class="form-submit" wx:if="{{mode==='openAiUse'}}">
<button style="width: 100%;" type="primary" bindtap="search" loading="{{isLoading}}">发送</button>
</view>
</view>
<view class="loading" wx:if="{{isLoading}}">
......
/* pages/homeContent/homeContent.wxss */
.container-future{
.container-future {
position: relative;
width: 100vw;
height:100vh;
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-repeat: repeat;
background-size: 10px 10px;
......@@ -11,112 +11,156 @@
box-sizing: border-box;
}
.loading{
.loading {
position: absolute;
width: 100px;
height: 100px;
perspective: 780px;
position: relative;
top:25%;
left:50%;
transform: translate(-50%,-25%);
top: 25%;
left: 50%;
transform: translate(-50%, -25%);
}
.container-box{
.container-box {
position: relative;
width: 100%;
height: 100vh;
overflow: auto;
}
.header-container{
.header-container {
position: absolute;
height:30px;
height: 30px;
width: 100%;
}
.content-container{
margin-top:30px;
.content-container {
margin-top: 30px;
position: absolute;
height:100vh;
height: 100vh;
width: 100%;
overflow: auto;
}
.flex-container{
.flex-container {
display: flex;
justify-content: center;
align-items: center;
line-height: 30px;
}
.header-container{
.header-container {
width: 100vw;
}
.header-btn{
color:#262626;
margin:0;
padding:0;
.header-btn {
color: #262626;
margin: 0;
padding: 0;
}
.title{
color:#ffffff;
flex:1;
.title {
color: #ffffff;
flex: 1;
font-size: 12px;
line-height: 30px;
text-align: center;
background: rgb(252, 37, 8);
}
button{
button {
border-radius: 0;
outline: none;
font-weight: normal;
}
.btn-default{
color:#262626;
flex:1;
width:300px;
.btn-default {
color: #262626;
flex: 1;
width: 300px;
text-align: center;
background-color: #ffffff;
}
.actived{
.actived {
color: #ffffff;
flex:1;
flex: 1;
text-align: center;
background-color: rgb(8, 183, 252);
}
.form-container-api{
.form-container-api {
display: block;
height:auto;
height: auto;
width: 100%;
}
.form-request{
.form-request {
display: block;
width: 100%;
color:#07c160;
color: #07c160;
background-color: rgb(37, 0, 97);
line-height: 50px;
padding: 5px;
}
.form-response{
.form-response {
position: relative;
width: 100%;
margin-top: 10px;
display: block;
margin-bottom: 10px;
color:#07c160;
background-color: rgb(0, 72, 94);
color: #07c160;
background-color: rgb(0, 72, 94);
}
.form-class-submit{
.form-class-submit {
margin-top: 10px;
display: block;
width: 100%;
background-color: rgb(248, 70, 0);
}
.form-submit-btn{
.form-container-introduce {
position: relative;
width: 100%;
display: block;
height: calc(100vh - 60px);
}
.chat-container{
margin-top:20px;
.container-box-article{
position: relative;
width: 100%;
height: 336px;
height: calc(100vh - 100px);
overflow: auto;
}
.chat-container {
margin-top: 10px;
width: 100%;
height: calc(100vh - 100px);
overflow: auto;
position: relative;
}
.user-image-box {
width: 200px;
height: 140px;
text-align: center;
align-items: center;
}
.user-image {
position: relative;
width: 15px;
height: 15px;
border-radius: 50%;
}
.ai-image {
position: relative;
width: 20px;
height: 20px;
border-radius: 50%;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ Page({
*/
data: {
title: 'header',
userInfo: '',
userInfo: {},
content: '我是父组件的content',
footContent: "bottomContent",
headBackground: [
......@@ -40,6 +40,15 @@ Page({
console.log('监听', newVal, oldVal)
}
},
/**
* 用户信息配置
*/
setCurrentUserInfo(userInfo){
console.log('事件触发userInfo',userInfo)
this.setData({
userInfo:userInfo
})
},
/**
* 获取文章
*/
......
......@@ -6,9 +6,9 @@
<view class="container-menu-mask" wx:if="{{menuIsShow}}"></view>
<view class="container-menu" wx:if="{{menuIsShow}}">
<view class="arrow-right" bindtap="menuSwitch"></view>
<view class="btn-ul">
<view class="btn-ul" style="margin-top: 10px;font-weight: bold;position: absolute;">
记忆碎片</view>
<view class='menu-box'>
<view class='menu-box' style="margin-top: 40px;">
<block wx:for="{{titleObj}}" wx:key="*this">
<view class="blog-title {{currentArticleId===item.id? 'title-actived':''}}" bindtap="clickBlogTitleBtn" data-title="{{item.title}}" data-id="{{item.id}}">{{item.title}}</view>
</block>
......@@ -34,13 +34,13 @@
<home-content class='home-content-class' headerItem='{{content}}' wx:if="{{bottomBtn==='front'}}" id="home-content-id"></home-content>
<blog class='home-content-class' id="blog-id" wx:if="{{bottomBtn==='blog'}}" bind:updateArticleMenu="updateArticleMenu"></blog>
<future class='home-content-class' wx:if="{{bottomBtn==='target'}}"></future>
<life class='home-content-class' wx:if="{{bottomBtn==='life'}}"></life>
<life class='home-content-class' wx:if="{{bottomBtn==='life'}}" bindUserinfo="{{userInfo}}"></life>
</view>
<view class="container-footer">
<view class="container-footer-btn-menu">
<view class="default-btn active {{bottomBtn==='front'? 'btn-actived':''}}" bindtap="clickBottomBtn" data-label='front'>主页</view>
<view class="default-btn active {{bottomBtn==='blog'? 'btn-actived':''}}" bindtap="clickBottomBtn" data-label='blog'>博客</view>
<view class="default-btn active {{bottomBtn==='target'? 'btn-actived':''}}" bindtap="clickBottomBtn" data-label='target'>可视化</view>
<view class="default-btn active {{bottomBtn==='target'? 'btn-actived':''}}" bindtap="clickBottomBtn" data-label='target'>api管理</view>
<view class="default-btn active {{bottomBtn==='life'? 'btn-actived':''}}" bindtap="clickBottomBtn" data-label='life'>关于</view>
</view>
</view>
......
......@@ -152,6 +152,7 @@ page {
position: relative;
width: 100%;
height:100%;
background: #262626;
}
.container-footer{
position: absolute;
......@@ -167,7 +168,7 @@ page {
flex-wrap: nowrap;
width:100vw;
background-color: white;
/* border:1px solid rgb(255, 136, 0); */
border-top:2px solid rgba(0, 183, 255,.5);
bottom:0;
}
.default-btn{
......
......@@ -93,6 +93,14 @@ Component({
}
});
},
/**
* 清空
*/
clearArticle(){
this.setData({
article:null
})
},
onMyButtonTap: function(){
this.setData({
// 更新属性和数据的方法与更新页面数据的方法类似
......
......@@ -6,5 +6,7 @@
<view class="loader-child"/>
<view class="loader-child"/>
</view>
<towxml nodes="{{article}}"/>
<view class="container-box">
<towxml nodes="{{article}}" class="container-box-content"/>
</view>
</view>
......@@ -4,7 +4,7 @@
width: 100vw;
height:100vh;
background: rgba(255,255,255,0.8); /* fallback for old browsers */
overflow: auto;
overflow: hidden;
}
.loading{
......@@ -18,6 +18,12 @@
transform: translate(-50%,-25%);
}
.container-box{
position: relative;
height: calc(100vh - 212px);
overflow: auto;
}
......
......@@ -4,16 +4,17 @@
Page({
data: {
detailInfo:'关于:前端程序员的生活博客',
detailInfo: '关于:前端程序员的生活博客',
title: "yma16博客",
userImageUrl: "https://yongma16.xyz/staticFile/common/img/logo.png",
loginTitle: "点击授权",
userName: '',
userInfo: {},
hasUserInfo: false,
isloading:true,
isloading: true,
},
getUserInfoBtn: function (info) {fgetUserProfile
getUserInfoBtn: function (info) {
fgetUserProfile
wx.showLoading({
title: '授权中',
});
......@@ -21,11 +22,11 @@ Page({
if (info && info.detail) {
const rowData = info.detail.rawData ? JSON.parse(info.detail.rawData) : { nickName: '未授权用户', avatarUrl: '' }
this.setData({
userImageUrl: rowData.avatarUrl
})
this.setData({
userName: rowData.nickName
userImageUrl: rowData.avatarUrl,
userName: rowData.nickName,
userInfo:rowData
})
wx.setStorageSync('currentUserInfo',rowData)
console.log('rowData', rowData)
}
wx.hideLoading();
......@@ -36,17 +37,13 @@ Page({
wx.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log('信息',res)
console.log('信息', res)
console.log('信息', res.userInfo)
wx.setStorageSync('currentUserInfo',res.userInfo)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
// 全局变量
try {
wx.setStorageSync('currentUserInfo', JSON.stringify(this.userInfo))
} catch (e) {
console.warn('获取用户信息报错',this.userInfo)
}
// 跳转到home
this.jumpTohome()
}
......@@ -54,8 +51,13 @@ Page({
},
// 跳转到home
jumpTohome: function () {
const thisBack = this
wx.navigateTo({
url: '/pages/home/home'
url: '/pages/home/home',
success: function (res) {
// 通过 eventChannel 向被打开页面传送数据
res.eventChannel.emit('setCurrentUserInfo', thisBack.data.userInfo)
}
})
},
onLoad: function (options) {
......
......@@ -9,7 +9,6 @@
<view class="login-container">
<button type="primary" plain="true" bindtap="getUserProfile" class="user-login" bindgetuserinfo="getUserInfoBtn">{{loginTitle}}</button></view>
</view>
<view class="loading-container">
<view class="loading" wx:if="isloading">
......
......@@ -8,26 +8,4 @@
<view class='container-box'>
<towxml nodes="{{article}}" class="blog-container"/>
</view>
<!-- <view class='gril-friend'>
<view class="gril-friend-header">
<view>遇见</view>
<view>在一起:{{togetherDate}}</view>
</view>
<view class="box">
<view class='heart'></view></view>
<view class="gril-friend-content">{{content}}</view>
<view class="gril-friend-bottom">
<view class='gril-friend-content-left'>
<view >一语寄相思</view>
</view>
<view class='gril-friend-content-right'> -->
<!-- <view>
柚屿</view> -->
<!-- <view class='container-life-right-font'>
yma16</view>
</view>
</view>
</view>
<view class='beat-heart'></view> -->
</view>
......@@ -2,18 +2,24 @@
.container-life{
position: relative;
width: 100vw;
height:100vh;
height:calc(100vh - 60px);
color:#ff00aa;
background: #fff; /* fallback for old browsers */
overflow: hidden;
animation-name:backdiv;
animation-duration: 6s;
animation-iteration-count: infinite;
box-sizing: border-box;
}
.container-box{
position: relative;
width: 100vw;
height:100vh;
height: calc(100vh - 60px);
overflow: auto;
}
.blog-container{
width: 100vw;
overflow: auto;
}
.loading{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册