Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
55cb233b
Commit
55cb233b
authored
Apr 02, 2020
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打卡完成
parent
d024c385
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
168 additions
and
1 deletion
+168
-1
app.js
app.js
+2
-0
index.js
business/pages/themeeditor/index.js
+6
-0
index.json
business/pages/themeeditor/index.json
+2
-1
index.wxml
business/pages/themeeditor/index.wxml
+9
-0
index.js
components/richTextarea/index.js
+123
-0
index.json
components/richTextarea/index.json
+4
-0
index.wxml
components/richTextarea/index.wxml
+7
-0
index.wxss
components/richTextarea/index.wxss
+15
-0
No files found.
app.js
View file @
55cb233b
...
...
@@ -115,6 +115,7 @@ App({
originScene
:
''
,
// 页面进去的场景值
studentSchoolId
:
0
,
currentSchoolStudentId
:
0
,
sdkVersion
:
0
,
//基础库版本
},
getCurrentSchoolStudentId
(
data
)
{
return
studentidentity
({
...
...
@@ -212,6 +213,7 @@ App({
this
.
globalData
.
navHeight
=
parseInt
(
titleBarHeight
)
+
parseInt
(
statusBarHeight
);
this
.
globalData
.
windowWidth
=
res
.
windowWidth
||
375
;
this
.
globalData
.
windowHeight
=
res
.
windowHeight
;
this
.
globalData
.
sdkVersion
=
SDKVersion
}
}
catch
(
err
){
...
...
business/pages/themeeditor/index.js
View file @
55cb233b
...
...
@@ -242,6 +242,12 @@ Page({
confirmId
:
0
,
// has_subjects_count: 0
},
// // 测试
// change_editor: function (e) {
// this.setData({
// 'params.title': e.detail.value
// });
// },
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
const
that
=
this
;
const
{
...
...
business/pages/themeeditor/index.json
View file @
55cb233b
...
...
@@ -9,6 +9,7 @@
"w-cell-group"
:
"/dist/w-cell-group/index"
,
"w-pane"
:
"/dist/w-pane/index"
,
"expiredTip"
:
"../../components/expiredTip"
,
"calender"
:
"../../components/calendar"
"calender"
:
"../../components/calendar"
,
"richtext"
:
"../../../components/richTextarea"
}
}
\ No newline at end of file
business/pages/themeeditor/index.wxml
View file @
55cb233b
...
...
@@ -28,6 +28,15 @@
</view>
</view>
</view>
<!-- <view class="section-wrap pdlpdr24" style="margin-bottom: 0;">
<view class="section-item" style="padding-bottom: 8px;">
<view class="form-item title" >
<view class="item-l">测试textarea</view>
</view>
</view>
</view>
<richtext value="{{params.title}}" richStyle="padding:25rpx 0;border-top:1px solid #f0f0f0;" placeholder='此处填写标题,最多100字' bindinput="change_editor" maxlength="10000" /> -->
<view class="section-wrap pdlpdr24" style="margin-bottom: 0;">
<view class="section-item" style="padding-bottom: 8px;">
<view class="form-item title" >
...
...
components/richTextarea/index.js
0 → 100644
View file @
55cb233b
// components/richTextarea/index.js
const
app
=
getApp
();
console
.
log
(
app
.
globalData
.
sdkVersion
,
'app.globalData.sdkVersion'
);
Component
({
/**
* 组件的属性列表
*/
properties
:
{
text_height
:
{
type
:
String
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
text_height
:
newVal
?
newVal
:
"350rpx"
});
}
},
id
:
{
type
:
String
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
id
:
newVal
});
}
},
maxlength
:
{
type
:
String
,
value
:
'-1'
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
maxlength
:
newVal
});
}
},
richStyle
:
{
type
:
String
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
richStyle
:
newVal
});
}
},
placeholder
:
{
type
:
String
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
placeholder
:
newVal
});
}
},
value
:
{
type
:
String
,
observer
:
function
(
newVal
,
oldVal
)
{
this
.
setData
({
value
:
newVal
});
if
(
this
.
data
.
isFirst
)
{
this
.
setData
({
isFirst
:
false
});
this
.
setContent
(
newVal
);
}
}
},
},
/**
* 组件的初始数据
*/
data
:
{
value
:
null
,
isFirst
:
true
,
showType
:
app
.
globalData
.
sdkVersion
>=
270
?
3
:
1
//1=view;2=textarea;3=editor
},
/**
* 组件的方法列表
*/
methods
:
{
text_show
:
function
()
{
setTimeout
(()
=>
{
this
.
setData
({
showType
:
2
,
})
},
50
)
},
view_show
:
function
(
e
)
{
//失去光标 view显示 textarea隐藏
this
.
setData
({
showType
:
1
,
value
:
e
.
detail
.
value
})
},
bindinput
:
function
(
e
)
{
this
.
triggerEvent
(
"input"
,
e
.
detail
)
},
editorinput
:
function
(
e
)
{
e
.
detail
.
value
=
e
.
detail
.
text
;
this
.
triggerEvent
(
"input"
,
e
.
detail
)
},
onEditorReady
:
function
(
e
)
{
const
that
=
this
this
.
createSelectorQuery
().
select
(
'#editor'
).
context
(
function
(
res
)
{
that
.
editor
=
res
.
context
;
}).
exec
();
},
setContent
:
function
(
value
)
{
let
showType
=
this
.
data
.
showType
;
if
(
showType
==
3
)
{
if
(
this
.
editor
)
{
this
.
editor
.
setContents
({
html
:
value
});
wx
.
pageScrollTo
({
scrollTop
:
0
,
duration
:
0
})
}
else
{
setTimeout
(()
=>
{
this
.
setContent
(
value
);
},
50
)
}
}
},
}
})
\ No newline at end of file
components/richTextarea/index.json
0 → 100644
View file @
55cb233b
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
components/richTextarea/index.wxml
0 → 100644
View file @
55cb233b
<!--components/richTextarea/index.wxml-->
<view style='{{richStyle}}'>
<view class='textarea placeholder-tip' style='min-height:{{text_height}}' wx:if='{{showType==1&&(value==null||value=="") }}' bindtap='text_show'>{{placeholder}}</view>
<view class='textarea' wx:if='{{showType==1&&value!=null&&value!="" }}' bindtap='text_show'>{{value}}</view>
<textarea class='textarea' style='min-height:{{text_height}}' wx:if='{{showType==2 }}' placeholder-class='placeholder-tip' maxlength='{{maxlength}}' auto-focus='{{showType==2 }}' focus='{{showType==2 }}' placeholder="{{placeholder}}" bindinput='bindinput' bindblur='view_show' value="{{value}}"></textarea>
<editor wx:if='{{showType==3}}' id="editor" class='textarea' bindinput="editorinput" bindready="onEditorReady" placeholder='{{placeholder}}' style='min-height:{{text_height}}'></editor>
</view>
\ No newline at end of file
components/richTextarea/index.wxss
0 → 100644
View file @
55cb233b
/* components/richTextarea/index.wxss */
.textarea {
font-size: 24rpx;
color: #000;
width: 100%;
min-height: 350rpx;
height: auto;
line-height: 32rpx;
white-space: pre-wrap;
}
.placeholder-tip {
font-size: 24rpx;
color: #999;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment