Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shop_mobile_uni
Project
Project
Details
Activity
Releases
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
郑秀明
shop_mobile_uni
Commits
14f4ecf0
Commit
14f4ecf0
authored
May 12, 2020
by
郑秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug 修改
parent
bc960610
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
16 deletions
+78
-16
host.js
common/host.js
+48
-2
navigation.vue
pages/home/components/navigation.vue
+15
-6
slide.vue
pages/home/components/slide.vue
+10
-3
home.vue
pages/home/home.vue
+5
-5
No files found.
common/host.js
View file @
14f4ecf0
...
...
@@ -5,7 +5,7 @@
// export const php = 'https://jingxiang.pet-dbc.cn/mobile/index.php?'
// php正式环境
export
const
php
=
'https://shop.pet-dbc.cn/mobile/index.php?'
//
export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// go测试环境
// export const go = 'https://tm.pet-dbc.cn'
...
...
@@ -14,4 +14,50 @@ export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// export const go = 'https://jxm.pet-dbc.cn'
// go正式环境
export
const
go
=
'https://m.pet-dbc.cn'
;
\ No newline at end of file
// export const go = 'https://m.pet-dbc.cn';
// 获取php正式环境
export
const
php
=
phpfunc
();
// 获取跳转白条地址
export
const
go
=
gofunc
();
/**
* 根据当前域名返回ecmall地址
* */
function
phpfunc
(){
const
{
origin
}
=
window
.
location
;
let
url
=
''
;
// 测试环境
if
(
origin
.
indexOf
(
'localhost'
)
>
-
1
||
origin
.
indexOf
(
'test'
)
>
-
1
){
if
(
origin
.
indexOf
(
'test'
)
>
-
1
){
url
=
`
${
origin
}
/mobile/index.php?`
;
}
else
{
url
=
'https://test.pet-dbc.cn/mobile/index.php?'
;
}
}
else
if
(
origin
.
indexOf
(
'jingxiang'
)
>
-
1
){
url
=
'https://jingxiang.pet-dbc.cn/mobile/index.php?'
;
}
else
{
url
=
'https://shop.pet-dbc.cn/mobile/index.php?'
;
}
return
url
;
}
/**
* 根据当前域名返回白条地址
* */
function
gofunc
(){
const
{
origin
}
=
window
.
location
;
let
url
=
''
;
// 测试环境
if
(
origin
.
indexOf
(
'localhost'
)
>
-
1
||
origin
.
indexOf
(
'test'
)
>
-
1
){
url
=
'https://tm.pet-dbc.cn'
;
}
else
if
(
origin
.
indexOf
(
'jingxiang'
)
>
-
1
){
url
=
'https://jxm.pet-dbc.cn'
;
}
else
{
url
=
'https://m.pet-dbc.cn'
;
}
return
url
;
}
pages/home/components/navigation.vue
View file @
14f4ecf0
<
template
>
<view
class=
"navigation"
:style=
"[
{'height': style_setting.height*2+'rpx', 'height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : null, {'background-color': style_setting.bg_color}]">
<view>
<text
class=
"navigation_item"
v-for=
"(item, key) in list"
:key=
"key"
v-if=
"
item.goods_type ? item.goods_type === goods_type : true
"
>
<text
class=
"navigation_item"
v-for=
"(item, key) in list"
:key=
"key"
v-if=
"
!item.goods_type || (item.goods_type > 0 && goods_type > 0)
"
>
<text
class=
"navigation_text"
:style=
"[
{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']" @click="$jump(item.link)">
<i
v-if=
"item.title_icon_show"
class=
"navigation_icon"
:style=
"
{'background-image': 'url('+item.title_icon_url+')'}">
</i>
<text
v-if=
"item.title_show"
>
{{
item
.
title
}}
</text>
...
...
@@ -22,13 +22,22 @@
return
{
style_setting
:
this
.
wrapper_props
.
style_setting
,
list
:
this
.
wrapper_props
.
list
,
goods_type
:
'
'
goods_type
:
'
-1'
//默认不可见
}
},
mounted
()
{
const
goods_type
=
getCurrentPages
()[
0
][
'$route'
][
'query'
][
'goods_type'
]
||
''
;
const
goods_type
=
getCurrentPages
()[
0
][
'$route'
][
'query'
][
'goods_type'
]
||
'-1'
;
const
gt
=
uni
.
getStorageSync
(
'goods_type'
);
// 判断goods_type是否有值
if
(
goods_type
===
'-1'
&&
gt
){
this
.
goods_type
=
gt
;
}
else
{
this
.
goods_type
=
goods_type
;
}
if
(
this
.
goods_type
){
uni
.
setStorageSync
(
'goods_type'
,
this
.
goods_type
);
}
}
}
</
script
>
...
...
@@ -37,12 +46,12 @@
display: flex;
align-items: center;
white-space: nowrap;
overflow
: scroll
;
overflow
-x: auto
;
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 24rpx;
box-sizing: border-box;
border-right: 10rpx solid rgba(0,0,0,0.4);
//
border-right: 10rpx solid rgba(0,0,0,0.4);
.navigation_item {
width: 177.5rpx;
display: inline-block;
...
...
pages/home/components/slide.vue
View file @
14f4ecf0
...
...
@@ -30,11 +30,19 @@
}
},
mounted
()
{
const
goods_type
=
getCurrentPages
()[
0
][
'$route'
][
'query'
][
'goods_type'
]
||
'
'
;
let
goods_type
=
getCurrentPages
()[
0
][
'$route'
][
'query'
][
'goods_type'
]
||
'-1
'
;
const
{
infinite
}
=
this
.
slide_setting
;
const
list
=
[];
const
gt
=
uni
.
getStorageSync
(
'goods_type'
);
// 判断goods_type是否有值
if
(
goods_type
===
'-1'
&&
gt
){
goods_type
=
gt
;
}
if
(
goods_type
){
uni
.
setStorageSync
(
'goods_type'
,
goods_type
);
}
this
.
slide_list
.
map
((
item
,
index
)
=>
{
if
((
item
.
goods_type
&&
item
.
goods_type
===
goods_type
)
||
!
item
.
goods_type
)
{
if
((
item
.
goods_type
>
0
&&
goods_type
>
0
)
||
!
item
.
goods_type
)
{
list
.
push
(
item
)
}
});
...
...
@@ -45,7 +53,6 @@
this
.
autoplay
=
false
;
},
time
);
}
},
methods
:
{
change
(
e
)
{
...
...
pages/home/home.vue
View file @
14f4ecf0
...
...
@@ -11,7 +11,7 @@
:avatarShape=
'skeleton1.avatarShape'
:titleWidth=
'skeleton1.titleWidth'
>
<view
class=
"homeContent"
>
<view
class=
"homeContent"
style=
"padding: 100rpx 0 110rpx;background-color: #f8f8f8;"
>
<component
v-for=
"(item, index) in data"
:key=
"index"
:is=
"item.name"
:wrapper_props=
"item.wrapper_props"
:isLogin=
"isLogin"
:ref=
"item.name"
></component>
<BottomBar
/>
<uni-popup
ref=
"popup"
type=
"center"
:maskClick=
"false"
>
...
...
@@ -95,10 +95,10 @@
this
.
loading
=
false
;
// 打开广告弹窗
const
timestamp
=
new
Date
(
'2020/05/18 00:00:00'
).
getTime
()
/
1000
;
console
.
log
(
timestamp
);
//
console.log(timestamp);
if
(
res
.
data
.
login_flg
===
1
&&
res
.
data
.
reg_time
>
timestamp
){
setTimeout
(()
=>
{
this
.
$refs
.
popup
.
open
();
//
this.$refs.popup.open();
},
600
);
}
}
else
{
...
...
@@ -137,8 +137,8 @@
}
</
script
>
<
style
lang=
"less"
scoped
>
.homeContent
{
<
style
>
.homeContent
{
padding
:
100
rpx
0
110
rpx
;
background-color
:
#f8f8f8
;
}
...
...
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