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>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<van-pull-refresh v-model="isLoading" @refresh="onRefresh"> <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="head boxsiz"> <div class="head boxsiz">
<div class="banner boxsiz"> <div class="banner boxsiz">
<Slide></Slide> <Slide :slidedata="index.rollbanner"></Slide>
</div> </div>
<div class="login-wrap"> <div class="login-wrap">
<a href="/v3/login?ptag=index-topnav" class="btn" style="display: none">登录</a> <a href="/v3/login?ptag=index-topnav" class="btn" style="display: none">登录</a>
...@@ -37,350 +37,135 @@ ...@@ -37,350 +37,135 @@
</div> </div>
<div class="tab-content boxsiz"> <div class="tab-content boxsiz">
<ul class="boxsiz"> <ul class="boxsiz">
<li> <li v-for="(item,index) in index.business_entry">
<a href=""> <a :href="item.url" :target="item.window_open > 0 ?'_blank':'_self'">
<img src="../../assets/images/home/nav-1.png" alt=""> <img :src="item.images" alt="">
<p>关于我们</p> <p>{{item.title}}</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-2.png" alt="">
<p>自营现货</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-3.png" alt="">
<p>联营商场</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-4.png" alt="">
<p>积分商城</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-5.png" alt="">
<p>平台入驻</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-6.png" alt="">
<p>SMT工厂</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-7.png" alt="">
<p>PCB快板</p>
</a>
</li>
<li>
<a href="">
<img src="../../assets/images/home/nav-8.png" alt="">
<p>资讯中心</p>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content boxsiz"> <div class="content boxsiz">
<div class="selfshop boxsiz"> <template v-for="(item,index) in index.template">
<div class="tit boxsiz"> <!--自营现货-->
<div class="l"> <template v-if="item.class == 'temp2'">
<i class="lineBlock va-b"></i> <div class="selfshop boxsiz">
<span class="t1 va-b">自营现货</span> <div class="tit boxsiz">
<span class="t2 va-b">海量商品 正品低价</span> <div class="l">
</div> <i class="lineBlock va-b"></i>
<a class="r"> <span class="t1 va-b">{{item.tem_name}}</span>
<span class="va-m">更多</span> <span class="t2 va-b">{{item.ad_words}}</span>
<i class="lineBlock va-m"></i>
</a>
</div>
<ul class="boxsiz list">
<li class="boxsiz">
<a href="javascript:;">
<img src="../../assets/images/home/pic-1.png" alt="">
<div class="text">
<p class="t1">贴片电阻1111111111</p>
<p class="t2">
<span class="l">¥ 0.17089</span>
<span class="r">抢购</span>
</p>
<p class="t3">¥ 0.26089</p>
</div> </div>
</a> <template v-if="item.link_words">
</li> <a class="r" :href="item.url">
<li class="boxsiz"> <span class="va-m">{{item.link_words}}</span>
<a href="javascript:;"> <i class="lineBlock va-m"></i>
<img src="../../assets/images/home/pic-1.png" alt=""> </a>
<div class="text"> </template>
<p class="t1">贴片电阻1111111111</p> </div>
<p class="t2"> <ul class="boxsiz list">
<span class="l">¥ 0.17089</span> <li class="boxsiz" v-for="(v,index) in item.data.tempGoods" :key="index">
<span class="r">抢购</span> <a href="javascript:;">
</p> <img src="../../assets/images/home/pic-1.png" alt="">
<p class="t3">¥ 0.26089</p> <div class="text">
</div> <p class="t1">{{v.goods_name}}</p>
</a> <p class="t2">
</li> <span class="l">{{v.price_ac}}</span>
<li class="boxsiz"> <span class="r">抢购</span>
<a href="javascript:;"> </p>
<img src="../../assets/images/home/pic-1.png" alt=""> <p class="t3">{{v.price}}</p>
<div class="text"> </div>
<p class="t1">贴片电阻1111111111</p> </a>
<p class="t2"> </li>
<span class="l">¥ 0.17089</span> </ul>
<span class="r">抢购</span>
</p>
<p class="t3">¥ 0.26089</p>
</div>
</a>
</li>
<li class="boxsiz">
<a href="javascript:;">
<img src="../../assets/images/home/pic-1.png" alt="">
<div class="text">
<p class="t1">贴片电阻1111111111</p>
<p class="t2">
<span class="l">¥ 0.17089</span>
<span class="r">抢购</span>
</p>
<p class="t3">¥ 0.26089</p>
</div>
</a>
</li>
<li class="boxsiz">
<a href="javascript:;">
<img src="../../assets/images/home/pic-1.png" alt="">
<div class="text">
<p class="t1">贴片电阻1111111111</p>
<p class="t2">
<span class="l">¥ 0.17089</span>
<span class="r">抢购</span>
</p>
<p class="t3">¥ 0.26089</p>
</div>
</a>
</li>
<li class="boxsiz">
<a href="javascript:;">
<img src="../../assets/images/home/pic-1.png" alt="">
<div class="text">
<p class="t1">贴片电阻1111111111</p>
<p class="t2">
<span class="l">¥ 0.17089</span>
<span class="r">抢购</span>
</p>
<p class="t3">¥ 0.26089</p>
</div>
</a>
</li>
</ul>
</div>
<div class="lxshop boxsiz">
<div class="tit boxsiz">
<div class="l">
<i class="lineBlock va-b"></i>
<span class="t1 va-b">联营现货</span>
<span class="t2 va-b">一片起订 3小时发货</span>
</div> </div>
<a class="r"> </template>
<span class="va-m">更多</span> <!--联营-->
<i class="lineBlock va-m"></i> <template v-else-if="item.class == 'temp1'">
</a> <div class="lxshop boxsiz">
</div> <div class="tit boxsiz">
<ul class="boxsiz list"> <div class="l">
<li class="boxsiz"> <i class="lineBlock va-b"></i>
<a href="javascript:;" class="boxsiz"> <span class="t1 va-b">{{item.tem_name}}</span>
<div class="pic"> <span class="t2 va-b">{{item.ad_words}}</span>
<img src="../../assets/images/home/pic-2.png" alt="">
</div>
</a>
</li>
<li class="boxsiz">
<a href="javascript:;" class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-2.png" alt="">
</div>
</a>
</li>
<li class="boxsiz">
<a href="javascript:;" class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-2.png" alt="">
</div> </div>
</a> <template v-if="item.link_words">
</li> <a class="r" :href="item.url">
<li class="boxsiz"> <span class="va-m">{{item.link_words}}</span>
<a href="javascript:;" class="boxsiz"> <i class="lineBlock va-m"></i>
<div class="pic"> </a>
<img src="../../assets/images/home/pic-2.png" alt=""> </template>
</div> </div>
</a> <ul class="boxsiz list">
</li> <li class="boxsiz" v-for="(v,index) in item.data.brandImages" :key="index">
<li class="boxsiz"> <a :href="v.url" class="boxsiz">
<a href="javascript:;" class="boxsiz"> <div class="pic">
<div class="pic"> <img :src="v.images" :alt="v.title">
<img src="../../assets/images/home/pic-2.png" alt=""> </div>
</div> </a>
</a> </li>
</li> </ul>
<li class="boxsiz">
<a href="javascript:;" class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-2.png" alt="">
</div>
</a>
</li>
</ul>
</div>
<div class="pcb boxsiz">
<div class="tit boxsiz">
<div class="l">
<i class="lineBlock va-b"></i>
<span class="t1 va-b">自营现货</span>
<span class="t2 va-b">海量商品 正品低价</span>
</div>
<a class="r">
<span class="va-m">更多</span>
<i class="lineBlock va-m"></i>
</a>
</div>
<ul class="list boxsiz">
<li class="boxsiz">
<a class="boxsiz" href="">
<img src="../../assets/images/home/banner-1.png" alt="">
</a>
</li>
</ul>
</div>
<div class="smt boxsiz">
<div class="tit boxsiz">
<div class="l">
<i class="lineBlock va-b"></i>
<span class="t1 va-b">SMT工厂</span>
<span class="t2 va-b">整合多家传统SMT贴片OEM工厂</span>
</div>
<a class="r">
<span class="va-m">更多</span>
<i class="lineBlock va-m"></i>
</a>
</div>
<ul class="list boxsiz">
<li class="boxsiz">
<a class="boxsiz" href="">
<img src="../../assets/images/home/banner-2.png" alt="">
</a>
</li>
</ul>
</div>
<div class="jfshop boxsiz">
<div class="tit boxsiz">
<div class="l">
<i class="lineBlock va-b"></i>
<span class="t1 va-b">积分商城</span>
<span class="t2 va-b">积分商城火热上线 EM工厂</span>
</div> </div>
<a class="r"> </template>
<span class="va-m">更多</span> <!--积分商城-->
<i class="lineBlock va-m"></i> <template v-else-if="item.class == 'temp3'">
</a> <div class="jfshop boxsiz">
</div> <div class="tit boxsiz">
<ul class="list boxsiz"> <div class="l">
<li class="boxsiz"> <i class="lineBlock va-b"></i>
<a class="boxsiz"> <span class="t1 va-b">{{item.tem_name}}</span>
<div class="pic"> <span class="t2 va-b">{{item.ad_words}}</span>
<img src="../../assets/images/home/pic-3.png" alt="">
</div> </div>
<p class="t1">Apple/苹果 iPad Pro 1</p> <template v-if="item.link_words">
<p class="t2"> <a class="r" :href="item.url">
<i class="va-m lineBlock"></i> <span class="va-m">{{item.link_words}}</span>
<em>45124578</em> <i class="lineBlock va-m"></i>
</p> </a>
</a> </template>
</li> </div>
<li class="boxsiz"> <ul class="list boxsiz">
<a class="boxsiz"> <li class="boxsiz" v-for="(v,index) in item.data.pointGoods" :key="index">
<div class="pic"> <a class="boxsiz">
<img src="../../assets/images/home/pic-3.png" alt=""> <div class="pic">
</div> <img :src="v.prize_img_url" :alt="v.prize_name">
<p class="t1">Apple/苹果 iPad Pro 1</p> </div>
<p class="t2"> <p class="t1">{{v.prize_name}}</p>
<i class="va-m lineBlock"></i> <p class="t2">
<em>45124578</em> <i class="va-m lineBlock"></i>
</p> <em>{{v.prize_point}}</em>
</a> </p>
</li> </a>
<li class="boxsiz"> </li>
<a class="boxsiz"> </ul>
<div class="pic">
<img src="../../assets/images/home/pic-3.png" alt="">
</div>
<p class="t1">Apple/苹果 iPad Pro 1</p>
<p class="t2">
<i class="va-m lineBlock"></i>
<em>45124578</em>
</p>
</a>
</li>
<li class="boxsiz">
<a class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-3.png" alt="">
</div>
<p class="t1">Apple/苹果 iPad Pro 1</p>
<p class="t2">
<i class="va-m lineBlock"></i>
<em>45124578</em>
</p>
</a>
</li>
</ul>
</div>
<div class="scm boxsiz">
<div class="tit boxsiz">
<div class="l">
<i class="lineBlock va-b"></i>
<span class="t1 va-b">进口报关</span>
<span class="t2 va-b">快速 安全 透明 低收费</span>
</div> </div>
<a class="r"> </template>
<span class="va-m">更多</span> <!--PCB打板 SMT云工厂 进口报关 平台入驻-->
<i class="lineBlock va-m"></i> <template v-else-if="item.class == 'temp4'">
</a> <div class="pcb boxsiz">
</div> <div class="tit boxsiz">
<ul class="list boxsiz"> <div class="l">
<li class="boxsiz"> <i class="lineBlock va-b"></i>
<a class="boxsiz" href=""> <span class="t1 va-b">{{item.tem_name}}</span>
<img src="../../assets/images/home/banner-3.png" alt=""> <span class="t2 va-b">{{item.ad_words}}</span>
</a> </div>
</li> <template v-if="item.link_words">
</ul> <a class="r" :href="item.url">
</div> <span class="va-m">{{item.link_words}}</span>
<div class="supplier boxsiz"> <i class="lineBlock va-m"></i>
<div class="tit boxsiz"> </a>
<div class="l"> </template>
<i class="lineBlock va-b"></i> </div>
<span class="t1 va-b">平台入驻</span> <ul class="list boxsiz">
<span class="t2 va-b">诚邀合作供应商</span> <li class="boxsiz" v-for="(v,index) in item.data.tempImages" :key="index">
<a class="boxsiz" href="v.url">
<img :src="v.images" :alt="v.title">
</a>
</li>
</ul>
</div> </div>
<a class="r"> </template>
<span class="va-m">更多</span> </template>
<i class="lineBlock va-m"></i> <!--资讯中心-->
</a>
</div>
<ul class="list boxsiz">
<li class="boxsiz">
<a class="boxsiz" href="">
<img src="../../assets/images/home/banner-4.png" alt="">
</a>
</li>
</ul>
</div>
<div class="news boxsiz"> <div class="news boxsiz">
<div class="tit boxsiz"> <div class="tit boxsiz">
<div class="l"> <div class="l">
...@@ -393,69 +178,20 @@ ...@@ -393,69 +178,20 @@
</a> </a>
</div> </div>
<ul class="list boxsiz"> <ul class="list boxsiz">
<li class="boxsiz"> <li class="boxsiz" v-for="item in index.footer_new_article" :key="item.art_id">
<a class="boxsiz"> <a class="boxsiz" :href="'/article/'+item.art_id+'.html?ptag='+ptag+'-dynamic'">
<div class="pic">
<img src="../../assets/images/home/pic-4.png" alt="">
</div>
<div class="text">
<p class="t1">吕家璈:中国半导体代工部分最难,看好IC设计和封装看好IC设计和封装看好IC设计和封装 </p>
<div class="t2">
<span>来源:21世纪电源网</span>
<div>
<i class="ico lineBlock va-m"></i>
<em class="va-m">242424</em>
</div>
</div>
</div>
</a>
</li>
<li class="boxsiz">
<a class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-4.png" alt="">
</div>
<div class="text">
<p class="t1">吕家璈:中国半导体代工部分最难,看好IC设计和封装看好IC设计和封装看好IC设计和封装 </p>
<div class="t2">
<span>来源:21世纪电源网</span>
<div>
<i class="ico lineBlock va-m"></i>
<em class="va-m">242424</em>
</div>
</div>
</div>
</a>
</li>
<li class="boxsiz">
<a class="boxsiz">
<div class="pic"> <div class="pic">
<img src="../../assets/images/home/pic-4.png" alt=""> <img :src="item.litpic">
</div> </div>
<div class="text"> <div class="text">
<p class="t1">吕家璈:中国半导体代工部分最难,看好IC设计和封装看好IC设计和封装看好IC设计和封装 </p> <p class="t1">{{item.title_seo}}</p>
<div class="t2"> <div class="t2">
<span>来源:21世纪电源网</span> <span>来源:{{item.writer}}</span>
<div> <div>
<i class="ico lineBlock va-m"></i> <i class="ico lineBlock va-m"></i>
<em class="va-m">242424</em> <em class="va-m">
</div> {{parseInt(item.click)+parseInt(item.start_review)}}
</div> </em>
</div>
</a>
</li>
<li class="boxsiz">
<a class="boxsiz">
<div class="pic">
<img src="../../assets/images/home/pic-4.png" alt="">
</div>
<div class="text">
<p class="t1">吕家璈:中国半导体代工部分最难,看好IC设计和封装看好IC设计和封装看好IC设计和封装 </p>
<div class="t2">
<span>来源:21世纪电源网</span>
<div>
<i class="ico lineBlock va-m"></i>
<em class="va-m">242424</em>
</div> </div>
</div> </div>
</div> </div>
...@@ -473,6 +209,7 @@ ...@@ -473,6 +209,7 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import {mapState} from 'vuex'
import {PullRefresh} from 'vant'; import {PullRefresh} from 'vant';
import Navigator from '@/views/common/Navigator.vue'; import Navigator from '@/views/common/Navigator.vue';
import Slide from '@/views/common/Slide.vue'; import Slide from '@/views/common/Slide.vue';
...@@ -481,6 +218,9 @@ ...@@ -481,6 +218,9 @@
export default { export default {
name: 'index', name: 'index',
computed: mapState({
index: state => state.home.index
}),
data() { data() {
return { return {
ptag: 'index', ptag: 'index',
...@@ -489,7 +229,9 @@ ...@@ -489,7 +229,9 @@
} }
}, },
created() { created() {
this.$store.dispatch({
type: 'index'
})
}, },
methods: { methods: {
onRefresh() { onRefresh() {
...@@ -734,13 +476,9 @@ ...@@ -734,13 +476,9 @@
justify-content: space-between; justify-content: space-between;
li { li {
padding: 0.16rem 0.133rem 0.267rem 0.133rem; padding: 0.16rem 0.133rem 0.267rem 0.133rem;
flex: 1; width: 32%;
background: #fff; background: #fff;
margin-right: 0.13rem;
margin-bottom: 0.13rem; margin-bottom: 0.13rem;
&:nth-of-type(3n) {
margin-right: 0;
}
a { a {
display: block; display: block;
img { img {
...@@ -936,7 +674,6 @@ ...@@ -936,7 +674,6 @@
a { a {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
.pic { .pic {
width: 115px; width: 115px;
height: 69px; height: 69px;
......
...@@ -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