Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
孙凯
7 years ago
Commit
b67ce0e3345f62f4b06e8effefee14b1d55c2b02
1 parent
e60c5398
add shareType review by daiqiang
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
13 deletions
js/groupPurchase/components/SnapshootShare.js
js/groupPurchase/containers/GroupPurchaseContainer.js
js/groupPurchase/containers/GroupPurchaseDetailContainer.js
js/groupPurchase/reducers/groupPurchase/groupPurchaseActions.js
js/groupPurchase/components/SnapshootShare.js
View file @
b67ce0e
...
...
@@ -28,10 +28,10 @@ export default class SnapshootShare extends React.Component {
this
.
shareImage
=
this
.
shareImage
.
bind
(
this
);
}
shareImage
(
index
){
shareImage
(
shareType
){
ReactNative
.
takeSnapshot
(
this
.
refs
.
container
,
{
format
:
'png'
,
quality
:
10
}).
then
(
(
uri
)
=>
{
this
.
props
.
shareSnapshootAction
&&
this
.
props
.
shareSnapshootAction
(
index
,
uri
);
this
.
props
.
shareSnapshootAction
&&
this
.
props
.
shareSnapshootAction
(
shareType
,
uri
);
}).
catch
(
(
error
)
=>
{
Alert
.
alert
(
'图片生成失败!'
)
...
...
@@ -129,13 +129,13 @@ export default class SnapshootShare extends React.Component {
<
View
style
=
{
styles
.
shareView
}
>
<
View
style
=
{
styles
.
buttons
}
>
<
TouchableOpacity
activeOpacity
=
{
0.5
}
style
=
{
styles
.
button1
}
onPress
=
{()
=>
{
this
.
shareImage
&&
this
.
shareImage
(
0
);
this
.
shareImage
&&
this
.
shareImage
(
'WXSceneSession'
);
}}
>
<
Image
source
=
{
require
(
'../images/weixin.png'
)}
style
=
{
styles
.
icon
}
/
>
<
Text
style
=
{
styles
.
text
}
>
微信好友
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.5
}
style
=
{
styles
.
button2
}
onPress
=
{()
=>
{
this
.
shareImage
&&
this
.
shareImage
(
1
);
this
.
shareImage
&&
this
.
shareImage
(
'WXSceneTimeline'
);
}}
>
<
Image
source
=
{
require
(
'../images/share_timeline_icon.png'
)}
style
=
{
styles
.
icon
}
/
>
<
Text
style
=
{
styles
.
text
}
>
微信朋友圈
<
/Text
>
...
...
@@ -166,6 +166,7 @@ const DEVICE_WIDTH_RATIO = width / 375;
let
styles
=
StyleSheet
.
create
({
modalContainer
:
{
flex
:
1
,
width
:
width
,
height
:
height
,
},
...
...
js/groupPurchase/containers/GroupPurchaseContainer.js
View file @
b67ce0e
...
...
@@ -55,6 +55,12 @@ class GroupPurchaseContainer extends Component {
}
_didTouchBanner
(
url
)
{
let
params
=
{
URL
:
url
,
};
ReactNative
.
NativeModules
.
YH_CommonHelper
.
logEvent
(
'YB_GROUP_LIST_BANNER_C'
,
params
);
ReactNative
.
NativeModules
.
YH_CommonHelper
.
jumpWithUrl
(
url
);
}
...
...
js/groupPurchase/containers/GroupPurchaseDetailContainer.js
View file @
b67ce0e
...
...
@@ -81,9 +81,10 @@ class GroupPurchaseDetailContainer extends Component {
}
}
shareSnapshootAction
(
index
,
url
)
{
shareSnapshootAction
(
shareType
,
url
)
{
let
param
=
{
index
,
shareType
,
imageUrl
:
url
,
}
...
...
@@ -163,8 +164,6 @@ class GroupPurchaseDetailContainer extends Component {
}
let
qrCode
=
host
+
'/wechat/miniapp/img-check.jpg?param='
+
encodeURIComponent
(
JSON
.
stringify
(
param
))
+
'&miniQrType=4'
;
console
.
log
(
qrCode
);
console
.
log
(
'qrCode'
);
return
(
<
View
style
=
{
styles
.
container
}
>
...
...
js/groupPurchase/reducers/groupPurchase/groupPurchaseActions.js
View file @
b67ce0e
...
...
@@ -67,11 +67,7 @@ export function fetchResourceInfo() {
return
(
dispatch
,
getState
)
=>
{
let
{
app
}
=
getState
();
dispatch
(
resourceInfoRequest
());
let
content_code
=
'f99fa98a01fdadb09012bbd2b4a28e91'
;
if
(
app
.
host
==
'http://api.yoho.cn'
){
content_code
=
'ab4ca2161bada40fe7335dce51b8e196'
;
}
let
content_code
=
'ab4ca2161bada40fe7335dce51b8e196'
;
//测试:f99fa98a01fdadb09012bbd2b4a28e91
return
new
GroupPurchaseService
(
app
.
host
).
fetchResourceInfo
(
content_code
)
.
then
(
json
=>
{
dispatch
(
resourceInfoSuccess
(
json
));
...
...
Please
register
or
login
to post a comment