zhaojs
2023-06-09 a008c1b65662ebe6af3fea4ff0c103655705809f
public/html/freebuy.html
@@ -345,39 +345,68 @@
            getGoodsList:function(){
                var _this = this;
                this.loading=true;
                alert("进来了")
                alert(this.getUrlPar("token"))
                //判断是否首单
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                        "token":_this.getUrlPar("token")
                    },
                    //url:'http://dfg.shop.com/index.php/api/taoke/get_first_free_goods',
                   //url:'http://dfgapp.ushopvip.com/api/taoke/get_first_free_goods',
                   url:'http://appapitest.ushopvip.com/api/taoke/get_first_free_goods',
                    //url:'http://dfg.shop.com/index.php/api/user/check_isfirst_free',
                   //url:'http://dfgapp.ushopvip.com/api/user/check_isfirst_free',
                   url:'http://appapitest.ushopvip.com/api/user/check_isfirst_free',
                   type:"post",
                    dataType:"json",
                    data:{
                        nineCid:1,
                        page: 1,
                        pageSize:20,
                    }
                }).done(function(res){
                    alert(res)
                    var newlist=[];
                    res.data.list.map(function(r,k){
                        var buprice=r.actualPrice-r.topFanli;
                        if(buprice<=3)
                        {
                            newlist.push(r);
                        }
                    })
                    _this.lists=[].concat(_this.lists,newlist);
                    _this.loading = false;
                    if(res.msg.info==1)
                    {
                        $.ajax({
                            headers:{
                                "token":_this.getUrlPar("token")
                            },
                                //url:'http://dfg.shop.com/index.php/api/taoke/get_first_free_goods',
                            //url:'http://dfgapp.ushopvip.com/api/taoke/get_first_free_goods',
                            url:'http://appapitest.ushopvip.com/api/taoke/get_first_free_goods',
                            type:"post",
                                dataType:"json",
                            data:{
                                nineCid:1,
                                page: 1,
                                pageSize:20,
                            }
                            }).done(function(res){
                                    var newlist=[];
                                    res.data.list.map(function(r,k){
                                        var buprice=r.actualPrice-r.topFanli;
                                        if(buprice<=3)
                                        {
                                            newlist.push(r);
                                        }
                            })
                            _this.lists=[].concat(_this.lists,newlist);
                            _this.loading = false;
                     })
                    }
                    else{
                        alert("您已下过首单,不可再次购买,请浏览其他商品吧~");
                        setTimeout(function(){
                            if(_this.isUniReady)
                            {
                                uni.postMessage({
                                data: {
                                    action: 'back'
                                }
                                });
                           }
                        }, 1000 )
                    }
                })
            },
        },
        mounted: function () {
            alert("开始")
            this.getGoodsList();
            var that=this;
            document.addEventListener('UniAppJSBridgeReady', function() {