Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
H5_2.0
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
31a21af0
authored
May 24, 2023
by
肖康
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://git.ichunt.net/xiaokang/H5_2.0
parents
9b9e739d
da2f5d6a
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1284 additions
and
284 deletions
App.vue
assets/css/mine/invoice.scss
components/bottom_nav.vue
components/drag-button-follow/drag-button-follow.vue
main.js
pages/index/index.vue
pages/mine/invoice.vue
pages/mine/invoiceAdd.vue
pages/mine/invoiceEdit.vue
pages/mine/shoporder.vue
pages/mine/user.vue
pages/mine/userAddress.vue
pages/mine/userAddressAdd.vue
pages/mine/userAddressEdit.vue
router/index.js
util/util.js
App.vue
View file @
31a21af0
...
@@ -19,7 +19,7 @@ export default {
...
@@ -19,7 +19,7 @@ export default {
uni-page-head
{
uni-page-head
{
display
:
none
;
display
:
none
;
}
}
body
{
body
{
background
:
#f5f5f5
;
background
:
#f5f5f5
;
}
}
/* #endif */
/* #endif */
...
...
assets/css/mine/invoice.scss
View file @
31a21af0
...
@@ -68,9 +68,9 @@
...
@@ -68,9 +68,9 @@
}
}
}
}
.p3
{
.p3
{
height
:
66rpx
;
font-size
:
24rpx
;
font-size
:
24rpx
;
color
:
#919399
;
color
:
#919399
;
margin-bottom
:
16rpx
;
}
}
.operate
{
.operate
{
.edit
{
.edit
{
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
}
}
.page-userAddress-add
{
.page-userAddress-add
{
padding
:
180rpx
24rpx
1
0
0rpx
24rpx
;
padding
:
180rpx
24rpx
1
5
0rpx
24rpx
;
.tip
{
.tip
{
margin-top
:
16rpx
;
margin-top
:
16rpx
;
margin-bottom
:
16rpx
;
margin-bottom
:
16rpx
;
...
@@ -166,13 +166,11 @@
...
@@ -166,13 +166,11 @@
.text
{
.text
{
margin-left
:
16rpx
;
margin-left
:
16rpx
;
.t1
{
.t1
{
max-width
:
560rpx
;
text-align
:
justify
;
font-size
:
22rpx
;
font-size
:
22rpx
;
color
:
#f98119
;
color
:
#f98119
;
}
}
.t2
{
font-size
:
22rpx
;
color
:
#1969f9
;
}
}
}
}
}
.tab
{
.tab
{
...
@@ -223,6 +221,11 @@
...
@@ -223,6 +221,11 @@
width
:
155rpx
;
width
:
155rpx
;
font-size
:
26rpx
;
font-size
:
26rpx
;
color
:
#484b59
;
color
:
#484b59
;
&.
required
:
:
before
{
content
:
'*'
;
font-size
:
26rpx
;
color
:
#1969f9
;
}
}
}
.intl_code
{
.intl_code
{
.uni-input
{
.uni-input
{
...
...
components/bottom_nav.vue
View file @
31a21af0
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<text
class=
"icon iconfont icon-car"
></text>
<text
class=
"icon iconfont icon-car"
></text>
<view>
<view>
购物车
购物车
<text
class=
"counts"
>
{{
count
}}
</text>
<text
class=
"counts"
>
{{
count
}}
</text>
</view>
</view>
</navigator>
</navigator>
<navigator
url=
"/user"
class=
"navitem"
:class=
"
{ act: actval == 4 }">
<navigator
url=
"/user"
class=
"navitem"
:class=
"
{ act: actval == 4 }">
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
export
default
{
export
default
{
name
:
'bottom_nav'
,
name
:
'bottom_nav'
,
props
:
{
props
:
{
...
@@ -38,21 +38,19 @@ export default {
...
@@ -38,21 +38,19 @@ export default {
},
},
created
()
{
created
()
{
this
.
getData
();
this
.
getData
();
},
},
data
()
{
data
()
{
return
{
return
{
count
:
0
count
:
0
};
};
},
},
methods
:
{
methods
:
{
getData
()
{
getData
()
{
this
.
request
(
Api_Url
+
"/cart/count"
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/cart/count'
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
count
=
res
.
data
;
this
.
count
=
res
.
data
;
console
.
log
(
this
.
carcount
)
if
(
this
.
carcount
)
{
if
(
this
.
carcount
){
this
.
count
=
this
.
carcount
;
this
.
count
=
this
.
carcount
}
}
}
}
});
});
...
...
components/drag-button-follow/drag-button-follow.vue
View file @
31a21af0
<
template
>
<
template
>
<view
<!-- #ifndef MP-WEIXIN -->
<view
<!-- #ifndef MP-WEIXIN -->
:style="{
:style="{ transform: `translate(${offsetX}px, ${offsetY}px)`, MsTransform: `translate(${offsetX}px, ${offsetY}px)`, MozTransform: `translate(${offsetX}px, ${offsetY}px)`, WebkitTransform: `translate(${offsetX}px, ${offsetY}px)`, OTransform: `translate(${offsetX}px, ${offsetY}px)`, transition: move ? 'none' : 'transform 0.2s ease-in-out', MsTransition: move ? 'none' : 'transform 0.2s ease-in-out', MozTransition: move ? 'none' : 'transform 0.2s ease-in-out', WebkitTransition: move ? 'none' : 'transform 0.2s ease-in-out', OTransition: move ? 'none' : 'transform 0.2s ease-in-out' }"
transform: `translate(${offsetX}px, ${offsetY}px)`,
MsTransform: `translate(${offsetX}px, ${offsetY}px)`,
MozTransform: `translate(${offsetX}px, ${offsetY}px)`,
WebkitTransform: `translate(${offsetX}px, ${offsetY}px)`,
OTransform: `translate(${offsetX}px, ${offsetY}px)`,
transition: move ? 'none' : 'transform 0.2s ease-in-out',
MsTransition: move ? 'none' : 'transform 0.2s ease-in-out',
MozTransition: move ? 'none' : 'transform 0.2s ease-in-out',
WebkitTransition: move ? 'none' : 'transform 0.2s ease-in-out',
OTransition: move ? 'none' : 'transform 0.2s ease-in-out'
}"
<!-- #endif -->
<!-- #endif -->
@click.stop="click"
@click.stop="click" @touchmove.stop.prevent="touchmove" @touchstart="touchstart" @touchend="touchend" >
@touchmove.stop.prevent="touchmove"
@touchstart="touchstart"
@touchend="touchend"
>
<a
class=
"navxfbox25"
:href=
"url"
target=
"_balnk"
>
<a
class=
"navxfbox25"
:href=
"url"
target=
"_balnk"
>
<text
class=
"icon iconfont icon-qq icon-qqnavxf"
></text>
<text
class=
"icon iconfont icon-qq icon-qqnavxf"
></text>
<view
class=
"texttmavsk"
>
QQ
</view>
<view
class=
"texttmavsk"
>
QQ
</view>
<view
class=
"texttmavsk"
>
咨询
</view>
<view
class=
"texttmavsk"
>
咨询
</view>
</a>
</a>
<slot>
<slot></slot>
</slot>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'DragButtonFollow'
,
name
:
'DragButtonFollow'
,
props
:
{
props
:
{
className
:
{
className
:
{
...
@@ -51,7 +34,6 @@
...
@@ -51,7 +34,6 @@
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
follow
:
{
follow
:
{
type
:
String
|
Boolean
,
type
:
String
|
Boolean
,
default
:
'all'
default
:
'all'
...
@@ -71,49 +53,48 @@
...
@@ -71,49 +53,48 @@
left
:
0
,
left
:
0
,
top
:
0
,
top
:
0
,
move
:
false
,
move
:
false
,
foll
:
{
foll
:
{}
};
}
}
},
},
mounted
()
{
mounted
()
{
const
systemInfo
=
uni
.
getSystemInfoSync
()
||
{};
const
systemInfo
=
uni
.
getSystemInfoSync
()
||
{}
this
.
$options
.
safeArea
=
{
this
.
$options
.
safeArea
=
{
left
:
0
,
left
:
0
,
top
:
0
,
top
:
0
,
right
:
systemInfo
.
windowWidth
,
right
:
systemInfo
.
windowWidth
,
bottom
:
systemInfo
.
windowHeight
bottom
:
systemInfo
.
windowHeight
}
};
const
query
=
this
.
$parent
.
createSelectorQuery
()
const
query
=
this
.
$parent
.
createSelectorQuery
();
query
.
select
(
`.
${
this
.
className
}
`
).
boundingClientRect
(
data
=>
{
query
.
select
(
`.
${
this
.
className
}
`
)
.
boundingClientRect
(
data
=>
{
if
(
data
)
{
if
(
data
)
{
this
.
width
=
data
.
width
this
.
width
=
data
.
width
;
this
.
height
=
data
.
height
this
.
height
=
data
.
height
;
this
.
left
=
data
.
left
this
.
left
=
data
.
left
;
this
.
top
=
data
.
top
this
.
top
=
data
.
top
;
}
}
}).
exec
()
})
.
exec
();
if
(
this
.
follow
)
{
if
(
this
.
follow
)
{
const
type
=
this
.
follow
.
split
(
","
)
const
type
=
this
.
follow
.
split
(
','
);
let
isLeft
,
isRight
,
isTop
,
isBottom
,
isAll
,
num
let
isLeft
,
isRight
,
isTop
,
isBottom
,
isAll
,
num
;
type
.
forEach
(
_
=>
{
type
.
forEach
(
_
=>
{
if
(
_
===
'all'
)
isAll
=
true
if
(
_
===
'all'
)
isAll
=
true
;
if
(
_
===
'left'
)
isLeft
=
true
if
(
_
===
'left'
)
isLeft
=
true
;
if
(
_
===
'right'
)
isRight
=
true
if
(
_
===
'right'
)
isRight
=
true
;
if
(
_
===
'top'
)
isTop
=
true
if
(
_
===
'top'
)
isTop
=
true
;
if
(
_
===
'bottom'
)
isBottom
=
true
if
(
_
===
'bottom'
)
isBottom
=
true
;
})
});
if
(
isAll
)
isLeft
=
isRight
=
isTop
=
isBottom
=
true
if
(
isAll
)
isLeft
=
isRight
=
isTop
=
isBottom
=
true
;
num
=
Math
.
round
(
this
.
width
*
this
.
followNum
/
100
)
num
=
Math
.
round
((
this
.
width
*
this
.
followNum
)
/
100
);
this
.
foll
=
{
this
.
foll
=
{
isLeft
,
isLeft
,
isRight
,
isRight
,
isTop
,
isTop
,
isBottom
,
isBottom
,
num
num
}
};
}
}
},
},
methods
:
{
methods
:
{
...
@@ -121,97 +102,92 @@
...
@@ -121,97 +102,92 @@
this
.
$emit
(
'btnClick'
);
this
.
$emit
(
'btnClick'
);
},
},
touchstart
(
e
)
{
touchstart
(
e
)
{
if
(
!
this
.
drag
)
return
if
(
!
this
.
drag
)
return
;
this
.
move
=
true
this
.
move
=
true
;
},
},
touchmove
(
e
)
{
touchmove
(
e
)
{
if
(
!
this
.
drag
)
return
if
(
!
this
.
drag
)
return
;
if
(
!
this
.
move
)
return
if
(
!
this
.
move
)
return
;
const
{
const
{
left
,
right
,
top
,
bottom
}
=
this
.
$options
.
safeArea
;
left
,
const
dot
=
e
.
changedTouches
[
0
];
right
,
if
(
dot
.
clientX
<
left
+
this
.
width
/
2
)
dot
.
clientX
=
left
+
this
.
width
/
2
;
top
,
if
(
dot
.
clientX
>
right
-
this
.
width
/
2
)
dot
.
clientX
=
right
-
this
.
width
/
2
;
bottom
if
(
dot
.
clientY
<
top
+
this
.
height
/
2
)
dot
.
clientY
=
top
+
this
.
height
/
2
;
}
=
this
.
$options
.
safeArea
if
(
dot
.
clientY
>
bottom
-
this
.
height
/
2
)
dot
.
clientY
=
bottom
-
this
.
height
/
2
;
const
dot
=
e
.
changedTouches
[
0
]
this
.
offsetX
=
dot
.
clientX
-
this
.
left
-
this
.
width
/
2
;
if
(
dot
.
clientX
<
left
+
this
.
width
/
2
)
dot
.
clientX
=
left
+
this
.
width
/
2
this
.
offsetY
=
dot
.
clientY
-
this
.
top
-
this
.
height
/
2
;
if
(
dot
.
clientX
>
right
-
this
.
width
/
2
)
dot
.
clientX
=
right
-
this
.
width
/
2
if
(
dot
.
clientY
<
top
+
this
.
height
/
2
)
dot
.
clientY
=
top
+
this
.
height
/
2
if
(
dot
.
clientY
>
bottom
-
this
.
height
/
2
)
dot
.
clientY
=
bottom
-
this
.
height
/
2
this
.
offsetX
=
dot
.
clientX
-
this
.
left
-
this
.
width
/
2
this
.
offsetY
=
dot
.
clientY
-
this
.
top
-
this
.
height
/
2
// #ifdef MP-WEIXIN
// #ifdef MP-WEIXIN
this
.
$emit
(
"update:style"
,
`
this
.
$emit
(
'update:style'
,
`
transform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
transform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
WebkitTransform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
WebkitTransform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
transition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
transition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
WebkitTransition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
WebkitTransition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
`
)
`
);
// #endif
// #endif
},
},
touchend
(
e
)
{
touchend
(
e
)
{
if
(
!
this
.
drag
)
return
if
(
!
this
.
drag
)
return
;
this
.
move
=
false
this
.
move
=
false
;
if
(
!
this
.
follow
)
return
if
(
!
this
.
follow
)
return
;
const
dot
=
e
.
changedTouches
[
0
]
const
dot
=
e
.
changedTouches
[
0
];
const
{
const
{
left
,
right
,
top
,
bottom
}
=
this
.
$options
.
safeArea
;
left
,
right
,
top
,
bottom
}
=
this
.
$options
.
safeArea
if
(
this
.
foll
.
isLeft
&&
this
.
foll
.
isRight
)
{
if
(
this
.
foll
.
isLeft
&&
this
.
foll
.
isRight
)
{
if
(
dot
.
clientX
<=
(
left
+
right
)
/
2
)
this
.
offsetX
=
this
.
foll
.
num
-
this
.
left
if
(
dot
.
clientX
<=
(
left
+
right
)
/
2
)
this
.
offsetX
=
this
.
foll
.
num
-
this
.
left
;
if
(
dot
.
clientX
>
(
left
+
right
)
/
2
)
this
.
offsetX
=
right
-
this
.
width
-
this
.
foll
.
num
-
this
.
left
if
(
dot
.
clientX
>
(
left
+
right
)
/
2
)
this
.
offsetX
=
right
-
this
.
width
-
this
.
foll
.
num
-
this
.
left
;
}
else
if
(
this
.
foll
.
isLeft
)
{
}
else
if
(
this
.
foll
.
isLeft
)
{
this
.
offsetX
=
this
.
foll
.
num
-
this
.
left
this
.
offsetX
=
this
.
foll
.
num
-
this
.
left
;
}
else
if
(
this
.
foll
.
isRight
)
{
}
else
if
(
this
.
foll
.
isRight
)
{
this
.
offsetX
=
right
-
this
.
width
-
this
.
foll
.
num
-
this
.
left
this
.
offsetX
=
right
-
this
.
width
-
this
.
foll
.
num
-
this
.
left
;
}
}
if
(
this
.
foll
.
isTop
&&
this
.
foll
.
isBottom
)
{
if
(
this
.
foll
.
isTop
&&
this
.
foll
.
isBottom
)
{
if
(
dot
.
clientY
<=
(
top
+
bottom
)
/
2
)
this
.
offsetY
=
this
.
foll
.
num
-
this
.
top
if
(
dot
.
clientY
<=
(
top
+
bottom
)
/
2
)
this
.
offsetY
=
this
.
foll
.
num
-
this
.
top
;
if
(
dot
.
clientY
>
(
top
+
bottom
)
/
2
)
this
.
offsetY
=
bottom
-
this
.
height
-
this
.
foll
.
num
-
this
.
top
if
(
dot
.
clientY
>
(
top
+
bottom
)
/
2
)
this
.
offsetY
=
bottom
-
this
.
height
-
this
.
foll
.
num
-
this
.
top
;
}
else
if
(
this
.
foll
.
isTop
)
{
}
else
if
(
this
.
foll
.
isTop
)
{
this
.
offsetY
=
this
.
foll
.
num
-
this
.
top
this
.
offsetY
=
this
.
foll
.
num
-
this
.
top
;
}
else
if
(
this
.
foll
.
isBottom
)
{
}
else
if
(
this
.
foll
.
isBottom
)
{
this
.
offsetY
=
bottom
-
this
.
height
-
this
.
foll
.
num
-
this
.
top
this
.
offsetY
=
bottom
-
this
.
height
-
this
.
foll
.
num
-
this
.
top
;
}
}
// #ifdef MP-WEIXIN
// #ifdef MP-WEIXIN
this
.
$emit
(
"update:style"
,
`
this
.
$emit
(
'update:style'
,
`
transform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
transform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
WebkitTransform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
WebkitTransform: translate(
${
this
.
offsetX
}
px,
${
this
.
offsetY
}
px);
transition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
transition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
WebkitTransition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
WebkitTransition:
${
this
.
move
?
'none'
:
'transform 0.2s ease-in-out'
}
;
`
)
`
);
// #endif
// #endif
},
}
}
}
}
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
/* #ifdef MP-WEIXIN */
/* #ifdef MP-WEIXIN */
view
{
view
{
height
:
100%
;
height
:
100%
;
width
:
100%
;
width
:
100%
;
display
:
inherit
;
display
:
inherit
;
justify-content
:
inherit
;
justify-content
:
inherit
;
align-items
:
inherit
;
align-items
:
inherit
;
}
}
/* #endif */
/* #endif */
.drag-button
{
.drag-button
{
width
:
68
rpx
;
width
:
68
rpx
;
height
:
130
rpx
;
height
:
130
rpx
;
background
:
#1969F
9
;
background
:
#1969f
9
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
position
:
fixed
;
position
:
fixed
;
left
:
0px
;
left
:
0px
;
top
:
50%
;
top
:
50%
;
z-index
:
777
;
z-index
:
777
;
}
}
.navxfbox25
{
.navxfbox25
{
width
:
68
rpx
;
width
:
68
rpx
;
height
:
130
rpx
;
height
:
130
rpx
;
text-align
:
center
;
text-align
:
center
;
...
@@ -219,18 +195,17 @@
...
@@ -219,18 +195,17 @@
box-sizing
:
border-box
;
box-sizing
:
border-box
;
display
:
block
;
display
:
block
;
text-decoration
:
none
;
text-decoration
:
none
;
}
}
.icon-qqnavxf
{
.icon-qqnavxf
{
font-size
:
48
rpx
;
font-size
:
48
rpx
;
color
:
#fff
;
color
:
#fff
;
}
}
.texttmavsk
{
.texttmavsk
{
font-size
:
20
rpx
;
font-size
:
20
rpx
;
color
:
#fff
;
color
:
#fff
;
height
:
24
rpx
;
height
:
24
rpx
;
line-height
:
24
rpx
;
line-height
:
24
rpx
;
}
}
</
style
>
</
style
>
main.js
View file @
31a21af0
import
App
from
'./App'
import
App
from
'./App'
import
{
request
}
from
'@/util/util.js'
import
{
request
}
from
'@/util/util.js'
import
filters
from
'@/filters'
import
filters
from
'@/filters'
import
router
from
'@/router/index.js'
import
router
from
'@/router/index.js'
import
{
RouterMount
}
from
'uni-simple-router'
import
{
RouterMount
}
from
'uni-simple-router'
import
directive
from
'@/directive'
import
directive
from
'@/directive'
import
{
Ichunt_Api
}
from
'@/util/api.js'
;
// #ifndef VUE3
// #ifndef VUE3
import
Vue
from
'vue'
import
Vue
from
'vue'
...
@@ -18,16 +20,33 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
...
@@ -18,16 +20,33 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
//自定义指令
//自定义指令
Vue
.
use
(
directive
);
Vue
.
use
(
directive
);
//定义全局变量
var
globalData
=
{
SEARCH_SUPPLIER_SINGLE
:
''
,
global_contact_us
:
''
,
h5_home_activity_recommend
:
''
,
h5_home_hide_menu
:
''
,
h5_home_hot_search_goods
:
''
,
kfqq_xk
:
''
};
//读取全局变量配置
request
(
Ichunt_Api
+
'/api/common/data'
,
'GET'
,
{},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
globalData
.
SEARCH_SUPPLIER_SINGLE
=
res
.
data
.
SEARCH_SUPPLIER_SINGLE
;
globalData
.
global_contact_us
=
res
.
data
.
global_contact_us
;
globalData
.
h5_home_activity_recommend
=
res
.
data
.
h5_home_activity_recommend
;
globalData
.
h5_home_hide_menu
=
res
.
data
.
h5_home_hide_menu
;
globalData
.
h5_home_hot_search_goods
=
res
.
data
.
h5_home_hot_search_goods
;
globalData
.
kfqq_xk
=
res
.
data
.
kfqq_xk
.
data
;
Vue
.
prototype
.
$globalData
=
globalData
;
}
});
try
{
try
{
function
isPromise
(
obj
)
{
function
isPromise
(
obj
)
{
return
(
return
(
!!
obj
&&
(
typeof
obj
===
"object"
||
typeof
obj
===
"function"
)
&&
typeof
obj
.
then
===
"function"
);
!!
obj
&&
(
typeof
obj
===
"object"
||
typeof
obj
===
"function"
)
&&
typeof
obj
.
then
===
"function"
);
}
}
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
...
...
pages/index/index.vue
View file @
31a21af0
<
template
>
<
template
>
<view
class=
"page indexPage"
>
<view
class=
"page indexPage"
>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
:url=
"kfurl"
></drag-button-follow>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
:url=
"kfurl"
></drag-button-follow>
<view
class=
"header "
:class=
"
{'fixedtop':scrollTop>45
}">
<view
class=
"header "
:class=
"
{ fixedtop: scrollTop > 45
}">
<view
class=
"search-topb row bothSide "
>
<view
class=
"search-topb row bothSide "
>
<image
src=
"../../static/logosmall.png"
></image>
<image
src=
"../../static/logosmall.png"
></image>
<navigator
class=
"searchinput row"
url=
"/search"
>
<navigator
class=
"searchinput row"
url=
"/search"
>
...
@@ -11,31 +10,27 @@
...
@@ -11,31 +10,27 @@
</navigator>
</navigator>
<navigator
class=
"newsbox"
url=
"/user/msg"
>
<navigator
class=
"newsbox"
url=
"/user/msg"
>
<text
class=
"icon iconfont icon-news"
></text>
<text
class=
"icon iconfont icon-news"
></text>
<text
class=
"counts"
>
{{
newscount
}}
</text>
<text
class=
"counts"
>
{{
newscount
}}
</text>
</navigator>
</navigator>
<view
class=
"cdbox"
>
<view
class=
"cdbox"
>
<text
class=
"icon iconfont icon-candan"
></text>
<text
class=
"icon iconfont icon-candan"
></text>
<text
class=
"sj"
></text>
<text
class=
"sj"
></text>
<view
class=
"cdcons"
>
<view
class=
"cdcons"
>
<a
:href=
"item.url"
v-for=
"(item,index) in pbobj.h5_home_hide_menu"
<a
:href=
"item.url"
v-for=
"(item, index) in pbobj.h5_home_hide_menu"
:key=
"index"
>
{{
item
.
title
}}
</a>
:key=
"index"
>
{{
item
.
title
}}
</a>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"tipsad row avarage"
>
<view
class=
"tipsad row avarage"
>
<view
class=
"taditem"
@
click=
"clickbug"
v-for=
"(item,
index) in obj.h5_home_concept_text"
:key=
"index"
>
<view
class=
"taditem"
@
click=
"clickbug"
v-for=
"(item,
index) in obj.h5_home_concept_text"
:key=
"index"
>
<text
:class=
"'icon iconfont icon-adindex'+(index+
1)"
></text>
<text
:class=
"'icon iconfont icon-adindex' + (index +
1)"
></text>
<text>
{{
item
.
title
}}
</text>
<text>
{{
item
.
title
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"bannerbox"
>
<view
class=
"bannerbox"
>
<swiper
class=
"swiper"
circular
:indicator-dots=
"autoplay"
indicator-color=
"#fff"
:autoplay=
"autoplay"
>
<swiper
class=
"swiper"
circular
:indicator-dots=
"autoplay"
indicator-color=
"#fff"
:autoplay=
"autoplay"
>
<swiper-item
v-for=
"(item, index) in obj.rollbanner"
:key=
"index"
>
<swiper-item
v-for=
"(item, index) in obj.rollbanner"
:key=
"index"
>
<a
:href=
"item.url"
>
<a
:href=
"item.url"
><image
:src=
"item.images"
></image></a>
<image
:src=
"item.images"
></image>
</a>
</swiper-item>
</swiper-item>
</swiper>
</swiper>
</view>
</view>
</view>
</view>
...
@@ -43,110 +38,108 @@
...
@@ -43,110 +38,108 @@
<text
class=
"icon iconfont icon-tz"
></text>
<text
class=
"icon iconfont icon-tz"
></text>
<view
class=
"ggcons"
>
<view
class=
"ggcons"
>
<view
class=
"ggsec"
ref=
"boxcpr"
>
<view
class=
"ggsec"
ref=
"boxcpr"
>
<a
:href=
"item.url"
class=
"row"
v-for=
"(item,index) in obj.h5_home_notice"
:key=
"index"
>
<a
:href=
"item.url"
class=
"row"
v-for=
"(item, index) in obj.h5_home_notice"
:key=
"index"
>
<view
class=
"ggtext row"
><text
class=
"elep titletext"
>
{{
item
.
title
}}
</text>
<text>
>>
</text>
<view
class=
"ggtext row"
>
<text
class=
"elep titletext"
>
{{
item
.
title
}}
</text>
<text>
>>
</text>
</view>
</view>
</a>
</a>
</view>
</view>
</view>
</view>
</view>
</view>
<view
class=
"szbox row avarage"
>
<view
class=
"szbox row avarage"
>
<a
:href=
"item.url"
v-for=
"(item,
index) in obj.h5_home_function_nav"
:key=
"index"
>
<a
:href=
"item.url"
v-for=
"(item,
index) in obj.h5_home_function_nav"
:key=
"index"
>
<image
:src=
"item.images"
></image>
<image
:src=
"item.images"
></image>
<view
class=
"sitips"
>
{{
item
.
title
||
"默认文案"
}}
</view>
<view
class=
"sitips"
>
{{
item
.
title
||
'默认文案'
}}
</view>
</a>
</a>
</view>
</view>
<view
class=
"brandbox"
>
<view
class=
"brandbox"
>
<view
class=
"brand-tab row bothSide"
>
<view
class=
"brand-tab row bothSide"
>
<view
:class=
'
{"act":brandact==1}' class="tabitem" @click="tabchange(1)">
<view
:class=
"
{ act: brandact == 1 }" class="tabitem" @click="tabchange(1)">
<text>
原厂
</text><text
class=
"hztext"
>
直供
</text>
<text>
原厂
</text>
<text
class=
"hztext"
>
直供
</text>
<view
class=
"hztips"
>
原厂战略合作 官方技术支持
</view>
<view
class=
"hztips"
>
原厂战略合作 官方技术支持
</view>
</view>
</view>
<view
class=
"tabitem hwxhitem"
@
click=
"tabchange(2)"
>
<view
class=
"tabitem hwxhitem"
@
click=
"tabchange(2)"
>
<text>
海外
</text><text
class=
"hztext"
>
现货
</text>
<text>
海外
</text>
<text
class=
"hztext"
>
现货
</text>
<view
class=
"hztips"
>
海外千万元物料 一站式现货采购
</view>
<view
class=
"hztips"
>
海外千万元物料 一站式现货采购
</view>
</view>
</view>
</view>
</view>
<view
class=
"brand-con row bothSide"
v-show=
'brandact==1'
>
<view
class=
"brand-con row bothSide"
v-show=
"brandact == 1"
>
<a
:href=
"item.url"
v-for=
"(item,index) in obj.h5_home_original_supply"
:key=
"index"
>
<a
:href=
"item.url"
v-for=
"(item, index) in obj.h5_home_original_supply"
:key=
"index"
><image
:src=
"item.images"
></image></a>
<image
:src=
"item.images"
></image>
</a>
</view>
</view>
<view
class=
"brand-con row bothSide brand-conxh"
v-show=
'brandact!=1'
>
<view
class=
"brand-con row bothSide brand-conxh"
v-show=
"brandact != 1"
>
<a
:href=
"item.url"
v-for=
"(item,index) in obj.h5_home_oversea_goods"
:key=
"index"
>
<a
:href=
"item.url"
v-for=
"(item, index) in obj.h5_home_oversea_goods"
:key=
"index"
><image
:src=
"item.images"
></image></a>
<image
:src=
"item.images"
></image>
</a>
</view>
</view>
</view>
</view>
<view
class=
"goods-box"
>
<view
class=
"goods-box"
>
<view
class=
"titg"
>
精选物料
</view>
<view
class=
"titg"
>
精选物料
</view>
<scroll-view
class=
"goods-con"
scroll-x=
"true"
>
<scroll-view
class=
"goods-con"
scroll-x=
"true"
>
<navigator
:url=
"'/item?goods_id='+item.goods_id"
class=
"goods-item"
<navigator
:url=
"'/item?goods_id=' + item.goods_id"
class=
"goods-item"
v-for=
"(item, index) in obj.h5_home_choice_goods"
:key=
"index"
>
v-for=
"(item,index) in obj.h5_home_choice_goods"
:key=
"index"
>
<image
:src=
"item.goods_images"
></image>
<image
:src=
"item.goods_images"
></image>
<view
class=
"xhg elep"
>
{{
item
.
goods_name
}}
</view>
<view
class=
"xhg elep"
>
{{
item
.
goods_name
}}
</view>
<view
class=
"ppg elep"
>
品牌:
<text>
{{
item
.
brand_name
}}
</text></view>
<view
class=
"ppg elep"
>
<view
class=
"jgg elep"
>
价格:
<text>
{{
item
.
price
}}
</text></view>
品牌:
<text>
{{
item
.
brand_name
}}
</text>
</view>
<view
class=
"jgg elep"
>
价格:
<text>
{{
item
.
price
}}
</text>
</view>
</navigator>
</navigator>
</scroll-view>
</scroll-view>
</view>
</view>
<view
class=
"fwbox"
>
<view
class=
"fwbox"
>
<view
class=
"fwinfo"
>
<view
class=
"fwinfo"
>
<view
class=
"tiiw"
>
<view
class=
"tiiw"
>
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/57ea7022c4120d275183e00bdf86e97e.png"
>
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/57ea7022c4120d275183e00bdf86e97e.png"
></image>
</image>
猎芯网的服务保障
猎芯网的服务保障
</view>
<view
class=
"finfocon"
>
每一颗电了物料都将通过猎芯网严格的质量检测,我们将有效把控供应链源头质量,为客户稳定生产保驾护航。成为值得信赖的电子供应链技术与服务提供商。
</view>
</view>
<view
class=
"finfocon"
>
每一颗电了物料都将通过猎芯网严格的质量检测,我们将有效把控供应链源头质量,为客户稳定生产保驾护航。成为值得信赖的电子供应链技术与服务提供商。
</view>
<view
class=
"rzbox row bothSide"
>
<view
class=
"rzbox row bothSide"
>
<view
class=
"rzitem"
v-for=
"(item,index) in obj.h5_home_qualifications"
:key=
"index"
v-if=
"index
<
3
"
>
<view
class=
"rzitem"
v-for=
"(item, index) in obj.h5_home_qualifications"
:key=
"index"
v-if=
"index
<
3
"
>
<image
:src=
"item.images"
></image>
<image
:src=
"item.images"
></image>
<text>
{{
item
.
title
}}
</text>
<text>
{{
item
.
title
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view
v-for=
"(item,
index) in obj.h5_home_slogan"
:key=
"index"
>
<view
v-for=
"(item,
index) in obj.h5_home_slogan"
:key=
"index"
>
<view
class=
"videobox"
>
<view
class=
"videobox"
>
<view
class=
"tiib"
>
{{
item
.
title
}}
<view
class=
"tiib"
>
<image
{{
item
.
title
}}
src=
"https://img.ichunt.com/images/ichunt/202304/05/870dc360521d97062018c93afb40130e.png"
>
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/870dc360521d97062018c93afb40130e.png"
></image>
</image>
</view>
</view>
</view>
<view
class=
"videoval"
>
<video
object-fit=
"fill"
:src=
"item.images"
></video>
</view>
</view>
<view
class=
"videoval"
><video
object-fit=
"fill"
:src=
"item.images"
></video></view>
</view>
</view>
</view>
</view>
<view
class=
"newsbox"
>
<view
class=
"newsbox"
>
<view
class=
"news-tab row"
>
<view
class=
"news-tab row"
>
<view
class=
"tab-item "
@
click=
"newtab(index)"
:class=
"
{act:(index==newsindex)}"
<view
class=
"tab-item "
@
click=
"newtab(index)"
:class=
"
{ act: index == newsindex }" v-for="(item, index) in obj.h5_home_article" :key="index">
{{
item
.
title
}}
</view>
v-for="(item,index) in obj.h5_home_article" :key="index">
{{
item
.
title
}}
</view>
</view>
</view>
<view
class=
"newscons"
v-for=
"(item,index) in obj.h5_home_article"
:key=
"index"
v-show=
"index==
newsindex"
>
<view
class=
"newscons"
v-for=
"(item, index) in obj.h5_home_article"
:key=
"index"
v-show=
"index ==
newsindex"
>
<a
class=
"newsconitem row"
:href=
"item1.url"
v-for=
"(item1,
index1) in item.article_list"
:key=
"index1"
>
<a
class=
"newsconitem row"
:href=
"item1.url"
v-for=
"(item1,
index1) in item.article_list"
:key=
"index1"
>
<view
class=
"row bothSide"
>
<view
class=
"row bothSide"
>
<view
class=
"ncleft"
>
<view
class=
"ncleft"
>
<view
class=
"titnew elep2"
>
{{
item1
.
title
}}
</view>
<view
class=
"titnew elep2"
>
{{
item1
.
title
}}
</view>
<view
class=
"tittips elep2"
>
{{
item1
.
description
}}
</view>
<view
class=
"tittips elep2"
>
{{
item1
.
description
}}
</view>
</view>
</view>
<image
:src=
"item1.litpic"
></image>
<image
:src=
"item1.litpic"
></image>
</view>
</view>
<view
class=
"newitembottom row bothSide"
>
<view
class=
"newitembottom row bothSide"
>
<view
class=
"tagbox row"
>
<view
class=
"tagbox row"
>
<view
class=
"tagitem"
v-for=
"(item2,index2) in item1.tag"
:key=
"index2"
>
{{
item2
.
tag
}}
</view>
<view
class=
"tagitem"
v-for=
"(item2, index2) in item1.tag"
:key=
"index2"
>
{{
item2
.
tag
}}
</view>
</view>
</view>
<view
class=
"newtime"
>
{{
item1
.
publish_time
}}
</view>
<view
class=
"newtime"
>
{{
item1
.
publish_time
}}
</view>
</view>
</view>
</a>
</a>
</view>
</view>
<view
class=
"newsbot"
>
<view
class=
"newsbot"
>
<navigator
url=
"/news"
>
浏览更多资讯
<text
class=
"icon iconfont icon-jt"
></text></navigator>
<navigator
url=
"/news"
>
浏览更多资讯
<text
class=
"icon iconfont icon-jt"
></text>
</navigator>
</view>
</view>
</view>
</view>
<view
class=
"pagebot"
>
—— 已经到底了 ——
</view>
<view
class=
"pagebot"
>
—— 已经到底了 ——
</view>
...
@@ -155,16 +148,16 @@
...
@@ -155,16 +148,16 @@
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
bottomNavFixed
from
'@/components/bottom_nav.vue'
;
import
bottomNavFixed
from
'@/components/bottom_nav.vue'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
newscount
:
0
,
newscount
:
0
,
kfurl
:
""
,
kfurl
:
''
,
autoplay
:
true
,
autoplay
:
true
,
scrollTop
:
0
,
scrollTop
:
0
,
pbobj
:
{},
pbobj
:
{},
obj
:
{},
obj
:
{},
brandact
:
1
,
brandact
:
1
,
newsindex
:
0
,
newsindex
:
0
,
...
@@ -175,68 +168,66 @@
...
@@ -175,68 +168,66 @@
onShow
()
{
onShow
()
{
this
.
getData
();
this
.
getData
();
},
},
onPageScroll
(
e
)
{
onPageScroll
(
e
)
{
this
.
scrollTop
=
e
.
scrollTop
;
this
.
scrollTop
=
e
.
scrollTop
;
},
},
destroyed
()
{
destroyed
()
{
// 在组件销毁之前,清除 setInterval
// 在组件销毁之前,清除 setInterval
clearInterval
(
this
.
intervalHandler
)
clearInterval
(
this
.
intervalHandler
);
},
},
methods
:
{
methods
:
{
moveUp
()
{
moveUp
()
{
const
moveDistance
=
16
;
const
moveDistance
=
16
;
let
height_
=
this
.
obj
.
h5_home_notice
.
length
*
16
;
let
height_
=
this
.
obj
.
h5_home_notice
.
length
*
16
;
this
.
translateY
=
this
.
translateY
-
moveDistance
;
this
.
translateY
=
this
.
translateY
-
moveDistance
;
if
(
Math
.
abs
(
this
.
translateY
)
>=
height_
){
this
.
translateY
=
0
}
if
(
Math
.
abs
(
this
.
translateY
)
>=
height_
)
{
this
.
$refs
.
boxcpr
.
$el
.
style
.
transform
=
`translateY(
${
this
.
translateY
}
px)`
this
.
translateY
=
0
;
}
this
.
$refs
.
boxcpr
.
$el
.
style
.
transform
=
`translateY(
${
this
.
translateY
}
px)`
;
},
},
newtab
(
index
)
{
newtab
(
index
)
{
this
.
newsindex
=
index
this
.
newsindex
=
index
;
},
},
clickbug
(
e
)
{
clickbug
(
e
)
{
return
false
return
false
;
},
},
tabchange
(
guid
)
{
tabchange
(
guid
)
{
this
.
brandact
=
guid
;
this
.
brandact
=
guid
;
},
},
allowChange
()
{
allowChange
()
{},
},
getData
()
{
getData
()
{
this
.
request
(
Ichunt_Api
+
"/api/index/index"
,
'GET'
,
{},
).
then
(
res
=>
{
this
.
request
(
Ichunt_Api
+
'/api/index/index'
,
'GET'
,
{}
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
obj
=
res
.
data
;
this
.
obj
=
res
.
data
;
clearInterval
(
this
.
intervalHandler
)
clearInterval
(
this
.
intervalHandler
);
if
(
this
.
obj
.
h5_home_notice
.
length
<=
1
)
{
if
(
this
.
obj
.
h5_home_notice
.
length
<=
1
)
{
return
return
;
}
}
this
.
intervalHandler
=
setInterval
(()
=>
{
this
.
intervalHandler
=
setInterval
(()
=>
{
this
.
moveUp
()
this
.
moveUp
();
},
10000
)
},
10000
);
}
}
});
});
this
.
request
(
Ichunt_Api
+
"/api/common/data"
,
'GET'
,
{},
).
then
(
res
=>
{
this
.
request
(
Ichunt_Api
+
'/api/common/data'
,
'GET'
,
{}
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
pbobj
=
res
.
data
;
this
.
pbobj
=
res
.
data
;
this
.
kfurl
=
this
.
pbobj
.
kfqq_xk
.
data
this
.
kfurl
=
this
.
pbobj
.
kfqq_xk
.
data
;
}
}
});
});
this
.
request
(
Api_Url
+
"/msg/allnum"
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/msg/allnum'
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
newscount
=
res
.
data
this
.
newscount
=
res
.
data
;
}
}
});
});
}
}
},
},
components
:
{
components
:
{
bottomNavFixed
bottomNavFixed
}
}
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
@import
'../../assets/css/index/index.scss'
;
@import
'../../assets/css/index/index.scss'
;
</
style
>
</
style
>
pages/mine/invoice.vue
View file @
31a21af0
<
template
>
<
template
>
<view
class=
"page-userAddress"
>
<view
class=
"page-userAddress"
>
<template
v-if=
"from"
>
<navElement
title=
"选择发票"
></navElement>
</
template
>
<
template
v-else
>
<navElement
title=
"发票管理"
></navElement>
<navElement
title=
"发票管理"
></navElement>
</
template
>
<view
class=
"tip row verCenter"
>
<view
class=
"tip row verCenter"
>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"t1"
>
已创建
</text>
<text
class=
"t1"
>
已创建
</text>
...
@@ -22,16 +27,32 @@
...
@@ -22,16 +27,32 @@
</view>
</view>
<view
class=
"p3"
>
{{ item.consignee_province_val }}{{ item.consignee_city_val }}{{ item.consignee_district_val }}{{ item.consignee_address }}
</view>
<view
class=
"p3"
>
{{ item.consignee_province_val }}{{ item.consignee_city_val }}{{ item.consignee_district_val }}{{ item.consignee_address }}
</view>
<view
class=
"operate row bothSide verCenter"
>
<view
class=
"operate row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<
template
v-if=
"from"
>
<view
class=
"row verCenter"
@
click=
"chooseTax(item.tax_id)"
>
<view
class=
"default"
></view>
<text
class=
"default-text"
>
选择
</text>
</view>
</
template
>
<
template
v-else
>
<template
v-if=
"item.is_default == 1"
>
<view
class=
"row verCenter default-curr"
>
<view
class=
"default"
></view>
<text
class=
"default-text"
>
默认发票
</text>
</view>
</
template
>
<
template
v-else
>
<view
class=
"row verCenter"
@
click=
"setdefault(item.tax_id)"
>
<view
class=
"default"
></view>
<view
class=
"default"
></view>
<text
class=
"default-text"
>
设为默认
</text>
<text
class=
"default-text"
>
设为默认
</text>
</view>
</view>
</
template
>
</template>
<view
class=
"row verCenter"
>
<view
class=
"row verCenter"
>
<navigator
class=
"edit row verCenter"
url=
"/user/invoiceEdit
"
hover-class=
"none"
>
<navigator
class=
"edit row verCenter"
:url=
"'/user/invoiceEdit?tax_id=' + item.tax_id + '&inv_type=' + item.inv_type
"
hover-class=
"none"
>
<text
class=
"iconfont icon-bjt"
></text>
<text
class=
"iconfont icon-bjt"
></text>
<text
class=
"tt"
>
编辑
</text>
<text
class=
"tt"
>
编辑
</text>
</navigator>
</navigator>
<view
class=
"delete row verCenter"
>
<view
class=
"delete row verCenter"
@
click=
"deleteInvoice(item.tax_id)"
>
<text
class=
"iconfont icon-del"
></text>
<text
class=
"iconfont icon-del"
></text>
<text
class=
"tt"
>
删除
</text>
<text
class=
"tt"
>
删除
</text>
</view>
</view>
...
@@ -44,10 +65,18 @@
...
@@ -44,10 +65,18 @@
<text
class=
"tt"
>
暂无发票信息
</text>
<text
class=
"tt"
>
暂无发票信息
</text>
</view>
</view>
<view
class=
"btn row verCenter"
>
<view
class=
"btn row verCenter"
>
<
template
v-if=
"from"
>
<navigator
class=
"btn1 row rowCenter verCenter"
:url=
"'/user/invoiceAdd?from=' + from"
hover-class=
"none"
>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"text"
>
添加新发票
</text>
</navigator>
</
template
>
<
template
v-else
>
<navigator
class=
"btn1 row rowCenter verCenter"
url=
"/user/invoiceAdd"
hover-class=
"none"
>
<navigator
class=
"btn1 row rowCenter verCenter"
url=
"/user/invoiceAdd"
hover-class=
"none"
>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"text"
>
添加新发票
</text>
<text
class=
"text"
>
添加新发票
</text>
</navigator>
</navigator>
</
template
>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -62,13 +91,75 @@ export default {
...
@@ -62,13 +91,75 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
from
:
''
,
list
:
[]
list
:
[]
};
};
},
},
onLoad
(
options
)
{
this
.
from
=
options
.
from
||
''
;
},
onShow
()
{
onShow
()
{
this
.
getData
();
this
.
getData
();
},
},
methods
:
{
methods
:
{
/**
* 选择发票
* @param {Object} tax_id
*/
chooseTax
(
tax_id
)
{
if
(
this
.
from
)
{
uni
.
navigateTo
({
url
:
this
.
from
+
'?tax_id='
+
tax_id
});
}
},
/**
* 删除发票
*/
deleteInvoice
(
tax_id
)
{
uni
.
showModal
({
title
:
''
,
content
:
'您确定删除该发票嘛'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
request
(
Api_Url
+
'/invoice/delete'
,
'POST'
,
{
tax_id
:
tax_id
},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
this
.
getData
();
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
},
/**
* 设置默认地址
* @param {Object} tax_id
*/
setdefault
(
tax_id
)
{
this
.
request
(
Api_Url
+
'/invoice/setdefault'
,
'POST'
,
{
tax_id
:
tax_id
},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
getData
();
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
},
getData
()
{
getData
()
{
this
.
request
(
Api_Url
+
'/invoice/lists'
,
'POST'
,
{},
true
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/invoice/lists'
,
'POST'
,
{},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
...
...
pages/mine/invoiceAdd.vue
View file @
31a21af0
...
@@ -2,72 +2,143 @@
...
@@ -2,72 +2,143 @@
<view
class=
"page-userAddress-add"
>
<view
class=
"page-userAddress-add"
>
<navElement
title=
"新增发票"
></navElement>
<navElement
title=
"新增发票"
></navElement>
<view
class=
"tab row avarage verCenter"
>
<view
class=
"tab row avarage verCenter"
>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index)"
:class=
"
{ curr: index == curr }" :key="index" v-for="(item, index) in text_arr">
{{
item
}}
</view>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index
, 1
)"
:class=
"
{ curr: index == curr }" :key="index" v-for="(item, index) in text_arr">
{{
item
}}
</view>
</view>
</view>
<view
class=
"tip row"
>
<view
class=
"tip row"
>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"iconfont icon-ts"
></text>
<view
class=
"text column"
>
<view
class=
"text column"
>
<template
v-if=
"curr == 0"
>
<text
class=
"t1"
>
1.自营商品的增值税普通发票,将随货一起快递给您;
</text>
<text
class=
"t1"
>
1.自营商品的增值税普通发票,将随货一起快递给您;
</text>
<text
class=
"t1"
>
2.默认使用收货地址,您也可以自行修改。
</text>
<text
class=
"t1"
>
2.默认使用收货地址,您也可以自行修改。
</text>
</
template
>
<
template
v-else-if=
"curr == 1"
>
<text
class=
"t1"
>
1、自营商品单笔订单额大于200元,立即申请开票;单笔订单小于200元,统一每月10号开票;
</text>
<text
class=
"t1"
>
2、联营商品月消费额最低满1000元,统一开具发票,如未满1000元,则顺延至下月。
</text>
</
template
>
</view>
</view>
</view>
</view>
<!--增值税普通发票-->
<
template
v-if=
"curr == 0"
>
<view
class=
"invoice-form"
>
<view
class=
"invoice-form"
>
<view
class=
"label-box"
><text
class=
"t1"
>
开票信息
</text></view>
<view
class=
"label-box"
><text
class=
"t1"
>
开票信息
</text></view>
<view
class=
"tab-type row bothSide verCenter"
>
<view
class=
"tab-type row bothSide verCenter"
>
<view
class=
"box curr row rowCenter verCenter"
>
公司
</view>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index, 2)"
:class=
"
{ curr: index == taxIndex }" :key="index" v-for="(item, index) in taxType">
{{
item
}}
</view>
<view
class=
"box row rowCenter verCenter"
>
个人
</view>
</view>
</view>
<!-- 公司 -->
<template
v-if=
"taxIndex == 0"
>
<view
class=
"input-box"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
</view>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input
"
/></view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input"
v-model=
"formParams.tax_title
"
/></view>
</view>
</view>
<view
class=
"input-box"
style=
"margin-bottom: 0;"
>
<view
class=
"input-box"
style=
"margin-bottom: 0;"
>
<view
class=
"input-label"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
税务登记号:
</text>
<text
class=
"tt"
>
税务登记号:
</text>
</view>
</view>
<view><input
type=
"text"
placeholder=
"请输入税务登记号"
class=
"uni-input
"
/></view>
<view><input
type=
"text"
placeholder=
"请输入税务登记号"
class=
"uni-input"
v-model=
"formParams.tax_no
"
/></view>
</view>
</view>
</
template
>
<!-- 个人 -->
<
template
v-else-if=
"taxIndex == 1"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票人名称:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票人名称"
class=
"uni-input"
v-model=
"formParams.tax_title"
/></view>
</view>
</
template
>
</view>
</template>
<!--增值税专用发票-->
<
template
v-else-if=
"curr == 1"
>
<view
class=
"invoice-form"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input"
v-model=
"formParams.tax_title"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
公司注册地址:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入注册地址"
class=
"uni-input"
v-model=
"formParams.company_address"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
公司电话:
</text>
</view>
</view>
<view
class=
"setting-default row verCenter bothSide"
>
<view><input
type=
"text"
placeholder=
"请输入电话号码"
class=
"uni-input"
v-model=
"formParams.company_phone"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
纳税人识别号:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入纳税人识别号"
class=
"uni-input"
v-model=
"formParams.tax_no"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开户银行:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开户银行"
class=
"uni-input"
v-model=
"formParams.bank_name"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
银行账号:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开户银行账号"
class=
"uni-input"
v-model=
"formParams.bank_account"
/></view>
</view>
</view>
</
template
>
<view
class=
"setting-default row verCenter bothSide"
style=
"margin-bottom: 24rpx;"
>
<text
class=
"tt"
>
设为默认发票
</text>
<text
class=
"tt"
>
设为默认发票
</text>
<view><switch
checked
style=
"transform:scale(0.7)"
/></view>
<view><switch
@
change=
"onSwitchChange"
checked
style=
"transform:scale(0.7)"
/></view>
</view>
</view>
<view
class=
"info-title row bothSide verCenter"
>
<!-- 收票信息 -->
<view
class=
"info-title row bothSide verCenter"
@
click=
"toggle = !toggle"
v-if=
"curr == 0"
>
<text
class=
"info-title-t1"
>
展开收票信息(非必填)
</text>
<text
class=
"info-title-t1"
>
展开收票信息(非必填)
</text>
<
template
v-if=
"toggle"
>
<text
class=
"iconfont icon-arrtop"
></text>
<text
class=
"iconfont icon-arrtop"
></text>
</
template
>
<
template
v-else
>
<text
class=
"iconfont icon-arrbot"
></text>
</
template
>
</view>
</view>
<view
class=
"form-box"
>
<view
class=
"form-box"
v-if=
"toggle"
>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
收货
人
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
收票
人
</text>
<input
type=
"text"
placeholder=
"请输入收
货人"
class=
"uni-input
"
/>
<input
type=
"text"
placeholder=
"请输入收
票人"
class=
"uni-input"
v-model=
"formParams.consignee
"
/>
</view>
</view>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
手机号码
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
手机号码
</text>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"intl_code"
>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"intl_code"
>
<view
class=
"row verCenter bothSide"
>
<view
class=
"row verCenter bothSide"
>
<view
class=
"uni-input"
>
{{ array[index] }}
</view>
<view
class=
"uni-input"
>
{{ array[index] }}
</view>
<view
class=
"iconfont icon-arrbot"
></view>
<view
class=
"iconfont icon-arrbot"
></view>
</view>
</view>
</picker>
</picker>
<input
type=
"number"
placeholder=
"请输入手机号"
class=
"uni-input"
style=
"margin-left: 24rpx;"
/>
<input
type=
"number"
placeholder=
"请输入手机号"
class=
"uni-input"
style=
"margin-left: 24rpx;"
v-model=
"formParams.consignee_phone"
/>
</view>
</view>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
所在地区
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
所在地区
</text>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"area"
>
<picker
mode=
"multiSelector"
@
change=
"pickerChange"
@
columnchange=
"bindMultiPickerColumnChange"
:value=
"multiIndex"
:range=
"multiArray"
:range-key=
"'name'"
>
<view
class=
"row verCenter bothSide"
>
<view>
{{ selectText }}
</view>
<view
class=
"uni-input"
>
省、市、区
</view>
<view
class=
"iconfont icon-arrbot"
></view>
</view>
</picker>
</picker>
</view>
</view>
<view
class=
"input-box textarea row verCenter"
><textarea
placeholder=
"请输入详细街道地址"
></textarea></view>
<view
class=
"input-box textarea row verCenter"
><textarea
placeholder=
"请输入详细街道地址"
v-model=
"formParams.consignee_address"
></textarea></view>
</view>
</view>
<view
class=
"btn row verCenter"
>
<view
class=
"btn row verCenter"
>
<view
class=
"btn1 row rowCenter verCenter"
><text
class=
"text"
>
保存
</text></view>
<view
class=
"btn1 row rowCenter verCenter"
@
click=
"invoiceCreate()"
><text
class=
"text"
>
保存
</text></view>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -84,22 +155,291 @@ export default {
...
@@ -84,22 +155,291 @@ export default {
return
{
return
{
index
:
0
,
index
:
0
,
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
formParams
:
{
intl_code
:
'86'
},
curr
:
0
,
curr
:
0
,
text_arr
:
[
'增值税普通发票'
,
'增值税专用发票'
]
text_arr
:
[
'增值税普通发票'
,
'增值税专用发票'
],
taxIndex
:
0
,
taxType
:
[
'公司'
,
'个人'
],
toggle
:
false
,
multiArray
:
[[],
[],
[]],
//省市区数据
multiIndex
:
[
0
,
0
,
0
],
//选中省市区的索引
selectText
:
'请选择省市区'
,
//省市区显示文本
formParams
:
{
inv_type
:
4
,
//发票类型
tax_title
:
''
,
//开票公司名称
tax_no
:
''
,
//税务登记号
company_address
:
''
,
//公司注册地址
company_phone
:
''
,
//公司电话
bank_name
:
''
,
//开户行
bank_account
:
''
,
//开户银行账号
consignee
:
''
,
//收票人
consignee_phone
:
''
,
//收票手机号
intl_code
:
'0086'
,
consignee_province
:
''
,
//寄送地址省
consignee_city
:
''
,
//寄送地址市
consignee_district
:
''
,
//寄送地址区
consignee_address
:
''
,
//详细地址
is_default
:
1
//设置默认
}
};
};
},
},
onLoad
()
{},
onLoad
()
{
this
.
getProvince
();
},
methods
:
{
methods
:
{
tab
(
index
)
{
tab
(
index
,
type
)
{
if
(
type
==
1
)
{
this
.
curr
=
index
;
this
.
curr
=
index
;
if
(
this
.
curr
==
0
)
{
this
.
formParams
.
inv_type
=
4
;
}
else
if
(
this
.
curr
==
1
)
{
this
.
formParams
.
inv_type
=
3
;
this
.
toggle
=
true
;
}
}
else
if
(
type
==
2
)
{
//增值税普通发票公司-个人切换
this
.
taxIndex
=
index
;
if
(
this
.
taxIndex
==
0
)
{
this
.
formParams
.
inv_type
=
4
;
}
else
if
(
this
.
taxIndex
==
1
)
{
this
.
formParams
.
inv_type
=
2
;
}
}
},
/**
* 设置默认监听
* @param {Object} e
*/
onSwitchChange
(
e
)
{
this
.
formParams
.
is_default
=
e
.
detail
.
value
?
1
:
0
;
},
},
bindPickerChange
:
function
(
e
)
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
index
=
e
.
detail
.
value
;
this
.
index
=
e
.
detail
.
value
;
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
},
/**
* 新增发票
*/
invoiceCreate
()
{
if
(
this
.
curr
==
0
)
{
if
(
this
.
taxIndex
==
0
)
{
//增值税普通发票-公司
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票公司名称'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
tax_no
)
{
uni
.
showToast
({
title
:
'请输入税务登记号'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
,
{
is_self
:
1
});
}
else
if
(
this
.
taxIndex
==
1
)
{
//增值税普通发票-个人
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票人名称'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
,
{
is_self
:
1
});
}
}
else
{
//增值税专用发票
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票公司名称'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
company_address
)
{
uni
.
showToast
({
title
:
'请输入注册地址'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
company_phone
)
{
uni
.
showToast
({
title
:
'请输入电话号码'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
tax_no
)
{
uni
.
showToast
({
title
:
'请输入纳税人识别号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
bank_name
)
{
uni
.
showToast
({
title
:
'请输入开户银行'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
bank_account
)
{
uni
.
showToast
({
title
:
'请输入开户银行账号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee
)
{
uni
.
showToast
({
title
:
'请输入收票人'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_phone
)
{
uni
.
showToast
({
title
:
'请输入手机号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_province
)
{
uni
.
showToast
({
title
:
'请输入省、市、区'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_address
)
{
uni
.
showToast
({
title
:
'请输入详细街道地址'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
);
}
this
.
request
(
Api_Url
+
'/invoice/create'
,
'POST'
,
params
,
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'新增发票成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
uni
.
navigateBack
({
delta
:
1
});
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
},
/**
* 省市区联动监听
* @param {Object} e
*/
bindMultiPickerColumnChange
(
e
)
{
console
.
log
(
e
.
detail
);
if
(
e
.
detail
.
column
===
0
)
{
// 第一列滑动
this
.
multiIndex
[
0
]
=
e
.
detail
.
value
;
this
.
getCity
(
this
.
multiArray
[
0
][
e
.
detail
.
value
].
value
,
true
);
// 第一列滑动之后 第二列 和第三列 都变为第一个
this
.
multiIndex
.
splice
(
1
,
1
,
0
);
this
.
multiIndex
.
splice
(
2
,
1
,
0
);
}
else
if
(
e
.
detail
.
column
===
1
)
{
// 第二列滑动
this
.
multiIndex
[
1
]
=
e
.
detail
.
value
;
this
.
getDistrict
(
this
.
multiArray
[
1
][
e
.
detail
.
value
].
value
);
// 第二列滑动之后 第三列 变成第一个
this
.
multiIndex
.
splice
(
2
,
1
,
0
);
}
else
if
(
e
.
detail
.
column
===
2
)
{
// 第三列滑动
this
.
multiIndex
[
2
]
=
e
.
detail
.
value
;
}
this
.
$forceUpdate
();
},
/**
* 省市区选择确定
* @param {Object} e
*/
pickerChange
(
e
)
{
this
.
multiIndex
=
e
.
detail
.
value
;
this
.
formParams
.
consignee_province
=
this
.
multiArray
[
0
][
this
.
multiIndex
[
0
]].
value
;
this
.
formParams
.
consignee_city
=
this
.
multiArray
[
1
][
this
.
multiIndex
[
1
]].
value
;
this
.
formParams
.
consignee_district
=
this
.
multiArray
[
2
][
this
.
multiIndex
[
2
]].
value
;
this
.
selectText
=
`
${
this
.
multiArray
[
0
][
this
.
multiIndex
[
0
]].
name
+
','
+
this
.
multiArray
[
1
][
this
.
multiIndex
[
1
]].
name
+
','
+
this
.
multiArray
[
2
][
this
.
multiIndex
[
2
]].
name
}
`
;
},
/**
* 获取省数据
*/
getProvince
(
id
=
1
)
{
console
.
log
(
'获取省数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
0
]
=
arr
;
this
.
getCity
(
2
,
true
);
this
.
$forceUpdate
();
}
});
},
/**
* @param {Object} id
* @param {Object} default
*/
getCity
(
id
,
defaultParms
)
{
console
.
log
(
'获取市数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
1
]
=
arr
;
if
(
defaultParms
)
{
this
.
getDistrict
(
arr
[
0
].
value
);
}
this
.
$forceUpdate
();
}
});
},
/**
* 获取区数据
* @param {Object} id
*/
getDistrict
(
id
)
{
console
.
log
(
'获取区数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
2
]
=
arr
;
this
.
$forceUpdate
();
}
});
}
}
}
}
};
};
...
...
pages/mine/invoiceEdit.vue
View file @
31a21af0
<
template
>
<
template
>
<view
class=
"page-userAddress-add"
>
<view
class=
"page-userAddress-add"
>
<navElement
title=
"编辑发票"
></navElement>
<navElement
title=
"编辑发票"
>
<template
slot=
"title-bar"
>
<view
class=
"delete"
@
click=
"deleteInvoice()"
style=
"font-size: 28rpx;color: #1969F9;text-align: right;"
>
删除
</view>
</
template
>
</navElement>
<view
class=
"tab row avarage verCenter"
>
<view
class=
"tab row avarage verCenter"
>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index)"
:class=
"
{ curr: index == curr }" :key="index" v-for="(item, index) in text_arr">
{{
item
}}
</view>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index
, 1
)"
:class=
"{ curr: index == curr }"
:key=
"index"
v-for=
"(item, index) in text_arr"
>
{{ item }}
</view>
</view>
</view>
<view
class=
"tip row"
>
<view
class=
"tip row"
>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"iconfont icon-ts"
></text>
<view
class=
"text column"
>
<view
class=
"text column"
>
<
template
v-if=
"curr == 0"
>
<text
class=
"t1"
>
1.自营商品的增值税普通发票,将随货一起快递给您;
</text>
<text
class=
"t1"
>
1.自营商品的增值税普通发票,将随货一起快递给您;
</text>
<text
class=
"t1"
>
2.默认使用收货地址,您也可以自行修改。
</text>
<text
class=
"t1"
>
2.默认使用收货地址,您也可以自行修改。
</text>
</
template
>
<
template
v-else-if=
"curr == 1"
>
<text
class=
"t1"
>
1、自营商品单笔订单额大于200元,立即申请开票;单笔订单小于200元,统一每月10号开票;
</text>
<text
class=
"t1"
>
2、联营商品月消费额最低满1000元,统一开具发票,如未满1000元,则顺延至下月。
</text>
</
template
>
</view>
</view>
</view>
</view>
<!--增值税普通发票-->
<
template
v-if=
"curr == 0"
>
<view
class=
"invoice-form"
>
<view
class=
"invoice-form"
>
<view
class=
"label-box"
><text
class=
"t1"
>
开票信息
</text></view>
<view
class=
"label-box"
><text
class=
"t1"
>
开票信息
</text></view>
<view
class=
"tab-type row bothSide verCenter"
>
<view
class=
"tab-type row bothSide verCenter"
>
<view
class=
"box curr row rowCenter verCenter"
>
公司
</view>
<view
class=
"box row rowCenter verCenter"
@
click=
"tab(index, 2)"
:class=
"
{ curr: index == taxIndex }" :key="index" v-for="(item, index) in taxType">
{{
item
}}
</view>
<view
class=
"box row rowCenter verCenter"
>
个人
</view>
</view>
</view>
<!-- 公司 -->
<template
v-if=
"taxIndex == 0"
>
<view
class=
"input-box"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
</view>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input
"
/></view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input"
v-model=
"formParams.tax_title
"
/></view>
</view>
</view>
<view
class=
"input-box"
style=
"margin-bottom: 0;"
>
<view
class=
"input-box"
style=
"margin-bottom: 0;"
>
<view
class=
"input-label"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
税务登记号:
</text>
<text
class=
"tt"
>
税务登记号:
</text>
</view>
</view>
<view><input
type=
"text"
placeholder=
"请输入税务登记号"
class=
"uni-input
"
/></view>
<view><input
type=
"text"
placeholder=
"请输入税务登记号"
class=
"uni-input"
v-model=
"formParams.tax_no
"
/></view>
</view>
</view>
</
template
>
<!-- 个人 -->
<
template
v-else-if=
"taxIndex == 1"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票人名称:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票人名称"
class=
"uni-input"
v-model=
"formParams.tax_title"
/></view>
</view>
</
template
>
</view>
</template>
<!--增值税专用发票-->
<
template
v-else-if=
"curr == 1"
>
<view
class=
"invoice-form"
>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开票公司名称:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开票公司名称"
class=
"uni-input"
v-model=
"formParams.tax_title"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
公司注册地址:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入注册地址"
class=
"uni-input"
v-model=
"formParams.company_address"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
公司电话:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入电话号码"
class=
"uni-input"
v-model=
"formParams.company_phone"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
纳税人识别号:
</text>
</view>
</view>
<view
class=
"setting-default row verCenter bothSide"
>
<view><input
type=
"text"
placeholder=
"请输入纳税人识别号"
class=
"uni-input"
v-model=
"formParams.tax_no"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
开户银行:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开户银行"
class=
"uni-input"
v-model=
"formParams.bank_name"
/></view>
</view>
<view
class=
"input-box"
>
<view
class=
"input-label"
>
<text
class=
"required"
>
*
</text>
<text
class=
"tt"
>
银行账号:
</text>
</view>
<view><input
type=
"text"
placeholder=
"请输入开户银行账号"
class=
"uni-input"
v-model=
"formParams.bank_account"
/></view>
</view>
</view>
</
template
>
<view
class=
"setting-default row verCenter bothSide"
style=
"margin-bottom: 24rpx;"
>
<text
class=
"tt"
>
设为默认发票
</text>
<text
class=
"tt"
>
设为默认发票
</text>
<view><switch
checked
style=
"transform:scale(0.7)"
/></view>
<view><switch
@
change=
"onSwitchChange"
:checked=
"is_default"
style=
"transform:scale(0.7)"
/></view>
</view>
</view>
<view
class=
"info-title row bothSide verCenter"
>
<!-- 收票信息 -->
<view
class=
"info-title row bothSide verCenter"
@
click=
"toggle = !toggle"
v-if=
"curr == 0"
>
<text
class=
"info-title-t1"
>
展开收票信息(非必填)
</text>
<text
class=
"info-title-t1"
>
展开收票信息(非必填)
</text>
<
template
v-if=
"toggle"
>
<text
class=
"iconfont icon-arrtop"
></text>
<text
class=
"iconfont icon-arrtop"
></text>
</
template
>
<
template
v-else
>
<text
class=
"iconfont icon-arrbot"
></text>
</
template
>
</view>
</view>
<view
class=
"form-box"
>
<view
class=
"form-box"
v-if=
"toggle"
>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
收货
人
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
收票
人
</text>
<input
type=
"text"
placeholder=
"请输入收
货人"
class=
"uni-input
"
/>
<input
type=
"text"
placeholder=
"请输入收
票人"
class=
"uni-input"
v-model=
"formParams.consignee
"
/>
</view>
</view>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
手机号码
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
手机号码
</text>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"intl_code"
>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"intl_code"
>
<view
class=
"row verCenter bothSide"
>
<view
class=
"row verCenter bothSide"
>
<view
class=
"uni-input"
>
{{ array[index] }}
</view>
<view
class=
"uni-input"
>
{{ array[index] }}
</view>
<view
class=
"iconfont icon-arrbot"
></view>
<view
class=
"iconfont icon-arrbot"
></view>
</view>
</view>
</picker>
</picker>
<input
type=
"number"
placeholder=
"请输入手机号"
class=
"uni-input"
style=
"margin-left: 24rpx;"
/>
<input
type=
"number"
placeholder=
"请输入手机号"
class=
"uni-input"
style=
"margin-left: 24rpx;"
v-model=
"formParams.consignee_phone"
/>
</view>
</view>
<view
class=
"input-box input row verCenter"
>
<view
class=
"input-box input row verCenter"
>
<text
class=
"tt"
>
所在地区
</text>
<text
class=
"tt"
:class=
"{ required: curr == 1 }"
>
所在地区
</text>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
class=
"area"
>
<picker
mode=
"multiSelector"
@
change=
"pickerChange"
@
columnchange=
"bindMultiPickerColumnChange"
:value=
"multiIndex"
:range=
"multiArray"
:range-key=
"'name'"
>
<view
class=
"row verCenter bothSide"
>
<view>
{{ selectText }}
</view>
<view
class=
"uni-input"
>
省、市、区
</view>
<view
class=
"iconfont icon-arrbot"
></view>
</view>
</picker>
</picker>
</view>
</view>
<view
class=
"input-box textarea row verCenter"
><textarea
placeholder=
"请输入详细街道地址"
></textarea></view>
<view
class=
"input-box textarea row verCenter"
><textarea
placeholder=
"请输入详细街道地址"
v-model=
"formParams.consignee_address"
></textarea></view>
</view>
</view>
<view
class=
"btn row verCenter"
>
<view
class=
"btn row verCenter"
>
<view
class=
"btn1 row rowCenter verCenter"
><text
class=
"text"
>
保存
</text></view>
<view
class=
"btn1 row rowCenter verCenter"
@
click=
"invoiceUpdate()"
><text
class=
"text"
>
保存修改
</text></view>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -84,22 +159,412 @@ export default {
...
@@ -84,22 +159,412 @@ export default {
return
{
return
{
index
:
0
,
index
:
0
,
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
formParams
:
{
intl_code
:
'86'
},
curr
:
0
,
curr
:
0
,
text_arr
:
[
'增值税普通发票'
,
'增值税专用发票'
]
text_arr
:
[
'增值税普通发票'
,
'增值税专用发票'
],
taxIndex
:
0
,
taxType
:
[
'公司'
,
'个人'
],
toggle
:
false
,
multiArray
:
[[],
[],
[]],
//省市区数据
multiIndex
:
[
0
,
0
,
0
],
//选中省市区的索引
selectText
:
'请选择省市区'
,
//省市区显示文本
is_default
:
true
,
formParams
:
{
tax_id
:
''
,
inv_type
:
4
,
//发票类型
tax_title
:
''
,
//开票公司名称
tax_no
:
''
,
//税务登记号
company_address
:
''
,
//公司注册地址
company_phone
:
''
,
//公司电话
bank_name
:
''
,
//开户行
bank_account
:
''
,
//开户银行账号
consignee
:
''
,
//收票人
consignee_phone
:
''
,
//收票手机号
intl_code
:
'0086'
,
consignee_province
:
''
,
//寄送地址省
consignee_city
:
''
,
//寄送地址市
consignee_district
:
''
,
//寄送地址区
consignee_address
:
''
,
//详细地址
is_default
:
1
//设置默认
}
};
};
},
},
onLoad
()
{},
onLoad
(
options
)
{
this
.
formParams
.
tax_id
=
options
.
tax_id
||
''
;
let
inv_type
=
options
.
inv_type
||
''
;
if
(
inv_type
==
2
)
{
this
.
curr
=
0
;
this
.
taxIndex
=
1
;
}
else
if
(
inv_type
==
3
)
{
this
.
curr
=
0
;
this
.
taxIndex
=
0
;
}
else
if
(
inv_type
==
4
)
{
this
.
curr
=
1
;
this
.
taxIndex
=
0
;
this
.
toggle
=
true
;
}
else
{
this
.
curr
=
0
;
this
.
taxIndex
=
0
;
}
},
onShow
()
{
this
.
getData
();
},
methods
:
{
methods
:
{
tab
(
index
)
{
tab
(
index
,
type
)
{
if
(
type
==
1
)
{
this
.
curr
=
index
;
this
.
curr
=
index
;
if
(
this
.
curr
==
0
)
{
this
.
formParams
.
inv_type
=
4
;
}
else
if
(
this
.
curr
==
1
)
{
this
.
formParams
.
inv_type
=
3
;
this
.
toggle
=
true
;
}
}
else
if
(
type
==
2
)
{
//增值税普通发票公司-个人切换
this
.
taxIndex
=
index
;
if
(
this
.
taxIndex
==
0
)
{
this
.
formParams
.
inv_type
=
4
;
}
else
if
(
this
.
taxIndex
==
1
)
{
this
.
formParams
.
inv_type
=
2
;
}
}
},
/**
* @param {Object} arr
* @param {Object} target
* @param {Object} type
*/
findIndex
(
arr
,
target
,
type
)
{
const
result
=
[];
arr
.
map
((
item
,
index
)
=>
{
if
(
type
)
{
if
(
item
.
value
==
target
)
{
result
.
push
(
index
);
}
}
else
{
if
(
item
==
target
)
{
result
.
push
(
index
);
}
}
});
return
result
;
},
/**
* 设置默认监听
* @param {Object} e
*/
onSwitchChange
(
e
)
{
this
.
formParams
.
is_default
=
e
.
detail
.
value
?
1
:
0
;
},
},
bindPickerChange
:
function
(
e
)
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
index
=
e
.
detail
.
value
;
this
.
index
=
e
.
detail
.
value
;
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
},
/**
* 获取信息
*/
getData
()
{
this
.
request
(
Api_Url
+
'/invoice/info'
,
'POST'
,
{
tax_id
:
this
.
formParams
.
tax_id
},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
formParams
.
inv_type
=
res
.
data
.
inv_type
;
this
.
formParams
.
tax_title
=
res
.
data
.
tax_title
;
this
.
formParams
.
tax_no
=
res
.
data
.
tax_no
;
this
.
formParams
.
company_address
=
res
.
data
.
company_address
;
this
.
formParams
.
company_phone
=
res
.
data
.
company_phone
;
this
.
formParams
.
bank_name
=
res
.
data
.
bank_name
;
this
.
formParams
.
bank_account
=
res
.
data
.
bank_account
;
this
.
formParams
.
consignee
=
res
.
data
.
consignee
;
this
.
formParams
.
consignee_phone
=
res
.
data
.
consignee_phone
;
this
.
formParams
.
intl_code
=
res
.
data
.
intl_code
;
this
.
formParams
.
consignee_province
=
res
.
data
.
consignee_province
;
this
.
formParams
.
consignee_city
=
res
.
data
.
consignee_city
;
this
.
formParams
.
consignee_district
=
res
.
data
.
consignee_district
;
this
.
formParams
.
consignee_address
=
res
.
data
.
consignee_address
;
this
.
is_default
=
res
.
data
.
is_default
==
1
?
true
:
false
;
this
.
formParams
.
is_default
=
res
.
data
.
is_default
;
this
.
selectText
=
`
${
res
.
data
.
consignee_province_val
+
','
+
res
.
data
.
consignee_city_val
+
','
+
res
.
data
.
consignee_district_val
}
`
;
//收票信息
if
(
this
.
formParams
.
consignee
&&
this
.
formParams
.
consignee_phone
)
{
this
.
toggle
=
true
;
}
//区号
let
index
=
this
.
findIndex
(
this
.
array
,
res
.
data
.
intl_code
);
this
.
index
=
index
;
//初始化省市区
this
.
getProvince
(
1
,
res
.
data
.
consignee_province
);
}
});
},
/**
* 删除发票
*/
deleteInvoice
()
{
uni
.
showModal
({
title
:
''
,
content
:
'您确定删除该发票嘛'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
request
(
Api_Url
+
'/invoice/delete'
,
'POST'
,
{
tax_id
:
this
.
formParams
.
tax_id
},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
uni
.
navigateBack
({
delta
:
1
});
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
},
/**
* 更新发票
*/
invoiceUpdate
()
{
if
(
this
.
curr
==
0
)
{
if
(
this
.
taxIndex
==
0
)
{
//增值税普通发票-公司
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票公司名称'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
tax_no
)
{
uni
.
showToast
({
title
:
'请输入税务登记号'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
,
{
is_self
:
1
});
}
else
if
(
this
.
taxIndex
==
1
)
{
//增值税普通发票-个人
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票人名称'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
,
{
is_self
:
1
});
}
}
else
{
//增值税专用发票
if
(
!
this
.
formParams
.
tax_title
)
{
uni
.
showToast
({
title
:
'请输入开票公司名称'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
company_address
)
{
uni
.
showToast
({
title
:
'请输入注册地址'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
company_phone
)
{
uni
.
showToast
({
title
:
'请输入电话号码'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
tax_no
)
{
uni
.
showToast
({
title
:
'请输入纳税人识别号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
bank_name
)
{
uni
.
showToast
({
title
:
'请输入开户银行'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
bank_account
)
{
uni
.
showToast
({
title
:
'请输入开户银行账号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee
)
{
uni
.
showToast
({
title
:
'请输入收票人'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_phone
)
{
uni
.
showToast
({
title
:
'请输入手机号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_province
)
{
uni
.
showToast
({
title
:
'请输入省、市、区'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
consignee_address
)
{
uni
.
showToast
({
title
:
'请输入详细街道地址'
,
icon
:
'none'
});
return
false
;
}
var
params
=
Object
.
assign
({},
this
.
formParams
);
}
this
.
request
(
Api_Url
+
'/invoice/update'
,
'POST'
,
params
,
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'修改发票成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
uni
.
navigateBack
({
delta
:
1
});
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
},
/**
* 省市区联动监听
* @param {Object} e
*/
bindMultiPickerColumnChange
(
e
)
{
console
.
log
(
e
.
detail
);
if
(
e
.
detail
.
column
===
0
)
{
// 第一列滑动
this
.
multiIndex
[
0
]
=
e
.
detail
.
value
;
this
.
getCity
(
this
.
multiArray
[
0
][
e
.
detail
.
value
].
value
,
true
);
// 第一列滑动之后 第二列 和第三列 都变为第一个
this
.
multiIndex
.
splice
(
1
,
1
,
0
);
this
.
multiIndex
.
splice
(
2
,
1
,
0
);
}
else
if
(
e
.
detail
.
column
===
1
)
{
// 第二列滑动
this
.
multiIndex
[
1
]
=
e
.
detail
.
value
;
this
.
getDistrict
(
this
.
multiArray
[
1
][
e
.
detail
.
value
].
value
);
// 第二列滑动之后 第三列 变成第一个
this
.
multiIndex
.
splice
(
2
,
1
,
0
);
}
else
if
(
e
.
detail
.
column
===
2
)
{
// 第三列滑动
this
.
multiIndex
[
2
]
=
e
.
detail
.
value
;
}
this
.
$forceUpdate
();
},
/**
* 省市区选择确定
* @param {Object} e
*/
pickerChange
(
e
)
{
this
.
multiIndex
=
e
.
detail
.
value
;
this
.
formParams
.
consignee_province
=
this
.
multiArray
[
0
][
this
.
multiIndex
[
0
]].
value
;
this
.
formParams
.
consignee_city
=
this
.
multiArray
[
1
][
this
.
multiIndex
[
1
]].
value
;
this
.
formParams
.
consignee_district
=
this
.
multiArray
[
2
][
this
.
multiIndex
[
2
]].
value
;
this
.
selectText
=
`
${
this
.
multiArray
[
0
][
this
.
multiIndex
[
0
]].
name
+
','
+
this
.
multiArray
[
1
][
this
.
multiIndex
[
1
]].
name
+
','
+
this
.
multiArray
[
2
][
this
.
multiIndex
[
2
]].
name
}
`
;
},
/**
* 获取省数据
*/
getProvince
(
id
=
1
,
defaultValue
)
{
console
.
log
(
'获取省数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
0
]
=
arr
;
if
(
defaultValue
)
{
let
index
=
this
.
findIndex
(
arr
,
defaultValue
,
true
);
this
.
multiIndex
.
splice
(
0
,
1
,
index
[
0
]);
}
this
.
getCity
(
this
.
formParams
.
consignee_province
,
this
.
formParams
.
consignee_city
);
this
.
$forceUpdate
();
}
});
},
/**
* 获取市数据
* @param {Object} id
* @param {Object} defaultValue
*/
getCity
(
id
,
defaultValue
)
{
console
.
log
(
'获取市数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
1
]
=
arr
;
if
(
defaultValue
)
{
let
index
=
this
.
findIndex
(
arr
,
defaultValue
,
true
);
this
.
multiIndex
.
splice
(
1
,
1
,
index
[
0
]);
this
.
getDistrict
(
this
.
formParams
.
consignee_city
,
this
.
formParams
.
consignee_district
);
}
this
.
$forceUpdate
();
}
});
},
/**
* 获取区数据
* @param {Object} id
*/
getDistrict
(
id
,
defaultValue
)
{
console
.
log
(
'获取区数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
arr
.
push
({
name
:
res
.
data
[
key
],
value
:
parseInt
(
key
)
});
}
this
.
multiArray
[
2
]
=
arr
;
if
(
defaultValue
)
{
let
index
=
this
.
findIndex
(
arr
,
defaultValue
,
true
);
this
.
multiIndex
.
splice
(
2
,
1
,
index
[
0
]);
}
this
.
$forceUpdate
();
}
});
}
}
}
}
};
};
...
...
pages/mine/shoporder.vue
View file @
31a21af0
<
template
>
<
template
>
<view
class=
"page-userOrder"
>
<view
class=
"page-userOrder"
>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
:url=
"kf
url
"
></drag-button-follow>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
:url=
"kf
qq_xk
"
></drag-button-follow>
<view
class=
"top"
>
<view
class=
"top"
>
<view
class=
"head row bothSide verCenter"
>
<view
class=
"head row bothSide verCenter"
>
<view
class=
"left row verCenter"
>
<view
class=
"left row verCenter"
>
...
@@ -153,8 +153,8 @@ export default {
...
@@ -153,8 +153,8 @@ export default {
format
:
true
format
:
true
});
});
return
{
return
{
kfqq_xk
:
''
,
time
:
currentDate
,
time
:
currentDate
,
kfurl
:
'https://url.cn/uia2no5Z?_type=wpa&qidian=true'
,
arr
:
[
'全部'
,
'待付款'
,
'待收货'
,
'已完结订单'
],
arr
:
[
'全部'
,
'待付款'
,
'待收货'
,
'已完结订单'
],
curr
:
0
,
curr
:
0
,
list
:
[],
list
:
[],
...
@@ -172,6 +172,9 @@ export default {
...
@@ -172,6 +172,9 @@ export default {
}
}
};
};
},
},
onLoad
()
{
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kfqq_xk
;
},
onShow
()
{
onShow
()
{
this
.
getData
();
this
.
getData
();
},
},
...
...
pages/mine/user.vue
View file @
31a21af0
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<text
class=
"tt"
>
我的优惠券
</text>
<text
class=
"tt"
>
我的优惠券
</text>
<text
class=
"tip"
></text>
<text
class=
"tip"
></text>
</navigator>
</navigator>
<a
class=
"box column rowCenter verCenter"
:href=
"
userInfo.kefu_url
"
>
<a
class=
"box column rowCenter verCenter"
:href=
"
kfqq_xk
"
>
<image
src=
"../../static/qq.png"
></image>
<image
src=
"../../static/qq.png"
></image>
<text
class=
"tt"
>
我的客服
</text>
<text
class=
"tt"
>
我的客服
</text>
</a>
</a>
...
@@ -120,10 +120,14 @@ export default {
...
@@ -120,10 +120,14 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
kfqq_xk
:
''
,
userInfo
:
{},
userInfo
:
{},
activity_list
:
[]
activity_list
:
[]
};
};
},
},
onLoad
()
{
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kfqq_xk
;
},
onShow
()
{
onShow
()
{
this
.
getData
();
this
.
getData
();
},
},
...
@@ -315,6 +319,7 @@ export default {
...
@@ -315,6 +319,7 @@ export default {
this
.
request
(
Api_Url
+
'/user/getUserType'
,
'POST'
,
{},
true
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/user/getUserType'
,
'POST'
,
{},
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
userInfo
=
res
.
data
;
this
.
userInfo
=
res
.
data
;
this
.
$globalData
.
kefu
=
res
.
data
.
kefu_url
;
}
else
if
(
res
.
err_code
===
11012
)
{
}
else
if
(
res
.
err_code
===
11012
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/login'
url
:
'/login'
...
...
pages/mine/userAddress.vue
View file @
31a21af0
<
template
>
<
template
>
<view
class=
"page-userAddress"
>
<view
class=
"page-userAddress"
>
<template
v-if=
"from"
>
<navElement
title=
"选择收货地址"
></navElement>
</
template
>
<
template
v-else
>
<navElement
title=
"地址管理"
></navElement>
<navElement
title=
"地址管理"
></navElement>
</
template
>
<view
class=
"tip row verCenter"
style=
"margin-bottom: 16rpx;margin-top: 0;"
>
<view
class=
"tip row verCenter"
style=
"margin-bottom: 16rpx;margin-top: 0;"
>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"iconfont icon-ts"
></text>
<text
class=
"t1"
>
已创建
</text>
<text
class=
"t1"
>
已创建
</text>
...
@@ -17,6 +22,13 @@
...
@@ -17,6 +22,13 @@
</view>
</view>
<view
class=
"p2"
>
{{ item.province_val }}{{ item.city_val }}{{ item.district_val }}{{ item.detail_address }}
</view>
<view
class=
"p2"
>
{{ item.province_val }}{{ item.city_val }}{{ item.district_val }}{{ item.detail_address }}
</view>
<view
class=
"operate row bothSide verCenter"
>
<view
class=
"operate row bothSide verCenter"
>
<
template
v-if=
"from"
>
<view
class=
"row verCenter"
@
click=
"chooseAddress(item.address_id)"
>
<view
class=
"default"
></view>
<text
class=
"default-text"
>
选择
</text>
</view>
</
template
>
<
template
v-else
>
<template
v-if=
"item.is_default == 1"
>
<template
v-if=
"item.is_default == 1"
>
<view
class=
"row verCenter default-curr"
>
<view
class=
"row verCenter default-curr"
>
<view
class=
"default"
></view>
<view
class=
"default"
></view>
...
@@ -29,6 +41,7 @@
...
@@ -29,6 +41,7 @@
<text
class=
"default-text"
>
设为默认
</text>
<text
class=
"default-text"
>
设为默认
</text>
</view>
</view>
</
template
>
</
template
>
</template>
<view
class=
"row verCenter"
>
<view
class=
"row verCenter"
>
<navigator
class=
"edit row verCenter"
:url=
"'/user/userAddressEdit?address_id=' + item.address_id"
hover-class=
"none"
>
<navigator
class=
"edit row verCenter"
:url=
"'/user/userAddressEdit?address_id=' + item.address_id"
hover-class=
"none"
>
<text
class=
"iconfont icon-bjt"
></text>
<text
class=
"iconfont icon-bjt"
></text>
...
@@ -47,10 +60,18 @@
...
@@ -47,10 +60,18 @@
<text
class=
"tt"
>
暂无收货地址
</text>
<text
class=
"tt"
>
暂无收货地址
</text>
</view>
</view>
<view
class=
"btn row verCenter"
>
<view
class=
"btn row verCenter"
>
<
template
v-if=
"from"
>
<navigator
class=
"btn1 row rowCenter verCenter"
:url=
"'/user/userAddressAdd?from=' + from"
hover-class=
"none"
>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"text"
>
新增地址
</text>
</navigator>
</
template
>
<
template
v-else
>
<navigator
class=
"btn1 row rowCenter verCenter"
url=
"/user/userAddressAdd"
hover-class=
"none"
>
<navigator
class=
"btn1 row rowCenter verCenter"
url=
"/user/userAddressAdd"
hover-class=
"none"
>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"text"
>
新增地址
</text>
<text
class=
"text"
>
新增地址
</text>
</navigator>
</navigator>
</
template
>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -65,9 +86,13 @@ export default {
...
@@ -65,9 +86,13 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
from
:
''
,
list
:
[]
list
:
[]
};
};
},
},
onLoad
(
options
)
{
this
.
from
=
options
.
from
||
''
;
},
onShow
()
{
onShow
()
{
this
.
getData
();
this
.
getData
();
},
},
...
@@ -84,6 +109,16 @@ export default {
...
@@ -84,6 +109,16 @@ export default {
});
});
},
},
/**
/**
* 选择地址
*/
chooseAddress
(
address_id
)
{
if
(
this
.
from
)
{
uni
.
navigateTo
({
url
:
this
.
from
+
'?address_id='
+
address_id
});
}
},
/**
* 删除地址
* 删除地址
* @param {Object} address_id
* @param {Object} address_id
*/
*/
...
...
pages/mine/userAddressAdd.vue
View file @
31a21af0
...
@@ -49,6 +49,7 @@ export default {
...
@@ -49,6 +49,7 @@ export default {
index
:
0
,
index
:
0
,
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
array
:
[
'0086'
,
'00886'
,
'00853'
,
'00852'
],
selectText
:
'请选择省市区'
,
selectText
:
'请选择省市区'
,
from
:
''
,
formParams
:
{
formParams
:
{
address_type
:
0
,
address_type
:
0
,
consignee
:
''
,
consignee
:
''
,
...
@@ -62,6 +63,9 @@ export default {
...
@@ -62,6 +63,9 @@ export default {
}
}
};
};
},
},
onLoad
(
options
)
{
this
.
from
=
options
.
from
||
''
;
},
onShow
()
{
onShow
()
{
this
.
getProvince
();
this
.
getProvince
();
},
},
...
@@ -71,11 +75,15 @@ export default {
...
@@ -71,11 +75,15 @@ export default {
this
.
index
=
e
.
detail
.
value
;
this
.
index
=
e
.
detail
.
value
;
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
this
.
formParams
.
intl_code
=
this
.
array
[
e
.
detail
.
value
];
},
},
/**
* 设置默认监听
* @param {Object} e
*/
onSwitchChange
(
e
)
{
onSwitchChange
(
e
)
{
this
.
formParams
.
is_default
=
e
.
detail
.
value
?
1
:
0
;
this
.
formParams
.
is_default
=
e
.
detail
.
value
?
1
:
0
;
},
},
/**
/**
*
地址
监听
*
省市区联动
监听
* @param {Object} e
* @param {Object} e
*/
*/
bindMultiPickerColumnChange
(
e
)
{
bindMultiPickerColumnChange
(
e
)
{
...
@@ -102,7 +110,7 @@ export default {
...
@@ -102,7 +110,7 @@ export default {
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
/**
/**
* 省市区
完成
* 省市区
选择确定
* @param {Object} e
* @param {Object} e
*/
*/
pickerChange
(
e
)
{
pickerChange
(
e
)
{
...
@@ -118,7 +126,7 @@ export default {
...
@@ -118,7 +126,7 @@ export default {
*/
*/
getProvince
(
id
=
1
)
{
getProvince
(
id
=
1
)
{
console
.
log
(
'获取省数据id:'
+
id
);
console
.
log
(
'获取省数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
tru
e
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
fals
e
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
for
(
var
key
in
res
.
data
)
{
...
@@ -136,7 +144,7 @@ export default {
...
@@ -136,7 +144,7 @@ export default {
*/
*/
getCity
(
id
,
defaultParms
)
{
getCity
(
id
,
defaultParms
)
{
console
.
log
(
'获取市数据id:'
+
id
);
console
.
log
(
'获取市数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
tru
e
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
fals
e
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
for
(
var
key
in
res
.
data
)
{
...
@@ -156,7 +164,7 @@ export default {
...
@@ -156,7 +164,7 @@ export default {
*/
*/
getDistrict
(
id
)
{
getDistrict
(
id
)
{
console
.
log
(
'获取区数据id:'
+
id
);
console
.
log
(
'获取区数据id:'
+
id
);
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
tru
e
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/address/pcd'
,
'POST'
,
{
id
:
id
},
fals
e
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
var
arr
=
[];
var
arr
=
[];
for
(
var
key
in
res
.
data
)
{
for
(
var
key
in
res
.
data
)
{
...
@@ -171,6 +179,34 @@ export default {
...
@@ -171,6 +179,34 @@ export default {
* 保存地址
* 保存地址
*/
*/
create
()
{
create
()
{
if
(
!
this
.
formParams
.
consignee
)
{
uni
.
showToast
({
title
:
'请输入收货人'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
mobile
)
{
uni
.
showToast
({
title
:
'请输入手机号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
province
)
{
uni
.
showToast
({
title
:
'请选择省市区'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
detail_address
)
{
uni
.
showToast
({
title
:
'请输入详细街道地址'
,
icon
:
'none'
});
return
false
;
}
this
.
request
(
Api_Url
+
'/address/create'
,
'POST'
,
this
.
formParams
,
true
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/address/create'
,
'POST'
,
this
.
formParams
,
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -178,9 +214,15 @@ export default {
...
@@ -178,9 +214,15 @@ export default {
icon
:
'success'
icon
:
'success'
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
from
)
{
uni
.
navigateTo
({
url
:
this
.
from
+
'?address_id='
+
res
.
data
});
}
else
{
uni
.
navigateBack
({
uni
.
navigateBack
({
delta
:
1
delta
:
1
});
});
}
},
2000
);
},
2000
);
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
...
...
pages/mine/userAddressEdit.vue
View file @
31a21af0
...
@@ -111,7 +111,7 @@ export default {
...
@@ -111,7 +111,7 @@ export default {
return
result
;
return
result
;
},
},
/**
/**
*
地址
监听
*
省市区联动
监听
* @param {Object} e
* @param {Object} e
*/
*/
bindMultiPickerColumnChange
(
e
)
{
bindMultiPickerColumnChange
(
e
)
{
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
/**
/**
* 省市区
完成
* 省市区
选择确定
* @param {Object} e
* @param {Object} e
*/
*/
pickerChange
(
e
)
{
pickerChange
(
e
)
{
...
@@ -209,6 +209,34 @@ export default {
...
@@ -209,6 +209,34 @@ export default {
* 更新
* 更新
*/
*/
update
()
{
update
()
{
if
(
!
this
.
formParams
.
consignee
)
{
uni
.
showToast
({
title
:
'请输入收货人'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
mobile
)
{
uni
.
showToast
({
title
:
'请输入手机号'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
province
)
{
uni
.
showToast
({
title
:
'请选择省市区'
,
icon
:
'none'
});
return
false
;
}
if
(
!
this
.
formParams
.
detail_address
)
{
uni
.
showToast
({
title
:
'请输入详细街道地址'
,
icon
:
'none'
});
return
false
;
}
this
.
request
(
Api_Url
+
'/address/update'
,
'POST'
,
this
.
formParams
,
true
,
true
).
then
(
res
=>
{
this
.
request
(
Api_Url
+
'/address/update'
,
'POST'
,
this
.
formParams
,
true
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -250,6 +278,7 @@ export default {
...
@@ -250,6 +278,7 @@ export default {
});
});
},
},
/**
/**
* 获取市数据
* @param {Object} id
* @param {Object} id
* @param {Object} defaultValue
* @param {Object} defaultValue
*/
*/
...
...
router/index.js
View file @
31a21af0
...
@@ -310,7 +310,7 @@ const router = new Router({
...
@@ -310,7 +310,7 @@ const router = new Router({
//全局路由前置守卫
//全局路由前置守卫
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
to
.
meta
.
auth
)
{
if
(
to
.
meta
&&
to
.
meta
.
auth
)
{
if
(
!
getCookie
(
'Yo4teW_uid'
)
||
getCookie
(
'Yo4teW_uid'
)
==
0
)
{
if
(
!
getCookie
(
'Yo4teW_uid'
)
||
getCookie
(
'Yo4teW_uid'
)
==
0
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/login?referer='
+
to
.
aliasPath
url
:
'/login?referer='
+
to
.
aliasPath
...
...
util/util.js
View file @
31a21af0
...
@@ -44,6 +44,10 @@ const request = (url = '', type = 'GET', param = {}, Loading, headertype) => {
...
@@ -44,6 +44,10 @@ const request = (url = '', type = 'GET', param = {}, Loading, headertype) => {
resolve
(
result
);
resolve
(
result
);
}
else
{
}
else
{
reject
(
response
);
reject
(
response
);
uni
.
showToast
({
title
:
'网络出现问题'
,
icon
:
'error'
});
}
}
},
},
fail
:
(
error
)
=>
{
fail
:
(
error
)
=>
{
...
...
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