Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
8d460662
Commit
8d460662
authored
Oct 25, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
讲师介绍,需要有个简易版的编辑器。
需要支持以下功能: 加粗,倾斜,下划线,字体颜色,有序列表,无需列表
parent
2ad0080d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
93 deletions
+41
-93
TestController.php
src/frontend/controllers/TestController.php
+0
-90
publish.php
src/frontend/views/my-course/publish.php
+11
-1
add.php
src/frontend/views/teacher-manager/add.php
+3
-1
edit.php
src/frontend/views/teacher-manager/edit.php
+3
-1
form.js
src/frontend/web/js/teacher-manager/form.js
+24
-0
No files found.
src/frontend/controllers/TestController.php
deleted
100644 → 0
View file @
2ad0080d
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 2016/10/13
* Time: 上午9:57
*/
namespace
frontend\controllers
;
use
common\libs\Utils
;
use
GuzzleHttp\Client
;
use
yii\web\Controller
;
class
TestController
extends
Controller
{
public
$enableCsrfValidation
=
FALSE
;
public
function
actionIndex2
()
{
$data
=
(
\Yii
::
$app
->
request
->
post
());
$order_id
=
date
(
"YmdHis"
);
$order_id
=
'20161013135950'
;
//发送统一下单请求
$client
=
new
Client
(
[
'timeout'
=>
8
,
'verify'
=>
FALSE
,
'connect_timeout'
=>
8
]
);
$uri
=
'https://api.mch.weixin.qq.com/pay/unifiedorder'
;
$weixinpay
=
\Yii
::
$app
->
params
[
'weixinpay'
];
$xml
=
[
'appid'
=>
$weixinpay
[
'appid'
],
'mch_id'
=>
$weixinpay
[
'mchid'
],
'device_info'
=>
"WEB"
,
'nonce_str'
=>
\Yii
::
$app
->
security
->
generateRandomString
(
16
),
'sign'
=>
''
,
'body'
=>
'云崖充值中心-课程购买'
,
'out_trade_no'
=>
$order_id
,
'total_fee'
=>
1
,
'spbill_create_ip'
=>
'114.112.65.4'
,
'notify_url'
=>
'http://c.pp.cc/frontend/web/index.php/pay/weixin-notify'
,
'trade_type'
=>
'NATIVE'
,
];
$xml
[
'sign'
]
=
Utils
::
makeWeixinPaySign
(
$xml
,
$weixinpay
[
'key'
]);
$xml
=
Utils
::
assocArrayToXML
(
'xml'
,
$xml
);
$reponse
=
$client
->
request
(
'POST'
,
$uri
,
[
'Content-Type'
=>
'text/xml; charset=UTF8'
,
'body'
=>
$xml
]);
$reponse
=
$reponse
->
getBody
();
$result
=
((
string
)
$reponse
);
$result
=
simplexml_load_string
(
$result
);
$prepay_id
=
(
string
)
$result
->
prepay_id
;
$return
=
[
'return_code'
=>
'SUCCESS'
,
'appid'
=>
$weixinpay
[
'appid'
],
'mch_id'
=>
$weixinpay
[
'mchid'
],
'nonce_str'
=>
(
string
)
$result
->
nonce_str
,
'prepay_id'
=>
(
string
)
$result
->
prepay_id
,
'result_code'
=>
'SUCCESS'
,
'sign'
=>
''
];
$return
[
'sign'
]
=
Utils
::
makeWeixinPaySign
(
$return
,
$weixinpay
[
'key'
]);
return
\Yii
::
createObject
([
'class'
=>
'yii\web\Response'
,
'format'
=>
\yii\web\Response
::
FORMAT_XML
,
'formatters'
=>
[
\yii\web\Response
::
FORMAT_XML
=>
[
'class'
=>
'yii\web\XmlResponseFormatter'
,
'rootTag'
=>
'xml'
,
//根节点
],
],
'data'
=>
$return
]);
// var_dump(Yii::$app->request->post());
// $log = \Yii::$app->log->getLogger();
// $log->log(json_encode($data),Logger::LEVEL_ERROR);
}
public
function
actionIndex
(){
return
$this
->
render
(
'index'
);
}
}
opcache_invalidate
(
__FILE__
);
\ No newline at end of file
src/frontend/views/my-course/publish.php
View file @
8d460662
...
@@ -81,3 +81,13 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
...
@@ -81,3 +81,13 @@ AppAsset::addCss($this, '@web/assets/css/course_publish.css');
</div>
</div>
</form>
</form>
</div>
</div>
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
window
).
unload
(
function
()
{
// return "Bye now!";
alert
(
"Goodbye!"
);
return
false
;
});
});
</script>
\ No newline at end of file
src/frontend/views/teacher-manager/add.php
View file @
8d460662
...
@@ -7,6 +7,8 @@ use frontend\assets\AppAsset;
...
@@ -7,6 +7,8 @@ use frontend\assets\AppAsset;
$this
->
title
=
'添加讲师'
;
$this
->
title
=
'添加讲师'
;
AppAsset
::
addScript
(
$this
,
'@web/assets/teacher_form.js'
);
AppAsset
::
addScript
(
$this
,
'@web/assets/teacher_form.js'
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/teacher_form.css'
);
?>
?>
<div
class=
"add-box"
>
<div
class=
"add-box"
>
<div
class=
"add-box-main"
>
<div
class=
"add-box-main"
>
...
@@ -20,7 +22,7 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
...
@@ -20,7 +22,7 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
</div>
</div>
<div
class=
"teacher-info"
>
<div
class=
"teacher-info"
>
<textarea
name=
"intro"
placeholder=
"请输入讲师介绍..."
></textarea>
<textarea
id=
"teacher-intro"
name=
"intro"
placeholder=
"请输入讲师介绍..."
></textarea>
<p
class=
"text-number"
>
20 / 500
</p>
<p
class=
"text-number"
>
20 / 500
</p>
</div>
</div>
...
...
src/frontend/views/teacher-manager/edit.php
View file @
8d460662
...
@@ -4,6 +4,8 @@ use frontend\assets\AppAsset;
...
@@ -4,6 +4,8 @@ use frontend\assets\AppAsset;
$this
->
title
=
'修改讲师信息'
;
$this
->
title
=
'修改讲师信息'
;
AppAsset
::
addScript
(
$this
,
'@web/assets/teacher_form.js'
);
AppAsset
::
addScript
(
$this
,
'@web/assets/teacher_form.js'
);
AppAsset
::
addCss
(
$this
,
'@web/assets/css/teacher_form.css'
);
?>
?>
<div
class=
"add-box"
>
<div
class=
"add-box"
>
<div
class=
"add-box-main"
>
<div
class=
"add-box-main"
>
...
@@ -17,7 +19,7 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
...
@@ -17,7 +19,7 @@ AppAsset::addScript($this, '@web/assets/teacher_form.js');
</div>
</div>
<div
class=
"teacher-info"
>
<div
class=
"teacher-info"
>
<textarea
name=
"intro"
placeholder=
"请输入讲师介绍..."
>
<?=
$teacher
->
intro
?>
</textarea>
<textarea
id=
"teacher-intro"
name=
"intro"
placeholder=
"请输入讲师介绍..."
>
<?=
$teacher
->
intro
?>
</textarea>
<p
class=
"text-number"
>
20 / 500
</p>
<p
class=
"text-number"
>
20 / 500
</p>
</div>
</div>
...
...
src/frontend/web/js/teacher-manager/form.js
View file @
8d460662
...
@@ -57,3 +57,27 @@ var vm = new Vue({
...
@@ -57,3 +57,27 @@ var vm = new Vue({
});
});
}
}
});
});
var
Simditor
=
require
(
"../utils/simditor"
);
//添加编辑器部分
var
editor
=
new
Simditor
({
textarea
:
$
(
'#teacher-intro'
),
upload
:
false
,
tabIndent
:
true
,
toolbar
:
[
'bold'
,
'italic'
,
'underline'
,
'color'
,
'ol'
,
'ul'
],
toolbarFloat
:
true
,
toolbarFloatOffset
:
0
,
toolbarHidden
:
false
,
pasteImage
:
false
,
cleanPaste
:
false
,
//optional options
});
\ 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