Commit c696c83c by 梁建民

css

parent 7175e41b
...@@ -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
} }
......
...@@ -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 = {
appindex: {} index: {}
} }
const mutations = { const mutations = {
appIndex(state, payload) { index(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
});
});
} }
} }
......
...@@ -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
<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>
......
...@@ -2,7 +2,7 @@ module.exports = { ...@@ -2,7 +2,7 @@ module.exports = {
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target: 'https://api.ichunt.com', target: 'http://m.liexin.com',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
pathRewrite: { 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