How to use pageObj method in ghostjs

Best JavaScript code snippet using ghostjs

functionData.js

Source:functionData.js Github

copy

Full Screen

1var _DuoguanData = require('data.js');2module.exports = {3 requestUrl: function(data, url, callback, pageobj) {4 wx.request({5 url: url,6 data: data,7 header: {8 'Content-Type': 'application/json'9 },10 success: function(res) {11 if (res.statusCode == 200 && res.data.code > 0) {12 callback.apply(pageobj, [res.data])13 } else {14 var error_msg = 'error:接口请求错误';15 if (res.data.info != 'null' || res.data.info != '') {16 error_msg = res.data.info17 }18 wx.showModal({19 title: '提示',20 content: error_msg,21 showCancel: false22 })23 }24 },25 complete: function() {}26 })27 },28 httpRequest: function(data, url, callback, pageobj) {29 wx.request({30 url: url,31 data: data,32 header: {33 'Content-Type': 'application/json'34 },35 success: function(res) {36 if (res.statusCode != 200) {37 wx.showModal({38 title: '提示',39 content: "error:接口请求错误",40 showCancel: false41 })42 } else {43 callback.apply(pageobj, [res.data]);44 if (res.data.status != 2 && res.data.status != 1) {45 wx.showModal({46 title: '提示',47 content: res.data.msg,48 showCancel: false49 })50 }51 }52 },53 fail: function() {54 wx.showModal({55 title: '提示',56 content: "error:网络请求失败",57 showCancel: false58 })59 }60 })61 },62 getShareData: function(mmodule, callback, pageobj) {63 var that = this;64 var data = {65 token: _DuoguanData.duoguan_user_token,66 mmodule: mmodule,67 _: Date.now()68 };69 var res = this.requestUrl(data, _DuoguanData.duoguan_get_share_data_url, callback, pageobj)70 },71 getSwiperList: function(callback, pageobj) {72 var that = this;73 var data = {74 token: _DuoguanData.duoguan_user_token,75 _: Date.now()76 };77 var res = this.requestUrl(data, _DuoguanData.duoguan_swiper_url, callback, pageobj)78 },79 getCmsCateList: function(beginnum, endnum, callback, pageobj) {80 var data = {81 token: _DuoguanData.duoguan_user_token,82 beginnum: beginnum,83 endnum: endnum,84 _: Date.now()85 };86 this.requestUrl(data, _DuoguanData.duoguan_cms_cate_url, callback, pageobj)87 },88 getCmsList: function(s_key, cate_id, pagesize, pagenum, callback, pageobj) {89 var data = {90 token: _DuoguanData.duoguan_user_token,91 cate_id: cate_id,92 keyword: s_key,93 pagesize: pagesize,94 pagenum: pagenum,95 _: Date.now()96 };97 this.requestUrl(data, _DuoguanData.duoguan_cms_url, callback, pageobj)98 },99 getCmsInfo: function(utoken, id, callback, pageobj) {100 var data = {101 token: _DuoguanData.duoguan_user_token,102 utoken: utoken,103 id: id,104 _: Date.now()105 };106 this.requestUrl(data, _DuoguanData.duoguan_cms_read_url, callback, pageobj)107 },108 postComment: function(utoken, cid, content, callback, pageobj) {109 var data = {110 token: _DuoguanData.duoguan_user_token,111 utoken: utoken,112 cid: cid,113 content: content,114 _: Date.now()115 };116 this.requestUrl(data, _DuoguanData.duoguan_comment_add_url, callback, pageobj)117 },118 getCommentList: function(cid, pagesize, pagenum, callback, pageobj) {119 var data = {120 token: _DuoguanData.duoguan_user_token,121 cid: cid,122 pagesize: pagesize,123 pagenum: pagenum,124 _: Date.now()125 };126 this.requestUrl(data, _DuoguanData.duoguan_comment_list_url, callback, pageobj)127 },128 postCommentGood: function(cid, callback, pageobj) {129 var data = {130 token: _DuoguanData.duoguan_user_token,131 cid: cid,132 _: Date.now()133 };134 this.requestUrl(data, _DuoguanData.duoguan_comment_good_url, callback, pageobj)135 },136 getUserInfo: function(utoken, callback, pageobj) {137 var data = {138 token: _DuoguanData.duoguan_user_token,139 utoken: utoken,140 _: Date.now()141 };142 this.requestUrl(data, _DuoguanData.duoguan_user_info_url, callback, pageobj)143 },144 postUserInfo: function(utoken, udata, callback, pageobj) {145 var data = {146 token: _DuoguanData.duoguan_user_token,147 utoken: utoken,148 udata: udata,149 _: Date.now()150 };151 this.requestUrl(data, _DuoguanData.duoguan_user_info_post_url, callback, pageobj)152 },153 getUserAddressList: function(utoken, callback, pageobj) {154 var data = {155 token: _DuoguanData.duoguan_user_token,156 utoken: utoken,157 _: Date.now()158 };159 this.requestUrl(data, _DuoguanData.duoguan_user_address_list_url, callback, pageobj)160 },161 addAddress: function(utoken, ainfo, callback, pageobj) {162 var data = {163 token: _DuoguanData.duoguan_user_token,164 utoken: utoken,165 ainfo: ainfo,166 _: Date.now()167 };168 this.requestUrl(data, _DuoguanData.duoguan_user_address_add_url, callback, pageobj)169 },170 getAddressInfo: function(utoken, aid, callback, pageobj) {171 var data = {172 token: _DuoguanData.duoguan_user_token,173 utoken: utoken,174 aid: aid,175 _: Date.now()176 };177 this.requestUrl(data, _DuoguanData.duoguan_user_address_info_url, callback, pageobj)178 },179 delAddress: function(utoken, aid, callback, pageobj) {180 var data = {181 token: _DuoguanData.duoguan_user_token,182 utoken: utoken,183 aid: aid,184 _: Date.now()185 };186 this.requestUrl(data, _DuoguanData.duoguan_user_address_del_url, callback, pageobj)187 },188 getUserPaylog: function(utoken, pagesize, pagenum, callback, pageobj) {189 var data = {190 token: _DuoguanData.duoguan_user_token,191 utoken: utoken,192 pagesize: pagesize,193 pagenum: pagenum,194 _: Date.now()195 };196 this.requestUrl(data, _DuoguanData.duoguan_get_user_paylog_url, callback, pageobj)197 },198 makePayData: function(utoken, cid, callback, pageobj) {199 var data = {200 token: _DuoguanData.duoguan_user_token,201 utoken: utoken,202 cid: cid,203 _: Date.now()204 };205 this.requestUrl(data, _DuoguanData.duoguan_make_paydata_url, callback, pageobj)206 },207 getUserPostList: function(utoken, pagesize, pagenum, callback, pageobj) {208 var data = {209 token: _DuoguanData.duoguan_user_token,210 utoken: utoken,211 pagesize: pagesize,212 pagenum: pagenum,213 _: Date.now()214 };215 this.requestUrl(data, _DuoguanData.duoguan_get_user_postlist_url, callback, pageobj)216 },217 getUserOrderList: function(utoken, pagesize, pagenum, callback, pageobj) {218 var data = {219 token: _DuoguanData.duoguan_user_token,220 utoken: utoken,221 pagesize: pagesize,222 pagenum: pagenum,223 _: Date.now()224 };225 this.requestUrl(data, _DuoguanData.duoguan_get_user_orderlist_url, callback, pageobj)226 },227 deleteOrderInfo: function(utoken, oid, callback, pageobj) {228 var data = {229 token: _DuoguanData.duoguan_user_token,230 utoken: utoken,231 oid: oid,232 _: Date.now()233 };234 this.requestUrl(data, _DuoguanData.duoguan_delete_user_order_url, callback, pageobj)235 },236 shouhuoOrderInfo: function(utoken, oid, callback, pageobj) {237 var data = {238 token: _DuoguanData.duoguan_user_token,239 utoken: utoken,240 oid: oid,241 _: Date.now()242 };243 this.requestUrl(data, _DuoguanData.duoguan_shouhuo_user_order_url, callback, pageobj)244 },245 postCommentOrder: function(utoken, oid, fval, fcon, callback, pageobj) {246 var data = {247 token: _DuoguanData.duoguan_user_token,248 utoken: utoken,249 oid: oid,250 fval: fval,251 fcon: fcon,252 _: Date.now()253 };254 this.requestUrl(data, _DuoguanData.duoguan_post_comment_order, callback, pageobj)255 },256 getBbsCategory: function(callback, pageobj) {257 var data = {258 token: _DuoguanData.duoguan_user_token,259 _: Date.now()260 };261 this.requestUrl(data, _DuoguanData.duoguan_get_bbs_cate_url, callback, pageobj)262 },263 getBbsGonggaoId: function(callback, pageobj) {264 var data = {265 token: _DuoguanData.duoguan_user_token,266 _: Date.now()267 };268 this.requestUrl(data, _DuoguanData.duoguan_get_bbs_gonggao_id, callback, pageobj)269 },270 getBbsTwoCategory: function(callback, pageobj) {271 var data = {272 token: _DuoguanData.duoguan_user_token,273 _: Date.now()274 };275 this.requestUrl(data, _DuoguanData.duoguan_get_bbs_cate_two_url, callback, pageobj)276 },277 getBbsPostList: function(wid, isjinghua, pagesize, pagenum, callback, pageobj) {278 var data = {279 token: _DuoguanData.duoguan_user_token,280 wid: wid,281 isjinghua: isjinghua,282 pagesize: pagesize,283 pagenum: pagenum,284 _: Date.now()285 };286 this.requestUrl(data, _DuoguanData.duoguan_get_bbs_postlist_url, callback, pageobj)287 },288 postBBs: function(utoken, t_data, t_wb_name, callback, pageobj) {289 var data = {290 token: _DuoguanData.duoguan_user_token,291 utoken: utoken,292 t_data: t_data,293 t_wb_name: t_wb_name,294 _: Date.now()295 };296 this.requestUrl(data, _DuoguanData.duoguan_bbs_post_url, callback, pageobj)297 },298 imgUpload: function(pid, utoken, imgurl, cb) {299 wx.uploadFile({300 url: _DuoguanData.duoguan_imgupload_url,301 filePath: imgurl,302 name: 'file',303 formData: {304 token: _DuoguanData.duoguan_user_token,305 utoken: utoken,306 pid: pid307 },308 success: function(res) {309 cb(res.data)310 }311 })312 },313 getPostInfo: function(pid, callback, pageobj) {314 var data = {315 token: _DuoguanData.duoguan_user_token,316 pid: pid,317 _: Date.now()318 };319 this.requestUrl(data, _DuoguanData.duoguan_post_info_url, callback, pageobj)320 },321 checkBBSManage: function(utoken, callback, pageobj) {322 var data = {323 token: _DuoguanData.duoguan_user_token,324 utoken: utoken,325 _: Date.now()326 };327 this.requestUrl(data, _DuoguanData.duoguan_check_bbs_manage_url, callback, pageobj)328 },329 delPostAction: function(utoken, pid, callback, pageobj) {330 var data = {331 token: _DuoguanData.duoguan_user_token,332 utoken: utoken,333 pid: pid,334 _: Date.now()335 };336 this.requestUrl(data, _DuoguanData.duoguan_post_del_url, callback, pageobj)337 },338 addPostReply: function(utoken, pid, rp_id, content, callback, pageobj) {339 var data = {340 token: _DuoguanData.duoguan_user_token,341 utoken: utoken,342 pid: pid,343 rp_id: rp_id,344 content: content,345 _: Date.now()346 };347 this.requestUrl(data, _DuoguanData.duoguan_post_replyadd_url, callback, pageobj)348 },349 getReplyList: function(pid, pagesize, pagenum, callback, pageobj) {350 var data = {351 token: _DuoguanData.duoguan_user_token,352 pid: pid,353 pagesize: pagesize,354 pagenum: pagenum,355 _: Date.now()356 };357 this.requestUrl(data, _DuoguanData.duoguan_post_replylist_url, callback, pageobj)358 },359 postXihuanAct: function(utoken, pid, ptype, callback, pageobj) {360 var data = {361 token: _DuoguanData.duoguan_user_token,362 utoken: utoken,363 pid: pid,364 ptype: ptype,365 _: Date.now()366 };367 this.requestUrl(data, _DuoguanData.duoguan_post_xihuan_url, callback, pageobj)368 },369 postReportAct: function(utoken, pid, ptype, content, callback, pageobj) {370 var data = {371 token: _DuoguanData.duoguan_user_token,372 utoken: utoken,373 pid: pid,374 ptype: ptype,375 content: content,376 _: Date.now()377 };378 this.requestUrl(data, _DuoguanData.duoguan_post_report_url, callback, pageobj)379 },380 getShopConfig: function(callback, pageobj) {381 var data = {382 token: _DuoguanData.duoguan_user_token,383 _: Date.now()384 };385 this.requestUrl(data, _DuoguanData.duoguan_get_shop_config_url, callback, pageobj)386 },387 getShopQuanInfo: function(qid, callback, pageobj) {388 var data = {389 token: _DuoguanData.duoguan_user_token,390 qid: qid,391 _: Date.now()392 };393 this.requestUrl(data, _DuoguanData.duoguan_shop_get_quan_info_url, callback, pageobj)394 },395 getShopQuanLingqu: function(utoken, qid, callback, pageobj) {396 var data = {397 token: _DuoguanData.duoguan_user_token,398 utoken: utoken,399 qid: qid,400 _: Date.now()401 };402 this.requestUrl(data, _DuoguanData.duoguan_shop_get_quan_lingqu_url, callback, pageobj)403 },404 getUserOneQuanInfo: function(utoken, quan_id, callback, pageobj) {405 var data = {406 token: _DuoguanData.duoguan_user_token,407 utoken: utoken,408 quan_id: quan_id,409 _: Date.now()410 };411 this.requestUrl(data, _DuoguanData.duoguan_shop_get_user_quan_info_url, callback, pageobj)412 },413 getShopUserQuanlist: function(utoken, qtype, callback, pageobj) {414 var data = {415 token: _DuoguanData.duoguan_user_token,416 utoken: utoken,417 qtype: qtype,418 _: Date.now()419 };420 this.requestUrl(data, _DuoguanData.duoguan_shop_get_user_quanlist_url, callback, pageobj)421 },422 getShopPsOrderInfo: function(oid, callback, pageobj) {423 var data = {424 token: _DuoguanData.duoguan_user_token,425 oid: oid,426 _: Date.now()427 };428 this.requestUrl(data, _DuoguanData.duoguan_shop_get_psorder_info_url, callback, pageobj)429 },430 getShopPsUserInfo: function(utoken, callback, pageobj) {431 var data = {432 token: _DuoguanData.duoguan_user_token,433 utoken: utoken,434 _: Date.now()435 };436 this.requestUrl(data, _DuoguanData.duoguan_shop_get_psuser_info_url, callback, pageobj)437 },438 getShopPsConfirm: function(utoken, oid, callback, pageobj) {439 var data = {440 token: _DuoguanData.duoguan_user_token,441 utoken: utoken,442 oid: oid,443 _: Date.now()444 };445 this.requestUrl(data, _DuoguanData.duoguan_shop_get_ps_confrim_url, callback, pageobj)446 },447 getShopWuliuInfo: function(oid, callback, pageobj) {448 var data = {449 token: _DuoguanData.duoguan_user_token,450 oid: oid,451 _: Date.now()452 };453 this.requestUrl(data, _DuoguanData.duoguan_shop_get_wuliu_info_url, callback, pageobj)454 },455 getShopCategory: function(callback, pageobj) {456 var data = {457 token: _DuoguanData.duoguan_user_token,458 _: Date.now()459 };460 this.requestUrl(data, _DuoguanData.duoguan_get_shop_cate_url, callback, pageobj)461 },462 getGoodsList: function(searchData, callback, pageobj) {463 var data = {464 token: _DuoguanData.duoguan_user_token,465 searchData: searchData,466 _: Date.now()467 };468 this.requestUrl(data, _DuoguanData.duoguan_get_good_list_url, callback, pageobj)469 },470 getGoodsInfo: function(sid, callback, pageobj) {471 var data = {472 token: _DuoguanData.duoguan_user_token,473 sid: sid,474 _: Date.now()475 };476 this.requestUrl(data, _DuoguanData.duoguan_get_good_info_url, callback, pageobj)477 },478 addGoodsCart: function(utoken, gid, gnumber, gattr, callback, pageobj) {479 var data = {480 token: _DuoguanData.duoguan_user_token,481 utoken: utoken,482 gid: gid,483 gnumber: gnumber,484 gattr: gattr,485 _: Date.now()486 };487 this.requestUrl(data, _DuoguanData.duoguan_add_good_cart_url, callback, pageobj)488 },489 getCartList: function(utoken, callback, pageobj) {490 var data = {491 token: _DuoguanData.duoguan_user_token,492 utoken: utoken,493 _: Date.now()494 };495 this.requestUrl(data, _DuoguanData.duoguan_get_cart_list_url, callback, pageobj)496 },497 delCartList: function(utoken, cid, callback, pageobj) {498 var data = {499 token: _DuoguanData.duoguan_user_token,500 utoken: utoken,501 cid: cid,502 _: Date.now()503 };504 this.requestUrl(data, _DuoguanData.duoguan_del_cart_list_url, callback, pageobj)505 },506 editCartList: function(utoken, cid, cnum, callback, pageobj) {507 var data = {508 token: _DuoguanData.duoguan_user_token,509 utoken: utoken,510 cid: cid,511 cnum: cnum,512 _: Date.now()513 };514 this.requestUrl(data, _DuoguanData.duoguan_edit_cart_list_url, callback, pageobj)515 },516 orderPost: function(utoken, oinfo, callback, pageobj) {517 var data = {518 token: _DuoguanData.duoguan_user_token,519 utoken: utoken,520 oinfo: oinfo,521 _: Date.now()522 };523 this.requestUrl(data, _DuoguanData.duoguan_order_post_url, callback, pageobj)524 },525 getOrderInfo: function(utoken, oid, callback, pageobj) {526 var data = {527 token: _DuoguanData.duoguan_user_token,528 utoken: utoken,529 oid: oid,530 _: Date.now()531 };532 this.requestUrl(data, _DuoguanData.duoguan_order_info_url, callback, pageobj)533 },534 makeOrderPayData: function(utoken, oid, callback, pageobj) {535 var data = {536 token: _DuoguanData.duoguan_user_token,537 utoken: utoken,538 oid: oid,539 _: Date.now()540 };541 this.requestUrl(data, _DuoguanData.duoguan_make_order_pay_url, callback, pageobj)542 },543 getAddressList: function(utoken, callback, pageobj) {544 var data = {545 token: _DuoguanData.duoguan_user_token,546 utoken: utoken,547 _: Date.now()548 };549 this.requestUrl(data, _DuoguanData.duoguan_get_address_list_url, callback, pageobj)550 },551 getUserMenu: function(callback, pageobj) {552 var data = {553 token: _DuoguanData.duoguan_user_token,554 ver_id: _DuoguanData.duoguan_config_version,555 _: Date.now()556 };557 this.requestUrl(data, _DuoguanData.duoguan_get_user_menu_url, callback, pageobj)558 },559 duoguanData: _DuoguanData,560 getTuanCategory: function(callback, pageobj) {561 var data = {562 token: _DuoguanData.duoguan_user_token,563 _: Date.now()564 };565 this.requestUrl(data, _DuoguanData.duoguan_get_tuan_cate_url, callback, pageobj)566 },567 getTuanGoodsList: function(cid, pagesize, pagenum, callback, pageobj) {568 var data = {569 token: _DuoguanData.duoguan_user_token,570 cid: cid,571 pagesize: pagesize,572 pagenum: pagenum,573 _: Date.now()574 };575 this.requestUrl(data, _DuoguanData.duoguan_get_tuan_good_list_url, callback, pageobj)576 },577 getTuanGoodsInfo: function(sid, callback, pageobj) {578 var data = {579 token: _DuoguanData.duoguan_user_token,580 sid: sid,581 _: Date.now()582 };583 this.requestUrl(data, _DuoguanData.duoguan_get_tuan_good_info_url, callback, pageobj)584 },585 addTuanGoodsCart: function(utoken, gid, gnumber, gattr, btype, chengtuan_id, callback, pageobj) {586 var data = {587 token: _DuoguanData.duoguan_user_token,588 utoken: utoken,589 gid: gid,590 gnumber: gnumber,591 gattr: gattr,592 btype: btype,593 chengtuan_id: chengtuan_id,594 _: Date.now()595 };596 this.requestUrl(data, _DuoguanData.duoguan_add_tuan_good_cart_url, callback, pageobj)597 },598 getTuanCartList: function(utoken, callback, pageobj) {599 var data = {600 token: _DuoguanData.duoguan_user_token,601 utoken: utoken,602 _: Date.now()603 };604 this.requestUrl(data, _DuoguanData.duoguan_get_tuan_cart_list_url, callback, pageobj)605 },606 orderTuanPost: function(utoken, oinfo, callback, pageobj) {607 var data = {608 token: _DuoguanData.duoguan_user_token,609 utoken: utoken,610 oinfo: oinfo,611 _: Date.now()612 };613 this.requestUrl(data, _DuoguanData.duoguan_order_tuan_post_url, callback, pageobj)614 },615 makeTuanOrderPayData: function(utoken, oid, callback, pageobj) {616 var data = {617 token: _DuoguanData.duoguan_user_token,618 utoken: utoken,619 oid: oid,620 _: Date.now()621 };622 this.requestUrl(data, _DuoguanData.duoguan_make_tuan_order_pay_url, callback, pageobj)623 },624 getTuanInfo: function(tid, callback, pageobj) {625 var data = {626 token: _DuoguanData.duoguan_user_token,627 tid: tid,628 _: Date.now()629 };630 this.requestUrl(data, _DuoguanData.duoguan_get_tuan_info_url, callback, pageobj)631 },632 getTuanWuliuInfo: function(oid, callback, pageobj) {633 var data = {634 token: _DuoguanData.duoguan_user_token,635 oid: oid,636 _: Date.now()637 };638 this.requestUrl(data, _DuoguanData.duoguan_tuan_get_wuliu_info_url, callback, pageobj)639 },640 getUserTuanOrderList: function(utoken, pagesize, pagenum, callback, pageobj) {641 var data = {642 token: _DuoguanData.duoguan_user_token,643 utoken: utoken,644 pagesize: pagesize,645 pagenum: pagenum,646 _: Date.now()647 };648 this.requestUrl(data, _DuoguanData.duoguan_get_user_tuan_orderlist_url, callback, pageobj)649 },650 getTuanOrderInfo: function(utoken, oid, callback, pageobj) {651 var data = {652 token: _DuoguanData.duoguan_user_token,653 utoken: utoken,654 oid: oid,655 _: Date.now()656 };657 this.requestUrl(data, _DuoguanData.duoguan_tuan_order_info_url, callback, pageobj)658 },659 deleteTuanOrderInfo: function(utoken, oid, callback, pageobj) {660 var data = {661 token: _DuoguanData.duoguan_user_token,662 utoken: utoken,663 oid: oid,664 _: Date.now()665 };666 this.requestUrl(data, _DuoguanData.duoguan_delete_user_tuan_order_url, callback, pageobj)667 },668 shouhuoTuanOrderInfo: function(utoken, oid, callback, pageobj) {669 var data = {670 token: _DuoguanData.duoguan_user_token,671 utoken: utoken,672 oid: oid,673 _: Date.now()674 };675 this.requestUrl(data, _DuoguanData.duoguan_shouhuo_user_tuan_order_url, callback, pageobj)676 },677 getCardMyInfo: function(utoken, callback, pageobj) {678 var data = {679 token: _DuoguanData.duoguan_user_token,680 utoken: utoken,681 _: Date.now()682 };683 this.requestUrl(data, _DuoguanData.duoguan_card_my_info_url, callback, pageobj)684 },685 getCardUserInfo: function(utoken, cid, callback, pageobj) {686 var data = {687 token: _DuoguanData.duoguan_user_token,688 utoken: utoken,689 cid: cid,690 _: Date.now()691 };692 this.requestUrl(data, _DuoguanData.duoguan_card_user_info_url, callback, pageobj)693 },694 postCardInfo: function(utoken, data, callback, pageobj) {695 var data = {696 token: _DuoguanData.duoguan_user_token,697 utoken: utoken,698 data: data,699 _: Date.now()700 };701 this.requestUrl(data, _DuoguanData.duoguan_card_post_info_url, callback, pageobj)702 },703 postChangePhoneInfo: function(utoken, data, callback, pageobj) {704 var data = {705 token: _DuoguanData.duoguan_user_token,706 utoken: utoken,707 data: data,708 _: Date.now()709 };710 this.requestUrl(data, _DuoguanData.duoguan_card_change_phone_url, callback, pageobj)711 },712 getCardViewInfo: function(uid, fid, ctype, callback, pageobj) {713 var data = {714 token: _DuoguanData.duoguan_user_token,715 uid: uid,716 fid: fid,717 ctype: ctype,718 _: Date.now()719 };720 this.requestUrl(data, _DuoguanData.duoguan_card_view_info_url, callback, pageobj)721 },722 getMyCardList: function(utoken, ctype, ltype, callback, pageobj) {723 var data = {724 token: _DuoguanData.duoguan_user_token,725 utoken: utoken,726 ctype: ctype,727 ltype: ltype,728 _: Date.now()729 };730 this.requestUrl(data, _DuoguanData.duoguan_card_get_list_url, callback, pageobj)731 },732 getUserPhoneCode: function(utoken, phone, callback, pageobj) {733 var data = {734 token: _DuoguanData.duoguan_user_token,735 utoken: utoken,736 phone: phone,737 _: Date.now()738 };739 this.requestUrl(data, _DuoguanData.duoguan_get_user_phone_code_url, callback, pageobj)740 },741 getHotelListData: function (utoken, callback, pageobj) {742 var data = {743 token: _DuoguanData.duoguan_user_token,744 utoken: utoken,745 _: Date.now(),746 };747 this.httpRequest(data, _DuoguanData.duoguan_h_gethotellist_url, callback, pageobj)748 },749 getHotelData: function (hotel_id,utoken, callback, pageobj) {750 var data = {751 token: _DuoguanData.duoguan_user_token,752 utoken: utoken,753 hotel_id: hotel_id,754 _: Date.now()755 };756 this.httpRequest(data, _DuoguanData.duoguan_h_gethoteldata_url, callback, pageobj)757 },758 getHotelEvaData: function (hotel_id,pageIndex, pageSize, utoken, callback, pageobj) {759 var data = {760 hotel_id: hotel_id,761 token: _DuoguanData.duoguan_user_token,762 utoken: utoken,763 _: Date.now(),764 pageIndex: pageIndex,765 pageSize: pageSize766 };767 this.httpRequest(data, _DuoguanData.duoguan_h_gethotelevadata_url, callback, pageobj)768 },769 getRoomListData: function (hotel_id,startTime, stopTime, utoken, callback, pageobj) {770 var data = {771 hotel_id: hotel_id,772 token: _DuoguanData.duoguan_user_token,773 utoken: utoken,774 _: Date.now(),775 startTime: startTime,776 stopTime: stopTime777 };778 this.httpRequest(data, _DuoguanData.duoguan_h_getroomlist_url, callback, pageobj)779 },780 makeHotelOrder: function (hotel_id,checkintime, leavetime, name, tel, roomid, mealid, roomnums, price, paytype, utoken, callback, pageobj) {781 var data = {782 hotel_id: hotel_id,783 token: _DuoguanData.duoguan_user_token,784 utoken: utoken,785 _: Date.now(),786 checkintime: checkintime,787 leavetime: leavetime,788 name: name,789 tel: tel,790 paytype: paytype,791 roomid: roomid,792 mealid: mealid,793 roomnums: roomnums,794 price: price,795 };796 this.httpRequest(data, _DuoguanData.duoguan_h_makeorder_url, callback, pageobj)797 },798 makeHotelComment: function (data, utoken, callback, pageobj) {799 var data = {800 token: _DuoguanData.duoguan_user_token,801 utoken: utoken,802 _: Date.now(),803 data: data804 };805 this.httpRequest(data, _DuoguanData.duoguan_h_makecomment_url, callback, pageobj)806 },807 getOrderList: function (pageIndex,808 pageSize, utoken, callback, pageobj) {809 var data = {810 token: _DuoguanData.duoguan_user_token,811 utoken: utoken,812 _: Date.now(),813 pageIndex: pageIndex,814 pageSize: pageSize815 };816 this.httpRequest(data, _DuoguanData.duoguan_h_getorderlist_url, callback, pageobj)817 },818 deleteOrder: function (ordernumber, utoken, callback, pageobj) {819 var data = {820 token: _DuoguanData.duoguan_user_token,821 utoken: utoken,822 _: Date.now(),823 ordernumber: ordernumber824 };825 this.httpRequest(data, _DuoguanData.duoguan_h_deleteorder_url, callback, pageobj)826 },827 cancelOrder: function (ordernumber, utoken, callback, pageobj) {828 var data = {829 token: _DuoguanData.duoguan_user_token,830 utoken: utoken,831 _: Date.now(),832 ordernumber: ordernumber833 };834 this.httpRequest(data, _DuoguanData.duoguan_h_cancelorder_url, callback, pageobj)835 },836 payHotelOrder: function (ordernumber, utoken, callback, pageobj) {837 var data = {838 token: _DuoguanData.duoguan_user_token,839 utoken: utoken,840 _: Date.now(),841 ordernumber: ordernumber842 };843 this.httpRequest(data, _DuoguanData.duoguan_h_payHotelorder_url, callback, pageobj)844 },845 dishGetDishConfig: function(callback, pageobj) {846 var data = {847 token: _DuoguanData.duoguan_user_token,848 _: Date.now()849 };850 this.requestUrl(data, _DuoguanData.duoguan_dish_get_dish_config, callback, pageobj)851 },852 dishGetDishList: function(lat, lng, pagesize, pagenum, callback, pageobj) {853 var data = {854 token: _DuoguanData.duoguan_user_token,855 ws_lat: lat,856 ws_lng: lng,857 pagesize: pagesize,858 pagenum: pagenum,859 _: Date.now()860 };861 this.requestUrl(data, _DuoguanData.duoguan_dish_get_dish_list, callback, pageobj)862 },863 dishGetDishInfo: function(utoken, dish_id, callback, pageobj) {864 var data = {865 token: _DuoguanData.duoguan_user_token,866 utoken: utoken,867 dish_id: dish_id,868 _: Date.now()869 };870 this.requestUrl(data, _DuoguanData.duoguan_dish_get_dish_info, callback, pageobj)871 },872 dishGetDishOneInfo: function(dish_id, callback, pageobj) {873 var data = {874 token: _DuoguanData.duoguan_user_token,875 dish_id: dish_id,876 _: Date.now()877 };878 this.requestUrl(data, _DuoguanData.duoguan_dish_get_dish_one_info, callback, pageobj)879 },880 dishGetGoodsInfo: function(utoken, dish_id, goods_id, callback, pageobj) {881 var data = {882 token: _DuoguanData.duoguan_user_token,883 utoken: utoken,884 dish_id: dish_id,885 goods_id: goods_id,886 _: Date.now()887 };888 this.requestUrl(data, _DuoguanData.duoguan_dish_get_goods_info, callback, pageobj)889 },890 dishGetOneGoodsAttr: function(goods_id, callback, pageobj) {891 var data = {892 token: _DuoguanData.duoguan_user_token,893 goods_id: goods_id,894 _: Date.now()895 };896 this.requestUrl(data, _DuoguanData.duoguan_dish_get_one_goods_attr, callback, pageobj)897 },898 dishAddGoodsCart: function(utoken, dish_id, gid, gnumber, gattr, callback, pageobj) {899 var data = {900 token: _DuoguanData.duoguan_user_token,901 utoken: utoken,902 dish_id: dish_id,903 gid: gid,904 gnumber: gnumber,905 gattr: gattr,906 _: Date.now()907 };908 this.requestUrl(data, _DuoguanData.duoguan_dish_add_cart_info, callback, pageobj)909 },910 dishGetCartList: function(utoken, dish_id, callback, pageobj) {911 var data = {912 token: _DuoguanData.duoguan_user_token,913 utoken: utoken,914 dish_id: dish_id,915 _: Date.now()916 };917 this.requestUrl(data, _DuoguanData.duoguan_dish_get_cart_info, callback, pageobj)918 },919 dishEditCartList: function(utoken, cid, cnum, callback, pageobj) {920 var data = {921 token: _DuoguanData.duoguan_user_token,922 utoken: utoken,923 cid: cid,924 cnum: cnum,925 _: Date.now()926 };927 this.requestUrl(data, _DuoguanData.duoguan_dish_edit_cart_info, callback, pageobj)928 },929 dishDeleteCartList: function(utoken, dish_id, callback, pageobj) {930 var data = {931 token: _DuoguanData.duoguan_user_token,932 utoken: utoken,933 dish_id: dish_id,934 _: Date.now()935 };936 this.requestUrl(data, _DuoguanData.duoguan_dish_delete_cart_info, callback, pageobj)937 },938 dishOrderPost: function(utoken, oinfo, callback, pageobj) {939 var data = {940 token: _DuoguanData.duoguan_user_token,941 utoken: utoken,942 oinfo: oinfo,943 _: Date.now()944 };945 this.requestUrl(data, _DuoguanData.duoguan_dish_order_post_info, callback, pageobj)946 },947 dishMakeOrderPayData: function(utoken, oid, callback, pageobj) {948 var data = {949 token: _DuoguanData.duoguan_user_token,950 utoken: utoken,951 oid: oid,952 _: Date.now()953 };954 this.requestUrl(data, _DuoguanData.duoguan_dish_order_pay_url, callback, pageobj)955 },956 dishGetUserOrderList: function(utoken, pagesize, pagenum, callback, pageobj) {957 var data = {958 token: _DuoguanData.duoguan_user_token,959 utoken: utoken,960 pagesize: pagesize,961 pagenum: pagenum,962 _: Date.now()963 };964 this.requestUrl(data, _DuoguanData.duoguan_dish_get_user_orderlist_url, callback, pageobj)965 },966 dishGetOrderInfo: function(utoken, oid, callback, pageobj) {967 var data = {968 token: _DuoguanData.duoguan_user_token,969 utoken: utoken,970 oid: oid,971 _: Date.now()972 };973 this.requestUrl(data, _DuoguanData.duoguan_dish_order_info_url, callback, pageobj)974 },975 dishDeleteOrderInfo: function(utoken, oid, callback, pageobj) {976 var data = {977 token: _DuoguanData.duoguan_user_token,978 utoken: utoken,979 oid: oid,980 _: Date.now()981 };982 this.requestUrl(data, _DuoguanData.duoguan_dish_delete_user_order_url, callback, pageobj)983 },984 dishPostOrderComment: function(utoken, oid, fval, fcon, callback, pageobj) {985 var data = {986 token: _DuoguanData.duoguan_user_token,987 utoken: utoken,988 oid: oid,989 fval: fval,990 fcon: fcon,991 _: Date.now()992 };993 this.requestUrl(data, _DuoguanData.duoguan_dish_post_comment_order, callback, pageobj)994 },995 dishImgUpload: function(pid, utoken, imgurl, cb) {996 wx.uploadFile({997 url: _DuoguanData.duoguan_dish_imgupload_url,998 filePath: imgurl,999 name: 'file',1000 formData: {1001 token: _DuoguanData.duoguan_user_token,1002 utoken: utoken,1003 pid: pid1004 },1005 success: function(res) {1006 cb(res.data)1007 }1008 })1009 },...

Full Screen

Full Screen

RfullPage.js

Source:RfullPage.js Github

copy

Full Screen

1!2 function(window){3 RfullPage={"version":"1.0",authon:"darkness"};4 window.RfullPage=RfullPage;5 jQuery.fn.setpagefunc=function(func){6 this.animefun=func;7 return this;8 };9 jQuery.fn.setoutpagefunc=function(func){10 this.outanimefun=func;11 return this;12 };13 window.browsertop=function(){14 if(window.pageYOffset){//这一条滤去了大部分, 只留了IE67815 return window.pageYOffset;16 }else if(document.documentElement.scrollTop ){//IE678 的非quirk模式17 return document.documentElement.scrollTop;18 }else if(document.body.scrolltop){//IE678 的quirk模式19 return document.body.scrollTop;20 }else{21 return 0;22 }23 }24 }(window),25 function (RfullPage){26 RfullPage.Rbasic=function(navul){27 this.navul=null;28 var pageobj=this;29 this.setnavul=function(jquerydiv){30 this.navul=jquerydiv;31 jquerydiv.on("click","li",function(e){32 pageobj.gotopage($(this).attr("data-page"));33 });34 };35 if(navul){36 this.setnavul(navul);37 }38 this.pagenum=1;//初始化页数为139 this.divarr=[];40 this.ismoving=false;41 this.ismousewhell=true;42 this.setismousewhell=function(ismousewhell){43 this.ismousewhell=ismousewhell;44 };45 this.navulactivecss="";46 this.setnavulactivecss=function(cssname){47 this.navulactivecss=cssname;48 };49 this.addnav=function(navtext,pagenum,isaddactive = true ){50 if(this.navul){51 this.navul.append("<li data-page='"+pagenum+"' data-isaddactive='"+isaddactive+"'>"+navtext+"</li>")52 }53 };54 this.getpage=function(pagenum){//得到对应页的jquery对象55 return this.divarr[(pagenum-1)];56 };57 }58 }(RfullPage),59 function(RfullPage){60 RfullPage.RnewFullPage=function(navul){61 var pageobj=this;62 RfullPage.Rbasic.call(this,navul);63 this.getfullpageheight=function(){64 return document.documentElement.clientHeight;65 };66 this.topheight=0;67 this.bottomheight=0;68 this.addnewpage=function(jquerydiv,title){//添加新页69 if(this.divarr.length==0){70 this.topheight=jquerydiv.position().top;71 }72 this.bottomheight=jquerydiv.position().top;73 jquerydiv.css("overflow","hidden");74 jquerydiv.height(this.getfullpageheight());75 this.divarr.push(jquerydiv);76 if(this.navul && title){77 this.addnav(title,this.divarr.length)78 }79 return jquerydiv;80 };81 if(this.ismousewhell){82 $("body").mousewheel(function(event, delta, deltaX, deltaY) {83 if(deltaY>0 && !pageobj.ismoving){//向上滚84 if(pageobj.bottomheight<(browsertop()-10)){//在底部85 pageobj.gotopage(pageobj.divarr.length,true);86 if(pageobj.navul){87 pageobj.navul.stop().fadeIn("fast");88 }89 return false;90 }else if(pageobj.pagenum!=1){//滚动条高度大于顶部的高度91 pageobj.gotopage(pageobj.pagenum-1);92 return false;93 }else{94 if(pageobj.navul){95 pageobj.navul.stop().fadeOut("fast");96 }97 }98 }else if(deltaY<0 && !pageobj.ismoving){//向下滚99 if(browsertop()<(pageobj.topheight-(10))){ //在顶部时100 pageobj.gotopage(1,true);101 if(pageobj.navul){102 pageobj.navul.stop().fadeIn("fast");103 }104 return false;105 }else{//不在顶部106 if(pageobj.pagenum!=pageobj.divarr.length){ //不在最后一个107 pageobj.gotopage(pageobj.pagenum+1);108 return false;109 }else{110 //if(pageobj.navul){111 // pageobj.navul.stop().fadeOut("fast");112 //}113 }114 }115 }116 if(pageobj.ismoving){117 return false;118 }119 });120 }121 this.gotopage=function(pagenum,isskipanime){//跳转到指定页122 if(this.getpage(this.pagenum).outanimefun && this.pagenum!=pagenum){123 this.getpage(this.pagenum).outanimefun();124 }125 if(this.navul){126 this.navul.children("li").each(function(i,e){127 if($(this).attr("data-page")==pagenum && $(this).attr("data-isaddactive")=="true"){128 $(this).addClass(pageobj.navulactivecss);129 }else{130 $(this).removeClass(pageobj.navulactivecss);131 }132 });133 }134 this.pagenum=parseInt(pagenum);135 this.ismoving=true;136 if(!isskipanime){137 isskipanime=false;138 }139 if(this.getpage(pagenum).animefun && !isskipanime){140 this.getpage(pagenum).animefun();141 }142 $("html,body").stop().animate({scrollTop:(pagenum-1)*pageobj.getfullpageheight()+pageobj.topheight},"2000",function(e){143 pageobj.ismoving=false;144 });145 };146 $(window).bind("resize",function(e) {147 //页面窗口大小改变时时间148 if(pageobj.getpage(pageobj.pagenum).animefun){149 pageobj.getpage(pageobj.pagenum).animefun();150 }151 $.each(pageobj.divarr,function(i,e){152 if(i==0){153 pageobj.topheight=e.position().top;154 }155 pageobj.bottomheight=e.position().top;156 e.height(pageobj.getfullpageheight());157 pageobj.gotopage(pageobj.pagenum,true);158 })159 });160 }161 }(RfullPage),162 function(RfullPage){163 RfullPage.RnewBannerFullPage=function(parentjqueryul,navul){164 var pageobj=this;165 RfullPage.Rbasic.call(this,(navul?navul:null));166 parentjqueryul.css("position","relative");167 parentjqueryul.children("li").each(function(i,e){168 if(navul){169 navul.append("<li data-page='"+(i-(-1))+"'></li>")170 }171 pageobj.divarr.push($(this));172 $(this).css("width","100%").css("height","100%").css("left",i*(parentjqueryul.width())+"px").css("top","0px").css("position","absolute");173 if(i!=0){174 $(this).animate({opacity:"0"});175 }176 });177 if(navul){178 navul.on("click","li",function(e){179 pageobj.gotopage($(this).attr("data-page"));180 });181 }182 this.gotopage=function(pagenum){183 navul.children("li:eq("+(this.pagenum-1)+")").removeClass(this.navulactivecss);184 navul.children("li:eq("+(pagenum-1)+")").addClass(this.navulactivecss);185 if(pagenum>this.pagenum){186 pageobj.divarr[pagenum-1].css("left",100+"px").stop().animate({opacity:"1",left:0},"slow");187 pageobj.divarr[this.pagenum-1].stop().animate({opacity:"0",left:-100},"slow");188 }else if(pagenum<this.pagenum){189 pageobj.divarr[pagenum-1].css("left",-(100)+"px").stop().animate({opacity:"1",left:0},"slow");190 pageobj.divarr[this.pagenum-1].stop().animate({opacity:"0",left:100},"slow");191 }else{192 return false;193 }194 this.pagenum=pagenum;195 this.startanime();196 };197 this.isanime=true;198 this.animespeed=5000;199 this.startanime=function(){200 if(this.isanime){201 if(this.animet)202 window.clearInterval(this.animet);203 this.animet=window.setInterval(function(){pageobj.gotopage((pageobj.divarr.length==pageobj.pagenum?1:(pageobj.pagenum-(-1))))},pageobj.animespeed);204 }205 }206 }...

Full Screen

Full Screen

preLoad.js

Source:preLoad.js Github

copy

Full Screen

1+(function(factory){2 window.PreLoad = factory();3}(function(){4 var PreLoad = function(opt){5 this.cache = [];6 this._cache = {};7 this.options = $.extend({},arguments.callee.options,opt);8 if(!history.pushState) return false;9 this.init();10 }11 $.extend(PreLoad.prototype,{12 init: function(){13 var that = this;14 this.$root = $('html,body');15 this.$view = $(".view-page");16 this.$content = this.$view.find('>.detail-box>.content');17 18 $(window).on("popstate",function(){19 var current = history.state;20 var page = location.href;21 that.showPage(page);22 });23 $(document).on("click","a",function(e){24 if(this.href.match(/books\/(\d+)\/chapters\/(\d+)/)){25 e.preventDefault();26 var page = this.href;27 var pageObj = that.showPage(page);28 history.pushState({page:page},'',this.href);29 }30 });31 this._init();32 },33 _init: function(){34 var that = this;35 var pageObj = {36 page: location.href,37 title: document.title,38 content: $(document.body).find('.view-page').html()39 }40 pageObj.ajax = $.Deferred();41 pageObj.ajax.resolve();42 this.cache.push(pageObj);43 this._cache[pageObj.page] = pageObj;44 $(window).on("load",function(){45 that.createPageObj(that.$view.find('.next-page').attr('href'));46 });47 },48 showPage: function(page){49 var pageObj = this._cache[page];50 if(!pageObj){51 this.createPageObj(page);52 }else if(pageObj.ajax.state() == 'resolved'){53 this.current = pageObj;54 document.title = pageObj.title;55 this.$root.scrollTop(this.$view.offset().top);56 try{57 this.$view.html(window.ad_filter(pageObj.content));58 }catch(e){59 console.log('has script');60 }finally{61 this.createPageObj(this.$view.find('.next-page').attr('href'));62 }63 }else{64 this.safeMode();65 }66 },67 createPageObj: function(page){68 var that = this;69 if(that._cache[page]) return;70 var pageObj = {71 page:page,72 tryCount:073 }74 that.fetchPage(pageObj);75 that.cache.push(pageObj);76 that._cache[page] = pageObj;77 if(that.cache.length >= that.options.maxCache){78 var rpo = that.cache.shift();79 delete that._cache[rpo[page]];80 }81 },82 fetchPage: function(pageObj){83 var that = this;84 pageObj.tryCount++;85 var ajax = $.get(pageObj.page).done(function(res){86 var $doc = $(res);87 pageObj.title = $doc.filter('title').html();88 pageObj.content = $doc.find('.view-page').html();89 if(window.location.href == pageObj.page){90 that.showPage(pageObj.page);91 }92 }).fail(function(){93 if(pageObj.tryCount>5) return;94 console.log('网络错误,1秒后重试');95 setTimeout(function(){96 that.fetchPage(pageObj);97 },1000);98 })99 pageObj.ajax = ajax;100 },101 safeMode: function(){102 var that = this;103 clearTimeout(this._safeid);104 console.log('用户观看欲望十分强烈,必须要启用安全模式啦!');105 this._safeid = setTimeout(function(){106 if(window.location.href != that.current.page){107 location.reload();108 }109 },3000)110 }111 });112 $.extend(PreLoad,{113 options:{114 maxCache: 20115 }116 });117 return PreLoad;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var page = require('webpage').create();2 console.log("Status: " + status);3 if(status === "success") {4 page.render('google.png');5 }6 phantom.exit();7});8var page = require('webpage').create();9 console.log("Status: " + status);10 if(status === "success") {11 page.render('google.png');12 }13 phantom.exit();14});15* [Chai-As-Promised](

Full Screen

Using AI Code Generation

copy

Full Screen

1var ghost = require('ghostjs');2 ghost.set('viewportSize', {width: 1024, height: 768}, function() {3 ghost.wait(2000, function() {4 ghost.screenshot('test.png', function() {5 ghost.exit();6 });7 });8 });9});10### ghost.open(url, callback)11### ghost.wait(ms, callback)12### ghost.set(property, value, callback)13### ghost.screenshot(filename, callback)14### ghost.exit()

Full Screen

Using AI Code Generation

copy

Full Screen

1var page = require('webpage').create();2 page.evaluate(function() {3 document.title = 'Hello, world!';4 });5 page.render('google.png');6 phantom.exit();7});8#### ghostjs.create(options)9#### ghostjs.createPage(options)10#### ghostjs.open(url, options)11#### ghostjs.wait(ms)12#### ghostjs.waitForPageReady()

Full Screen

Using AI Code Generation

copy

Full Screen

1var ghost = require('ghostjs');2 page.type('input[name="q"]', 'Hello World').then(function(){3 page.click('input[name="btnG"]').then(function(){4 page.wait(3000).then(function(){5 page.screenshot('google.png').then(function(){6 ghost.exit();7 });8 });9 });10 });11});12The examples can be found [here](

Full Screen

Using AI Code Generation

copy

Full Screen

1var ghost = require('ghostjs');2var page = ghost.createPage();3 console.log('Page opened with status: ' + status);4 page.set('viewportSize', {width: 1024, height: 768});5 page.render('test.png');6 ghost.exit();7});8var ghost = require('ghostjs');9ghost.createPage().then(function(page) {10 console.log('Page opened with status: ' + status);11 page.set('viewportSize', {width: 1024, height: 768});12 page.render('test.png');13 ghost.exit();14 });15});16The MIT License (MIT)17Copyright (c) 2014-2015 GhostJS Team

Full Screen

Using AI Code Generation

copy

Full Screen

1var page = require('webpage').create();2var ghost = require('ghostjs');3ghost.setPage(page);4.then(function(){5 return ghost.waitForSelector('input[name="q"]');6})7.then(function(){8 return ghost.sendKeys('input[name="q"]', 'Hello World');9})10.then(function(){11 return ghost.click('input[name="btnG"]');12})13.then(function(){14})15.then(function(){16 return ghost.waitForSelector('h3.r');17})18.then(function(){19 return ghost.evaluate(function(){20 return document.querySelector('h3.r').innerText;21 });22})23.then(function(text){24 console.log(text);25 phantom.exit();26});27### open(url, [options])28### sendKeys(selector, text)29### click(selector)30### evaluate(fn, [arg1, arg2, ...])31### waitForUrl(url)32### waitForSelector(selector)33### waitFor(fn, [interval, timeout])34### cookie(name, [value], [options])

Full Screen

Using AI Code Generation

copy

Full Screen

1module.exports = function (ghost, scenario, vp) {2 ghost.evaluate(function () {3 });4};5module.exports = function (ghost, scenario, vp) {6 ghost.then(function () {7 ghost.wait(1000, function () {8 ghost.screenshot('screenshot1');9 });10 });11 ghost.then(function () {12 ghost.wait(1000, function () {13 ghost.screenshot('screenshot2');14 });15 });16};17module.exports = function (ghost, scenario, vp) {18 ghost.waitForSelector('#selector', function () {19 });20};21module.exports = function (ghost, scenario, vp) {22 ghost.wait(1000, function () {23 });24};25module.exports = function (ghost, scenario, vp) {26 ghost.then(function () {27 ghost.echo('hello world');28 });29};30module.exports = function (ghost, scenario, vp) {31 ghost.then(function () {32 ghost.page.evaluate(function () {33 });34 });35};

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ghostjs automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful