Commit 46fb9dd4f1823bf621d67bffa1acef97bb10455c

Authored by 王强
1 parent b19ee132

组件提交

src/components/horizList/horizList.less 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +.horiz-list-box {
  4 + background-color: transparent;
  5 + width: 100%;
  6 + height: auto;
  7 + .box {
  8 +
  9 + }
  10 +}
0 \ No newline at end of file 11 \ No newline at end of file
src/components/horizList/horizList.vue 0 → 100644
  1 +<template>
  2 + <div class="horiz-list-box" v-if="lists && lists.list && lists.list.length">
  3 + <div class="box">
  4 + <div class="item-box" v-for="(item, index) in lists.list" :key="index" @click="jump(item)">
  5 + <div class="img-box">
  6 + <img :src="item.simg + SIGN.SMALL" class="simg" />
  7 + </div>
  8 + <div class="title">{{item.title}}</div>
  9 + <div class="price-box">
  10 + <div class="price">{{item.price}}</div>
  11 + <div class="add-cart" @click.stop.prevent @click="addCart(item)">
  12 + <img src="static/img/" class="add-img" />
  13 + </div>
  14 + </div>
  15 + </div>
  16 + </div>
  17 + </div>
  18 +</template>
  19 +
  20 +<script>
  21 + export default {
  22 + data: function () {
  23 + return {
  24 +
  25 + }
  26 + },
  27 + props: ["lists"],
  28 + methods: {
  29 +
  30 + /**
  31 + * 点击跳转
  32 + */
  33 + jump(item) {
  34 + this.$emit("jump", item);
  35 + },
  36 +
  37 + /**
  38 + * 加入购物车
  39 + */
  40 + addCart(item) {
  41 + this.$emit("addCart", item);
  42 + }
  43 + }
  44 + }
  45 +</script>
  46 +
  47 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  48 +<style rel="stylesheet/less" lang="less">
  49 + @import './horizList';
  50 +</style>
0 \ No newline at end of file 51 \ No newline at end of file
src/components/style_1/style_1.less 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +.style-1-com {
  4 + background-color: transparent;
  5 + width: 100%;
  6 + height: auto;
  7 + .com {
  8 + .banner-img-box {
  9 + margin-top: 30px;
  10 + width: 100%;
  11 + height: auto;
  12 + .banner-img {
  13 + display: block;
  14 + width: 100%;
  15 + height: auto;
  16 + }
  17 + }
  18 + }
  19 +}
0 \ No newline at end of file 20 \ No newline at end of file
src/components/style_1/style_1.vue 0 → 100644
  1 +<template>
  2 + <div class="style-1-com" v-if="styles">
  3 + <div class="com">
  4 +
  5 + <!-- 引入标题 -->
  6 + <title-box v-if="styles.titles"
  7 + :titles="styles.titles">
  8 + </title-box>
  9 +
  10 + <!-- Banner图 -->
  11 + <div class="banner-img-box">
  12 + <img :src="styles.banner + SIGN.BIG" class="banner-img" mode="widthFix" />
  13 + </div>
  14 +
  15 + <!-- 横向滚动列表 -->
  16 + <horiz-list v-if="styles.lists && styles.lists.list && styles.lists.list.length"
  17 + :lists="styles.lists">
  18 + </horiz-list>
  19 + </div>
  20 + </div>
  21 +</template>
  22 +
  23 +<script>
  24 +
  25 + // 引入组件
  26 + import titleBox from "@/components/titleBox/titleBox";
  27 + import horizList from "@/components/horizList/horizList";
  28 +
  29 + export default {
  30 + data: function () {
  31 + return {
  32 +
  33 + }
  34 + },
  35 + props: ["styles"],
  36 + components: {
  37 + titleBox,
  38 + horizList
  39 + },
  40 + methods: {
  41 +
  42 +
  43 + },
  44 + watch: {
  45 +
  46 + /**
  47 + * 监听styles变化
  48 + */
  49 + styles(newVal, oldVal) {
  50 +
  51 + // 设置横向滚动列表样式
  52 + if (this.styles.lists && this.styles.lists.length) {
  53 + this.$set(this.styles.lists, "style", "big-3");
  54 + }
  55 + }
  56 + }
  57 + }
  58 +</script>
  59 +
  60 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  61 +<style rel="stylesheet/less" lang="less">
  62 + @import './style_1';
  63 +</style>
0 \ No newline at end of file 64 \ No newline at end of file
src/components/titleBox/titleBox.less 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +.title-box {
  4 + background-color: transparent;
  5 + width: 100%;
  6 + height: auto;
  7 + .box {
  8 + position: relative;
  9 + width: 100%;
  10 + height: auto;
  11 + .title-img-box {
  12 + width: 100%;
  13 + height: auto;
  14 + .title-img {
  15 + display: block;
  16 + width: 100%;
  17 + height: auto;
  18 + }
  19 + }
  20 + .more-box {
  21 + position: absolute;
  22 + top: 0;
  23 + right: 20px;
  24 + display: flex;
  25 + justify-content: center;
  26 + align-items: center;
  27 + width: auto;
  28 + height: 100%;
  29 + .more-text {
  30 + color: #999999;
  31 + font-size: 26px;
  32 + }
  33 + .more-arrow-right-img {
  34 + display: block;
  35 + width: 26px;
  36 + height: 26px;
  37 + }
  38 + }
  39 + }
  40 +}
0 \ No newline at end of file 41 \ No newline at end of file
src/components/titleBox/titleBox.vue 0 → 100644
  1 +<template>
  2 + <div class="title-box" v-if="titles">
  3 + <div class="box">
  4 + <div class="title-img-box">
  5 + <img :src="titles.title" class="title-img" mode="widthFix" />
  6 + </div>
  7 + <div class="more-box" @click="more(titles.more)">
  8 + <div class="more-text">更多</div>
  9 + <img class="more-arrow-right-img" src="static/img/icon_arrow_right.png" />
  10 + </div>
  11 + </div>
  12 + </div>
  13 +</template>
  14 +
  15 +<script>
  16 + export default {
  17 + data: function () {
  18 + return {
  19 +
  20 + }
  21 + },
  22 + props: ["titles"],
  23 + methods: {
  24 +
  25 + /**
  26 + * 更多
  27 + * @param {object} item [数据对象]
  28 + */
  29 + more(item) {
  30 + this.$emit("more", item);
  31 + }
  32 + }
  33 + }
  34 +</script>
  35 +
  36 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  37 +<style rel="stylesheet/less" lang="less">
  38 + @import './titleBox';
  39 +</style>
0 \ No newline at end of file 40 \ No newline at end of file
src/pages/com/com.less 0 → 100644
  1 +@charset "UTF-8";
  2 +
  3 +.com {
  4 +
  5 +}
0 \ No newline at end of file 6 \ No newline at end of file
src/pages/com/com.vue 0 → 100644
  1 +<template>
  2 + <div class="index-box">
  3 +
  4 +
  5 + <!-- style_1组件 -->
  6 + <style-1
  7 + :styles="style1">
  8 + </style-1>
  9 +
  10 +
  11 +
  12 +
  13 +
  14 +
  15 +
  16 +
  17 +
  18 + </div>
  19 +</template>
  20 +
  21 +<script>
  22 +
  23 + // 引入组件
  24 + import { Toast, Indicator } from "mint-ui";
  25 + import style1 from "@/components/style_1/style_1";
  26 +
  27 +
  28 +
  29 +
  30 +
  31 + export default {
  32 + data () {
  33 + return {
  34 + title: "",
  35 + style1: {
  36 + titles: {
  37 + title: "static/img/title.png",
  38 + more: {
  39 + haveMore: true
  40 + }
  41 + },
  42 + banner: "static/img/banner-02.jpg",
  43 + lists: {
  44 + list: []
  45 + }
  46 + },
  47 +
  48 +
  49 +
  50 +
  51 +
  52 +
  53 +
  54 + }
  55 + },
  56 + components: {
  57 + style1,
  58 +
  59 +
  60 +
  61 + },
  62 + created() {
  63 +
  64 + // 设置标题
  65 + this.$set(this, "title", "aabb");
  66 +
  67 +
  68 +
  69 +
  70 +
  71 +
  72 + },
  73 + methods: {
  74 +
  75 + /**
  76 + * 更多
  77 + * @param {object} item [数据对象]
  78 + */
  79 + more(item) {
  80 +
  81 +
  82 + console.log("more", item);
  83 +
  84 +
  85 +
  86 + },
  87 +
  88 +
  89 +
  90 +
  91 +
  92 +
  93 +
  94 + },
  95 + head: {
  96 + title () {
  97 + return {
  98 + inner: this.title
  99 + }
  100 + }
  101 + },
  102 + watch: {
  103 +
  104 + // 设置页面标题
  105 + title(newVal) {
  106 + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") {
  107 + this.$iFrame.insertIFrame(newVal);
  108 + } else {
  109 + this.$emit("updateHead");
  110 + }
  111 + }
  112 + },
  113 + mounted() {
  114 +
  115 + }
  116 + }
  117 +</script>
  118 +
  119 +<!-- Add "scoped" attribute to limit CSS to this component only -->
  120 +<style rel="stylesheet/less" lang='less' scoped>
  121 + @import "com";
  122 +</style>
src/router/index.js
@@ -16,17 +16,17 @@ const router = new Router({ @@ -16,17 +16,17 @@ const router = new Router({
16 }, 16 },
17 redirect: "/index", 17 redirect: "/index",
18 children: [ 18 children: [
19 - // {  
20 - // // 首页  
21 - // path: "/index",  
22 - // name: "index",  
23 - // component: resolve => {  
24 - // require(["@/pages/index/index"], resolve);  
25 - // },  
26 - // meta: {  
27 - // requireAuth: false  
28 - // }  
29 - // } 19 + {
  20 + // 组件测试
  21 + path: "/com",
  22 + name: "com",
  23 + component: resolve => {
  24 + require(["@/pages/com/com"], resolve);
  25 + },
  26 + meta: {
  27 + requireAuth: false
  28 + }
  29 + }
30 ] 30 ]
31 }, 31 },
32 { 32 {
static/img/1.png 0 → 100644

14.3 KB

static/img/11.jpg 0 → 100644

21.4 KB

static/img/12.jpg 0 → 100644

9.75 KB

static/img/13.jpg 0 → 100644

9.01 KB

static/img/14.jpg 0 → 100644

9.67 KB

static/img/15.jpg 0 → 100644

9.46 KB

static/img/2.png 0 → 100644

8.54 KB

static/img/21.jpg 0 → 100644

9.38 KB

static/img/22.jpg 0 → 100644

10.2 KB

static/img/23.jpg 0 → 100644

8.79 KB

static/img/24.jpg 0 → 100644

10.1 KB

static/img/25.jpg 0 → 100644

18 KB

static/img/3.png 0 → 100644

14.3 KB

static/img/4.png 0 → 100644

14.5 KB

static/img/5.png 0 → 100644

11.7 KB

static/img/6.png 0 → 100644

14.1 KB

static/img/7.png 0 → 100644

15.3 KB

static/img/8.png 0 → 100644

14 KB

static/img/9.png 0 → 100644

13.9 KB

static/img/back.jpg deleted 100644 → 0

2.03 KB

static/img/banner-01.jpg 0 → 100644

64.2 KB

static/img/banner-02.jpg 0 → 100644

53.7 KB

static/img/banner-03.jpg 0 → 100644

38.8 KB

static/img/icon_add.png 0 → 100644

1.73 KB

static/img/icon_arrow_right.png

359 Bytes | W: | H:

327 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
static/img/icon_group.png 0 → 100644

1.41 KB

static/img/icon_layer_bottom_close.png deleted 100644 → 0

1.55 KB

static/img/icon_share.png deleted 100644 → 0

830 Bytes

static/img/icon_share_white.png deleted 100644 → 0

657 Bytes

static/img/icon_swiper_1.png 0 → 100644

3.36 KB

static/img/icon_swiper_2.png 0 → 100644

3.51 KB

static/img/pic_1.jpg

22.9 KB | W: | H:

11.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
static/img/pic_2.jpg 0 → 100644

14.1 KB

static/img/pic_3.jpg 0 → 100644

15.5 KB

static/img/share.jpg deleted 100644 → 0

2.1 KB

static/img/title.png 0 → 100644

5.84 KB

static/img/title2.png 0 → 100644

5.6 KB

static/img/更多.png 0 → 100644

7.72 KB