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
f8349bd3
authored
Sep 20, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加视频编辑
parent
d0e2b415
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
30 deletions
+75
-30
project.config.json
+27
-26
src/conpoments/shop_device_item/index.scss
+1
-1
src/pages/home/tempaltes/conpoments/home_item/index.scss
+1
-1
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
+45
-1
src/pages/home/tempaltes/conpoments/temp_item/index.scss
+1
-1
No files found.
project.config.json
View file @
f8349bd3
{
"miniprogramRoot"
:
"dist/"
,
"projectname"
:
"taroDemo"
,
"description"
:
""
,
"appid"
:
"wxc3dfc37466838046"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"coverView"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{}
}
"miniprogramRoot"
:
"dist/"
,
"projectname"
:
"taroDemo"
,
"description"
:
""
,
"appid"
:
"wxc3dfc37466838046"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
,
"autoAudits"
:
false
,
"checkInvalidKey"
:
true
,
"coverView"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{}
}
\ No newline at end of file
src/conpoments/shop_device_item/index.scss
View file @
f8349bd3
...
...
@@ -37,7 +37,7 @@
}
&
-intro
{
font-size
:
3
2px
;
font-size
:
2
2px
;
color
:
#666
;
margin-bottom
:
38px
;
}
...
...
src/pages/home/tempaltes/conpoments/home_item/index.scss
View file @
f8349bd3
...
...
@@ -43,7 +43,7 @@
width
:
100%
;
font-size
:
28px
;
padding-top
:
10px
;
background-color
:
white
;
//
background-color: white;
@include
eject
(
display
,
block
);
@include
eject
(
box-sizing
,
border-box
);
...
...
src/pages/home/tempaltes/conpoments/menu_item/index.tsx
View file @
f8349bd3
import
{
ComponentClass
}
from
'react'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
View
,
Text
,
Image
,
Input
,
Button
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
,
Input
,
Button
,
Video
}
from
'@tarojs/components'
import
ListItem
from
'../list_item'
import
'./index.scss'
import
api
from
'@/api/index'
...
...
@@ -45,9 +45,13 @@ class MenuItem extends Component {
const
{
setValue
,
schemaData
}
=
this
.
props
Taro
.
chooseImage
({
count
:
1
}).
then
(
res
=>
{
console
.
log
(
res
)
Taro
.
showLoading
({
title
:
'上传中'
})
api
.
files
.
uploadFile
(
res
.
tempFilePaths
[
0
])
.
then
(
result
=>
{
Taro
.
hideLoading
()
console
.
log
(
JSON
.
parse
(
result
.
data
).
data
)
const
url
=
JSON
.
parse
(
result
.
data
).
data
let
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
...
...
@@ -55,6 +59,33 @@ class MenuItem extends Component {
setValue
(
newSchemaData
)
})
.
catch
(()
=>
{
Taro
.
hideLoading
()
Taro
.
showToast
({
title
:
'上传失败'
,
duration
:
2000
})
})
})
}
chooseVideo
(
dataKey
)
{
const
{
setValue
,
schemaData
}
=
this
.
props
Taro
.
chooseVideo
({}).
then
(
res
=>
{
console
.
log
(
res
)
Taro
.
showLoading
({
title
:
'上传中'
})
api
.
files
.
uploadFile
(
res
.
tempFilePath
)
.
then
(
result
=>
{
console
.
log
(
JSON
.
parse
(
result
.
data
).
data
)
const
url
=
JSON
.
parse
(
result
.
data
).
data
let
newSchemaData
=
JSON
.
parse
(
JSON
.
stringify
(
schemaData
))
newSchemaData
[
dataKey
][
'value'
]
=
url
setValue
(
newSchemaData
)
Taro
.
hideLoading
()
})
.
catch
(()
=>
{
Taro
.
hideLoading
()
Taro
.
showToast
({
title
:
'上传失败'
,
duration
:
2000
...
...
@@ -117,6 +148,19 @@ class MenuItem extends Component {
</
Button
>
</
View
>
)
}
else
if
(
item
.
type
===
'video'
)
{
return
(
<
View
>
<
Video
src=
{
schemaData
[
item
.
dataKey
].
value
}
/>
<
Button
onClick=
{
()
=>
{
this
.
chooseVideo
(
item
.
dataKey
)
}
}
>
上传视频
</
Button
>
</
View
>
)
}
else
if
(
item
.
type
===
'list'
)
{
return
(
<
View
>
...
...
src/pages/home/tempaltes/conpoments/temp_item/index.scss
View file @
f8349bd3
...
...
@@ -46,7 +46,7 @@
font-size
:
26px
;
color
:
#333
;
font-weight
:
bold
;
background-color
:
white
;
//
background-color: white;
@include
eject
(
display
,
block
);
@include
eject
(
box-sizing
,
border-box
);
...
...
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