com.vue 6.41 KB
<template>
    <div class="index-box">


        <!-- style_1组件 -->
        <style-7 @more="moreA" @bannerJump="bannerJumpA" @jump=jumpA @addCart=addCartA
            :styles="styleA">
        </style-7>








        
    </div>
</template>

<script>

    // 引入组件
    import { Toast, Indicator } from "mint-ui";
    import style7 from "@/components/style_7/style_7";
    




    export default {
        data () {
            return {
                title: "",
                styleA: {
                    "id": "1567",
                    "simg": "https://wjjtest.ys2.cnliveimg.com/shop/img/2020/03/26/5e7c442f13a41.png",
                    "style": "7",
                    "title": "网家家生鲜",
                    "video": "",
                    "video_img": "",
                    "w": "90",
                    "h": "90",
                    "img": [],
                    "market": {
                        "id": "66",
                        "title": "火锅测试",
                        "icon": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/05/06/5ccfa14759478.png",
                        "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/05/06/5ccfa14a3c3fe.jpg",
                        "pid": "4",
                        "type": "13",
                        "to": "66",
                        "shop_type": "",
                        "goods": [
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            },
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            },
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            },
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            },
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            },
                            {
                                "id": "9520377",
                                "title": "测试优惠劵",
                                "simg": "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/04/29/5cc5e6f49256e.png",
                                "price": "120.00",
                                "shop_type": "1"
                            }
                        ]
                    }
                },
                






            }
        },
        components: {
            style7,



        },
        created() {

            // 设置标题
            this.$set(this, "title", "aabb");

            




        },
        methods: {

            /**
             * 更多A
             * @param {object} item [数据对象]
             */
            moreA(item) {
                

                console.log("moreA", item);
                


            },

            /**
             * Banner跳转A
             * @param {object} item [数据对象]
             */
            bannerJumpA(item) {
                
                // 判断并调用通用跳转
                if (typeof this.$parent.gotoDetail === "function") {
                    this.$parent.gotoDetail(item);
                }
            },

            /**
             * 跳转A
             * @param {object} item [数据对象]
             */
            jumpA(item) {
                

                console.log("jumpA", item);
                


            },

            /**
             * 加入购物车A
             * @param {object} item [数据对象]
             */
            addCartA(item) {
                

                console.log("addCartA", item);
                


            },

            /**
             * 更多B
             * @param {object} item [数据对象]
             */
            moreB(item) {
                

                console.log("moreB", item);
                


            },

            /**
             * 跳转A
             * @param {object} item [数据对象]
             */
            jumpB(item) {
                

                console.log("jumpA", item);
                


            },

            /**
             * 加入购物车A
             * @param {object} item [数据对象]
             */
            addCartB(item) {
                

                console.log("addCartA", item);
                


            },





        },
        head: {
            title () {
                return {
                    inner: this.title
                }
            }
        },
        watch: {

            // 设置页面标题
            title(newVal) {
                if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") {
                    this.$iFrame.insertIFrame(newVal);
                } else {
                    this.$emit("updateHead");
                }
            }
        },
        mounted() {
            
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang='less' scoped>
    @import "com";
</style>