Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
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
xugong
hls-xcmg-vue-app
Commits
f3db6a2e
Commit
f3db6a2e
authored
Oct 21, 2019
by
786817560
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ren' into develop
parents
71a990b2
43596535
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
25 deletions
+41
-25
product-detailed.vue
src/pages/productQuery/product-detailed.vue
+37
-23
product-list.vue
src/pages/productQuery/product-list.vue
+4
-2
No files found.
src/pages/productQuery/product-detailed.vue
View file @
f3db6a2e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Descrip: 产品明细
* @Descrip: 产品明细
* @Author: your name
* @Author: your name
* @Date: 2019-10-15 14:30:00
* @Date: 2019-10-15 14:30:00
* @LastEditTime: 2019-10-
18 15:35:42
* @LastEditTime: 2019-10-
21 15:56:00
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
-->
-->
<
template
>
<
template
>
...
@@ -118,14 +118,20 @@ export default {
...
@@ -118,14 +118,20 @@ export default {
bgc_flag
:
true
,
bgc_flag
:
true
,
collect_flag
:
false
,
collect_flag
:
false
,
src
:
require
(
'@/assets/productQuery/collect.png'
),
src
:
require
(
'@/assets/productQuery/collect.png'
),
// collect_status: window.sessionStorage.getItem('collect_status'),
}
}
},
},
computed
:
{},
computed
:
{},
watch
:
{},
watch
:
{
},
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
to
,
from
,
next
)
{
if
(
from
.
name
===
'ProductList'
)
{
if
(
from
.
name
===
'ProductList'
)
{
next
(
vm
=>
{
next
(
vm
=>
{
vm
.
product_id
=
vm
.
$route
.
params
.
product_id
vm
.
product_id
=
vm
.
$route
.
params
.
product_id
// vm.collect_status = vm.$route.params.collect_status
// if (vm.$route.params.collect_status === 'Y') {
// vm.src = require('@/assets/productQuery/coll-success.png')
// }
vm
.
baseMsg
()
vm
.
baseMsg
()
vm
.
detailMsg
()
vm
.
detailMsg
()
vm
.
confgMsg
()
vm
.
confgMsg
()
...
@@ -134,7 +140,10 @@ export default {
...
@@ -134,7 +140,10 @@ export default {
next
()
next
()
},
},
created
()
{
created
()
{
console
.
log
(
'collect........'
,
window
.
sessionStorage
.
getItem
(
'collect_status'
))
if
(
window
.
sessionStorage
.
getItem
(
'collect_status'
)
===
'Y'
)
{
this
.
src
=
require
(
'@/assets/productQuery/coll-success.png'
)
}
},
},
methods
:
methods
:
{
{
...
@@ -144,27 +153,32 @@ export default {
...
@@ -144,27 +153,32 @@ export default {
},
},
// 收藏
// 收藏
collect
()
{
collect
()
{
this
.
collect_flag
=
true
console
.
log
(
'collect'
,
window
.
sessionStorage
.
getItem
(
'collect_status'
))
console
.
log
(
this
.
collect_flag
)
if
(
window
.
sessionStorage
.
getItem
(
'collect_status'
)
===
'Y'
)
{
let
vm
=
this
hlsPopup
.
showLongCenter
(
'该产品已收藏过,请勿重复收藏'
)
let
url
=
$config
.
basePath
+
'save_collection'
}
else
{
let
param
=
{
this
.
collect_flag
=
true
master
:
{
console
.
log
(
this
.
collect_flag
)
product_id
:
vm
.
product_id
,
let
vm
=
this
user_phone
:
window
.
localStorage
.
user_phone
,
let
url
=
$config
.
basePath
+
'save_collection'
},
let
param
=
{
}
master
:
{
vm
.
$post
(
url
,
param
).
then
(
function
(
res
)
{
product_id
:
vm
.
product_id
,
console
.
log
(
'收藏'
,
res
)
user_phone
:
window
.
localStorage
.
user_phone
,
if
(
res
.
result
===
'S'
)
{
},
vm
.
src
=
require
(
'@/assets/productQuery/coll-success.png'
)
setTimeout
(()
=>
{
vm
.
collect_flag
=
false
},
1500
)
}
else
{
hlsPopup
.
showLongCenter
(
res
.
message
)
}
}
})
vm
.
$post
(
url
,
param
).
then
(
function
(
res
)
{
console
.
log
(
'收藏'
,
res
)
if
(
res
.
result
===
'S'
)
{
vm
.
src
=
require
(
'@/assets/productQuery/coll-success.png'
)
setTimeout
(()
=>
{
vm
.
collect_flag
=
false
},
1500
)
}
else
{
hlsPopup
.
showLongCenter
(
res
.
message
)
}
})
}
},
},
// 基本信息查询
// 基本信息查询
baseMsg
()
{
baseMsg
()
{
...
...
src/pages/productQuery/product-list.vue
View file @
f3db6a2e
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
</div>
</div>
</div>
</div>
<div
slot=
"right-icon"
>
<div
slot=
"right-icon"
>
<img
class=
"arrow"
src=
"@/assets/productQuery/getIn.png"
alt=
""
@
click=
"goDetailed(item.product_id)"
>
<img
class=
"arrow"
src=
"@/assets/productQuery/getIn.png"
alt=
""
@
click=
"goDetailed(item.product_id
,item.collect_status
)"
>
</div>
</div>
</item>
</item>
</list-item>
</list-item>
...
@@ -82,11 +82,13 @@ export default {
...
@@ -82,11 +82,13 @@ export default {
})
})
},
},
// val:产品id
// val:产品id
goDetailed
(
val
)
{
goDetailed
(
val
,
status
)
{
window
.
sessionStorage
.
setItem
(
'collect_status'
,
status
)
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'ProDetailed'
,
name
:
'ProDetailed'
,
params
:
{
params
:
{
product_id
:
val
,
product_id
:
val
,
// collect_status: status,
},
},
})
})
},
},
...
...
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