Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PHP
vryPanoEdit
Commits
8b099a3a
Commit
8b099a3a
authored
4 years ago
by
李文起
Browse files
Options
Download
Plain Diff
Merge branch 'feature/v1.2.8' into 'master'
Feature/v1.2.8 See merge request
!81
parents
96f27c1b
32b7c236
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/Model/HotspotArticle.php
+16
-0
src/Model/HotspotArticle.php
src/Providers/PanoEditServiceProvider.php
+1
-0
src/Providers/PanoEditServiceProvider.php
src/Repositories/Contracts/HotspotArticleInterface.php
+10
-0
src/Repositories/Contracts/HotspotArticleInterface.php
src/Repositories/Eloquent/HotspotArticleRepository.php
+17
-0
src/Repositories/Eloquent/HotspotArticleRepository.php
src/Services/Hotspot/HotspotAction/ArticleHotspot.php
+40
-0
src/Services/Hotspot/HotspotAction/ArticleHotspot.php
src/Services/Hotspot/HotspotOrdinary.php
+8
-0
src/Services/Hotspot/HotspotOrdinary.php
with
92 additions
and
0 deletions
+92
-0
src/Model/HotspotArticle.php
0 → 100644
View file @
8b099a3a
<?php
namespace
Yjtec\PanoEdit\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
HotspotArticle
extends
Model
{
use
SoftDeletes
;
protected
$table
=
'hotspot_articles'
;
protected
$fillable
=
[
'id'
,
'user_id'
,
'title'
,
'context'
];
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Providers/PanoEditServiceProvider.php
View file @
8b099a3a
...
...
@@ -37,6 +37,7 @@ class PanoEditServiceProvider extends ServiceProvider
$this
->
app
->
bind
(
'Yjtec\PanoEdit\Repositories\Contracts\HotspotInterface'
,
'Yjtec\PanoEdit\Repositories\Eloquent\HotspotRepository'
);
$this
->
app
->
bind
(
'Yjtec\PanoEdit\Repositories\Contracts\RingsInterface'
,
'Yjtec\PanoEdit\Repositories\Eloquent\RingsRepository'
);
$this
->
app
->
bind
(
'Yjtec\PanoEdit\Repositories\Contracts\EventDataInterface'
,
'Yjtec\PanoEdit\Repositories\Eloquent\EventDataRepository'
);
$this
->
app
->
bind
(
'Yjtec\PanoEdit\Repositories\Contracts\HotspotArticleInterface'
,
'Yjtec\PanoEdit\Repositories\Eloquent\HotspotArticleRepository'
);
}
}
This diff is collapsed.
Click to expand it.
src/Repositories/Contracts/HotspotArticleInterface.php
0 → 100644
View file @
8b099a3a
<?php
namespace
Yjtec\PanoEdit\Repositories\Contracts
;
interface
HotspotArticleInterface
{
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Repositories/Eloquent/HotspotArticleRepository.php
0 → 100644
View file @
8b099a3a
<?php
namespace
Yjtec\PanoEdit\Repositories\Eloquent
;
use
Yjtec\PanoEdit\Model\HotspotArticle
;
use
Yjtec\PanoEdit\Repositories\Contracts\HotspotArticleInterface
;
use
Yjtec\Repo\Repository
;
class
HotspotArticleRepository
extends
Repository
implements
HotspotArticleInterface
{
public
function
model
()
{
return
HotspotArticle
::
class
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Services/Hotspot/HotspotAction/ArticleHotspot.php
0 → 100644
View file @
8b099a3a
<?php
namespace
Yjtec\PanoEdit\Services\Hotspot\HotspotAction
;
use
Yjtec\PanoEdit\Repositories\Eloquent\HotspotArticleRepository
;
class
ArticleHotspot
extends
HotspotAction
{
/************************************************* 生成XML ****************************************************/
public
function
setNodeAttribute
(
$xmlService
,
$sceneNode
,
$hotspotNode
){
if
(
$this
->
data
[
'action_data'
]
&&
!
empty
(
$this
->
data
[
'action_data'
][
'article_id'
]))
{
$this
->
data
[
'onclick'
]
=
'show_rich_txt("data:article_hotspot_'
.
$this
->
data
[
'id'
]
.
'");'
;
$this
->
setArticleData
(
$sceneNode
,
$this
->
data
[
'id'
]);
}
return
$hotspotNode
;
}
/**
* 设置富文本数据
* @param $sceneNode
* @param $hotspotId
*/
public
function
setArticleData
(
$sceneNode
,
$hotspotId
){
//获取当前热点文本
$hotsportArticle
=
resolve
(
'Yjtec\PanoEdit\Repositories\Contracts\HotspotArticleInterface'
);
$articleData
=
$hotsportArticle
->
findBy
(
$this
->
data
[
'action_data'
][
'article_id'
]);
$dataNode
=
self
::
$xmlService
->
createElement
(
'data'
);
self
::
$xmlService
->
setAttribute
(
$dataNode
,[
'name'
=>
'article_hotspot_'
.
$hotspotId
]);
$dataNode
->
nodeValue
=
htmlspecialchars_decode
(
$articleData
[
'content'
]);
self
::
$xmlService
->
appendChild
(
$sceneNode
,
$dataNode
);
}
/************************************************* 生成XML结束 ****************************************************/
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Services/Hotspot/HotspotOrdinary.php
View file @
8b099a3a
...
...
@@ -4,6 +4,7 @@
namespace
Yjtec\PanoEdit\Service\Hotspot
;
use
Yjtec\PanoEdit\Services\Hotspot\HotspotAction\ArticleHotspot
;
use
Yjtec\PanoEdit\Services\Hotspot\HotspotAction\IframeHotspot
;
use
Yjtec\PanoEdit\Services\Hotspot\HotspotAction\RingsHotspot
;
use
Yjtec\PanoEdit\Services\Hotspot\HotspotAction\MusicHotspot
;
...
...
@@ -235,6 +236,13 @@ class HotspotOrdinary extends HotspotParent
break
;
}
//富文本热点
case
10
:
{
$hotspotNode
=
(
new
ArticleHotspot
(
$this
->
data
,
self
::
$key
,
$this
->
sceneId
,
$this
->
sceneArray
))
->
makeXml
(
$sceneNode
);
break
;
}
//根据项目设置不同的热点
default
:
{
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help