Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-shop-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-shop-show-h5
Commits
684f35e4
提交
684f35e4
authored
6月 08, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复list重复两次请求bug
上级
262828af
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
35 行删除
+26
-35
BuyPopup.vue
src/pages/buy/components/BuyPopup.vue
+3
-1
index.vue
src/pages/buy/index.vue
+4
-1
index.vue
src/pages/home/index.vue
+15
-30
index.vue
src/pages/order/index.vue
+4
-3
没有找到文件。
src/pages/buy/components/BuyPopup.vue
浏览文件 @
684f35e4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<p
class=
"surplus"
>
剩余
{{
surplus
}}
</p>
<p
class=
"surplus"
>
剩余
{{
surplus
}}
</p>
</div>
</div>
</div>
</div>
<van-field
label=
"规格
"
class=
"tag-item"
>
<van-field
:label=
"spec_title
"
class=
"tag-item"
>
<template
#
input
>
<template
#
input
>
<tag-selection
v-model=
"spec"
:data=
"specList"
:options=
"
{ label: 'spec_values', value: 'sku_id'}" @currentSelected="handleTagSelected"/>
<tag-selection
v-model=
"spec"
:data=
"specList"
:options=
"
{ label: 'spec_values', value: 'sku_id'}" @currentSelected="handleTagSelected"/>
</
template
>
</
template
>
...
@@ -60,6 +60,7 @@ export default {
...
@@ -60,6 +60,7 @@ export default {
thumb
:
''
,
thumb
:
''
,
price
:
''
,
price
:
''
,
surplus
:
0
,
surplus
:
0
,
spec_title
:
'规格'
,
spec
:
''
,
spec
:
''
,
specList
:
[],
specList
:
[],
form
:
{
form
:
{
...
@@ -202,6 +203,7 @@ export default {
...
@@ -202,6 +203,7 @@ export default {
getGoodsSpecs
(
params
).
then
(
res
=>
{
getGoodsSpecs
(
params
).
then
(
res
=>
{
this
.
specList
=
res
.
data
this
.
specList
=
res
.
data
const
[
first
=
{}]
=
res
.
data
const
[
first
=
{}]
=
res
.
data
this
.
spec_title
=
first
.
spec_names
this
.
spec
=
first
.
sku_id
this
.
spec
=
first
.
sku_id
this
.
price
=
first
.
price
this
.
price
=
first
.
price
this
.
surplus
=
first
.
stock
this
.
surplus
=
first
.
stock
...
...
src/pages/buy/index.vue
浏览文件 @
684f35e4
...
@@ -225,6 +225,9 @@ export default {
...
@@ -225,6 +225,9 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.buy-container
{
padding-bottom
:
1
.04rem
;
}
.van-swipe-item
{
.van-swipe-item
{
.van-icon
{
.van-icon
{
position
:absolute
!
important
;
position
:absolute
!
important
;
...
@@ -332,7 +335,7 @@ export default {
...
@@ -332,7 +335,7 @@ export default {
}
}
.bottom-bar
{
.bottom-bar
{
position
:fixed
;
position
:fixed
;
bottom
:
0
;
bottom
:
-1px
;
width
:
100%
;
width
:
100%
;
box-sizing
:border-box
;
box-sizing
:border-box
;
padding
:
0
.2rem
0
.8rem
;
padding
:
0
.2rem
0
.8rem
;
...
...
src/pages/home/index.vue
浏览文件 @
684f35e4
...
@@ -43,29 +43,16 @@
...
@@ -43,29 +43,16 @@
<p
class=
"title van-ellipsis"
>
{{item.spu_name}}
</p>
<p
class=
"title van-ellipsis"
>
{{item.spu_name}}
</p>
</div>
</div>
</div>
</div>
<
template
slot=
"finished"
>
{{
goodsList
.
length
>
0
?
'没有更多了'
:
''
}}
</
template
>
</van-list>
</van-list>
</van-pull-refresh>
</van-pull-refresh>
<ul
class=
"goods-list"
v-if=
"false"
>
<van-empty
description=
"暂无商品"
v-if=
"goodsList.length === 0 && finished"
/>
<li
class=
"goods-item"
v-for=
"item in goodsList"
:key=
"item.id"
@
click=
"handleClick(item)"
>
<div
class=
"thumb"
>
<img
:src=
"imgJsonParse(item.chart_oss)"
>
</div>
<div
class=
"content"
>
<div
class=
"top"
>
<div
class=
"price"
>
¥
<span>
{{item.price_zone}}
</span></div>
<div
class=
"right-tag"
>
{{item.sales_volume}}人付款
</div>
</div>
<p
class=
"title van-ellipsis"
>
{{item.spu_name}}
</p>
</div>
</li>
</ul>
<van-empty
description=
"暂无商品"
v-if=
"goodsList.length === 0"
/>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
AppSearchBar
from
'@/components/AppSearchBar.vue'
import
AppSearchBar
from
'@/components/AppSearchBar.vue'
import
{
getGoodsList
}
from
'@/api/common.js'
import
{
getGoodsList
}
from
'@/api/common.js'
//
import _ from 'lodash'
import
_
from
'lodash'
export
default
{
export
default
{
name
:
'Index'
,
name
:
'Index'
,
components
:
{
AppSearchBar
},
components
:
{
AppSearchBar
},
...
@@ -76,7 +63,7 @@ export default {
...
@@ -76,7 +63,7 @@ export default {
loading
:
false
,
loading
:
false
,
finished
:
false
,
finished
:
false
,
refreshing
:
false
,
refreshing
:
false
,
page_size
:
'
10
'
,
page_size
:
'
5
'
,
page
:
'0'
,
page
:
'0'
,
total
:
0
total
:
0
}
}
...
@@ -105,19 +92,18 @@ export default {
...
@@ -105,19 +92,18 @@ export default {
}
}
},
},
initParams
()
{
initParams
()
{
console
.
log
(
this
.
loading
)
this
.
goodsList
=
[]
this
.
goodsList
=
[]
this
.
loading
=
fals
e
this
.
loading
=
tru
e
this
.
finished
=
false
this
.
finished
=
false
// this.refreshing = false
// this.refreshing = false
this
.
page_size
=
'
10
'
this
.
page_size
=
'
5
'
this
.
page
=
'0'
this
.
page
=
'0'
this
.
total
=
0
this
.
total
=
0
},
},
initFetchList
()
{
initFetchList
:
_
.
debounce
(
function
()
{
this
.
initParams
()
this
.
initParams
()
this
.
fetchGoodsList
()
this
.
fetchGoodsList
()
},
},
200
),
onRefresh
()
{
onRefresh
()
{
this
.
initParams
()
this
.
initParams
()
this
.
finished
=
true
// 防止下拉刷新时触发上拉加载
this
.
finished
=
true
// 防止下拉刷新时触发上拉加载
...
@@ -138,18 +124,17 @@ export default {
...
@@ -138,18 +124,17 @@ export default {
this
.
finished
=
false
this
.
finished
=
false
this
.
refreshing
=
false
;
this
.
refreshing
=
false
;
}
}
if
(
res
.
code
===
0
&&
res
.
msg
===
'成功'
)
{
if
(
res
.
code
===
0
&&
Array
.
isArray
(
res
.
data
))
{
console
.
log
(
this
.
goodsList
)
console
.
log
(
res
.
data
)
this
.
goodsList
=
this
.
goodsList
.
concat
(
res
.
data
)
this
.
goodsList
=
this
.
goodsList
.
concat
(
res
.
data
)
this
.
total
=
parseInt
(
res
.
page_info
.
total_number
)
if
(((
parseInt
(
this
.
page
)
+
1
)
*
parseInt
(
this
.
page_size
))
>=
this
.
total
)
{
this
.
finished
=
true
}
else
{
this
.
page
=
parseInt
(
this
.
page
)
+
1
+
''
}
}
else
{
}
else
{
this
.
goodsList
=
[]
this
.
goodsList
=
[]
}
this
.
total
=
parseInt
(
res
.
page_info
.
total_number
)
if
(((
parseInt
(
this
.
page
)
+
1
)
*
parseInt
(
this
.
page_size
))
>
this
.
total
)
{
this
.
finished
=
true
this
.
finished
=
true
}
else
{
this
.
page
=
parseInt
(
this
.
page
)
+
1
+
''
}
}
this
.
loading
=
false
this
.
loading
=
false
})
})
...
...
src/pages/order/index.vue
浏览文件 @
684f35e4
...
@@ -92,6 +92,7 @@ import { getOrderList, createOrder } from '@/api/common'
...
@@ -92,6 +92,7 @@ import { getOrderList, createOrder } from '@/api/common'
import
{
getOpenId
}
from
'@/api/account.js'
import
{
getOpenId
}
from
'@/api/account.js'
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
import
_
from
'lodash'
const
statusMap
=
{
const
statusMap
=
{
1
:
'等待买家付款'
,
1
:
'等待买家付款'
,
2
:
'等待卖家发货'
,
2
:
'等待卖家发货'
,
...
@@ -192,17 +193,17 @@ export default {
...
@@ -192,17 +193,17 @@ export default {
},
},
initParams
()
{
initParams
()
{
this
.
list
=
[]
this
.
list
=
[]
this
.
loading
=
fals
e
this
.
loading
=
tru
e
this
.
finished
=
false
this
.
finished
=
false
// this.refreshing = false
// this.refreshing = false
this
.
page_size
=
'10'
this
.
page_size
=
'10'
this
.
page
=
'0'
this
.
page
=
'0'
this
.
total
=
0
this
.
total
=
0
},
},
initFetchList
()
{
initFetchList
:
_
.
throttle
(
function
()
{
this
.
initParams
()
this
.
initParams
()
this
.
fetchOrderList
()
this
.
fetchOrderList
()
},
},
200
),
onRefresh
()
{
onRefresh
()
{
this
.
initParams
()
this
.
initParams
()
this
.
finished
=
true
// 防止下拉刷新时触发上拉加载
this
.
finished
=
true
// 防止下拉刷新时触发上拉加载
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论