Commit c696c83c by 梁建民

css

parent 7175e41b
......@@ -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
}
......
......@@ -2,18 +2,31 @@ import axios from 'axios'
import {services as Services} from '../../api/index'
const state = {
appindex: {}
index: {}
}
const mutations = {
appIndex(state, payload) {
index(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
});
});
}
}
......
......@@ -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
<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>
......
......@@ -2,7 +2,7 @@ module.exports = {
devServer: {
proxy: {
'/api': {
target: 'https://api.ichunt.com',
target: 'http://m.liexin.com',
changeOrigin: true,
ws: true,
pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment