Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3640c563
authored
Sep 25, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
静态url 解析
parent
b57cc7ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
src/common/utils.ts
+2
-1
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
+9
-2
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
+5
-3
src/pages/home/tempaltes/film_edit.tsx
+1
-1
No files found.
src/common/utils.ts
View file @
3640c563
...
...
@@ -59,7 +59,8 @@ export function getHostUrl(frameUrl, dataUrl) {
}
else
{
let
arr
=
frameUrl
.
split
(
'/'
)
arr
.
splice
(
-
1
,
2
)
console
.
log
(
arr
.
join
(
''
))
let
host
=
arr
.
join
(
'/'
)
+
'/'
return
host
+
dataUrl
}
}
/** ArrayBuffer转16进制字符串 */
...
...
src/pages/home/tempaltes/conpoments/edit_menu/index.tsx
View file @
3640c563
...
...
@@ -18,6 +18,7 @@ type PageOwnProps = {
open
:
boolean
activeIndex
:
number
setValue
:
()
=>
void
frameUrl
?:
string
}
type
PageState
=
{
...
...
@@ -49,7 +50,7 @@ class EditMenu extends Component {
})
}
render
()
{
let
{
schemaData
,
itemList
,
setValue
}
=
this
.
props
let
{
schemaData
,
itemList
,
setValue
,
frameUrl
}
=
this
.
props
const
activeIndex
=
this
.
state
.
activeIndex
itemList
=
itemList
||
[]
return
(
...
...
@@ -67,7 +68,13 @@ class EditMenu extends Component {
key=
{
index
+
item
.
name
}
>
<
AtList
hasBorder=
{
false
}
>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
setValue=
{
setValue
}
/>
<
MenuItem
item=
{
item
}
schemaData=
{
schemaData
}
isList=
{
false
}
setValue=
{
setValue
}
frameUrl=
{
frameUrl
}
/>
</
AtList
>
</
AtAccordion
>
)
...
...
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
View file @
3640c563
...
...
@@ -2,6 +2,7 @@ import { ComponentClass } from 'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Image
,
Input
,
Button
,
Video
}
from
'@tarojs/components'
import
ListItem
from
'../list_item'
import
{
getHostUrl
}
from
'@/common/utils'
import
'./index.scss'
import
api
from
'@/api/index'
type
PageStateProps
=
{}
...
...
@@ -13,6 +14,7 @@ type PageOwnProps = {
schemaData
:
object
isList
:
boolean
setValue
:
()
=>
void
frameUrl
?:
string
}
type
PageState
=
{}
...
...
@@ -122,7 +124,7 @@ class MenuItem extends Component {
console
.
log
(
arguments
,
'inputValueChage'
)
}
render
()
{
const
{
schemaData
,
setValue
}
=
this
.
props
const
{
schemaData
,
setValue
,
frameUrl
}
=
this
.
props
let
{
item
}
=
this
.
props
item
=
item
||
{
type
:
''
...
...
@@ -138,7 +140,7 @@ class MenuItem extends Component {
}
else
if
(
item
.
type
===
'image'
)
{
return
(
<
View
>
<
Image
src=
{
schemaData
[
item
.
dataKey
].
value
}
/>
<
Image
src=
{
getHostUrl
(
frameUrl
,
schemaData
[
item
.
dataKey
].
value
)
}
/>
<
Button
onClick=
{
()
=>
{
this
.
chooseImg
(
item
.
dataKey
)
...
...
@@ -151,7 +153,7 @@ class MenuItem extends Component {
}
else
if
(
item
.
type
===
'video'
)
{
return
(
<
View
>
<
Video
src=
{
schemaData
[
item
.
dataKey
].
value
}
/>
<
Video
src=
{
getHostUrl
(
frameUrl
,
schemaData
[
item
.
dataKey
].
value
)
}
/>
<
Button
onClick=
{
()
=>
{
this
.
chooseVideo
(
item
.
dataKey
)
...
...
src/pages/home/tempaltes/film_edit.tsx
View file @
3640c563
...
...
@@ -280,7 +280,7 @@ class FilmDetail extends Component {
</
View
>
{
/* {filmData[pageIndex]} */
}
{
/* {pageIndex} */
}
<
EditMenu
{
...
pageList
[
pageIndex
]}
setValue=
{
this
.
setValue
}
/>
<
EditMenu
{
...
pageList
[
pageIndex
]}
frameUrl=
{
filmInfo
.
frameUrl
}
setValue=
{
this
.
setValue
}
/>
</
View
>
<
View
className=
"film-detail-bottom-bar"
>
<
Button
type=
"primary"
className=
"film-detail-bottom-bar-btn"
>
...
...
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