admin
2020-06-11 3bc16a1d3afee0d1ba5c39b1415309e1fe2c63a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>快省云发单</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link rel="stylesheet" type="text/css" href="css/base.css" />
        <link rel="stylesheet" type="text/css" href="css/cloudPushOrderManage.css" />
        <script>
            window.onresize = function() {
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
            };
            window.onresize();
        </script>
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <script src="http://img.flqapp.com/resource/js/app2019112217.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
        <link href="css/load.css" rel="stylesheet" />
        <style type="text/css">
            [v-cloak] {
                display: none !important;
            }
        </style>
    </head>
    <body>
        <div id="root">
            <div class="div_header">
                <div class="div_header_title">
                    <div class="div_header_1" @click="selectTab(1)">
                        <p>云发单管理</p>
                    </div>
                    <div class="div_header_mid">
                        <div></div>
                    </div>
                    <div class="div_header_2" @click="selectTab(2)">
                        <p>发单商品库</p>
                    </div>
                </div>
                <div class="div_header_line">
                    <div class="div_header_line_1"></div>
                    <div class="div_header_line_2"></div>
                </div>
            </div>
 
            <!-- 云发单管理 -->
            <div v-if="selectTabType==1" class="div_cloudPushOrderManage" v-cloak>
                <div class="div_top_header">
                    <div class="" style="display: -webkit-flex;">
                        <img :src="userInfo.portrait" class="headPortrait">
                        <div>
                            <div class="nickName">{{userInfo.nickName}}</div>
                            <div v-if="!openState" class="desc">开通云发单,自动分享轻松赚钱</div>
 
                            <div v-else class="desc">
                                开通时间:{{userInfo.openTime}} 剩余<span style="color: #E5005C;font-size: 0.36rem; font-weight: bold;">&nbsp;{{userInfo.countdown}}&nbsp;</span>天
                            </div>
 
                            <div v-if="!openState" class="openPushOrderManage" @click="openCloudPushOrder()">开通</div>
                            <div v-else class="openPushOrderManage">续费</div>
                        </div>
                    </div>
                </div>
                <!-- 云发单管理未登录 -->
                <div v-if="!isWxLogin" class="div_cloudPushOrderManage_notLogin" v-cloak>
                    <div class="div_cloudPushOrderManage_notLogin_content1">
                        <div class="login_wx" @click="loginWX()">
                            <p>登录微信</p>
                        </div>
                        <div class="content1_desc">
                            请先登录微信,微信在线才能发单哦~
                        </div>
                    </div>
 
                    <div class="div_cloudPushOrderManage_notLogin_content2">
                        <div style="display: -webkit-flex; padding-top: 0.45rem;align-items: center;">
                            <img src="img/icon_1.png" class="img1">
                            <img src="img/icon_arrow.png" class="icon_arrow">
                            <img src="img/icon_2.png" class="icon_img">
                            <img src="img/icon_arrow.png" class="icon_arrow">
                            <img src="img/icon_3.png" class="icon_img">
                            <img src="img/icon_arrow.png" class="icon_arrow">
                            <img src="img/icon_4.png" class="icon_img">
                            <img src="img/icon_arrow.png" class="icon_arrow">
                            <img src="img/icon_5.png" class="icon_img">
                        </div>
                        <div style="display: -webkit-flex;color: #666666;font-size: 0.24rem; margin-top: 0.17rem;">
                            <div class="" style="width: 20%; height: 0.24rem; display: -webkit-flex;justify-content: center;align-items: center;">
                                登录微信
                            </div>
                            <div class="" style="width: 20%; height: 0.24rem; display: -webkit-flex;justify-content: center;align-items: center;">
                                激活微信群
                            </div>
                            <div class="" style="width: 20%; height: 0.24rem; display: -webkit-flex;justify-content: center;align-items: center;">
                                选品/采集
                            </div>
                            <div class="" style="width: 20%; height: 0.24rem; display: -webkit-flex;justify-content: center;align-items: center;">
                                选群/朋友圈
                            </div>
                            <div class="" style="width: 20%; height: 0.24rem; display: -webkit-flex;justify-content: center;align-items: center;">
                                自动发单
                            </div>
                        </div>
                    </div>
 
                    <div class="div_cloudPushOrderManage_notLogin_content3">
                        <div style="height: 0.77rem; display: -webkit-flex; align-items: center;">
                            <div style="font-size: 0.26rem;font-weight: bold;color: #2BA245; margin-left: 0.25rem;">
                                云发单
                            </div>
                            <div style="background-color: #2BA245; width: 2px;height: 0.3rem;margin-left: 0.22rem;"></div>
                            <div style="font-size: 0.26rem;color: #000000; margin-left: 0.19rem;">
                                自动群发单/朋友圈发圈
                            </div>
                        </div>
                        <div class="div_image_fmt">
                            <img :src="userInfo.head" class="image_fmt">
                        </div>
 
                    </div>
                </div>
                <!-- 云发单管理已经登录 -->
                <div v-if="isWxLogin" class="div_cloudPushOrderManage_login" v-cloak>
                    <div class="div_cloudPushOrderManage_login_content1">
                        <div style="display: -webkit-flex; justify-content: space-between;">
                            <div>
                                <div style="color:#333333; display:-webkit-flex;font-size: 0.36rem;height: 0.36rem;align-items: center; margin-left: 0.28rem;margin-top: 0.34rem;">
                                    微信已登录
                                </div>
                                <div style="color:#666666; display:-webkit-flex;font-size: 0.3rem;height: 0.3rem;align-items: center; margin-left: 0.28rem;margin-top: 0.22rem;">
                                    {{userInfo.wxName}}
                                </div>
                            </div>
                            <div style="height: 1.54rem;display: -webkit-flex;align-items: center;">
                                <p style="color: #FFFFFF; font-size: 0.24rem; background-color: #2BA245; width: 2rem;height: 0.5rem;border-radius: 0.25rem;display:-webkit-flex;align-items: center;justify-content: center;margin-right: 0.26rem;">
                                    退出登录
                                </p>
                            </div>
                        </div>
                    </div>
 
                    <div class="div_cloudPushOrderManage_login_content2">
                        <div>
                            朋友圈发单
                        </div>
                        <img src="img/icon_off.png">
                    </div>
 
                    <div class="div_cloudPushOrderManage_login_content3">
                        <div class="div_cloudPushOrderManage_login_content3_header">
                            <div>
                                微信群发单
                            </div>
                            <img src="img/icon_refresh.png">
                        </div>
                        <div class="" style="margin-top: 0.2rem; background-color: #FFF3D3; display: -webkit-flex;align-items: center;justify-content: center;margin-left: 0.15rem;margin-right: 0.1rem;">
                            <p style="font-size: 0.24rem;color: #666666; padding-top: 0.25rem;padding-left: 0.25rem;padding-bottom: 0.25rem;padding-right: 0.05rem;">
                                请选择自己为群主的微信群,并把群保存到微信通讯录中,且向“微信群"发送“快省爆款推荐”激活云发单
                                <p>
                        </div>
                        <div class="div_list">
                            <div class="div_item" v-for="(item, index) in dataList">
                                <div style="height: 0.33rem;"></div>
                                <div class="div_item_content">
                                    <div>微信群名称微信群名称微信群名称</div>
                                    <img src="img/icon_off.png">
                                </div>
                            </div>
                        </div>
                        <div style="color: #999999; font-size: 0.22rem;height: 0.22rem;display: -webkit-flex;justify-content: center;align-items: center;margin-top: 0.51rem;">
                            发单建议频率不要过高,以免影响群友
                        </div>
                        <div style="height: 0.33rem;"></div>
                    </div>
                </div>
 
                <div style="height: 0.2rem;"></div>
            </div>
 
            <!-- 发单商品库 -->
            <div v-if="selectTabType==2" class="div_goodsLibrary" v-cloak>
                <div class="div_goodsLibrary_content1">
                    <div>
                        <div style="color: #333333;font-size: 0.34rem;height: 0.34rem; display: -webkit-flex;align-items: center;margin-left: 0.25rem;margin-top: 0.23rem;">
                            自动采集官方推荐
                        </div>
                        <div style="color: #666666;font-size: 0.2rem;height: 0.22rem; display: -webkit-flex;align-items: center;margin-left: 0.25rem;margin-top: 0.14rem;">
                            官方精选1个小时内仅发送一个商品(9:00~21:00)
                        </div>
                    </div>
                    <img v-if="!official" src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"
                     @click="openGFRecomend">
                    <img v-else src="img/icon_on.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"
                     @click="openGFRecomend">
                </div>
 
                <div class="div_goodsLibrary_content2">
                    <div>
                        <div style="color: #333333;font-size: 0.34rem;height: 0.34rem; display: -webkit-flex;align-items: center;margin-left: 0.25rem;margin-top: 0.23rem;">
                            优先发送自选商品
                        </div>
                        <div style="color: #666666;font-size: 0.2rem;height: 0.22rem; display: -webkit-flex;align-items: center;margin-left: 0.25rem;margin-top: 0.14rem;">
                            即选即发,注重质量不追求数量,避免骚扰群友
                        </div>
                    </div>
                    <img v-if="!custom" src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"
                     @click="openFSGoods">
                    <img v-else src="img/icon_on.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"
                     @click="openFSGoods">
                </div>
 
                <div class="div_goodsLibraryList">
                    <div class="div_item_goodsLibrary" v-for="(item, index) in goodsList">
                        
                        <div class="div_goodsBG"> 
                            <img v-bind:src="item.goods.picUrl" class="goodsimg" />
                            <img v-if="item.goods.state==2" src="img/icon_send.png" class="topleftImg">
                            <img v-else-if="item.goods.state==1" src="img/icon_ydown.png" class="topleftImg">
                        </div>
                        
                        <div class="div_item_rightBg">
                            <div class="div_goods_title_bg">
 
                                <img v-if="item.goods.shopType==10" src="img/icon_tb.png">
                                <img v-else-if="item.goods.shopType==11" src="img/icon_tm.png">
                                <img v-else-if="item.goods.shopType==20" src="img/icon_jd.png">
                                <img v-else-if="item.goods.shopType==30" src="img/icon_pdd.png" style="width: 0.81rem;">
                                <img v-else-if="item.goods.shopType==40" src="img/icon_wph.png" style="width: 0.9rem;">
                                <img v-else-if="item.goods.shopType==50" src="img/icon_sn.png" style="width: 1.12rem;">
 
                                <span v-if="item.goods.shopType==30" class="goods_title" style="text-indent: 0.93rem;">{{item.goods.title}}</span>
                                <span v-else-if="item.goods.shopType==40" class="goods_title" style="text-indent: 1.02rem;">{{item.goods.title}}</span>
                                <span v-else-if="item.goods.shopType==50" class="goods_title" style="text-indent: 1.24rem;">{{item.goods.title}}</span>
                                <span v-else class="goods_title">{{item.goods.title}}</span>
                            </div>
                            <div v-if="item.goods.labels" class="div_goods_labels_bg">
                                <div class="div_goods_label1">&nbsp;{{item.goods.labels[0].content}}&nbsp;</div>
                                <div class="div_goods_label2">&nbsp;夏季爆款&nbsp;</div>
                            </div>
                            
                            <div class="div_store_bg">
                                <img v-if="item.goods.shopInfo" src="img/icon_store.png">
                                <div v-if="item.goods.shopInfo">{{item.goods.shopInfo.shopName}}</div>
                            </div>
 
                            <div class="div_coupon_bg">
                                <div v-if="item.goods.shopType!=40&&item.goods.hasCoupon" style="color: white;font-size: 0.24rem;font-weight: bold;width: 0.41rem;height: 0.36rem;background-color: #E5005C;display: flex;align-items: center;justify-content: center;border-radius: 0.06rem 0 0 0.06rem;">
                                    券
                                </div>
                                <div v-else-if="item.goods.shopType==40" style="color: white;font-size: 0.24rem;background-color: #E5005C;border-radius: 0.06rem;">
                                    &nbsp;&nbsp;{{item.goods.discount}}&nbsp;&nbsp;
                                </div>
 
                                <div v-if="item.goods.shopType!=40&&item.goods.hasCoupon" class="coupon_money">&nbsp;¥{{item.goods.couponInfo.amount}}
                                    &nbsp;</div>
 
                                <div class="fanli_title">&nbsp;&nbsp; 返{{item.goods.moneyInfo.fanliMoney}} &nbsp;&nbsp;</div>
                            </div>
 
                            <div class="div_payment_sales_bg">
                                <div>¥</div>
 
                                <div v-if="item.goods.couponPrice">{{item.goods.couponPrice}}</div>
                                <div v-else>{{item.goods.zkPrice}}</div>
 
                                <div>¥{{item.goods.zkPrice}}</div>
                                <div v-if="item.goods.shopType!=40">月销 {{item.goods.salesCount}}</div>
                            </div>
                        </div>
                    </div>
                </div>
 
 
            </div>
 
            <div class="dialogmask_notOpen">
                <div class="dialog">
                    <img src="img/icon_close.png" @click="hiddenDialog()">
                    <div class="dialog_title">未开通提醒</div>
                    <div class="dialog_content">云发单首先要登录微信,且需要购买云发单服务,完成设置后,才会自动发单/发圈。</div>
                    <div class="dialog_commit" @click="pushOpenVip">去开通</div>
                </div>
            </div>
 
            <div class="dialogmask_Tips">
                <div class="dialog">
                    <img src="img/icon_close.png" @click="hiddenDialog()">
                    <div class="dialog_title">官方采集</div>
                    <div class="dialog_content">开启后30分钟内将会进行第一次发单,之后每1个小时发一个商品,你可随时关闭。</div>
                    <div class="dialog_commit" @click="commitAddTxRecord">知道了</div>
                </div>
            </div>
 
            <div class="dialogmask_wx">
                <div class="dialog_wx">
                    <img src="img/icon_close.png" @click="hiddenDialog()">
                    <div class="dialog_title">请使用手机微信扫描登录</div>
                    <div class="">
                        <img :src="qrCodeUrl" style="width: 4.46rem;height: 4.46rem;margin-left: 0.57rem;margin-top: 0.46rem;">
                    </div>
                    <div style="color: #E5005C;font-size: 0.24rem;height: 0.24rem;display: -webkit-flex;align-items: center;justify-content: center;margin-top: 0.2rem;">
                        登录方法
                    </div>
                    <div style="color: #E5005C;font-size: 0.24rem;height: 0.24rem;margin-top: 0.1rem;margin-left: 0.65rem;margin-right: 0.6rem;">
                        方法一:将二维码截图后发送其他手机,再使用手机微信扫一扫登录。<br>
                        方法二:将二维码截图发送至电脑,再用手机扫描二维码登录。
                    </div>
                </div>
            </div>
 
            <div v-show="selectTabType==2" class="loading-more"></div>
        </div>
    </body>
 
    <script src="js/load.js"></script>
 
    <script>
        // "http://api.flqapp.com";
        var host = "http://192.168.1.253:8080";
        var host1 = "http://192.168.1.114:8848";
        var check = null;
        var wId = null;
 
        $(function() {
            var app = new Vue({
                el: '#root',
                data: {
 
                    selectTabType: 1,
                    page: 1,
                    openState: false, // 是否了开通云发单权限
                    isWxLogin: false, // 是否登录了微信
                    circle: false, // 朋友圈-是否开启
                    qrCodeUrl: null,
                    userInfo: {},
                    dataList: [{}, {}],
                    custom: false, // 优先发送自选商品库
                    official: false, // 自动采集官方推荐
                    count: 0,
                    goodsList: [
                        //     {
                        //     goods: {
                        //         shopInfo: {
                        //             shopName: null
                        //         }
                        //     }
                        // },
                    ]
                },
                watch: {
 
                },
                methods: {
                    selectTab: function(type) {
                        if (app.selectTabType == type) return;
                        $('.div_header_line_' + type).css('opacity', '1');
                        $('.div_header_' + type).css('color', '#E5005C');
 
                        $('.div_header_line_' + app.selectTabType).css('opacity', '0');
                        $('.div_header_' + app.selectTabType).css('color', '#000000');
 
                        document.body.scrollTop = document.documentElement.scrollTop = 0;
                        app.selectTabType = type;
                        app.stopMacloginCheck();
                        if (type == 2) { //切换到发单商品库
                            app.page = 1;
                            app.fetchGoodsList();
 
                        }
                    },
 
                    hiddenDialog: function() {
                        $('.dialogmask_notOpen').css('display', 'none')
                        $('.dialogmask_Tips').css('display', 'none')
                        $('.dialogmask_wx').css('display', 'none')
                        app.stopMacloginCheck();
                    },
                    // 开通云发单
                    openCloudPushOrder: function() {
                        yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null);
                    },
                    // 登录微信
                    loginWX: function() {
                        if (app.openState) {
                            app.fetchQrcodeMaclogin();
 
                        } else {
                            yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null);
                        }
                    },
 
                    openGFRecomend: function() {
                        if (app.openState) {
 
 
                        } else {
                            $('.dialogmask_notOpen').css('display', 'block')
                        }
                    },
 
                    openFSGoods: function() {
                        if (app.openState) {
 
 
                        } else {
                            $('.dialogmask_notOpen').css('display', 'block')
                        }
                    },
 
                    pushOpenVip: function() {
                        $('.dialogmask_notOpen').css('display', 'none')
                        yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null);
                    },
 
                    commitAddTxRecord: function() {
 
                    },
 
                    fetchQrcodeMaclogin: function() {
                        yesApp.showLoading();
                        var uid = yesApp.getUid();
                        var params = {
                            uid: uid,
                        };
                        params = yesApp.getRequestBaseParams(params);
                        $.ajax({
                            type: "GET",
                            data: JSON.parse(params),
                            url: host + "/fanli/api/v2/user/cloud/getQrcodeMaclogin",
                            dataType: "jsonp",
                            async: false,
                            success: function(result) {
                                yesApp.hideLoading();
                                if (result.code == 0) {
                                    wid = result.data.wId;
 
                                    app.qrCodeUrl = result.data.qrCodeUrl;
                                    $('.dialogmask_wx').css('display', 'block');
                                    app.setMacloginCheck();
 
                                } else {
                                    yesApp.toast(result.msg);
                                }
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                yesApp.hideLoading();
                                if (textStatus === 'timeout') {
                                    setTimeout(function() {}, 2000);
                                }
                            }
                        });
                    },
 
                    setMacloginCheck: function() {
                        var myVar = setInterval(function() {
                            app.fetchMacloginCheck();
                        }, 3000);
                        check = myVar;
                    },
 
                    fetchMacloginCheck: function() {
                        var uid = yesApp.getUid();
                        var params = {
                            uid: uid,
                            wId: wid
                        };
                        params = yesApp.getRequestBaseParams(params);
                        $.ajax({
                            type: "GET",
                            data: JSON.parse(params),
                            url: host + "/fanli/api/v2/user/cloud/macloginCheck",
                            dataType: "jsonp",
                            async: false,
                            success: function(result) {
                                if (result.code == 0) {
                                    if (result.data.state) {
                                        $('.dialogmask_wx').css('display', 'none');
                                        app.stopMacloginCheck();
                                        app.fetcCloudInfo();
                                    }
 
                                } else {
                                    yesApp.toast(result.msg);
                                }
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                yesApp.hideLoading();
                                if (textStatus === 'timeout') {
                                    setTimeout(function() {}, 2000);
                                }
                            }
                        });
                    },
 
                    stopMacloginCheck: function() {
                        clearInterval(check);
                    },
                    // 云发单开通信息
                    fetcCloudInfo: function() {
                        yesApp.showLoading();
                        var uid = yesApp.getUid();
                        var params = {
                            uid: uid,
                        };
                        params = yesApp.getRequestBaseParams(params);
                        $.ajax({
                            type: "GET",
                            data: JSON.parse(params),
                            url: host + "/fanli/api/v2/user/cloud/getCloudInfo",
                            dataType: "jsonp",
                            async: false,
                            success: function(result) {
                                yesApp.hideLoading();
                                if (result.code == 0) {
                                    if (parseInt(result.data.openState) == 0) {
                                        app.openState = false;
 
                                    } else if (parseInt(result.data.openState) == 1) {
                                        app.openState = true;;
                                    }
                                    app.isWxLogin = result.data.loginState;
                                    app.circle = result.data.circle;
                                    app.userInfo = result.data;
 
                                } else {
                                    yesApp.toast(result.msg);
                                }
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                yesApp.hideLoading();
                                if (textStatus === 'timeout') {
                                    setTimeout(function() {}, 2000);
                                }
                            }
                        });
                    },
 
                    // 发单商品库
                    fetchGoodsList: function() {
                        yesApp.showLoading();
                        var uid = yesApp.getUid();
                        var params = {
                            uid: uid,
                            page: app.page
                        };
                        params = yesApp.getRequestBaseParams(params);
                        $.ajax({
                            type: "GET",
                            data: JSON.parse(params),
                            url: host + "/fanli/api/v2/user/cloud/getGoodsList",
                            dataType: "jsonp",
                            async: false,
                            success: function(result) {
                                yesApp.hideLoading();
                                if (result.code == 0) {
                                    app.custom = result.data.custom;
                                    app.official = result.data.official;
 
                                    if (app.page == 1) {
                                        app.goodsList = new Array();
                                    }
                                    app.page += 1;
                                    app.count = result.data.count;
 
                                    var list = app.goodsList.concat(result.data.list);
                                    app.goodsList = list;
 
                                    
 
                                    if (app.count <= app.goodsList.length) {
                                        load.noMore();
                                    }
 
                                } else {
                                    yesApp.toast(result.msg);
                                }
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {
                                yesApp.hideLoading();
                                if (textStatus === 'timeout') {
                                    setTimeout(function() {}, 2000);
                                }
                            }
                        });
                    }
                }
            });
            app.fetcCloudInfo();
        });
 
        //(浏览器窗口上边界内容高度)
        function getDocumentTop() {
            var scrollTop = 0,
                bodyScrollTop = 0,
                documentScrollTop = 0;
            if (document.body) {
                bodyScrollTop = document.body.scrollTop;
            }
            if (document.documentElement) {
                documentScrollTop = document.documentElement.scrollTop;
            }
            scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop;
            console.log("scrollTop:" + scrollTop);
            return scrollTop;
        }
 
        //可视窗口高度(屏幕可以看见的高度)
        function getWindowHeight() {
            var windowHeight = 0;
            if (document.compatMode == "CSS1Compat") {
                windowHeight = document.documentElement.clientHeight;
            } else {
                windowHeight = document.body.clientHeight;
            }
            console.log("windowHeight:" + windowHeight);
            return windowHeight;
        }
 
        //滚动条滚动高度(即整个网页的高度)
        function getScrollHeight() {
            var scrollHeight = 0,
                bodyScrollHeight = 0,
                documentScrollHeight = 0;
            if (document.body) {
                bodyScrollHeight = document.body.scrollHeight;
            }
            if (document.documentElement) {
                documentScrollHeight = document.documentElement.scrollHeight;
            }
            scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight;
            console.log("scrollHeight:" + scrollHeight);
            return scrollHeight;
        }
    </script>
</html>