diff --git a/miniprogram/app.js b/miniprogram/app.js
index 026c88f6e8744c25478a3af74cae8ff382ff488c..71cba3f86a77171d161c6b3143387c8d0bf7be1b 100644
--- a/miniprogram/app.js
+++ b/miniprogram/app.js
@@ -12,7 +12,7 @@ App({
userPrefix: '昵称:',
userName: '月牙天冲',
designPlaceholder: '自定义名称',
- joinTitle: '进入',
+ joinTitle: '微信登录',
isOldVersion: false
},
homePageConfig: {
@@ -35,7 +35,7 @@ App({
avatarUrl: 'https://yongma16.xyz/staticFile/common/img/aiTop.jpg',
bgUrl: 'https://yongma16.xyz/staticFile/common/img/aiBg.jpg'
},
- mode: 'openAiUse',
+ mode: 'introduce',
option: 'introduce,openAiUse',
layoutConfig: {
introduceText: 'api介绍',
@@ -46,14 +46,15 @@ App({
reportText: '复制数据',
copyText: '复制',
pasteText: '粘贴',
- upText: "↑",
- downText: "↓",
+ upText: "",
+ downText: "",
errorMsg: 'openai的服务器异常!',
emptyText: '欢迎',
storageKey: 'openAiOptionsConfig',
permissionTitle: '很抱歉您没有权限!',
permissionContent: '请联系微信号:cse-yma16\r\n 需要1元开通权限\r\n1元可支持100条消息!',
wxInfoImg: 'https://yongma16.xyz/staticFile/common/img/userInfo.png',
+ isShowOpenAi:true,
limitMsgCount: 10,
confirmText: '添加微信',
cancelText: '返回'
@@ -104,6 +105,31 @@ App({
}
});
return markdownText
+ },
+ /**
+ * 转换html
+ * @param {string} text
+ */
+ changeHtmlText(text) {
+ const markdownText = this.towxml(text, 'html', {
+ 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 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss
index 91f0cd088cb0be8aeca6384fc043b9b10f3dabf5..ac24012ad17bb2218e70043010fc99292d71301b 100644
--- a/miniprogram/app.wxss
+++ b/miniprogram/app.wxss
@@ -1,4 +1,7 @@
/**app.wxss**/
+
+
+
.container {
display: flex;
flex-direction: column;
diff --git a/miniprogram/pages/blog/blog.wxss b/miniprogram/pages/blog/blog.wxss
index 5932516c703ea1e2bae54ef9b5485bb588c469a4..cb17a20b31b520c7c0998fa8b8085127a935cc6a 100644
--- a/miniprogram/pages/blog/blog.wxss
+++ b/miniprogram/pages/blog/blog.wxss
@@ -33,7 +33,7 @@
.blog-title{
text-align: center;
font-weight: bold;
- background: rgba(114, 158, 240);
+ background: rgba(16, 116, 187);
color: #ffffff;
position: relative;
margin:0;
diff --git a/miniprogram/pages/codeOnline/codeOnline.js b/miniprogram/pages/codeOnline/codeOnline.js
new file mode 100644
index 0000000000000000000000000000000000000000..d9cf8e07b86f73f02bd959feaddb2d4f64b57373
--- /dev/null
+++ b/miniprogram/pages/codeOnline/codeOnline.js
@@ -0,0 +1,89 @@
+// pages/codeOnline/codeOnline.js
+const app = getApp()
+Component({
+ /**
+ * 继承父级样式
+ */
+ options: {
+ addGlobalClass: true,
+ },
+
+
+
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ baseUrl: 'https://yongma16.xyz',
+ runJsPath: '/common-api/searchOpenAiText/',
+ config: {
+ title: '运行js',
+ runCodePlaceholderText: '请输入js',
+ loading: true,
+ runBtnText: '运行',
+ formatBtnText: '格式化',
+ htmlNode: ''
+ },
+ codeVal: '',
+ loading: false,
+ runCodeRes: '结果集',
+ htmlNode: '结果集'
+ },
+
+
+ lifetimes: {
+ // 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
+ attached: function () {
+ this.initData('请输入')
+ }
+ },
+ methods: {
+ initData(val) {
+ this.setData({
+ htmlNode: app.changeHtmlText(val)
+ })
+ },
+ runCode() {
+ const codeVal = this.data.codeVal
+ console.log('运行代码', codeVal)
+ const thisBack = this
+ if (codeVal) {
+ // let obj =(new Function("return "+""+codeVal+""))();
+ const data = {
+ coontent: codeVal
+ }
+ wx.request({
+ url: this.data.baseUrl + this.data.runJsPath,
+ method: 'POST',
+ data: data,
+ success: res => {
+ console.log(res, 'res')
+ const resText=res.data
+ thisBack.setData({
+ runCodeRes:resText ,
+ htmlNode: app.changeHtmlText(resText)
+ })
+ },
+ fail: r => {
+ console.log(r, r)
+ }
+ })
+
+ }
+ // // eval(this.data.codeVal)
+
+ },
+ bindKeyInput(e) {
+ this.setData({
+ codeVal: e.detail.value
+ })
+ },
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pages/codeOnline/codeOnline.json b/miniprogram/pages/codeOnline/codeOnline.json
new file mode 100644
index 0000000000000000000000000000000000000000..9dc3362d3c459dc908f0a50f315aa8ee84bd2058
--- /dev/null
+++ b/miniprogram/pages/codeOnline/codeOnline.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "towxml":"/towxml/towxml"
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/pages/codeOnline/codeOnline.wxml b/miniprogram/pages/codeOnline/codeOnline.wxml
new file mode 100644
index 0000000000000000000000000000000000000000..241bbe21685c2ff443b2d157fe1f04fd44c1be9c
--- /dev/null
+++ b/miniprogram/pages/codeOnline/codeOnline.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/codeOnline/codeOnline.wxss b/miniprogram/pages/codeOnline/codeOnline.wxss
new file mode 100644
index 0000000000000000000000000000000000000000..ca2c187e5fa59e3cf272916bf93d96dfc770246a
--- /dev/null
+++ b/miniprogram/pages/codeOnline/codeOnline.wxss
@@ -0,0 +1,71 @@
+/* pages/codeOnline/codeOnline.wxss */
+.container {
+ position: relative;
+ width: 100vw;
+ height: 90vh;
+ /* background: rgba(255, 255, 255, 0.5); */
+ /* background-image: url('https://yongma16.xyz/media/editor/wallhaven-3kqv3y_20220724071651129556.jpg');
+ background-repeat: no-repeat;
+ background-size: cover; */
+ 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;
+ /* fallback for old browsers */
+ overflow: hidden;
+}
+
+.container-header {
+ background: rgba(16, 116, 187);
+ width: 100%;
+ text-align: center;
+ color: #ffffff;
+ height: 40px;
+ line-height: 40px;
+ font-weight: bold;
+}
+.container-box{
+ position: relative;
+ background-color: rgba(255,255,255,.5);
+ width: 90%;
+ height: calc( 100vh - 100px);
+}
+.container-box-show{
+ position: relative;
+ width: 100%;
+ height: 150px;
+
+ text-align: left;
+}
+.container-box-show-btn{
+ margin-top: 5px;
+ position: relative;
+ text-align: left;
+}
+.format-btn{
+ position: relative;
+ margin-left: 10px;
+}
+
+.container-box-edit{
+ position: relative;
+ width: 100%;
+ height: 50%;
+ background: rgba(255, 255, 255, .2);
+ border: 1px solid rgb(8, 183, 252);
+ box-shadow: 0 2rpx 5rpx 5rpx rgba(255, 255, 255, .2);
+}
+.section{
+ position: relative;
+ width: 80%;
+ color: #333;
+}
+
+.container-html{
+ position: relative;
+ height: 100px;
+ width: 100%;
+ color: #333;
+ user-select: text;
+ overflow: auto;
+ border: 1px solid rgb(8, 183, 252);
+}
\ No newline at end of file
diff --git a/miniprogram/pages/future/future.js b/miniprogram/pages/future/future.js
index 1226955c6596136f3cd21121bbb6159efc6d3cab..0528621d9f3b61b02906726c03d118ae3b477b13 100644
--- a/miniprogram/pages/future/future.js
+++ b/miniprogram/pages/future/future.js
@@ -185,10 +185,11 @@ Component({
success: (res => {
console.log('cloud res userInfo', res)
if (res && res.data && res.data) {
+ console.log('res.data__________',res.data)
thisBack.setData({
// 默认十条消息
- msgCount: res.data.data[0].send_msg_count || 10,
- isVip: res.data.data[0].is_vip || 0
+ msgCount: res.data.data.data[0].send_msg_count || 10,
+ isVip: res.data.data.data[0].is_vip || 0
})
}
}),
@@ -268,6 +269,7 @@ Component({
const openId = wx.getStorageSync('currentOpenid')
const wxOpenId = openId && openId.openid
params.wx_open_id = wxOpenId
+ const thisBack=this
wx.request({
url: this.data.baseCloudUrl + this.data.baseCloudAddRecordPath,
headers: headers,
@@ -275,6 +277,7 @@ Component({
method: 'POST',
success: (res => {
console.log('cloud res', res)
+ thisBack.getUserReadCount()
}),
fail: r => {
console.log('cloud r', r)
diff --git a/miniprogram/pages/future/future.wxml b/miniprogram/pages/future/future.wxml
index 19fbaf6e2aaab2909c2d42795e330be826d49dab..3649a9fd57f8622fb354ea526a1cff6bec598c84 100644
--- a/miniprogram/pages/future/future.wxml
+++ b/miniprogram/pages/future/future.wxml
@@ -2,13 +2,13 @@