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
52db00c8
authored
Dec 19, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1c245d90
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
33 deletions
+38
-33
src/common/events.ts
+2
-2
src/common/index.ts
+4
-4
src/pages/home/tempaltes/conpoments/temp_item2/index.tsx
+2
-1
src/pages/home/tempaltes/index.tsx
+4
-2
src/pages/home/tempaltes/scss/detail.scss
+1
-1
src/pages/home/tempaltes/template_type_detail.tsx
+25
-23
No files found.
src/common/events.ts
View file @
52db00c8
...
...
@@ -8,7 +8,7 @@ const EventBus = (function() {
// 将消息保存到当前的消息队列中
on
:
function
(
msgName
,
func
)
{
if
(
this
.
msgQueues
.
hasOwnProperty
(
msgName
))
{
if
(
typeof
this
.
msgQueues
===
'function'
)
{
if
(
typeof
this
.
msgQueues
[
msgName
]
===
'function'
)
{
this
.
msgQueues
[
msgName
]
=
[
this
.
msgQueues
[
msgName
],
func
]
}
else
{
this
.
msgQueues
[
msgName
]
=
[...
this
.
msgQueues
[
msgName
],
func
]
...
...
@@ -20,7 +20,6 @@ const EventBus = (function() {
// 消息队列中仅保存一个消息
one
:
function
(
msgName
,
func
)
{
// 无需检查msgName是否存在
this
.
msgQueues
[
msgName
]
=
func
},
// 发送消息
...
...
@@ -32,6 +31,7 @@ const EventBus = (function() {
if
(
typeof
this
.
msgQueues
[
msgName
]
===
'function'
)
{
this
.
msgQueues
[
msgName
](
msg
)
}
else
{
console
.
log
(
msgName
)
this
.
msgQueues
[
msgName
].
map
(
fn
=>
{
console
.
log
(
fn
,
'fn'
)
fn
(
msg
)
...
...
src/common/index.ts
View file @
52db00c8
export
const
FETCH_TIME_OUT
=
5000
//
export const BASE_URL = 'https://server.bdideal.com'
//
export const WEBVIEW_URL = 'https://visual.bdideal.com'
export
const
BASE_URL
=
'https://dev-server.bdideal.com'
export
const
WEBVIEW_URL
=
'https://dev-visual.bdideal.com'
export
const
BASE_URL
=
'https://server.bdideal.com'
export
const
WEBVIEW_URL
=
'https://visual.bdideal.com'
//
export const BASE_URL = 'https://dev-server.bdideal.com'
//
export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
// export const WEBVIEW_URL = 'http://127.0.0.1:8080'
/** 蓝牙的服务 uuid */
...
...
src/pages/home/tempaltes/conpoments/temp_item2/index.tsx
View file @
52db00c8
...
...
@@ -6,7 +6,7 @@ import { View, Text, Image } from '@tarojs/components'
import
{
formatTime
}
from
'@/common/utils'
import
'./index.scss'
import
api
from
'@/api/index'
import
events
from
'@/common/events'
type
IProps
=
ITempItem
interface
PageState
{}
...
...
@@ -39,6 +39,7 @@ class TempItem extends Component {
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail?templateId=
${
templateId
}
`
})
}
else
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/detail?templateId=
${
templateId
}
`
})
events
.
emit
(
'detailShow'
,
templateId
)
}
this
.
isload
=
false
Taro
.
hideLoading
()
...
...
src/pages/home/tempaltes/index.tsx
View file @
52db00c8
...
...
@@ -66,14 +66,16 @@ class Tempaltes extends Component {
async
componentWillMount
()
{
console
.
log
(
'componentWillMount'
)
this
.
getData
()
events
.
on
(
'detailShow'
,
e
=>
{
events
.
off
(
'detailShow'
)
events
.
off
(
'detailClose'
)
events
.
one
(
'detailShow'
,
e
=>
{
console
.
log
(
'detailShow'
,
e
)
Taro
.
hideTabBar
()
this
.
setState
({
templateId
:
e
})
})
events
.
on
(
'detailClose'
,
e
=>
{
events
.
on
e
(
'detailClose'
,
e
=>
{
console
.
log
(
'detailClose'
)
Taro
.
showTabBar
()
this
.
setState
({
...
...
src/pages/home/tempaltes/scss/detail.scss
View file @
52db00c8
...
...
@@ -8,7 +8,7 @@
box-sizing
:
border-box
;
flex-direction
:
column
;
background
:
rgba
(
0
,
0
,
0
,
0
.5
);
position
:
absolute
;
position
:
fixed
;
top
:
0
;
height
:
100vh
;
z-index
:
1000
;
...
...
src/pages/home/tempaltes/template_type_detail.tsx
View file @
52db00c8
...
...
@@ -7,6 +7,8 @@ import { getWindiwHeight } from '@/common/utils'
import
{
View
,
Text
,
ScrollView
,
Button
,
Radio
,
RadioGroup
,
Label
}
from
'@tarojs/components'
import
ListView
from
'@/conpoments/list_view'
import
TempItem
from
'./conpoments/temp_item'
import
TempDetail
from
'./detail'
import
events
from
'@/common/events'
import
'./scss/type_detail.scss'
import
{
SHOWTYPE
}
from
'@/common/enum'
...
...
@@ -28,6 +30,7 @@ type PageState = {
showModal
:
boolean
typeId
:
string
tagId
:
string
templateId
:
string
tempList
:
any
[]
windowHeight
:
number
templateShow
:
string
...
...
@@ -58,6 +61,7 @@ class TemplateTypeDetail extends Component {
showModal
:
false
,
filmDataList
:
[],
typeId
,
templateId
:
''
,
templateShow
:
templateShow
||
'HORIZONTAL'
,
windowHeight
:
getWindiwHeight
(),
tempList
:
[],
...
...
@@ -75,10 +79,29 @@ class TemplateTypeDetail extends Component {
this
.
typeChange
=
this
.
typeChange
.
bind
(
this
)
}
componentDidShow
()
{
this
.
setState
({
templateId
:
''
})
}
componentWillMount
()
{
console
.
log
(
events
)
events
.
on
(
'detailShow'
,
e
=>
{
console
.
log
(
'detailShow'
,
e
)
this
.
setState
({
templateId
:
e
})
})
events
.
on
(
'detailClose'
,
e
=>
{
this
.
setState
({
templateId
:
''
})
})
const
typeName
=
this
.
$router
.
params
.
typeName
Taro
.
setNavigationBarTitle
({
title
:
typeName
})
this
.
getData
()
// console.log('object', Taro.get)
}
...
...
@@ -181,6 +204,7 @@ class TemplateTypeDetail extends Component {
typeData
,
filmDataList
,
windowHeight
,
templateId
,
count
,
tagsList
,
tagId
,
...
...
@@ -264,31 +288,9 @@ class TemplateTypeDetail extends Component {
</
ListView
>
)
}
</
View
>
{
templateId
&&
<
TempDetail
templateId=
{
templateId
}
/>
}
</
View
>
)
}
}
// interface IProps {
// detailData: any
// filmDataList: any[]
// }
// function TempDetailContent(props: IProps) {
// const { detailData, filmDataList } = props
// return (
// <View>
// <DetailTop {...detailData} />
// <View className="temp-detail-list">
// <Text className="temp-detail-list-title">我的作品({filmDataList.length})</Text>
// <View className="temp-detail-list-content">
// {filmDataList.map(item => (
// <TempItem {...item} key={item.templateId} />
// ))}
// </View>
// </View>
// </View>
// )
// }
export
default
TemplateTypeDetail
as
ComponentClass
<
PageOwnProps
,
PageState
>
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