zhaojs
2023-06-09 573ba973d908841a65c21cd2c96049d5c0472be6
public/html/freebuy.html
@@ -22,7 +22,7 @@
    <script type="text/javascript" src="https://public.ffquan.cn/lib/taobaoCode/taobaoCode.js?v=1.2.1"></script>
    <script type="text/javascript" src="https://public.ffquan.cn/lib/clipboard.min.js"></script>
    <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
    <script type="text/javascript" src="https://img.ushopvip.com/js/uni-webview-js.js"></script>
    <title>新人专享</title>
    <script>
        
@@ -345,9 +345,22 @@
            getGoodsList:function(){
                var _this = this;
                this.loading=true;
                alert("进来了")
                alert(this.getUrlPar("token"))
                //判断是否首单
                $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
                    //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:{
                    }
                }).done(function(res){
                    if(res.data=='首单客户')
                    {
                        $.ajax({
                    headers:{
                        "token":this.getUrlPar("token")
                    },
@@ -361,23 +374,38 @@
                        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;
                      }).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'
                                }
                                });
                           }
                        }, 3000 )
                    }
                })
            },
        },
        mounted: function () {
            alert("开始")
            this.getGoodsList();
            var that=this;
            document.addEventListener('UniAppJSBridgeReady', function() {