zhaojs
2023-06-27 0a0d605f68e0f02d518b9106b7433067a18b07c4
public/html/fengqiangbang.html
@@ -29,13 +29,28 @@
        
        var _config = {
            appKey: 'bkuibk',//此处替换成用户appKey
            jumpGoodsUrl: function (items,sourceType,faction) {   //默认直接转链
            jumpGoodsUrl: function (items,sourceType) {   //默认直接转链
                var url='';
                if(sourceType=="jd"||sourceType=="pdd")
                {
                    var itemsStr=Infoformat(JSON.stringify(items));
                    url='/pages/goods/goodsDetail?sourcefrom=fqb&info=' +  encodeURIComponent(itemsStr)
                }
                else{
                    url='/pages/goods/goodsDetail?id=' + items.goodsid
                }
                uni.navigateTo({
                  url: '/pages/goods/goodsDetail?id=' + items.goodsid+"&sourceType="+sourceType+"&faction="+faction
                  url: url
                });
              //  return '/pages/goods/goodsDetail?id=' + items.goodsid; //替换为详细页面的地址
            }
        };
        function Infoformat(info){
            let formatObj = info.replace(/\%/g,"%25")
            formatObj = info.replace(/\#/g,"%23")
            formatObj = info.replace(/\&/g,"%26")
            formatObj = info.replace(/\?/g,"%3F")
            return formatObj;
        }
    </script>
    <style>
        body{
@@ -445,17 +460,36 @@
            console.log(options);
        },
        methods:{
            getItemDetail:function(items)
            {
                var _this = this;
                $.ajax({
                        headers:{
                            "token":_this.getUrlPar("token")
                        },
                        url:_this.posturl+'/api/Activity/fqb_goods_detail',
                        type:"post",
                        dataType:"json",
                        data:{
                            plat:_this.platid,
                            goodsid:items.goodsid
                        }
                    }).done(function(res){
                       _config.jumpGoodsUrl(res.data,_this.platid);
                    })
            },
            handleCdetailFavorite: function (items) {
                if(_config.jumpGoodsUrl){
                    var faction='t';
                    switch(this.platid)
                    {
                        case "tb":faction='t';break;
                        case "jd":faction="j";break;
                        case "pdd":faction="p";break;
                        case "dy":faction="d";break;
                        case "tb":
                        case "pdd":
                            _config.jumpGoodsUrl(items,this.platid);
                            break;
                        case "jd":
                             this.getItemDetail(items);
                             break;
                    }
                    _config.jumpGoodsUrl(items,this.platid,faction);
                }
                return;
                var params = {