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;
...
@@ -29,9 +29,9 @@ export const productionUrlApi = urlApi;
export
const
apis
=
{
export
const
apis
=
{
/**
/**
*
商城数据获取
*
首页
*/
*/
getPointPrize
:
productionUrlApi
+
'point/getPointPrize
'
,
index
:
productionUrlApi
+
'index
'
,
/**
/**
* 获取购物车数量
* 获取购物车数量
*/
*/
...
@@ -40,8 +40,8 @@ export const apis = {
...
@@ -40,8 +40,8 @@ export const apis = {
}
}
export
const
services
=
{
export
const
services
=
{
getPointPrize
(
params
)
{
index
(
params
)
{
return
axios
.
get
(
apis
.
getPointPrize
,
{
return
axios
.
get
(
apis
.
index
,
{
params
:
{
params
:
{
data
:
params
data
:
params
}
}
...
...
src/store/modules/home.js
View file @
c696c83c
...
@@ -2,18 +2,31 @@ import axios from 'axios'
...
@@ -2,18 +2,31 @@ import axios from 'axios'
import
{
services
as
Services
}
from
'../../api/index'
import
{
services
as
Services
}
from
'../../api/index'
const
state
=
{
const
state
=
{
app
index
:
{}
index
:
{}
}
}
const
mutations
=
{
const
mutations
=
{
appI
ndex
(
state
,
payload
)
{
i
ndex
(
state
,
payload
)
{
state
.
index
=
payload
.
data
;
}
}
}
}
const
actions
=
{
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 @@
...
@@ -45,9 +45,9 @@
cartCount
:
state
=>
state
.
common
.
cartCount
cartCount
:
state
=>
state
.
common
.
cartCount
}),
}),
created
()
{
created
()
{
this
.
$store
.
dispatch
({
/*
this.$store.dispatch({
type: 'cartCount'
type: 'cartCount'
})
})
*/
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/views/common/Slide.vue
View file @
c696c83c
<
template
>
<
template
>
<van-swipe
:autoplay=
"3000000"
indicator-color=
"#ffffff"
:loop=
"false"
>
<van-swipe
:autoplay=
"3000000"
indicator-color=
"#ffffff"
:loop=
"false"
>
<van-swipe-item>
<template
v-if=
"slidedata"
>
<img
src=
"../../assets/images/home/banner.png"
alt=
""
class=
"slide-pic"
>
<van-swipe-item
v-for=
"(item, index) in slidedata"
:key=
"index"
>
</van-swipe-item>
<img
:src=
"item.images"
class=
"slide-pic"
>
<van-swipe-item>
</van-swipe-item>
<img
src=
"../../assets/images/home/banner.png"
alt=
""
class=
"slide-pic"
>
</
template
>
</van-swipe-item>
<
template
v-else
>
<van-swipe-item>
<img
src=
"../../assets/images/home/banner.png"
class=
"slide-pic"
>
</van-swipe-item>
</
template
>
</van-swipe>
</van-swipe>
</template>
</template>
...
@@ -16,13 +20,8 @@
...
@@ -16,13 +20,8 @@
Vue
.
use
(
Swipe
).
use
(
SwipeItem
);
Vue
.
use
(
Swipe
).
use
(
SwipeItem
);
export
default
{
export
default
{
name
:
'slide'
,
name
:
'slide'
,
data
()
{
props
:
{
return
{
slidedata
:
Array
images
:
[
'https://img.yzcdn.cn/1.jpg'
,
'https://img.yzcdn.cn/2.jpg'
]
}
}
}
}
}
</
script
>
</
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 = {
...
@@ -2,7 +2,7 @@ module.exports = {
devServer
:
{
devServer
:
{
proxy
:
{
proxy
:
{
'/api'
:
{
'/api'
:
{
target
:
'http
s://api.ichunt
.com'
,
target
:
'http
://m.liexin
.com'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
ws
:
true
,
ws
:
true
,
pathRewrite
:
{
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