Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
上
上药订单生命周期升级
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
sph
上药订单生命周期升级
Commits
d1209725
Commit
d1209725
authored
Mar 10, 2021
by
琉璃丶c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.商品详情页面的ESlint整理
2.添加返回键事件
parent
ecc53607
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
37 deletions
+43
-37
src/views/myOrder/goodsInfo.vue
src/views/myOrder/goodsInfo.vue
+43
-37
No files found.
src/views/myOrder/goodsInfo.vue
View file @
d1209725
...
...
@@ -25,13 +25,12 @@
</div>
</
template
>
<
script
>
import
goodsInfoDetail
from
"
../myOrder/goodsInfoDetail
"
;
import
goodsInfoDetail
from
'
../myOrder/goodsInfoDetail
'
export
default
{
name
:
"
goodsInfo
"
,
name
:
'
goodsInfo
'
,
components
:
{
goodsInfoDetail
,
goodsInfoDetail
},
data
()
{
return
{
...
...
@@ -69,62 +68,69 @@ export default {
],
loading
:
false
,
finished
:
false
,
// error: false,
// error: false,
refreshing
:
false
,
icons
:
{
inDelivery
:
require
(
"
@/assets/img/u546.svg
"
),
copy
:
require
(
"
@/assets/img/u533.svg
"
),
},
};
inDelivery
:
require
(
'
@/assets/img/u546.svg
'
),
copy
:
require
(
'
@/assets/img/u533.svg
'
)
}
}
},
mounted
()
{
// 设置标题栏关闭返回按钮
this
.
$store
.
commit
(
'
setNavBar
'
,
{
show
:
true
,
leftArrow
:
true
,
rightIcon
:
false
,
title
:
''
,
leftText
:
'
商品详情
'
,
leftClick
:
{},
rightClick
:
{}
})
window
.
addEventListener
(
'
popstate
'
,
this
.
onBrowserBack
,
false
)
},
destroyed
()
{
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window
.
removeEventListener
(
'
popstate
'
,
this
.
onBrowserBack
,
false
)
},
methods
:
{
onBrowserBack
()
{
this
.
$router
.
go
(
-
1
)
},
onLoad
()
{
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout
(()
=>
{
if
(
this
.
refreshing
)
{
this
.
list
=
[]
;
this
.
refreshing
=
false
;
if
(
this
.
refreshing
)
{
this
.
list
=
[]
this
.
refreshing
=
false
}
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
this
.
list
.
push
(
this
.
list
.
length
+
1
)
;
this
.
list
.
push
(
this
.
list
.
length
+
1
)
}
// 加载状态结束
this
.
loading
=
false
;
this
.
loading
=
false
// 数据全部加载完成
if
(
this
.
list
.
length
>=
20
)
{
this
.
finished
=
true
;
this
.
finished
=
true
}
},
1000
)
;
},
1000
)
},
onRefresh
()
{
onRefresh
()
{
// 清空列表数据
this
.
finished
=
false
;
this
.
finished
=
false
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
this
.
loading
=
false
;
this
.
onLoad
();
},
},
mounted
()
{
// 设置标题栏关闭返回按钮
this
.
$store
.
commit
(
"
setNavBar
"
,
{
show
:
true
,
leftArrow
:
true
,
rightIcon
:
false
,
title
:
""
,
leftText
:
"
商品详情
"
,
leftClick
:
{},
rightClick
:
{},
});
},
};
this
.
loading
=
false
this
.
onLoad
()
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.goods-info
{
height
:
100%
;
...
...
@@ -161,4 +167,4 @@ export default {
padding-left
:
10px
;
}
}
</
style
>
\ No newline at end of file
</
style
>
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