huanggang před 7 roky
rodič
revize
d22bf79472

+ 1 - 0
src/components/blocks/block_list.vue

@@ -82,6 +82,7 @@
                     _self.proxy.setTag("HOT_ID", this.hot_id);
                     _self.proxy.setTag("BRAND_ID", this.brand_id);
                     _self.proxy.setTag("WORDS", this.keyword);
+
                     this.$store.commit('updateLoadingStatus', {isLoading: false});
 
 

+ 59 - 5
src/components/blocks/goods_item.vue

@@ -12,7 +12,7 @@
                     <div class="price_box" v-if="summery['act_type'] == 0">
                         <div class="bonus_price"><span class="symbols">¥</span>{{summery["bonus_price"]}}</div>
                         <div class="price_desc">
-                            <span class="f_left">专柜价{{summery["goods_price"]}}</span>
+                            <span class="f_left">天猫价&nbsp;{{summery["goods_price"]}}</span>
                             <span class="f_right">红包抵{{conserve}}元</span>
                         </div>
                     </div>
@@ -20,8 +20,18 @@
                     <div class="price_box" v-if="summery['act_type'] == 1">
                         <div class="bonus_price"><span class="symbols">¥</span>{{parseFloat(getgroupbuy.promotion_price)}}</div>
                         <div class="price_desc">
-                            <span class="f_left">专柜价{{summery["goods_price"]}}</span>
-                            <span class="f_right">仅剩{{grouptime}}天</span>
+                            <span class="f_left">天猫价&nbsp;{{summery["goods_price"]}}</span>
+                            <span class="f_right" v-if="less_one_day">仅剩{{grouptime}}</span>
+                            <span class="f_right" v-else>{{count_h_m_s}}</span>
+                        </div>
+                    </div>
+
+                    <div class="price_box" v-if="summery['act_type'] == 2">
+                        <div class="bonus_price"><span class="symbols">¥</span>{{summery["goods_promotion_price"]}}</div>
+                        <div class="price_desc">
+                            <span class="f_left">天猫价&nbsp;{{summery["goods_price"]}}</span>
+                            <span class="f_right" v-if="less_one_day">仅剩{{limitTime}}</span>
+                            <span class="f_right" v-else>{{limit_count_h_m_s}}</span>
                         </div>
                     </div>
 
@@ -40,7 +50,10 @@
             return {
                 summery:this.proxy.getSummery(this.item.data),
                 groupbuy:this.getGroupbuy,
-                defaultImg:DefaultImg
+                defaultImg:DefaultImg,
+                count_h_m_s:'',
+                less_one_day:true,
+                limit_count_h_m_s:''
             }
         },
         components:{
@@ -50,6 +63,28 @@
         },
 
         props:['item','proxy'],
+        methods:{
+            group_count(endtime){
+                let _self = this;
+                setInterval(function(){
+                    let count_time = parseInt(endtime-(new Date().getTime()/1000));
+                    let h = Math.floor(count_time/60/60%24) < 10?'0'+ Math.floor(count_time/60/60%24):Math.floor(count_time/60/60%24);
+                    let m = Math.floor(count_time/60%60) < 10?'0'+Math.floor(count_time/60%60):Math.floor(count_time/60%60);
+                    let s = Math.floor(count_time%60) < 10?'0'+Math.floor(count_time%60):Math.floor(count_time%60);
+                    _self.count_h_m_s = h + ':' + m + ':' + s;
+                },1000);
+            },
+            limit_count(endtime){
+                let _self = this;
+                setInterval(function(){
+                    let count_time = parseInt(endtime-(new Date().getTime()/1000));
+                    let h = Math.floor(count_time/60/60%24) < 10?'0'+ Math.floor(count_time/60/60%24):Math.floor(count_time/60/60%24);
+                    let m = Math.floor(count_time/60%60) < 10?'0'+Math.floor(count_time/60%60):Math.floor(count_time/60%60);
+                    let s = Math.floor(count_time%60) < 10?'0'+Math.floor(count_time%60):Math.floor(count_time%60);
+                    _self.limit_count_h_m_s = h + ':' + m + ':' + s;
+                },1000);
+            }
+        },
         computed:{
             getgroupbuy(){
                    return this.proxy.getGroupbuy(this.summery["act_id"]);
@@ -59,7 +94,26 @@
                 let endtime = groupbuygoods["end_time"];
                 let localtime = new Date().getTime()/1000;
                 let surplustime = parseInt((endtime-localtime)/60/60/24);
-                return surplustime;
+                if(surplustime <= 0) {
+                    this.less_one_day = false;
+                    this.group_count(endtime);
+                }
+                else {
+                    return surplustime+'天';
+                }
+            },
+            limitTime(){
+                let limitbuygoods = this.proxy.getLimitTime(this.summery["act_id"]);
+                let endtime = limitbuygoods["end_time"];
+                let localtime = new Date().getTime()/1000;
+                let surplustime = parseInt((endtime-localtime)/60/60/24);
+                if(surplustime <= 0) {
+                    this.less_one_day = false;
+                    this.limit_count(endtime);
+                }
+                else {
+                    return surplustime+'天';
+                }
             },
             discount(){
                 let discount;

+ 59 - 42
src/components/blocks/goods_top.vue

@@ -3,28 +3,19 @@
         <router-link :to="{ path: '/goods_detail', query: { goods_id: goods['goods_id'] }}">
             <div class="goods">
                 <flexbox>
-                    <flexbox-item>
+                    <flexbox-item :span="4">
                         <img :src="item.image" style="width: 285px;max-height:285px;min-height: 285px;margin-left: 25px;">
                     </flexbox-item>
-                    <flexbox-item style="text-align: left;">
-                        <p class="top_goods_title">{{item.title}}</p>
-                        <div class="stars">
-                            <x-icon type="ios-star" size="30" v-for="i in stars" style="color: red;"></x-icon>
-                        </div>
+                    <flexbox-item :span="7" style="text-align: left;margin-left: 40px;">
+                        <p class="goods_brand_name">{{goods.brand_name}}</p>
+                        <p class="goods_mobile_name">{{goods_name}}</p>
                         <div class="price_box" v-if="goods['act_type'] == 0">
-                            <div class="f_left">
-                                <p class="text_left bonus_price">¥{{goods["bonus_price"]}}<span></span></p>
-                                <p class="text_left desc"><span><s></s>专柜价{{goods["goods_price"]}}</span></p>
-                            </div>
-                            <!--<div class="f_right discount">-->
-                                <!--<p class="discounts_box"><span class="discounts">{{discount}}</span></p>-->
-                                <!--<p class="conserve">立省{{(goods["goods_price"] - goods["bonus_price"]).toFixed(2)}}元</p>-->
-                            <!--</div>-->
+                            <p class="desc bonus_price">¥{{goods["bonus_price"]}}<span class="tm_price"><s></s>天猫价{{parseFloat(goods["goods_price"])}}</span></p>
                         </div>
                         <div class="price_box" v-if="goods['act_type'] == 1">
                             <div class="f_left">
                                 <p class="bonus_price">¥{{goods["goods_promotion_price"]}}</p>
-                                <p class="text_left desc"><span><s></s>专柜价{{goods["goods_price"]}}</span><span class="f_right">仅剩{{grouptime}}天</span></p>
+                                <p class="text_left desc"><span><s></s>天猫价{{goods["goods_price"]}}</span><span class="f_right">仅剩{{grouptime}}天</span></p>
                             </div>
                         </div>
                     </flexbox-item>
@@ -33,6 +24,7 @@
             </div>
             <div class="top_bg"><img :src="attrs.image"></div>
         </router-link>
+        <div class="br"></div>
     </div>
 </template>
 <script>
@@ -47,6 +39,8 @@
         },
         computed:{
             attrs(){
+//               console.log(this.item);
+               console.log(this.proxy.getSummery(this.item.show_data));
                let attrArray = this.item.reserved.split('#');
                let attrs = {};
                for(let i = 0;i<attrArray.length;i++) {
@@ -57,7 +51,18 @@
                 return attrs;
             },
             goods(){
-                return this.proxy.getSummery(this.item.data);
+                return this.proxy.getSummery(this.item.show_data);
+            },
+            goods_name(){
+                let datas = this.proxy.getSummery(this.item.show_data);
+                let brand =  datas.brand_name;
+                try {
+                    return datas.goods_mobile_name.replace(brand,'');
+                }
+                catch(e){
+                    return datas.goods_mobile_name;
+                }
+
             },
             discount(){
                 let discount;
@@ -99,7 +104,9 @@
     }
 </script>
 <style scoped>
-
+    .goods {
+        margin-bottom: 38px;
+    }
     .top_bg {
         position: absolute;
         top: 10px;
@@ -108,34 +115,29 @@
         height: 25px;
     }
     .letter_info {
+        background: #F7F7F7;
         position: relative;
-        width: 660px;
+        width: 710px;
         margin:0 auto;
-        padding: 20px 0;
+        padding: 12px 20px;
         text-align: justify;
-    }
-    .letter_info:before {
-        content: '';
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 0;
-        border-bottom: 1px dashed #c1c1c1;
-        z-index: 100;
+        color: #000000;
+        box-sizing: border-box;
+        border-radius: 10px;
+        line-height: 1.3;
     }
     .letter_info span {
-        color: #bebebe;
+        color: #5E5E5E;
     }
-    .top_goods_title {
-        font-size: 28px;
+    .goods_mobile_name {
+        font-size: 32px;
         width: 100%;
         text-overflow: ellipsis;
         white-space: nowrap;
         overflow: hidden;
+        color: #333333;
     }
     .price_box {
-        margin-right: 50px;
         margin-top: 30px;
     }
     .stars {
@@ -144,20 +146,35 @@
    .vux-x-icon {
        color: red;
    }
-    .desc {
+    .desc .tm_price {
         color: #bebebe;
-        font-size: 20px;
-        width: 320px;
+        font-size: 25px;
+        margin-left: 20px;
+        vertical-align: middle;
     }
-    .desc span:first-child {
+    .desc span.tm_price:first-child {
         position: relative;
+        z-index: 2;
     }
-    .desc span:first-child s {
+    .desc span.tm_price:first-child s {
         position: absolute;
-        width: 100%;
-        height: 2px;
+        width: 120%;
+        height: 1px;
         top: 50%;
-        left: 0;
-        background: #bebebe;
+        left: -10%;
+        background: #000000;
+        z-index: 1;
+    }
+    .br {
+        width: 100%;
+        height: 12px;
+        background: #F7F7F7;
+    }
+    .goods_brand_name {
+        font-size: 36px;
+        color: #333333;
+    }
+    .bonus_price {
+        font-size: 38px;
     }
 </style>

+ 6 - 2
src/components/blocks/horizongoods_list.vue

@@ -99,7 +99,7 @@
                 }));
                 pos++;
             });
-
+            let bg_data = this.special['bg_data'];
             let div = createElement(
                 "div",
                 {
@@ -118,7 +118,11 @@
                 },
                 ret);
 
-            return createElement(Scroller, {}, [div]);
+            return createElement(Scroller, {
+                props: {
+                    bg_data:bg_data
+                }
+            }, [div]);
         }
     }
 

+ 1 - 1
src/components/blocks/swiper_list.vue

@@ -31,7 +31,7 @@
                 return SwiperList;
             },
             scale(){
-                return 750 / parseFloat(this.special.scale)+'px' ;
+                return 750 / parseFloat(this.special.scale)+'px';
             },
             posId(){
                 return 'special'+this.pos;

+ 35 - 0
src/components/blocks/ugc_list.vue

@@ -0,0 +1,35 @@
+<template>
+    <div class="ugc_list">
+        <div class="ugc_item">
+            <a :href="item.data">
+                <p class="ugc_item_title">{{item.title}}</p>
+                <div>
+                    <img :src="item.image">
+                </div>
+            </a>
+        </div>
+    </div>
+</template>
+<script>
+    export default {
+        props: ['item', 'proxy'],
+        data () {
+            return {}
+        },
+        components: {}
+    }
+</script>
+<style scoped>
+    .ugc_item {
+        background: #fff;
+    }
+    .ugc_item_title {
+        padding-left: 30px;
+        font-size: 32px;
+        height: 84px;
+        line-height: 84px;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+    }
+</style>

+ 5 - 0
src/components/blocks/util/blockUtil.js

@@ -20,6 +20,7 @@ import HomeGrid from '../HomeGrid.vue'
 import Brand from '../brand.vue'
 import FCode from '../fcode.vue'
 import GoodsTop from '../goods_top.vue'
+import UgcList from '../ugc_list.vue'
 class BlockUtil {
     static createBlockComp(createElement, special, proxy, pos) {
         let comp;
@@ -114,6 +115,10 @@ class BlockUtil {
                 case "goods_top":
                     comp = createElement(GoodsTop,params);
                     break;
+                case "ugc":
+                    comp = createElement(UgcList,params);
+                    console.log(params);
+                    break;
                 default:
                     comp = createElement('div', '类型:'+special['item_type']+'找不到');
                     break;

+ 16 - 3
src/components/blocks/util/proxy.js

@@ -9,10 +9,11 @@ class Proxy {
         this.specialList = [];
         this.data = {};
         this.tabs = [];
+        this.limitTime = [];
         this.tags = new Map();
     }
 
-    addData(json,is_init) {
+    addData(json, is_init) {
         this.specialList = this.specialList.concat(json.special_list);
         this.cartList = this.cartList.concat(json.cart_list);
         this.bundlingList = this.bundlingList.concat(json.bundling);
@@ -20,6 +21,7 @@ class Proxy {
         this.groupBuyList = this.groupBuyList.concat(json.groupbuy);
         this.fcodeList = this.fcodeList.concat(json.fcodes);
         this.tabs = json.tabs;
+        this.limitTime = json.limitime;
     }
 
     restoreData(text) {
@@ -33,8 +35,8 @@ class Proxy {
         this.fcodeList = this.fcodeList.concat(json.fcodeList);
     }
 
-    hasAnchors(){
-        if(!this.tabs) {
+    hasAnchors() {
+        if (!this.tabs) {
             return false;
         }
         return this.tabs.length > 0;
@@ -115,6 +117,15 @@ class Proxy {
         }
     }
 
+    getLimitTime(xianshi_id) {
+        for (let i = 0; i < this.limitTime.length; i++) {
+            let LimitTime = this.limitTime[i];
+            if (LimitTime['xianshi_id'] == xianshi_id) {
+                return LimitTime;
+            }
+        }
+    }
+
     getFcode(fcode_id) {
         for (let i = 0; i < this.fcodeList.length; i++) {
             let fode = this.fcodeList[i];
@@ -126,6 +137,8 @@ class Proxy {
 
 }
 
+
+
 export default Proxy
 
 

+ 8 - 2
src/components/comps/scroller.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="scroller_list ::-webkit-scrollbar">
+    <div class="scroller_list ::-webkit-scrollbar" :style='"background:url("+bg_data+");background-size:100% 100%;"'>
         <slot></slot>
     </div>
 </template>
@@ -8,6 +8,12 @@
         data () {
             return {}
         },
+        props:['bg_data'],
+        computed:{
+            background(){
+
+            }
+        },
         components: {}
     }
 </script>
@@ -16,7 +22,7 @@
         width: 100%;
         overflow-y: hidden;
         -webkit-overflow-scrolling: touch;
-        background: #fff;
+        background: red;
     }
 
     .scroller_list::-webkit-scrollbar {

+ 1 - 1
src/components/confirm_order/confirm_order.vue

@@ -36,7 +36,7 @@
                             <p>{{goods.goods_mobile_name}}</p>
                             <p style="margin: 20px 0 40px 0;" class="letter_pro">{{goods.goods_spec}}</p>
                             <p><span class="letter_warn" style="margin-right: 10px; font-size: 30px;">¥{{goods.act_type == 0?goods.bonus_price:goods.goods_promotion_price}}</span><span
-                                    class="letter_pro">专柜价{{goods.goods_price}}</span></p>
+                                    class="letter_pro">天猫价{{goods.goods_price}}</span></p>
                         </flexbox-item>
                         <flexbox-item style="text-align: right;">
                             <span class="letter_pro">x{{goods.goods_num}}</span>

+ 6 - 4
src/components/goods/goods_detail.vue

@@ -22,15 +22,15 @@
                     <p>{{getOneSummary.goods_jingle}}</p>
                 </div>
                 <div class="bonus_price">
-                    <span>¥{{getOneSummary['act_type'] !== 1?getOneSummary.bonus_price:datas['groupbuy'][0]['promotion_price']}}</span>
-                    <span class="goods_price">专柜价&nbsp;{{getOneSummary.goods_price}}</span>
+                    <span>¥{{getOneSummary['act_type'] == 0?getOneSummary.bonus_price:getOneSummary['goods_promotion_price']}}</span>
+                    <span class="goods_price">天猫价&nbsp;{{getOneSummary.goods_price}}</span>
                 </div>
                 <div class="goods_desc">
-                    <span v-if="getOneSummary['act_type'] !== 1">红包抵{{(getOneSummary.goods_price - getOneSummary.bonus_price).toFixed(2)}}元&nbsp;/</span>
+                    <span v-if="getOneSummary['act_type'] == 0">红包抵{{(getOneSummary.goods_price - getOneSummary.bonus_price).toFixed(2)}}元&nbsp;/</span>
                     <span>已售{{getOneSummary.goods_salenum}}件&nbsp;/&nbsp;库存{{getOneSummary.goods_storage}}件</span>
                 </div>
             </div>
-            <div style="overflow: hidden; padding-left: 25px;" v-if="getOneSummary['act_type'] !== 1">
+            <div style="overflow: hidden; padding-left: 25px;" v-if="getOneSummary['act_type'] == 0">
                 <p style="color: #a7a7a7; padding: 16px 0; float: right; width: 726px;" class="vux-1px-b">{{getOneSummary.gap_desc}}</p>
             </div>
             <div style="overflow: hidden; padding-left: 25px;" v-if="getOneSummary['is_fcode']">
@@ -622,6 +622,8 @@
     }
     .goods_html {
         margin-bottom: 101px;
+        width: 750px;
+        overflow: hidden;
     }
     .weui-cells {
         margin-top: 0;

+ 1 - 1
src/components/main/shop-car/shopping_cart.vue

@@ -223,7 +223,7 @@
                     quantity = 1;
                     this.$vux.confirm.show({
                         content: '确认删除?',
-                        onHide () {
+                        onConfirm () {
                             _self.$http.jsonp(Api.shoppingCartEdit(0, cart.cart_id),{_timeout:5000}).then(function (res) {
                                 if (res.body.message == '成功') {
                                     let cart_item = cart;

+ 1 - 1
src/components/special/special_list.vue

@@ -86,7 +86,7 @@
                     DebugUtil.log("special_list","getNewData 1");
                     this.url = Api.host() + '/mobile/index.php?act=search&op=index&client_type=ajax&title=' + title;
                     for (let i in params) {
-                        if (params[i] !== 'undefined') {
+                        if (params[i]) {
                             this.url += "&" + i + '=' + params[i] + "";
                         }
                     }