Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-school-app
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
wx-school-app
Commits
bb546863
Commit
bb546863
authored
Mar 07, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整条码样式
parent
97a06a3d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
21 deletions
+30
-21
BarCode.scss
src/pages/BarCode/BarCode.scss
+4
-0
BarCode.tsx
src/pages/BarCode/BarCode.tsx
+15
-13
Home.tsx
src/pages/Home/Home.tsx
+6
-2
OrderPayway.tsx
src/pages/Order/components/OrderPayway/OrderPayway.tsx
+5
-6
No files found.
src/pages/BarCode/BarCode.scss
View file @
bb546863
...
@@ -41,9 +41,13 @@
...
@@ -41,9 +41,13 @@
height
:
52px
;
height
:
52px
;
}
}
.BarCodeCav
{
.BarCodeCav
{
display
:
none
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
.BarCodeCav.show
{
display
:
block
;
}
.toggleBtn
{
.toggleBtn
{
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
...
...
src/pages/BarCode/BarCode.tsx
View file @
bb546863
...
@@ -186,29 +186,24 @@ class BarCode extends Component {
...
@@ -186,29 +186,24 @@ class BarCode extends Component {
}
}
payDoneHandle
()
{
payDoneHandle
()
{
const
{
showBig
}
=
this
.
state
;
this
.
setState
(
this
.
setState
(
{
{
showPayOrder
:
false
,
showPayOrder
:
false
,
},
},
()
=>
{
()
=>
{
this
.
drawBarCode
(
showBig
);
this
.
drawBarCode
();
},
},
);
);
}
}
drawBarCode
(
showBig
:
boolean
)
{
drawBarCode
()
{
const
{
userinfo
}
=
this
.
props
;
const
{
userinfo
}
=
this
.
props
;
let
idBar
=
userinfo
.
idBar
.
substring
(
0
,
userinfo
.
idBar
.
length
-
2
)
+
'04'
;
let
idBar
=
userinfo
.
idBar
.
substring
(
0
,
userinfo
.
idBar
.
length
-
2
)
+
'04'
;
if
(
showBig
)
{
wxbarcode
.
barcode
(
'BarCode'
,
idBar
,
646
,
188
);
wxbarcode
.
barcode
(
'BarCode'
,
idBar
,
700
,
188
);
wxbarcode
.
barcode
(
'BarCodeBig'
,
idBar
,
700
,
364
);
}
else
{
wxbarcode
.
barcode
(
'BarCode'
,
idBar
,
700
,
364
);
}
}
}
toggleBigBarCode
()
{
toggleBigBarCode
()
{
const
{
showBig
}
=
this
.
state
;
const
{
showBig
}
=
this
.
state
;
this
.
drawBarCode
(
showBig
);
this
.
setState
({
this
.
setState
({
showBig
:
!
showBig
,
showBig
:
!
showBig
,
});
});
...
@@ -222,7 +217,7 @@ class BarCode extends Component {
...
@@ -222,7 +217,7 @@ class BarCode extends Component {
updateUserInfo
({
updateUserInfo
({
idBar
:
data
,
idBar
:
data
,
});
});
this
.
drawBarCode
(
false
);
this
.
drawBarCode
();
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
Taro
.
showToast
({
Taro
.
showToast
({
...
@@ -267,11 +262,18 @@ class BarCode extends Component {
...
@@ -267,11 +262,18 @@ class BarCode extends Component {
onClick=
{
this
.
refreshCodeBar
}
onClick=
{
this
.
refreshCodeBar
}
/>
/>
)
}
)
}
<
View
className=
{
`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`
}
>
{
showPayOrder
?
null
:
(
{
showPayOrder
?
null
:
(
<
Canvas
className=
'BarCodeCav'
canvasId=
'BarCode'
/>
<
View
className=
{
`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`
}
>
)
}
<
Canvas
className=
{
`BarCodeCav ${showBig ? 'show' : ''}`
}
canvasId=
'BarCodeBig'
/>
<
Canvas
className=
{
`BarCodeCav ${showBig ? '' : 'show'}`
}
canvasId=
'BarCode'
/>
</
View
>
</
View
>
)
}
<
View
className=
'toggleBtn'
onClick=
{
this
.
toggleBigBarCode
}
>
<
View
className=
'toggleBtn'
onClick=
{
this
.
toggleBigBarCode
}
>
{
showBig
?
'缩小'
:
'放大'
}
{
showBig
?
'缩小'
:
'放大'
}
</
View
>
</
View
>
...
...
src/pages/Home/Home.tsx
View file @
bb546863
...
@@ -229,12 +229,16 @@ class Home extends Component {
...
@@ -229,12 +229,16 @@ class Home extends Component {
<
View
className=
'Home-UserBox-BeanItem'
>
<
View
className=
'Home-UserBox-BeanItem'
>
<
Image
className=
'Home-UserBox-BeanIcon'
src=
{
HBeanIcon
}
/>
<
Image
className=
'Home-UserBox-BeanIcon'
src=
{
HBeanIcon
}
/>
<
Text
>
吹风豆:
</
Text
>
<
Text
>
吹风豆:
</
Text
>
<
Text
className=
'Home-UserBox-BeanCount'
>
{
hairDryerBean
}
</
Text
>
<
Text
className=
'Home-UserBox-BeanCount'
>
{
hairDryerBean
.
toFixed
(
2
)
}
</
Text
>
</
View
>
</
View
>
<
View
className=
'Home-UserBox-BeanItem'
>
<
View
className=
'Home-UserBox-BeanItem'
>
<
Image
className=
'Home-UserBox-BeanIcon'
src=
{
TBeanIcon
}
/>
<
Image
className=
'Home-UserBox-BeanIcon'
src=
{
TBeanIcon
}
/>
<
Text
>
通用豆:
</
Text
>
<
Text
>
通用豆:
</
Text
>
<
Text
className=
'Home-UserBox-BeanCount'
>
{
commBean
}
</
Text
>
<
Text
className=
'Home-UserBox-BeanCount'
>
{
commBean
.
toFixed
(
2
)
}
</
Text
>
</
View
>
</
View
>
</
View
>
</
View
>
<
View
className=
'Home-UserBox-Order'
>
<
View
className=
'Home-UserBox-Order'
>
...
...
src/pages/Order/components/OrderPayway/OrderPayway.tsx
View file @
bb546863
...
@@ -165,23 +165,22 @@ class OrderPayway extends Component {
...
@@ -165,23 +165,22 @@ class OrderPayway extends Component {
}).
toString
(
Utf8
),
}).
toString
(
Utf8
),
);
);
console
.
log
(
payData
);
console
.
log
(
payData
);
Taro
.
requestPayment
({
Taro
.
requestPayment
({
timeStamp
:
payData
.
msg
.
timeStamp
.
toString
(),
timeStamp
:
payData
.
msg
.
timeStamp
.
toString
(),
nonceStr
:
payData
.
msg
.
nonceStr
,
nonceStr
:
payData
.
msg
.
nonceStr
,
package
:
payData
.
msg
.
package
,
package
:
payData
.
msg
.
package
,
signType
:
payData
.
msg
.
signType
,
signType
:
payData
.
msg
.
signType
,
paySign
:
payData
.
msg
.
paySign
,
paySign
:
payData
.
msg
.
paySign
,
success
(
res
)
{
})
.
then
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
onPayDoneCallback
();
onPayDoneCallback
();
}
,
}
)
fail
(
res
)
{
.
catch
(
err
=>
{
Taro
.
showToast
({
Taro
.
showToast
({
title
:
res
.
msg
||
'发起支付失败'
,
title
:
err
.
msg
||
'发起支付失败'
,
icon
:
'none'
,
icon
:
'none'
,
});
});
},
});
});
}
else
{
}
else
{
onPayDoneCallback
();
onPayDoneCallback
();
...
...
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