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
1e11bdaf
Commit
1e11bdaf
authored
Mar 11, 2020
by
郑秀明
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
7b0c1f14
' into develop
parents
88fd3fb9
7b0c1f14
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
189 additions
and
885 deletions
+189
-885
App.vue
App.vue
+5
-1
manifest.json
manifest.json
+1
-1
package-lock.json
package-lock.json
+164
-164
Category.vue
pages/category/Category.vue
+0
-361
category.vue
pages/category/category.vue
+4
-0
Detail.vue
pages/detail/Detail.vue
+0
-350
detail.vue
pages/detail/detail.vue
+4
-0
goodslist.vue
pages/home/components/goodslist.vue
+4
-2
hotrecommd.vue
pages/home/components/hotrecommd.vue
+2
-2
searchbar.vue
pages/home/components/searchbar.vue
+0
-3
index.vue
pages/index/index.vue
+5
-1
No files found.
App.vue
View file @
1e11bdaf
...
...
@@ -14,5 +14,9 @@
</
script
>
<
style
>
@import
'./static/iconfont.css'
;
@import
'./static/iconfont.css'
;
.uni-input-input
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
manifest.json
View file @
1e11bdaf
...
...
@@ -62,7 +62,7 @@
"disableHostCheck"
:
true
,
"proxy"
:
{
"/uni/api"
:
{
"target"
:
"http://
39.96.85.45:9093
/"
,
"target"
:
"http://
192.168.50.133:6564
/"
,
"changeOrigin"
:
true
,
"secure"
:
false
,
"pathRewrite"
:
{
...
...
package-lock.json
View file @
1e11bdaf
This diff is collapsed.
Click to expand it.
pages/category/Category.vue
deleted
100644 → 0
View file @
88fd3fb9
This diff is collapsed.
Click to expand it.
pages/category/category.vue
View file @
1e11bdaf
...
...
@@ -62,6 +62,9 @@
}
},
onLoad
(
option
)
{
uni
.
showLoading
({
title
:
'加载中'
});
this
.
firsr_cate_id
=
option
.
cate_id_1
;
option
.
current
=
Number
(
option
.
current
);
option
.
page_size
=
Number
(
option
.
page_size
);
...
...
@@ -108,6 +111,7 @@
this
.
page
=
page
;
this
.
isLogin
=
res
.
data
.
login_flg
;
this
.
is_city
=
res
.
data
.
city_flg
;
uni
.
hideLoading
();
}
});
},
...
...
pages/detail/Detail.vue
deleted
100644 → 0
View file @
88fd3fb9
<
template
>
<view>
<view
v-if=
"isLogin && !is_city"
>
<Fail
/>
</view>
<view
v-else
>
<view
class=
"search_box"
>
<uni-icons
type=
"back"
size=
"30"
:style=
"
{'position':'relative','top': '-2px'}" @click.native="goBack()">
</uni-icons>
<i
@
click=
"search"
></i>
<input
type=
"text"
placeholder=
"我是要找的商品名"
v-model=
"keyword"
@
confirm=
"search"
>
<view
class=
"category_list"
>
<text
:class=
"
{act: tabIndex === -1}" @click="changeTabs(-1, firsr_cate_id)">全部
</text>
<text
v-for=
"(item, index) in cate_list"
:key=
"index"
:class=
"
{act: tabIndex === index}" @click="changeTabs(index, item.cate_id)">
{{
item
.
cate_name
}}
</text>
</view>
</view>
<view
class=
"goods_box"
v-if=
"goods_list instanceof Array"
>
<view
class=
"goods_item"
v-for=
"(item, index) in goods_list"
:key=
"index"
>
<image
:src=
"item.default_image || $noGoodsImg"
@
click=
"$jumpPhpPage(item.goods_id)"
></image>
<view
class=
"goods_item_info"
>
<p>
{{
item
.
goods_name
}}
</p>
<p>
{{
item
.
goods_subname
}}
</p>
<view
class=
"goods_tag"
>
<text>
限时免息
</text>
<!--
<text>
9个月账期
</text>
-->
</view>
<p
class=
"price"
>
<text>
{{
isLogin
?
'¥'
:
''
}}
</text>
{{
isLogin
?
item
.
price
:
'登录显示价格'
}}
</p>
</view>
<i
class=
"cart_icon"
@
click=
"addCart(item.spec_id, 1)"
></i>
</view>
<view
class=
"pageBox"
>
<uni-pagination
ref=
"pagination"
:total=
"page['total']"
current=
"1"
show-icon=
"true"
@
change=
"changePage"
></uni-pagination>
</view>
</view>
<view
class=
"nodata"
v-else
>
暂无此类商品
</view>
<BottomBar
/>
</view>
</view>
</
template
>
<
script
>
import
uniIcons
from
"@/components/uni-icons/uni-icons.vue"
;
import
uniPagination
from
'@/components/uni-pagination/uni-pagination.vue'
;
import
BottomBar
from
"@/components/BottomBar/BottomBar.vue"
;
import
Fail
from
'../fail.vue'
;
import
{
php
,
go
}
from
'../../common/host.js'
;
export
default
{
data
()
{
return
{
goods_list
:
[],
page
:
{
total
:
0
,
current
:
1
},
cate_list
:
[],
firsr_cate_id
:
''
,
cate_id_1
:
''
,
tabIndex
:
-
1
,
keyword
:
''
,
isLogin
:
0
,
is_city
:
0
}
},
onLoad
(
option
)
{
this
.
getData
({
current
:
1
,
page_size
:
10
});
// #ifdef H5
//默认请求微信分享
if
(
this
.
$wechat
&&
this
.
$wechat
.
isWechat
())
{
this
.
$wechat
.
share
({
titie
:
this
.
$getNavigationBarTitle
()});
}
// #endif
},
onPullDownRefresh
()
{
if
(
this
.
keyword
)
{
this
.
search
(
this
.
keyword
,
uni
.
stopPullDownRefresh
);
return
}
else
if
(
this
.
cate_id_1
)
{
this
.
changeTabs
(
this
.
tabIndex
,
this
.
cate_id_1
,
uni
.
stopPullDownRefresh
);
}
else
{
this
.
changeTabs
(
this
.
tabIndex
,
this
.
firsr_cate_id
,
uni
.
stopPullDownRefresh
);
}
},
components
:
{
uniIcons
,
uniPagination
,
BottomBar
,
Fail
},
methods
:
{
goBack
()
{
history
.
back
()
},
getData
(
params
)
{
uni
.
request
({
url
:
'/uni/api/credit_goods/get_credit_all_goods'
,
method
:
'POST'
,
data
:
params
,
dataType
:
'json'
,
success
:
(
res
)
=>
{
const
{
credit_cates_list
,
credit_goods_list
}
=
res
.
data
.
data
,
{
page
}
=
res
.
data
;
this
.
goods_list
=
credit_goods_list
;
this
.
cate_list
=
credit_cates_list
;
this
.
page
=
page
;
this
.
isLogin
=
res
.
data
.
login_flg
;
this
.
is_city
=
res
.
data
.
city_flg
;
}
});
},
changeTabs
(
index
,
cate_id
,
cb
)
{
if
(
index
!=
-
1
)
{
var
params
=
{
cate_id_1
:
cate_id
+
''
};
this
.
cate_id_1
=
cate_id
+
''
;
}
else
{
var
params
=
{}
this
.
cate_id_1
=
''
;
}
this
.
tabIndex
=
index
;
uni
.
request
({
url
:
'/uni/api/credit_goods/get_credit_all_goods'
,
method
:
'POST'
,
data
:
{
...
params
,
goods_name
:
this
.
keyword
,
current
:
1
,
page_size
:
10
},
dataType
:
'json'
,
success
:
(
res
)
=>
{
const
{
credit_goods_list
}
=
res
.
data
.
data
,
{
page
}
=
res
.
data
;
this
.
goods_list
=
credit_goods_list
;
this
.
page
=
page
;
if
(
credit_goods_list
instanceof
Array
)
{
setTimeout
(()
=>
{
this
.
$refs
.
pagination
.
parentsChangeCurrent
(
1
);
},
0
);
}
!!
cb
&&
cb
();
}
});
},
changePage
(
data
)
{
const
{
current
}
=
data
;
uni
.
request
({
url
:
'/uni/api/credit_goods/get_credit_all_goods'
,
method
:
'POST'
,
data
:
{
cate_id_1
:
this
.
cate_id_1
,
goods_name
:
this
.
keywords
,
current
:
current
,
page_size
:
10
},
dataType
:
'json'
,
success
:
(
res
)
=>
{
const
{
credit_goods_list
}
=
res
.
data
.
data
;
this
.
goods_list
=
credit_goods_list
;
}
});
},
search
(
keyword
,
cb
)
{
uni
.
request
({
url
:
'/uni/api/credit_goods/get_credit_all_goods'
,
method
:
'POST'
,
data
:
{
goods_name
:
this
.
keyword
,
current
:
1
,
page_size
:
10
},
dataType
:
'json'
,
success
:
(
res
)
=>
{
const
{
credit_goods_list
}
=
res
.
data
.
data
,
{
page
}
=
res
.
data
;
this
.
goods_list
=
credit_goods_list
;
this
.
page
=
page
;
!!
cb
&&
cb
();
this
.
tabIndex
=
-
1
;
if
(
credit_goods_list
instanceof
Array
)
{
setTimeout
(()
=>
{
this
.
$refs
.
pagination
.
parentsChangeCurrent
(
1
);
},
0
);
}
}
});
},
addCart
(
spec_id
,
quantity
)
{
this
.
$addCart
(
spec_id
,
quantity
,
this
.
isLogin
);
},
jumpPhpPage
(
url
)
{
let
link
=
url
?
`
${
php
}${
url
}
`
:
php
;
window
.
location
.
href
=
link
;
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.search_box {
background: url(../../static/category/2641581405726_.pic.png) no-repeat;
background-position: 100% 100%;
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 10;
i {
display: inline-block;
width: 60rpx;
height: 60rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAMAAACfWMssAAAAulBMVEUhISEiIiIjIyMsLCwtLS0vLy86OjpAQEBISEhMTExPT09SUlJaWlppaWl0dHR4eHh5eXmOjo6Tk5OYmJienp7AwMDJycnNxGbNxWjOxWjOxWrPxmvPxm7Qx3DQyHPRyXTRynbV1dXW1tbX0IrX0YvY0YvY0ozb1Zbb1pjc3Nzl5eXm4rvm4rzo6Ojp5cTp5sXq6urr6Mzr6M3s7Ozt6tLt69Xu69bv7+/w7tzx8fH19O/19e/39/X4+Phd4ycQAAABNklEQVRIx+3XyVKDQBCA4R8JEBJZBWTcIrjvUdS4zfu/lodErYhVA11lTukbFB80MNM9w/ZXHN1/6B7Bgh0/6X4xh5NbrSXw7E1L4M6V1hK496hF8OBFy6DQafQarhAWWZpmRV9YxQ4AOHHVAzahxXdYYdMV1h6AGyVJ5AJ4dTdYD4BgkWEVAIO6C2w8sPOf49wGr+kAQ7CXnlDbEJphZUG+fCoHqzLCGILf1wQQG6EDrbtX4JhgAW77fVwoDDCDqA0jyAwwhaQNE0j/C4pTFX8c8e+QDwDxkBMP8j+nlXUpm8gwnklKB8CoERSriyHgTwXlceoDwxtBQW5GgC9pAbMxbIh6x+umtbXujyuA4gXSRLokU/vCRaBSu9ciWJZlef4uhOXhnSRVpZRSp89CqNTJQ6/twycM+aPLaun/FQAAAABJRU5ErkJggg==) no-repeat;
background-size: 100% 100%;
margin-left: 20rpx;
position: relative;
top: 8rpx;
}
input {
display: inline-block;
vertical-align: middle;
width: 590rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
margin: 14rpx 0 40rpx 0;
background: #F8F8F8;
border-radius: 0 30rpx 30rpx 0;
}
.category_list {
display: block;
white-space: nowrap;
overflow: scroll;
width: 94.6%;
margin-left: 2.7%;
padding-bottom: 8rpx;
text {
font-size: 28rpx;
line-height: 40rpx;
margin-right: 68rpx;
}
text:last-child {
margin-right: 0;
}
text.act {
font-size: 32rpx;
line-height: 44rpx;
position: relative;
font-weight: 500;
}
text.act:after {
width: 52rpx;
height: 4rpx;
background: #212121;
position: absolute;
left: 50%;
bottom: -8rpx;
margin-left: -26rpx;
content: '';
}
}
.category_list::-webkit-scrollbar {
display: none;
}
}
.nodata {
text-align: center;
padding: 40rpx 0;
margin-top: 174rpx;
}
.goods_box {
padding-bottom: 118rpx;
margin-top: 174rpx;
.pageBox {
text-align: center;
}
.goods_item {
position: relative;
width: 100%;
box-sizing: border-box;
padding: 32rpx 88rpx 32rpx 20rpx;
background: #fff;
display: flex;
justify-content: space-between;
.cart_icon {
position: absolute;
right: 88rpx;
bottom: 32rpx;
width: 56rpx;
height: 56rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAAAAACN7WTCAAABfElEQVRIx2P4TyZgGNU4qnFUIxEafx87+eYvORqvVFRUbiTLxstTSktW/yHHj7/2FRa9ICtw/kzM2wa2/MTmzZs2gTAEbL3yi0Co7sye/A9IfcpGBVlZU/7i1/g4o/gryObzEJtgdm4uyliDX+PXgpQn2Ly0LaUNv8Z/PYl7sGlcnTiRQMpZETsXm8aJccsJaDwTXfULU9/3ouiDBDS+j4z5jKnxU3T4IwIaf+SFXMXUeCsk+jOh3NEfuBpT4+bAwl+ENK7x68bUOMOvl2B+vOmd8h1d7F+F9xKCGj/5e75DF/sc6X6MoMbfOS7oiv6/dnF5SbjomODYhV4O7HIM+ExY4z5b+1lr1gPBurVr16xZs3rVipnetpV/CWv8XmiFAbzuElPKfd4wpb8PCPr7+yeAwMRJK14Mt5L822ZQmJ6FhOOHTSDOub/EaFwVCwYfwJxFYHbcR2I03stJTk5OgqaC6xkgTjdRNv7//R0I/sEKaWTOaI08qnHoaQQAAyi97TBEkioAAAAASUVORK5CYII=) no-repeat;
background-size: 100% 100%;
}
image {
width: 240rpx;
height: 240rpx;
margin-right: 24rpx;
}
.goods_item_info {
width: 402rpx;
position: relative;
p:nth-of-type(1) {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 30rpx;
line-height: 42rpx;
margin-bottom: 10rpx;
}
p:nth-of-type(2) {
width: 100%;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
font-size: 22rpx;
color: #7C7C7C;
}
.goods_tag {
display: block;
text {
display: inline-block;
vertical-align: middle;
border: 1px solid #C7B64E;
color: #C7B64E;
height: 36rpx;
line-height: 36rpx;
padding: 0 12rpx;
border-radius: 18rpx;
font-size: 22rpx;
margin-right: 8rpx;
}
}
.price {
font-size: 40rpx;
line-height: 40rpx;
margin-top: 26rpx;
text {
font-size: 28rpx;
}
}
}
}
}
</
style
>
pages/detail/detail.vue
View file @
1e11bdaf
...
...
@@ -63,6 +63,9 @@
}
},
onLoad
(
option
)
{
uni
.
showLoading
({
title
:
'加载中'
});
this
.
getData
({
current
:
1
,
page_size
:
10
...
...
@@ -108,6 +111,7 @@
this
.
page
=
page
;
this
.
isLogin
=
res
.
data
.
login_flg
;
this
.
is_city
=
res
.
data
.
city_flg
;
uni
.
hideLoading
();
}
});
},
...
...
pages/home/components/goodslist.vue
View file @
1e11bdaf
...
...
@@ -79,10 +79,11 @@
if
(
goods_data_type
===
3
)
{
list
=
goods_list
;
}
else
if
(
goods_data_type
===
1
)
{
list
=
additional_goods_show
?
cate_goods_list
.
concat
(
goods_list
).
slice
(
0
,
goods_num
)
:
cate_goods_list
let
cgl
=
cate_goods_list
||
[];
list
=
additional_goods_show
?
cgl
.
concat
(
goods_list
||
[]).
slice
(
0
,
goods_num
)
:
cgl
}
else
{
let
bgl
=
buy_goods_list
||
[];
list
=
additional_goods_show
?
bgl
.
concat
(
goods_list
).
slice
(
0
,
goods_num
)
:
bgl
list
=
additional_goods_show
?
bgl
.
concat
(
goods_list
||
[]
).
slice
(
0
,
goods_num
)
:
bgl
}
const
space
=
listType
-
list
.
length
%
listType
;
if
(
space
!==
listType
)
{
...
...
@@ -113,6 +114,7 @@
}
.goods_content, .swiper_content {
border-radius: 0 0 16rpx 16rpx;
margin-bottom: 20rpx;
}
.goods_box, .goods_box2 {
display: flex;
...
...
pages/home/components/hotrecommd.vue
View file @
1e11bdaf
...
...
@@ -11,13 +11,13 @@
</view>
</view>
<view
class=
"hot_cate_list"
>
<text
class=
"hot_cate_item"
v-for=
"(item, key) in cate_list"
:key=
"key"
@
click=
"changeCate(key)"
:class=
"key === hotIndex ? 'act' : ''"
>
{{
item
.
cate_name
}}
</text>
<text
class=
"hot_cate_item"
v-for=
"(item, key) in cate_list"
:key=
"key"
@
click=
"changeCate(key)"
:class=
"key === hotIndex ? 'act' : ''"
v-if=
"item.goods_list instanceof Array"
>
{{
item
.
cate_name
}}
</text>
</view>
</view>
<view
v-for=
"(val, key) in cate_list"
:key=
"key"
v-if=
"key === hotIndex"
>
<view
v-if=
"val.goods_list"
class=
"flex_goods"
>
<view
class=
"hot_goods_item"
v-for=
"(item, index) in val.goods_list"
:key=
"index"
>
<image
class=
"hot_goods_icon"
:src=
"style_setting.angle_sign_url"
></image>
<image
class=
"hot_goods_icon"
v-if=
"style_setting.angle_sign"
:src=
"style_setting.angle_sign_url"
></image>
<image
class=
"hot_goods_img"
:src=
"item.default_image || $noGoodsImg"
@
click=
"$jumpGoodDetail(item.goods_id)"
></image>
<text
class=
"hot_goods_name"
v-if=
"style_setting.title_show"
>
{{
item
.
goods_name
}}
</text>
<text
class=
"hot_goods_subname"
v-if=
"style_setting.sub_title_show"
>
{{
item
.
goods_subname
||
' '
}}
</text>
...
...
pages/home/components/searchbar.vue
View file @
1e11bdaf
...
...
@@ -86,9 +86,6 @@
.search_input {
height: 60rpx;
font-size: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.login_btn {
width: 92rpx;
...
...
pages/index/index.vue
View file @
1e11bdaf
...
...
@@ -112,7 +112,10 @@
is_city
:
0
}
}
,
onLoad
()
{
onLoad
()
{
uni
.
showLoading
({
title
:
'加载中'
}
);
this
.
getData
();
// #ifdef H5
//默认请求微信分享
...
...
@@ -163,6 +166,7 @@
if
(
res
.
data
.
data
.
portrait
)
{
this
.
portrait
=
res
.
data
.
data
.
portrait
;
}
uni
.
hideLoading
();
}
}
)
}
,
...
...
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