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
85085964
authored
May 24, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
全局变量
parent
83306b5e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
231 additions
and
240 deletions
components/drag-button-follow/drag-button-follow.vue
pages/index/index.vue
pages/mine/shoporder.vue
pages/mine/user.vue
components/drag-button-follow/drag-button-follow.vue
View file @
85085964
...
...
@@ -34,7 +34,6 @@ export default {
type
:
String
,
default
:
''
},
follow
:
{
type
:
String
|
Boolean
,
default
:
'all'
...
...
@@ -57,9 +56,7 @@ export default {
foll
:
{}
};
},
onShow
()
{},
mounted
()
{
this
.
url
=
this
.
$globalData
.
kefu
;
const
systemInfo
=
uni
.
getSystemInfoSync
()
||
{};
this
.
$options
.
safeArea
=
{
left
:
0
,
...
...
pages/index/index.vue
View file @
85085964
<
template
>
<view
class=
"page indexPage"
>
<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=
"search-topb row bothSide "
>
<image
src=
"../../static/logosmall.png"
></image>
<navigator
class=
"searchinput row"
url=
"/search"
>
<text
class=
"icon iconfont icon-search seartext"
></text>
<input
/>
</navigator>
<navigator
class=
"newsbox"
url=
"/user/msg"
>
<text
class=
"icon iconfont icon-news"
></text>
<text
class=
"counts"
>
{{
newscount
}}
</text>
</navigator>
<view
class=
"cdbox"
>
<text
class=
"icon iconfont icon-candan"
></text>
<text
class=
"sj"
></text>
<view
class=
"cdcons"
>
<a
:href=
"item.url"
v-for=
"(item, index) in pbobj.h5_home_hide_menu"
:key=
"index"
>
{{
item
.
title
}}
</a>
</view>
</view>
</view>
<view
class=
"tipsad row avarage"
>
<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>
{{
item
.
title
}}
</text>
</view>
</view>
<view
class=
"bannerbox"
>
<swiper
class=
"swiper"
circular
:indicator-dots=
"autoplay"
indicator-color=
"#fff"
:autoplay=
"autoplay"
>
<swiper-item
v-for=
"(item, index) in obj.rollbanner"
:key=
"index"
>
<a
:href=
"item.url"
><image
:src=
"item.images"
></image></a>
</swiper-item>
</swiper>
</view>
</view>
<view
class=
"ggbox row verCenter"
>
<text
class=
"icon iconfont icon-tz"
></text>
<view
class=
"ggcons"
>
<view
class=
"ggsec"
ref=
"boxcpr"
>
<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>
</a>
</view>
</view>
</view>
<view
class=
"szbox row avarage"
>
<a
:href=
"item.url"
v-for=
"(item, index) in obj.h5_home_function_nav"
:key=
"index"
>
<image
:src=
"item.images"
></image>
<view
class=
"sitips"
>
{{
item
.
title
||
'默认文案'
}}
</view>
</a>
</view>
<view
class=
"brandbox"
>
<view
class=
"brand-tab row bothSide"
>
<view
:class=
"
{ act: brandact == 1 }" class="tabitem" @click="tabchange(1)">
<text>
原厂
</text>
<text
class=
"hztext"
>
直供
</text>
<view
class=
"hztips"
>
原厂战略合作 官方技术支持
</view>
</view>
<view
class=
"tabitem hwxhitem"
@
click=
"tabchange(2)"
>
<text>
海外
</text>
<text
class=
"hztext"
>
现货
</text>
<view
class=
"hztips"
>
海外千万元物料 一站式现货采购
</view>
</view>
</view>
<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"
><image
:src=
"item.images"
></image></a>
</view>
<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"
><image
:src=
"item.images"
></image></a>
</view>
</view>
<view
class=
"goods-box"
>
<view
class=
"titg"
>
精选物料
</view>
<scroll-view
class=
"goods-con"
scroll-x=
"true"
>
<navigator
:url=
"'/item?goods_id=' + item.goods_id"
class=
"goods-item"
v-for=
"(item, index) in obj.h5_home_choice_goods"
:key=
"index"
>
<image
:src=
"item.goods_images"
></image>
<view
class=
"xhg elep"
>
{{
item
.
goods_name
}}
</view>
<view
class=
"ppg elep"
>
品牌:
<text>
{{
item
.
brand_name
}}
</text>
</view>
<view
class=
"jgg elep"
>
价格:
<text>
{{
item
.
price
}}
</text>
</view>
</navigator>
</scroll-view>
</view>
<view
class=
"fwbox"
>
<view
class=
"fwinfo"
>
<view
class=
"tiiw"
>
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/57ea7022c4120d275183e00bdf86e97e.png"
></image>
猎芯网的服务保障
</view>
<view
class=
"finfocon"
>
每一颗电了物料都将通过猎芯网严格的质量检测,我们将有效把控供应链源头质量,为客户稳定生产保驾护航。成为值得信赖的电子供应链技术与服务提供商。
</view>
<view
class=
"rzbox row bothSide"
>
<view
class=
"rzitem"
v-for=
"(item, index) in obj.h5_home_qualifications"
:key=
"index"
v-if=
"index
<
3
"
>
<image
:src=
"item.images"
></image>
<text>
{{
item
.
title
}}
</text>
</view>
</view>
</view>
<view
v-for=
"(item, index) in obj.h5_home_slogan"
:key=
"index"
>
<view
class=
"videobox"
>
<view
class=
"tiib"
>
{{
item
.
title
}}
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/870dc360521d97062018c93afb40130e.png"
></image>
</view>
</view>
<view
class=
"videoval"
><video
object-fit=
"fill"
:src=
"item.images"
></video></view>
</view>
</view>
<view
class=
"newsbox"
>
<view
class=
"news-tab row"
>
<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>
</view>
<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"
>
<view
class=
"row bothSide"
>
<view
class=
"ncleft"
>
<view
class=
"titnew elep2"
>
{{
item1
.
title
}}
</view>
<view
class=
"tittips elep2"
>
{{
item1
.
description
}}
</view>
</view>
<image
:src=
"item1.litpic"
></image>
</view>
<view
class=
"newitembottom row bothSide"
>
<view
class=
"tagbox row"
>
<view
class=
"tagitem"
v-for=
"(item2, index2) in item1.tag"
:key=
"index2"
>
{{
item2
.
tag
}}
</view>
</view>
<view
class=
"newtime"
>
{{
item1
.
publish_time
}}
</view>
</view>
</a>
</view>
<view
class=
"newsbot"
>
<navigator
url=
"/news"
>
浏览更多资讯
<text
class=
"icon iconfont icon-jt"
></text>
</navigator>
</view>
</view>
<view
class=
"pagebot"
>
—— 已经到底了 ——
</view>
<view
class=
"page indexPage"
>
<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=
"search-topb row bothSide "
>
<image
src=
"../../static/logosmall.png"
></image>
<navigator
class=
"searchinput row"
url=
"/search"
>
<text
class=
"icon iconfont icon-search seartext"
></text>
<input
/>
</navigator>
<navigator
class=
"newsbox"
url=
"/user/msg"
>
<text
class=
"icon iconfont icon-news"
></text>
<text
class=
"counts"
>
{{
newscount
}}
</text>
</navigator>
<view
class=
"cdbox"
>
<text
class=
"icon iconfont icon-candan"
></text>
<text
class=
"sj"
></text>
<view
class=
"cdcons"
>
<a
:href=
"item.url"
v-for=
"(item,index) in pbobj.h5_home_hide_menu"
:key=
"index"
>
{{
item
.
title
}}
</a>
</view>
</view>
</view>
<view
class=
"tipsad row avarage"
>
<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>
{{
item
.
title
}}
</text>
</view>
</view>
<view
class=
"bannerbox"
>
<swiper
class=
"swiper"
circular
:indicator-dots=
"autoplay"
indicator-color=
"#fff"
:autoplay=
"autoplay"
>
<swiper-item
v-for=
"(item, index) in obj.rollbanner"
:key=
"index"
>
<a
:href=
"item.url"
>
<image
:src=
"item.images"
></image>
</a>
</swiper-item>
</swiper>
</view>
</view>
<view
class=
"ggbox row verCenter"
>
<text
class=
"icon iconfont icon-tz"
></text>
<view
class=
"ggcons"
>
<view
class=
"ggsec"
ref=
"boxcpr"
>
<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>
</a>
</view>
</view>
</view>
<view
class=
"szbox row avarage"
>
<a
:href=
"item.url"
v-for=
"(item,index) in obj.h5_home_function_nav"
:key=
"index"
>
<image
:src=
"item.images"
></image>
<view
class=
"sitips"
>
{{
item
.
title
||
"默认文案"
}}
</view>
</a>
</view>
<view
class=
"brandbox"
>
<view
class=
"brand-tab row bothSide"
>
<view
:class=
'
{"act":brandact==1}' class="tabitem" @click="tabchange(1)">
<text>
原厂
</text><text
class=
"hztext"
>
直供
</text>
<view
class=
"hztips"
>
原厂战略合作 官方技术支持
</view>
</view>
<view
class=
"tabitem hwxhitem"
@
click=
"tabchange(2)"
>
<text>
海外
</text><text
class=
"hztext"
>
现货
</text>
<view
class=
"hztips"
>
海外千万元物料 一站式现货采购
</view>
</view>
</view>
<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"
>
<image
:src=
"item.images"
></image>
</a>
</view>
<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"
>
<image
:src=
"item.images"
></image>
</a>
</view>
</view>
<view
class=
"goods-box"
>
<view
class=
"titg"
>
精选物料
</view>
<scroll-view
class=
"goods-con"
scroll-x=
"true"
>
<navigator
:url=
"'/item?goods_id='+item.goods_id"
class=
"goods-item"
v-for=
"(item,index) in obj.h5_home_choice_goods"
:key=
"index"
>
<image
:src=
"item.goods_images"
></image>
<view
class=
"xhg elep"
>
{{
item
.
goods_name
}}
</view>
<view
class=
"ppg elep"
>
品牌:
<text>
{{
item
.
brand_name
}}
</text></view>
<view
class=
"jgg elep"
>
价格:
<text>
{{
item
.
price
}}
</text></view>
</navigator>
</scroll-view>
</view>
<view
class=
"fwbox"
>
<view
class=
"fwinfo"
>
<view
class=
"tiiw"
>
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/57ea7022c4120d275183e00bdf86e97e.png"
>
</image>
猎芯网的服务保障
</view>
<view
class=
"finfocon"
>
每一颗电了物料都将通过猎芯网严格的质量检测,我们将有效把控供应链源头质量,为客户稳定生产保驾护航。成为值得信赖的电子供应链技术与服务提供商。
</view>
<view
class=
"rzbox row bothSide"
>
<view
class=
"rzitem"
v-for=
"(item,index) in obj.h5_home_qualifications"
:key=
"index"
v-if=
"index
<3
"
>
<image
:src=
"item.images"
></image>
<text>
{{
item
.
title
}}
</text>
</view>
</view>
</view>
<view
v-for=
"(item,index) in obj.h5_home_slogan"
:key=
"index"
>
<view
class=
"videobox"
>
<view
class=
"tiib"
>
{{
item
.
title
}}
<image
src=
"https://img.ichunt.com/images/ichunt/202304/05/870dc360521d97062018c93afb40130e.png"
>
</image>
</view>
</view>
<view
class=
"videoval"
>
<video
object-fit=
"fill"
:src=
"item.images"
></video>
</view>
</view>
</view>
<view
class=
"newsbox"
>
<view
class=
"news-tab row"
>
<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>
</view>
<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"
>
<view
class=
"row bothSide"
>
<view
class=
"ncleft"
>
<view
class=
"titnew elep2"
>
{{
item1
.
title
}}
</view>
<view
class=
"tittips elep2"
>
{{
item1
.
description
}}
</view>
</view>
<image
:src=
"item1.litpic"
></image>
</view>
<view
class=
"newitembottom row bothSide"
>
<view
class=
"tagbox row"
>
<view
class=
"tagitem"
v-for=
"(item2,index2) in item1.tag"
:key=
"index2"
>
{{
item2
.
tag
}}
</view>
</view>
<view
class=
"newtime"
>
{{
item1
.
publish_time
}}
</view>
</view>
</a>
</view>
<view
class=
"newsbot"
>
<navigator
url=
"/news"
>
浏览更多资讯
<text
class=
"icon iconfont icon-jt"
></text></navigator>
</view>
</view>
<view
class=
"pagebot"
>
—— 已经到底了 ——
</view>
<bottomNavFixed
actval=
"1"
/>
</view>
<bottomNavFixed
actval=
"1"
/>
</view>
</
template
>
<
script
>
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
bottomNavFixed
from
'@/components/bottom_nav.vue'
;
export
default
{
data
()
{
return
{
newscount
:
0
,
kfurl
:
""
,
autoplay
:
true
,
scrollTop
:
0
,
pbobj
:{},
obj
:
{},
brandact
:
1
,
newsindex
:
0
,
translateY
:
0
,
intervalHandler
:
null
};
},
onShow
()
{
this
.
getData
();
},
onPageScroll
(
e
)
{
this
.
scrollTop
=
e
.
scrollTop
;
},
destroyed
()
{
// 在组件销毁之前,清除 setInterval
clearInterval
(
this
.
intervalHandler
)
},
methods
:
{
moveUp
()
{
const
moveDistance
=
16
;
let
height_
=
this
.
obj
.
h5_home_notice
.
length
*
16
;
this
.
translateY
=
this
.
translateY
-
moveDistance
;
if
(
Math
.
abs
(
this
.
translateY
)
>=
height_
){
this
.
translateY
=
0
}
this
.
$refs
.
boxcpr
.
$el
.
style
.
transform
=
`translateY(
${
this
.
translateY
}
px)`
},
newtab
(
index
)
{
this
.
newsindex
=
index
},
clickbug
(
e
)
{
return
false
},
tabchange
(
guid
)
{
this
.
brandact
=
guid
;
},
allowChange
()
{
},
getData
()
{
this
.
request
(
Ichunt_Api
+
"/api/index/index"
,
'GET'
,
{},
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
obj
=
res
.
data
;
clearInterval
(
this
.
intervalHandler
)
if
(
this
.
obj
.
h5_home_notice
.
length
<=
1
){
return
}
this
.
intervalHandler
=
setInterval
(()
=>
{
this
.
moveUp
()
},
10000
)
}
});
this
.
request
(
Ichunt_Api
+
"/api/common/data"
,
'GET'
,
{},
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
pbobj
=
res
.
data
;
this
.
kfurl
=
this
.
pbobj
.
kfqq_xk
.
data
}
});
this
.
request
(
Api_Url
+
"/msg/allnum"
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
newscount
=
res
.
data
}
});
}
},
components
:
{
bottomNavFixed
import
{
Ichunt_Api
,
Api_Url
}
from
'@/util/api.js'
;
import
bottomNavFixed
from
'@/components/bottom_nav.vue'
;
export
default
{
data
()
{
return
{
newscount
:
0
,
kfurl
:
''
,
autoplay
:
true
,
scrollTop
:
0
,
pbobj
:
{},
obj
:
{},
brandact
:
1
,
newsindex
:
0
,
translateY
:
0
,
intervalHandler
:
null
};
},
}
};
onShow
()
{
this
.
getData
();
},
onPageScroll
(
e
)
{
this
.
scrollTop
=
e
.
scrollTop
;
},
destroyed
()
{
// 在组件销毁之前,清除 setInterval
clearInterval
(
this
.
intervalHandler
);
},
methods
:
{
moveUp
()
{
const
moveDistance
=
16
;
let
height_
=
this
.
obj
.
h5_home_notice
.
length
*
16
;
this
.
translateY
=
this
.
translateY
-
moveDistance
;
if
(
Math
.
abs
(
this
.
translateY
)
>=
height_
)
{
this
.
translateY
=
0
;
}
this
.
$refs
.
boxcpr
.
$el
.
style
.
transform
=
`translateY(
${
this
.
translateY
}
px)`
;
},
newtab
(
index
)
{
this
.
newsindex
=
index
;
},
clickbug
(
e
)
{
return
false
;
},
tabchange
(
guid
)
{
this
.
brandact
=
guid
;
},
allowChange
()
{},
getData
()
{
this
.
request
(
Ichunt_Api
+
'/api/index/index'
,
'GET'
,
{}).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
obj
=
res
.
data
;
clearInterval
(
this
.
intervalHandler
);
if
(
this
.
obj
.
h5_home_notice
.
length
<=
1
)
{
return
;
}
this
.
intervalHandler
=
setInterval
(()
=>
{
this
.
moveUp
();
},
10000
);
}
});
this
.
request
(
Ichunt_Api
+
'/api/common/data'
,
'GET'
,
{}).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
pbobj
=
res
.
data
;
this
.
kfurl
=
this
.
pbobj
.
kfqq_xk
.
data
;
}
});
this
.
request
(
Api_Url
+
'/msg/allnum'
,
'POST'
,
{},
false
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
newscount
=
res
.
data
;
}
});
}
},
components
:
{
bottomNavFixed
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'../../assets/css/index/index.scss'
;
</
style
>
\ No newline at end of file
@import
'../../assets/css/index/index.scss'
;
</
style
>
pages/mine/shoporder.vue
View file @
85085964
<
template
>
<view
class=
"page-userOrder"
>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
></drag-button-follow>
<drag-button-follow
follow=
"left,right"
className=
"drag-button"
class=
"drag-button"
:url=
"kfqq_xk"
></drag-button-follow>
<view
class=
"top"
>
<view
class=
"head row bothSide verCenter"
>
<view
class=
"left row verCenter"
>
...
...
@@ -153,6 +153,7 @@ export default {
format
:
true
});
return
{
kfqq_xk
:
''
,
time
:
currentDate
,
arr
:
[
'全部'
,
'待付款'
,
'待收货'
,
'已完结订单'
],
curr
:
0
,
...
...
@@ -171,6 +172,9 @@ export default {
}
};
},
onLoad
()
{
this
.
kfqq_xk
=
this
.
$globalData
&&
this
.
$globalData
.
kefu
;
},
onShow
()
{
this
.
getData
();
},
...
...
pages/mine/user.vue
View file @
85085964
...
...
@@ -127,7 +127,7 @@ export default {
},
onShow
()
{
this
.
getData
();
this
.
kfqq_xk
=
this
.
$globalData
.
kefu
;
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