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
14be3504
authored
May 24, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
85085964
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
26 deletions
components/bottom_nav.vue
main.js
pages/mine/shoporder.vue
pages/mine/user.vue
components/bottom_nav.vue
View file @
14be3504
...
...
@@ -12,7 +12,7 @@
<text
class=
"icon iconfont icon-car"
></text>
<view>
购物车
<text
class=
"counts"
>
{{
count
}}
</text>
<text
class=
"counts"
>
{{
count
}}
</text>
</view>
</navigator>
<navigator
url=
"/user"
class=
"navitem"
:class=
"
{ act: actval == 4 }">
...
...
@@ -23,7 +23,7 @@
</
template
>
<
script
>
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
export
default
{
name
:
'bottom_nav'
,
props
:
{
...
...
@@ -31,32 +31,30 @@ export default {
type
:
String
,
default
:
1
},
carcount
:
{
type
:
Number
,
default
:
0
}
carcount
:
{
type
:
Number
,
default
:
0
}
},
created
()
{
this
.
getData
();
},
created
()
{
this
.
getData
();
},
data
()
{
return
{
count
:
0
};
count
:
0
};
},
methods
:
{
getData
()
{
this
.
request
(
Api_Url
+
"/cart/count"
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
count
=
res
.
data
;
console
.
log
(
this
.
carcount
)
if
(
this
.
carcount
){
this
.
count
=
this
.
carcount
}
}
});
}
this
.
request
(
Api_Url
+
'/cart/count'
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
count
=
res
.
data
;
if
(
this
.
carcount
)
{
this
.
count
=
this
.
carcount
;
}
}
});
}
}
};
</
script
>
...
...
main.js
View file @
14be3504
...
...
@@ -22,13 +22,23 @@ Vue.use(directive);
//定义全局变量
var
globalData
=
{
kefu
:
''
//客服
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
.
kefu
=
res
.
data
.
kfqq_xk
.
data
;
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
;
}
});
...
...
pages/mine/shoporder.vue
View file @
14be3504
...
...
@@ -173,7 +173,8 @@ export default {
};
},
onLoad
()
{
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kefu
;
console
.
log
(
this
.
$globalData
);
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kfqq_xk
;
},
onShow
()
{
this
.
getData
();
...
...
pages/mine/user.vue
View file @
14be3504
...
...
@@ -125,9 +125,11 @@ export default {
activity_list
:
[]
};
},
onLoad
()
{
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kfqq_xk
;
},
onShow
()
{
this
.
getData
();
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kefu
;
},
methods
:
{
/**
...
...
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