zhaojs
2023-07-14 7abb8b4ea79b96e52acfde0cfaee98989469cb36
public/html/compareprice.html
@@ -295,15 +295,34 @@
    * {
        box-sizing: border-box;
    }
    .loading{
        display: flex;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgb(0 0 0 / 67%);
        top: 0;
        left: 0;
        z-index: 10;
        justify-content: center;
        align-items: center;
        font-size: .35rem;
        color: #fff;
        }
        .showshop
        {
            font-size: .28rem;
            color: #787070;
            margin-top: 0.15rem;
        }
    </style>
</head>
<body style="background: #f5f5f9;">
    <div id="comprice">
        <div v-if="loading" class="loading">加载中...</div>
        <image class="top-content" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/compareprice_topimg.png"></image>
        <div class="main-content">
            <div class="mid-content">
                <div class="mid-content-con">
                    <div class="content-tip" v-on:click="clear()">
@@ -314,13 +333,13 @@
                        <span class="copytxt" v-on:click="fromcopy()">粘贴</span>
                    </div>
                    <div class="mid-button-content">
                        <div class="mid-button-content-img">
                        <div class="mid-button-content-img" v-on:click="search()">
                            <image style="width: 100%;" src="https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/compareprice_search.png"></image>
                        </div>
                    </div>
                </div>
                <div class="cont-title">
                    查询排行
                    {{showTxt}}
                </div>
                    <div v-if="goodsItem.length==0" class="mid-content-none">
                        暂无数据~
@@ -328,21 +347,22 @@
                    <div v-else class="ulist">
                        <a v-for="g in goodsItem" :key="g.id" v-on:click="handleCdetailFavorite(g)">
                            <div class="detail___3ZQFW">
                                <img :src="g.pic"
                                <img :src="g.mainPic"
                                    class="fadeIn picture___r4a1j">
                                <div class="choiceInfo___3ZuEa">
                                    <div class="other___2Mv8Q">
                                        <h2>
                                            <div class="shoplabel___1_Nv0"><img
                                                    src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAaCAYAAADIUm6MAAAE60lEQVRYw9WYbVBUVRjHz+gH/OCHdCY/WE1OGTNWU40ibIqSE6IGZpoGgrGUyAjrYkrI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Sv1ZBE2KgPUcVLICoBosbDTn0MKFyktQTYfVC0zNk+njEoer9OQJKy4Io+7FSfB8tY/5hpc+HefYnZexgiAsQ8Fw3rt0pMRZVoX++Q8QclRtw3+i1kFhvaZr2JbUV+voqnh2DixTgo3yBHVIDvj0Lf0fjFeUiYJusS4MZNmFoCvfTcC7HwrS5+pwFGpIq+aqNoC8sNH89byJgt42ejoVK/7Xez/eoqeg6GnlEGx/Vh6N59mL8cnnzNPN8zCsnxou8Y2HfM68/6Yolbu0XGN90wxg5PRAmj7fJgmpvly15zQdOfEuu+A9fq4bY+8l68Ar2H+dVX9IikhccjIXUW/PgTRE6QcSC841u0QWCbA7/VQO8RMm8ZDwdOQP94THV6RMKUEqi/1famrDwNUdaA9RXdBrjpNgAzA/HXvHhME2iu+0D/uNbiuw+EXsPgmeH+PBXdVg9uRVeLk64WhAiN5T8i6PpORUh4KF3CXYT0xyDch/7tEGxcsP5tzHcJdxESrv+3EhIeSucwJ53C3HTqx/+TMDedw5yepv8GV1+TBUuIRhcAAAAASUVORK5CYII=">
                                                    :src="g.labelImg">
                                            </div>
                                            <span>{{g.title}}</span></h2>
                                        <div class="coupon___2SVZi" style="float: left; margin-right:10px"><span>券</span>{{g.quanJine}}元</div>
                                        <div v-if="g.couponPrice" class="coupon___2SVZi" style="float: left; margin-right:10px"><span>券</span>{{g.couponPrice}}元</div>
                                        <div class="coupon___2SVZi" style="background: #A429F3;"><span style="color: #A429F3;">返</span>{{g.fanli}}元</div>
                                        <div class="showshop">{{g.shopName}}</div>
                                    </div>
                                    <div class="price___dfbCD">¥<span>{{g.jiage}}</span><u style="text-decoration:line-through">聚划算价 ¥{{g.yuanjia}}</u></div>
                                    <div class="price___dfbCD">¥<span>{{g.actualPrice}}</span><u style="text-decoration:line-through">¥{{g.originalPrice}}</u></div>
                                    <div class="operation___3KazI">
                                        <button>马上抢</button>
                                        <button>立即购买</button>
                                    </div>
                                </div>
                            </div>
@@ -384,20 +404,75 @@
        el: '#comprice',
        data:{
          //posturl:'http://dfg.shop.com',
          posturl:'https://appapitest.ushopvip.com',
          posturl:'http://appapitest.ushopvip.com',
          //posturl:'http://dfgapp.ushopvip.com',
          goodsItem:[],
          loading:false,
          txtareatxt:'',
          showTxt:'猜你喜欢',
          txtplaceholder:'1、支持淘宝、天猫、京东、抖音、拼多多等多家电商 \r\n 2、请粘贴您需要转换的分享文案/链接和口令/商品链接;不支持券链接'
        },
        methods:{
            likeDataGet:function(postData)
            //查询
            search:function()
            {
                if(this.txtareatxt=='')
                {
                    return;
                }
                this.showTxt="查询排行";
                this.goodsItem=[];
                var that = this;
                this.loading = true
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    url:this.posturl+'/api/taoke/compare_good',
                    type:"post",
                    dataType:"json",
                    data:{
                        content:that.txtareatxt
                    }
                }).done(function(res){
                    that.loading = false;
                    if(res.code == 0){
                        that.goodsItem=res.data.list;
                    }
                })
            },
            Infoformat: function(info){
                info = info.replace(/\%/g,"%25")
            info = info.replace(/\#/g,"%23")
            info = info.replace(/\&/g,"%26")
            info = info.replace(/\?/g,"%3F")
            return info;
            },
            handleCdetailFavorite:function(item)
            {
                switch(item.sourceType)
                {
                    case "tb":
                        uni.navigateTo({
                            url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=freebuy'
                        });
                        break;
                    default:
                        var itemsStr=this.Infoformat(JSON.stringify(item));
                        uni.navigateTo({
                            url: '/pages/goods/goodsDetail?sourcefrom=compareprice&info=' + itemsStr+'&frompage=compareprice'
                        });
                        break;
                }
            },
            likeDataGet:function(postData)
            {
                var _this=this;
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    url:_this.posturl+'/api/taoke/get_goods_things',
                    type:"post",
                    dataType:"json",
@@ -410,6 +485,7 @@
                        type:1
                    }
                }).done(function(res){
                    _this.goodsItem=res.data.list;
                    console.log(res);                   
                })
            },
@@ -417,7 +493,7 @@
            {
                uni.postMessage({
                    data: {
                        action: 'copy'
                        action: 'getlike'
                    }
                })
            },
@@ -447,30 +523,13 @@
                if(r !=null)return unescape(r[2]);
                 return null;
            },
            getGoodsList: function () {
                var that = this;
                this.loading = true
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    url:this.posturl+'/api/Activity/zsz_goods_list',
                    type:"post",
                    dataType:"json",
                    data:{
                        cid:0,
                        app_key: 'zsccir',
                    }
                }).done(function(res){
                    if(res.code == 0){
                    that.goodsItem = res.data.data.data.list;
                    }
                })
            },
        },
        mounted:function(){
           /*  var postData={
                postData:'OAID',
                deviceValue:''
            };
            this.likeDataGet(postData); */
            var that=this;
            document.addEventListener('UniAppJSBridgeReady', function() {
                that.getLikeGoods();