zhaojs
2023-07-31 34db7035c9c7880e00b9328d022be65a29c62cb2
public/html/compareprice.html
@@ -421,10 +421,14 @@
                                                <img class="shoplabel___1_Nv0" :src="g.labelImg">
                                                {{g.title}}</div></h2>
                                        <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 v-if="isshowfan" class="coupon___2SVZi" style="background: #A429F3;"><span style="color: #A429F3;">返</span>{{g.fanli}}元</div>
                                       
                                    </div>
                                    <div class="price___dfbCD"><span class="price_font" style="font-size: .26rem; font-weight: 500;">到手价</span><span style="padding: 0;">¥</span><span style="padding: 0 .08rem 0 0;">{{(g.actualPrice-g.fanli).toFixed(2)}}</span><u v-if="g.sourceType=='tb'||g.sourceType=='tm'" style="text-decoration:line-through">¥{{g.originalPrice}}</u></div>
                                    <div class="price___dfbCD">
                                        <span class="price_font" style="font-size: .26rem; font-weight: 500;">到手价</span><span style="padding: 0;">¥</span>
                                        <span v-if="isshowfan" style="padding: 0 .08rem 0 0;">{{(g.actualPrice-g.fanli).toFixed(2)}}</span>
                                        <span v-else style="padding: 0 .08rem 0 0;">{{g.actualPrice}}</span>
                                        <u v-if="g.sourceType=='tb'||g.sourceType=='tm'" style="text-decoration:line-through">¥{{g.originalPrice}}</u></div>
                                   <!--  <div class="operation___3KazI">
                                        <button>立即购买</button>
                                    </div> -->
@@ -443,6 +447,7 @@
</html>
<script type="text/javascript" src="./js/vue.js"></script>
<script type="text/javascript" src="./js/md5.js"></script>
<script>
(function () {
@@ -484,6 +489,7 @@
          //posturl:'http://dfgapp.ushopvip.com',
          goodsItem:[],
          loading:false,
          isshowfan:false,
          plat:[
            {
                'platname':'淘宝',
@@ -556,10 +562,9 @@
                        }
                    }
                }
                var header=this.getPostHeader(postData);
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    headers:header,
                    url:'/api/taoke/compare_good',
                    type:"post",
                    dataType:"json",
@@ -582,40 +587,49 @@
            },
            handleCdetailFavorite:function(item)
            {
                switch(item.sourceType)
                if(this.isshowfan)
                {
                    case "tb":
                    case "tm":
                        uni.navigateTo({
                            url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=compareprice'
                        });
                        break;
                    default:
                        var itemsStr=this.Infoformat(JSON.stringify(item));
                        uni.navigateTo({
                            url: '/pages/goods/goodsDetail?sourcefrom=compareprice&info=' + itemsStr+'&frompage=compareprice'
                        });
                        break;
                    switch(item.sourceType)
                    {
                        case "tb":
                        case "tm":
                            uni.navigateTo({
                                url: '/pages/goods/goodsDetail?id=' + item.goodsId+'&frompage=compareprice'
                            });
                            break;
                        default:
                            var itemsStr=this.Infoformat(JSON.stringify(item));
                            uni.navigateTo({
                                url: '/pages/goods/goodsDetail?sourcefrom=compareprice&info=' + itemsStr+'&frompage=compareprice'
                            });
                            break;
                    }
                }
                else{
                    var itemsStr=this.Infoformat(JSON.stringify(item));
                    uni.navigateTo({
                        url: '/pages/goodDetail/index?id=' + item.goodsId+'&info'+itemsStr
                    });
                }
            },
            likeDataGet:function(postData)
            {
                var _this=this;
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    url:'/api/taoke/get_goods_things',
                    type:"post",
                    dataType:"json",
                    async: false,
                    data:{
                var data={
                        deviceType:postData.postData,
                        deviceValue:postData.deviceValue,
                        pageId:1,
                        pageSize:10,
                        type:1
                    }
                    };
                var header=this.getPostHeader(data);
                $.ajax({
                    headers:header,
                    url:'/api/taoke/get_goods_things',
                    type:"post",
                    dataType:"json",
                    async: false,
                    data:data
                }).done(function(res){
                    _this.goodsItem=res.data.list;
                    console.log(res);                   
@@ -655,19 +669,55 @@
                if(r !=null)return unescape(r[2]);
                 return null;
            },
            getPostHeader(data)
            {
                var token=this.getUrlPar("token");
                if(token)
                {
                    return {
                        "token":token
                    }
                }
                else{
                    token=this.getUrlPar("dfgtoken");
                    if(token)
                    {
                        let keysList=Object.keys(data);
                        let enstr="";
                        if(keysList&&keysList.length>0)
                        {
                            let curData=data;
                            keysList.forEach(function(value,index){
                                enstr+=value+ (JSON.stringify(data[value]).replace(/^\"|\"$/g,''));
                            })
                        }
                        enstr="dfg"+enstr+"apph5"+token;
                        enstr=hex_md5(enstr);
                        enstr+='.'+token
                        return {
                            "dfgsessionkey":enstr
                         }
                    }
                }
            }
        },
        mounted:function(){
        /*       var postData={
                postData:'OAID',
                deviceValue:''
            };
            this.likeDataGet(postData);  */
            var that=this;
            document.addEventListener('UniAppJSBridgeReady', function() {
                that.getLikeGoods();
            });
            var token=this.getUrlPar("token");
            if(token)
            {
                this.isshowfan=true;
                var that=this;
                    document.addEventListener('UniAppJSBridgeReady', function() {
                    that.getLikeGoods();
                });
            }
            else{
                var postData={
                    postData:'OAID',
                    deviceValue:''
                 };
                 this.likeDataGet(postData);
            }
        }
    })
</script>