Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
ichunt3.0_h5
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
c696c83c
authored
Jan 22, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
7175e41b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
25 deletions
src/api/index.js
src/store/modules/home.js
src/views/common/Navigator.vue
src/views/common/Slide.vue
src/views/home/Index.vue
vue.config.js
src/api/index.js
View file @
c696c83c
...
...
@@ -29,9 +29,9 @@ export const productionUrlApi = urlApi;
export
const
apis
=
{
/**
*
商城数据获取
*
首页
*/
getPointPrize
:
productionUrlApi
+
'point/getPointPrize
'
,
index
:
productionUrlApi
+
'index
'
,
/**
* 获取购物车数量
*/
...
...
@@ -40,8 +40,8 @@ export const apis = {
}
export
const
services
=
{
getPointPrize
(
params
)
{
return
axios
.
get
(
apis
.
getPointPrize
,
{
index
(
params
)
{
return
axios
.
get
(
apis
.
index
,
{
params
:
{
data
:
params
}
...
...
src/store/modules/home.js
View file @
c696c83c
...
...
@@ -2,18 +2,31 @@ import axios from 'axios'
import
{
services
as
Services
}
from
'../../api/index'
const
state
=
{
app
index
:
{}
index
:
{}
}
const
mutations
=
{
appI
ndex
(
state
,
payload
)
{
i
ndex
(
state
,
payload
)
{
state
.
index
=
payload
.
data
;
}
}
const
actions
=
{
appIndex
({
commit
},
payload
)
{
index
({
commit
},
payload
)
{
Services
.
index
().
then
(
function
(
res
)
{
let
data
=
res
.
data
;
if
(
data
.
err_code
==
0
)
{
commit
({
type
:
'index'
,
data
:
data
.
data
});
}
}).
catch
(
function
(
err
)
{
Toast
({
message
:
'网络出现问题,请重试'
,
duration
:
1500
});
});
}
}
...
...
src/views/common/Navigator.vue
View file @
c696c83c
...
...
@@ -45,9 +45,9 @@
cartCount
:
state
=>
state
.
common
.
cartCount
}),
created
()
{
this
.
$store
.
dispatch
({
/*
this.$store.dispatch({
type: 'cartCount'
})
})
*/
}
}
</
script
>
\ No newline at end of file
src/views/common/Slide.vue
View file @
c696c83c
<
template
>
<van-swipe
:autoplay=
"3000000"
indicator-color=
"#ffffff"
:loop=
"false"
>
<van-swipe-item>
<img
src=
"../../assets/images/home/banner.png"
alt=
""
class=
"slide-pic"
>
</van-swipe-item>
<van-swipe-item>
<img
src=
"../../assets/images/home/banner.png"
alt=
""
class=
"slide-pic"
>
</van-swipe-item>
<template
v-if=
"slidedata"
>
<van-swipe-item
v-for=
"(item, index) in slidedata"
:key=
"index"
>
<img
:src=
"item.images"
class=
"slide-pic"
>
</van-swipe-item>
</
template
>
<
template
v-else
>
<van-swipe-item>
<img
src=
"../../assets/images/home/banner.png"
class=
"slide-pic"
>
</van-swipe-item>
</
template
>
</van-swipe>
</template>
...
...
@@ -16,13 +20,8 @@
Vue
.
use
(
Swipe
).
use
(
SwipeItem
);
export
default
{
name
:
'slide'
,
data
()
{
return
{
images
:
[
'https://img.yzcdn.cn/1.jpg'
,
'https://img.yzcdn.cn/2.jpg'
]
}
props
:
{
slidedata
:
Array
}
}
</
script
>
...
...
src/views/home/Index.vue
View file @
c696c83c
This diff is collapsed.
Click to expand it.
vue.config.js
View file @
c696c83c
...
...
@@ -2,7 +2,7 @@ module.exports = {
devServer
:
{
proxy
:
{
'/api'
:
{
target
:
'http
s://api.ichunt
.com'
,
target
:
'http
://m.liexin
.com'
,
changeOrigin
:
true
,
ws
:
true
,
pathRewrite
:
{
...
...
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