diff --git a/H5B854518.wgt b/H5B854518.wgt index b230920..22376bf 100644 Binary files a/H5B854518.wgt and b/H5B854518.wgt differ diff --git a/app-release.apk b/app-release.apk index 9bdd5b7..0270dd9 100644 Binary files a/app-release.apk and b/app-release.apk differ diff --git a/get_version_new.php b/get_version_new.php index 1e1addc..805ea64 100755 --- a/get_version_new.php +++ b/get_version_new.php @@ -2,12 +2,12 @@ $data['version'] = 16; $data['ios_must_update'] = 0; //是否强制更新,0不强制,1强制 $data['must_update'] = 1; //是否强制更新,0不强制,1强制 -$data['apk_version'] = '2.2.0'; -$data['apk_down_url'] = 'http://qlg.tsgz.moe:233/H5B854518.wgt'; +$data['apk_version'] = '2.2.1'; +$data['apk_down_url'] = 'http://www.zgqlg.com.cn/H5B854518.wgt'; //$data['ios_version'] = '1.0.0'; $data['ios_appid'] = '1355322179'; $data['update_url'] = 'https://itunes.apple.com/cn/lookup?id='.$data['ios_appid']; $data['ios_down_url'] = 'https://itunes.apple.com/cn/app/san-gu-hui/id'.$data['ios_appid'].'?mt=8'; -$data['cssUrl'] = 'http://qlg.tsgz.moe:233/static/app2/css/'; -$data['jsUrl'] = 'http://qlg.tsgz.moe:233/static/app2/js/'; +$data['cssUrl'] = 'http://www.zgqlg.com.cn/static/app2/css/'; +$data['jsUrl'] = 'http://www.zgqlg.com.cn/static/app2/js/'; exit(json_encode($data)); \ No newline at end of file diff --git a/static/app2/css/addessay.css b/static/app2/css/addessay.css old mode 100755 new mode 100644 diff --git a/static/app2/css/addgoods.css b/static/app2/css/addgoods.css old mode 100755 new mode 100644 diff --git a/static/app2/css/addqrrz.css b/static/app2/css/addqrrz.css old mode 100755 new mode 100644 diff --git a/static/app2/css/addshopping.css b/static/app2/css/addshopping.css old mode 100755 new mode 100644 diff --git a/static/app2/css/addyhk.css b/static/app2/css/addyhk.css old mode 100755 new mode 100644 diff --git a/static/app2/css/applicationopen.css b/static/app2/css/applicationopen.css old mode 100755 new mode 100644 diff --git a/static/app2/css/appraise.css b/static/app2/css/appraise.css old mode 100755 new mode 100644 index 090ed27..e7a4497 --- a/static/app2/css/appraise.css +++ b/static/app2/css/appraise.css @@ -88,7 +88,7 @@ figure { .pjbtitle p { color: #e61329; - font-size: 13.2px; + font-size: 18px; float: left; margin: 0; line-height: 25.2px; @@ -97,13 +97,13 @@ figure { .pjbcon { color: #525252; - font-size: 13.2px; + font-size: 18px; margin: 3px 0; } .pjclass { color: #909090; - font-size: 13.2px; + font-size: 18px; } .pjbtitle img { width: 25.2px; @@ -122,7 +122,7 @@ figure { padding: 9px 6px; background: #e4e4e4; border-radius: 4.8px; - font-size: 12px; + font-size: 18px; margin-top: 4px; } .zjpj{ diff --git a/static/app2/css/bill.css b/static/app2/css/bill.css old mode 100755 new mode 100644 diff --git a/static/app2/css/cash-out.css b/static/app2/css/cash-out.css old mode 100755 new mode 100644 index c0a023d..33fe140 --- a/static/app2/css/cash-out.css +++ b/static/app2/css/cash-out.css @@ -11,7 +11,7 @@ /* border-bottom: 1px solid #ccc; */ } -.idc-total h5 { +.idc-total h4 { width: 80%; } @@ -59,7 +59,7 @@ line-height: 48px; text-align: center; color: black; - font-size: 15.6px; + font-size: 18px; } .btns div { height: 30px; @@ -103,7 +103,7 @@ } .bg .row label { width: 100px; - font-size: 13px; + font-size: 16px; color: #363636; } @@ -127,7 +127,7 @@ padding: 0px; height: 21px; text-align: left; - font-size: 13px; + font-size: 16px; color:#7B7B7B; } .idc-list { @@ -163,7 +163,7 @@ .idc-list-title { width: 200px; - font-size: 15px; + font-size: 16px; font-weight: 200; margin-bottom: 10px; overflow: hidden; @@ -172,20 +172,20 @@ } .idc-list-price { - font-size: 15px; + font-size: 16px; color: #F02C43; } .idc-list-user { - font-size: 13px; + font-size: 16px; margin-bottom: 15px; } .idc-list-time { width: 50%; - font-size: 12px; + font-size: 14px; /* color: #F02C43; */ bottom: 10px; } diff --git a/static/app2/css/complain.css b/static/app2/css/complain.css old mode 100755 new mode 100644 diff --git a/static/app2/css/confirmOrder.css b/static/app2/css/confirmOrder.css old mode 100755 new mode 100644 index 7e55edc..8366a2e --- a/static/app2/css/confirmOrder.css +++ b/static/app2/css/confirmOrder.css @@ -1,151 +1,151 @@ -.scroll_out{ - position: fixed; - top: 66px; - bottom: 50px; - left: 0; - right: 0; -} - - -.c1_r input{ - margin: 0; - border: none; - padding: 0; - height: 22px; - width: calc( 100% ); - font-size: 12px; -} -.c1_r{ - width: calc(100% - 80px); - text-align: right; -} - -.c1_l input::-webkit-input-placeholder { /* WebKit browsers */ -font-size:12px; -} -.c1_l input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ -font-size:12px; -} -.c1_l input::-moz-placeholder { /* Mozilla Firefox 19+ */ -font-size:12px; -} -.c1_l input:-ms-input-placeholder { /* Internet Explorer 10+ */ -font-size:12px; -} - - -.js_r{ - float: right; - line-height: 50px; -} -.js_r span{ - font-size: 12px; -} -.js_r span j{ - color: #e94744; -} -.js_r span o{ - color: #909090; -} -.btn_tj{ - display: inline-block; - width: 102px; - height: 51px; - background: -moz-linear-gradient(left, #ff0423, #ff58a3); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0423), to(#ff58a3)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #ff0423, #ff58a3); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #ff0423, #ff58a3); - /*Opera11*/ - text-align: center; - color: white; - font-size: 14.4px; -} - -.isHb{ - width: 100%; - height: 42px; - border-bottom: 1px solid #e6e6e6; - background: white; - line-height: 41px; - padding:0 10px; -} -.h_left{ - font-size: 12px; - float: left; -} -.h_left o{ - color: #909090; -} -.he_right{ - float: right; - height: 41px; - width: 80px; - position: relative; -} -.checkout{ - width: 42px; - height: 25px; - border-radius: 15px; - /*background: #2ddd87;*/ - position: absolute; - right: 0; - top: 7px; - border:1px solid #909090; -} -.check_btn{ - position: absolute; - width: 21px; - height: 21px; - background: white; - border-radius: 50%; - top: 1px; - left: 1px; - border:1px solid #909090; -} -.he_right .on{ - top: 8px; - border: none; - height: 23px; - background: #2ddd87; -} - -.he_right .on .check_btn{ - border: none; - left: 20px; -} -select{ - margin: 0; - padding: 0 ; - font-size: 13.2px; -} -.mui-table-view-cell:after{ - height: 0; -} -.mui-table-view-cell.mui-collapse .mui-collapse-content{ - width: 100%; - background: transparent; -} -.row_{ - width: 100%; - font-size: 13.2px; - border-bottom: 1px solid #ebebeb; -} - -.shop_info{ - background: white; - border-bottom: none; - margin-bottom: 5px; -} -.row_block{ - background: white; -} -.row_block img{ - border-radius: 3px; - overflow: hidden; -} -.rcr { - background: white; -} +.scroll_out{ + position: fixed; + top: 66px; + bottom: 50px; + left: 0; + right: 0; +} + + +.c1_r input{ + margin: 0; + border: none; + padding: 0; + height: 22px; + width: calc( 100% ); + font-size: 18px; +} +.c1_r{ + width: calc(100% - 100px); + text-align: right; +} + +.c1_l input::-webkit-input-placeholder { /* WebKit browsers */ +font-size:18px; +} +.c1_l input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ +font-size:18px; +} +.c1_l input::-moz-placeholder { /* Mozilla Firefox 19+ */ +font-size:18px; +} +.c1_l input:-ms-input-placeholder { /* Internet Explorer 10+ */ +font-size:18px; +} + + +.js_r{ + float: right; + line-height: 50px; +} +.js_r span{ + font-size: 12px; +} +.js_r span j{ + color: #e94744; +} +.js_r span o{ + color: #909090; +} +.btn_tj{ + display: inline-block; + width: 102px; + height: 51px; + background: -moz-linear-gradient(left, #ff0423, #ff58a3); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0423), to(#ff58a3)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0423, #ff58a3); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0423, #ff58a3); + /*Opera11*/ + text-align: center; + color: white; + font-size: 14.4px; +} + +.isHb{ + width: 100%; + height: 42px; + border-bottom: 1px solid #e6e6e6; + background: white; + line-height: 41px; + padding:0 10px; +} +.h_left{ + font-size: 12px; + float: left; +} +.h_left o{ + color: #909090; +} +.he_right{ + float: right; + height: 41px; + width: 80px; + position: relative; +} +.checkout{ + width: 42px; + height: 25px; + border-radius: 15px; + /*background: #2ddd87;*/ + position: absolute; + right: 0; + top: 7px; + border:1px solid #909090; +} +.check_btn{ + position: absolute; + width: 21px; + height: 21px; + background: white; + border-radius: 50%; + top: 1px; + left: 1px; + border:1px solid #909090; +} +.he_right .on{ + top: 8px; + border: none; + height: 23px; + background: #2ddd87; +} + +.he_right .on .check_btn{ + border: none; + left: 20px; +} +select{ + margin: 0; + padding: 0 ; + font-size: 13.2px; +} +.mui-table-view-cell:after{ + height: 0; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content{ + width: 100%; + background: transparent; +} +.row_{ + width: 100%; + font-size: 13.2px; + border-bottom: 1px solid #ebebeb; +} + +.shop_info{ + background: white; + border-bottom: none; + margin-bottom: 5px; +} +.row_block{ + background: white; +} +.row_block img{ + border-radius: 3px; + overflow: hidden; +} +.rcr { + background: white; +} diff --git a/static/app2/css/cooperative.css b/static/app2/css/cooperative.css old mode 100755 new mode 100644 diff --git a/static/app2/css/details.css b/static/app2/css/details.css old mode 100755 new mode 100644 diff --git a/static/app2/css/discount.css b/static/app2/css/discount.css old mode 100755 new mode 100644 index d761b17..0228a0c --- a/static/app2/css/discount.css +++ b/static/app2/css/discount.css @@ -1,263 +1,263 @@ -body:after { - content: ""; - position: fixed; - /*top: -10px;*/ - bottom: -10px; - left: 0; - width: 100%; - height: 10px; - box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); - /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; - -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; - -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; - -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ - z-index: 100; -} - - -.oc_logo { - /*width: 67.5px;*/ - height: 16.5px; - position: absolute; - margin: 0 auto; - left: 0; - right: 0; - top: 13.75px; -} - -.top { - width: 100%; - height: 16px; - background: white; -} - -.con { - width: 100%; - padding: 0 2%; - transform: translateY(-16px); -} - - - -#timer_swiper .swiper-slide { - color: #101010; - font-size: 13px; - float: left; - padding: 9px 0; - height: 40px; -} -.nav .r{ - float: right; -} - -.con .recommend{ - padding: 5px 0; -} -#timer_swiper .lxy0 .on p{ - color: #00d793; - border-bottom: 4px solid #01de92; -} - -#timer_swiper .lxy1 .on p{ - color: #5f26e6; - border-bottom: 4px solid #64ed13; -} - -.t_con p{ - font-size: 13px; - color: #000; -} - - -.t_con { - width: 100%; - background: #fff; -} - -#timer_swiper { - width: 100%; -} -#timer_swiper .swiper-wrapper .swiper-slide img{ - padding: 3px; - border-radius: 7px; -} -.t_con .swiper-container { - width: 800px; -} - -.t_con .swiper-slide { - text-align: center; - font-size: 18px; - background: #fff; - /* Center slide text vertically */ - display: -webkit-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; -} -.on p{ - color: #ee344a; - border-bottom: 3px solid #EE344A; -} - - -#timer_swiper .swiper-slide { - position: relative; -} - -#timer_swiper .swiper-slide img {} - -#timer_swiper .swiper-slide p { - /*position: absolute;*/ -} - - -.con_block { - margin-top: 1px; - width: 100%; - height: 170px; - background: white; - position: relative; -} - -.con_block .img { - width: 109px; - height: 109px; - position: absolute; - top: 30px; - left: 2%; -} - -.con_block .p1 { - width: calc(100% - 130px); - right: 2%; - color: #101010; - font-size: 13px; - position: absolute; - top: 20px; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - overflow: hidden; -} - -.con_block .p2 { - color: #fff; - font-size: 10px; - position: absolute; - background: -moz-linear-gradient(left, #ff0000, #ff0066); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0000), to(#ff0066)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #ff0000, #ff0066); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #ff0000, #ff0066); - /*Opera11*/ - border-radius: 3px; - padding: 0px 2px; - top: 65px; - right: calc(100% - 171px); -} - -.pect{ - color: #fff; - font-size: 10px; - position: absolute; - background: -moz-linear-gradient(left, #6600ff, #a200ff); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #6600ff, #a200ff); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #6600ff, #a200ff); - /*Opera11*/ - border-radius: 3px; - padding: 0px 2px; - top: 65px; - right: calc(100% - 220px); -} - -.con_block .p3 { - color: #ec3449; - font-size: 15px; - position: absolute; - width: calc(100% - 130px); - right: 2%; - top: 105px; -} - -.con_block .p3 o { - font-size: 13px; -} - -.con_block del { - color: #808080; - font-size: 14px; - position: absolute; - width: calc(100% - 130px); - right: 2%; - top: 120px; -} - -.con_block del o { - font-size: 12px; -} - -.con_block button { - color: white; - background: #ED374C; - font-size: 13px; - padding: 5px 15px; - border-radius: 5px; - position: absolute; - right: 2%; - bottom: 35px; - border: none; -} - -.con_block .p4 { - color: #808080; - font-size: 10px; - position: absolute; - bottom: 10px; - right: 80px; -} - -.con_block progress { - width: 70px; - height: 9px; - border-radius: 10px; - position: absolute; - right: 2%; - bottom: 16px; - background: white; -} - -::-ms-fill { - background: #ED374C; -} - -::-moz-progress-bar { - background: #ED374C; -} - -::-webkit-progress-bar { - background: white; - border: 1px solid #ED374C; - border-radius: 10px; -} - -::-webkit-progress-value { - background: #ED374C; - border-radius: 0 5px 5px 0; -} - - +body:after { + content: ""; + position: fixed; + /*top: -10px;*/ + bottom: -10px; + left: 0; + width: 100%; + height: 10px; + box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); + /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ + z-index: 100; +} + + +.oc_logo { + /*width: 67.5px;*/ + height: 16.5px; + position: absolute; + margin: 0 auto; + left: 0; + right: 0; + top: 13.75px; +} + +.top { + width: 100%; + height: 16px; + background: white; +} + +.con { + width: 100%; + padding: 0 2%; + transform: translateY(-16px); +} + + + +#timer_swiper .swiper-slide { + color: #101010; + font-size: 13px; + float: left; + padding: 9px 0; + height: 40px; +} +.nav .r{ + float: right; +} + +.con .recommend{ + padding: 5px 0; +} +#timer_swiper .lxy0 .on p{ + color: #00d793; + border-bottom: 4px solid #01de92; +} + +#timer_swiper .lxy1 .on p{ + color: #5f26e6; + border-bottom: 4px solid #64ed13; +} + +.t_con p{ + font-size: 13px; + color: #000; +} + + +.t_con { + width: 100%; + background: #fff; +} + +#timer_swiper { + width: 100%; +} +#timer_swiper .swiper-wrapper .swiper-slide img{ + padding: 3px; + border-radius: 7px; +} +.t_con .swiper-container { + width: 800px; +} + +.t_con .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + display: -webkit-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + -webkit-align-items: center; + align-items: center; +} +.on p{ + color: #ee344a; + border-bottom: 3px solid #EE344A; +} + + +#timer_swiper .swiper-slide { + position: relative; +} + +#timer_swiper .swiper-slide img {} + +#timer_swiper .swiper-slide p { + /*position: absolute;*/ +} + + +.con_block { + margin-top: 1px; + width: 100%; + height: 170px; + background: white; + position: relative; +} + +.con_block .img { + width: 109px; + height: 109px; + position: absolute; + top: 30px; + left: 2%; +} + +.con_block .p1 { + width: calc(100% - 130px); + right: 2%; + color: #101010; + font-size: 13px; + position: absolute; + top: 20px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + +.con_block .p2 { + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #ff0000, #ff0066); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0000), to(#ff0066)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0000, #ff0066); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0000, #ff0066); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 171px); +} + +.pect{ + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #6600ff, #a200ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #6600ff, #a200ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #6600ff, #a200ff); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 220px); +} + +.con_block .p3 { + color: #ec3449; + font-size: 15px; + position: absolute; + width: calc(100% - 130px); + right: 2%; + top: 105px; +} + +.con_block .p3 o { + font-size: 13px; +} + +.con_block del { + color: #808080; + font-size: 14px; + position: absolute; + width: calc(100% - 130px); + right: 2%; + top: 120px; +} + +.con_block del o { + font-size: 12px; +} + +.con_block button { + color: white; + background: #ED374C; + font-size: 13px; + padding: 5px 15px; + border-radius: 5px; + position: absolute; + right: 2%; + bottom: 35px; + border: none; +} + +.con_block .p4 { + color: #808080; + font-size: 10px; + position: absolute; + bottom: 10px; + right: 80px; +} + +.con_block progress { + width: 70px; + height: 9px; + border-radius: 10px; + position: absolute; + right: 2%; + bottom: 16px; + background: white; +} + +::-ms-fill { + background: #ED374C; +} + +::-moz-progress-bar { + background: #ED374C; +} + +::-webkit-progress-bar { + background: white; + border: 1px solid #ED374C; + border-radius: 10px; +} + +::-webkit-progress-value { + background: #ED374C; + border-radius: 0 5px 5px 0; +} + + diff --git a/static/app2/css/discounts.css b/static/app2/css/discounts.css old mode 100755 new mode 100644 index e581fb5..80b1574 --- a/static/app2/css/discounts.css +++ b/static/app2/css/discounts.css @@ -1,21 +1,21 @@ -.nav{ - width: 100%; - height: 37px; - margin-top: 66px; - border-bottom: 1px solid #e6e6e6; -} -.p1{ - color: #909090; - width: 33.33333333%; - text-align: center; - display: block; - float: left; - line-height: 36px; - font-size: 13.2px; - background: white; -} -.nav .on{ - color: #e51329; -} - - +.nav{ + width: 100%; + height: 37px; + margin-top: 66px; + border-bottom: 1px solid #e6e6e6; +} +.p1{ + color: #909090; + width: 33.33333333%; + text-align: center; + display: block; + float: left; + line-height: 36px; + font-size: 13.2px; + background: white; +} +.nav .on{ + color: #e51329; +} + + diff --git a/static/app2/css/dynamic.css b/static/app2/css/dynamic.css old mode 100755 new mode 100644 index 982c107..f0af0dc --- a/static/app2/css/dynamic.css +++ b/static/app2/css/dynamic.css @@ -1,231 +1,231 @@ -/* 6p */ - -@media all and (min-width: 376px) { - .bc_img,.b_con img { - height: 125px; - } - - .mui-slider { - height: 168px; - } - .mui-slider-item { - height: 168px; - } - .mui-slider .mui-slider-item img { - height: 168px; - width: 100%; - } -} - - -/* 6 */ - -@media all and (min-width: 321px) and (max-width: 375px) { - .bc_img,.b_con img { - height: 113px; - } - .mui-slider { - height: 152px; - } - .mui-slider-item { - height: 152px; - } - .mui-slider .mui-slider-item img { - height: 152px; - width: 100%; - } -} - -/* 5 */ - -@media all and (max-width: 320px) { - .bc_img,.b_con img { - height: 94.5px; - } - .mui-slider { - height: 130px; - } - .mui-slider-item { - height: 130px; - } - .mui-slider .mui-slider-item img { - height: 130px; - width: 100%; - } -} -.con{ - width: 100%; - overflow: hidden; -} -.block { - width: 100%; - margin-bottom: 6px ; - background: white; -} - -.b_title { - width: 100%; - position: relative; - height: 60px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.b_title .b_img { - width: 48px; - height: 48px; - position: absolute; - bottom: 0; - left: 15px; -} - -.storename { - position: absolute; - width: calc(100% - 140px); - color: black; - left: 69px; - top: 15px; - font-size: 16.8px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.time { - position: absolute; - width: calc(100% - 140px); - left: 69px; - color: #909090; - font-size: 13.2px; - top: 38px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.btn_menu { - width: 38px; - height: 38px; - padding: 10px; - position: absolute; - right: 0; - top: 5px; -} - -.b_con { - width: 100%; - padding: 7.5px 13.5px; - font-size: 14.4px; - color: #525252; -} - -.b_footer { - width: 100%; - height: 36px; - position: relative; -} - -.num { - position: absolute; - width: 90px; - top: 7.5px; - left: 15px; -} - -.num img { - width: 18px; - float: left; -} - -.nun p { - float: left; -} - -.zan { - padding: 0 9px 0 12px; - height: 20px; - border: 1px solid #909090; - position: absolute; - background: url(../img/zan1.png) no-repeat 7px center; - background-size: 18px; - border-radius: 9px; - min-width: 45px; - line-height: 18px; - font-size: 14.4px; - color: #909090; - text-indent: 15px; - right: 18px; - bottom: 8px; -} - -.zanon { - padding: 0 9px 0 12px; - height: 20px; - border: 1px solid #e51329; - position: absolute; - background: url(../img/zan2.png) no-repeat 7px center; - background-size: 18px; - border-radius: 9px; - min-width: 45px; - line-height: 18px; - font-size: 14.4px; - color: #e51329; - text-indent: 15px; - right: 18px; - bottom: 8px; -} - -.b_con img { - width: calc(33.33333333333% - 3px); - margin: 1.5px; - float: left; -} - -.btn_gz{ - height: 24px; - text-align: center; - border: 1px solid #e91b34; - line-height: 24px; - color: #e91b31; - border-radius: 15px; - padding: 0 9px; - position: absolute; - right: 18px; - font-size: 12px; - top: 25px; -} +/* 6p */ -.btn_gz1{ - height: 24px; - text-align: center; - border: 1px solid #909090; - line-height: 24px; - color: #909090; - border-radius: 15px; - padding: 0 9px; - position: absolute; - right: 18px; - font-size: 12px; - top: 25px; -} - - -.bc_img{ - position: relative; - width: calc(33.33333333333% - 3px); - float: left; - margin: 1.5px; -} -.b_con .bc_img img{ - width: 100%; - margin: 0; -} -.bc_img p{ - position: absolute; - text-align: center; - width: 100%; - background: rgba(0,0,0,0.1); - color: white; - bottom: 0; -} +@media all and (min-width: 376px) { + .bc_img,.b_con img { + height: 125px; + } + + .mui-slider { + height: 168px; + } + .mui-slider-item { + height: 168px; + } + .mui-slider .mui-slider-item img { + height: 168px; + width: 100%; + } +} + + +/* 6 */ + +@media all and (min-width: 321px) and (max-width: 375px) { + .bc_img,.b_con img { + height: 113px; + } + .mui-slider { + height: 152px; + } + .mui-slider-item { + height: 152px; + } + .mui-slider .mui-slider-item img { + height: 152px; + width: 100%; + } +} + +/* 5 */ + +@media all and (max-width: 320px) { + .bc_img,.b_con img { + height: 94.5px; + } + .mui-slider { + height: 130px; + } + .mui-slider-item { + height: 130px; + } + .mui-slider .mui-slider-item img { + height: 130px; + width: 100%; + } +} +.con{ + width: 100%; + overflow: hidden; +} +.block { + width: 100%; + margin-bottom: 6px ; + background: white; +} + +.b_title { + width: 100%; + position: relative; + height: 60px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.b_title .b_img { + width: 48px; + height: 48px; + position: absolute; + bottom: 0; + left: 15px; +} + +.storename { + position: absolute; + width: calc(100% - 140px); + color: black; + left: 69px; + top: 15px; + font-size: 16.8px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.time { + position: absolute; + width: calc(100% - 140px); + left: 69px; + color: #909090; + font-size: 13.2px; + top: 38px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.btn_menu { + width: 38px; + height: 38px; + padding: 10px; + position: absolute; + right: 0; + top: 5px; +} + +.b_con { + width: 100%; + padding: 7.5px 13.5px; + font-size: 14.4px; + color: #525252; +} + +.b_footer { + width: 100%; + height: 36px; + position: relative; +} + +.num { + position: absolute; + width: 90px; + top: 7.5px; + left: 15px; +} + +.num img { + width: 18px; + float: left; +} + +.nun p { + float: left; +} + +.zan { + padding: 0 9px 0 12px; + height: 20px; + border: 1px solid #909090; + position: absolute; + background: url(../img/zan1.png) no-repeat 7px center; + background-size: 18px; + border-radius: 9px; + min-width: 45px; + line-height: 18px; + font-size: 14.4px; + color: #909090; + text-indent: 15px; + right: 18px; + bottom: 8px; +} + +.zanon { + padding: 0 9px 0 12px; + height: 20px; + border: 1px solid #e51329; + position: absolute; + background: url(../img/zan2.png) no-repeat 7px center; + background-size: 18px; + border-radius: 9px; + min-width: 45px; + line-height: 18px; + font-size: 14.4px; + color: #e51329; + text-indent: 15px; + right: 18px; + bottom: 8px; +} + +.b_con img { + width: calc(33.33333333333% - 3px); + margin: 1.5px; + float: left; +} + +.btn_gz{ + height: 24px; + text-align: center; + border: 1px solid #e91b34; + line-height: 24px; + color: #e91b31; + border-radius: 15px; + padding: 0 9px; + position: absolute; + right: 18px; + font-size: 12px; + top: 25px; +} + +.btn_gz1{ + height: 24px; + text-align: center; + border: 1px solid #909090; + line-height: 24px; + color: #909090; + border-radius: 15px; + padding: 0 9px; + position: absolute; + right: 18px; + font-size: 12px; + top: 25px; +} + + +.bc_img{ + position: relative; + width: calc(33.33333333333% - 3px); + float: left; + margin: 1.5px; +} +.b_con .bc_img img{ + width: 100%; + margin: 0; +} +.bc_img p{ + position: absolute; + text-align: center; + width: 100%; + background: rgba(0,0,0,0.1); + color: white; + bottom: 0; +} diff --git a/static/app2/css/editAddress.css b/static/app2/css/editAddress.css old mode 100755 new mode 100644 index 2909571..e20b71b --- a/static/app2/css/editAddress.css +++ b/static/app2/css/editAddress.css @@ -1,43 +1,48 @@ -.row{ - width: 100%; - height: 42px; - border-bottom: 1px solid #E6E6E6; - line-height: 41px; - background: white; - margin-bottom: 5px; -} -.row input{ - border: none; - margin: 0; -} -.row input::-webkit-input-placeholder{ - font-size: 12px -} -.row select{ - float: left; - margin: 0; - width: 33%; - text-align: center; -} -.row select option{ - text-align: center; -} -textarea{ - border-top: none; - font-size: 12px -} -.bc_btn{ - margin: 0 auto; - left: 5%; - right: 5%; - /*position: absolute;*/ - width: 90%; - height: 42px; - border: none; - background: #F02C43; - color: white; -} -.add_info,.isdef{ - padding: 0 15px; - font-size: 12px; -} +.row{ + width: 100%; + height: 42px; + border-bottom: 1px solid #E6E6E6; + line-height: 41px; + background: white; + margin-bottom: 5px; +} +.row input{ + border: none; + margin: 0; +} +.row input::-webkit-input-placeholder{ + font-size: 16px +} +.row select{ + float: left; + margin: 0; + width: 33%; + text-align: center; + font-size: 18px; +} +.row select option{ + text-align: center; +} +textarea{ + border-top: none; + font-size: 17px; +} +.row textarea::-webkit-input-placeholder{ + font-size: 16px +} +.bc_btn{ + margin: 0 auto; + left: 5%; + right: 5%; + /*position: absolute;*/ + width: 90%; + height: 42px; + border: none; + background: #F02C43; + color: white; + font-size: 17px; +} +.add_info,.isdef{ + padding: 0 15px; + font-size: 18px; +} diff --git a/static/app2/css/essay.css b/static/app2/css/essay.css old mode 100755 new mode 100644 diff --git a/static/app2/css/essaylist.css b/static/app2/css/essaylist.css old mode 100755 new mode 100644 diff --git a/static/app2/css/friends.css b/static/app2/css/friends.css old mode 100755 new mode 100644 diff --git a/static/app2/css/global.1.css b/static/app2/css/global.1.css old mode 100755 new mode 100644 diff --git a/static/app2/css/global.css b/static/app2/css/global.css old mode 100755 new mode 100644 index 78f7770..a2da44d --- a/static/app2/css/global.css +++ b/static/app2/css/global.css @@ -1,144 +1,144 @@ -.clearfix:after { - height: 0; - content: " "; - display: block; - overflow: hidden; - clear: both; -} - -.clearfix { - zoom: 1; - /*IE低版本浏览器不支持after伪类所以要加这一句*/ -} - -a { - color: black; -} - -a:active { - color: white; -} - -p { - margin: 0; -} - -input { - margin: 0; -} - -img {} - -.scroll_out { - position: fixed; - top: 66px; - bottom: 50px; - left: 0; - right: 0; -} - -.scroll_out1 { - position: fixed; - top: 66px; - bottom: 0; - left: 0; - right: 0; -} - -.scroll_out2 { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -.scroll_out3 { - position: fixed; - top: 162px; - bottom: 0; - left: 0; - right: 0; -} - -.scroll_out4 { - position: fixed; - top: 120px; - bottom: 0; - left: 0; - right: 0; -} - -.scroll_out_tb { - position: fixed; - top: 64px; - bottom: 50px; - left: 0; - right: 0; -} - -.scroll_out_t { - position: fixed; - top: 64px; - bottom: 0; - left: 0; - right: 0; -} - -.scroll_out { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -body { - font-family: "微软雅黑"; -} - -.shadown_wai { - box-shadow: 2px 2px 5px rgba(25, 25, 25, 0.2); - border-radius: 5px; - overflow: hidden; - border-top: 1px solid #EFEFF4; - margin-bottom: 1px; -} - -.pect { - color: #fff; - font-size: 10px; - position: absolute; - background: -moz-linear-gradient(left, #6600ff, #a200ff); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #6600ff, #a200ff); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #6600ff, #a200ff); - /*Opera11*/ - border-radius: 3px; - padding: 0px 2px; - top: 65px; - right: calc(100% - 220px); -} - -.hide { - display: none; -} - -.backTop { - background: #DDDDDD; - border-radius: 50%; - position: fixed; - right: 10px; - bottom: 15px; - width: 38px; - height: 38px; - z-index: 9999; - text-align: center; - font-size: 18px; - color: #666666; - padding-top: 8px; - opacity: 0.8; +.clearfix:after { + height: 0; + content: " "; + display: block; + overflow: hidden; + clear: both; +} + +.clearfix { + zoom: 1; + /*IE低版本浏览器不支持after伪类所以要加这一句*/ +} + +a { + color: black; +} + +a:active { + color: white; +} + +p { + margin: 0; +} + +input { + margin: 0; +} + +img {} + +.scroll_out { + position: fixed; + top: 66px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out1 { + position: fixed; + top: 66px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out2 { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out3 { + position: fixed; + top: 162px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out4 { + position: fixed; + top: 120px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out_tb { + position: fixed; + top: 64px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out_t { + position: fixed; + top: 64px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +body { + font-family: "微软雅黑"; +} + +.shadown_wai { + box-shadow: 2px 2px 5px rgba(25, 25, 25, 0.2); + border-radius: 5px; + overflow: hidden; + border-top: 1px solid #EFEFF4; + margin-bottom: 1px; +} + +.pect { + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #6600ff, #a200ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #6600ff, #a200ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #6600ff, #a200ff); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 220px); +} + +.hide { + display: none; +} + +.backTop { + background: #DDDDDD; + border-radius: 50%; + position: fixed; + right: 10px; + bottom: 15px; + width: 38px; + height: 38px; + z-index: 9999; + text-align: center; + font-size: 18px; + color: #666666; + padding-top: 8px; + opacity: 0.8; } \ No newline at end of file diff --git a/static/app2/css/goodsList.css b/static/app2/css/goodslist.css old mode 100755 new mode 100644 similarity index 100% rename from static/app2/css/goodsList.css rename to static/app2/css/goodslist.css diff --git a/static/app2/css/header.css b/static/app2/css/header.css old mode 100755 new mode 100644 diff --git a/static/app2/css/home_new.css b/static/app2/css/home_new.css old mode 100755 new mode 100644 index 15bf49e..4c54753 --- a/static/app2/css/home_new.css +++ b/static/app2/css/home_new.css @@ -29,7 +29,7 @@ body{ height: 50px; width: 100%; text-align: center; - font-size: 12px; + font-size: 16px; } .header { @@ -49,20 +49,22 @@ body{ width: 100%; height: 44px; } - +.header_con select{ + font-size: 18px; +} #search { margin: 0; width: 65%; height: 31px; position: absolute; - left: 13.8%; + left: 15.8%; right: 21%; top: 7px; border-radius: 16px; border: none; /*text-indent: 20px;*/ background-color: rgb(255, 255, 255); - font-size: 11px; + font-size: 15px; line-height: 34px; text-indent: 30px; } @@ -105,11 +107,12 @@ body{ border: none; position: absolute; width: 50px; - height: 30px; + height: 32px; border-radius: 0; background: #007AFF; color: white; border-radius: 50px; + font-size: 16px; } .saoyisao { @@ -121,7 +124,9 @@ body{ right: 1.0%; } - +.search input { + font-size: 17px; +} diff --git a/static/app2/css/income-details.css b/static/app2/css/income-details.css old mode 100755 new mode 100644 diff --git a/static/app2/css/indent.css b/static/app2/css/indent.css old mode 100755 new mode 100644 index 92d3fbe..d37e6a9 --- a/static/app2/css/indent.css +++ b/static/app2/css/indent.css @@ -1,48 +1,48 @@ -body .header1{ - z-index: 11; - width: 100%; - position: fixed; - top: 0; - background: rgba(255,255,255,1); - border: none; - box-shadow: 0 0 0; - height: 66px; - border-bottom: 1px solid #efefef; -} -.mui-bar-nav.mui-bar .mui-icon { - margin-left: 0; -} -.mui-title{ - color: #909090; -} -.header1 .on{ - border-bottom: 3px solid #ff0000; - color: #e61329; -} -.nav{ - padding: 0 100px; - height: 66px; - text-align: center; -} -.p1{ - color: #000; - display: block; - line-height: 46px; - font-size: 18px; - padding-top: 20px; -} -.header1 .mui-action-back { - margin-top: 20px; - margin-left: 0; - color: #848484; - float: left; -} - -.footer{ - position: fixed; - bottom: 0; - width: 100%; - background: white; - height: 49px; - border-top: 1px solid #e6e6e6; -} +body .header1{ + z-index: 11; + width: 100%; + position: fixed; + top: 0; + background: rgba(255,255,255,1); + border: none; + box-shadow: 0 0 0; + height: 66px; + border-bottom: 1px solid #efefef; +} +.mui-bar-nav.mui-bar .mui-icon { + margin-left: 0; +} +.mui-title{ + color: #909090; +} +.header1 .on{ + border-bottom: 3px solid #ff0000; + color: #e61329; +} +.nav{ + padding: 0 100px; + height: 66px; + text-align: center; +} +.p1{ + color: #000; + display: block; + line-height: 46px; + font-size: 18px; + padding-top: 20px; +} +.header1 .mui-action-back { + margin-top: 20px; + margin-left: 0; + color: #848484; + float: left; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 49px; + border-top: 1px solid #e6e6e6; +} diff --git a/static/app2/css/indentcon.css b/static/app2/css/indentcon.css old mode 100755 new mode 100644 index 7642a75..f735425 --- a/static/app2/css/indentcon.css +++ b/static/app2/css/indentcon.css @@ -35,7 +35,7 @@ /* padding-right: 12px; padding-left: 18px; */ line-height: 36px; - font-size: 14px; + font-size: 16px; } .indent_status { @@ -95,7 +95,7 @@ .rcrc { float: left; - width: calc(100% - 60px); + width: calc(100% - 85px); } .rcrc p { @@ -104,7 +104,7 @@ -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; - font-size: 12px; + font-size: 18px; color: black; } @@ -114,8 +114,9 @@ .rcrr { - width: 60px; + width: 80px; float: right; + margin-right:4px; text-align: right; } @@ -123,18 +124,18 @@ .rcrr p { color: black; - font-size: 12px; + font-size: 18px; } .rcrr del { color: #909090; - font-size: 12px; + font-size: 18px; display: block; } .rcrr span { color: #909090; - font-size: 12px; + font-size: 18px; } .combination{ width: 100%; @@ -157,7 +158,7 @@ } .btns_btn{ color: black; - font-size: 12px; + font-size: 14px; padding:4px 6px 0px; float: right; /* line-height: 48px; */ diff --git a/static/app2/css/index.css b/static/app2/css/index.css old mode 100755 new mode 100644 index 7757183..9bac3de --- a/static/app2/css/index.css +++ b/static/app2/css/index.css @@ -11,14 +11,21 @@ body .mui-bar-tab{ height: 50px; } .mui-bar .mui-tab-item .mui-icon img { - height: 35px; + height:48px; + padding: 1px; } .mui-bar .mui-tab-item .mui-icon{ padding: 0; width: 50px; + height: 50px; + line-height: 50px; + display: inline-block; } .mui-bar .mui-tab-item{ height: 50px; + + box-sizing: border-box; + } .mui-bar{ width: 100%; diff --git a/static/app2/css/individual.css b/static/app2/css/individual.css old mode 100755 new mode 100644 index 739920f..05b0d7a --- a/static/app2/css/individual.css +++ b/static/app2/css/individual.css @@ -69,7 +69,7 @@ .mui-table-view-cell input ,.mui-table-view-cell p,.mui-table-view-cell textarea{ padding: 0px; /* width:calc(100%-100px); */ - font-size: 15px; + font-size: 17px; margin: 0px; border: 0px; text-align: right; diff --git a/static/app2/css/invest.css b/static/app2/css/invest.css old mode 100755 new mode 100644 diff --git a/static/app2/css/investdetail.css b/static/app2/css/investdetail.css old mode 100755 new mode 100644 diff --git a/static/app2/css/login.css b/static/app2/css/login.css old mode 100755 new mode 100644 diff --git a/static/app2/css/logistics.css b/static/app2/css/logistics.css old mode 100755 new mode 100644 diff --git a/static/app2/css/map.css b/static/app2/css/map.css old mode 100755 new mode 100644 diff --git a/static/app2/css/memorandumlist.css b/static/app2/css/memorandumlist.css old mode 100755 new mode 100644 diff --git a/static/app2/css/mui.css b/static/app2/css/mui.css old mode 100755 new mode 100644 diff --git a/static/app2/css/mui.min.css b/static/app2/css/mui.min.css old mode 100755 new mode 100644 diff --git a/static/app2/css/my.css b/static/app2/css/my.css old mode 100755 new mode 100644 diff --git a/static/app2/css/my_help_sale.css b/static/app2/css/my_help_sale.css new file mode 100644 index 0000000..6068282 --- /dev/null +++ b/static/app2/css/my_help_sale.css @@ -0,0 +1,63 @@ +.mydata .mydata-content{ + background: #fff; + width: 100%; + display: flex; + justify-content: flex-start; + flex-wrap: wrap; +} + +.mydata .mydata-content .mydata-table-view-cell{ + width: 20%; + text-align: center; + border-right: 1px solid #ECECEC; + border-bottom: 1px solid #ECECEC; + +} +.mydata .mydata-content .mydata-table-view-cell a { + color:#525252 ; + display: inline-block; + width: 100%; +} +.mydata .mydata-content .mydata-table-view-cell p { + font-size: 18px; +} +.mydata .mydata-content .mydata-table-view-cell .mydata-media-body { + font-size: 13px; +} + +.helpSaleTableRow .c1 { + font-size: 18px; + color: black; + line-height: 42px; + width: 34%; + display: inline-block; + text-align: center; +} + +.helpSaleTableRow .c2 { + font-size: 18px; + color: black; + line-height: 42px; + width: 34%; + display: inline-block; + text-align: center; +} + +.helpSaleTableRow .c3 { + font-size: 18px; + color: black; + line-height: 42px; + width: 30%; + display: inline-block; + text-align: center; +} +/* +.helpSaleTableRow .c4 { + font-size: 18px; + color: black; + line-height: 42px; + width: 16%; + display: inline-block; + text-align: center; +} + */ \ No newline at end of file diff --git a/static/app2/css/myshop.css b/static/app2/css/myshop.css old mode 100755 new mode 100644 index e44b119..7521834 --- a/static/app2/css/myshop.css +++ b/static/app2/css/myshop.css @@ -111,7 +111,7 @@ .myYouhuiquan_cb p { color: #525252; - font-size: 14px; + font-size: 18px; } .myYouhuiquan_cb .orange { @@ -136,7 +136,7 @@ } .order_title p { - font-size: 13.2px; + font-size: 17px; color: black; float: left; margin: 0; @@ -145,7 +145,7 @@ .order_title .order_more { color: #909090; - font-size: 15px; + font-size: 17px; float: right; margin: 0; margin-right: 12px; @@ -257,7 +257,7 @@ } .sgd-info { - font-size: 12px; + font-size: 16px; color: #000; margin: 5px auto; overflow: hidden; @@ -267,25 +267,27 @@ .sgd-price { display: flex; + flex-direction: row; justify-content: space-between; + align-items: center; } .market-price span { - font-size: 12px; + font-size: 15px; color: #000; } .market-price .price { color: #F02A40; /* font-size: 16px; */ - margin-left: 10px; + /* margin-left: 10px; */ } .youhuilv span { - font-size: 12px; + font-size: 15px; color: #000; } .youhuilv .preference-rate { - margin-left: 5px; + /* margin-left: 5px; */ } diff --git a/static/app2/css/myshops.css b/static/app2/css/myshops.css old mode 100755 new mode 100644 index b85b3c6..8d19014 --- a/static/app2/css/myshops.css +++ b/static/app2/css/myshops.css @@ -68,10 +68,11 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; + font-size: 18px; } .infocom { - font-size: 12px; + font-size: 16px; color: #ccc; margin: 0px 5px; } diff --git a/static/app2/css/notepad.css b/static/app2/css/notepad.css new file mode 100644 index 0000000..8e76621 --- /dev/null +++ b/static/app2/css/notepad.css @@ -0,0 +1,72 @@ +.row { + background: white; + width: 100%; + height: 84px; + border-bottom: 1px solid #ebebeb; + position: relative; + margin-bottom: 5px; +} + +.block{ + margin-top: 36px; + padding: 0 2%; +} + +.z{ + width: 100%; + height: 50px; +} + +.name { + font-size: 18px; + color: black; + line-height: 42px; + padding-left: 5px; +} + +[v-cloak] { + display: none; +} + +.left { + float: left; + margin-left: 5px; +} + +.right { + float: right; + margin-left: 5px; +} + +.small_title, +.created_time, +.updated_time { + font-size: 0.9rem; +} + +.operation { + font-size: 1rem; + line-height: 42px; + padding-right: 10px; + padding-left: 10px; + display: block; +} + +.edit { + background: yellowgreen; +} + +.delete { + background: red; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 50px; + line-height: 50px; + text-align: center; + border-top: 1px solid #e6e6e6; +} \ No newline at end of file diff --git a/static/app2/css/order_con.css b/static/app2/css/order_con.css old mode 100755 new mode 100644 index d877da6..4e1cc3b --- a/static/app2/css/order_con.css +++ b/static/app2/css/order_con.css @@ -1,183 +1,184 @@ -.ad { - background: -moz-linear-gradient(left, #f5364c, #e51329); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #f5364c, #e51329); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #f5364c, #e51329); - /*Opera11*/ - width: 100%; - height: 126px; - position: relative; -} - -.ad p { - position: absolute; - color: white; - margin: 0; - font-size: 13.2px; - top: 57px; - left: 36px; -} - -.address { - background: white; - /*border-bottom: 1px solid #e6e6e6;*/ - margin-bottom: 5px; - position: relative; -} - -.add_l { - float: left; - width: 39px; - position: absolute; - top: 0; - bottom: 0; -} - -.add_l img { - width: 21.6px; - height: 21.6px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - text-align: center; -} - -.add_r { - width: calc( 100% - 39px); - float: right; - padding-right: 9px; - font-size: 13.2px; - color: #909090; -} - -.add_r_t { - width: 100%; - padding: 6px 0 1px; -} - -.add_r_t_l { - float: left; -} - -.add_r_t_r { - float: right; -} - -.add_r_b { - width: 100%; - padding: 0 0 3px; -} - -.shop_info { - margin-bottom: 5px; -} - -.invoice_info { - width: 100%; - padding: 3px 9px; - background: white; - margin-bottom: 6px; -} - -.invoice_info p {} - -.cost { - border-bottom: 1px solid #e6e6e6; - background: white; - padding: 9px 9px; - border-radius: ; -} - -.c1 { - font-size: 12px; - color: #909090; -} - -.c1_l { - float: left; -} - -.c1_r { - float: right; -} - -.c2 { - font-size: 13.2px; - color: black; -} - -.cost .on { - color: #e51329; -} - -.jf_info { - width: 100%; - height: 45.6px; - background: white; - border-bottom: 1px solid #e6e6e6; -} - -.jf_jf { - margin-top: 10px; - margin-left: 10px; - color: #e51326; - font-size: 10.8px; - border: 1px solid #e51227; - border-radius: 3px; - float: left; - padding: 0 5px; -} - -.jf_p { - font-size: 13.2px; - color: #525252; - float: left; - margin-left: 10px; - line-height: 46px; -} - -.jf_p o { - color: #e51329; -} - -.lxmj { - width: 100%; - height: 51.6px; - position: relative; - background: white; - margin-bottom: 6px; - display: block; -} - -.lxmj img { - width: 15px; - position: absolute; - top: 50%; - left: 40%; - transform: translate(-50%, -50%); -} - -.lxmj p { - font-size: 13.2px; - color: #525252; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -.info { - width: 100%; - padding: 9px; - background: white; - margin-bottom: 6px ; -} - -.info p { - color: #909090; - font-size: 10.8px; +.ad { + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ + width: 100%; + height: 126px; + position: relative; +} + +.ad p { + position: absolute; + color: white; + margin: 0; + font-size: 13.2px; + top: 57px; + left: 36px; +} + +.address { + background: white; + /*border-bottom: 1px solid #e6e6e6;*/ + margin-bottom: 5px; + position: relative; +} + +.add_l { + float: left; + width: 39px; + position: absolute; + top: 0; + bottom: 0; +} + +.add_l img { + width: 21.6px; + height: 21.6px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + text-align: center; +} + +.add_r { + width: calc( 100% - 39px); + float: right; + padding-right: 9px; + font-size: 18px; + color: #909090; +} + +.add_r_t { + width: 100%; + padding: 6px 0 1px; +} + +.add_r_t_l { + float: left; +} + +.add_r_t_r { + float: right; +} + +.add_r_b { + width: 100%; + padding: 0 0 3px; +} + +.shop_info { + margin-bottom: 5px; +} + +.invoice_info { + width: 100%; + padding: 3px 9px; + background: white; + margin-bottom: 6px; + +} + +.invoice_info p {font-size: 17px;} + +.cost { + border-bottom: 1px solid #e6e6e6; + background: white; + padding: 9px 9px; + border-radius: ; +} + +.c1 { + font-size: 18px; + color: #909090; +} + +.c1_l { + float: left; +} + +.c1_r { + float: right; +} + +.c2 { + font-size: 18px; + color: black; +} + +.cost .on { + color: #e51329; +} + +.jf_info { + width: 100%; + height: 45.6px; + background: white; + border-bottom: 1px solid #e6e6e6; +} + +.jf_jf { + margin-top: 10px; + margin-left: 10px; + color: #e51326; + font-size: 16px; + border: 1px solid #e51227; + border-radius: 3px; + float: left; + padding: 0 5px; +} + +.jf_p { + font-size: 18px; + color: #525252; + float: left; + margin-left: 10px; + line-height: 46px; +} + +.jf_p o { + color: #e51329; +} + +.lxmj { + width: 100%; + height: 51.6px; + position: relative; + background: white; + margin-bottom: 6px; + display: block; +} + +.lxmj img { + width: 15px; + position: absolute; + top: 50%; + left: 35%; + transform: translate(-50%, -50%); +} + +.lxmj p { + font-size: 18px; + color: #525252; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.info { + width: 100%; + padding: 9px; + background: white; + margin-bottom: 6px ; +} + +.info p { + color: #909090; + font-size: 16px; } \ No newline at end of file diff --git a/static/app2/css/pay.css b/static/app2/css/pay.css old mode 100755 new mode 100644 index 7510146..b863fe3 --- a/static/app2/css/pay.css +++ b/static/app2/css/pay.css @@ -49,7 +49,7 @@ } .paynum { - font-size: 15px; + font-size: 18px; text-align: center; color: black; padding: 20px 0; @@ -70,6 +70,7 @@ .row_left { float: left; color: #909090; + font-size: 18px; } .row_right { @@ -77,6 +78,7 @@ color: black; padding-right: 15px; position: relative; + font-size: 18px; } .row_right img { @@ -107,13 +109,13 @@ margin: 0px; } #qlg_pay_pwd .con_2 .prod .info .p1{ - flex: 1; +/* flex: 1; */ padding: 0px; - margin: 0px 8px; + margin: 0px 0px; text-align: left; } #qlg_pay_pwd .con_2 .prod .info .p1 span{ - margin-left: 10px; + /* margin-left: 10px; */ } #qlg_pay_pwd .con_2 .shadown_wai input{ width: 40%; @@ -149,7 +151,10 @@ margin: 0; /* position: relative; */ } - +#pay_pwd,#qlg_pay_pwd .con_2 p{ + font-size: 16px; + +} #pay_pwd,#qlg_pay_pwd .con_1 input{ margin: 14px 5%; width: 70%; @@ -166,7 +171,8 @@ /* padding:10px; */ left:18%; /* right: 5%; */ - top:57px; + top:62px; + font-size: 16px } /* #pay_pwd,#qlg_pay_pwd .con_2 .p1{ diff --git a/static/app2/css/paymentVoucher.css b/static/app2/css/paymentVoucher.css old mode 100755 new mode 100644 diff --git a/static/app2/css/pj.css b/static/app2/css/pj.css old mode 100755 new mode 100644 index 755aab7..02c1c3f --- a/static/app2/css/pj.css +++ b/static/app2/css/pj.css @@ -25,7 +25,7 @@ body { .describe p { font-family: "微软雅黑"; - font-size: 13.2px; + font-size: 18px; float: left; line-height: 70.2px; margin-left: 5%; @@ -38,7 +38,7 @@ body { .row p { font-family: "微软雅黑"; - font-size: 13.2px; + font-size: 16px; float: left; line-height: 40px; margin-left: 5%; @@ -73,7 +73,7 @@ body { height: 76.2px; padding: 0; font-family: "微软雅黑"; - font-size: 12px; + font-size: 16px; margin-top: 5px; /*border: none;*/ } @@ -91,7 +91,7 @@ body { } .star_a{ float: left; - padding: 10px; + padding: 8px; width: 40px; height: 40px; margin-left: 2%; diff --git a/static/app2/css/properties.css b/static/app2/css/properties.css old mode 100755 new mode 100644 diff --git a/static/app2/css/qrrz.css b/static/app2/css/qrrz.css old mode 100755 new mode 100644 index 048d766..6375ef7 --- a/static/app2/css/qrrz.css +++ b/static/app2/css/qrrz.css @@ -14,6 +14,7 @@ border-radius: 5px; } .pname{ + font-size: 16px; width: 80%; color: #fff; @@ -24,18 +25,21 @@ text-align: right; } .caozuo { - width: 20%; + width: 15%; display: flex; justify-content: space-around; align-items: center; } .caozuo span { display: inline-block; - width: 25%; + /* width: 25%; */ + } + .caozuo .mui-icon{ + font-size: 32px; } .caozuo span img{ width: 100%; - + height: 100%; } .add1{ width: 96%; diff --git a/static/app2/css/recommend.css b/static/app2/css/recommend.css old mode 100755 new mode 100644 index 9c6ed1c..a3001a4 --- a/static/app2/css/recommend.css +++ b/static/app2/css/recommend.css @@ -3,10 +3,14 @@ padding: 0 1%; } .recommend_title{ - padding: 0 1%; + /* padding: 0 1%; + */ + margin: 2px auto; + height: 60px; } .recommend_title img{ width: 100%; + height: 100%; display: block; } .recommend_con{ @@ -37,12 +41,12 @@ -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; - font-size: 13px; + font-size: 15px; height: 42px; } .rcb_title span{ border-radius: 5px; - font-size: 11px; + font-size: 15px; color: white; background: #e6132c; padding: 0 2px; @@ -50,12 +54,12 @@ .rcb_pay{ margin-top: 2px; width: 100%; - font-size: 14px; + font-size: 17px; color: #e51329; } .rcb_pay span{ border: 1px solid #e51329; - font-size: 10px; + font-size: 13px; padding: 0 2px; border-radius: 5px; margin-left: 10px; @@ -68,14 +72,14 @@ } .rcb_bottom span{ color: #e51329; - font-size: 10px; + font-size: 15px; padding: 1px 2px; /* background: #FFD7D7; */ border-radius: 20px 0 0px 20px; } .rcb_bottom .s1{ color: white; - font-size: 10px; + font-size: 15px; padding: 1px 2px; background: -moz-linear-gradient(left, #e9c520, #ffad03); /*Mozilla*/ @@ -104,7 +108,7 @@ background: -o-linear-gradient(left, #a200ff, #6600ff); /*Opera11*/ color: white; - font-size: 12px; + font-size: 15px; padding: 0 3px; border-radius:4px; } diff --git a/static/app2/css/reviewsmanage.css b/static/app2/css/reviewsmanage.css old mode 100755 new mode 100644 diff --git a/static/app2/css/saoyisao.css b/static/app2/css/saoyisao.css old mode 100755 new mode 100644 diff --git a/static/app2/css/self_shop.css b/static/app2/css/self_shop.css old mode 100755 new mode 100644 diff --git a/static/app2/css/setting.css b/static/app2/css/setting.css old mode 100755 new mode 100644 index 40db993..152867d --- a/static/app2/css/setting.css +++ b/static/app2/css/setting.css @@ -1,114 +1,130 @@ -body .header1{ - z-index: 11; - width: 100%; - position: fixed; - top: 0; - background: rgba(255,255,255,1); - border: none; - box-shadow: 0 0 0; - height: 66px; - border-bottom: 1px solid #efefef; -} -.mui-bar-nav.mui-bar .mui-icon { - margin-left: 0; -} -.mui-title{ - color: #909090; -} -.header1 .on{ - border-bottom: 3px solid #ff0000; - color: #e61329; -} -.nav{ - padding: 0 50px; - height: 66px; - text-align: center; -} -.p1{ - color: #000; - display: block; - line-height: 46px; - font-size: 18px; - padding-top: 20px; -} -.header1 .mui-action-back { - margin-top: 20px; - margin-left: 0; - color: #848484; - float: left; -} - -.footer{ - position: fixed; - bottom: 0; - width: 100%; - background: white; - height: 49px; - border-top: 1px solid #e6e6e6; -} - -.z{ - width: 100%; - height: 66px; -} -.block{ - margin-top: 36px; - padding: 0 2%; -} - -.row{ - background: white; - width: 100%; - height: 42px; - border-bottom: 1px solid #ebebeb; - position: relative; - margin-bottom: 5px; -} -.row:last-child{ - border-bottom: none; -} - - - -.row .img{ - width: 15.6px; - position: absolute; - top: 12px; - left: 12px; -} -.r1{ - font-size: 13.2px; - color: black; - line-height: 42px; - position: absolute; - left: 35px; +body .header1{ + z-index: 11; + width: 100%; + position: fixed; + top: 0; + background: rgba(255,255,255,1); + border: none; + box-shadow: 0 0 0; + height: 66px; + border-bottom: 1px solid #efefef; } -.r2{ - font-size: 12px; - color: #909090; - line-height: 42px; - position: absolute; - right: 25px; -} -.row img.youjiantou{ - width: 6px; - position: absolute; - right: 10px; - top: 15px; -} -.loginout{ - width: 96%; - height: 42px; - line-height: 42px; - text-align: center; - margin: 36px 2%; - background: -moz-linear-gradient(left, #f5354b, #ff005a); - /*Mozilla*/ - background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5354b), to(#ff005a)); - /*Old gradient for webkit*/ - background: -webkit-linear-gradient(left, #f5354b, #ff005a); - /*new gradient for Webkit*/ - background: -o-linear-gradient(left, #f5354b, #ff005a); - /*Opera11*/ - color: #fff; -} +.mui-bar-nav.mui-bar .mui-icon { + margin-left: 0; +} +.mui-title{ + color: #909090; +} +.header1 .on{ + border-bottom: 3px solid #ff0000; + color: #e61329; +} +.nav{ + padding: 0 50px; + height: 66px; + text-align: center; +} +.p1{ + color: #000; + display: block; + line-height: 46px; + font-size: 18px; + padding-top: 20px; +} +.header1 .mui-action-back { + margin-top: 20px; + margin-left: 0; + color: #848484; + float: left; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 49px; + border-top: 1px solid #e6e6e6; +} + +.z{ + width: 100%; + height: 50px; +} +.block{ + margin-top: 36px; + padding: 0 2%; +} + +.row{ + background: white; + width: 100%; + height: 42px; + border-bottom: 1px solid #ebebeb; + position: relative; + margin-bottom: 5px; +} +.row:last-child{ + border-bottom: none; +} + + + +.row .img{ + width: 15.6px; + position: absolute; + top: 12px; + left: 12px; +} +.r1{ + font-size: 18px; + color: black; + line-height: 42px; + position: absolute; + left: 35px; +} +.r2{ + font-size: 18px; + color: #909090; + line-height: 42px; + position: absolute; + right: 25px; +} +.row img.youjiantou{ + width: 6px; + position: absolute; + right: 10px; + top: 15px; +} +.loginout{ + width: 96%; + height: 42px; + line-height: 42px; + text-align: center; + margin: 36px 2%; + background: -moz-linear-gradient(left, #f5354b, #ff005a); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5354b), to(#ff005a)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5354b, #ff005a); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5354b, #ff005a); + /*Opera11*/ + color: #fff; +} +.cancellation{ + width: 96%; + height: 42px; + line-height: 42px; + text-align: center; + margin: 36px 2%; + background: -moz-linear-gradient(left, #f5354b, #ff005a); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5354b), to(#ff005a)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5354b, #ff005a); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5354b, #ff005a); + /*Opera11*/ + color: #fff; +} \ No newline at end of file diff --git a/static/app2/css/setting_address.css b/static/app2/css/setting_address.css old mode 100755 new mode 100644 index 8fc13cd..32e2c42 --- a/static/app2/css/setting_address.css +++ b/static/app2/css/setting_address.css @@ -1,86 +1,110 @@ -.con .block{ - width: 100%; - height: 117px; - background: white; - border-bottom: 5px solid #ebebeb; - position: relative; -} -.pname{ - position: absolute; - font-size: 14.4px; - color: black; - left: 15px; - top: 15px; -} +.con .block{ + width: 100%; + height: 125px; + background: white; + border-bottom: 5px solid #ebebeb; + position: relative; +} +.pname{ + position: absolute; + font-size: 17px; + color: black; + left: 15px; + top: 15px; +} -.pphone{ - position: absolute; - font-size: 14.4px; - color: black; - right: 15px; - top: 15px; -} -.paddress{ - position: absolute; - font-size: 10.8px; - color: black; - left: 15px; - top: 40px; -} -.block hr{ - position: absolute; - width: 100%; - top: 60px; - border: none; - border-top: 1px dotted #909090; -} -.btnout{ - width: 42px; - height: 42px; - position: absolute; - bottom: 0; - padding: 12px; - left: 5px; -} -.btn{ - width: 100%; - height: 100%; - border-radius: 50%; - border: 1px solid #909090; -} -.btnout .on{ - border: none; - background: #e7172f; -} -.block .p1{ - position: absolute; - font-size: 12px; - color: black; - left: 40px; - bottom: 0px; - height: 42px; - padding: 0; - line-height: 42px; -} -button{ - padding-left: 20px; - padding-right: 20px; - position: absolute; - bottom: 5px; -} -.bj{ - right: 100px; -} -.del{ - right: 15px; -} -.footer_btn{ - width: 100%; - height: 50px; - border: none; - position: fixed; - bottom: 0; - background: #E5122B; - color: white; - border-radius: 0; -} +.pphone{ + position: absolute; + font-size: 17px; + color: black; + right: 15px; + top: 15px; +} +.paddress{ + position: absolute; + font-size: 17px; + color: black; + left: 15px; + top: 40px; +} +.block hr{ + position: absolute; + width: 100%; + top: 75px; + border: none; + border-top: 1px dotted #909090; +} +.btnout{ + width: 42px; + height: 42px; + position: absolute; + top:82px; + bottom: 0; + padding: 12px; + left: 5px; +} +.btn{ + width: 100%; + height: 100%; + border-radius: 50%; + border: 1px solid #909090; +} +.btnout .on{ + border: none; + background: #e7172f; +} +.block .p1{ + position: absolute; + font-size: 17px; + color: black; + left: 40px; + top:82px; + bottom: 0px; + height: 42px; + padding: 0; + line-height: 42px; +} +button{ +/* padding-left: 20px; + padding-right: 20px; */ + position: absolute; + bottom: 5px; + top:88px; + padding: 2px 20px; + font-size: 17px; +} +.bj{ + right: 100px; + +} +.del{ + right: 15px; + +} +.footer_btn{ + width: 100%; + height: 50px; + border: none; + position: fixed; + bottom: 0; + background: #E5122B; + color: white; + border-radius: 0; +} +.footer{ + position: fixed; + bottom: 0; + width: 100%; + height: 50px; + line-height: 50px; + text-align: center; + background: -moz-linear-gradient(left, #f5354b, #ff005a); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5354b), to(#ff005a)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5354b, #ff005a); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5354b, #ff005a); + /*Opera11*/ + color: #fff; +} \ No newline at end of file diff --git a/static/app2/css/sha.css b/static/app2/css/sha.css old mode 100755 new mode 100644 index e8cf3bc..6417234 --- a/static/app2/css/sha.css +++ b/static/app2/css/sha.css @@ -1,13 +1,13 @@ -.top { - width: 100%; - height: 16px; - background: white; -} - -.con { - width: 100%; - padding: 0 2%; - transform: translateY(-16px); - position: relative; - z-index: 1000; -} +.top { + width: 100%; + height: 16px; + background: white; +} + +.con { + width: 100%; + padding: 0 2%; + transform: translateY(-16px); + position: relative; + z-index: 1000; +} diff --git a/static/app2/css/shop_decorate.css b/static/app2/css/shop_decorate.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shop_indentcon.css b/static/app2/css/shop_indentcon.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shopdecoration.css b/static/app2/css/shopdecoration.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shopgoodlist.css b/static/app2/css/shopgoodlist.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shoppingcart.css b/static/app2/css/shoppingcart.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shopsList.css b/static/app2/css/shopsList.css old mode 100755 new mode 100644 diff --git a/static/app2/css/shopsetting.css b/static/app2/css/shopsetting.css old mode 100755 new mode 100644 diff --git a/static/app2/css/store_commodity.css b/static/app2/css/store_commodity.css old mode 100755 new mode 100644 diff --git a/static/app2/css/store_home.css b/static/app2/css/store_home.css old mode 100755 new mode 100644 diff --git a/static/app2/css/store_info.css b/static/app2/css/store_info.css old mode 100755 new mode 100644 diff --git a/static/app2/css/storeout.css b/static/app2/css/storeout.css old mode 100755 new mode 100644 index 20a7ea0..8759766 --- a/static/app2/css/storeout.css +++ b/static/app2/css/storeout.css @@ -159,7 +159,18 @@ body .header { justify-content: center; align-items: center; } - +.gt_con span{ + font-size: 18px; + /* overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; */ + } + .gt_con .shopAddress{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 200px; + } .goimg { display: inline-block; width: 20px; diff --git a/static/app2/css/swiper.min.css b/static/app2/css/swiper.min.css old mode 100755 new mode 100644 diff --git a/static/app2/css/trade_rule.css b/static/app2/css/trade_rule.css new file mode 100644 index 0000000..48f1cf2 --- /dev/null +++ b/static/app2/css/trade_rule.css @@ -0,0 +1,77 @@ +.row { + background: white; + width: 100%; + height: 62px; + border-bottom: 1px solid #ebebeb; + position: relative; + margin-bottom: 5px; +} + +.block{ + margin-top: 36px; + padding: 0 2%; +} + +.z{ + width: 100%; + height: 50px; +} + +.name { + font-size: 18px; + color: black; + line-height: 42px; + padding-left: 5px; +} + +[v-cloak] { + display: none; +} + +.left { + float: left; + margin-left: 5px; +} + +.right { + float: right; + margin-left: 5px; +} +.youjiantou{ + width: 6px; + position: absolute; + right: 10px; + top: 25px; +} +.small_title, +.created_time, +.updated_time { + font-size: 0.9rem; +} + +.operation { + font-size: 1rem; + line-height: 42px; + padding-right: 10px; + padding-left: 10px; + display: block; +} + +.edit { + background: yellowgreen; +} + +.delete { + background: red; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 50px; + line-height: 50px; + text-align: center; + border-top: 1px solid #e6e6e6; +} \ No newline at end of file diff --git a/static/app2/css/upload.css b/static/app2/css/upload.css old mode 100755 new mode 100644 diff --git a/static/app2/css/vouchers.css b/static/app2/css/vouchers.css old mode 100755 new mode 100644 diff --git a/static/app2/css/yhk.css b/static/app2/css/yhk.css old mode 100755 new mode 100644 diff --git a/static/app2/css/zhuweiba.css b/static/app2/css/zhuweiba.css old mode 100755 new mode 100644 diff --git a/static/app2/img/+.png b/static/app2/img/+.png new file mode 100644 index 0000000..2692856 Binary files /dev/null and b/static/app2/img/+.png differ diff --git a/static/app2/img/1.png b/static/app2/img/1.png old mode 100755 new mode 100644 index 950d16a..afbdf1a Binary files a/static/app2/img/1.png and b/static/app2/img/1.png differ diff --git a/static/app2/img/11223456.png b/static/app2/img/11223456.png new file mode 100644 index 0000000..a1d0a42 Binary files /dev/null and b/static/app2/img/11223456.png differ diff --git a/static/app2/img/2.png b/static/app2/img/2.png old mode 100755 new mode 100644 index 1518343..7cf548d Binary files a/static/app2/img/2.png and b/static/app2/img/2.png differ diff --git a/static/app2/img/2_0.png b/static/app2/img/2_0.png new file mode 100644 index 0000000..867c967 Binary files /dev/null and b/static/app2/img/2_0.png differ diff --git a/static/app2/img/2_1.png b/static/app2/img/2_1.png new file mode 100644 index 0000000..cf4a79b Binary files /dev/null and b/static/app2/img/2_1.png differ diff --git a/static/app2/img/3.png b/static/app2/img/3.png old mode 100755 new mode 100644 index 29a169e..4e3cdfd Binary files a/static/app2/img/3.png and b/static/app2/img/3.png differ diff --git a/static/app2/img/4.png b/static/app2/img/4.png old mode 100755 new mode 100644 index 23979ab..9896764 Binary files a/static/app2/img/4.png and b/static/app2/img/4.png differ diff --git a/static/app2/img/5.png b/static/app2/img/5.png old mode 100755 new mode 100644 index cc7cc3a..b82284b Binary files a/static/app2/img/5.png and b/static/app2/img/5.png differ diff --git a/static/app2/img/ac1111_title.png b/static/app2/img/ac1111_title.png new file mode 100644 index 0000000..ba3da46 Binary files /dev/null and b/static/app2/img/ac1111_title.png differ diff --git a/static/app2/img/acbg1111.png b/static/app2/img/acbg1111.png new file mode 100644 index 0000000..b82e389 Binary files /dev/null and b/static/app2/img/acbg1111.png differ diff --git a/static/app2/img/activity_jt.png b/static/app2/img/activity_jt.png new file mode 100644 index 0000000..a3b79ae Binary files /dev/null and b/static/app2/img/activity_jt.png differ diff --git a/static/app2/img/adds_title_bg1.png b/static/app2/img/adds_title_bg1.png new file mode 100644 index 0000000..677c906 Binary files /dev/null and b/static/app2/img/adds_title_bg1.png differ diff --git a/static/app2/img/adds_title_bg2.png b/static/app2/img/adds_title_bg2.png new file mode 100644 index 0000000..1a29000 Binary files /dev/null and b/static/app2/img/adds_title_bg2.png differ diff --git a/static/app2/img/adds_title_bg3.png b/static/app2/img/adds_title_bg3.png new file mode 100644 index 0000000..4828144 Binary files /dev/null and b/static/app2/img/adds_title_bg3.png differ diff --git a/static/app2/img/adds_title_bg4.png b/static/app2/img/adds_title_bg4.png new file mode 100644 index 0000000..eb70330 Binary files /dev/null and b/static/app2/img/adds_title_bg4.png differ diff --git a/static/app2/img/adds_title_bg5.png b/static/app2/img/adds_title_bg5.png new file mode 100644 index 0000000..0ab56e3 Binary files /dev/null and b/static/app2/img/adds_title_bg5.png differ diff --git a/static/app2/img/aixin.png b/static/app2/img/aixin.png new file mode 100644 index 0000000..ea7b51f Binary files /dev/null and b/static/app2/img/aixin.png differ diff --git a/static/app2/img/banner_ectin.png b/static/app2/img/banner_ectin.png new file mode 100644 index 0000000..0ff3186 Binary files /dev/null and b/static/app2/img/banner_ectin.png differ diff --git a/static/app2/img/be.png b/static/app2/img/be.png new file mode 100644 index 0000000..7aa2dc1 Binary files /dev/null and b/static/app2/img/be.png differ diff --git a/static/app2/img/beiwang.png b/static/app2/img/beiwang.png new file mode 100644 index 0000000..65f0f9c Binary files /dev/null and b/static/app2/img/beiwang.png differ diff --git a/static/app2/img/beiwanglu.png b/static/app2/img/beiwanglu.png new file mode 100644 index 0000000..6cc5c31 Binary files /dev/null and b/static/app2/img/beiwanglu.png differ diff --git a/static/app2/img/bg_miaosha.png b/static/app2/img/bg_miaosha.png new file mode 100644 index 0000000..b8fe5e9 Binary files /dev/null and b/static/app2/img/bg_miaosha.png differ diff --git a/static/app2/img/bg_pay_list.png b/static/app2/img/bg_pay_list.png new file mode 100644 index 0000000..861a63b Binary files /dev/null and b/static/app2/img/bg_pay_list.png differ diff --git a/static/app2/img/bianji.png b/static/app2/img/bianji.png new file mode 100644 index 0000000..882421b Binary files /dev/null and b/static/app2/img/bianji.png differ diff --git a/static/app2/img/bianji3.png b/static/app2/img/bianji3.png new file mode 100644 index 0000000..e8de503 Binary files /dev/null and b/static/app2/img/bianji3.png differ diff --git a/static/app2/img/bianji9.png b/static/app2/img/bianji9.png new file mode 100644 index 0000000..89b8a8d Binary files /dev/null and b/static/app2/img/bianji9.png differ diff --git a/static/app2/img/bianjiblack.png b/static/app2/img/bianjiblack.png new file mode 100644 index 0000000..99a92a0 Binary files /dev/null and b/static/app2/img/bianjiblack.png differ diff --git a/static/app2/img/bianjihei.png b/static/app2/img/bianjihei.png new file mode 100644 index 0000000..1014c4f Binary files /dev/null and b/static/app2/img/bianjihei.png differ diff --git a/static/app2/img/button.png b/static/app2/img/button.png new file mode 100644 index 0000000..001037f Binary files /dev/null and b/static/app2/img/button.png differ diff --git a/static/app2/img/button2.png b/static/app2/img/button2.png new file mode 100644 index 0000000..b0d50a6 Binary files /dev/null and b/static/app2/img/button2.png differ diff --git a/static/app2/img/cainixihuan.png b/static/app2/img/cainixihuan.png old mode 100755 new mode 100644 diff --git a/static/app2/img/class.png b/static/app2/img/class.png new file mode 100644 index 0000000..d6cd940 Binary files /dev/null and b/static/app2/img/class.png differ diff --git a/static/app2/img/classmenu.png b/static/app2/img/classmenu.png old mode 100755 new mode 100644 diff --git a/static/app2/img/close.png b/static/app2/img/close.png old mode 100755 new mode 100644 diff --git a/static/app2/img/com.png b/static/app2/img/com.png new file mode 100644 index 0000000..b1adb05 Binary files /dev/null and b/static/app2/img/com.png differ diff --git a/static/app2/img/common.js b/static/app2/img/common.js new file mode 100644 index 0000000..422bc63 --- /dev/null +++ b/static/app2/img/common.js @@ -0,0 +1,856 @@ +$(function() { + var act = "store_list"; + if (act == "store_list") { + $('#search ul.tab li span').eq(0).html('店铺'); + $('#search ul.tab li span').eq(1).html('商品'); + $('#search ul.tab li').eq(0).attr('act', 'store_list'); + $('#search-form').attr("action", HOMESITEURL+"/Storelist/index.html"); + + } + $('#search').hover(function() { + $('#search ul.tab li').eq(1).show(); + $('#search ul.tab li i').addClass('over').removeClass('arrow'); + }, function() { + $('#search ul.tab li').eq(1).hide(); + $('#search ul.tab li i').addClass('arrow').removeClass('over'); + }); + $('#search ul.tab li').eq(1).click(function() { + $(this).hide(); + if ($(this).find('span').html() == '店铺') { + $('#keyword').attr("placeholder", "请输入您要搜索的店铺关键字"); + $('#search ul.tab li span').eq(0).html('店铺'); + $('#search ul.tab li span').eq(1).html('商品'); + $('#search-form').attr("action", HOMESITEURL+"/Storelist/index.html"); + } else { + $('#keyword').attr('placeholder', '请输入您要搜索的商品关键字'); + $('#search ul.tab li span').eq(0).html('商品'); + $('#search ul.tab li span').eq(1).html('店铺'); + $('#search-form').attr("action", HOMESITEURL+"/Search/index.html"); + } + $("#keyword").focus(); + }); +}); +function drop_confirm(msg, url){ + if(confirm(msg)){ + window.location = url; + } +} +function ajax_confirm(msg, url){ + if(confirm(msg)){ + ajaxget(url); + } +} +function go(url){ + window.location = url; +} + + +/* 格式化金额 */ +function price_format(price){ + if(typeof(PRICE_FORMAT) == 'undefined'){ + PRICE_FORMAT = '¥%s'; + } + price = number_format(price, 2); +// return PRICE_FORMAT.replace('%s', price); + return price; +} +function number_format(num, ext){ + if(ext < 0){ + return num; + } + num = Number(num); + if(isNaN(num)){ + num = 0; + } + var _str = num.toString(); + var _arr = _str.split('.'); + var _int = _arr[0]; + var _flt = _arr[1]; + if(_str.indexOf('.') == -1){ + /* 找不到小数点,则添加 */ + if(ext == 0){ + return _str; + } + var _tmp = ''; + for(var i = 0; i < ext; i++){ + _tmp += '0'; + } + _str = _str + '.' + _tmp; + }else{ + if(_flt.length == ext){ + return _str; + } + /* 找得到小数点,则截取 */ + if(_flt.length > ext){ + _str = _str.substr(0, _str.length - (_flt.length - ext)); + if(ext == 0){ + _str = _int; + } + }else{ + for(var i = 0; i < ext - _flt.length; i++){ + _str += '0'; + } + } + } + + return _str; +} + +/* 火狐下取本地全路径 */ +function getFullPath(obj) +{ + if(obj) + { + //ie + if (window.navigator.userAgent.indexOf("MSIE")>=1) + { + obj.select(); + if(window.navigator.userAgent.indexOf("MSIE") == 25){ + obj.blur(); + } + return document.selection.createRange().text; + } + //firefox + else if(window.navigator.userAgent.indexOf("Firefox")>=1) + { + if(obj.files) + { + //return obj.files.item(0).getAsDataURL(); + return window.URL.createObjectURL(obj.files.item(0)); + } + return obj.value; + } + return obj.value; + } +} +/* 转化JS跳转中的 & */ +function transform_char(str) +{ + if(str.indexOf('&')) + { + str = str.replace(/&/g, "%26"); + } + return str; +} + +//图片垂直水平缩放裁切显示 +(function($){ + $.fn.VMiddleImg = function(options) { + var defaults={ + "width":null, + "height":null + }; + var opts = $.extend({},defaults,options); + return $(this).each(function() { + var $this = $(this); + var objHeight = $this.height(); //图片高度 + var objWidth = $this.width(); //图片宽度 + var parentHeight = opts.height||$this.parent().height(); //图片父容器高度 + var parentWidth = opts.width||$this.parent().width(); //图片父容器宽度 + var ratio = objHeight / objWidth; + if (objHeight > parentHeight && objWidth > parentWidth) { + if (objHeight > objWidth) { //赋值宽高 + $this.width(parentWidth); + $this.height(parentWidth * ratio); + } else { + $this.height(parentHeight); + $this.width(parentHeight / ratio); + } + objHeight = $this.height(); //重新获取宽高 + objWidth = $this.width(); + if (objHeight > objWidth) { + $this.css("top", (parentHeight - objHeight) / 2); + //定义top属性 + } else { + //定义left属性 + $this.css("left", (parentWidth - objWidth) / 2); + } + } + else { + if (objWidth > parentWidth) { + $this.css("left", (parentWidth - objWidth) / 2); + } + $this.css("top", (parentHeight - objHeight) / 2); + } + }); + }; +})(jQuery); +function DrawImage(ImgD,FitWidth,FitHeight){ + var image=new Image(); + image.src=ImgD.src; + if(image.width>0 && image.height>0) + { + if(image.width/image.height>= FitWidth/FitHeight) + { + if(image.width>FitWidth) + { + ImgD.width=FitWidth; + ImgD.height=(image.height*FitWidth)/image.width; + } + else + { + ImgD.width=image.width; + ImgD.height=image.height; + } + } + else + { + if(image.height>FitHeight) + { + ImgD.height=FitHeight; + ImgD.width=(image.width*FitHeight)/image.height; + } + else + { + ImgD.width=image.width; + ImgD.height=image.height; + } + } + } +} + +/** + * 浮动DIV定时显示提示信息,如操作成功, 失败等 + * @param string tips (提示的内容) + * @param int height 显示的信息距离浏览器顶部的高度 + * @param int time 显示的时间(按秒算), time > 0 + * @sample 点击 + * @sample 上面代码表示点击后显示操作成功3秒钟, 距离顶部100px + * @copyright ZhouHr 2010-08-27 + */ +function showTips( tips, height, time ){ + var windowWidth = document.documentElement.clientWidth; + var tipsDiv = '
' + tips + '
'; + + $( 'body' ).append( tipsDiv ); + $( 'div.tipsClass' ).css({ + 'top' : 200 + 'px', + 'left' : ( windowWidth / 2 ) - ( tips.length * 13 / 2 ) + 'px', + 'position' : 'fixed', + 'padding' : '20px 50px', + 'background': '#EAF2FB', + 'font-size' : 14 + 'px', + 'margin' : '0 auto', + 'text-align': 'center', + 'width' : 'auto', + 'color' : '#333', + 'border' : 'solid 1px #A8CAED', + 'opacity' : '0.90', + 'z-index' : '9999' + }).show(); + setTimeout( function(){$( 'div.tipsClass' ).fadeOut().remove();}, ( time * 1000 ) ); +} + +function trim(str) { + return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, ''); +} +//弹出框登录 +function login_dialog(){ + CUR_DIALOG = ajax_form('login','登录',HOMESITEURL+'/Login/login.html?inajax=1',360,1); +} + +/* 显示Ajax表单 */ +function ajax_form(id, title, url, width, model) +{ + if (!width) width = 480; + if (!model) model = 1; + var d = DialogManager.create(id); + d.setTitle(title); + d.setContents('ajax', url); + d.setWidth(width); + d.show('center',model); + return d; +} +//显示一个内容为自定义HTML内容的消息 +function html_form(id, title, _html, width, model) { + if (!width) width = 480; + if (!model) model = 0; + var d = DialogManager.create(id); + d.setTitle(title); + d.setContents(_html); + d.setWidth(width); + d.show('center',model); + return d; +} +//收藏店铺js +function collect_store(fav_id, jstype, jsobj) { + $.get(HOMESITEURL+'/Memberfavorites/checkLogin', function(result) { + if (result == '0') { + login_dialog(); + } else { + var url = HOMESITEURL+'/Memberfavorites/favoritesstore'; + $.getJSON(url, {'fid': fav_id}, function(data) { + if (data.done) { + showDialog(data.msg, 'succ', '', '', '', '', '', '', '', '', 2); + if (jstype == 'count') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html(parseInt($(this).text()) + 1); + }); + } + if (jstype == 'succ') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html("收藏成功"); + }); + } + if (jstype == 'store') { + $('[ds_store="' + fav_id + '"]').each(function() { + $(this).before(' '); + $(this).remove(); + }); + } + } + else + { + showDialog(data.msg, 'notice'); + } + }); + } + }); +} +//收藏商品js +function collect_goods(fav_id, jstype, jsobj) { + $.get(HOMESITEURL+'/Memberfavorites/checkLogin', function(result) { + if (result.done == '0') { + login_dialog(); + } else { + var url = HOMESITEURL+'/Memberfavorites/favoritesgoods'; + $.getJSON(url, {'fid': fav_id}, function(data) { + if (data.done) + { + showDialog(data.msg, 'succ', '', '', '', '', '', '', '', '', 2); + if (jstype == 'count') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html(parseInt($(this).text()) + 1); + }); + } + if (jstype == 'succ') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html("收藏成功"); + }); + } + } + else + { + showDialog(data.msg, 'notice'); + } + }); + } + }); +} + +//加载购物车信息 +function load_cart_information() { + $.getJSON(HOMESITEURL + '/Cart/ajax_load', function(result) { + var obj = $('.header .user_menu .my-cart'); + var mini =$('#rtoolbar_cartlist'); + if (result) { + var html = ''; + if (result.cart_goods_num > 0) { + for (var i = 0; i < result['list'].length; i++) { + var goods = result['list'][i]; + html += '
' + goods['goods_name'] + '
'; + html += '
'; + html += '
'; + html += '
¥' + goods['goods_price'] + '×' + goods['goods_num'] + '
'; + html += '
删除
'; + html += "
"; + } + obj.find('.incart-goods').html(html); + obj.find('.incart-goods-box').perfectScrollbar('destroy'); + obj.find('.incart-goods-box').perfectScrollbar({suppressScrollX: true}); + html = "共" + result.cart_goods_num + "种商品  总计金额:¥" + result.cart_all_price + ""; + obj.find('.total-price').html(html); + mini.find('.total-price').html(html); + if (obj.find('.addcart-goods-num').size() == 0) { + obj.append('
0
'); + } + obj.find('.addcart-goods-num').html(result.cart_goods_num); + $('#rtoobar_cart_count').html(result.cart_goods_num).show(); + } else { + html = "
您的购物车中暂无商品,赶快选择心爱的商品吧!
"; + obj.find('.incart-goods').html(html); + mini.find('.total-price').html(html); + obj.find('.total-price').html(''); + $('.addcart-goods-num').remove(); + $('#rtoobar_cart_count').html('').hide(); + } + } + }); +} + +//头部删除购物车信息,登录前使用goods_id,登录后使用cart_id +function drop_topcart_item(cart_id, goods_id) { + $.getJSON(HOMESITEURL + '/Cart/del',{'cart_id': cart_id, 'goods_id': goods_id}, function(result) { + if (result.state == 'true') { + $("[ds_type='cart_item_"+cart_id+"']").remove(); + load_cart_information(); + } else { + alert(result.msg); + } + }); +} + +//加载最近浏览的商品 +function load_history_information(){ + $.getJSON(HOMESITEURL+'/Index/viewed_info.html', function(result){ + var obj = $('.header .user_menu .my-mall'); + if(result['m_id'] >0){ + if (typeof result['consult'] !== 'undefined') obj.find('#member_consult').html(result['consult']); + if (typeof result['consult'] !== 'undefined') obj.find('#member_voucher').html(result['voucher']); + } + var goods_id = 0; + var text_append = ''; + var n = 0; + if (typeof result['viewed_goods'] !== 'undefined') { + for (goods_id in result['viewed_goods']) { + var goods = result['viewed_goods'][goods_id]; + text_append += '
  • '+goods['goods_name']+''; + text_append += '
  • '; + n++; + if (n > 4) break; + } + } + if (text_append == '') text_append = '
  • 暂无商品
  • ';; + obj.find('.browse-history ul').html(text_append); + }); +} + +/* + * 弹出窗口 + */ +(function($) { + $.fn.ds_show_dialog = function(options) { + + var that = $(this); + var settings = $.extend({}, {width: 480, title: '', close_callback: function() {}}, options); + + var init_dialog = function(title) { + var _div = that; + that.addClass("dialog_wrapper"); + that.wrapInner(function(){ + return '
    '; + }); + that.wrapInner(function(){ + return '
    '; + }); + that.find('.dialog_body').prepend('

    '+settings.title+'X

    '); + that.append('
    '); + + $(".dialog_close_button").click(function(){ + settings.close_callback(); + _div.hide(); + }); + + that.draggable({handle: ".dialog_head"}); + }; + + if(!$(this).hasClass("dialog_wrapper")) { + init_dialog(settings.title); + } + settings.left = $(window).scrollLeft() + ($(window).width() - settings.width) / 2; + settings.top = ($(window).height() - $(this).height()) / 2; + $(this).attr("style","display:none; z-index: 1100; position: fixed; width: "+settings.width+"px; left: "+settings.left+"px; top: "+settings.top+"px;"); + $(this).show(); + + }; +})(jQuery); +/** + * Membership card + * + * + * Example: + * + * HTML part + * + * + * JAVASCRIPT part + * + * + * $('a[dstype="mcard"]').membershipCard(); + */ +(function($){ + $.fn.membershipCard = function(options){ + var defaults = { + type:'' + }; + options = $.extend(defaults,options); + return this.each(function(){ + var $this = $(this); + var data_str = $(this).attr('data-param');eval('data_str = '+data_str); + var _uri = HOMESITEURL+'/Membercard/index.html?callback=?&uid='+data_str.id+'&from='+options.type; + $this.qtip({ + content: { + text: 'Loading...', + ajax: { + url: _uri, + type: 'GET', + dataType: 'jsonp', + success: function(data) { + if(data){ + var _dl = $('
    '); + // sex + $('
    ').append('') + .append(''+data.name+''+(data.truename != ''?'('+data.truename+')':'')) + .appendTo(_dl); + // avatar + $('
    ') + .appendTo(_dl); + // info + var _info = ''; + if(typeof connect !== 'undefined' && connect === 1 && data.follow != 2){ + var class_html = 'chat_offline'; + var text_html = '离线'; + if (typeof user_list[data.id] !== 'undefined' && user_list[data.id]['online'] > 0 ) { + class_html = 'chat_online'; + text_html = '在线'; + } + _info += ''+text_html+''; + } + if(data.qq != ''){ + _info += ''; + } + if(data.ww != ''){ + _info += '点击这里给我发消息'; + } + if(_info == ''){ + _info = '--'; + } + var _ul = $('
      ').append('
    • 城市:'+((data.areainfo != null)?data.areainfo:'--')+'
    • ') + .append('
    • 生日:'+((data.birthday != null)?data.birthday:'--')+'
    • ') + .append('
    • 联系:'+_info+'
    • ').appendTo('
      ').parent().appendTo(_dl); + // ajax info + if(data.url != ''){ + $.getJSON(data.url+'/Membercard/mcard_info&uid='+data.id, function(d){ + if(d){ + eval('var msg = '+options.type+'_function(d);'); + msg.appendTo(_dl); + } + }); + data.url = ''; + } + + // bottom + var _bottom; + if(data.follow != 2){ + _bottom = $('
      '); + var _a; + if(data.follow == 1){ + $('') + .append('已关注') + .append('取消关注').find('a[dstype="nofollow"]').click(function(){ + onfollow($(this)); + }).end().appendTo(_bottom); + }else{ + $('') + .append('加关注').find('a[dstype="follow"]').click(function(){ + follow($(this)); + }).end().appendTo(_bottom); + } + $('').appendTo(_bottom); + } + + var _content = $('
      ').append(_dl).append(_bottom); + this.set('content.text', ' ');this.set('content.text', _content); + } + } + } + }, + position: { + viewport: $(window) + }, + hide: { + fixed: true, + delay: 300 + }, + style: 'qtip-wiki' + }); + }); + function follow(o){ + var data_str = o.parent().attr('data-param'); + eval( "data_str = "+data_str); + $.getJSON(HOMESITEURL+'/Membersnsfriend/addfollow.html?callback=?&mid='+data_str.mid, function(data){ + if(data){ + $('[dstype="follow-handle'+data_str.mid+'"]').html('已关注 取消关注').find('a[dstype="nofollow"]').click(function(){ + onfollow($(this)); + }); + } + }); + } + function onfollow(o){ + var data_str = o.parent().attr('data-param'); + eval( "data_str = "+data_str); + $.getJSON(HOMESITEURL+'/Membersnsfriend/delfollow.html?callback=?&mid='+data_str.mid, function(data){ + if(data){ + $('[dstype="follow-handle'+data_str.mid+'"]').html('加关注').find('a[dstype="follow"]').click(function(){ + follow($(this)); + }); + } + }); + } + function shop_function(d){ + return $('
      买家信用:'+((d.member_credit == 0)?'暂无信用':d.member_credit)+'
      '); + } + }; +})(jQuery); + + + + +(function($) { + $.fn.ds_region = function(options) { + var $region = $(this); + var settings = $.extend({}, { + area_id: 0, + region_span_class: "_region_value", + src: "cache", + show_deep: 0, + btn_style_html: "", + tip_type: "" + }, options); + settings.islast = false; + settings.selected_deep = 0; + settings.last_text = ""; + this.each(function() { + var $inputArea = $(this); + if ($inputArea.val() === "") { + initArea($inputArea) + } else { + var $region_span = $('' + $inputArea.val() + ""); + var $region_btn = $(''); + $inputArea.after($region_span); + $region_span.after($region_btn); + $region_btn.on("click", function() { + $region_span.remove(); + $region_btn.remove(); + initArea($inputArea) + }); + settings.islast = true + } + this.settings = settings; + if ($inputArea.val() && /^\d+$/.test($inputArea.val())) { + $.getJSON(HOMESITEURL + "/Index/json_area_show?area_id=" + $inputArea.val() + "&callback=?", function(data) { + $("#_area_span").html(data.text == null ? "无" : data.text) + }) + } + }); + + function initArea($inputArea) { + settings.$area = $(""); + $inputArea.before(settings.$area); + loadAreaArray(function() { + loadArea(settings.$area, settings.area_id) + }) + } + function loadArea($area, area_id) { + if ($area && ds_a[area_id].length > 0) { + var areas = []; + areas = ds_a[area_id]; + if (settings.tip_type && settings.last_text != "") { + $area.append("") + } else { + $area.append("") + } + for (i = 0; i < areas.length; i++) { + $area.append("") + } + settings.islast = false + } + $area.on("change", function() { + var region_value = "", + area_ids = [], + selected_deep = 1; + $(this).nextAll("select").remove(); + $region.parent().find("select").each(function() { + if ($(this).find("option:selected").val() != "") { + region_value += $(this).find("option:selected").text() + " "; + area_ids.push($(this).find("option:selected").val()) + } + }); + settings.selected_deep = area_ids.length; + settings.area_ids = area_ids.join(" "); + $region.val(region_value); + settings.area_id_1 = area_ids[0] ? area_ids[0] : ""; + settings.area_id_2 = area_ids[1] ? area_ids[1] : ""; + settings.area_id_3 = area_ids[2] ? area_ids[2] : ""; + settings.area_id_4 = area_ids[3] ? area_ids[3] : ""; + settings.last_text = $region.prevAll("select").find("option:selected").last().text(); + var area_id = settings.area_id = $(this).val(); + if ($('#_area_1').length > 0) $("#_area_1").val(settings.area_id_1); + if ($('#_area_2').length > 0) $("#_area_2").val(settings.area_id_2); + if ($('#_area_3').length > 0) $("#_area_3").val(settings.area_id_3); + if ($('#_area_4').length > 0) $("#_area_4").val(settings.area_id_4); + if ($('#_area').length > 0) $("#_area").val(settings.area_id); + if ($('#_areas').length > 0) $("#_areas").val(settings.area_ids); + if (settings.show_deep > 0 && $region.prevAll("select").size() == settings.show_deep) { + settings.islast = true; + if (typeof settings.last_click == 'function') { + settings.last_click(area_id); + } + return + } + if (area_id > 0) { + if (ds_a[area_id] && ds_a[area_id].length > 0) { + var $newArea = $(""); + $(this).after($newArea); + loadArea($newArea, area_id); + settings.islast = false + } else { + settings.islast = true; + if (typeof settings.last_click == 'function') { + settings.last_click(area_id); + } + } + } else { + settings.islast = false + } + if ($('#islast').length > 0) $("#islast").val(""); + }) + } + function loadAreaArray(callback) { + if (typeof ds_a === "undefined") { + $.getJSON(HOMESITEURL + "/Index/json_area.html?src=" + settings.src + "&callback=?", function(data) { + ds_a = data; + callback() + }) + } else { + callback() + } + } + if (typeof jQuery.validator != 'undefined') { + jQuery.validator.addMethod("checklast", function(value, element) { + return $(element).fetch('islast'); + }, "请将地区选择完整"); + } + }; + $.fn.fetch = function(k) { + var p; + this.each(function() { + if (this.settings) { + p = eval("this.settings." + k); + return false + } + }); + return p + } + + +})(jQuery); + +/* 加入购物车 */ +function addcart(goods_id, quantity, callbackfunc,dir) { + + var url = HOMESITEURL + '/Cart/add.html'; + quantity = parseInt(quantity); + $.getJSON(url, {'goods_id': goods_id, 'quantity': quantity}, function(data) { + if (data != null) { + if (data.state) { + if (callbackfunc) { + eval(callbackfunc + "(data)"); + } + // 头部加载购物车信息 + load_cart_information(); + $("#rtoolbar_cartlist").load(HOMESITEURL + '/Cart/ajax_load?type=html'); + if(dir) { + showDialog('添加购物车成功', 'succ', '', '', '', '', '', '', '', '', 2); + } + } else { + alert(data.msg); + } + } + }); +} + +function setCookie(name, value, days) { + var exp = new Date(); + exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000); + var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); + document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); +} +function getCookie(name) { + var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); + if (arr != null) { + return unescape(arr[2]); + return null; + } +} +function delCookie(name) { + var exp = new Date(); + exp.setTime(exp.getTime() - 1); + var cval = getCookie(name); + if (cval != null) { + document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); + } +} + + +(function($) { + $.show_ds_login = function(options) { + var settings = $.extend({}, {action:HOMESITEURL+'/Login/login.html?inajax=1', nchash:'', formhash:'' ,anchor:''}, options); + var login_dialog_html = $(''); + var ref_url = document.location.href; + login_dialog_html.append('
      ').find('form') + .append('') + .append('') + .append('') + .append('
      用户名
      ') + .append('
      密   码
      ') + .append('
      验证码
      不区分大小写
      ') + .append('') + .append('
      '); + + login_dialog_html.find('input[type="submit"]').click(function(){ + ajaxpost('ajax_login', '', '', 'onerror'); + }); + html_form("form_dialog_login", "登录", login_dialog_html, 360); + }; + $.fn.ds_login = function(options) { + return this.each(function() { + $(this).on('click',function(){ + $.show_ds_login(options); + return false; + }); + }); + }; + +})(jQuery); +(function($) { + $.fn.F_slider = function(options){ + var defaults = { + page : 1, + len : 0, // 滚动篇幅 + axis : 'y' // y为上下滚动,x为左右滚动 + } + var options = $.extend(defaults,options); + return this.each(function(){ + var $this = $(this); + var len = options.len; + var page = options.page; + if(options.axis == 'y'){ + var Val = $(this).find('.F-center').height(); + var Param = 'top'; + }else if(options.axis == 'x'){ + var Val = $(this).find('.F-center').parent().width(); + var Param = 'left'; + } + $this.find('.F-prev').click(function(){ + if( page == 1){ + eval("$this.find('.F-center').animate({"+Param+":'-=' + Val*(len-1)},'slow');"); + page=len; + }else{ + eval("$this.find('.F-center').animate({"+Param+":'+=' + Val},'slow');"); + page--; + } + }); + $this.find('.F-next').click(function(){ + if(page == len){ + eval("$this.find('.F-center').animate({"+Param+":0},'slow');"); + page=1; + }else{ + eval("$this.find('.F-center').animate({"+Param+":'-=' + Val},'show');"); + page++; + } + }); + }); + } +})(jQuery); diff --git a/static/app2/img/cost1.png b/static/app2/img/cost1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/cost2.png b/static/app2/img/cost2.png old mode 100755 new mode 100644 diff --git a/static/app2/img/cost3.png b/static/app2/img/cost3.png old mode 100755 new mode 100644 diff --git a/static/app2/img/cost_1.png b/static/app2/img/cost_1.png new file mode 100644 index 0000000..9c4a3ec Binary files /dev/null and b/static/app2/img/cost_1.png differ diff --git a/static/app2/img/cost_2.png b/static/app2/img/cost_2.png new file mode 100644 index 0000000..9cffa33 Binary files /dev/null and b/static/app2/img/cost_2.png differ diff --git a/static/app2/img/cost_3.png b/static/app2/img/cost_3.png new file mode 100644 index 0000000..60bcad3 Binary files /dev/null and b/static/app2/img/cost_3.png differ diff --git a/static/app2/img/daifahuo.png b/static/app2/img/daifahuo.png new file mode 100644 index 0000000..863e63b Binary files /dev/null and b/static/app2/img/daifahuo.png differ diff --git a/static/app2/img/daifukuan.png b/static/app2/img/daifukuan.png new file mode 100644 index 0000000..015deab Binary files /dev/null and b/static/app2/img/daifukuan.png differ diff --git a/static/app2/img/daishouhuo.png b/static/app2/img/daishouhuo.png new file mode 100644 index 0000000..e2f8b81 Binary files /dev/null and b/static/app2/img/daishouhuo.png differ diff --git a/static/app2/img/del.png b/static/app2/img/del.png new file mode 100644 index 0000000..7034b71 Binary files /dev/null and b/static/app2/img/del.png differ diff --git a/static/app2/img/delete.png b/static/app2/img/delete.png new file mode 100644 index 0000000..2317d05 Binary files /dev/null and b/static/app2/img/delete.png differ diff --git a/static/app2/img/dianhuaben.png b/static/app2/img/dianhuaben.png new file mode 100644 index 0000000..f9c806e Binary files /dev/null and b/static/app2/img/dianhuaben.png differ diff --git a/static/app2/img/dianpu.png b/static/app2/img/dianpu.png new file mode 100644 index 0000000..ce25335 Binary files /dev/null and b/static/app2/img/dianpu.png differ diff --git a/static/app2/img/dingwei1.png b/static/app2/img/dingwei1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/dis_log.png b/static/app2/img/dis_log.png new file mode 100644 index 0000000..5ea288b Binary files /dev/null and b/static/app2/img/dis_log.png differ diff --git a/static/app2/img/ditudingwei.png b/static/app2/img/ditudingwei.png new file mode 100644 index 0000000..c21ddf3 Binary files /dev/null and b/static/app2/img/ditudingwei.png differ diff --git a/static/app2/img/dituzhibiao.png b/static/app2/img/dituzhibiao.png new file mode 100644 index 0000000..7405911 Binary files /dev/null and b/static/app2/img/dituzhibiao.png differ diff --git a/static/app2/img/ect.png b/static/app2/img/ect.png old mode 100755 new mode 100644 index f0e5067..ce42779 Binary files a/static/app2/img/ect.png and b/static/app2/img/ect.png differ diff --git a/static/app2/img/ect_address.png b/static/app2/img/ect_address.png new file mode 100644 index 0000000..9f4a1b7 Binary files /dev/null and b/static/app2/img/ect_address.png differ diff --git a/static/app2/img/ect_index_title.png b/static/app2/img/ect_index_title.png new file mode 100644 index 0000000..5fc511c Binary files /dev/null and b/static/app2/img/ect_index_title.png differ diff --git a/static/app2/img/ect_list.png b/static/app2/img/ect_list.png new file mode 100644 index 0000000..e85c7c4 Binary files /dev/null and b/static/app2/img/ect_list.png differ diff --git a/static/app2/img/ect_list1.png b/static/app2/img/ect_list1.png new file mode 100644 index 0000000..cbaf087 Binary files /dev/null and b/static/app2/img/ect_list1.png differ diff --git a/static/app2/img/ect_list_bg.png b/static/app2/img/ect_list_bg.png new file mode 100644 index 0000000..8e446b3 Binary files /dev/null and b/static/app2/img/ect_list_bg.png differ diff --git a/static/app2/img/ect_pre.png b/static/app2/img/ect_pre.png new file mode 100644 index 0000000..aaa51e8 Binary files /dev/null and b/static/app2/img/ect_pre.png differ diff --git a/static/app2/img/ect_pre_log.png b/static/app2/img/ect_pre_log.png new file mode 100644 index 0000000..2acb28a Binary files /dev/null and b/static/app2/img/ect_pre_log.png differ diff --git a/static/app2/img/ect_right.png b/static/app2/img/ect_right.png new file mode 100644 index 0000000..a0f35a4 Binary files /dev/null and b/static/app2/img/ect_right.png differ diff --git a/static/app2/img/ect_setting.png b/static/app2/img/ect_setting.png new file mode 100644 index 0000000..cab5d14 Binary files /dev/null and b/static/app2/img/ect_setting.png differ diff --git a/static/app2/img/ect_wall.png b/static/app2/img/ect_wall.png new file mode 100644 index 0000000..412ddcd Binary files /dev/null and b/static/app2/img/ect_wall.png differ diff --git a/static/app2/img/ect_wall1.png b/static/app2/img/ect_wall1.png new file mode 100644 index 0000000..d1bcbe8 Binary files /dev/null and b/static/app2/img/ect_wall1.png differ diff --git a/static/app2/img/eye.png b/static/app2/img/eye.png old mode 100755 new mode 100644 diff --git a/static/app2/img/faxianhaohuo1.png b/static/app2/img/faxianhaohuo1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/feichangdapai.png b/static/app2/img/feichangdapai.png old mode 100755 new mode 100644 diff --git a/static/app2/img/fenlei.png b/static/app2/img/fenlei.png old mode 100755 new mode 100644 diff --git a/static/app2/img/fenx111.png b/static/app2/img/fenx111.png new file mode 100644 index 0000000..b5175c6 Binary files /dev/null and b/static/app2/img/fenx111.png differ diff --git a/static/app2/img/god_bg.png b/static/app2/img/god_bg.png new file mode 100644 index 0000000..b2a08eb Binary files /dev/null and b/static/app2/img/god_bg.png differ diff --git a/static/app2/img/god_rech.png b/static/app2/img/god_rech.png new file mode 100644 index 0000000..d5a5c94 Binary files /dev/null and b/static/app2/img/god_rech.png differ diff --git a/static/app2/img/god_shop .png b/static/app2/img/god_shop .png new file mode 100644 index 0000000..df50aeb Binary files /dev/null and b/static/app2/img/god_shop .png differ diff --git a/static/app2/img/god_shopp.png b/static/app2/img/god_shopp.png new file mode 100644 index 0000000..82017ab Binary files /dev/null and b/static/app2/img/god_shopp.png differ diff --git a/static/app2/img/god_success.png b/static/app2/img/god_success.png new file mode 100644 index 0000000..a639cfc Binary files /dev/null and b/static/app2/img/god_success.png differ diff --git a/static/app2/img/god_success_shop.png b/static/app2/img/god_success_shop.png new file mode 100644 index 0000000..3450322 Binary files /dev/null and b/static/app2/img/god_success_shop.png differ diff --git a/static/app2/img/gothere.png b/static/app2/img/gothere.png new file mode 100644 index 0000000..4418829 Binary files /dev/null and b/static/app2/img/gothere.png differ diff --git a/static/app2/img/gouwuche.png b/static/app2/img/gouwuche.png new file mode 100644 index 0000000..ab3d5fd Binary files /dev/null and b/static/app2/img/gouwuche.png differ diff --git a/static/app2/img/gouwuquan.png b/static/app2/img/gouwuquan.png old mode 100755 new mode 100644 index 6e2308b..b0a622a Binary files a/static/app2/img/gouwuquan.png and b/static/app2/img/gouwuquan.png differ diff --git a/static/app2/img/guangshangchang.png b/static/app2/img/guangshangchang.png old mode 100755 new mode 100644 diff --git a/static/app2/img/guangshangchang1.png b/static/app2/img/guangshangchang1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/haitunlogo.png b/static/app2/img/haitunlogo.png old mode 100755 new mode 100644 index 5f62490..e65aed0 Binary files a/static/app2/img/haitunlogo.png and b/static/app2/img/haitunlogo.png differ diff --git a/static/app2/img/heart.png b/static/app2/img/heart.png old mode 100755 new mode 100644 diff --git a/static/app2/img/hot_title.png b/static/app2/img/hot_title.png new file mode 100644 index 0000000..9af2846 Binary files /dev/null and b/static/app2/img/hot_title.png differ diff --git a/static/app2/img/hui.png b/static/app2/img/hui.png old mode 100755 new mode 100644 index 8de74a5..6ff51b4 Binary files a/static/app2/img/hui.png and b/static/app2/img/hui.png differ diff --git a/static/app2/img/hukou.jpg b/static/app2/img/hukou.jpg new file mode 100644 index 0000000..ea30840 Binary files /dev/null and b/static/app2/img/hukou.jpg differ diff --git a/static/app2/img/icon-test-copy.png b/static/app2/img/icon-test-copy.png new file mode 100644 index 0000000..084311f Binary files /dev/null and b/static/app2/img/icon-test-copy.png differ diff --git a/static/app2/img/icon_1.png b/static/app2/img/icon_1.png new file mode 100644 index 0000000..f902a4c Binary files /dev/null and b/static/app2/img/icon_1.png differ diff --git a/static/app2/img/icon_10.png b/static/app2/img/icon_10.png new file mode 100644 index 0000000..775d937 Binary files /dev/null and b/static/app2/img/icon_10.png differ diff --git a/static/app2/img/icon_2.png b/static/app2/img/icon_2.png new file mode 100644 index 0000000..64b5688 Binary files /dev/null and b/static/app2/img/icon_2.png differ diff --git a/static/app2/img/icon_3.png b/static/app2/img/icon_3.png new file mode 100644 index 0000000..d8ebdae Binary files /dev/null and b/static/app2/img/icon_3.png differ diff --git a/static/app2/img/icon_4.png b/static/app2/img/icon_4.png new file mode 100644 index 0000000..6b07842 Binary files /dev/null and b/static/app2/img/icon_4.png differ diff --git a/static/app2/img/icon_5.png b/static/app2/img/icon_5.png new file mode 100644 index 0000000..90dd6b3 Binary files /dev/null and b/static/app2/img/icon_5.png differ diff --git a/static/app2/img/icon_6.png b/static/app2/img/icon_6.png new file mode 100644 index 0000000..0d986b4 Binary files /dev/null and b/static/app2/img/icon_6.png differ diff --git a/static/app2/img/icon_7.png b/static/app2/img/icon_7.png new file mode 100644 index 0000000..dc4568c Binary files /dev/null and b/static/app2/img/icon_7.png differ diff --git a/static/app2/img/icon_8.png b/static/app2/img/icon_8.png new file mode 100644 index 0000000..2a91b77 Binary files /dev/null and b/static/app2/img/icon_8.png differ diff --git a/static/app2/img/icon_9.png b/static/app2/img/icon_9.png new file mode 100644 index 0000000..862e615 Binary files /dev/null and b/static/app2/img/icon_9.png differ diff --git a/static/app2/img/icon_ac1111left.png b/static/app2/img/icon_ac1111left.png new file mode 100644 index 0000000..9b6be41 Binary files /dev/null and b/static/app2/img/icon_ac1111left.png differ diff --git a/static/app2/img/icon_ac1111right.png b/static/app2/img/icon_ac1111right.png new file mode 100644 index 0000000..d46c791 Binary files /dev/null and b/static/app2/img/icon_ac1111right.png differ diff --git a/static/app2/img/icon_back.png b/static/app2/img/icon_back.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_car.png b/static/app2/img/icon_car.png new file mode 100644 index 0000000..50a99b2 Binary files /dev/null and b/static/app2/img/icon_car.png differ diff --git a/static/app2/img/icon_check0.png b/static/app2/img/icon_check0.png new file mode 100644 index 0000000..ce6f490 Binary files /dev/null and b/static/app2/img/icon_check0.png differ diff --git a/static/app2/img/icon_check1.png b/static/app2/img/icon_check1.png new file mode 100644 index 0000000..642610f Binary files /dev/null and b/static/app2/img/icon_check1.png differ diff --git a/static/app2/img/icon_clock.png b/static/app2/img/icon_clock.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_close.png b/static/app2/img/icon_close.png new file mode 100644 index 0000000..22a98c8 Binary files /dev/null and b/static/app2/img/icon_close.png differ diff --git a/static/app2/img/icon_down.png b/static/app2/img/icon_down.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_ect111111.png b/static/app2/img/icon_ect111111.png new file mode 100644 index 0000000..0bd5229 Binary files /dev/null and b/static/app2/img/icon_ect111111.png differ diff --git a/static/app2/img/icon_eye.png b/static/app2/img/icon_eye.png new file mode 100644 index 0000000..f644dd5 Binary files /dev/null and b/static/app2/img/icon_eye.png differ diff --git a/static/app2/img/icon_juzitoutiao.png b/static/app2/img/icon_juzitoutiao.png new file mode 100644 index 0000000..de7d7fc Binary files /dev/null and b/static/app2/img/icon_juzitoutiao.png differ diff --git a/static/app2/img/icon_market.png b/static/app2/img/icon_market.png new file mode 100644 index 0000000..92ad65b Binary files /dev/null and b/static/app2/img/icon_market.png differ diff --git a/static/app2/img/icon_menu.png b/static/app2/img/icon_menu.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_more.png b/static/app2/img/icon_more.png new file mode 100644 index 0000000..dcebe09 Binary files /dev/null and b/static/app2/img/icon_more.png differ diff --git a/static/app2/img/icon_msg.png b/static/app2/img/icon_msg.png new file mode 100644 index 0000000..b357990 Binary files /dev/null and b/static/app2/img/icon_msg.png differ diff --git a/static/app2/img/icon_msg1.png b/static/app2/img/icon_msg1.png new file mode 100644 index 0000000..17bcd63 Binary files /dev/null and b/static/app2/img/icon_msg1.png differ diff --git a/static/app2/img/icon_phone1.png b/static/app2/img/icon_phone1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_photo.png b/static/app2/img/icon_photo.png new file mode 100644 index 0000000..9daa35f Binary files /dev/null and b/static/app2/img/icon_photo.png differ diff --git a/static/app2/img/icon_pwd1.png b/static/app2/img/icon_pwd1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_right.png b/static/app2/img/icon_right.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_rocket.png b/static/app2/img/icon_rocket.png new file mode 100644 index 0000000..747c89d Binary files /dev/null and b/static/app2/img/icon_rocket.png differ diff --git a/static/app2/img/icon_s.png b/static/app2/img/icon_s.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_search.png b/static/app2/img/icon_search.png new file mode 100644 index 0000000..ed1e671 Binary files /dev/null and b/static/app2/img/icon_search.png differ diff --git a/static/app2/img/icon_search1.png b/static/app2/img/icon_search1.png new file mode 100644 index 0000000..d0398f2 Binary files /dev/null and b/static/app2/img/icon_search1.png differ diff --git a/static/app2/img/icon_select.png b/static/app2/img/icon_select.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_select1.png b/static/app2/img/icon_select1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_shop.png b/static/app2/img/icon_shop.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_smjd.png b/static/app2/img/icon_smjd.png new file mode 100644 index 0000000..548e11d Binary files /dev/null and b/static/app2/img/icon_smjd.png differ diff --git a/static/app2/img/icon_sscl.png b/static/app2/img/icon_sscl.png new file mode 100644 index 0000000..8926f43 Binary files /dev/null and b/static/app2/img/icon_sscl.png differ diff --git a/static/app2/img/icon_star.png b/static/app2/img/icon_star.png new file mode 100644 index 0000000..a99aea5 Binary files /dev/null and b/static/app2/img/icon_star.png differ diff --git a/static/app2/img/icon_user1.png b/static/app2/img/icon_user1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/icon_ziying.png b/static/app2/img/icon_ziying.png new file mode 100644 index 0000000..adb1bfe Binary files /dev/null and b/static/app2/img/icon_ziying.png differ diff --git a/static/app2/img/icon_zy1.png b/static/app2/img/icon_zy1.png new file mode 100644 index 0000000..a6079b6 Binary files /dev/null and b/static/app2/img/icon_zy1.png differ diff --git a/static/app2/img/icon_zy2.png b/static/app2/img/icon_zy2.png new file mode 100644 index 0000000..cb2846f Binary files /dev/null and b/static/app2/img/icon_zy2.png differ diff --git a/static/app2/img/icon_zy3.png b/static/app2/img/icon_zy3.png new file mode 100644 index 0000000..9768b37 Binary files /dev/null and b/static/app2/img/icon_zy3.png differ diff --git a/static/app2/img/icon_zy4.png b/static/app2/img/icon_zy4.png new file mode 100644 index 0000000..d247d98 Binary files /dev/null and b/static/app2/img/icon_zy4.png differ diff --git a/static/app2/img/icon_zy5.png b/static/app2/img/icon_zy5.png new file mode 100644 index 0000000..775d937 Binary files /dev/null and b/static/app2/img/icon_zy5.png differ diff --git a/static/app2/img/imail.png b/static/app2/img/imail.png old mode 100755 new mode 100644 diff --git a/static/app2/img/imail2.png b/static/app2/img/imail2.png old mode 100755 new mode 100644 diff --git a/static/app2/img/img_white.png b/static/app2/img/img_white.png new file mode 100644 index 0000000..8f542b5 Binary files /dev/null and b/static/app2/img/img_white.png differ diff --git a/static/app2/img/jia.png b/static/app2/img/jia.png old mode 100755 new mode 100644 diff --git a/static/app2/img/jian.png b/static/app2/img/jian.png old mode 100755 new mode 100644 diff --git a/static/app2/img/jifen.png b/static/app2/img/jifen.png old mode 100755 new mode 100644 diff --git a/static/app2/img/jingpintuijian.png b/static/app2/img/jingpintuijian.png old mode 100755 new mode 100644 diff --git a/static/app2/img/juan.png b/static/app2/img/juan.png new file mode 100644 index 0000000..3361ef6 Binary files /dev/null and b/static/app2/img/juan.png differ diff --git a/static/app2/img/juan_yes.png b/static/app2/img/juan_yes.png new file mode 100644 index 0000000..47d536d Binary files /dev/null and b/static/app2/img/juan_yes.png differ diff --git a/static/app2/img/jxyh.png b/static/app2/img/jxyh.png old mode 100755 new mode 100644 diff --git a/static/app2/img/kaidian.png b/static/app2/img/kaidian.png new file mode 100644 index 0000000..280e434 Binary files /dev/null and b/static/app2/img/kaidian.png differ diff --git a/static/app2/img/kong.png b/static/app2/img/kong.png new file mode 100644 index 0000000..2f2fb0a Binary files /dev/null and b/static/app2/img/kong.png differ diff --git a/static/app2/img/lianxishangjia4.png b/static/app2/img/lianxishangjia4.png new file mode 100644 index 0000000..cf2d58d Binary files /dev/null and b/static/app2/img/lianxishangjia4.png differ diff --git a/static/app2/img/likelogo.png b/static/app2/img/likelogo.png old mode 100755 new mode 100644 diff --git a/static/app2/img/likelogo1.png b/static/app2/img/likelogo1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/likelogoon.png b/static/app2/img/likelogoon.png old mode 100755 new mode 100644 diff --git a/static/app2/img/loginbg.jpg b/static/app2/img/loginbg.jpg new file mode 100644 index 0000000..5a0667e Binary files /dev/null and b/static/app2/img/loginbg.jpg differ diff --git a/static/app2/img/marker_red_sprite.png b/static/app2/img/marker_red_sprite.png new file mode 100644 index 0000000..38a5900 Binary files /dev/null and b/static/app2/img/marker_red_sprite.png differ diff --git a/static/app2/img/meirigengxin.png b/static/app2/img/meirigengxin.png old mode 100755 new mode 100644 diff --git a/static/app2/img/menu.png b/static/app2/img/menu.png old mode 100755 new mode 100644 diff --git a/static/app2/img/menu_dian.png b/static/app2/img/menu_dian.png old mode 100755 new mode 100644 diff --git a/static/app2/img/miaoshabg.png b/static/app2/img/miaoshabg.png old mode 100755 new mode 100644 diff --git a/static/app2/img/ms_1.png b/static/app2/img/ms_1.png new file mode 100644 index 0000000..80d1046 Binary files /dev/null and b/static/app2/img/ms_1.png differ diff --git a/static/app2/img/mu.png b/static/app2/img/mu.png new file mode 100644 index 0000000..c67d9f5 Binary files /dev/null and b/static/app2/img/mu.png differ diff --git a/static/app2/img/muji_quan.png b/static/app2/img/muji_quan.png new file mode 100644 index 0000000..412d13d Binary files /dev/null and b/static/app2/img/muji_quan.png differ diff --git a/static/app2/img/mujiimg.png b/static/app2/img/mujiimg.png new file mode 100644 index 0000000..786f447 Binary files /dev/null and b/static/app2/img/mujiimg.png differ diff --git a/static/app2/img/my_bg.png b/static/app2/img/my_bg.png old mode 100755 new mode 100644 index b295676..8324793 Binary files a/static/app2/img/my_bg.png and b/static/app2/img/my_bg.png differ diff --git a/static/app2/img/nav_0_0.png b/static/app2/img/nav_0_0.png old mode 100755 new mode 100644 index ff1d2ef..d103a21 Binary files a/static/app2/img/nav_0_0.png and b/static/app2/img/nav_0_0.png differ diff --git a/static/app2/img/nav_0_1.png b/static/app2/img/nav_0_1.png old mode 100755 new mode 100644 index 025db46..2feb77e Binary files a/static/app2/img/nav_0_1.png and b/static/app2/img/nav_0_1.png differ diff --git a/static/app2/img/nav_1_0.png b/static/app2/img/nav_1_0.png old mode 100755 new mode 100644 index c3cc95c..e464d39 Binary files a/static/app2/img/nav_1_0.png and b/static/app2/img/nav_1_0.png differ diff --git a/static/app2/img/nav_1_1.png b/static/app2/img/nav_1_1.png old mode 100755 new mode 100644 index d6dac4d..dc4020d Binary files a/static/app2/img/nav_1_1.png and b/static/app2/img/nav_1_1.png differ diff --git a/static/app2/img/nav_2_0.png b/static/app2/img/nav_2_0.png new file mode 100644 index 0000000..e934c11 Binary files /dev/null and b/static/app2/img/nav_2_0.png differ diff --git a/static/app2/img/nav_2_1.png b/static/app2/img/nav_2_1.png new file mode 100644 index 0000000..0c8f55c Binary files /dev/null and b/static/app2/img/nav_2_1.png differ diff --git a/static/app2/img/nav_2_in.png b/static/app2/img/nav_2_in.png new file mode 100644 index 0000000..2f3756b Binary files /dev/null and b/static/app2/img/nav_2_in.png differ diff --git a/static/app2/img/nav_2_out.png b/static/app2/img/nav_2_out.png new file mode 100644 index 0000000..65fb7a6 Binary files /dev/null and b/static/app2/img/nav_2_out.png differ diff --git a/static/app2/img/nav_3_0.png b/static/app2/img/nav_3_0.png old mode 100755 new mode 100644 index db8e426..b248ab6 Binary files a/static/app2/img/nav_3_0.png and b/static/app2/img/nav_3_0.png differ diff --git a/static/app2/img/nav_3_1.png b/static/app2/img/nav_3_1.png old mode 100755 new mode 100644 index 49500d9..cb83e88 Binary files a/static/app2/img/nav_3_1.png and b/static/app2/img/nav_3_1.png differ diff --git a/static/app2/img/nav_4_0.png b/static/app2/img/nav_4_0.png old mode 100755 new mode 100644 index 51456a4..df8746a Binary files a/static/app2/img/nav_4_0.png and b/static/app2/img/nav_4_0.png differ diff --git a/static/app2/img/nav_4_1.png b/static/app2/img/nav_4_1.png old mode 100755 new mode 100644 index 7a403ff..d1324cd Binary files a/static/app2/img/nav_4_1.png and b/static/app2/img/nav_4_1.png differ diff --git a/static/app2/img/news_title.png b/static/app2/img/news_title.png new file mode 100644 index 0000000..9b91b3c Binary files /dev/null and b/static/app2/img/news_title.png differ diff --git a/static/app2/img/next_title.png b/static/app2/img/next_title.png new file mode 100644 index 0000000..2951625 Binary files /dev/null and b/static/app2/img/next_title.png differ diff --git a/static/app2/img/oc_logo1.png b/static/app2/img/oc_logo1.png new file mode 100644 index 0000000..9e1f15c Binary files /dev/null and b/static/app2/img/oc_logo1.png differ diff --git a/static/app2/img/oc_logo2.png b/static/app2/img/oc_logo2.png new file mode 100644 index 0000000..0e2095c Binary files /dev/null and b/static/app2/img/oc_logo2.png differ diff --git a/static/app2/img/oc_logo3.png b/static/app2/img/oc_logo3.png new file mode 100644 index 0000000..2601d41 Binary files /dev/null and b/static/app2/img/oc_logo3.png differ diff --git a/static/app2/img/oc_logo4.png b/static/app2/img/oc_logo4.png new file mode 100644 index 0000000..17440c5 Binary files /dev/null and b/static/app2/img/oc_logo4.png differ diff --git a/static/app2/img/oc_shop.png b/static/app2/img/oc_shop.png new file mode 100644 index 0000000..aa8d05b Binary files /dev/null and b/static/app2/img/oc_shop.png differ diff --git a/static/app2/img/order-icons.png b/static/app2/img/order-icons.png old mode 100755 new mode 100644 diff --git a/static/app2/img/orderdetail.png b/static/app2/img/orderdetail.png new file mode 100644 index 0000000..7d667ce Binary files /dev/null and b/static/app2/img/orderdetail.png differ diff --git a/static/app2/img/paihangbang.png b/static/app2/img/paihangbang.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pengyou.png b/static/app2/img/pengyou.png new file mode 100644 index 0000000..e162113 Binary files /dev/null and b/static/app2/img/pengyou.png differ diff --git a/static/app2/img/phone1.png b/static/app2/img/phone1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pingjia.png b/static/app2/img/pingjia.png new file mode 100644 index 0000000..f5ff9b2 Binary files /dev/null and b/static/app2/img/pingjia.png differ diff --git a/static/app2/img/pingpaijie.png b/static/app2/img/pingpaijie.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pingzheng.png b/static/app2/img/pingzheng.png new file mode 100644 index 0000000..73470ba Binary files /dev/null and b/static/app2/img/pingzheng.png differ diff --git a/static/app2/img/pingzheng1.png b/static/app2/img/pingzheng1.png new file mode 100644 index 0000000..73d6753 Binary files /dev/null and b/static/app2/img/pingzheng1.png differ diff --git a/static/app2/img/pingzheng2.png b/static/app2/img/pingzheng2.png new file mode 100644 index 0000000..ce4b322 Binary files /dev/null and b/static/app2/img/pingzheng2.png differ diff --git a/static/app2/img/pingzheng3.png b/static/app2/img/pingzheng3.png new file mode 100644 index 0000000..4acdd53 Binary files /dev/null and b/static/app2/img/pingzheng3.png differ diff --git a/static/app2/img/pingzheng4.png b/static/app2/img/pingzheng4.png new file mode 100644 index 0000000..64d459b Binary files /dev/null and b/static/app2/img/pingzheng4.png differ diff --git a/static/app2/img/pinzhishishang.png b/static/app2/img/pinzhishishang.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pjhx.png b/static/app2/img/pjhx.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pjhx1.png b/static/app2/img/pjhx1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pjimg.png b/static/app2/img/pjimg.png old mode 100755 new mode 100644 diff --git a/static/app2/img/pos.png b/static/app2/img/pos.png new file mode 100644 index 0000000..b792abb Binary files /dev/null and b/static/app2/img/pos.png differ diff --git a/static/app2/img/qidong_bg.jpg b/static/app2/img/qidong_bg.jpg new file mode 100644 index 0000000..0d5b81e Binary files /dev/null and b/static/app2/img/qidong_bg.jpg differ diff --git a/static/app2/img/recommend.png b/static/app2/img/recommend.png new file mode 100644 index 0000000..6e67725 Binary files /dev/null and b/static/app2/img/recommend.png differ diff --git a/static/app2/img/recommend_title1.png b/static/app2/img/recommend_title1.png new file mode 100644 index 0000000..45f2b66 Binary files /dev/null and b/static/app2/img/recommend_title1.png differ diff --git a/static/app2/img/recommend_title2.png b/static/app2/img/recommend_title2.png new file mode 100644 index 0000000..96d050a Binary files /dev/null and b/static/app2/img/recommend_title2.png differ diff --git a/static/app2/img/recommend_title3.png b/static/app2/img/recommend_title3.png new file mode 100644 index 0000000..b73ba14 Binary files /dev/null and b/static/app2/img/recommend_title3.png differ diff --git a/static/app2/img/renzheng.png b/static/app2/img/renzheng.png new file mode 100644 index 0000000..e025abd Binary files /dev/null and b/static/app2/img/renzheng.png differ diff --git a/static/app2/img/renzheng1.png b/static/app2/img/renzheng1.png new file mode 100644 index 0000000..e0a7e6d Binary files /dev/null and b/static/app2/img/renzheng1.png differ diff --git a/static/app2/img/sanjiaoshang.png b/static/app2/img/sanjiaoshang.png old mode 100755 new mode 100644 diff --git a/static/app2/img/sanjiaoxia.png b/static/app2/img/sanjiaoxia.png old mode 100755 new mode 100644 diff --git a/static/app2/img/saoyisao.png b/static/app2/img/saoyisao.png old mode 100755 new mode 100644 index c14f6da..73f8324 Binary files a/static/app2/img/saoyisao.png and b/static/app2/img/saoyisao.png differ diff --git a/static/app2/img/saoyisao1.png b/static/app2/img/saoyisao1.png new file mode 100644 index 0000000..47c3f73 Binary files /dev/null and b/static/app2/img/saoyisao1.png differ diff --git a/static/app2/img/saved_resource b/static/app2/img/saved_resource new file mode 100644 index 0000000..14af93b Binary files /dev/null and b/static/app2/img/saved_resource differ diff --git a/static/app2/img/saved_resource(1) b/static/app2/img/saved_resource(1) new file mode 100644 index 0000000..49d027a Binary files /dev/null and b/static/app2/img/saved_resource(1) differ diff --git a/static/app2/img/saved_resource(2) b/static/app2/img/saved_resource(2) new file mode 100644 index 0000000..f29fe5e Binary files /dev/null and b/static/app2/img/saved_resource(2) differ diff --git a/static/app2/img/saved_resource(3) b/static/app2/img/saved_resource(3) new file mode 100644 index 0000000..98c41b1 Binary files /dev/null and b/static/app2/img/saved_resource(3) differ diff --git a/static/app2/img/saved_resource(4) b/static/app2/img/saved_resource(4) new file mode 100644 index 0000000..9adc626 Binary files /dev/null and b/static/app2/img/saved_resource(4) differ diff --git a/static/app2/img/saved_resource(5) b/static/app2/img/saved_resource(5) new file mode 100644 index 0000000..6af7a85 Binary files /dev/null and b/static/app2/img/saved_resource(5) differ diff --git a/static/app2/img/search1.png b/static/app2/img/search1.png old mode 100755 new mode 100644 index ef4f42c..d0398f2 Binary files a/static/app2/img/search1.png and b/static/app2/img/search1.png differ diff --git a/static/app2/img/send.png b/static/app2/img/send.png new file mode 100644 index 0000000..724bf63 Binary files /dev/null and b/static/app2/img/send.png differ diff --git a/static/app2/img/setting.png b/static/app2/img/setting.png new file mode 100644 index 0000000..2a94a63 Binary files /dev/null and b/static/app2/img/setting.png differ diff --git a/static/app2/img/setting_lock1.png b/static/app2/img/setting_lock1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/setting_user1.png b/static/app2/img/setting_user1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/shangchang.png b/static/app2/img/shangchang.png new file mode 100644 index 0000000..804f70a Binary files /dev/null and b/static/app2/img/shangchang.png differ diff --git a/static/app2/img/shangchangkefu.png b/static/app2/img/shangchangkefu.png new file mode 100644 index 0000000..e545578 Binary files /dev/null and b/static/app2/img/shangchangkefu.png differ diff --git a/static/app2/img/shangxin.png b/static/app2/img/shangxin.png old mode 100755 new mode 100644 diff --git a/static/app2/img/share.png b/static/app2/img/share.png new file mode 100644 index 0000000..93a15b8 Binary files /dev/null and b/static/app2/img/share.png differ diff --git a/static/app2/img/shoplogo.png b/static/app2/img/shoplogo.png old mode 100755 new mode 100644 diff --git a/static/app2/img/site_logo.png b/static/app2/img/site_logo.png new file mode 100644 index 0000000..8e02cac --- /dev/null +++ b/static/app2/img/site_logo.png @@ -0,0 +1,1230 @@ + + + + + System Error + + + + + +
      +
      +
      +
      + +
      +
      +

      [0] HttpException in App.php line 361

      +
      +

      模块不存在:uploads

      +
      + +
      +
      +
      1. +
      2. // 模块初始化 +
      3. if ($module && $available) { +
      4. // 初始化模块 +
      5. $request->module($module); +
      6. $config = self::init($module); +
      7. // 模块请求缓存检查 +
      8. $request->cache($config['request_cache'], $config['request_cache_expire'], $config['request_cache_except']); +
      9. } else { +
      10. throw new HttpException(404, 'module not exists:' . $module); +
      11. } +
      12. } else { +
      13. // 单一模块部署 +
      14. $module = ''; +
      15. $request->module($module); +
      16. } +
      17. // 当前模块路径 +
      18. App::$modulePath = APP_PATH . ($module ? $module . DS : ''); +
      19. +
      +
      +
      +

      Call Stack

      +
        +
      1. in App.php line 361
      2. +
      3. + at App::module(['uploads', 'home', 'common'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 296
      4. +
      5. + at App::exec(['type' => 'module', 'module' => ['uploads', 'home', 'common']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 124
      6. +
      7. + at App::run() in start.php line 18
      8. +
      9. + at require('D:\wwwroot\mall\thin...') in index.php line 19
      10. +
      +
      +
      + + +
      +

      Environment Variables

      +
      +
      +
      GET Data
      +
      empty
      +
      +
      +
      +
      +
      POST Data
      +
      empty
      +
      +
      +
      +
      +
      Files
      +
      empty
      +
      +
      +
      +

      Cookies

      +
      +
      +
      PHPSESSID
      +
      + 3c22e0jntkb2jncja6vlefne6n
      +
      +
      +
      __guid
      +
      + 155745575.1562149503273026300.1548253012647.3384
      +
      +
      +
      cart_goods_num
      +
      + 0
      +
      +
      +
      msgnewnum1
      +
      + 3
      +
      +
      +
      username
      +
      + fuhuigou
      +
      +
      +
      key
      +
      + f7b4b5e4248a2e99042cd20c5b1af10c
      +
      +
      +
      cart_count
      +
      + 0
      +
      +
      +
      msgnewnum381
      +
      + 23
      +
      +
      +
      monitor_count
      +
      + 52
      +
      +
      +
      +
      +
      +
      Session
      +
      empty
      +
      +
      +
      +

      Server/Request Data

      +
      +
      +
      PATH
      +
      + C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\TortoiseSVN\bin;D:\Program Files\nodejs\;d:\Program Files\Git\cmd;C:\Users\63003\AppData\Local\Microsoft\WindowsApps;C:\Users\63003\AppData\Roaming\npm
      +
      +
      +
      SYSTEMROOT
      +
      + C:\Windows
      +
      +
      +
      COMSPEC
      +
      + C:\Windows\system32\cmd.exe
      +
      +
      +
      PATHEXT
      +
      + .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
      +
      +
      +
      WINDIR
      +
      + C:\Windows
      +
      +
      +
      PHP_FCGI_MAX_REQUESTS
      +
      + 1000
      +
      +
      +
      PHPRC
      +
      + D:/phpStudy/PHPTutorial/php/php-7.0.12-nts/
      +
      +
      +
      _FCGI_SHUTDOWN_EVENT_
      +
      + 2248
      +
      +
      +
      SCRIPT_NAME
      +
      + /index.php
      +
      +
      +
      REQUEST_URI
      +
      + /uploads/home/common/site_logo.png
      +
      +
      +
      QUERY_STRING
      +
      +
      +
      +
      +
      REQUEST_METHOD
      +
      + GET
      +
      +
      +
      SERVER_PROTOCOL
      +
      + HTTP/1.1
      +
      +
      +
      GATEWAY_INTERFACE
      +
      + CGI/1.1
      +
      +
      +
      REDIRECT_URL
      +
      + /uploads/home/common/site_logo.png
      +
      +
      +
      REMOTE_PORT
      +
      + 64728
      +
      +
      +
      SCRIPT_FILENAME
      +
      + D:/wwwroot/mall/public/index.php
      +
      +
      +
      SERVER_ADMIN
      +
      + admin@php.cn
      +
      +
      +
      CONTEXT_DOCUMENT_ROOT
      +
      + D:/wwwroot/mall/public
      +
      +
      +
      CONTEXT_PREFIX
      +
      +
      +
      +
      +
      REQUEST_SCHEME
      +
      + http
      +
      +
      +
      DOCUMENT_ROOT
      +
      + D:/wwwroot/mall/public
      +
      +
      +
      REMOTE_ADDR
      +
      + 127.0.0.1
      +
      +
      +
      SERVER_PORT
      +
      + 80
      +
      +
      +
      SERVER_ADDR
      +
      + 127.0.0.1
      +
      +
      +
      SERVER_NAME
      +
      + mall.com
      +
      +
      +
      SERVER_SOFTWARE
      +
      + Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9
      +
      +
      +
      SERVER_SIGNATURE
      +
      +
      +
      +
      +
      SystemRoot
      +
      + C:\Windows
      +
      +
      +
      HTTP_COOKIE
      +
      + PHPSESSID=3c22e0jntkb2jncja6vlefne6n; __guid=155745575.1562149503273026300.1548253012647.3384; cart_goods_num=0; msgnewnum1=3; username=fuhuigou; key=f7b4b5e4248a2e99042cd20c5b1af10c; cart_count=0; msgnewnum381=23; monitor_count=52
      +
      +
      +
      HTTP_ACCEPT_LANGUAGE
      +
      + zh-CN,zh;q=0.9
      +
      +
      +
      HTTP_ACCEPT_ENCODING
      +
      + gzip, deflate
      +
      +
      +
      HTTP_REFERER
      +
      + http://mall.com/index.php/home/Sellerjoininc2c/step1.html
      +
      +
      +
      HTTP_ACCEPT
      +
      + image/webp,image/apng,image/*,*/*;q=0.8
      +
      +
      +
      HTTP_USER_AGENT
      +
      + Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
      +
      +
      +
      HTTP_CONNECTION
      +
      + close
      +
      +
      +
      HTTP_HOST
      +
      + mall.com
      +
      +
      +
      REDIRECT_STATUS
      +
      + 200
      +
      +
      +
      REDIRECT_PATH_INFO
      +
      + uploads/home/common/site_logo.png
      +
      +
      +
      FCGI_ROLE
      +
      + RESPONDER
      +
      +
      +
      PHP_SELF
      +
      + /index.php
      +
      +
      +
      REQUEST_TIME_FLOAT
      +
      + 1548323988.6424
      +
      +
      +
      REQUEST_TIME
      +
      + 1548323988
      +
      +
      +
      PATH_INFO
      +
      + uploads/home/common/site_logo.png
      +
      +
      +
      +
      +
      +
      Environment Variables
      +
      empty
      +
      +
      +
      +

      ThinkPHP Constants

      +
      +
      +
      APP_PATH
      +
      + D:\wwwroot\mall\public/../application/
      +
      +
      +
      THINK_VERSION
      +
      + 5.0.12
      +
      +
      +
      THINK_START_TIME
      +
      + 1548323988.6453
      +
      +
      +
      THINK_START_MEM
      +
      + 373392
      +
      +
      +
      EXT
      +
      + .php
      +
      +
      +
      DS
      +
      + \
      +
      +
      +
      THINK_PATH
      +
      + D:\wwwroot\mall\thinkphp\
      +
      +
      +
      LIB_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\
      +
      +
      +
      CORE_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\think\
      +
      +
      +
      TRAIT_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\traits\
      +
      +
      +
      ROOT_PATH
      +
      + D:\wwwroot\mall\
      +
      +
      +
      EXTEND_PATH
      +
      + D:\wwwroot\mall\extend\
      +
      +
      +
      VENDOR_PATH
      +
      + D:\wwwroot\mall\vendor\
      +
      +
      +
      RUNTIME_PATH
      +
      + D:\wwwroot\mall\runtime\
      +
      +
      +
      LOG_PATH
      +
      + D:\wwwroot\mall\runtime\log\
      +
      +
      +
      CACHE_PATH
      +
      + D:\wwwroot\mall\runtime\cache\
      +
      +
      +
      TEMP_PATH
      +
      + D:\wwwroot\mall\runtime\temp\
      +
      +
      +
      CONF_PATH
      +
      + D:\wwwroot\mall\public/../application/
      +
      +
      +
      CONF_EXT
      +
      + .php
      +
      +
      +
      ENV_PREFIX
      +
      + PHP_
      +
      +
      +
      IS_CLI
      +
      + false
      +
      +
      +
      IS_WIN
      +
      + true
      +
      +
      +
      MD5_KEY
      +
      + a2382918dbb49c8643f19bc3ab90ecf9
      +
      +
      +
      CHARSET
      +
      + UTF-8
      +
      +
      +
      BASE_SITE_ROOT
      +
      +
      +
      +
      +
      PLUGINS_SITE_ROOT
      +
      + /static/plugins
      +
      +
      +
      ADMIN_SITE_ROOT
      +
      + /static/admin
      +
      +
      +
      HOME_SITE_ROOT
      +
      + /static/home
      +
      +
      +
      REWRITE_MODEL
      +
      + false
      +
      +
      +
      BASE_SITE_URL
      +
      + http://mall.com/index.php
      +
      +
      +
      HOME_SITE_URL
      +
      + http://mall.com/index.php/home
      +
      +
      +
      ADMIN_SITE_URL
      +
      + http://mall.com/index.php/admin
      +
      +
      +
      MOBILE_SITE_URL
      +
      + http://mall.com/index.php/mobile
      +
      +
      +
      WAP_SITE_URL
      +
      + http://mall.com/wap
      +
      +
      +
      UPLOAD_SITE_URL
      +
      + http://mall.com/uploads
      +
      +
      +
      EXAMPLES_SITE_URL
      +
      + http://mall.com/examples
      +
      +
      +
      CHAT_SITE_URL
      +
      + http://mall.com/static/chat
      +
      +
      +
      SESSION_EXPIRE
      +
      + 3600
      +
      +
      +
      PUBLIC_PATH
      +
      + D:\wwwroot\mall\/public
      +
      +
      +
      BASE_DATA_PATH
      +
      + D:\wwwroot\mall\/public/data
      +
      +
      +
      BASE_UPLOAD_PATH
      +
      + D:\wwwroot\mall\/public/uploads
      +
      +
      +
      BASE_RESOURCE_PATH
      +
      + D:\wwwroot\mall\/public/resource
      +
      +
      +
      TIMESTAMP
      +
      + 1548323988
      +
      +
      +
      DIR_SHOP
      +
      + shop
      +
      +
      +
      DIR_ADMIN
      +
      + admin
      +
      +
      +
      DIR_API
      +
      + api
      +
      +
      +
      DIR_MOBILE
      +
      + mobile
      +
      +
      +
      DIR_WAP
      +
      + wap
      +
      +
      +
      DIR_RESOURCE
      +
      + data/resource
      +
      +
      +
      DIR_UPLOAD
      +
      + public/uploads
      +
      +
      +
      ATTACH_PATH
      +
      + home
      +
      +
      +
      ATTACH_COMMON
      +
      + home/common
      +
      +
      +
      ATTACH_AVATAR
      +
      + home/avatar
      +
      +
      +
      ATTACH_INVITER
      +
      + home/inviter
      +
      +
      +
      ATTACH_EDITOR
      +
      + home/editor
      +
      +
      +
      ATTACH_MEMBERTAG
      +
      + home/membertag
      +
      +
      +
      ATTACH_STORE
      +
      + home/store
      +
      +
      +
      ATTACH_GOODS
      +
      + home/store/goods
      +
      +
      +
      ATTACH_STORE_DECORATION
      +
      + home/store/decoration
      +
      +
      +
      ATTACH_LOGIN
      +
      + home/login
      +
      +
      +
      ATTACH_WAYBILL
      +
      + home/waybill
      +
      +
      +
      ATTACH_ARTICLE
      +
      + home/article
      +
      +
      +
      ATTACH_BRAND
      +
      + home/brand
      +
      +
      +
      ATTACH_COMPLAIN
      +
      + home/complain
      +
      +
      +
      ATTACH_GOODS_CLASS
      +
      + home/goods_class
      +
      +
      +
      ATTACH_DELIVERY
      +
      + /delivery
      +
      +
      +
      ATTACH_ADV
      +
      + home/adv
      +
      +
      +
      ATTACH_APPADV
      +
      + home/appadv
      +
      +
      +
      ATTACH_ACTIVITY
      +
      + home/activity
      +
      +
      +
      ATTACH_WATERMARK
      +
      + home/watermark
      +
      +
      +
      ATTACH_POINTPROD
      +
      + home/pointprod
      +
      +
      +
      ATTACH_GROUPBUY
      +
      + home/groupbuy
      +
      +
      +
      ATTACH_LIVE_GROUPBUY
      +
      + home/livegroupbuy
      +
      +
      +
      ATTACH_SLIDE
      +
      + home/store/slide
      +
      +
      +
      ATTACH_VOUCHER
      +
      + home/voucher
      +
      +
      +
      ATTACH_STORE_JOININ
      +
      + home/store_joinin
      +
      +
      +
      ATTACH_MOBILE
      +
      + mobile
      +
      +
      +
      ATTACH_LIVE
      +
      + live
      +
      +
      +
      ATTACH_MALBUM
      +
      + home/member
      +
      +
      +
      TPL_SHOP_NAME
      +
      + default
      +
      +
      +
      TPL_ADMIN_NAME
      +
      + default
      +
      +
      +
      TPL_DELIVERY_NAME
      +
      + default
      +
      +
      +
      TPL_MEMBER_NAME
      +
      + default
      +
      +
      +
      DEFAULT_CONNECT_SMS_TIME
      +
      + 60
      +
      +
      +
      STORE_JOIN_STATE_NEW
      +
      + 10
      +
      +
      +
      STORE_JOIN_STATE_PAY
      +
      + 11
      +
      +
      +
      STORE_JOIN_STATE_VERIFY_SUCCESS
      +
      + 20
      +
      +
      +
      STORE_JOIN_STATE_VERIFY_FAIL
      +
      + 30
      +
      +
      +
      STORE_JOIN_STATE_PAY_FAIL
      +
      + 31
      +
      +
      +
      STORE_JOIN_STATE_FINAL
      +
      + 40
      +
      +
      +
      DEFAULT_SPEC_COLOR_ID
      +
      + 1
      +
      +
      +
      GOODS_IMAGES_WIDTH
      +
      + 60,240,360,1280
      +
      +
      +
      GOODS_IMAGES_HEIGHT
      +
      + 60,240,360,12800
      +
      +
      +
      GOODS_IMAGES_EXT
      +
      + _60,_240,_360,_1280
      +
      +
      +
      ORDER_STATE_CANCEL
      +
      + 0
      +
      +
      +
      ORDER_STATE_NEW
      +
      + 10
      +
      +
      +
      ORDER_STATE_PAY
      +
      + 20
      +
      +
      +
      ORDER_STATE_SEND
      +
      + 30
      +
      +
      +
      ORDER_STATE_SUCCESS
      +
      + 40
      +
      +
      +
      ORDER_AUTO_CANCEL_DAY
      +
      + 3
      +
      +
      +
      ORDER_AUTO_RECEIVE_DAY
      +
      + 7
      +
      +
      +
      CODE_INVALID_REFUND
      +
      + 7
      +
      +
      +
      ORDER_DEL_STATE_DEFAULT
      +
      + 0
      +
      +
      +
      ORDER_DEL_STATE_DELETE
      +
      + 1
      +
      +
      +
      ORDER_DEL_STATE_DROP
      +
      + 2
      +
      +
      +
      ORDER_EVALUATE_TIME
      +
      + 1296000
      +
      +
      +
      OFFLINE_ORDER_CANCEL_TIME
      +
      + 3
      +
      +
      +
      +
      + + + + + diff --git a/static/app2/img/sousuo.png b/static/app2/img/sousuo.png old mode 100755 new mode 100644 diff --git a/static/app2/img/spotmkrs.png b/static/app2/img/spotmkrs.png new file mode 100644 index 0000000..191efd9 Binary files /dev/null and b/static/app2/img/spotmkrs.png differ diff --git a/static/app2/img/start.png b/static/app2/img/start.png new file mode 100644 index 0000000..bc9f5ec Binary files /dev/null and b/static/app2/img/start.png differ diff --git a/static/app2/img/tanhao.png b/static/app2/img/tanhao.png new file mode 100644 index 0000000..d98b5fc Binary files /dev/null and b/static/app2/img/tanhao.png differ diff --git a/static/app2/img/tianjia.png b/static/app2/img/tianjia.png new file mode 100644 index 0000000..962178a Binary files /dev/null and b/static/app2/img/tianjia.png differ diff --git a/static/app2/img/time_bg.png b/static/app2/img/time_bg.png new file mode 100644 index 0000000..8507300 Binary files /dev/null and b/static/app2/img/time_bg.png differ diff --git a/static/app2/img/time_icon.png b/static/app2/img/time_icon.png new file mode 100644 index 0000000..7018616 Binary files /dev/null and b/static/app2/img/time_icon.png differ diff --git a/static/app2/img/time_more.png b/static/app2/img/time_more.png new file mode 100644 index 0000000..edaf0ef Binary files /dev/null and b/static/app2/img/time_more.png differ diff --git a/static/app2/img/timer_logo.png b/static/app2/img/timer_logo.png new file mode 100644 index 0000000..6e8eadd Binary files /dev/null and b/static/app2/img/timer_logo.png differ diff --git a/static/app2/img/title_ac11next.png b/static/app2/img/title_ac11next.png new file mode 100644 index 0000000..eccc41f Binary files /dev/null and b/static/app2/img/title_ac11next.png differ diff --git a/static/app2/img/title_brand.png b/static/app2/img/title_brand.png new file mode 100644 index 0000000..aec8a83 Binary files /dev/null and b/static/app2/img/title_brand.png differ diff --git a/static/app2/img/title_miaosha.png b/static/app2/img/title_miaosha.png new file mode 100644 index 0000000..3cf7294 Binary files /dev/null and b/static/app2/img/title_miaosha.png differ diff --git a/static/app2/img/title_miaoshaqu.png b/static/app2/img/title_miaoshaqu.png new file mode 100644 index 0000000..f5c3005 Binary files /dev/null and b/static/app2/img/title_miaoshaqu.png differ diff --git a/static/app2/img/title_news.png b/static/app2/img/title_news.png new file mode 100644 index 0000000..307416e Binary files /dev/null and b/static/app2/img/title_news.png differ diff --git a/static/app2/img/title_pp.png b/static/app2/img/title_pp.png new file mode 100644 index 0000000..4174108 Binary files /dev/null and b/static/app2/img/title_pp.png differ diff --git a/static/app2/img/title_zhekouqu.png b/static/app2/img/title_zhekouqu.png new file mode 100644 index 0000000..1950adc Binary files /dev/null and b/static/app2/img/title_zhekouqu.png differ diff --git a/static/app2/img/tixian.png b/static/app2/img/tixian.png new file mode 100644 index 0000000..50ffcaf Binary files /dev/null and b/static/app2/img/tixian.png differ diff --git a/static/app2/img/tixian6.png b/static/app2/img/tixian6.png new file mode 100644 index 0000000..d029533 Binary files /dev/null and b/static/app2/img/tixian6.png differ diff --git a/static/app2/img/touxiang.jpg b/static/app2/img/touxiang.jpg new file mode 100644 index 0000000..9047ca2 Binary files /dev/null and b/static/app2/img/touxiang.jpg differ diff --git a/static/app2/img/trade.png b/static/app2/img/trade.png new file mode 100644 index 0000000..0528aa5 Binary files /dev/null and b/static/app2/img/trade.png differ diff --git a/static/app2/img/trade1.png b/static/app2/img/trade1.png new file mode 100644 index 0000000..19d387a Binary files /dev/null and b/static/app2/img/trade1.png differ diff --git a/static/app2/img/true.jpg b/static/app2/img/true.jpg new file mode 100644 index 0000000..e186417 Binary files /dev/null and b/static/app2/img/true.jpg differ diff --git a/static/app2/img/tuijian.png b/static/app2/img/tuijian.png new file mode 100644 index 0000000..8c0ad4c Binary files /dev/null and b/static/app2/img/tuijian.png differ diff --git a/static/app2/img/weiba.png b/static/app2/img/weiba.png new file mode 100644 index 0000000..622c3ff Binary files /dev/null and b/static/app2/img/weiba.png differ diff --git a/static/app2/img/xiajiantou.png b/static/app2/img/xiajiantou.png new file mode 100644 index 0000000..bab4af5 Binary files /dev/null and b/static/app2/img/xiajiantou.png differ diff --git a/static/app2/img/xianshiqianggou.png b/static/app2/img/xianshiqianggou.png old mode 100755 new mode 100644 diff --git a/static/app2/img/xiaodian.png b/static/app2/img/xiaodian.png new file mode 100644 index 0000000..4dafe95 Binary files /dev/null and b/static/app2/img/xiaodian.png differ diff --git a/static/app2/img/xinyongka.png b/static/app2/img/xinyongka.png new file mode 100644 index 0000000..48965bd Binary files /dev/null and b/static/app2/img/xinyongka.png differ diff --git a/static/app2/img/youjiantou.png b/static/app2/img/youjiantou.png old mode 100755 new mode 100644 diff --git a/static/app2/img/yuan.png b/static/app2/img/yuan.png old mode 100755 new mode 100644 index 1c7423f..2b4f820 Binary files a/static/app2/img/yuan.png and b/static/app2/img/yuan.png differ diff --git a/static/app2/img/zan1.png b/static/app2/img/zan1.png old mode 100755 new mode 100644 diff --git a/static/app2/img/zan2.png b/static/app2/img/zan2.png old mode 100755 new mode 100644 diff --git a/static/app2/js/addessay.js b/static/app2/js/addessay.js old mode 100755 new mode 100644 diff --git a/static/app2/js/addgoods.1.js b/static/app2/js/addgoods.1.js old mode 100755 new mode 100644 index 19e0a7f..3754144 --- a/static/app2/js/addgoods.1.js +++ b/static/app2/js/addgoods.1.js @@ -1,658 +1,658 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); - -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - var goodsId = self.goodsId; - // //console.log(shopId); - // var isSale = typeof(self.isSale)!= 'undefined' ? self.isSale : ""; - // var isSpec = typeof(self.isSpec)!= 'undefined' ? self.isSpec : ""; - if (goodsId > 0) { - $(".title").text("编辑商品") - - JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { - shopId: shopId, - goodsId: goodsId - }, function(data) { - //console.log(data); - if (data.status == 1) { - var html1 = ''; - var data = data.data; - var i = 0, - j = 0; - var res = ''; - var id = data.setNameId; - if (1 == data.isSpec) { - getRecommend(page, pageSize, id) - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(datas) { - setSpec(data.spec, specList) - }); - - } - if (1 == data.isSale) { - $('#isSale').prop("checked", "checked"); - } - mui.each(data, function(index, element) { - if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { - var imgindex = index.substring(0, index.length - 3); - var obj = '#' + imgindex; - // //console.log(obj); - // if ($(obj)!= "") { - if ($(obj).is('img')) { - // //console.log(element); - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index).val(element) - // } - } else if ($('#' + index).hasClass('gallery')) { - var html = '' - // //console.log(element.length); - if (element.length > 0) { - var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; - //console.log("test"); - - html = '' - for (var i = 0; i < imgurls.length; i++) { - html += '
      ' - // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) - } - var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; - html += '
      '; - $(".batchImg").html(html) - } else { - html = ""; - html = - '
      '; - $(".batchImg").html(html) - } - } - } else if (index == 'goodsCatIdPath') { - // data.goodsCatIdPath 三级目录 - var goodsCatIdPathArr = []; - var pathArr = ["largeCat", "mediumCat", "smallCat"] - // //console.log(data.goodsCatIdPath); - goodsCatIdPathArr = data.goodsCatIdPath.split('_') - goodsCatIdPathArr.pop() - // //console.log(goodsCatIdPathArr); - mui.each(pathArr, function(idx, ele) { - // //console.log(idx); - switch (ele) { - case 'largeCat': - getCatIdPathName(goodsCatIdPathArr[0], function(data) { - // //console.log(data); - getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); - }) - break; - case 'mediumCat': - getCatIdPathName(goodsCatIdPathArr[1], function(data) { - $('#mediumCat').html('') - }); - break; - case 'smallCat': - getCatIdPathName(goodsCatIdPathArr[2], function(data) { - $('#smallCat').html('') - }); - break; - } - }) - - } else { - $('#' + index).val(element) - } - }) - } - }) - - } else { - getGoodsCats("largeCat", 0) - getRecommend(page, pageSize); - - $(".title").text("添加商品") - } - - function setSpec(goodsSpec, specList) { - var html1 = '', - res = '', - goodsRes = '' - - var arr = []; - var arr2 = {}; - for (var i = 0; i < specList.length; i++) { - arr.push(specList[i].list); - arr2[specList[i].catId] = specList[i].list; - } - var a = combins(arr); - var cLength = 0; - var catId = 0; - var showSpecNames = []; - while (c = a.next()) { - res = c.join(' '); - cLength = c.length; - for (i = 0; i < cLength; i++) { - $.each(arr2, function(ind, val) { - $.each(val, function(index, value) { - if (value == c[i]) { - catId = ind; - return; - } - }); - }) - html1 += '' + - '' + - ''; - } - html1 += '' + - '
      ' - j++; - } - $('.pricset_con_con').html(html1); - mui.each(goodsSpec, function(idx, val) { - goodsRes = ''; - i = 0; - mui.each(val.names, function(index, value) { - goodsRes += value.itemName + ' '; //hongse 39ma - }) - var showSpecNames = $('label[name="showSpecNames[]"]'); - - var specNameArr=[]; - for(var k=0;k' + -// '' + -// ''; -// goodsRes += value.itemName + ' '; -// i++; -// }) -// html1 += '' + -// '
      '; - // j++; - }) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // $('.pricset_con_con').html(html1); - } - -}) -} - -function getCatIdPathName(catId, callback) { - JZL.ajax(qlgUrl("app/goodscats/getCatName"), { - catId: catId - }, function(data) { - callback(data); - }) -} - -//获取商品总规格列表 -var page = 1; -var pageSize = 100; -var isjiazai = 1; - -function getRecommend(page, pageSize, defaultVal) { - - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 100 - } - recommenddata.shopId = shopId - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { - - - // //console.log(data); - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if (typeof(defaultVal) == "undefined") { - // //console.log(1); - $.each(data.Rows, function() { - html += '' - }); - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - } else { - // //console.log(defaultVal); - $.each(data.Rows, function() { - if (this.id = defaultVal) { - selected = 'selected'; - } else { - selected = ''; - } - html = ''; - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - }); - - - } - - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - isjiazai = 1; - }) -} - -//获取商品规格 - -combins = function(args) { - - if (args.length < 2) return args[0] || []; - // if (arguments.length < 2) return arguments[0] || []; - //var args = Array.prototype.slice.call(arguments); - var that = { - index: 0, - nth: function(n) { - var result = [], - d = 0; - for (; d < this.dim; d++) { - var l = this[d].length; - var i = n % l; - result.push(this[d][i]); - n -= i; - n /= l; - } - return result; - }, - next: function() { - if (this.index >= size) return; - var result = this.nth(this.index); - this.index++; - return result; - } - }; - var size = 1; - for (var i = 0; i < args.length; i++) { - size = size * args[i].length; - that[i] = args[i]; - } - that.size = size; - that.dim = args.length; - return that; -} - -// 判断是否上架 -var isSale = "", - setNameId, - isSpec; -if ($("#isSale").prop("checked")) { - isSale = "1"; -} else { - isSale = "0"; -} -// 判断有没有商品属性 - -if ($("#setNameId option:selected").val() != "") { - isSpec = 1; -} else { - isSpec = 0; -} - -$('#setNameId').change(function() { - var id = $('#setNameId option:selected').val() - - var html1 = ""; - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(data) { - - // //console.log(data); - if (1 == data.status) { - - var arr = []; - var arr2 = {}; - for (var i = 0; i < data.data.length; i++) { - arr.push(data.data[i].list); - arr2[data.data[i].catId] = data.data[i].list; - } - var a = combins(arr); - var j = 0; - var res = ''; - var cLength = 0; - var catId = 0; - while (c = a.next()) { - res = c.join(','); - cLength = c.length; - for (i = 0; i < cLength; i++) { - $.each(arr2, function(ind, val) { - $.each(val, function(index, value) { - if (value == c[i]) { - catId = ind; - return; - } - }); - - }) - html1 += '' + - '' + - ''; - - } - html1 += '' + - '
      ' - j++; - } - $('.pricset_con_con').html(html1); - } - }) -}) - -// 下一页 -var check = true; -mui("body").on('tap', '.next_btn', function() { - check = true; - $('.isemptyinp').each(function() { - // //console.log(this); - - if (!this.value || "" == $.trim(this.value)) { - var label = this.previousElementSibling; - //console.log(label); - mui.alert(label.innerText + "不允许为空") - check = false; - return false; - } - }) - - if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { - mui.alert("商品没有属性必须输入商品价格") - check = false; - return false; - } - - if ($("#setNameId option:selected").val() != "" & check == true) { - $('.pricset_con_con input').each(function() { - if ((!this.value || "" == $.trim(this.value))) { - mui.alert("请输入数据") - check = false; - return false; - } - }) - } - - - if (check == true) { - $(".addcon").css("display", "none") - $(".pre").css("display", "block"); - backTop(); - let E = window.wangEditor; - - let editor = new E('#goodsDesc'); - editor.customConfig.uploadImgShowBase64 = true; - editor.create(); - } - - -}) -//预览 -mui("body").on('tap', '.prelook', function() { - - - -}) - - - -// 上一页 -mui('body').on('tap', '.pre_btn', function() { - $(".addcon").css("display", "block") - $(".pre").css("display", "none") -}) -// //console.log($("#goodsDesc").text()); - -//提交 -var click = false; -mui('.btn').on('tap', '.submit_btn ', function() { - if (click == true) { - return - } - - var imgs = ''; - var data = $('input[name="gallery[]"]'); - // //console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - - }) - - - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - - - $('#gallery').val(imgs); - // //console.log($('#gallery').val()); - - var params = JZL.getParams(".inp"); - params.shopId = shopId; - params.isSale = isSale; - params.isSpec = isSpec; - params.goodsDesc = $("#goodsDesc").text(); - params.setNameId = $('#setNameId option:selected').val() - click = true; - if (goodsId > 0) { - params.goodsId = goodsId; - - } - JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { - // //console.log(data); - if (data.status == 1) { - mui.back(); - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - - }) - - -}) - -//获取类目 -$('.selectarea').on("change", ".area", function() { - var objs = ['largeCat', 'mediumCat', 'smallCat']; - // var areaStr = ['请选择', '请选择', '请选择']; - var level = +$(this).attr('data-level') + 1; //0 - pid = $('#' + objs[level - 1] + ' option:selected').val(); - getGoodsCats(objs[level], pid); - -}) - -//三级类目 -function getGoodsCats(obj, pid, defaultId) { - JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { - pid: pid - }, - function(data) { - // //console.log(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('undefined' == typeof(defaultId)) { - $.each(data, function() { - // //console.log(this); - html += '' - }); - } else { - $.each(data, function() { - if (this.catId == defaultId) { - selected = 'selected'; - } else { - selected = ''; - } - html += '' - }); - } - $('#' + obj).html(html); - } - }) -} - -// 上传图片 -$(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - // //console.log($('#galleryImg[' + num + ']')); - //if ($('#galleryImg[' + num + ']').length > 0) { - that.html(html); - //} else { - // $(".batchImg").append(html); - //} - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); -}) - -$(".oneImg").on("tap", '#goods', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("goodsImg", "test", "goods") - openCamera(function(t, status, fileName, serverName) { - var html = ''; - - $(".goods").html(html); - - }) -}) -// 删除图片 -$(".batchImg").on('tap', '.delete', function(e) { - -e.preventDefault(); -e.stopPropagation() - -// //console.log(this); -var that = $(this) -//var idx = that.parent().attr('data-id'); -//var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; -if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; -} -}) - -}) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); + +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + var goodsId = self.goodsId; + // //console.log(shopId); + // var isSale = typeof(self.isSale)!= 'undefined' ? self.isSale : ""; + // var isSpec = typeof(self.isSpec)!= 'undefined' ? self.isSpec : ""; + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var id = data.setNameId; + if (1 == data.isSpec) { + getRecommend(page, pageSize, id) + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(datas) { + setSpec(data.spec, specList) + }); + + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + // //console.log(obj); + // if ($(obj)!= "") { + if ($(obj).is('img')) { + // //console.log(element); + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + // } + } else if ($('#' + index).hasClass('gallery')) { + var html = '' + // //console.log(element.length); + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + //console.log("test"); + + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + // //console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() + // //console.log(goodsCatIdPathArr); + mui.each(pathArr, function(idx, ele) { + // //console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + // //console.log(data); + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + + $(".title").text("添加商品") + } + + function setSpec(goodsSpec, specList) { + var html1 = '', + res = '', + goodsRes = '' + + var arr = []; + var arr2 = {}; + for (var i = 0; i < specList.length; i++) { + arr.push(specList[i].list); + arr2[specList[i].catId] = specList[i].list; + } + var a = combins(arr); + var cLength = 0; + var catId = 0; + var showSpecNames = []; + while (c = a.next()) { + res = c.join(' '); + cLength = c.length; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + }) + html1 += '' + + '' + + ''; + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + mui.each(goodsSpec, function(idx, val) { + goodsRes = ''; + i = 0; + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + var showSpecNames = $('label[name="showSpecNames[]"]'); + + var specNameArr=[]; + for(var k=0;k' + +// '' + +// ''; +// goodsRes += value.itemName + ' '; +// i++; +// }) +// html1 += '' + +// '
      '; + // j++; + }) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // $('.pricset_con_con').html(html1); + } + +}) +} + +function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) +} + +//获取商品总规格列表 +var page = 1; +var pageSize = 100; +var isjiazai = 1; + +function getRecommend(page, pageSize, defaultVal) { + + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // //console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // //console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // //console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id = defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html = ''; + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + }); + + + } + + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + isjiazai = 1; + }) +} + +//获取商品规格 + +combins = function(args) { + + if (args.length < 2) return args[0] || []; + // if (arguments.length < 2) return arguments[0] || []; + //var args = Array.prototype.slice.call(arguments); + var that = { + index: 0, + nth: function(n) { + var result = [], + d = 0; + for (; d < this.dim; d++) { + var l = this[d].length; + var i = n % l; + result.push(this[d][i]); + n -= i; + n /= l; + } + return result; + }, + next: function() { + if (this.index >= size) return; + var result = this.nth(this.index); + this.index++; + return result; + } + }; + var size = 1; + for (var i = 0; i < args.length; i++) { + size = size * args[i].length; + that[i] = args[i]; + } + that.size = size; + that.dim = args.length; + return that; +} + +// 判断是否上架 +var isSale = "", + setNameId, + isSpec; +if ($("#isSale").prop("checked")) { + isSale = "1"; +} else { + isSale = "0"; +} +// 判断有没有商品属性 + +if ($("#setNameId option:selected").val() != "") { + isSpec = 1; +} else { + isSpec = 0; +} + +$('#setNameId').change(function() { + var id = $('#setNameId option:selected').val() + + var html1 = ""; + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + + // //console.log(data); + if (1 == data.status) { + + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + var a = combins(arr); + var j = 0; + var res = ''; + var cLength = 0; + var catId = 0; + while (c = a.next()) { + res = c.join(','); + cLength = c.length; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + + '' + + ''; + + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + } + }) +}) + +// 下一页 +var check = true; +mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + // //console.log(this); + + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + //console.log(label); + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + + if ($("#setNameId option:selected").val() != "" & check == true) { + $('.pricset_con_con input').each(function() { + if ((!this.value || "" == $.trim(this.value))) { + mui.alert("请输入数据") + check = false; + return false; + } + }) + } + + + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + let E = window.wangEditor; + + let editor = new E('#goodsDesc'); + editor.customConfig.uploadImgShowBase64 = true; + editor.create(); + } + + +}) +//预览 +mui("body").on('tap', '.prelook', function() { + + + +}) + + + +// 上一页 +mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") +}) +// //console.log($("#goodsDesc").text()); + +//提交 +var click = false; +mui('.btn').on('tap', '.submit_btn ', function() { + if (click == true) { + return + } + + var imgs = ''; + var data = $('input[name="gallery[]"]'); + // //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + // //console.log($('#gallery').val()); + + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.goodsDesc = $("#goodsDesc").text(); + params.setNameId = $('#setNameId option:selected').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + // //console.log(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + + }) + + +}) + +//获取类目 +$('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + +}) + +//三级类目 +function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // //console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // //console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) +} + +// 上传图片 +$(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + // //console.log($('#galleryImg[' + num + ']')); + //if ($('#galleryImg[' + num + ']').length > 0) { + that.html(html); + //} else { + // $(".batchImg").append(html); + //} + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); +}) + +$(".oneImg").on("tap", '#goods', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) +}) +// 删除图片 +$(".batchImg").on('tap', '.delete', function(e) { + +e.preventDefault(); +e.stopPropagation() + +// //console.log(this); +var that = $(this) +//var idx = that.parent().attr('data-id'); +//var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; +if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; +} +}) + +}) diff --git a/static/app2/js/addgoods.2.js b/static/app2/js/addgoods.2.js old mode 100755 new mode 100644 index 5fd7f09..ed9ccdb --- a/static/app2/js/addgoods.2.js +++ b/static/app2/js/addgoods.2.js @@ -1,859 +1,859 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -$(".pricset_con").hide(); -function escape2Html(str) { - var arrEntities = { - 'lt': '<', - 'gt': '>', - 'nbsp': ' ', - 'amp': '&', - 'quot': '"' - }; - return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { - return arrEntities[i]; - }); -}; -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - // ////console.log(self); - var shopId = self.id; - var goodsId = self.goodsId; - var richText = ''; - - var E = window.wangEditor - var editor = new E('#goodsDesc') - // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab - // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 - // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 - - // 允许上传到七牛云存储 - editor.customConfig.qiniu = true; - editor.customConfig.debug = true; - // editor.customConfig.onchange = function (html) { - // // 监控变化,同步更新到 textarea - // // $text1.val(html) - // }; - editor.create(); - // 初始化七牛上传 - - - if (goodsId > 0) { - $(".title").text("编辑商品") - - JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { - shopId: shopId, - goodsId: goodsId - }, function(data) { - //console.log(data); - if (data.status == 1) { - var html1 = ''; - var data = data.data; - var i = 0, - j = 0; - var res = ''; - var bjSpec = data.isSpec; - if (1 == data.isSpec) { - $(".pricset_con").show() - var id = data.setNameId; - - // ////console.log(id); - getRecommend(page, pageSize, id) - - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(data1) { - //console.log(data1); - if (1 == data1.status) { - var that = this - var arr = []; - var arr2 = {}; - for (var i = 0; i < data1.data.length; i++) { - arr.push(data1.data[i].list); - arr2[data1.data[i].catId] = data1.data[i].list; - } - - // ////console.log(a); - var cLength = 0; - var catId = 0; - var goodsRes = ""; - if (arr.length > 0) { - var tmpI = 0; - var a = combins(arr); - while (true) { - if (arr.length > 1) { - c = a.next(); - if (!c) break; - cLength = c.length; - res = c.join(' '); - } else { - if (tmpI >= arr[0].length) { - break; - } - c = arr[0]; - res = arr[0][tmpI]; - cLength = arr[0].length; - } - tmpI++; - // ////console.log(c); - // ////console.log(res); - for (i = 0; i < cLength; i++) { - $.each(arr2, function(ind, val) { - $.each(val, function(index, value) { - if (value == c[i]) { - catId = ind; - return; - } - }); - - }) - html1 += '' + //属性值id - '' + //分类ID - ''; - } - //console.log(j); - html1 += '' + //规格表ID 新增传0 - '
      '; - j++; - } - - $('.pricset_con_con').html(html1); - var setNum = 0; - mui.each(data.spec, function(idx, val) { - if (cLength != val.names.length) return false; - goodsRes = ''; - i = 0; - if (arr.length > 1) { - mui.each(val.names, function(index, value) { - goodsRes += value.itemName + ' '; //hongse 39ma - }) - } else { - // //console.log(val); - //console.log(val.names); - goodsRes = val.names[setNum].itemName; - setNum++; - } - var showSpecNames = $('label[name="showSpecNames[]"]'); - var specNameArr = []; - for (var k = 0; k < showSpecNames.length; k++) { - specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); - } - $.each(specNameArr, function(sitem, sval) { - if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 - i = 0; - mui.each(val.names, function(index, value) { - // ////console.log(i); - document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 - i++; - }); - document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 - document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice - document.getElementById('specStock[' + +sitem + ']').value = val.specStock - if (1 == val.isDefault) { - - //checked - var inputList = $('input[name=defaultId]') - - - $.each(inputList, function(index, value) { - // ////console.log(value, index); - this.previousElementSibling - if (sitem == this.value) { - this.checked = true - } - }) - } - - } - }) - - }) - } - } - }) - - - } else if (0 == data.isSpec) { - // $('#setNameId').html('') - getRecommend(page, pageSize) - } - if (1 == data.isSale) { - $('#isSale').prop("checked", "checked"); - } - mui.each(data, function(index, element) { - if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { - var imgindex = index.substring(0, index.length - 3); - var obj = '#' + imgindex; - if ($(obj).is('img')) { - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index).val(element) - } else if ($('#' + index).hasClass('gallery')) { - var html = ''; - if (element.length > 0) { - var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; - html = '' - for (var i = 0; i < imgurls.length; i++) { - html += '
      ' - // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) - } - var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; - html += '
      '; - $(".batchImg").html(html) - } else { - html = ""; - html = - '
      '; - $(".batchImg").html(html) - } - } - } else if (index == 'goodsCatIdPath') { - // data.goodsCatIdPath 三级目录 - var goodsCatIdPathArr = []; - var pathArr = ["largeCat", "mediumCat", "smallCat"] - // ////console.log(data.goodsCatIdPath); - goodsCatIdPathArr = data.goodsCatIdPath.split('_') - goodsCatIdPathArr.pop() //移除最后一个数组元素 _ - mui.each(pathArr, function(idx, ele) { - // ////console.log(idx); - switch (ele) { - case 'largeCat': - getCatIdPathName(goodsCatIdPathArr[0], function(data) { - getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); - }) - break; - case 'mediumCat': - getCatIdPathName(goodsCatIdPathArr[1], function(data) { - $('#mediumCat').html('') - }); - break; - case 'smallCat': - getCatIdPathName(goodsCatIdPathArr[2], function(data) { - $('#smallCat').html('') - }); - break; - } - }) - - } else { - $('#' + index).val(element) - } - }) - if ('' != data.goodsDesc) { - var Desc = escape2Html(data.goodsDesc) - // var Desc= HtmlUtils.htmlUnescape(data.goodsDesc) - ////console.log(Desc) - // $('#goodsDesc').val(Desc) - // $('#goodsDesc').html(Desc) - editor.txt.html(Desc) - } - - // params.goodsDesc = editor.txt.html(); - - } else { - mui.alert(data.msg) - } - }) - - } else { - getGoodsCats("largeCat", 0) - getRecommend(page, pageSize); - - $(".title").text("添加商品") - } - - - function getCatIdPathName(catId, callback) { - JZL.ajax(qlgUrl("app/goodscats/getCatName"), { - catId: catId - }, function(data) { - callback(data); - }) - } - - //获取商品总规格列表 - var page = 1; - var pageSize = 100; - var isjiazai = 1; - - function getRecommend(page, pageSize, defaultVal) { - - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 100 - } - recommenddata.shopId = shopId - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { - - - // ////console.log(data); - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if (typeof(defaultVal) == "undefined") { - // ////console.log(1); - $.each(data.Rows, function() { - html += '' - }); - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - } else { - // ////console.log(defaultVal); - $.each(data.Rows, function() { - if (this.id == defaultVal) { - selected = 'selected'; - } else { - selected = ''; - } - html += ''; - - }); - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - - } - - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg); - // location.reload(); - } - isjiazai = 1; - }) - } - - //获取商品规格 - // 笛卡尔积 - combins = function(args) { - - if (args.length < 2) return args[0] || []; - // if (arguments.length < 2) return arguments[0] || []; - //var args = Array.prototype.slice.call(arguments); - var that = { - index: 0, - nth: function(n) { - var result = [], - d = 0; - for (; d < this.dim; d++) { - var l = this[d].length; - var i = n % l; - result.push(this[d][i]); - n -= i; - n /= l; - } - return result; - }, - next: function() { - if (this.index >= size) return; - var result = this.nth(this.index); - this.index++; - return result; - } - }; - var size = 1; - for (var i = 0; i < args.length; i++) { - size = size * args[i].length; - that[i] = args[i]; - } - that.size = size; - that.dim = args.length; - return that; - } - - - - $('#setNameId').change(function() { - var id = $('#setNameId option:selected').attr('data-id') - // ////console.log(id); - - var html1 = ""; - if (typeof id == "undefined" || 0 == id) { - $(".pricset_con").hide() - } else { - $(".pricset_con").show() - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(data) { - // ////console.log(data); - if (1 == data.status) { - html1 = ""; - var arr = []; - var arr2 = {}; - for (var i = 0; i < data.data.length; i++) { - arr.push(data.data[i].list); - arr2[data.data[i].catId] = data.data[i].list; - } - - var j = 0; - var res = ''; - var cLength = 0; - var catId = 0; - var tmpI = 0; - var a = combins(arr); - while (true) { - if (arr.length > 1) { - c = a.next(); - if (!c) break; - cLength = c.length; - res = c.join(' '); - } else { - if (tmpI >= arr[0].length) { - break; - } - c = arr[0]; - res = arr[0][tmpI]; - cLength = arr[0].length; - } - tmpI++; - for (i = 0; i < cLength; i++) { - $.each(arr2, function(ind, val) { - $.each(val, function(index, value) { - if (value == c[i]) { - catId = ind; - return; - } - }); - - }) - html1 += '' + - '' + - ''; - - } - html1 += '' + - '
      ' - j++; - } - $('.pricset_con_con').html(html1); - } else { - mui.alert(data.msg) - } - }) - } - }) - - // 下一页 - var check = true; - mui("body").on('tap', '.next_btn', function() { - check = true; - $('.isemptyinp').each(function() { - if (!this.value || "" == $.trim(this.value)) { - var label = this.previousElementSibling; - mui.alert(label.innerText + "不允许为空") - check = false; - return false; - } - }) - - if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { - mui.alert("商品没有属性必须输入商品价格") - check = false; - return false; - } - if ($("#setNameId option:selected").val() != 0 && check == true) { - - if ($('input[name="defaultId"]:checked').length == 0) { - mui.alert("请选择默认规格") - check = false; - return false - } - $('.pricset_con_con input').each(function() { - if ((!$(this).val() || "" == $.trim(this.value))) { - - - mui.alert("请输入数据") - $(this).focus(); - check = false; - return false; - } - }) - } - // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); - // ////console.log(shopPrice) - if ($("#isSale").prop("checked")) { - isSale = "1"; - } else { - isSale = "0"; - } - if (check == true) { - $(".addcon").css("display", "none") - $(".pre").css("display", "block"); - backTop(); - - } - - - }) - //预览 - $('.prelook').hide(); - // mui("body").on('tap', '.prelook', function() { - // - // - // - // }) - // 上一页 - mui('body').on('tap', '.pre_btn', function() { - $(".addcon").css("display", "block") - $(".pre").css("display", "none") - }) - // ////console.log($("#goodsDesc").text()); - - //提交 - // 判断是否上架 - var isSale = "", - setNameId, - isSpec; - - // ////console.log(typeof($("#setNameId option:selected").val())); - - - //提交 - var click = false; - mui('.btn').on('tap', '.submit_btn ', function() { - richText = editor.txt.text() - // 判断有没有商品属性 - if ($("#setNameId option:selected").val() != 0) { - isSpec = 1; - } else { - isSpec = 0; - } - if (click == true) { - return - } - - if ($("#isSale").prop("checked")) { - // ////console.log(1); - isSale = "1"; - } else { - // ////console.log(0); - isSale = "0"; - } - var imgs = ''; - var data = $('input[name="gallery[]"]'); - // ////console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - - }) - - - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - - - $('#gallery').val(imgs); - //默认选中 - var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); - var params = JZL.getParams(".inp"); - params.shopId = shopId; - params.isSale = isSale; - params.isSpec = isSpec; - params.defaultId = $('input[name="defaultId"]:checked').val(); - params.goodsDesc = editor.txt.html(); - params.setNameId = $('#setNameId option:selected').val() - if (isSpec == 1) { - // params.shopPrice = shopPrice - $('#shopPrice').val(defaultPrice); - - } - params.shopPrice = $('#shopPrice').val() - click = true; - if (goodsId > 0) { - params.goodsId = goodsId; - - } - // alert(editor.txt.html()) - JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { - // ////console.log(data); - if (data.status == 1) { - mui.toast(data.msg); - mui.back(); - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - - }) - - - }) - - //获取类目 - $('.selectarea').on("change", ".area", function() { - var objs = ['largeCat', 'mediumCat', 'smallCat']; - // var areaStr = ['请选择', '请选择', '请选择']; - var level = +$(this).attr('data-level') + 1; //0 - pid = $('#' + objs[level - 1] + ' option:selected').val(); - getGoodsCats(objs[level], pid); - - }) - - //三级类目 - function getGoodsCats(obj, pid, defaultId) { - JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { - pid: pid - }, - function(data) { - // ////console.log(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('undefined' == typeof(defaultId)) { - $.each(data, function() { - // ////console.log(this); - html += '' - }); - } else { - $.each(data, function() { - if (this.catId == defaultId) { - selected = 'selected'; - } else { - selected = ''; - } - html += '' - }); - } - $('#' + obj).html(html); - } - }) - } - - // 上传图片 - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - // ////console.log($('#galleryImg[' + num + ']')); - //if ($('#galleryImg[' + num + ']').length > 0) { - that.html(html); - //} else { - // $(".batchImg").append(html); - //} - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - - $(".oneImg").on("tap", '#goods', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("goodsImg", "test", "goods") - openCamera(function(t, status, fileName, serverName) { - var html = ''; - - $(".goods").html(html); - - }) - }) - // 删除图片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - // ////console.log(this); - var that = $(this) - //var idx = that.parent().attr('data-id'); - //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; - } - }) - //上传图片到七牛; - - var uptoken = ''; - var rs = send_request(); - rs = JSON.parse(rs); - - uptoken = rs.token; - - function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - // ////console.log(dir) - serverUrl = hyhUrl('oss/qiniu.php'); - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - - }; - - - // 初始化七牛上传的方法 - function uploadInit() { - var btnId = editor.imgMenuId; - var containerId = editor.toolbarElemId; - var textElemId = editor.textElemId; - // 创建上传对象 - var uploader = Qiniu.uploader({ - runtimes: 'html5,flash,html4', //上传模式,依次退化 - browse_button: btnId, //上传选择的点选按钮,**必需** - //uptoken_url: rs, - //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) - uptoken: uptoken, - // url: 'http://up-z1.qiniup.com', - - // uptoken : '', - //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 - // unique_names: true, - // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) - // save_key: true, - // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 - // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', - // domain:$('#domain').val(), - domain: rs.url, - - //bucket 域名,下载资源时用到,**必需** - container: containerId, //上传区域DOM ID,默认是browser_button的父元素, - max_file_size: '100mb', //最大文件体积限制 - flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 - filters: { - mime_types: [ - //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) - { - title: "图片文件", - extensions: "jpg,gif,png,bmp" - } - ] - }, - max_retries: 3, //上传失败最大重试次数 - dragdrop: true, //开启可拖曳上传 - drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 - chunk_size: '4mb', //分块上传时,每片的体积 - auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 - init: { - 'FilesAdded': function(up, files) { - plupload.each(files, function(file) { - // 文件添加进队列后,处理相关的事情 - // printLog('on FilesAdded'); - }); - }, - 'BeforeUpload': function(up, file) { - // 每个文件上传前,处理相关的事情 - // printLog('on BeforeUpload'); - }, - 'UploadProgress': function(up, file) { - // 显示进度 - // printLog('进度 ' + file.percent) - }, - 'FileUploaded': function(up, file, info) { - // 每个文件上传成功后,处理相关的事情 - // 其中 info 是文件上传成功后,服务端返回的json,形式如 - // { - // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", - // "key": "gogopher.jpg" - // } - // printLog(info); - // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html - - var domain = up.getOption('domain'); - var res = $.parseJSON(info); - var sourceLink = domain + res.key; //获取上传成功后的文件的Url - // 插入图片到editor - editor.cmd.do('insertHtml', '') - }, - 'Error': function(up, err, errTip) { - //上传出错时,处理相关的事情 - // printLog('on Error'); - }, - 'UploadComplete': function() { - //队列文件处理完毕后,处理相关的事情 - // printLog('on UploadComplete'); - } - // Key 函数如果有需要自行配置,无特殊需要请注释 - //, - // 'Key': function(up, file) { - // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 - // // 该配置必须要在 unique_names: false , save_key: false 时才生效 - // var key = ""; - // // do something with key here - // return key - // } - } - // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 - // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs - }); - } - uploadInit(); - // 封装 ////console.log 函数 - function printLog(title, info) { - window.console && console.log(title, info); - } +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +$(".pricset_con").hide(); +function escape2Html(str) { + var arrEntities = { + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'amp': '&', + 'quot': '"' + }; + return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { + return arrEntities[i]; + }); +}; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + // ////console.log(self); + var shopId = self.id; + var goodsId = self.goodsId; + var richText = ''; + + var E = window.wangEditor + var editor = new E('#goodsDesc') + // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab + // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 + // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 + + // 允许上传到七牛云存储 + editor.customConfig.qiniu = true; + editor.customConfig.debug = true; + // editor.customConfig.onchange = function (html) { + // // 监控变化,同步更新到 textarea + // // $text1.val(html) + // }; + editor.create(); + // 初始化七牛上传 + + + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var bjSpec = data.isSpec; + if (1 == data.isSpec) { + $(".pricset_con").show() + var id = data.setNameId; + + // ////console.log(id); + getRecommend(page, pageSize, id) + + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data1) { + //console.log(data1); + if (1 == data1.status) { + var that = this + var arr = []; + var arr2 = {}; + for (var i = 0; i < data1.data.length; i++) { + arr.push(data1.data[i].list); + arr2[data1.data[i].catId] = data1.data[i].list; + } + + // ////console.log(a); + var cLength = 0; + var catId = 0; + var goodsRes = ""; + if (arr.length > 0) { + var tmpI = 0; + var a = combins(arr); + while (true) { + if (arr.length > 1) { + c = a.next(); + if (!c) break; + cLength = c.length; + res = c.join(' '); + } else { + if (tmpI >= arr[0].length) { + break; + } + c = arr[0]; + res = arr[0][tmpI]; + cLength = arr[0].length; + } + tmpI++; + // ////console.log(c); + // ////console.log(res); + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + } + + $('.pricset_con_con').html(html1); + var setNum = 0; + mui.each(data.spec, function(idx, val) { + if (cLength != val.names.length) return false; + goodsRes = ''; + i = 0; + if (arr.length > 1) { + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + } else { + // //console.log(val); + //console.log(val.names); + goodsRes = val.names[setNum].itemName; + setNum++; + } + var showSpecNames = $('label[name="showSpecNames[]"]'); + var specNameArr = []; + for (var k = 0; k < showSpecNames.length; k++) { + specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); + } + $.each(specNameArr, function(sitem, sval) { + if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 + i = 0; + mui.each(val.names, function(index, value) { + // ////console.log(i); + document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 + i++; + }); + document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 + document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice + document.getElementById('specStock[' + +sitem + ']').value = val.specStock + if (1 == val.isDefault) { + + //checked + var inputList = $('input[name=defaultId]') + + + $.each(inputList, function(index, value) { + // ////console.log(value, index); + this.previousElementSibling + if (sitem == this.value) { + this.checked = true + } + }) + } + + } + }) + + }) + } + } + }) + + + } else if (0 == data.isSpec) { + // $('#setNameId').html('') + getRecommend(page, pageSize) + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + } else if ($('#' + index).hasClass('gallery')) { + var html = ''; + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + // ////console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() //移除最后一个数组元素 _ + mui.each(pathArr, function(idx, ele) { + // ////console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + if ('' != data.goodsDesc) { + var Desc = escape2Html(data.goodsDesc) + // var Desc= HtmlUtils.htmlUnescape(data.goodsDesc) + ////console.log(Desc) + // $('#goodsDesc').val(Desc) + // $('#goodsDesc').html(Desc) + editor.txt.html(Desc) + } + + // params.goodsDesc = editor.txt.html(); + + } else { + mui.alert(data.msg) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + + $(".title").text("添加商品") + } + + + function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) + } + + //获取商品总规格列表 + var page = 1; + var pageSize = 100; + var isjiazai = 1; + + function getRecommend(page, pageSize, defaultVal) { + + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // ////console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // ////console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // ////console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id == defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html += ''; + + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + + } + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg); + // location.reload(); + } + isjiazai = 1; + }) + } + + //获取商品规格 + // 笛卡尔积 + combins = function(args) { + + if (args.length < 2) return args[0] || []; + // if (arguments.length < 2) return arguments[0] || []; + //var args = Array.prototype.slice.call(arguments); + var that = { + index: 0, + nth: function(n) { + var result = [], + d = 0; + for (; d < this.dim; d++) { + var l = this[d].length; + var i = n % l; + result.push(this[d][i]); + n -= i; + n /= l; + } + return result; + }, + next: function() { + if (this.index >= size) return; + var result = this.nth(this.index); + this.index++; + return result; + } + }; + var size = 1; + for (var i = 0; i < args.length; i++) { + size = size * args[i].length; + that[i] = args[i]; + } + that.size = size; + that.dim = args.length; + return that; + } + + + + $('#setNameId').change(function() { + var id = $('#setNameId option:selected').attr('data-id') + // ////console.log(id); + + var html1 = ""; + if (typeof id == "undefined" || 0 == id) { + $(".pricset_con").hide() + } else { + $(".pricset_con").show() + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + // ////console.log(data); + if (1 == data.status) { + html1 = ""; + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + + var j = 0; + var res = ''; + var cLength = 0; + var catId = 0; + var tmpI = 0; + var a = combins(arr); + while (true) { + if (arr.length > 1) { + c = a.next(); + if (!c) break; + cLength = c.length; + res = c.join(' '); + } else { + if (tmpI >= arr[0].length) { + break; + } + c = arr[0]; + res = arr[0][tmpI]; + cLength = arr[0].length; + } + tmpI++; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + + '' + + ''; + + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + } else { + mui.alert(data.msg) + } + }) + } + }) + + // 下一页 + var check = true; + mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + if ($("#setNameId option:selected").val() != 0 && check == true) { + + if ($('input[name="defaultId"]:checked').length == 0) { + mui.alert("请选择默认规格") + check = false; + return false + } + $('.pricset_con_con input').each(function() { + if ((!$(this).val() || "" == $.trim(this.value))) { + + + mui.alert("请输入数据") + $(this).focus(); + check = false; + return false; + } + }) + } + // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + // ////console.log(shopPrice) + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + + } + + + }) + //预览 + $('.prelook').hide(); + // mui("body").on('tap', '.prelook', function() { + // + // + // + // }) + // 上一页 + mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") + }) + // ////console.log($("#goodsDesc").text()); + + //提交 + // 判断是否上架 + var isSale = "", + setNameId, + isSpec; + + // ////console.log(typeof($("#setNameId option:selected").val())); + + + //提交 + var click = false; + mui('.btn').on('tap', '.submit_btn ', function() { + richText = editor.txt.text() + // 判断有没有商品属性 + if ($("#setNameId option:selected").val() != 0) { + isSpec = 1; + } else { + isSpec = 0; + } + if (click == true) { + return + } + + if ($("#isSale").prop("checked")) { + // ////console.log(1); + isSale = "1"; + } else { + // ////console.log(0); + isSale = "0"; + } + var imgs = ''; + var data = $('input[name="gallery[]"]'); + // ////console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + //默认选中 + var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.defaultId = $('input[name="defaultId"]:checked').val(); + params.goodsDesc = editor.txt.html(); + params.setNameId = $('#setNameId option:selected').val() + if (isSpec == 1) { + // params.shopPrice = shopPrice + $('#shopPrice').val(defaultPrice); + + } + params.shopPrice = $('#shopPrice').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + // alert(editor.txt.html()) + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + // ////console.log(data); + if (data.status == 1) { + mui.toast(data.msg); + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + + }) + + + }) + + //获取类目 + $('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + + }) + + //三级类目 + function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // ////console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // ////console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) + } + + // 上传图片 + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + // ////console.log($('#galleryImg[' + num + ']')); + //if ($('#galleryImg[' + num + ']').length > 0) { + that.html(html); + //} else { + // $(".batchImg").append(html); + //} + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + + $(".oneImg").on("tap", '#goods', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) + }) + // 删除图片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // ////console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + //上传图片到七牛; + + var uptoken = ''; + var rs = send_request(); + rs = JSON.parse(rs); + + uptoken = rs.token; + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // ////console.log(dir) + serverUrl = hyhUrl('oss/qiniu.php'); + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + }; + + + // 初始化七牛上传的方法 + function uploadInit() { + var btnId = editor.imgMenuId; + var containerId = editor.toolbarElemId; + var textElemId = editor.textElemId; + // 创建上传对象 + var uploader = Qiniu.uploader({ + runtimes: 'html5,flash,html4', //上传模式,依次退化 + browse_button: btnId, //上传选择的点选按钮,**必需** + //uptoken_url: rs, + //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) + uptoken: uptoken, + // url: 'http://up-z1.qiniup.com', + + // uptoken : '', + //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 + // unique_names: true, + // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) + // save_key: true, + // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 + // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', + // domain:$('#domain').val(), + domain: rs.url, + + //bucket 域名,下载资源时用到,**必需** + container: containerId, //上传区域DOM ID,默认是browser_button的父元素, + max_file_size: '100mb', //最大文件体积限制 + flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 + filters: { + mime_types: [ + //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) + { + title: "图片文件", + extensions: "jpg,gif,png,bmp" + } + ] + }, + max_retries: 3, //上传失败最大重试次数 + dragdrop: true, //开启可拖曳上传 + drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 + chunk_size: '4mb', //分块上传时,每片的体积 + auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 + init: { + 'FilesAdded': function(up, files) { + plupload.each(files, function(file) { + // 文件添加进队列后,处理相关的事情 + // printLog('on FilesAdded'); + }); + }, + 'BeforeUpload': function(up, file) { + // 每个文件上传前,处理相关的事情 + // printLog('on BeforeUpload'); + }, + 'UploadProgress': function(up, file) { + // 显示进度 + // printLog('进度 ' + file.percent) + }, + 'FileUploaded': function(up, file, info) { + // 每个文件上传成功后,处理相关的事情 + // 其中 info 是文件上传成功后,服务端返回的json,形式如 + // { + // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", + // "key": "gogopher.jpg" + // } + // printLog(info); + // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html + + var domain = up.getOption('domain'); + var res = $.parseJSON(info); + var sourceLink = domain + res.key; //获取上传成功后的文件的Url + // 插入图片到editor + editor.cmd.do('insertHtml', '') + }, + 'Error': function(up, err, errTip) { + //上传出错时,处理相关的事情 + // printLog('on Error'); + }, + 'UploadComplete': function() { + //队列文件处理完毕后,处理相关的事情 + // printLog('on UploadComplete'); + } + // Key 函数如果有需要自行配置,无特殊需要请注释 + //, + // 'Key': function(up, file) { + // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 + // // 该配置必须要在 unique_names: false , save_key: false 时才生效 + // var key = ""; + // // do something with key here + // return key + // } + } + // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs + }); + } + uploadInit(); + // 封装 ////console.log 函数 + function printLog(title, info) { + window.console && console.log(title, info); + } }) diff --git a/static/app2/js/addgoods.js b/static/app2/js/addgoods.js old mode 100755 new mode 100644 index 848d7fb..715f8f7 --- a/static/app2/js/addgoods.js +++ b/static/app2/js/addgoods.js @@ -1,855 +1,855 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -$(".pricset_con").hide(); - -function escape2Html(str) { - var arrEntities = { - 'lt': '<', - 'gt': '>', - 'nbsp': ' ', - 'amp': '&', - 'quot': '"' - }; - return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { - return arrEntities[i]; - }); -}; -mui.plusReady(function() { - $("#isSale").prop("checked", true); - var self = plus.webview.currentWebview(); - - var shopId = self.id; - var goodsId = self.goodsId; - var richText = ''; - - var E = window.wangEditor - var editor = new E('#goodsDesc') - // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab - // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 - // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 - - // 允许上传到七牛云存储 - editor.customConfig.qiniu = true; - editor.customConfig.debug = true; - // editor.customConfig.onchange = function (html) { - // // 监控变化,同步更新到 textarea - // // $text1.val(html) - // }; - editor.create(); - // 初始化七牛上传 - - - if (goodsId > 0) { - $(".title").text("编辑商品") - - JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { - shopId: shopId, - goodsId: goodsId - }, function(data) { - //console.log(data); - if (data.status == 1) { - var html1 = ''; - var data = data.data; - var i = 0, - j = 0; - var res = ''; - var bjSpec = data.isSpec; - if (1 == data.isSpec) { - $(".pricset_con").show() - var id = data.setNameId; - - - getRecommend(page, pageSize, id) - - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(data1) { - - if (1 == data1.status) { - var that = this - var arr = []; - var arr2 = {}; - for (var i = 0; i < data1.data.length; i++) { - arr.push(data1.data[i].list); - arr2[data1.data[i].catId] = data1.data[i].list; - } - - - var cLength = 0; - var catId = 0; - var goodsRes = ""; - if (arr.length > 0) { - var calc = calcDescartes(arr); - var cIndex = 0, - cArr = []; - while (true) { - if (cIndex >= calc.length) { - break; - } - //区分单规格和多规格 - if (Array.isArray(calc[cIndex])) { - res = calc[cIndex].join(' '); - cArr = calc[cIndex]; - cLength = calc[cIndex].length; - } else { - res = calc[cIndex]; - cArr[0] = res; - cLength = 1; - } - for (i = 0; i < cArr.length; i++) { - //获取catId - - // console.log(cArr[i]); - $.each(arr2, function(ind, val) { - //console.log(val); - $.each(val, function(index, value) { - if (value == cArr[i]) { - catId = ind; - // console.log(catId); - return; - } - }); - }); - html1 += '' + //属性值id - '' + //分类ID - ''; - } - //console.log(j); - html1 += '' + //规格表ID 新增传0 - '
      '; - j++; - cIndex++; - } - - $('.pricset_con_con').html(html1); - //var setNum = 0; - - mui.each(data.spec, function(idx, val) { - // console.log(val.names); - //if (calc[setNum].length != val.names.length) return false; - //setNum++; - goodsRes = ''; - i = 0; - mui.each(val.names, function(index, value) { - goodsRes += value.itemName + ' '; //hongse 39ma - }) - - var showSpecNames = $('label[name="showSpecNames[]"]'); - var specNameArr = []; - for (var k = 0; k < showSpecNames.length; k++) { - specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); - } - $.each(specNameArr, function(sitem, sval) { - if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 - i = 0; - mui.each(val.names, function(index, value) { - - document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 - i++; - }); - document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 - document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice - document.getElementById('specStock[' + +sitem + ']').value = val.specStock - if (1 == val.isDefault) { - - //checked - var inputList = $('input[name=defaultId]') - - - $.each(inputList, function(index, value) { - - this.previousElementSibling - if (sitem == this.value) { - this.checked = true - } - }) - } - - } - }) - - }) - } - } - }) - - - } else if (0 == data.isSpec) { - // $('#setNameId').html('') - getRecommend(page, pageSize) - } - if (1 == data.isSale) { - $('#isSale').prop("checked", "checked"); - } - mui.each(data, function(index, element) { - if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { - var imgindex = index.substring(0, index.length - 3); - var obj = '#' + imgindex; - if ($(obj).is('img')) { - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index).val(element) - } else if ($('#' + index).hasClass('gallery')) { - var html = ''; - if (element.length > 0) { - var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; - html = '' - for (var i = 0; i < imgurls.length; i++) { - html += '
      ' - // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) - } - var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; - html += '
      '; - $(".batchImg").html(html) - } else { - html = ""; - html = - '
      '; - $(".batchImg").html(html) - } - } - } else if (index == 'goodsCatIdPath') { - // data.goodsCatIdPath 三级目录 - var goodsCatIdPathArr = []; - var pathArr = ["largeCat", "mediumCat", "smallCat"] - //console.log(data.goodsCatIdPath); - goodsCatIdPathArr = data.goodsCatIdPath.split('_') - goodsCatIdPathArr.pop() //移除最后一个数组元素 _ - mui.each(pathArr, function(idx, ele) { - //console.log(idx); - switch (ele) { - case 'largeCat': - getCatIdPathName(goodsCatIdPathArr[0], function(data) { - getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); - }) - break; - case 'mediumCat': - getCatIdPathName(goodsCatIdPathArr[1], function(data) { - $('#mediumCat').html('') - }); - break; - case 'smallCat': - getCatIdPathName(goodsCatIdPathArr[2], function(data) { - $('#smallCat').html('') - }); - break; - } - }) - - } else { - $('#' + index).val(element) - } - }) - if ('' != data.goodsDesc) { - var Desc = escape2Html(data.goodsDesc) - editor.txt.html(Desc) - } - } else { - mui.alert(data.msg) - } - }) - - } else { - getGoodsCats("largeCat", 0) - getRecommend(page, pageSize); - $(".title").text("添加商品") - } - function getCatIdPathName(catId, callback) { - JZL.ajax(qlgUrl("app/goodscats/getCatName"), { - catId: catId - }, function(data) { - callback(data); - }) - } - - //获取商品总规格列表 - var page = 1; - var pageSize = 100; - var isjiazai = 1; - function getRecommend(page, pageSize, defaultVal) { - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 100 - } - recommenddata.shopId = shopId - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { - - - // ////console.log(data); - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if (typeof(defaultVal) == "undefined") { - // ////console.log(1); - $.each(data.Rows, function() { - html += '' - }); - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - } else { - // ////console.log(defaultVal); - $.each(data.Rows, function() { - if (this.id == defaultVal) { - selected = 'selected'; - } else { - selected = ''; - } - html += ''; - - }); - if (page == 1) { - $('#setNameId').html(html); - - } else { - $('#setNameId').append(html); - - } - - } - - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg); - // location.reload(); - } - isjiazai = 1; - }) - } - - //获取商品规格 - //笛卡尔积 - function calcDescartes(array) { - if (array.length < 2) return array[0] || []; - return [].reduce.call(array, function(col, set) { - var res = []; - col.forEach(function(c) { - set.forEach(function(s) { - var t = [].concat(Array.isArray(c) ? c : [c]); - t.push(s); - res.push(t); - }) - }); - return res; - }); - } - // 笛卡尔积 -// combins = function(args) { -// -// if (args.length < 2) return args[0] || []; -// // if (arguments.length < 2) return arguments[0] || []; -// //var args = Array.prototype.slice.call(arguments); -// var that = { -// index: 0, -// nth: function(n) { -// var result = [], -// d = 0; -// for (; d < this.dim; d++) { -// var l = this[d].length; -// var i = n % l; -// result.push(this[d][i]); -// n -= i; -// n /= l; -// } -// return result; -// }, -// next: function() { -// if (this.index >= size) return; -// var result = this.nth(this.index); -// this.index++; -// return result; -// } -// }; -// var size = 1; -// for (var i = 0; i < args.length; i++) { -// size = size * args[i].length; -// that[i] = args[i]; -// } -// that.size = size; -// that.dim = args.length; -// return that; -// } - - - - $('#setNameId').change(function() { - var id = $('#setNameId option:selected').attr('data-id') - // ////console.log(id); - - var html1 = ""; - if (typeof id == "undefined" || 0 == id) { - $(".pricset_con").hide() - } else { - $(".pricset_con").show() - JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { - shopId: shopId, - id: id - }, function(data) { - // ////console.log(data); - if (1 == data.status) { - html1 = ""; - var arr = []; - var arr2 = {}; - for (var i = 0; i < data.data.length; i++) { - arr.push(data.data[i].list); - arr2[data.data[i].catId] = data.data[i].list; - } - var calc = calcDescartes(arr); - var cIndex = 0; - var i = 0, - j = 0, - cArr = []; - while (true) { - if (cIndex >= calc.length) { - break; - } - //区分单规格和多规格 - if (Array.isArray(calc[cIndex])) { - res = calc[cIndex].join(' '); - cArr = calc[cIndex]; - cLength = calc[cIndex].length; - } else { - res = calc[cIndex]; - cArr[0] = res; - cLength = 1; - } - for (i = 0; i < cArr.length; i++) { - //获取catId - - // console.log(cArr[i]); - $.each(arr2, function(ind, val) { - //console.log(val); - $.each(val, function(index, value) { - if (value == cArr[i]) { - catId = ind; - // console.log(catId); - return; - } - }); - }); - html1 += '' + //属性值id - '' + //分类ID - ''; - } - //console.log(j); - html1 += '' + //规格表ID 新增传0 - '
      '; - j++; - cIndex++; - } - - $('.pricset_con_con').html(html1); - } else { - mui.alert(data.msg) - } - }) - } - }) - - // 下一页 - var check = true; - mui("body").on('tap', '.next_btn', function() { - check = true; - $('.isemptyinp').each(function() { - if (!this.value || "" == $.trim(this.value)) { - var label = this.previousElementSibling; - mui.alert(label.innerText + "不允许为空") - check = false; - return false; - } - }) - - if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { - mui.alert("商品没有属性必须输入商品价格") - check = false; - return false; - } - if ($("#setNameId option:selected").val() != 0 && check == true) { - - if ($('input[name="defaultId"]:checked').length == 0) { - mui.alert("请选择默认规格") - check = false; - return false - } - $('.pricset_con_con input').each(function() { - if ((!$(this).val() || "" == $.trim(this.value))) { - - - mui.alert("请输入数据") - $(this).focus(); - check = false; - return false; - } - }) - } - // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); - // ////console.log(shopPrice) - if ($("#isSale").prop("checked")) { - isSale = "1"; - } else { - isSale = "0"; - } - if (check == true) { - $(".addcon").css("display", "none") - $(".pre").css("display", "block"); - backTop(); - } - - - }) - //预览 - $('.prelook').hide(); - // mui("body").on('tap', '.prelook', function() { - // - // - // - // }) - // 上一页 - mui('body').on('tap', '.pre_btn', function() { - $(".addcon").css("display", "block") - $(".pre").css("display", "none") - }) - // ////console.log($("#goodsDesc").text()); - - //提交 - // 判断是否上架 - var isSale = "", - setNameId, - isSpec; - //提交 - var click = false; - mui('.btn').on('tap', '.submit_btn ', function() { - // if (click == true) return; - richText = editor.txt.text() - // 判断有没有商品属性 - if ($("#setNameId option:selected").val() != 0) { - isSpec = 1; - } else { - isSpec = 0; - } - if (click == true) return; - if ($("#isSale").prop("checked")) { - isSale = "1"; - } else { - isSale = "0"; - } - var imgs = ''; - var data = $('input[name="gallery[]"]'); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - - }) - - - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - - - $('#gallery').val(imgs); - //默认选中 - var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); - var params = JZL.getParams(".inp"); - params.shopId = shopId; - params.isSale = isSale; - params.isSpec = isSpec; - params.defaultId = $('input[name="defaultId"]:checked').val(); - params.goodsDesc = editor.txt.html(); - params.setNameId = $('#setNameId option:selected').val() - if (isSpec == 1) { - // params.shopPrice = shopPrice - $('#shopPrice').val(defaultPrice); - - } - params.shopPrice = $('#shopPrice').val() - click = true; - if (goodsId > 0) { - params.goodsId = goodsId; - - } - - JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { - - if (data.status == 1) { - click = false; - mui.toast(data.msg); - mui.back(); - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - - }) - - - }) - - //获取类目 - $('.selectarea').on("change", ".area", function() { - var objs = ['largeCat', 'mediumCat', 'smallCat']; - // var areaStr = ['请选择', '请选择', '请选择']; - var level = +$(this).attr('data-level') + 1; //0 - pid = $('#' + objs[level - 1] + ' option:selected').val(); - getGoodsCats(objs[level], pid); - - }) - - //三级类目 - function getGoodsCats(obj, pid, defaultId) { - JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { - pid: pid - }, - function(data) { - // ////console.log(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('undefined' == typeof(defaultId)) { - $.each(data, function() { - // ////console.log(this); - html += '' - }); - } else { - $.each(data, function() { - if (this.catId == defaultId) { - selected = 'selected'; - } else { - selected = ''; - } - html += '' - }); - } - $('#' + obj).html(html); - } - }) - } - - // 上传图片 - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - - - that.html(html); - - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - - $(".oneImg").on("tap", '#goods', function() { - - - UP.init("goodsImg", "test", "goods") - openCamera(function(t, status, fileName, serverName) { - var html = ''; - - $(".goods").html(html); - - }) - }) - // 删除图片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - - var that = $(this) - - if (confirm('确认删除图片?')) { - that.parent().remove() - - } - }) - //上传图片到七牛; - - var uptoken = ''; - var rs = send_request(); - rs = JSON.parse(rs); - - uptoken = rs.token; - - function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - - serverUrl = hyhUrl('oss/qiniu.php'); - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - - }; - - - // 初始化七牛上传的方法 - function uploadInit() { - var btnId = editor.imgMenuId; - var containerId = editor.toolbarElemId; - var textElemId = editor.textElemId; - // 创建上传对象 - var uploader = Qiniu.uploader({ - runtimes: 'html5,flash,html4', //上传模式,依次退化 - browse_button: btnId, //上传选择的点选按钮,**必需** - //uptoken_url: rs, - //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) - uptoken: uptoken, - // url: 'http://up-z1.qiniup.com', - - // uptoken : '', - //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 - // unique_names: true, - // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) - // save_key: true, - // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 - // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', - // domain:$('#domain').val(), - domain: rs.url, - - //bucket 域名,下载资源时用到,**必需** - container: containerId, //上传区域DOM ID,默认是browser_button的父元素, - max_file_size: '100mb', //最大文件体积限制 - flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 - filters: { - mime_types: [ - //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) - { - title: "图片文件", - extensions: "jpg,gif,png,bmp" - } - ] - }, - max_retries: 3, //上传失败最大重试次数 - dragdrop: true, //开启可拖曳上传 - drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 - chunk_size: '4mb', //分块上传时,每片的体积 - auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 - init: { - 'FilesAdded': function(up, files) { - plupload.each(files, function(file) { - // 文件添加进队列后,处理相关的事情 - // printLog('on FilesAdded'); - }); - }, - 'BeforeUpload': function(up, file) { - // 每个文件上传前,处理相关的事情 - // printLog('on BeforeUpload'); - }, - 'UploadProgress': function(up, file) { - // 显示进度 - // printLog('进度 ' + file.percent) - }, - 'FileUploaded': function(up, file, info) { - // 每个文件上传成功后,处理相关的事情 - // 其中 info 是文件上传成功后,服务端返回的json,形式如 - // { - // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", - // "key": "gogopher.jpg" - // } - // printLog(info); - // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html - - var domain = up.getOption('domain'); - var res = $.parseJSON(info); - var sourceLink = domain + res.key; //获取上传成功后的文件的Url - // 插入图片到editor - editor.cmd.do('insertHtml', '') - }, - 'Error': function(up, err, errTip) { - //上传出错时,处理相关的事情 - // printLog('on Error'); - }, - 'UploadComplete': function() { - //队列文件处理完毕后,处理相关的事情 - // printLog('on UploadComplete'); - } - // Key 函数如果有需要自行配置,无特殊需要请注释 - //, - // 'Key': function(up, file) { - // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 - // // 该配置必须要在 unique_names: false , save_key: false 时才生效 - // var key = ""; - // // do something with key here - // return key - // } - } - // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 - // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs - }); - } - uploadInit(); - // 封装 ////console.log 函数 - function printLog(title, info) { - window.console && console.log(title, info); - } +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +$(".pricset_con").hide(); + +function escape2Html(str) { + var arrEntities = { + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'amp': '&', + 'quot': '"' + }; + return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { + return arrEntities[i]; + }); +}; +mui.plusReady(function() { + $("#isSale").prop("checked", true); + var self = plus.webview.currentWebview(); + + var shopId = self.id; + var goodsId = self.goodsId; + var richText = ''; + + var E = window.wangEditor + var editor = new E('#goodsDesc') + // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab + // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 + // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 + + // 允许上传到七牛云存储 + editor.customConfig.qiniu = true; + editor.customConfig.debug = true; + // editor.customConfig.onchange = function (html) { + // // 监控变化,同步更新到 textarea + // // $text1.val(html) + // }; + editor.create(); + // 初始化七牛上传 + + + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var bjSpec = data.isSpec; + if (1 == data.isSpec) { + $(".pricset_con").show() + var id = data.setNameId; + + + getRecommend(page, pageSize, id) + + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data1) { + + if (1 == data1.status) { + var that = this + var arr = []; + var arr2 = {}; + for (var i = 0; i < data1.data.length; i++) { + arr.push(data1.data[i].list); + arr2[data1.data[i].catId] = data1.data[i].list; + } + + + var cLength = 0; + var catId = 0; + var goodsRes = ""; + if (arr.length > 0) { + var calc = calcDescartes(arr); + var cIndex = 0, + cArr = []; + while (true) { + if (cIndex >= calc.length) { + break; + } + //区分单规格和多规格 + if (Array.isArray(calc[cIndex])) { + res = calc[cIndex].join(' '); + cArr = calc[cIndex]; + cLength = calc[cIndex].length; + } else { + res = calc[cIndex]; + cArr[0] = res; + cLength = 1; + } + for (i = 0; i < cArr.length; i++) { + //获取catId + + // console.log(cArr[i]); + $.each(arr2, function(ind, val) { + //console.log(val); + $.each(val, function(index, value) { + if (value == cArr[i]) { + catId = ind; + // console.log(catId); + return; + } + }); + }); + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + cIndex++; + } + + $('.pricset_con_con').html(html1); + //var setNum = 0; + + mui.each(data.spec, function(idx, val) { + // console.log(val.names); + //if (calc[setNum].length != val.names.length) return false; + //setNum++; + goodsRes = ''; + i = 0; + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + + var showSpecNames = $('label[name="showSpecNames[]"]'); + var specNameArr = []; + for (var k = 0; k < showSpecNames.length; k++) { + specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); + } + $.each(specNameArr, function(sitem, sval) { + if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 + i = 0; + mui.each(val.names, function(index, value) { + + document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 + i++; + }); + document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 + document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice + document.getElementById('specStock[' + +sitem + ']').value = val.specStock + if (1 == val.isDefault) { + + //checked + var inputList = $('input[name=defaultId]') + + + $.each(inputList, function(index, value) { + + this.previousElementSibling + if (sitem == this.value) { + this.checked = true + } + }) + } + + } + }) + + }) + } + } + }) + + + } else if (0 == data.isSpec) { + // $('#setNameId').html('') + getRecommend(page, pageSize) + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + } else if ($('#' + index).hasClass('gallery')) { + var html = ''; + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + //console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() //移除最后一个数组元素 _ + mui.each(pathArr, function(idx, ele) { + //console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + if ('' != data.goodsDesc) { + var Desc = escape2Html(data.goodsDesc) + editor.txt.html(Desc) + } + } else { + mui.alert(data.msg) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + $(".title").text("添加商品") + } + function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) + } + + //获取商品总规格列表 + var page = 1; + var pageSize = 100; + var isjiazai = 1; + function getRecommend(page, pageSize, defaultVal) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // ////console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // ////console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // ////console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id == defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html += ''; + + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + + } + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg); + // location.reload(); + } + isjiazai = 1; + }) + } + + //获取商品规格 + //笛卡尔积 + function calcDescartes(array) { + if (array.length < 2) return array[0] || []; + return [].reduce.call(array, function(col, set) { + var res = []; + col.forEach(function(c) { + set.forEach(function(s) { + var t = [].concat(Array.isArray(c) ? c : [c]); + t.push(s); + res.push(t); + }) + }); + return res; + }); + } + // 笛卡尔积 +// combins = function(args) { +// +// if (args.length < 2) return args[0] || []; +// // if (arguments.length < 2) return arguments[0] || []; +// //var args = Array.prototype.slice.call(arguments); +// var that = { +// index: 0, +// nth: function(n) { +// var result = [], +// d = 0; +// for (; d < this.dim; d++) { +// var l = this[d].length; +// var i = n % l; +// result.push(this[d][i]); +// n -= i; +// n /= l; +// } +// return result; +// }, +// next: function() { +// if (this.index >= size) return; +// var result = this.nth(this.index); +// this.index++; +// return result; +// } +// }; +// var size = 1; +// for (var i = 0; i < args.length; i++) { +// size = size * args[i].length; +// that[i] = args[i]; +// } +// that.size = size; +// that.dim = args.length; +// return that; +// } + + + + $('#setNameId').change(function() { + var id = $('#setNameId option:selected').attr('data-id') + // ////console.log(id); + + var html1 = ""; + if (typeof id == "undefined" || 0 == id) { + $(".pricset_con").hide() + } else { + $(".pricset_con").show() + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + // ////console.log(data); + if (1 == data.status) { + html1 = ""; + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + var calc = calcDescartes(arr); + var cIndex = 0; + var i = 0, + j = 0, + cArr = []; + while (true) { + if (cIndex >= calc.length) { + break; + } + //区分单规格和多规格 + if (Array.isArray(calc[cIndex])) { + res = calc[cIndex].join(' '); + cArr = calc[cIndex]; + cLength = calc[cIndex].length; + } else { + res = calc[cIndex]; + cArr[0] = res; + cLength = 1; + } + for (i = 0; i < cArr.length; i++) { + //获取catId + + // console.log(cArr[i]); + $.each(arr2, function(ind, val) { + //console.log(val); + $.each(val, function(index, value) { + if (value == cArr[i]) { + catId = ind; + // console.log(catId); + return; + } + }); + }); + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + cIndex++; + } + + $('.pricset_con_con').html(html1); + } else { + mui.alert(data.msg) + } + }) + } + }) + + // 下一页 + var check = true; + mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + if ($("#setNameId option:selected").val() != 0 && check == true) { + + if ($('input[name="defaultId"]:checked').length == 0) { + mui.alert("请选择默认规格") + check = false; + return false + } + $('.pricset_con_con input').each(function() { + if ((!$(this).val() || "" == $.trim(this.value))) { + + + mui.alert("请输入数据") + $(this).focus(); + check = false; + return false; + } + }) + } + // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + // ////console.log(shopPrice) + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + } + + + }) + //预览 + $('.prelook').hide(); + // mui("body").on('tap', '.prelook', function() { + // + // + // + // }) + // 上一页 + mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") + }) + // ////console.log($("#goodsDesc").text()); + + //提交 + // 判断是否上架 + var isSale = "", + setNameId, + isSpec; + //提交 + var click = false; + mui('.btn').on('tap', '.submit_btn ', function() { + // if (click == true) return; + richText = editor.txt.text() + // 判断有没有商品属性 + if ($("#setNameId option:selected").val() != 0) { + isSpec = 1; + } else { + isSpec = 0; + } + if (click == true) return; + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + var imgs = ''; + var data = $('input[name="gallery[]"]'); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + //默认选中 + var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.defaultId = $('input[name="defaultId"]:checked').val(); + params.goodsDesc = editor.txt.html(); + params.setNameId = $('#setNameId option:selected').val() + if (isSpec == 1) { + // params.shopPrice = shopPrice + $('#shopPrice').val(defaultPrice); + + } + params.shopPrice = $('#shopPrice').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + + if (data.status == 1) { + click = false; + mui.toast(data.msg); + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + + }) + + + }) + + //获取类目 + $('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + + }) + + //三级类目 + function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // ////console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // ////console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) + } + + // 上传图片 + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + + that.html(html); + + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + + $(".oneImg").on("tap", '#goods', function() { + + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) + }) + // 删除图片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + + var that = $(this) + + if (confirm('确认删除图片?')) { + that.parent().remove() + + } + }) + //上传图片到七牛; + + var uptoken = ''; + var rs = send_request(); + rs = JSON.parse(rs); + + uptoken = rs.token; + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + + serverUrl = hyhUrl('oss/qiniu.php'); + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + }; + + + // 初始化七牛上传的方法 + function uploadInit() { + var btnId = editor.imgMenuId; + var containerId = editor.toolbarElemId; + var textElemId = editor.textElemId; + // 创建上传对象 + var uploader = Qiniu.uploader({ + runtimes: 'html5,flash,html4', //上传模式,依次退化 + browse_button: btnId, //上传选择的点选按钮,**必需** + //uptoken_url: rs, + //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) + uptoken: uptoken, + // url: 'http://up-z1.qiniup.com', + + // uptoken : '', + //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 + // unique_names: true, + // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) + // save_key: true, + // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 + // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', + // domain:$('#domain').val(), + domain: rs.url, + + //bucket 域名,下载资源时用到,**必需** + container: containerId, //上传区域DOM ID,默认是browser_button的父元素, + max_file_size: '100mb', //最大文件体积限制 + flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 + filters: { + mime_types: [ + //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) + { + title: "图片文件", + extensions: "jpg,gif,png,bmp" + } + ] + }, + max_retries: 3, //上传失败最大重试次数 + dragdrop: true, //开启可拖曳上传 + drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 + chunk_size: '4mb', //分块上传时,每片的体积 + auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 + init: { + 'FilesAdded': function(up, files) { + plupload.each(files, function(file) { + // 文件添加进队列后,处理相关的事情 + // printLog('on FilesAdded'); + }); + }, + 'BeforeUpload': function(up, file) { + // 每个文件上传前,处理相关的事情 + // printLog('on BeforeUpload'); + }, + 'UploadProgress': function(up, file) { + // 显示进度 + // printLog('进度 ' + file.percent) + }, + 'FileUploaded': function(up, file, info) { + // 每个文件上传成功后,处理相关的事情 + // 其中 info 是文件上传成功后,服务端返回的json,形式如 + // { + // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", + // "key": "gogopher.jpg" + // } + // printLog(info); + // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html + + var domain = up.getOption('domain'); + var res = $.parseJSON(info); + var sourceLink = domain + res.key; //获取上传成功后的文件的Url + // 插入图片到editor + editor.cmd.do('insertHtml', '') + }, + 'Error': function(up, err, errTip) { + //上传出错时,处理相关的事情 + // printLog('on Error'); + }, + 'UploadComplete': function() { + //队列文件处理完毕后,处理相关的事情 + // printLog('on UploadComplete'); + } + // Key 函数如果有需要自行配置,无特殊需要请注释 + //, + // 'Key': function(up, file) { + // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 + // // 该配置必须要在 unique_names: false , save_key: false 时才生效 + // var key = ""; + // // do something with key here + // return key + // } + } + // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs + }); + } + uploadInit(); + // 封装 ////console.log 函数 + function printLog(title, info) { + window.console && console.log(title, info); + } }) diff --git a/static/app2/js/addhhrrz.js b/static/app2/js/addhhrrz.js old mode 100755 new mode 100644 index 09ef22c..95e78fb --- a/static/app2/js/addhhrrz.js +++ b/static/app2/js/addhhrrz.js @@ -1,174 +1,174 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var hhrrzid = self.id ? self.id : 0; - //console.log(hhrrzid); - if (hhrrzid > 0) { - $('.header .title').html("编辑合伙人认证信息") - $('#home_zhezhao').hide(); - - JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { - id: hhrrzid - }, function(data) { - // //console.log(data); - if (data.status == 1) { - var data = data.data - $('#userName').val(data.familyName); - $('#cardId').val(data.familyIdCard); - $('#familyRelations').val(data.familyRelations); - // var html=''; - $("#familyRelationsImg").val(data.familyRelationsImg) - $("#idCardFrontImg").val(data.idCardFrontImg) - $("#idCardBackImg").val(data.idCardBackImg) - - $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) - $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) - - $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) - }else{ - mui.alert(data.msg) - } - }) - } else { - $('.header .title').html("添加合伙人认证信息") - } - - $('.lxy_home_zz ul').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - }) - var wait = 120; - - function time() { - if (wait == 0) { - $('.HQYZM').removeAttr("disabled"); - $('.HQYZM').val("重新发送"); - wait = 120; - } else { - $('.HQYZM').attr("disabled", true); - $('.HQYZM').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { - var pargams = {} - pargams.userPhone = $('#indiv-tel').val(); - if ('' == pargams.userPhone) { - mui.alert('手机号不能为空!'); - return; - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(pargams.userPhone))) { - mui.alert("手机号码有误,请重填!"); - return; - } - - JZL.ajax(qlgUrl('app/auth/getPartnerPhoneCode'), pargams, function(data) { - data = toJson(data); - //console.log(data) - if (data.status == 1) { - telephoneNo = pargams.userPhone; - time(); - } else { - mui.alert(data.msg); - } - }); - }) - var click = 0; - - mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { - if (1 == click) return - click = 1 - var pargams = {} - pargams.userPhone = $('#indiv-tel').val(); - pargams.mobileCode = $('.YZM').val(); - if ('' == pargams.mobileCode) { - mui.alert('请输入验证码!'); - return; - } - JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), { - mobileCode: pargams.mobileCode - }, function(data) { - //console.log(data); - if (data.status == 1) { - var data = data.data; - $('#home_zhezhao').hide(); - - $('#familyName').val(data.uName); - $('#familyIdCard').val(data.idCard); - }else{ - mui.alert (data.msg) - } - }) - - }) - $(".photos_con").on("tap", '.business', function() { - UP.init("businessImg", "test", "business") - openCamera(); - }) - $(".photos_con").on("tap", '.idCardFront', function() { - UP.init("idCardFrontImg", "test", "idCardFront") - openCamera(); - }) - $(".photos_con").on("tap", '.idCardBack', function() { - UP.init("idCardBackImg", "test", "idCardBack") - openCamera(); - }) - - -var bcclick = 0 - $(".bc_btn").on('tap',function() { - if (bcclick == 1) return; - bcclick = 1; - var pargams = JZL.getParams('.inp'); - pargams.id = hhrrzid - - if (pargams.positionName == '') { - mui.alert('职位名不能为空!'); - return; - } - if (pargams.stake == '') { - mui.alert('持股比例不能为空!'); - return; - } - if (pargams.businessImg == '') { - mui.alert('请上传手持营业执照照!'); - return; - } - if (pargams.idCardFrontImg == '') { - mui.alert('请上传身份证正面照!'); - return; - } - if (pargams.idCardBackImg == '') { - mui.alert('请上传身份证反面照!'); - return; - } - - - JZL.ajax(qlgUrl('app/auth/setAuthPartner'), pargams, function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - var data = toJson(data); - if (data.status == 1) { - mui.back(); - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }) - - - }) -}) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var hhrrzid = self.id ? self.id : 0; + //console.log(hhrrzid); + if (hhrrzid > 0) { + $('.header .title').html("编辑合伙人认证信息") + $('#home_zhezhao').hide(); + + JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { + id: hhrrzid + }, function(data) { + // //console.log(data); + if (data.status == 1) { + var data = data.data + $('#userName').val(data.familyName); + $('#cardId').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); + // var html=''; + $("#familyRelationsImg").val(data.familyRelationsImg) + $("#idCardFrontImg").val(data.idCardFrontImg) + $("#idCardBackImg").val(data.idCardBackImg) + + $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) + $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) + + $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) + }else{ + mui.alert(data.msg) + } + }) + } else { + $('.header .title').html("添加合伙人认证信息") + } + + $('.lxy_home_zz ul').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + if ('' == pargams.userPhone) { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pargams.userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + + JZL.ajax(qlgUrl('app/auth/getPartnerPhoneCode'), pargams, function(data) { + data = toJson(data); + //console.log(data) + if (data.status == 1) { + telephoneNo = pargams.userPhone; + time(); + } else { + mui.alert(data.msg); + } + }); + }) + var click = 0; + + mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { + if (1 == click) return + click = 1 + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + pargams.mobileCode = $('.YZM').val(); + if ('' == pargams.mobileCode) { + mui.alert('请输入验证码!'); + return; + } + JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), { + mobileCode: pargams.mobileCode + }, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data; + $('#home_zhezhao').hide(); + + $('#familyName').val(data.uName); + $('#familyIdCard').val(data.idCard); + }else{ + mui.alert (data.msg) + } + }) + + }) + $(".photos_con").on("tap", '.business', function() { + UP.init("businessImg", "test", "business") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardFront', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardBack', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + + +var bcclick = 0 + $(".bc_btn").on('tap',function() { + if (bcclick == 1) return; + bcclick = 1; + var pargams = JZL.getParams('.inp'); + pargams.id = hhrrzid + + if (pargams.positionName == '') { + mui.alert('职位名不能为空!'); + return; + } + if (pargams.stake == '') { + mui.alert('持股比例不能为空!'); + return; + } + if (pargams.businessImg == '') { + mui.alert('请上传手持营业执照照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + + + JZL.ajax(qlgUrl('app/auth/setAuthPartner'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }) + + + }) +}) diff --git a/static/app2/js/addmemorandum.js b/static/app2/js/addmemorandum.js old mode 100755 new mode 100644 index e0b5d05..6e53ac0 --- a/static/app2/js/addmemorandum.js +++ b/static/app2/js/addmemorandum.js @@ -1,84 +1,84 @@ -mui.plusReady(function () { - - - var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: 'selectfiles', - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementById('ossfile').innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false, 'complains'); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementById('ossfile').innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if (info.status == 200) { - console.log(get_uploaded_object_name (file.name)); - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - }, - - Error: function(up, err) { - if (err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if (err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if (err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } - }); - - uploader.init(); +mui.plusReady(function () { + + + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: 'selectfiles', + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementById('ossfile').innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false, 'complains'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementById('ossfile').innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if (info.status == 200) { + console.log(get_uploaded_object_name (file.name)); + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if (err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if (err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if (err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); }) \ No newline at end of file diff --git a/static/app2/js/addproperties.js b/static/app2/js/addproperties.js old mode 100755 new mode 100644 index 006768b..6923ee9 --- a/static/app2/js/addproperties.js +++ b/static/app2/js/addproperties.js @@ -1,125 +1,125 @@ -mui.plusReady(function() { - mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } - }); - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - var specCatsId = self.specCatsId ? self.specCatsId : 0; - var setName = self.setName ? self.setName : 0; - var index = 0; - //console.log(shopId,specCatsId,setName); - if (specCatsId > 0) { - $(".title").html("编辑产品规格属性") - JZL.ajax(qlgUrl("app/shops/getSpecCats"), { - id: specCatsId, - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status) { - $("#setName").val(setName) - //var specNames = $('input[name="specNames[]"]'); - //var specItems = $('input[name="specItems[]"]');// - var html = ''; - $.each(data.data, function(i, v) { - - html += - '
      ' - }) - - $('.con_con').append(html); - - // $(specNames[i]).val(data.data[i].catName) - // $(specItems[i]).val(data.data[i].itemNames) - // } - } else { - mui.alert(data.msg) - } - - }) - - } else { - $(".title").html("添加产品规格属性") - - var html = ''; - html = '
      ' - index++ - $('.con_con').append(html); - - } - - mui('body').on('tap', '.add1', function() { - var html = ''; - html += '
      ' - $('.con_con').append(html); - index++; - }) - var click = false; - mui('body').on('tap', '.bc_btn', function() { - //if (true == click) return; - click = true; - var length = $('input[name="specNames[]"]').length; - var specName,specItem; - for (var i = 0; i < length; i++) { - specName = document.getElementById('specNames[' + +i + ']'); - specItem = document.getElementById('specItems[' + +i + ']'); - if ('' == specItem.value && '' == specItem.value) { - if (specCatsId == 0) { - specName.classList.remove("inp"); - specItem.classList.remove("inp"); - document.getElementById('specNamesId[' + +i + ']').classList.remove("inp"); - document.getElementById('specItemsId[' + +i + ']').classList.remove("inp"); - } - } else { - if ('' == specName.value) { - mui.alert('请输入属性名'); - specName.focus(); - return; - } - if ('' == specItem.value) { - specItem.focus(); - mui.alert('请输入属性值'); - return; - } - specItem.value = specItem.value.replace(/,/g, ','); - } - } - var params = JZL.getParams(".inp"); -// $.each(params,function(i,v){ -// params[i] = v.replace(/,/g, ','); -// }) - params.shopId = shopId; - if (specCatsId > 0) { - params.id = specCatsId; - } - JZL.ajax(qlgUrl("app/shops/setSpecs"), params, function(data) { - //console.log(data); - if (data.status == 1) { - mui.toast('添加规格成功'); - mui.back(); - } else { - mui.alert(data.msg); - //location.reload(); - } - click = false; - }) - }) +mui.plusReady(function() { + mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } + }); + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + var specCatsId = self.specCatsId ? self.specCatsId : 0; + var setName = self.setName ? self.setName : 0; + var index = 0; + //console.log(shopId,specCatsId,setName); + if (specCatsId > 0) { + $(".title").html("编辑产品规格属性") + JZL.ajax(qlgUrl("app/shops/getSpecCats"), { + id: specCatsId, + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + $("#setName").val(setName) + //var specNames = $('input[name="specNames[]"]'); + //var specItems = $('input[name="specItems[]"]');// + var html = ''; + $.each(data.data, function(i, v) { + + html += + '
      ' + }) + + $('.con_con').append(html); + + // $(specNames[i]).val(data.data[i].catName) + // $(specItems[i]).val(data.data[i].itemNames) + // } + } else { + mui.alert(data.msg) + } + + }) + + } else { + $(".title").html("添加产品规格属性") + + var html = ''; + html = '
      ' + index++ + $('.con_con').append(html); + + } + + mui('body').on('tap', '.add1', function() { + var html = ''; + html += '
      ' + $('.con_con').append(html); + index++; + }) + var click = false; + mui('body').on('tap', '.bc_btn', function() { + //if (true == click) return; + click = true; + var length = $('input[name="specNames[]"]').length; + var specName,specItem; + for (var i = 0; i < length; i++) { + specName = document.getElementById('specNames[' + +i + ']'); + specItem = document.getElementById('specItems[' + +i + ']'); + if ('' == specItem.value && '' == specItem.value) { + if (specCatsId == 0) { + specName.classList.remove("inp"); + specItem.classList.remove("inp"); + document.getElementById('specNamesId[' + +i + ']').classList.remove("inp"); + document.getElementById('specItemsId[' + +i + ']').classList.remove("inp"); + } + } else { + if ('' == specName.value) { + mui.alert('请输入属性名'); + specName.focus(); + return; + } + if ('' == specItem.value) { + specItem.focus(); + mui.alert('请输入属性值'); + return; + } + specItem.value = specItem.value.replace(/,/g, ','); + } + } + var params = JZL.getParams(".inp"); +// $.each(params,function(i,v){ +// params[i] = v.replace(/,/g, ','); +// }) + params.shopId = shopId; + if (specCatsId > 0) { + params.id = specCatsId; + } + JZL.ajax(qlgUrl("app/shops/setSpecs"), params, function(data) { + //console.log(data); + if (data.status == 1) { + mui.toast('添加规格成功'); + mui.back(); + } else { + mui.alert(data.msg); + //location.reload(); + } + click = false; + }) + }) }) diff --git a/static/app2/js/addqrbb.js b/static/app2/js/addqrbb.js old mode 100755 new mode 100644 index 8dfa5eb..d86471e --- a/static/app2/js/addqrbb.js +++ b/static/app2/js/addqrbb.js @@ -1,89 +1,89 @@ -mui.init({ - beforeback: function() {     //获得父页面的webview - var list = plus.webview.currentWebview().opener();     //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { -var self = plus.webview.currentWebview(); - // //console.log(self); - var qrbbid = self.id ? self.id : 0; - //console.log(qrbbid);// - - if (qrbbid >0) { - $('.header .title').html("编辑亲人报备信息") - JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportInfo'), {id: qrbbid}, function(data) { - //console.log(data); - if (data.status == 1) { - var data = data.data - $('#familyName').val(data.familyName); - $('#familyIdCard').val(data.familyIdCard); - $('#familyRelations').val(data.familyRelations); -// var html=''; -// $('#ossfile').html(html); -$('#familyRelationsImg').val(data.familyRelationsImg) -$('#familyRelations1').attr('src',hyhImgUrl(data.familyRelationsImg)) - } else { - mui.alert(data.msg); - } - }) - }else{ - $('.header .title').html("添加亲人报备信息") - - } -var click = false; - - $(".bc_btn").on('tap', function() { - if(click ==true) return; - - click=true; - - var pargams = JZL.getParams('.inp'); - if (pargams.familyName == '') { - mui.alert('姓名不能为空!'); - return; - } - if (pargams.familyIdCard == '') { - mui.alert('身份证号不能为空!'); - return; - } - if (pargams.familyRelations == '') { - mui.alert('与户主关系不能为空!'); - return; - } - if (pargams.familyRelationsImg == '') { - mui.alert('请上传与户主关系照!'); - return; - } - // $('.bc_btn').attr('disabled','disabled'); - if (qrbbid >0) { - //console.log(qrbbid); - pargams.id=qrbbid - } - - JZL.ajax(qlgUrl('app/auth/setAuthFamilyReport'),pargams,function(data){ - - //console.log(data); - var data = toJson(data); - if(data.status == 1) { - mui.back(); - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - }) - - click = false - - }) -//上传图片 - $('.renzhengphoto').on('tap','.familyRelations',function () { - UP.init("familyRelationsImg", "test", "familyRelations1") - openCamera() - }) - - }) - +mui.init({ + beforeback: function() {     //获得父页面的webview + var list = plus.webview.currentWebview().opener();     //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { +var self = plus.webview.currentWebview(); + // //console.log(self); + var qrbbid = self.id ? self.id : 0; + //console.log(qrbbid);// + + if (qrbbid >0) { + $('.header .title').html("编辑亲人报备信息") + JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportInfo'), {id: qrbbid}, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data + $('#familyName').val(data.familyName); + $('#familyIdCard').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); +// var html=''; +// $('#ossfile').html(html); +$('#familyRelationsImg').val(data.familyRelationsImg) +$('#familyRelations1').attr('src',hyhImgUrl(data.familyRelationsImg)) + } else { + mui.alert(data.msg); + } + }) + }else{ + $('.header .title').html("添加亲人报备信息") + + } +var click = false; + + $(".bc_btn").on('tap', function() { + if(click ==true) return; + + click=true; + + var pargams = JZL.getParams('.inp'); + if (pargams.familyName == '') { + mui.alert('姓名不能为空!'); + return; + } + if (pargams.familyIdCard == '') { + mui.alert('身份证号不能为空!'); + return; + } + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + // $('.bc_btn').attr('disabled','disabled'); + if (qrbbid >0) { + //console.log(qrbbid); + pargams.id=qrbbid + } + + JZL.ajax(qlgUrl('app/auth/setAuthFamilyReport'),pargams,function(data){ + + //console.log(data); + var data = toJson(data); + if(data.status == 1) { + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + click = false + + }) +//上传图片 + $('.renzhengphoto').on('tap','.familyRelations',function () { + UP.init("familyRelationsImg", "test", "familyRelations1") + openCamera() + }) + + }) + diff --git a/static/app2/js/addqrrz.js b/static/app2/js/addqrrz.js old mode 100755 new mode 100644 index b0ee107..ece9bc4 --- a/static/app2/js/addqrrz.js +++ b/static/app2/js/addqrrz.js @@ -1,213 +1,213 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var qrrzid = self.id ? self.id : 0; - //console.log(qrrzid); - if (qrrzid > 0) { - $('.header .title').html("编辑亲人认证信息") - $('#home_zhezhao').hide(); - - JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { - id: qrrzid - }, function(data) { - //console.log(data); - if (data.status == 1) { - var data = data.data - $('#userName').val(data.familyName); - $('#cardId').val(data.familyIdCard); - $('#familyRelations').val(data.familyRelations); - // var html=''; - $("#familyRelationsImg").val(data.familyRelationsImg) - $("#idCardFrontImg").val(data.idCardFrontImg) - $("#idCardBackImg").val(data.idCardBackImg) - - $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) - $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) - $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) - } else { - mui.alert(data.msg) - } - }) - - - var click = false; - - $(".bc_btn").on('tap', function() { - if (click == true) return; - var pargams = JZL.getParams('.inp'); - pargams.id = qrrzid - if (pargams.familyRelations == '') { - mui.alert('与户主关系不能为空!'); - return; - } - if (pargams.familyRelationsImg == '') { - mui.alert('请上传与户主关系照!'); - return; - } - if (pargams.idCardFrontImg == '') { - mui.alert('请上传身份证正面照!'); - return; - } - if (pargams.idCardBackImg == '') { - mui.alert('请上传身份证反面照!'); - return; - } - click = true; - JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - var data = toJson(data); - if (data.status == 1) { - mui.back(); - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - }) - - - }) - } else { - $('.header .title').html("添加亲人认证信息") - } - - - - - - - - - - - - $('.lxy_home_zz ul').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - }) - var wait = 120; - - function time() { - if (wait == 0) { - $('.HQYZM').removeAttr("disabled"); - $('.HQYZM').val("重新发送"); - wait = 120; - } else { - $('.HQYZM').attr("disabled", true); - $('.HQYZM').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { - var pargams = {} - pargams.userPhone = $('#indiv-tel').val(); - if ('' == pargams.userPhone) { - mui.alert('手机号不能为空!'); - return; - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(pargams.userPhone))) { - mui.alert("手机号码有误,请重填!"); - return; - } - - JZL.ajax(qlgUrl('app/auth/getFamilyPhoneCode'), pargams, function(data) { - data = toJson(data); - //console.log(data) - if (data.status == 1) { - telephoneNo = pargams.userPhone; - time(); - } else { - mui.alert(data.msg); - } - }); - }) - mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { - var pargams = {} - pargams.userPhone = $('#indiv-tel').val(); - pargams.mobileCode = $('.YZM').val(); - if ('' == pargams.mobileCode) { - mui.alert('请输入验证码!'); - return; - } - JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), pargams, function(data) { - //console.log(data) - if (data.status == 1) { - var data = data.data; - $('#home_zhezhao').hide(); - $('#userName').val(data.uName); - $('#cardId').val(data.idCard); - $('#telephone').val(pargams.userPhone); - } else { - mui.alert(data.msg); - } - }) - - - }) - $(".photos_con").on("tap", '.familyRelations', function() { - UP.init("familyRelationsImg", "test", "familyRelationsimg") - openCamera(); - }) - $(".photos_con").on("tap", '.idCardFront', function() { - UP.init("idCardFrontImg", "test", "idCardFront") - openCamera(); - }) - $(".photos_con").on("tap", '.idCardBack', function() { - UP.init("idCardBackImg", "test", "idCardBack") - openCamera(); - }) - - var click = false; - - $(".bc_btn").on('tap', function() { - if (click == true) return; - var pargams = JZL.getParams('.inp'); - - if (pargams.familyRelations == '') { - mui.alert('与户主关系不能为空!'); - return; - } - if (pargams.familyRelationsImg == '') { - mui.alert('请上传与户主关系照!'); - return; - } - if (pargams.idCardFrontImg == '') { - mui.alert('请上传身份证正面照!'); - return; - } - if (pargams.idCardBackImg == '') { - mui.alert('请上传身份证反面照!'); - return; - } - // $('.bc_btn').attr('disabled','disabled'); - click = true; - JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - var data = toJson(data); - if (data.status == 1) { - mui.back(); - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - }) - - - }) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var qrrzid = self.id ? self.id : 0; + //console.log(qrrzid); + if (qrrzid > 0) { + $('.header .title').html("编辑亲人认证信息") + $('#home_zhezhao').hide(); + + JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { + id: qrrzid + }, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data + $('#userName').val(data.familyName); + $('#cardId').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); + // var html=''; + $("#familyRelationsImg").val(data.familyRelationsImg) + $("#idCardFrontImg").val(data.idCardFrontImg) + $("#idCardBackImg").val(data.idCardBackImg) + + $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) + $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) + $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) + } else { + mui.alert(data.msg) + } + }) + + + var click = false; + + $(".bc_btn").on('tap', function() { + if (click == true) return; + var pargams = JZL.getParams('.inp'); + pargams.id = qrrzid + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + click = true; + JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + + }) + } else { + $('.header .title').html("添加亲人认证信息") + } + + + + + + + + + + + + $('.lxy_home_zz ul').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + if ('' == pargams.userPhone) { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pargams.userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + + JZL.ajax(qlgUrl('app/auth/getFamilyPhoneCode'), pargams, function(data) { + data = toJson(data); + //console.log(data) + if (data.status == 1) { + telephoneNo = pargams.userPhone; + time(); + } else { + mui.alert(data.msg); + } + }); + }) + mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + pargams.mobileCode = $('.YZM').val(); + if ('' == pargams.mobileCode) { + mui.alert('请输入验证码!'); + return; + } + JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), pargams, function(data) { + //console.log(data) + if (data.status == 1) { + var data = data.data; + $('#home_zhezhao').hide(); + $('#userName').val(data.uName); + $('#cardId').val(data.idCard); + $('#telephone').val(pargams.userPhone); + } else { + mui.alert(data.msg); + } + }) + + + }) + $(".photos_con").on("tap", '.familyRelations', function() { + UP.init("familyRelationsImg", "test", "familyRelationsimg") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardFront', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardBack', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + + var click = false; + + $(".bc_btn").on('tap', function() { + if (click == true) return; + var pargams = JZL.getParams('.inp'); + + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + // $('.bc_btn').attr('disabled','disabled'); + click = true; + JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + + }) }) diff --git a/static/app2/js/addshopping.js b/static/app2/js/addshopping.js old mode 100755 new mode 100644 diff --git a/static/app2/js/addyhk.js b/static/app2/js/addyhk.js old mode 100755 new mode 100644 index 77b1f01..2eb3497 --- a/static/app2/js/addyhk.js +++ b/static/app2/js/addyhk.js @@ -1,98 +1,98 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - - $('#_select').on('change', function() { - var selectValue = $('#_select option:selected').text(); //选中select的内容 - // alert("selectValue" + selectValue); - - $("#bankUserName").val(selectValue); - }) - var self = plus.webview.currentWebview(); - ////console.log(self); - var yhkid = self.id ? self.id : 0; - // //console.log(yhkid);// - - if (yhkid > 0) { - $('.header .title').html("编辑银行卡") - JZL.ajax(qlgUrl('app/auth/getCompanyBankInfo'), { - id: yhkid - }, function(data) { - ////console.log(data); - if (data.status == 1) { - var data = data.data - $('#_select').css("background", "none"); - $("#bankUserName").val(data.accountName); - $('.bankname').prepend(''); - $("#cardnum").val(data.bankNo); - } else { - mui.alert(data.msg); - } - }) - }else{ - $('.header .title').html("添加银行卡") - - } - // 选择银行 - JZL.ajax(qlgUrl('app/auth/getBankNameList'), {}, function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - ////console.log(data) - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('.bankname').append(html); - - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - }) - -//提交 -var click = false - $('.bc_btn').on('tap', function() { - if(true == click) return; - click =true; - var pargams = {}; - //编辑页面需要加id - if (yhkid > 0) { - pargams.id = yhkid; - } - pargams.accountName = $("#bankUserName").val(); - pargams.bankName = $(".bankname option:selected").text(); - pargams.bankNo = $("#cardnum").val(); - if ('' == pargams.accountName) { - mui.alert("请输入持卡人姓名") - return; - } - if ('' == pargams.bankNo) { - mui.alert("请输入银行卡号") - return; - } - if ('选择银行' == pargams.bankName) { - mui.alert("请输入银行名称") - return; - } - JZL.ajax(qlgUrl('app/auth/setBank'), pargams, function(data) { - data = toJson(data); - ////console.log(data) - if (data.status == 1) { - mui.back(); - } else { - mui.alert(data.msg); - } - }); - - }) -}) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + + $('#_select').on('change', function() { + var selectValue = $('#_select option:selected').text(); //选中select的内容 + // alert("selectValue" + selectValue); + + $("#bankUserName").val(selectValue); + }) + var self = plus.webview.currentWebview(); + ////console.log(self); + var yhkid = self.id ? self.id : 0; + // //console.log(yhkid);// + + if (yhkid > 0) { + $('.header .title').html("编辑银行卡") + JZL.ajax(qlgUrl('app/auth/getCompanyBankInfo'), { + id: yhkid + }, function(data) { + ////console.log(data); + if (data.status == 1) { + var data = data.data + $('#_select').css("background", "none"); + $("#bankUserName").val(data.accountName); + $('.bankname').prepend(''); + $("#cardnum").val(data.bankNo); + } else { + mui.alert(data.msg); + } + }) + }else{ + $('.header .title').html("添加银行卡") + + } + // 选择银行 + JZL.ajax(qlgUrl('app/auth/getBankNameList'), {}, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data) + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('.bankname').append(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + +//提交 +var click = false + $('.bc_btn').on('tap', function() { + if(true == click) return; + click =true; + var pargams = {}; + //编辑页面需要加id + if (yhkid > 0) { + pargams.id = yhkid; + } + pargams.accountName = $("#bankUserName").val(); + pargams.bankName = $(".bankname option:selected").text(); + pargams.bankNo = $("#cardnum").val(); + if ('' == pargams.accountName) { + mui.alert("请输入持卡人姓名") + return; + } + if ('' == pargams.bankNo) { + mui.alert("请输入银行卡号") + return; + } + if ('选择银行' == pargams.bankName) { + mui.alert("请输入银行名称") + return; + } + JZL.ajax(qlgUrl('app/auth/setBank'), pargams, function(data) { + data = toJson(data); + ////console.log(data) + if (data.status == 1) { + mui.back(); + } else { + mui.alert(data.msg); + } + }); + + }) +}) diff --git a/static/app2/js/applicationopen.js b/static/app2/js/applicationopen.js old mode 100755 new mode 100644 index e6869cb..1e01209 --- a/static/app2/js/applicationopen.js +++ b/static/app2/js/applicationopen.js @@ -1,443 +1,443 @@ -mui.plusReady(function() { - mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } - }); - var shopAddress = ""; - $('.header_con').append('

      保存

      ') - $(".oper .next").css("width", "100%") - $(".oper .pre").css("width", "0px") - // 判断是编辑还是新增 - var self = plus.webview.currentWebview(); - // //console.log(self); - var shopId = self.id ? self.id : 0; - // //console.log(shopid); - if (shopId > 0) { - //console.log(22); - JZL.ajax(qlgUrl('app/shops/getShopJoinInfo'), { - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status) { - var data = data.data; - getMap(data.lng, data.lat); - mui.each(data, function(index, element) { - //console.log(element); - if ($('#' + index).attr("type") == "hidden") { - var imgindex = index.substring(0, index.length - 3); - var obj = '#' + imgindex + '' - // //console.log('#' + imgindex + '') - if (imgindex != "") { - if ($(obj).is('img')) { - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index + '').val(element) - } - } - - } else if ($('#' + index).is("select")) { - - switch (index) { - case 'provinceId': - getAreaName(element, 1, function(data) { - getArea(index, 1, 0, '请选择省', data.data.areaId); - // $('#'+index).html('') - }) - break; - case 'cityId': - getAreaName(element, 2, function(data) { - $('#' + index).html('') - }); - break; - case 'countyId': - getAreaName(element, 3, function(data) { - $('#' + index).html('') - }); - break; - case 'townId': - getAreaName(element, 4, function(data) { - $('#' + index).html('') - }); - break; - case 'villageId': - getAreaName(element, 5, function(data) { - $('#' + index).html('') - }); - break; - case 'bankName': - getBankList(element); - - break; - default: - break; - } - // $('#'+index+' option:selected').text(element) - // $('#'+index+' option:selected').attr('value',element) - // $('#'+index+' option:selected').attr('text',element) - } else { - $('#' + index).val(element) - // //console.log(this); - } - }) - shopAddress = $('#shopAddress').val(); - } else { - mui.alert(data.msg) - } - }) - setTimeout(function() { - $('#shopAddress').val(shopAddress) - }, 1000) - } else { - - getBankList(); - getArea('provinceId', 1, 0, '请选择省'); - getLocation(function(data) { - //console.log(11); - if (1 == data.status) { - $('#lng').val(data.lng); - $('#lat').val(data.lat); - getMap(data.lng, data.lat) - //console.log(JSON.stringify(data)); - } else { - mui.alert(data.errStr); - return; - } - }); - JZL.getItems('editorShopInfo') - } - - function getAreaName(id, level, callback) { - JZL.ajax(qlgUrl("app/Position/getAreaName"), { - id: id, - level: level - }, function(data) { - callback(data); - }) - } - //下一步 - mui('.next').on('tap', '.bc_btn', function() { - var params = JZL.getParams(".inp") - // //console.log(params); - // var html= - var idx = $(this).index() + 1; - var prenum = idx + 1; - // checkStep(idx) - if (checkStep(idx)) { - if (prenum !== 1) { - // //console.log(1); - $(".pre").attr("display", "block") - $(".oper .pre").css("width", "50%") - $(".oper .next").css("width", "50%") - } - if (prenum == 1) { - // //console.log(1); - $(".oper .next").css("width", "100%") - $(".oper .pre").css("width", "0px") - } - $('.con-nav ul li').eq(idx).addClass("active") - $('.next .bc_btn').eq(idx).show().siblings().hide() - $('.pre .pre_btn').eq(idx).show().siblings().hide() - $('.con-content .num').eq(idx).show().siblings().hide() - JZL.saveItems('.localinp', 'auth_personal'); - backTop() - } - }) - //上一步 - mui('.pre').on('tap', '.pre_btn', function() { - var idx = $(this).index() - 1; - var prenum = idx + 1; - if (checkStep(idx)) { - if (prenum !== 1) { - $(".pre").attr("display", "block") - $(".oper .pre").css("width", "50%") - $(".oper .next").css("width", "50%") - } - if (prenum == 1) { - $(".oper .next").css("width", "100%") - $(".oper .pre").css("width", "0px") - } - $('.con-nav ul li').eq(idx + 1).removeClass("active") - $('.next .bc_btn').eq(idx).show().siblings().hide() - $('.pre .pre_btn').eq(idx).show().siblings().hide() - $('.con-content .num').eq(idx).show().siblings().hide() - JZL.getItems('auth_personal'); - backTop() - } - }) - //五级联动 - $('.selectarea').on("change", ".area", function() { - var areas = ['province', 'city', 'county', 'town', 'village']; - var areaStr = ['请选择省', '请选择市', '选择区县', '选择乡镇', '选择村社区']; - var level = $(this).attr('data-level'); //1 - pid = $("#" + areas[level - 1] + "Id option:selected").val(); - var sonLevel = +level + 1; - getArea(areas[level] + 'Id', sonLevel, pid, areaStr[level]); - - }) - - function getArea(area, level, pid, selectAreaStr, defaultId) { - JZL.ajax(qlgUrl('app/Position/listQuery'), { - level: level, - pid: pid - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('undefined' == typeof(defaultId)) { - $.each(data, function() { - html += '' - }); - } else { - $.each(data, function() { - if (this.areaId == defaultId) { - selected = 'selected'; - } else { - selected = ''; - } - html += '' - }); - } - - // //console.log(area) - $('#' + area).html(html); - - } else { - // mui.alert('发生错误请刷新后重试!'); - // // location.reload(); - mui.alert(data.msg) - } - }) - } - - // 上传图片 - - $(".photos_con").on("tap", '.sfzzm', function() { - UP.init("idCardFrontImg", "test", "idCardFront") - openCamera(); - }) - - $(".photos_con").on("tap", '.sfzfm', function() { - UP.init("idCardBackImg", "test", "idCardBack") - openCamera(); - }) - $(".photos_con").on("tap", '.weituoshu', function() { - UP.init("commissionImg", "test", "commission") - openCamera(); - }) - $(".photos_con").on("tap", '.shopsimg', function() { - UP.init("businessLicenceImg", "test", "businessLicence") - openCamera(); - }) - $(".photos_con").on("tap", '.querenshu', function() { - UP.init("confirmationImg", "test", "confirmation") - openCamera(); - }) - - function getBankList(defaultBankName) { - JZL.ajax(qlgUrl('app/auth/getBankNameList'), { - - }, - function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data) - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - // var html=""; - if ('undefined' == typeof(defaultBankName)) { - $.each(data, function() { - // //console.log(data); - html += '' - }); - } else { - // //console.log(data); - $.each(data, function() { - // //console.log(data); - if (this.bankName == defaultBankName) { - selected = 'selected'; - } else { - selected = ''; - } - html += '' - }); - } - - $('.bankname').append(html); - - } else { - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - mui.alert(data.msg) - } - }) - } - - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 112 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.confirmationtext_con').html(data.articleContent) - - // } - - }); - - - function checkStep(step) { - var params = JZL.getParams(".inp") - // //console.log(params); - // //console.log(step); - switch (step) { - case 1: - if ('' == params.shopName) { - mui.alert("请输入店铺名称") - return; - } - if ('' == params.phone) { - mui.alert("请输入手机号码") - //console.log(params); - return; - } - if ('' == params.userName) { - mui.alert("请输入姓名") - return; - - } - - if ('' == params.provinceId) { - mui.alert("请输入所在省") - return; - - } - if ('' == params.cityId) { - mui.alert("请输入所在市") - return; - - } - if ('' == params.countyId) { - mui.alert("请输入所在区") - return; - - } - if ('' == params.townId) { - mui.alert("请输入所在镇") - return; - } - if ('' == params.villageId) { - mui.alert("请输入所在村") - return; - } - if ('' == params.shopAddress) { - mui.alert("请输入详细地址") - return; - } - if ('' == params.lat) { - mui.alert("请在地图上选择位置") - return; - } - break; - case 2: - if ('' == params.accountName) { - mui.alert("请输入持卡人姓名") - return; - - } - if ('' == params.bankName) { - mui.alert("请输入银行名称") - return; - - } - if ('' == params.bankNo) { - mui.alert("请输入银行卡号") - return; - - } - if ('' == params.userName) { - mui.alert("请输入开户行") - return; - - } - break; - case 3: - if ('' == params.idCardFrontImg) { - mui.alert("请上传身份证正面照") - return; - } - if ('' == params.idCardBackImg) { - mui.alert("请上传身份证反面照") - return; - } - if ('' == params.commissionImg) { - mui.alert("请上传直营人委托书照片") - return; - } - if ('' == params.businessLicenceImg) { - mui.alert("请上传营业执照照片") - return; - } - break; - case 4: - - - if ('' == params.commissionImg) { - mui.alert("请上传手持确认书照片") - return; - } - - break; - default: - break; - } - return true; - } - - // 保存 - mui('.header').on('tap','.header_con_bc',function(){ - JZL.saveItems (".inp","editorShopInfo"); - mui.toast('保存成功'); - }) - //提交 - var flag = false; - - - mui('.next').on('tap', '.finish', function() { - if (flag == true) return; - flag = true - var params = JZL.getParams(".inp") - if (shopId > 0) { - params.shopId = shopId - } - - JZL.ajax(qlgUrl('app/shops/shopJoin'), params, function(data) { - - //console.log(data); - if (1 == data.status) { - // JZL.saveItems ("inp","editorShopInfo"); - mui.toast(data.msg) - localStorage.removeItem("editorShopInfo") - mui.back() - // JZL.openWindow("myshops.html", "myshops.html") - // JZL.openWindow("myshop.html", "myshop.html") - - } else { - mui.alert(data.msg) - } - - - }) - - }) - +mui.plusReady(function() { + mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } + }); + var shopAddress = ""; + $('.header_con').append('

      保存

      ') + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + // 判断是编辑还是新增 + var self = plus.webview.currentWebview(); + // //console.log(self); + var shopId = self.id ? self.id : 0; + // //console.log(shopid); + if (shopId > 0) { + //console.log(22); + JZL.ajax(qlgUrl('app/shops/getShopJoinInfo'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + getMap(data.lng, data.lat); + mui.each(data, function(index, element) { + //console.log(element); + if ($('#' + index).attr("type") == "hidden") { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex + '' + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else if ($('#' + index).is("select")) { + + switch (index) { + case 'provinceId': + getAreaName(element, 1, function(data) { + getArea(index, 1, 0, '请选择省', data.data.areaId); + // $('#'+index).html('') + }) + break; + case 'cityId': + getAreaName(element, 2, function(data) { + $('#' + index).html('') + }); + break; + case 'countyId': + getAreaName(element, 3, function(data) { + $('#' + index).html('') + }); + break; + case 'townId': + getAreaName(element, 4, function(data) { + $('#' + index).html('') + }); + break; + case 'villageId': + getAreaName(element, 5, function(data) { + $('#' + index).html('') + }); + break; + case 'bankName': + getBankList(element); + + break; + default: + break; + } + // $('#'+index+' option:selected').text(element) + // $('#'+index+' option:selected').attr('value',element) + // $('#'+index+' option:selected').attr('text',element) + } else { + $('#' + index).val(element) + // //console.log(this); + } + }) + shopAddress = $('#shopAddress').val(); + } else { + mui.alert(data.msg) + } + }) + setTimeout(function() { + $('#shopAddress').val(shopAddress) + }, 1000) + } else { + + getBankList(); + getArea('provinceId', 1, 0, '请选择省'); + getLocation(function(data) { + //console.log(11); + if (1 == data.status) { + $('#lng').val(data.lng); + $('#lat').val(data.lat); + getMap(data.lng, data.lat) + //console.log(JSON.stringify(data)); + } else { + mui.alert(data.errStr); + return; + } + }); + JZL.getItems('editorShopInfo') + } + + function getAreaName(id, level, callback) { + JZL.ajax(qlgUrl("app/Position/getAreaName"), { + id: id, + level: level + }, function(data) { + callback(data); + }) + } + //下一步 + mui('.next').on('tap', '.bc_btn', function() { + var params = JZL.getParams(".inp") + // //console.log(params); + // var html= + var idx = $(this).index() + 1; + var prenum = idx + 1; + // checkStep(idx) + if (checkStep(idx)) { + if (prenum !== 1) { + // //console.log(1); + $(".pre").attr("display", "block") + $(".oper .pre").css("width", "50%") + $(".oper .next").css("width", "50%") + } + if (prenum == 1) { + // //console.log(1); + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + } + $('.con-nav ul li').eq(idx).addClass("active") + $('.next .bc_btn').eq(idx).show().siblings().hide() + $('.pre .pre_btn').eq(idx).show().siblings().hide() + $('.con-content .num').eq(idx).show().siblings().hide() + JZL.saveItems('.localinp', 'auth_personal'); + backTop() + } + }) + //上一步 + mui('.pre').on('tap', '.pre_btn', function() { + var idx = $(this).index() - 1; + var prenum = idx + 1; + if (checkStep(idx)) { + if (prenum !== 1) { + $(".pre").attr("display", "block") + $(".oper .pre").css("width", "50%") + $(".oper .next").css("width", "50%") + } + if (prenum == 1) { + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + } + $('.con-nav ul li').eq(idx + 1).removeClass("active") + $('.next .bc_btn').eq(idx).show().siblings().hide() + $('.pre .pre_btn').eq(idx).show().siblings().hide() + $('.con-content .num').eq(idx).show().siblings().hide() + JZL.getItems('auth_personal'); + backTop() + } + }) + //五级联动 + $('.selectarea').on("change", ".area", function() { + var areas = ['province', 'city', 'county', 'town', 'village']; + var areaStr = ['请选择省', '请选择市', '选择区县', '选择乡镇', '选择村社区']; + var level = $(this).attr('data-level'); //1 + pid = $("#" + areas[level - 1] + "Id option:selected").val(); + var sonLevel = +level + 1; + getArea(areas[level] + 'Id', sonLevel, pid, areaStr[level]); + + }) + + function getArea(area, level, pid, selectAreaStr, defaultId) { + JZL.ajax(qlgUrl('app/Position/listQuery'), { + level: level, + pid: pid + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + html += '' + }); + } else { + $.each(data, function() { + if (this.areaId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + + // //console.log(area) + $('#' + area).html(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + mui.alert(data.msg) + } + }) + } + + // 上传图片 + + $(".photos_con").on("tap", '.sfzzm', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + + $(".photos_con").on("tap", '.sfzfm', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + $(".photos_con").on("tap", '.weituoshu', function() { + UP.init("commissionImg", "test", "commission") + openCamera(); + }) + $(".photos_con").on("tap", '.shopsimg', function() { + UP.init("businessLicenceImg", "test", "businessLicence") + openCamera(); + }) + $(".photos_con").on("tap", '.querenshu', function() { + UP.init("confirmationImg", "test", "confirmation") + openCamera(); + }) + + function getBankList(defaultBankName) { + JZL.ajax(qlgUrl('app/auth/getBankNameList'), { + + }, + function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data) + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + // var html=""; + if ('undefined' == typeof(defaultBankName)) { + $.each(data, function() { + // //console.log(data); + html += '' + }); + } else { + // //console.log(data); + $.each(data, function() { + // //console.log(data); + if (this.bankName == defaultBankName) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + + $('.bankname').append(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 112 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.confirmationtext_con').html(data.articleContent) + + // } + + }); + + + function checkStep(step) { + var params = JZL.getParams(".inp") + // //console.log(params); + // //console.log(step); + switch (step) { + case 1: + if ('' == params.shopName) { + mui.alert("请输入店铺名称") + return; + } + if ('' == params.phone) { + mui.alert("请输入手机号码") + //console.log(params); + return; + } + if ('' == params.userName) { + mui.alert("请输入姓名") + return; + + } + + if ('' == params.provinceId) { + mui.alert("请输入所在省") + return; + + } + if ('' == params.cityId) { + mui.alert("请输入所在市") + return; + + } + if ('' == params.countyId) { + mui.alert("请输入所在区") + return; + + } + if ('' == params.townId) { + mui.alert("请输入所在镇") + return; + } + if ('' == params.villageId) { + mui.alert("请输入所在村") + return; + } + if ('' == params.shopAddress) { + mui.alert("请输入详细地址") + return; + } + if ('' == params.lat) { + mui.alert("请在地图上选择位置") + return; + } + break; + case 2: + if ('' == params.accountName) { + mui.alert("请输入持卡人姓名") + return; + + } + if ('' == params.bankName) { + mui.alert("请输入银行名称") + return; + + } + if ('' == params.bankNo) { + mui.alert("请输入银行卡号") + return; + + } + if ('' == params.userName) { + mui.alert("请输入开户行") + return; + + } + break; + case 3: + if ('' == params.idCardFrontImg) { + mui.alert("请上传身份证正面照") + return; + } + if ('' == params.idCardBackImg) { + mui.alert("请上传身份证反面照") + return; + } + if ('' == params.commissionImg) { + mui.alert("请上传直营人委托书照片") + return; + } + if ('' == params.businessLicenceImg) { + mui.alert("请上传营业执照照片") + return; + } + break; + case 4: + + + if ('' == params.commissionImg) { + mui.alert("请上传手持确认书照片") + return; + } + + break; + default: + break; + } + return true; + } + + // 保存 + mui('.header').on('tap','.header_con_bc',function(){ + JZL.saveItems (".inp","editorShopInfo"); + mui.toast('保存成功'); + }) + //提交 + var flag = false; + + + mui('.next').on('tap', '.finish', function() { + if (flag == true) return; + flag = true + var params = JZL.getParams(".inp") + if (shopId > 0) { + params.shopId = shopId + } + + JZL.ajax(qlgUrl('app/shops/shopJoin'), params, function(data) { + + //console.log(data); + if (1 == data.status) { + // JZL.saveItems ("inp","editorShopInfo"); + mui.toast(data.msg) + localStorage.removeItem("editorShopInfo") + mui.back() + // JZL.openWindow("myshops.html", "myshops.html") + // JZL.openWindow("myshop.html", "myshop.html") + + } else { + mui.alert(data.msg) + } + + + }) + + }) + }) diff --git a/static/app2/js/appraise.js b/static/app2/js/appraise.js old mode 100755 new mode 100644 index 84b0e17..37d3996 --- a/static/app2/js/appraise.js +++ b/static/app2/js/appraise.js @@ -1,319 +1,319 @@ -var isjiazai = 1; -var type = ''; -var page = 1 - -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var data_id = self.goodsId; - // //console.log(data_id) - - function getData(page, pagesize, type) { - var set_data = { - goodsId: data_id, - type: type ? type : '', - page: page ? page : 1, - pagesize: pagesize ? pagesize : 10 - } - if (isjiazai == 1) { - isjiazai = 0 - - } else { - return; - } - mui.ajax(qlgUrl('app/goodsappraises/getById'), { - - data: set_data, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - var html = ''; - - if (data.status == 1) { - data = data.data; - $('#sum').html('全部(' + data.sum + ')'); - $('#pic').html('有图(' + data.picNum + ')'); - $('#bad').html('差评(' + data.badNum + ')'); - $('#good').html('中评(' + data.goodNum + ')'); - $('#best').html('好评(' + data.bestNum + ')'); - if (data.Rows == '') { - if (page == 1) { - $('.pj_list').html('

      没有更多评价

      '); - } else { - $('.pj_list').append( - '

      没有更多评价

      '); - } - - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - - var userImg = ''; - if (this.userPhoto) { - userImg = hyhImgUrl(this.userPhoto); - } else { - userImg = '../img/mujiimg.png' - } - - html += '

      ' + this.loginName + - '

      ' + this.content + '
      '; - - if (this.shopReply != null) { - html += '
      商家回复:' + this.shopReply + - '
      '; - } - html += '
      ' + this.goodsSpecNames + '
      ' + this.createTime + - '
      '; - if (this.images != '' && this.images != null) { - html += '
      '; - } - - html += '
      '; - - }); - if (page == 1) { - $('.pj_list').html(html); - } else { - $('.pj_list').append(html); - } - - isjiazai = 1; - - setTimeout(function() { - $('.img-dv a').each(function() { - var that = $(this); - var img_ = new Image() - img_.src = that.attr('href'); - img_.onload = function() { - that.attr('data-size', img_.width + 'x' + img_.height); - } - }); - document.addEventListener('DOMAttrModified', function() { - $('.img-dv a').each(function() { - var that = $(this); - var img_ = new Image() - img_.src = that.attr('href'); - img_.onload = function() { - that.attr('data-size', img_.width + 'x' + img_.height); - } - }); - }, false); - - var initPhotoSwipeFromDOM = function(gallerySelector) { - // 解析来自DOM元素幻灯片数据(URL,标题,大小...) - var parseThumbnailElements = function(el) { - var thumbElements = el.childNodes, - numNodes = thumbElements.length, - items = [], - figureEl, - linkEl, - size, - item, - divEl; - for (var i = 0; i < numNodes; i++) { - figureEl = thumbElements[i]; //
      element - // 仅包括元素节点 - if (figureEl.nodeType !== 1) { - continue; - } - divEl = figureEl.children[0]; - linkEl = divEl.children[0]; // element - size = linkEl.getAttribute('data-size').split('x'); - // 创建幻灯片对象 - item = { - src: linkEl.getAttribute('href'), - w: parseInt(size[0], 10), - h: parseInt(size[1], 10) - // w: '100%' - }; - if (figureEl.children.length > 1) { - item.title = figureEl.children[1].innerHTML; - } - if (linkEl.children.length > 0) { - // 缩略图节点, 检索缩略图网址 - item.msrc = linkEl.children[0].getAttribute('src'); - } - item.el = figureEl; // 保存链接元素 for getThumbBoundsFn - items.push(item); - } - return items; - }; - - // 查找最近的父节点 - var closest = function closest(el, fn) { - return el && (fn(el) ? el : closest(el.parentNode, fn)); - }; - - // 当用户点击缩略图触发 - var onThumbnailsClick = function(e) { - e = e || window.event; - e.preventDefault ? e.preventDefault() : e.returnValue = false; - var eTarget = e.target || e.srcElement; - var clickedListItem = closest(eTarget, function(el) { - return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); - }); - if (!clickedListItem) { - return; - } - var clickedGallery = clickedListItem.parentNode, - childNodes = clickedListItem.parentNode.childNodes, - numChildNodes = childNodes.length, - nodeIndex = 0, - index; - for (var i = 0; i < numChildNodes; i++) { - if (childNodes[i].nodeType !== 1) { - continue; - } - if (childNodes[i] === clickedListItem) { - index = nodeIndex; - break; - } - nodeIndex++; - } - if (index >= 0) { - openPhotoSwipe(index, clickedGallery); - } - return false; - }; - - var photoswipeParseHash = function() { - var hash = window.location.hash.substring(1), - params = {}; - if (hash.length < 5) { - return params; - } - var vars = hash.split('&'); - for (var i = 0; i < vars.length; i++) { - if (!vars[i]) { - continue; - } - var pair = vars[i].split('='); - if (pair.length < 2) { - continue; - } - params[pair[0]] = pair[1]; - } - if (params.gid) { - params.gid = parseInt(params.gid, 10); - } - return params; - }; - - var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) { - var pswpElement = document.querySelectorAll('.pswp')[0], - gallery, - options, - items; - items = parseThumbnailElements(galleryElement); - // 这里可以定义参数 - options = { - barsSize: { - top: 100, - bottom: 100 - }, - fullscreenEl: false, - shareButtons: [{ - id: 'wechat', - label: '分享微信', - url: '#' - }, - { - id: 'weibo', - label: '新浪微博', - url: '#' - }, - { - id: 'download', - label: '保存图片', - url: '{{raw_image_url}}', - download: true - } - ], - galleryUID: galleryElement.getAttribute('data-pswp-uid'), - getThumbBoundsFn: function(index) { - var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail - pageYScroll = window.pageYOffset || document.documentElement.scrollTop, - rect = thumbnail.getBoundingClientRect(); - return { - x: rect.left, - y: rect.top + pageYScroll, - w: rect.width - }; - } - }; - if (fromURL) { - if (options.galleryPIDs) { - for (var j = 0; j < items.length; j++) { - if (items[j].pid == index) { - options.index = j; - break; - } - } - } else { - options.index = parseInt(index, 10) - 1; - } - } else { - options.index = parseInt(index, 10); - } - if (isNaN(options.index)) { - return; - } - if (disableAnimation) { - options.showAnimationDuration = 0; - } - gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); - gallery.init(); - }; - - var galleryElements = document.querySelectorAll(gallerySelector); - for (var i = 0, l = galleryElements.length; i < l; i++) { - galleryElements[i].setAttribute('data-pswp-uid', i + 1); - galleryElements[i].onclick = onThumbnailsClick; - } - var hashData = photoswipeParseHash(); - if (hashData.pid && hashData.gid) { - openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); - } - }; - - initPhotoSwipeFromDOM('.my-gallery'); - }, 500) - } else { - //console.log(data.status) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - - }) - } - getData(1, 10) - $('.nav').on('tap', '.nav_', function() { - $(this).addClass('on').siblings().removeClass('on'); - type = $(this).attr('id'); - page = 1; - isjiazai = 1; - getData(page, 10, type) - }) - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getData(page, 10, type) - } - - } - }) - +var isjiazai = 1; +var type = ''; +var page = 1 + +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var data_id = self.goodsId; + // //console.log(data_id) + + function getData(page, pagesize, type) { + var set_data = { + goodsId: data_id, + type: type ? type : '', + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 1) { + isjiazai = 0 + + } else { + return; + } + mui.ajax(qlgUrl('app/goodsappraises/getById'), { + + data: set_data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + var html = ''; + + if (data.status == 1) { + data = data.data; + $('#sum').html('全部(' + data.sum + ')'); + $('#pic').html('有图(' + data.picNum + ')'); + $('#bad').html('差评(' + data.badNum + ')'); + $('#good').html('中评(' + data.goodNum + ')'); + $('#best').html('好评(' + data.bestNum + ')'); + if (data.Rows == '') { + if (page == 1) { + $('.pj_list').html('

      没有更多评价

      '); + } else { + $('.pj_list').append( + '

      没有更多评价

      '); + } + + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + var userImg = ''; + if (this.userPhoto) { + userImg = hyhImgUrl(this.userPhoto); + } else { + userImg = '../img/mujiimg.png' + } + + html += '
      '; + + }); + if (page == 1) { + $('.pj_list').html(html); + } else { + $('.pj_list').append(html); + } + + isjiazai = 1; + + setTimeout(function() { + $('.img-dv a').each(function() { + var that = $(this); + var img_ = new Image() + img_.src = that.attr('href'); + img_.onload = function() { + that.attr('data-size', img_.width + 'x' + img_.height); + } + }); + document.addEventListener('DOMAttrModified', function() { + $('.img-dv a').each(function() { + var that = $(this); + var img_ = new Image() + img_.src = that.attr('href'); + img_.onload = function() { + that.attr('data-size', img_.width + 'x' + img_.height); + } + }); + }, false); + + var initPhotoSwipeFromDOM = function(gallerySelector) { + // 解析来自DOM元素幻灯片数据(URL,标题,大小...) + var parseThumbnailElements = function(el) { + var thumbElements = el.childNodes, + numNodes = thumbElements.length, + items = [], + figureEl, + linkEl, + size, + item, + divEl; + for (var i = 0; i < numNodes; i++) { + figureEl = thumbElements[i]; //
      element + // 仅包括元素节点 + if (figureEl.nodeType !== 1) { + continue; + } + divEl = figureEl.children[0]; + linkEl = divEl.children[0]; // element + size = linkEl.getAttribute('data-size').split('x'); + // 创建幻灯片对象 + item = { + src: linkEl.getAttribute('href'), + w: parseInt(size[0], 10), + h: parseInt(size[1], 10) + // w: '100%' + }; + if (figureEl.children.length > 1) { + item.title = figureEl.children[1].innerHTML; + } + if (linkEl.children.length > 0) { + // 缩略图节点, 检索缩略图网址 + item.msrc = linkEl.children[0].getAttribute('src'); + } + item.el = figureEl; // 保存链接元素 for getThumbBoundsFn + items.push(item); + } + return items; + }; + + // 查找最近的父节点 + var closest = function closest(el, fn) { + return el && (fn(el) ? el : closest(el.parentNode, fn)); + }; + + // 当用户点击缩略图触发 + var onThumbnailsClick = function(e) { + e = e || window.event; + e.preventDefault ? e.preventDefault() : e.returnValue = false; + var eTarget = e.target || e.srcElement; + var clickedListItem = closest(eTarget, function(el) { + return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); + }); + if (!clickedListItem) { + return; + } + var clickedGallery = clickedListItem.parentNode, + childNodes = clickedListItem.parentNode.childNodes, + numChildNodes = childNodes.length, + nodeIndex = 0, + index; + for (var i = 0; i < numChildNodes; i++) { + if (childNodes[i].nodeType !== 1) { + continue; + } + if (childNodes[i] === clickedListItem) { + index = nodeIndex; + break; + } + nodeIndex++; + } + if (index >= 0) { + openPhotoSwipe(index, clickedGallery); + } + return false; + }; + + var photoswipeParseHash = function() { + var hash = window.location.hash.substring(1), + params = {}; + if (hash.length < 5) { + return params; + } + var vars = hash.split('&'); + for (var i = 0; i < vars.length; i++) { + if (!vars[i]) { + continue; + } + var pair = vars[i].split('='); + if (pair.length < 2) { + continue; + } + params[pair[0]] = pair[1]; + } + if (params.gid) { + params.gid = parseInt(params.gid, 10); + } + return params; + }; + + var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) { + var pswpElement = document.querySelectorAll('.pswp')[0], + gallery, + options, + items; + items = parseThumbnailElements(galleryElement); + // 这里可以定义参数 + options = { + barsSize: { + top: 100, + bottom: 100 + }, + fullscreenEl: false, + shareButtons: [{ + id: 'wechat', + label: '分享微信', + url: '#' + }, + { + id: 'weibo', + label: '新浪微博', + url: '#' + }, + { + id: 'download', + label: '保存图片', + url: '{{raw_image_url}}', + download: true + } + ], + galleryUID: galleryElement.getAttribute('data-pswp-uid'), + getThumbBoundsFn: function(index) { + var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail + pageYScroll = window.pageYOffset || document.documentElement.scrollTop, + rect = thumbnail.getBoundingClientRect(); + return { + x: rect.left, + y: rect.top + pageYScroll, + w: rect.width + }; + } + }; + if (fromURL) { + if (options.galleryPIDs) { + for (var j = 0; j < items.length; j++) { + if (items[j].pid == index) { + options.index = j; + break; + } + } + } else { + options.index = parseInt(index, 10) - 1; + } + } else { + options.index = parseInt(index, 10); + } + if (isNaN(options.index)) { + return; + } + if (disableAnimation) { + options.showAnimationDuration = 0; + } + gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); + gallery.init(); + }; + + var galleryElements = document.querySelectorAll(gallerySelector); + for (var i = 0, l = galleryElements.length; i < l; i++) { + galleryElements[i].setAttribute('data-pswp-uid', i + 1); + galleryElements[i].onclick = onThumbnailsClick; + } + var hashData = photoswipeParseHash(); + if (hashData.pid && hashData.gid) { + openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); + } + }; + + initPhotoSwipeFromDOM('.my-gallery'); + }, 500) + } else { + //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + + }) + } + getData(1, 10) + $('.nav').on('tap', '.nav_', function() { + $(this).addClass('on').siblings().removeClass('on'); + type = $(this).attr('id'); + page = 1; + isjiazai = 1; + getData(page, 10, type) + }) + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getData(page, 10, type) + } + + } + }) + }) diff --git a/static/app2/js/bill.js b/static/app2/js/bill.js old mode 100755 new mode 100644 index 8d73c86..231248c --- a/static/app2/js/bill.js +++ b/static/app2/js/bill.js @@ -1,72 +1,72 @@ -var vouchersType = '', - isExpected = ''; -var data_href = ''; -var pageSize = 20; -var count = 1; -var isLoading = false; -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - //console.log(self) - vouchersType = self.data_type; - isExpected = self.data_expected; - data_href = data_href; - getBillList(count, pageSize) - - function getBillList(count, pageSize) { - if (true == isLoading) return; - isLoading = true; - JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), { - page: count, - perPage: pageSize, - vouchersType: vouchersType, - isExpected: isExpected, - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - //console.log(data); - var data = toJson(data); - if (data.status == 1) { - data = data.data; - if (data.Rows == '') { - $('.con').append( - '

      没有更多数据

      '); - return; - } - var html = '' - $.each(data.Rows, function() { - html += - '

      ' + - this.remark + '

      ' + this.createTime + '

      -' + this.num + - '
      '; - - }) - if (count == 1) { - $('.con').html(html); - } else { - $('.con').append(html); - } - - } else { - mui.alert(data.msg) - } - isLoading = false; - }); - } - - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (e.cancelable) { - // 判断默认行为是否已经被禁用 - if (!e.defaultPrevented) { - e.preventDefault(); - } - } - if (scroll.y == scroll.maxScrollY) { - if (isLoading == false) { - count++; - getBillList(count, pageSize) - } - } - }) +var vouchersType = '', + isExpected = ''; +var data_href = ''; +var pageSize = 20; +var count = 1; +var isLoading = false; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self) + vouchersType = self.data_type; + isExpected = self.data_expected; + data_href = data_href; + getBillList(count, pageSize) + + function getBillList(count, pageSize) { + if (true == isLoading) return; + isLoading = true; + JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), { + page: count, + perPage: pageSize, + vouchersType: vouchersType, + isExpected: isExpected, + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows == '') { + $('.con').append( + '

      没有更多数据

      '); + return; + } + var html = '' + $.each(data.Rows, function() { + html += + '

      ' + + this.remark + '

      ' + this.createTime + '

      -' + this.num + + '
      '; + + }) + if (count == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + + } else { + mui.alert(data.msg) + } + isLoading = false; + }); + } + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + count++; + getBillList(count, pageSize) + } + } + }) }) diff --git a/static/app2/js/cancellation.js b/static/app2/js/cancellation.js new file mode 100644 index 0000000..99215b4 --- /dev/null +++ b/static/app2/js/cancellation.js @@ -0,0 +1,86 @@ +mui.plusReady(function(){ + var wait = 120; + + function time() { + + if(wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time(); + }, + 1000) + } + + } + $(".photos").on("tap", 'img', function() { + var _input = $(this).parent().parent().parent().prev()[0]; + UP.init(_input.id, "test", this.id) + openCamera() + }) + var token = localStorage.getItem('token'); + mui.ajax(qlgUrl('app/users/editPhone'), { + headers: { + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.userPhone) { + $('#userPhone').val(data.userPhone); + } + } + }, + }) + mui('.row').on('tap', '#mobileCode', function() { + var that = $(this); + + that.attr("disabled", true); + alert('功能开发中'); + // mui.ajax(hyhUrl('app/users/backpayCode'), {  + // + // data: {}, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒 + // success: function(data) { + // var data = toJson(data); + // //服务器返回响应,根据响应结果,分析是否登录成功; + // if(data.status == 1) { + // time(); + // } else { + // alert(data.msg) + // } + // that.removeAttr('disabled'); + // }, + // + // error: function(xhr, type, errorThrown) { + // //异常处理; + // // alert(type) + // // alert(type);       + // } + // });  + }) + mui('.down').on('tap', '#true', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if(phoneCode == '') { + alert('验证码不能为空!'); + return; + } else if(phoneCode.length < 4) { + alert('验证码格式不正确!'); + return; + } + alert('功能开发中'); + }) +}) \ No newline at end of file diff --git a/static/app2/js/cash-out.js b/static/app2/js/cash-out.js old mode 100755 new mode 100644 index 19f6d76..edef770 --- a/static/app2/js/cash-out.js +++ b/static/app2/js/cash-out.js @@ -1,110 +1,110 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); - -mui.plusReady(function() { - //获取数值 - $('.bg').css("display", 'none') - var self = plus.webview.currentWebview() - var shopId = self.id; - var totlemoney = ""; - JZL.ajax(qlgUrl('app/users/getMoney'), { - type: 3 - }, function(data) { - if (1 == data.status) { - var data = data.data; - totlemoney = data.wangNum; - // $('.idc-total span').html('¥'+data.wangNum) - $('#money').val(totlemoney) - } else { - mui.alert(data.msg) - } - $('.btns').on('tap', '.sqtx', function() { - if ($('#money').val() > totlemoney) { - mui.alert("超过最大提现金额") - return; - } else if ('' == $('#money').val()) { - mui.alert("请输入提现金额") - return; - } else if (1 > $('#money').val()) { - mui.alert("提现金额不能小于1") - return; - } - $('.bg').css('display', 'block'); - $('.footer').hide(); - JZL.ajax(qlgUrl('app/shops/getBank'), { - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status) { - var data = data.data - $('#bankUserName').val(data.accountName) - // $('.bankname').prepend('') - $('.bankname').val(data.bankName) - $('#cardnum').val(data.bankNo) - $('#money').on('focus', function() { - $('.bg').css('display', 'none'); - $('.footer').show(); - }) - - } else { - mui.alert(data.msg) - } - }) - }) - $('.bg').on('tap', '.qrtx', function() { - // mui.prompt("请输入操作密码:") - mui.prompt('请输入操作密码', '', '全亮共商城', ['取消', '忘记密码', '确定'], function(e) { - //console.log(e); - if (2 == e.index) { - var payPwd = e.value; - if ('' == payPwd) { - mui.alert('密码不能为空') - return; - } - var money = $('#money').val(); - JZL.ajax(qlgUrl('app/shops/withdrawal'), { - payPwd: payPwd, - money: money, - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status) { - mui.toast(data.msg) - mui.back() - } else { - mui.alert(data.msg) - } - }) - } else if (1 == e.index) { - JZL.openWindow('setting_fogetPwd.html', 'setting_fogetPwd.html') - } - - }, 'div') - document.querySelector('.mui-popup-input input').type = 'password' - - // var mark=mui.prompt("请输入操作密码:") - // //console.log(document.querySelector('.mui-popup-input input').value) - // if(null!=mark){ - // var payPwd =document.getElementById('mark') - // //console.log(payPwd); - // } - }) - $('.bg').on('tap', '.mui-icon-left-nav', function() { - $('.bg').css('display', 'none'); - $('.footer').show(); - }) - }) - - $('.btns').on('tap', '.ckmx', function() { - JZL.openWindow("vouchers.html", "vouchers.html", { - data_href: "wang", - isExpected: 1 - }) - }) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); + +mui.plusReady(function() { + //获取数值 + $('.bg').css("display", 'none') + var self = plus.webview.currentWebview() + var shopId = self.id; + var totlemoney = ""; + JZL.ajax(qlgUrl('app/users/getMoney'), { + type: 3 + }, function(data) { + if (1 == data.status) { + var data = data.data; + totlemoney = data.wangNum; + // $('.idc-total span').html('¥'+data.wangNum) + $('#money').val(totlemoney) + } else { + mui.alert(data.msg) + } + $('.btns').on('tap', '.sqtx', function() { + if ($('#money').val() > totlemoney) { + mui.alert("超过最大提现金额") + return; + } else if ('' == $('#money').val()) { + mui.alert("请输入提现金额") + return; + } else if (1 > $('#money').val()) { + mui.alert("提现金额不能小于1") + return; + } + $('.bg').css('display', 'block'); + $('.footer').hide(); + JZL.ajax(qlgUrl('app/shops/getBank'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data + $('#bankUserName').val(data.accountName) + // $('.bankname').prepend('') + $('.bankname').val(data.bankName) + $('#cardnum').val(data.bankNo) + $('#money').on('focus', function() { + $('.bg').css('display', 'none'); + $('.footer').show(); + }) + + } else { + mui.alert(data.msg) + } + }) + }) + $('.bg').on('tap', '.qrtx', function() { + // mui.prompt("请输入操作密码:") + mui.prompt('请输入操作密码', '', '全亮共商城', ['取消', '忘记密码', '确定'], function(e) { + //console.log(e); + if (2 == e.index) { + var payPwd = e.value; + if ('' == payPwd) { + mui.alert('密码不能为空') + return; + } + var money = $('#money').val(); + JZL.ajax(qlgUrl('app/shops/withdrawal'), { + payPwd: payPwd, + money: money, + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + mui.toast(data.msg) + mui.back() + } else { + mui.alert(data.msg) + } + }) + } else if (1 == e.index) { + JZL.openWindow('setting_fogetPwd.html', 'setting_fogetPwd.html') + } + + }, 'div') + document.querySelector('.mui-popup-input input').type = 'password' + + // var mark=mui.prompt("请输入操作密码:") + // //console.log(document.querySelector('.mui-popup-input input').value) + // if(null!=mark){ + // var payPwd =document.getElementById('mark') + // //console.log(payPwd); + // } + }) + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.bg').css('display', 'none'); + $('.footer').show(); + }) + }) + + $('.btns').on('tap', '.ckmx', function() { + JZL.openWindow("vouchers.html", "vouchers.html", { + data_href: "wang", + isExpected: 1 + }) + }) }) diff --git a/static/app2/js/choiceness.js b/static/app2/js/choiceness.js old mode 100755 new mode 100644 index 89744db..f061b73 --- a/static/app2/js/choiceness.js +++ b/static/app2/js/choiceness.js @@ -1,316 +1,316 @@ -$('.mui-slider-indicator').html('') - -mui.init({ - pullRefresh: { - container: '#pullrefresh', - down: { - style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 - color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 - height: '50px', //可选,默认50px.下拉刷新控件的高度, - range: '100px', //可选 默认100px,控件可下拉拖拽的范围 - offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 - // auto: true, //可选,默认false.首次加载自动上拉刷新一次 - contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 - contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 - contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 - callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; - }, - up: { - contentrefresh: '正在加载...', - callback: pullupRefresh - } - } -}); -var count = 1; - -function pullupRefresh() { - count += 1; - ////console.log(count) - setTimeout(function() { - mui('#pullrefresh').pullRefresh().endPullupToRefresh(); - - // //console.log(order_class) - mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { - - data: { - page: count, - goodsSize: 3, - pagesize: 10 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - data = data.data; - if (data.Rows.length == 0) { - mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); - return; - } - var html = '' - $.each(data.Rows, function() { - html += '

      ' + this.shopName + - '

      ' + this.newTime + - '

      + 关注
      '; - - $.each(this.goods, function() { - - html += '

      ¥' + this.shopPrice + '

      '; - }); - html += '
      ' - }); - $('.con').append(html); - } else { - mui.alert(data.msg) - ////console.log(data.status) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }, 500); -} - -/** - * 下拉刷新具体业务实现 - */ -function pulldownRefresh() { - setTimeout(function() { - window.location.reload(); - mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed - }, 1500); -} -mui.plusReady(function() { - function openAds(item) { - if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { - return; - } - var adURL = item.attr('data-adURL'); - var targetType = ''; - var data_set = {}; - if (item.attr('data-targetType') == 1) { - //商品 - targetType = 'details.html'; - data_set = { - data_id: adURL - } - } else if (item.attr('data-targetType') == 2) { - //商家 - targetType = 'storeout.html'; - - if (adURL == 1) { - // targetType='self_shop.html'; - } - data_set = { - shopId: adURL - } - } else if (item.attr('data-targetType') == 3) { - //活动 - targetType = adURL + '.html'; - } - mui.openWindow({ - url: targetType, - id: targetType + adURL, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: data_set, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } - var data = ''; - mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { - data: { - pagesize: 10, - goodsSize: 3, - page: 1 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - - data = data.data; - - var html = ''; - $.each(data.Rows, function() { - html += '

      ' + this.shopName + - '

      ' + this.newTime + - '

      + 关注
      '; - - $.each(this.goods, function() { - html += '

      ¥' + this.shopPrice + '

      '; - }); - html += '
      ' - }); - $('.con').html(html) - if (data.chosenAdsList.length != 0) { - var html1 = '
      '; - var html2 = '
      '; - $.each(data.chosenAdsList, function() { - html1 += '
      ' - html2 += '
      ' - }) - html2 += '
      ' - html1 += '
      ' - html1 += html2; - $('#slider').html(html1); - - mui("#slider").slider({ - interval: 5000 - }); - document.getElementsByClassName('mui-indicator')[0].className += ' mui-active'; - } - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - mui('.con').on('tap', '.storename', function() { - var shopId = $(this).parent().attr('data-shopId'); - var url = 'storeout.html'; - if (shopId == 1) { - // url='self_shop.html' - } - mui.openWindow({ - url: url, - id: url + shopId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - shopId: shopId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.con').on('tap', '.bc_img', function() { - var goodsId = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + goodsId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: goodsId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.con').on('tap', '.btn_gz', function() { - var shopId = $(this).parent().attr('data-shopId'); - var that = $(this); - mui.ajax(hyhUrl('app/Favorites/add'), { - - data: { - id: shopId, - type: 1 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - that.html('已关注'); - that.addClass('btn_gz1').removeClass('btn_gz'); - } else { - mui.alert(data.msg) ////console.log(data.status) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - //轮播图跳转 - $('#slider').on('tap', '.mui-slider-item', function() { - openAds($(this)); - }) - +$('.mui-slider-indicator').html('') + +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + } + } +}); +var count = 1; + +function pullupRefresh() { + count += 1; + ////console.log(count) + setTimeout(function() { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); + + // //console.log(order_class) + mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { + + data: { + page: count, + goodsSize: 3, + pagesize: 10 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows.length == 0) { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); + return; + } + var html = '' + $.each(data.Rows, function() { + html += '

      ' + this.shopName + + '

      ' + this.newTime + + '

      + 关注
      '; + + $.each(this.goods, function() { + + html += '

      ¥' + this.shopPrice + '

      '; + }); + html += '
      ' + }); + $('.con').append(html); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }, 500); +} + +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +mui.plusReady(function() { + function openAds(item) { + if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { + return; + } + var adURL = item.attr('data-adURL'); + var targetType = ''; + var data_set = {}; + if (item.attr('data-targetType') == 1) { + //商品 + targetType = 'details.html'; + data_set = { + data_id: adURL + } + } else if (item.attr('data-targetType') == 2) { + //商家 + targetType = 'storeout.html'; + + if (adURL == 1) { + // targetType='self_shop.html'; + } + data_set = { + shopId: adURL + } + } else if (item.attr('data-targetType') == 3) { + //活动 + targetType = adURL + '.html'; + } + mui.openWindow({ + url: targetType, + id: targetType + adURL, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: data_set, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + var data = ''; + mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { + data: { + pagesize: 10, + goodsSize: 3, + page: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + + data = data.data; + + var html = ''; + $.each(data.Rows, function() { + html += '

      ' + this.shopName + + '

      ' + this.newTime + + '

      + 关注
      '; + + $.each(this.goods, function() { + html += '

      ¥' + this.shopPrice + '

      '; + }); + html += '
      ' + }); + $('.con').html(html) + if (data.chosenAdsList.length != 0) { + var html1 = '
      '; + var html2 = '
      '; + $.each(data.chosenAdsList, function() { + html1 += '
      ' + html2 += '
      ' + }) + html2 += '
      ' + html1 += '
      ' + html1 += html2; + $('#slider').html(html1); + + mui("#slider").slider({ + interval: 5000 + }); + document.getElementsByClassName('mui-indicator')[0].className += ' mui-active'; + } + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + mui('.con').on('tap', '.storename', function() { + var shopId = $(this).parent().attr('data-shopId'); + var url = 'storeout.html'; + if (shopId == 1) { + // url='self_shop.html' + } + mui.openWindow({ + url: url, + id: url + shopId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + shopId: shopId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + goodsId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: goodsId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.btn_gz', function() { + var shopId = $(this).parent().attr('data-shopId'); + var that = $(this); + mui.ajax(hyhUrl('app/Favorites/add'), { + + data: { + id: shopId, + type: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + that.html('已关注'); + that.addClass('btn_gz1').removeClass('btn_gz'); + } else { + mui.alert(data.msg) ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + //轮播图跳转 + $('#slider').on('tap', '.mui-slider-item', function() { + openAds($(this)); + }) + }) diff --git a/static/app2/js/commercial.js b/static/app2/js/commercial.js old mode 100755 new mode 100644 index 5c8b811..e080b3a --- a/static/app2/js/commercial.js +++ b/static/app2/js/commercial.js @@ -1,222 +1,222 @@ -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - //console.log(self); - - - var id = self.ssid ? self.ssid : ''; - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 3 - }, function(data) { - //console.log(data); - if (1 == data.status & undefined != data.data) { - var data = data.data; - - if (0 == data.status || 2 == data.status) { - if (id == '') { - id = data.id - } - getShopList(data.shopId); - - $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) - $('#confirmImg').val(data.confirmImg) - - var imgs = data.shopImg - imgs = Array.from(imgs.split(',')) - //console.log(imgs); - var html = ""; - var html1 = ''; - mui.each(imgs, function(index, element) { - //console.log(index, element); - html += '
      '; - }) - // $(".batchImg").html(html); - - // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - var maxNum = imgs.length; - - - // if (num == maxNum) { - // maxNum++; - html += '
      '; - $(".batchImg").html(html); - // } - - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 116 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - - } else if (1 == data.status) { - //tiaozhuandao shangdu yemian - } - } else { - getShopList(); - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 116 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - } - }) - - - // 上传图片 - $('.photos_con').on('tap', '.confirm', function() { - UP.init("confirmImg", "test", "confirm") - openCamera() - }) - // 获取店铺信息 - - function getShopList(defaultShopId) { - - JZL.ajax(qlgUrl('app/shops/userShopList'), { - shopType: 1 - }, function(data) { - //console.log(data); - if (1 == data.status) { - var html = ""; - html = ``; - if (undefined == typeof defaultShop) { - - mui.each(data.data, function() { - // //console.log(index, element); - html += ``; - }) - } else { - mui.each(data.data, function() { - if (this.shopId == defaultShopId) { - selected = 'selected'; - } else { - selected = ''; - } - html += ``; - }) - - } - $("#shopId").html(html) - } else { - mui.alert(data.msg) - } - // }) - }) - } - - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - - that.html(html); - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - //删除照片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - // //console.log(this); - var that = $(this) - //var idx = that.parent().attr('data-id'); - //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; - } - }) - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 116 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - var click = 0; - $('.down').on('tap', '.btn', function() { - - if (click == 1) { - return; - } - click = 1 - var imgs = ''; - var data = $('input[name="gallery[]"]'); - //console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - }) - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - $('#shopImg').val(imgs); - if ('' == $('#shopId option:selected').val()) { - mui.alert('请选择要升级的店铺名称') - return; - } - - if ('' == $('#confirmImg').val()) { - mui.alert('请上传确认书照片') - return; - } - if ('' == $('#shopImg').val()) { - mui.alert('请上传店铺照片') - return; - } - - - var params = JZL.getParams(".inp"); - params.applyLevel = 3; - if ("" != id) { - params.id = id; - - } - JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { - // //console.log(data); - if (1 == data.status) { - mui.back() - } else { - mui.alert(data.msg) - } - }) - }) +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + //console.log(self); + + + var id = self.ssid ? self.ssid : ''; + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 3 + }, function(data) { + //console.log(data); + if (1 == data.status & undefined != data.data) { + var data = data.data; + + if (0 == data.status || 2 == data.status) { + if (id == '') { + id = data.id + } + getShopList(data.shopId); + + $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) + $('#confirmImg').val(data.confirmImg) + + var imgs = data.shopImg + imgs = Array.from(imgs.split(',')) + //console.log(imgs); + var html = ""; + var html1 = ''; + mui.each(imgs, function(index, element) { + //console.log(index, element); + html += '
      '; + }) + // $(".batchImg").html(html); + + // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + var maxNum = imgs.length; + + + // if (num == maxNum) { + // maxNum++; + html += '
      '; + $(".batchImg").html(html); + // } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + + } else if (1 == data.status) { + //tiaozhuandao shangdu yemian + } + } else { + getShopList(); + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + } + }) + + + // 上传图片 + $('.photos_con').on('tap', '.confirm', function() { + UP.init("confirmImg", "test", "confirm") + openCamera() + }) + // 获取店铺信息 + + function getShopList(defaultShopId) { + + JZL.ajax(qlgUrl('app/shops/userShopList'), { + shopType: 1 + }, function(data) { + //console.log(data); + if (1 == data.status) { + var html = ""; + html = ``; + if (undefined == typeof defaultShop) { + + mui.each(data.data, function() { + // //console.log(index, element); + html += ``; + }) + } else { + mui.each(data.data, function() { + if (this.shopId == defaultShopId) { + selected = 'selected'; + } else { + selected = ''; + } + html += ``; + }) + + } + $("#shopId").html(html) + } else { + mui.alert(data.msg) + } + // }) + }) + } + + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + that.html(html); + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + //删除照片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // //console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + var click = 0; + $('.down').on('tap', '.btn', function() { + + if (click == 1) { + return; + } + click = 1 + var imgs = ''; + var data = $('input[name="gallery[]"]'); + //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + }) + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + $('#shopImg').val(imgs); + if ('' == $('#shopId option:selected').val()) { + mui.alert('请选择要升级的店铺名称') + return; + } + + if ('' == $('#confirmImg').val()) { + mui.alert('请上传确认书照片') + return; + } + if ('' == $('#shopImg').val()) { + mui.alert('请上传店铺照片') + return; + } + + + var params = JZL.getParams(".inp"); + params.applyLevel = 3; + if ("" != id) { + params.id = id; + + } + JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { + // //console.log(data); + if (1 == data.status) { + mui.back() + } else { + mui.alert(data.msg) + } + }) + }) }) diff --git a/static/app2/js/common.js b/static/app2/js/common.js old mode 100755 new mode 100644 index 0e7050b..c19d22c --- a/static/app2/js/common.js +++ b/static/app2/js/common.js @@ -1,479 +1,478 @@ -var is_online = 1; -var is_app = 1; -var imgUrl = 'http://img.zgqlg.com.cn/'; -var webUrl = 'http://t.ect99.com/'; -var webUrl1 = 'http://t.ect99.com/'; -var cssUrl = localStorage.getItem("cssUrl"); -var jsUrl = localStorage.getItem("jsUrl"); -var version = localStorage.getItem("version"); -if (0 == is_online) { - webUrl = 'http://192.168.1.111/'; -} - -function qlgUrl(url) { - return webUrl + url; -} - -function hyhUrl(url) { - return webUrl + url; -} - -function llUrl(url) { - return webUrl + url; -} - -function hgUrl(url) { - return webUrl + url; -} - -function kxUrl(url) { - return webUrl + url; -} - -function hyhImgUrl(url) { - return imgUrl + url; -} - -function ectUrl(url) { - return webUrl + url; -} - -function ectImgUrl(url) { - return imgUrl + url; -} - -function cssUrl(url) { - return '../css/' + url; -} - -function formatDate(date) { - var d = new Date(date), - - month = '' + (d.getMonth() + 1), - day = '' + d.getDate(), - year = d.getFullYear(), - hour = d.getHours(), - minute =d.getMinutes(), - second = d.getSeconds(); - console.log(hour ); - if (month.length < 2) month = '0' + month; - if (day.length < 2) day = '0' + day; - if (hour< 10) hour = '0' + hour; - if (minute< 10) minute = '0' + minute; - if (second < 10) second = '0' + second; - // return [year, month, day].join('-')+" "+[hour,minute,second].join(':'); - return year+"年"+month +"月"+day+"日"; -} - -function backTop() { - mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 0); -} -function bMapTransQQMap(lng, lat) { - var x_pi = 3.14159265358979324 * 3000.0 / 180.0; - var x = lng - 0.0065; - var y = lat - 0.006; - var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); - var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); - var lngs = z * Math.cos(theta); - var lats = z * Math.sin(theta); - - return { - lng: lngs, - lat: lats - } -} -function toJson(str, notLimit) { - var json = {}; - if (str) { - try { - if (typeof(str) == "object") { - json = str; - } else { - json = eval("(" + str + ")"); - } - if(json.status && (json.status == '-555' || json.status == '-666')){ - //topingzheng - var type = 0; - if(json.status == '-666') type = 1; - JZL.openWindow("paymentVoucher.html",json.data.shopId,{'type':type}); - } - if (!notLimit) { - if (json.status && json.status == '-999') { - //console.log(str.msg) - inLogin(); - - } - } - } catch (e) { - mui.alert("系统发生错误:" + e.getMessage); - json = {}; - } - return json; - } else { - return; - } -} -var JZL = JZL || {}; -JZL.js_init = function(cdn) { - var typeName = 'script'; - var type = 'text/javascript'; - var element, i = 0, - file, parent = document.body; - - for (i; i < cdn.length; i++) { - file = cdn[i]; - element = document.createElement(typeName); - element.type = type; - element.src = file; - parent.appendChild(element); - //free file's value - file = null; - } - /* - * Cleanup at end of function, which isn't necessary unless lots of memory is being - * used up. - * No point nulling a Number, however. In some ECMAScript implementations - * (ActionScript 3), this throws a warning. - */ - //empty array - cdn.splice(0, cdn.length); - //clear variable values - element = null; - parent = null; - cdn = null; -} -JZL.css_init = function(cdn) { - var typeName = 'style'; - var type = 'text/css'; - var rel = 'stylesheet'; - var element, i = 0, - file, head, parent = document.head || document.getElementsByTagName('head')[0]; - for (i; i < cdn.length; i++) { - file = cdn[i]; - element = document.createElement('link'); - element.rel = rel; - element.type = type; - element.href = file; - parent.appendChild(element); - //free file's value - file = null; - } - cdn.splice(0, cdn.length); - element = null; - parent = null; - cdn = null; -} -JZL.getToken = function() { - return localStorage.getItem('token'); -} -JZL.getCssUrl = function(cssName) { - return cssUrl + cssName + '?ver=' + version -} -JZL.getJsUrl = function(jsName) { - return jsUrl + jsName + '?ver=' + version -} -JZL.openWindow = function(openUrl, openId, extras, targetUrl) { - if (1 == is_app) { - if (typeof(extras) == "undefined") extras = {}; - mui.openWindow({ - url: openUrl, - id: openId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: extras, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } else { - location.href = targetUrl; - } - -} - -JZL.closeWindow = function(closeId) { - if (1 == is_app) { - plus.webview.getWebviewById(closeId).close(); - } -} - -JZL.ajax = function(url, data, fnDeal, sendType, sendToken) { - if (typeof(sendType) == "undefined") sendType = 'POST'; - if (typeof(sendToken) == "undefined") sendToken = 1; - if (1 == sendToken) - headers = { - "HYH-Token": JZL.getToken() - }; - else - headers = {}; - // //console.log(JSON.stringify(headers)) - if (1 == is_app) { - - mui.ajax(url, { - headers: headers, - data: data, - dataType: 'json', //服务器返回json格式数据 - type: sendType, //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; - - if (typeof(fnDeal) != "undefined") { - fnDeal(result); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - //alert(xhr+type+errorThrown); - console.log(JSON.stringify(data)); - console.log(url); - //mui.alert(xhr); - } - }); - } else { - - $.ajax(url, { - headers: headers, - data: data, - dataType: 'jsonp', //服务器返回json格式数据 - type: sendType, //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; - if (typeof(fnDeal) != "undefined") { - fnDeal(result); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - //alert(xhr+type+errorThrown); - alert(type); - } - }); - } - -} - -function inLogin() { - JZL.openWindow('login.html', 'login.html'); -} - -var scroll = mui('.mui-scroll-wrapper').scroll(); - -var ua = navigator.userAgent.toLowerCase(); -if (/iphone|ipad|ipod/.test(ua)) { //苹果手机 - if (document.getElementsByClassName('zhe')[0]) { - document.getElementsByClassName('zhe')[0].style.display = 'none'; - } - // document.getElementsByClassName('zhe')[0].style.display='none'; -} else if (/android/.test(ua)) { - // document.getElementsByClassName('zhe')[0].style.display='block'; - if (document.getElementsByClassName('zhe')[0]) { - document.getElementsByClassName('zhe')[0].style.display = 'none'; - } -} - -var hSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; -var hPadding = 22 + (+localStorage.getItem('ipxSizeTop')) + 'px'; -$('.header').css('height', hSize); -$('.header').css('padding-top', hPadding); -$('.scroll_out_tb').css('top', hSize); -$('.scroll_out_t').css('top', hSize); -mui.plusReady(function() { - plus.navigator.setStatusBarStyle('dark'); -}) - -mui('.nav').on('tap', '.nav_block', function() { - $(this).addClass('on').siblings().removeClass('on'); -}) - -//打开广告 -function openAds(item) { - if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { - return; - } - var adURL = item.attr('data-adURL'); - var targetType = ''; - var data_set = {}; - if (item.attr('data-targetType') == 1) { - //商品 - targetType = 'details.html'; - data_set = { - data_id: adURL - } - } else if (item.attr('data-targetType') == 2) { - //商家 - targetType = 'storeout.html'; - if (adURL == 1) { - // targetType = 'self_shop.html' - } - data_set = { - shopId: adURL - } - } else if (item.attr('data-targetType') == 3) { - //活动 - targetType = adURL; - data_set = { - adURLId: adURL.split('?')[1] - } - } - ////console.log(item.attr('data-adURL')); - JZL.openWindow(targetType, targetType + adURL, data_set); -} - -//返回顶部 -//var scrollToTopBox = document.getElementById('scrollToTop'); //返回按钮tap -//scrollToTopBox.addEventListener('tap', function(e) { -// e.stopPropagation(); -// mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); //滚动到顶部 -//}); -// Android上监听原生滚动,iOS上监听div滚动,上拉超过一屏后显示按钮,否则隐藏,可自行在条件判断中修改 -//if(mui.os.android) { -// window.addEventListener('scroll', function(e) { -// if(window.pageYOffset >= window.innerHeight && scrollToTopBox.classList.contains('hide')) { -// scrollToTopBox.classList.remove('hide'); -// } else if(window.pageYOffset < window.innerHeight && !scrollToTopBox.classList.contains('hide')) { -// scrollToTopBox.classList.add('hide'); -// } -// }); -//} else { -// document.getElementsByClassName('mui-scroll-wrapper')[0].addEventListener('scroll', function() { -// if(mui('.mui-scroll-wrapper').scroll().y <= window.innerHeight * (-1) && scrollToTopBox.classList.contains('hide')) { -// scrollToTopBox.classList.remove('hide'); -// } else if(mui('.mui-scroll-wrapper').scroll().y > window.innerHeight * (-1) && !scrollToTopBox.classList.contains('hide')) { -// scrollToTopBox.classList.add('hide'); -// } -// }); -//} -JZL.saveItems = function(className, itemName) { - var params = JZL.getParams(className); - localStorage.setItem(itemName, JSON.stringify(params)); -} -JZL.getItems = function(itemName) { - var itemNames = localStorage.getItem(itemName); - //if(null != itemNames) - JZL.setValues(JSON.parse(itemNames)); - -} -JZL.getParams = function(obj) { - var params = {}; - var chk = {}; - var s; - $(obj).each(function() { - // //console.log($(this)[0]); - if ($(this)[0].type == 'hidden' || $(this)[0].type == 'number' || $(this)[0].type == 'tel' || $(this)[0].type == - 'password' || $(this)[0].type == 'select-one' || $(this)[0].type == 'textarea' || $(this)[0].type == 'text') { - params[$(this).attr('id')] = $.trim($(this).val()); - } else if ($(this).is('img')) { - // //console.log(1) - params[$(this).attr('id')] = $.trim($(this).attr('data-src')); - } else if ($(this)[0].type == 'radio') { - if ($(this).attr('name')) { - params[$(this).attr('name')] = $('input[name=' + $(this).attr('name') + ']:checked').val(); - } - } else if ($(this)[0].type == 'checkbox') { - if ($(this).attr('name') && !chk[$(this).attr('name')]) { - s = []; - chk[$(this).attr('name')] = 1; - $('input[name=' + $(this).attr('name') + ']:checked').each(function() { - s.push($(this).val()); - }); - params[$(this).attr('name')] = s.join(','); - } - } - }); - chk = null, s = null; - return params; -} -JZL.setValue = function(name, value) { - - var first = name.substr(0, 1), - input, i = 0, - val; - if ("#" === first || "." === first) { - input = $(name); - } else { - input = $("[name='" + name + "']"); - } - - if (input.eq(0).is(":radio")) { //单选按钮 - input.filter("[value='" + value + "']").each(function() { - this.checked = true - }); - } else if (input.eq(0).is(":checkbox")) { //复选框 - if (!$.isArray(value)) { - val = new Array(); - val[0] = value; - } else { - val = value; - } - for (i = 0, len = val.length; i < len; i++) { - input.filter("[value='" + val[i] + "']").each(function() { - this.checked = true - }); - } - } else if (input.is('img')) { //图片 - - if (''!= value) { - input.attr('src',hyhImgUrl(value)); - input.attr('data-src',value); - } - - } else { //其他表单选项直接设置值 - input.val(value); - } - -} -JZL.setValues = function(obj) { - var input, value, val; - for (var key in obj) { - if ($('#' + key)[0]) { - JZL.setValue('#' + key, obj[key]); - } else if ($("[name='" + key + "']")[0]) { - JZL.setValue(key, obj[key]); - } - } -} - - - - -/** - * 邮箱格式判断 - * @param str - */ -function checkEmail(str){ - var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i; - if(reg.test(str)){ - return true; - }else{ - return false; - } -} -/** - * 输入为空检查 - * @param name '#id' '.id' (name模式直接写名称) - * @param type 类型 0 默认是id或者class方式 1 name='X'模式 - */ -function is_empty(name,type){ - if(type == 1){ - if($('input[name="'+name+'"]').val() == ''){ - return true; - } - }else{ - if($(name).val() == ''){ - return true; - } - } - return false; -} - - +var is_app = 1; +var imgUrl = 'http://img.zgqlg.com.cn/'; +var webUrl = 'http://www.zgqlg.com.cn/'; +var webUrl1 = 'http://www.zgqlg.com.cn/'; +// var imgUrl = 'http://qlg.tsgz.moe:233/'; +// var webUrl = 'http://qlg.tsgz.moe:233/'; +// var webUrl1 = 'http://qlg.tsgz.moe:233/'; +var cssUrl = localStorage.getItem("cssUrl"); +var jsUrl = localStorage.getItem("jsUrl"); +var version = localStorage.getItem("version"); +function qlgUrl(url) { + console.log(webUrl) + return webUrl + url; +} + +function hyhUrl(url) { + return webUrl + url; +} + +function llUrl(url) { + return webUrl + url; +} + +function hgUrl(url) { + return webUrl + url; +} + +function kxUrl(url) { + return webUrl + url; +} + +function hyhImgUrl(url) { + return imgUrl + url; +} + +function ectUrl(url) { + return webUrl + url; +} + +function ectImgUrl(url) { + return imgUrl + url; +} + +function cssUrl(url) { + return '../css/' + url; +} + +function formatDate(date) { + var d = new Date(date), + + month = '' + (d.getMonth() + 1), + day = '' + d.getDate(), + year = d.getFullYear(), + hour = d.getHours(), + minute =d.getMinutes(), + second = d.getSeconds(); + console.log(hour ); + if (month.length < 2) month = '0' + month; + if (day.length < 2) day = '0' + day; + if (hour< 10) hour = '0' + hour; + if (minute< 10) minute = '0' + minute; + if (second < 10) second = '0' + second; + // return [year, month, day].join('-')+" "+[hour,minute,second].join(':'); + return year+"年"+month +"月"+day+"日"; +} + +function backTop() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 0); +} +function bMapTransQQMap(lng, lat) { + var x_pi = 3.14159265358979324 * 3000.0 / 180.0; + var x = lng - 0.0065; + var y = lat - 0.006; + var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); + var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); + var lngs = z * Math.cos(theta); + var lats = z * Math.sin(theta); + + return { + lng: lngs, + lat: lats + } +} +function toJson(str, notLimit) { + var json = {}; + if (str) { + try { + if (typeof(str) == "object") { + json = str; + } else { + json = eval("(" + str + ")"); + } + if(json.status && (json.status == '-555' || json.status == '-666')){ + //topingzheng + var type = 0; + if(json.status == '-666') type = 1; + JZL.openWindow("paymentVoucher.html",json.data.shopId,{'type':type}); + } + if (!notLimit) { + if (json.status && json.status == '-999') { + //console.log(str.msg) + inLogin(); + + } + } + } catch (e) { + mui.alert("系统发生错误:" + e.getMessage); + json = {}; + } + return json; + } else { + return; + } +} +var JZL = JZL || {}; +JZL.js_init = function(cdn) { + var typeName = 'script'; + var type = 'text/javascript'; + var element, i = 0, + file, parent = document.body; + + for (i; i < cdn.length; i++) { + file = cdn[i]; + element = document.createElement(typeName); + element.type = type; + element.src = file; + parent.appendChild(element); + //free file's value + file = null; + } + /* + * Cleanup at end of function, which isn't necessary unless lots of memory is being + * used up. + * No point nulling a Number, however. In some ECMAScript implementations + * (ActionScript 3), this throws a warning. + */ + //empty array + cdn.splice(0, cdn.length); + //clear variable values + element = null; + parent = null; + cdn = null; +} +JZL.css_init = function(cdn) { + var typeName = 'style'; + var type = 'text/css'; + var rel = 'stylesheet'; + var element, i = 0, + file, head, parent = document.head || document.getElementsByTagName('head')[0]; + for (i; i < cdn.length; i++) { + file = cdn[i]; + element = document.createElement('link'); + element.rel = rel; + element.type = type; + element.href = file; + parent.appendChild(element); + //free file's value + file = null; + } + cdn.splice(0, cdn.length); + element = null; + parent = null; + cdn = null; +} +JZL.getToken = function() { + return localStorage.getItem('token'); +} +JZL.getCssUrl = function(cssName) { + return cssUrl + cssName + '?ver=' + version +} +JZL.getJsUrl = function(jsName) { + return jsUrl + jsName + '?ver=' + version +} +JZL.openWindow = function(openUrl, openId, extras, targetUrl) { + if (1 == is_app) { + if (typeof(extras) == "undefined") extras = {}; + mui.openWindow({ + url: openUrl, + id: openId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: extras, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } else { + location.href = targetUrl; + } + +} + +JZL.closeWindow = function(closeId) { + if (1 == is_app) { + plus.webview.getWebviewById(closeId).close(); + } +} + +JZL.ajax = function(url, data, fnDeal, sendType, sendToken) { + if (typeof(sendType) == "undefined") sendType = 'POST'; + if (typeof(sendToken) == "undefined") sendToken = 1; + if (1 == sendToken) + headers = { + "HYH-Token": JZL.getToken() + }; + else + headers = {}; + // //console.log(JSON.stringify(headers)) + if (1 == is_app) { + + mui.ajax(url, { + headers: headers, + data: data, + dataType: 'json', //服务器返回json格式数据 + type: sendType, //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; + + if (typeof(fnDeal) != "undefined") { + fnDeal(result); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + //alert(xhr+type+errorThrown); + console.log(JSON.stringify(data)); + console.log(url); + //mui.alert(xhr); + } + }); + } else { + + $.ajax(url, { + headers: headers, + data: data, + dataType: 'jsonp', //服务器返回json格式数据 + type: sendType, //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; + if (typeof(fnDeal) != "undefined") { + fnDeal(result); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + //alert(xhr+type+errorThrown); + alert(type); + } + }); + } + +} + +function inLogin() { + JZL.openWindow('login.html', 'login.html'); +} + +var scroll = mui('.mui-scroll-wrapper').scroll(); + +var ua = navigator.userAgent.toLowerCase(); +if (/iphone|ipad|ipod/.test(ua)) { //苹果手机 + if (document.getElementsByClassName('zhe')[0]) { + document.getElementsByClassName('zhe')[0].style.display = 'none'; + } + // document.getElementsByClassName('zhe')[0].style.display='none'; +} else if (/android/.test(ua)) { + // document.getElementsByClassName('zhe')[0].style.display='block'; + if (document.getElementsByClassName('zhe')[0]) { + document.getElementsByClassName('zhe')[0].style.display = 'none'; + } +} + +var hSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; +var hPadding = 22 + (+localStorage.getItem('ipxSizeTop')) + 'px'; +$('.header').css('height', hSize); +$('.header').css('padding-top', hPadding); +$('.scroll_out_tb').css('top', hSize); +$('.scroll_out_t').css('top', hSize); +mui.plusReady(function() { + plus.navigator.setStatusBarStyle('dark'); +}) + +mui('.nav').on('tap', '.nav_block', function() { + $(this).addClass('on').siblings().removeClass('on'); +}) + +//打开广告 +function openAds(item) { + if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { + return; + } + var adURL = item.attr('data-adURL'); + var targetType = ''; + var data_set = {}; + if (item.attr('data-targetType') == 1) { + //商品 + targetType = 'details.html'; + data_set = { + data_id: adURL + } + } else if (item.attr('data-targetType') == 2) { + //商家 + targetType = 'storeout.html'; + if (adURL == 1) { + // targetType = 'self_shop.html' + } + data_set = { + shopId: adURL + } + } else if (item.attr('data-targetType') == 3) { + //活动 + targetType = adURL; + data_set = { + adURLId: adURL.split('?')[1] + } + } + ////console.log(item.attr('data-adURL')); + JZL.openWindow(targetType, targetType + adURL, data_set); +} + +//返回顶部 +//var scrollToTopBox = document.getElementById('scrollToTop'); //返回按钮tap +//scrollToTopBox.addEventListener('tap', function(e) { +// e.stopPropagation(); +// mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); //滚动到顶部 +//}); +// Android上监听原生滚动,iOS上监听div滚动,上拉超过一屏后显示按钮,否则隐藏,可自行在条件判断中修改 +//if(mui.os.android) { +// window.addEventListener('scroll', function(e) { +// if(window.pageYOffset >= window.innerHeight && scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.remove('hide'); +// } else if(window.pageYOffset < window.innerHeight && !scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.add('hide'); +// } +// }); +//} else { +// document.getElementsByClassName('mui-scroll-wrapper')[0].addEventListener('scroll', function() { +// if(mui('.mui-scroll-wrapper').scroll().y <= window.innerHeight * (-1) && scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.remove('hide'); +// } else if(mui('.mui-scroll-wrapper').scroll().y > window.innerHeight * (-1) && !scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.add('hide'); +// } +// }); +//} +JZL.saveItems = function(className, itemName) { + var params = JZL.getParams(className); + localStorage.setItem(itemName, JSON.stringify(params)); +} +JZL.getItems = function(itemName) { + var itemNames = localStorage.getItem(itemName); + //if(null != itemNames) + JZL.setValues(JSON.parse(itemNames)); + +} +JZL.getParams = function(obj) { + var params = {}; + var chk = {}; + var s; + $(obj).each(function() { + // //console.log($(this)[0]); + if ($(this)[0].type == 'hidden' || $(this)[0].type == 'number' || $(this)[0].type == 'tel' || $(this)[0].type == + 'password' || $(this)[0].type == 'select-one' || $(this)[0].type == 'textarea' || $(this)[0].type == 'text') { + params[$(this).attr('id')] = $.trim($(this).val()); + } else if ($(this).is('img')) { + // //console.log(1) + params[$(this).attr('id')] = $.trim($(this).attr('data-src')); + } else if ($(this)[0].type == 'radio') { + if ($(this).attr('name')) { + params[$(this).attr('name')] = $('input[name=' + $(this).attr('name') + ']:checked').val(); + } + } else if ($(this)[0].type == 'checkbox') { + if ($(this).attr('name') && !chk[$(this).attr('name')]) { + s = []; + chk[$(this).attr('name')] = 1; + $('input[name=' + $(this).attr('name') + ']:checked').each(function() { + s.push($(this).val()); + }); + params[$(this).attr('name')] = s.join(','); + } + } + }); + chk = null, s = null; + return params; +} +JZL.setValue = function(name, value) { + + var first = name.substr(0, 1), + input, i = 0, + val; + if ("#" === first || "." === first) { + input = $(name); + } else { + input = $("[name='" + name + "']"); + } + + if (input.eq(0).is(":radio")) { //单选按钮 + input.filter("[value='" + value + "']").each(function() { + this.checked = true + }); + } else if (input.eq(0).is(":checkbox")) { //复选框 + if (!$.isArray(value)) { + val = new Array(); + val[0] = value; + } else { + val = value; + } + for (i = 0, len = val.length; i < len; i++) { + input.filter("[value='" + val[i] + "']").each(function() { + this.checked = true + }); + } + } else if (input.is('img')) { //图片 + + if (''!= value) { + input.attr('src',hyhImgUrl(value)); + input.attr('data-src',value); + } + + } else { //其他表单选项直接设置值 + input.val(value); + } + +} +JZL.setValues = function(obj) { + var input, value, val; + for (var key in obj) { + if ($('#' + key)[0]) { + JZL.setValue('#' + key, obj[key]); + } else if ($("[name='" + key + "']")[0]) { + JZL.setValue(key, obj[key]); + } + } +} + + + + +/** + * 邮箱格式判断 + * @param str + */ +function checkEmail(str){ + var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i; + if(reg.test(str)){ + return true; + }else{ + return false; + } +} +/** + * 输入为空检查 + * @param name '#id' '.id' (name模式直接写名称) + * @param type 类型 0 默认是id或者class方式 1 name='X'模式 + */ +function is_empty(name,type){ + if(type == 1){ + if($('input[name="'+name+'"]').val() == ''){ + return true; + } + }else{ + if($(name).val() == ''){ + return true; + } + } + return false; +} + + diff --git a/static/app2/js/compare.js b/static/app2/js/compare.js old mode 100755 new mode 100644 diff --git a/static/app2/js/complain.js b/static/app2/js/complain.js old mode 100755 new mode 100644 index c9d526d..5039f1e --- a/static/app2/js/complain.js +++ b/static/app2/js/complain.js @@ -1,156 +1,156 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - var self = plus.webview.currentWebview(); - var data_order_id = self.data_order_id; - - mui.ajax(hyhUrl('app/Ordercomplains/getComplainCause'), { - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += ''; - }) - $('select').html(html); - - } else { - mui.alert(data.msg) - // //console.log(data.status) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - - var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: 'selectfiles', - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementById('ossfile').innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false, 'complains'); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementById('ossfile').innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if (info.status == 200) { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - }, - - Error: function(up, err) { - if (err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if (err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if (err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } - }); - - uploader.init(); - - $('button').on('tap', function() { - var complainType = $('select').val(); - var complainContent = $('textarea').val(); - var imagesArr = []; - $('#ossfile').children('.files_out').children('b').children('img').each(function() { - imagesArr.push($(this).attr('data-src')) - }) - var images = imagesArr.join(','); - if (complainType == 0) { - mui.alert('请选择投诉原因!'); - return; - } - if (complainContent.length < 5) { - mui.alert('投诉内容不小于5个字!'); - return; - } - var that = $(this); - mui.ajax(hyhUrl('app/Ordercomplains/saveComplain'), { - data: { - orderId: data_order_id, - complainType: complainType, - complainContent: complainContent, - complainAnnex: images - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - mui.alert('提交成功!'); - var targetTab = plus.webview.getWebviewById('complain.html'); - mui.fire(targetTab, 'refresh'); - mui.back(); - } else { - mui.alert(data.msg) - // //console.log(data.status) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - }) - +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var self = plus.webview.currentWebview(); + var data_order_id = self.data_order_id; + + mui.ajax(hyhUrl('app/Ordercomplains/getComplainCause'), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += ''; + }) + $('select').html(html); + + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: 'selectfiles', + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementById('ossfile').innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false, 'complains'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementById('ossfile').innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if (info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if (err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if (err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if (err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); + + $('button').on('tap', function() { + var complainType = $('select').val(); + var complainContent = $('textarea').val(); + var imagesArr = []; + $('#ossfile').children('.files_out').children('b').children('img').each(function() { + imagesArr.push($(this).attr('data-src')) + }) + var images = imagesArr.join(','); + if (complainType == 0) { + mui.alert('请选择投诉原因!'); + return; + } + if (complainContent.length < 5) { + mui.alert('投诉内容不小于5个字!'); + return; + } + var that = $(this); + mui.ajax(hyhUrl('app/Ordercomplains/saveComplain'), { + data: { + orderId: data_order_id, + complainType: complainType, + complainContent: complainContent, + complainAnnex: images + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + mui.alert('提交成功!'); + var targetTab = plus.webview.getWebviewById('complain.html'); + mui.fire(targetTab, 'refresh'); + mui.back(); + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }) + }) diff --git a/static/app2/js/confirmOrder.js b/static/app2/js/confirmOrder.js old mode 100755 new mode 100644 index cfe4838..820b35f --- a/static/app2/js/confirmOrder.js +++ b/static/app2/js/confirmOrder.js @@ -1,717 +1,760 @@ -//$('.pay_info .row_left').eq(0).html('桔子链账号'); -var wxChannel = null; // 微信支付 -var aliChannel = null; // 支付宝支付 -var channel = null; //支付通道 -mui.init(); -mui.plusReady(function() { - window.addEventListener('setAddress', function(e) { - var addressId = localStorage.getItem('addressId') ? localStorage.getItem('addressId') : 0; - if (addressId == 0) { - return; - } - mui.ajax(hyhUrl('app/useraddress/getById'), { - data: { - addressId: addressId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - // for(i in data.data){ - // //console.log(i) - // //console.log(data.data[i]) - // } - var html = - '
      收货人:' + - data.userName + '
      ' + data.userPhone + - '
      收货地址:' + data.areaName + ' ' + data.userAddress + '
      '; - $('.address').html(html); - $('.address').attr('data-addressId', data.addressId); - $('.address').attr('data-areaId', data.areaId2); - - } else { - mui.alert(data.msg); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }); - - $('.con').on('tap', '.address', function() { - var addressId = $(this).attr('data-addressId'); - localStorage.setItem('addressId', addressId); - var isOrder = true; - mui.openWindow({ - url: 'setting_address.html', - id: 'setting_address.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_addressId: addressId, - data_isOrder: isOrder - - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - }) - //支付插件 - plus.payment.getChannels(function(channels) { - for (var i in channels) { - if (channels[i].id == "wxpay") { - wxChannel = channels[i]; - } else { - aliChannel = channels[i]; - } - } - }, function(e) { - mui.alert("获取支付通道失败:" + e.message); - }); - // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; - var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=1&orderNo='); - // 2. 发起支付请求 - function pay(id, orderNo) { - // 从服务器请求支付订单 - var PAYSERVER = ''; - if (id == 'alipay') { - PAYSERVER = ALIPAYSERVER; - channel = aliChannel; - } else if (id == 'wxpay') { - PAYSERVER = WXPAYSERVER; - channel = wxChannel; - } else { - plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); - return; - } - var xhr = new XMLHttpRequest(); - // var amount = 1; - - xhr.onreadystatechange = function() { - switch (xhr.readyState) { - case 4: - if (xhr.status == 200) { - plus.payment.request(channel, xhr.responseText, function(result) { - plus.nativeUI.alert("支付成功!", function() { - // back(); - - }); - }, function(error) { - // plus.nativeUI.alert("支付失败:" + error.code); - plus.webview.getWebviewById('confirmOrder.html').close(); - }); - } else { - mui.alert("获取订单信息失败!"); - ////console.log(xhr.status) - } - break; - default: - break; - } - } - xhr.open('GET', PAYSERVER + orderNo); - xhr.send(); - - } - var self = plus.webview.currentWebview(); - var type = self.type; - var data_1 = {}; - var isUseScore = 0; - var orderNo; - var priceT = 0; - var payCode = ''; - var userCoupon = ''; - var couponIds = []; - var areaId2 = ''; - // //console.log(type) - - mui.ajax(qlgUrl('app/carts/settlement'), { - data: { - type: type - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data) - var data = toJson(data); - // //console.log(JSON.stringify(data)); - if (data.status == 1) { - var allallnum = 0; - data = data.data; - data_1 = data; - if (data.userAddress.addressId) { - var html = '
      收货人:' + - data.userAddress.userName + '
      ' + data.userAddress.userPhone + - '
      收货地址:' + data.userAddress.areaName + ' ' + data.userAddress.userAddress + - '
      '; - } else { - var html = - '
      请选择收货地址
      '; - } - $.each(data.carts, function() { - var allNum = 0; - html += '
      ' + this.shopName + - '
      '; - $.each(this.list, function() { - allNum += this.cartNum; - var price = ''; - if (this.isWhsle == 1) { - price = this.whslePrice; - } else if (this.specPrice != 'null') { - price = this.shopPrice; - } else { - price = this.specPrice; - } - var specNames = ''; - for (var i in this.specNames[0]) { - if (i == "catName") { - specNames = this.specNames[0][i] + ':'; - } else if (i == "itemName") { - specNames += this.specNames[0][i] - } - } - - html += '

      ' + this.goodsName + '

      '; - $.each(this.specNames, function() { - html += this.catName + ':' + this.itemName + ';'; - }); - - html += '

      ¥' + price + '

      ¥' + this.marketPrice + 'x' + - this.cartNum + '
      ' - }); - allallnum += allNum; - html += - '
      买家留言:
      '; - // if (this.coupons != '') { - // couponName = ''; - // html += - // '
      选择优惠券:
      '; - // } else { - html += ''; - //} - - html += '
      共' + allNum + - '件商品 小计:¥' + this.goodsMoney + ' + 运费:¥' + this.shippingMoney + - '
      '; - }); - html += '
      发货方式:
      '; - // $.each(data.userCoupon, function() { - // html += ''; - // }); - // html += '
      ' - //木吉抵扣 - if (data.is_seckilling == 1 || data.promotion_goods == 1 || data.ect_pay == 1) { - // data.useOrderScore=0; - } else { - // html += '
      木吉抵用    可抵用木吉:' + data.useOrderScore + '
      ' - - } - // html+='
      购买数量
      -+
      ' - // html += '
      木吉
      成交后奖励成交价20%的木吉
      '; - priceT = (Math.floor((+data.goodsTotalMoney - (+data.promotionMoney)) * 100)) / 100; - priceT = priceT >= 0 ? priceT : 0; - var html1 = '共' + allallnum + '件商品 合计:¥' + priceT + - '  '; - // if(data.ect_pay == 1) { - // var htmlpay = '

      ECT余额:' + data.userECT + '

      '; - // - // $('.pay_info .con_1').append(htmlpay); - // // $('.pay_info .con_1 .row').eq(0).attr('style','display: none;'); - // $('.pay_info .con_1 .row').eq(1).remove(); - // }; - $.each(data.payments, function(i, v) { - $.each(v, function() { - $('#pay_way,.pay_info .con_1').append('

      付款方式

      ' + this.payName + '

      '); - }) - }) - $('.con').html(html); - $('.js_r').html(html1); - $('#loginName').html(data.loginName); - $('.userMoney').html(data.userMoney); - - $('#goodsTotalMoney').html(priceT); - } else { - mui.alert(data.msg); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - //店铺优惠券 - $('.con').on('change', '.yhq_', function() { - userCoupon = $('#userCoupon').val(); - areaId2 = $('.address').attr('data-areaId2'); - couponIds = []; - $('select').each(function() { - couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); - }) - // var addressId = $('.address').attr('data-addressId') - var areaId2 = $('.address').attr('data-areaId2') - var couponIdsArr = couponIds.join(','); - mui.ajax(qlgUrl('app/carts/getMoney'), { - data: { - type: type, - areaId2: areaId2, - isUseScore: isUseScore, - useScore: data_1.useOrderScore, - couponIds: couponIdsArr, - recordId: userCoupon - - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - data = toJson(data); - // //console.log(data.msg) - if (data.status == 1) { - data_1.useOrderScore = data.data.maxScore; - $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); - priceT = data.data.realTotalMoney; - $('.js_r span j').html('¥' + data.data.realTotalMoney) - $('#goodsTotalMoney').html(data.data.realTotalMoney); - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - }); - //订单优惠券 - $('body').on('change', '#userCoupon,#deliverType', function() { - userCoupon = $('#userCoupon').val(); - areaId2 = $('.address').attr('data-areaId2'); - couponIds = []; - $('select').each(function() { - couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); - }) - // var addressId = $('.address').attr('data-addressId') - var areaId2 = $('.address').attr('data-areaId2') - var couponIdsArr = couponIds.join(','); - mui.ajax(hyhUrl('app/carts/getMoney'), { - data: { - type: type, - deliverType:$('#deliverType').val(), - areaId2: areaId2, - //isUseScore: isUseScore, - useScore: data_1.useOrderScore, - //couponIds: couponIdsArr, - //recordId: userCoupon - - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(JSON.stringify( data)) - data = toJson(data); - // //console.log(data.msg) - if (data.status == 1) { - data_1.useOrderScore = data.data.maxScore; - $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); - $('.js_r span j').html('¥' + data.data.realTotalMoney); - priceT = data.data.realTotalMoney; - $('#goodsTotalMoney').html(data.data.realTotalMoney); - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - }); - //是否使用木吉 -// $('.con').on('tap', '.checkout', function() { -// userCoupon = $('#userCoupon').val(); -// $(this).toggleClass('on'); -// if ($(this).hasClass('on')) { -// isUseScore = 1; -// } else { -// isUseScore = 0; -// } -// couponIds = []; -// $('select').each(function() { -// couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); -// }) -// couponIdsArr = couponIds.join(','); -// areaId2 = $('.address').attr('data-areaId2'); -// // //console.log(areaId2) -// // //console.log(couponIdsArr) -// // //console.log(data_1.userAddress.areaId2) -// // //console.log(data_1.userAddress) -// -// // //console.log( areaId2) -// // //console.log(isUseScore) -// // //console.log( data_1.useOrderScore) -// // //console.log(couponIdsArr) -// // //console.log(userCoupon); -// mui.ajax(hyhUrl('app/carts/getMoney'), { -// data: { -// type: type, -// areaId2: areaId2, -// isUseScore: isUseScore, -// useScore: data_1.useOrderScore, -// couponIds: couponIdsArr, -// recordId: userCoupon -// -// }, -// dataType: 'json', //服务器返回json格式数据 -// type: 'post', //HTTP请求类型 -// timeout: 10000, //超时时间设置为10秒; -// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; -// -// data = toJson(data); -// -// if (data.status == 1) { -// data_1.useOrderScore = data.data.maxScore; -// $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); -// // //console.log(data) -// // //console.log(data.data.shopFreight) -// // for(i in data.data){ -// // //console.log(i) -// // //console.log(data.data[i]) -// // } -// priceT = data.data.realTotalMoney; -// $('.js_r span j').html('¥' + data.data.realTotalMoney) -// $('#goodsTotalMoney').html(data.data.realTotalMoney); -// } else { -// mui.alert('发生错误请刷新后重试!'); -// // location.reload(); -// } -// }, -// error: function(xhr, type, errorThrown) { //异常处理; -// //alert(errorThrown); -// } -// }); -// }) - $('.footer').on('tap', '.btn_tj', function() { - payCode = $('.select_payway').attr('data-payCode'); - var that = $(this); - if (payCode == 'ect') { - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/ect/getToEctNum'), { - - data: { - total_money: priceT - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - var btnArray = ['是', '否']; - mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { - if (e.index == 1) { - that.removeAttr('disabled'); - return; - - } else { - var addressId = $('.address').attr('data-addressId'); - if (addressId) { - $('.bg').css('display', 'block'); - $(".pay").slideDown(300); - } else { - mui.alert('未设置收货地址!') - } - that.removeAttr('disabled'); - } - }) - } else { - mui.alert(data.msg); - return; - } - - } - }) - } else { - var addressId = $('.address').attr('data-addressId'); - if (addressId) { - $('.bg').css('display', 'block'); - $(".pay").slideDown(300); - } else { - mui.alert('未设置收货地址!') - } - } - - }) - - $('.bg').on('tap', '.mui-icon-left-nav', function() { - $('.pay').css('display', 'block'); - $('.pay_way').css('display', 'none'); - }) - $('.bg').on('tap', '.mui-icon-closeempty', function() { - $('.bg').css('display', 'none'); - $(".pay").slideUp(300, function() { - - }); - }) - - $('#pay_way').on('tap', '.row', function() { - $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); - $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); - $('.select_payway .row_right o').html($(this).children('.row_left').html()); - $('.select_payway').attr('data-payCode', $(this).attr('data-payCode')) - $('.pay').css('display', 'block'); - $('#pay_way').css('display', 'none'); - - }) - $('.pay').on('tap', '.select_payway', function() { - if ($(this).attr('data-payCode') == 'ect') {} else { - $('.pay').css('display', 'none'); - $('#pay_way').css('display', 'block'); - } - - }) - var click = false; - $('.pay_btn').on('tap', function() { - - var addressId = $('.address').attr('data-addressId'); - var areaId = $('.address').attr('data-areaId'); - var that = $(this); - payCode = $('.select_payway').attr('data-payCode'); - var data_send = { - type: type, - s_addressId: addressId, - s_areaId: areaId, - payCode: payCode, - payType: 1, - isUseScore: isUseScore, - useScore: data_1.useOrderScore, - deliverType: $('#deliverType').val(), - isInvoice: 0, - invoiceId: 0, - invoiceClient: '', - recordId: userCoupon - } - $('.remark').each(function() { - data_send['remark_' + ($(this).attr('data-shopid'))] = $(this).val(); - }); - $('select').each(function() { - data_send['couponId_' + ($(this).attr('data-shopid'))] = $(this).val(); - }) - if (true == click) return; - click = true; - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/orders/submit'), { - data: data_send, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - ////console.log(JSON.stringify(data)) - data = toJson(data); - if (data.status == 1) { - orderNo = data.data; - if (payCode == 'qlgpay') { - JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { - orderNo: orderNo, - isBatch: 1 - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(JSON.stringify(data)); - var data = toJson(data); - // //console.log(JSON.stringify(data)) - if (data.status == 1) { - $('.pay').css('display', 'none'); - $('#qlg_pay_pwd').css('display', 'block'); - if (data.data.payPwd == '0') { - mui.alert('还未设置支付密码请先设置操作密码!'); - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - //return; - } - $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); - $('#productNum').val(data.data.product.useProduct); - if (data.data.product.useProduct > 0) { - var html1 = '

      抵扣额' + data.data.product.useProductOk + - '

      扣税 ' + data.data.product.useProductTaxFee + - '

      手续费 ' + data.data.product.useProductHandlingFee + - '

      '; - $('.productInfo_').html(html1) - // $('#productInfo').html('产品券[抵扣额:'+data.data.product.useProductOk+',扣税:'+data.data.product.useProductTaxFee+',手续费:'+data.data.product.useProductHandlingFee+']'); - } - $('#couponsNum').val(data.data.coupons.useCoupons); - if (data.data.coupons.useCoupons > 0) { - var html2 = '

      抵扣额' + data.data.coupons.useCouponsOk + - '

      扣税 ' + data.data.coupons.useCouponsTaxFee + - '

      手续费 ' + data.data.coupons.useCouponsHandlingFee + - '

      '; - $('.couponsInfo_').html(html2) - // $('#coupousInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + - // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); - } - $('#wangNum').val(data.data.wang.useWang); - $('#moneyNum').val(data.data.money.useMoney); - - } else { - mui.alert(data.msg) - } - }); - //显示支付页面 - } else if (payCode == 'wallets' || payCode == 'ect') { - //跳输入密码的页面 - JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { - orderNo: data.data, - isBatch: 1 - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - $('.pay').css('display', 'none'); - $('#pay_pwd').css('display', 'block'); - if (data.data.payPwd == '0') { - mui.alert('还未设置支付密码请先设置支付密码!'); - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - } - } - }); - - } else if (payCode == 'alipays') { - pay('alipay', data.data); - // plus.nativeUI.showWaiting(); - // mui.post(hyhUrl('app/Alipays/payment'), { - // orderNo: data.data, - // isBatch: 1 - // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); - - } - } else { - mui.alert(data.msg); //'发生错误请刷新后重试!'); - if (-2 == data.status) { - JZL.openWindow('indent.html', 'waitPay', { - data_href: 'waitPay' - }); - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - }, 500) - } else { - //location.reload(); - } - - //mui.back(); - - } - click = false; - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // //console.log(type) - // //console.log(errorThrown) - //mui.alert(errorThrown); - } - }) - }) - $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - }) - $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { - var payPwd = $('#payPwd').val(); - if (payPwd == '') { - mui.alert('支付密码不能为空!'); - return; - } - var that = $(this); - that.attr('disabled', 'disabled'); - var srcc = '' - if (payCode == 'qlgpay') { - srcc = 'payByQlg'; - } else if (payCode == 'ect') { - srcc = 'payByEct'; - } else { - srcc = 'payByWallet'; - } - JZL.ajax(hyhUrl('app/' + payCode + '/' + srcc), { - orderNo: orderNo, - isBatch: 1, - payPwd: payPwd - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(JSON.stringify(data)); - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - JZL.openWindow('indent.html', 'waitDeliver', { - data_href: 'waitDeliver' - }); - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - }, 700) - - } else { - if (-1 == data.status) { - JZL.openWindow('indent.html', 'waitPay', { - data_href: 'waitPay' - }); - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - }, 700) - } else if (-2 == data.status) { - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - } else if (-3 == data.status) { - - } else if (-4 == data.status) { - JZL.openWindow('indent.html', 'waitDeliver', { - data_href: 'waitDeliver' - }); - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - }, 700) - } - - } - that.removeAttr('disabled'); - }); - }) -}) +//$('.pay_info .row_left').eq(0).html('桔子链账号'); +var wxChannel = null; // 微信支付 +var aliChannel = null; // 支付宝支付 +var channel = null; //支付通道 +mui.init(); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + from_id = self.from?self.from:1 + if(from_id==3){ + $("#selectHelpLevel").show(); + }else{ + $("#selectHelpLevel").hide(); + } + window.addEventListener('setAddress', function(e) { + var addressId = localStorage.getItem('addressId') ? localStorage.getItem('addressId') : 0; + if (addressId == 0) { + return; + } + mui.ajax(hyhUrl('app/useraddress/getById'), { + data: { + addressId: addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + // for(i in data.data){ + // //console.log(i) + // //console.log(data.data[i]) + // } + var html = + '
      收货人:' + + data.userName + '
      ' + data.userPhone + + '
      收货地址:' + data.areaName + ' ' + data.userAddress + '
      '; + $('.address').html(html); + $('.address').attr('data-addressId', data.addressId); + $('.address').attr('data-areaId', data.areaId2); + + } else { + mui.alert(data.msg); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }); + + $('.con').on('tap', '.address', function() { + var addressId = $(this).attr('data-addressId'); + localStorage.setItem('addressId', addressId); + var isOrder = true; + mui.openWindow({ + url: 'setting_address.html', + id: 'setting_address.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_addressId: addressId, + data_isOrder: isOrder + + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }) + //支付插件 + plus.payment.getChannels(function(channels) { + for (var i in channels) { + if (channels[i].id == "wxpay") { + wxChannel = channels[i]; + } else { + aliChannel = channels[i]; + } + } + }, function(e) { + mui.alert("获取支付通道失败:" + e.message); + }); + // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; + var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=1&orderNo='); + // 2. 发起支付请求 + function pay(id, orderNo) { + // 从服务器请求支付订单 + var PAYSERVER = ''; + if (id == 'alipay') { + PAYSERVER = ALIPAYSERVER; + channel = aliChannel; + } else if (id == 'wxpay') { + PAYSERVER = WXPAYSERVER; + channel = wxChannel; + } else { + plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); + return; + } + var xhr = new XMLHttpRequest(); + // var amount = 1; + + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case 4: + if (xhr.status == 200) { + plus.payment.request(channel, xhr.responseText, function(result) { + plus.nativeUI.alert("支付成功!", function() { + // back(); + + }); + }, function(error) { + // plus.nativeUI.alert("支付失败:" + error.code); + plus.webview.getWebviewById('confirmOrder.html').close(); + }); + } else { + mui.alert("获取订单信息失败!"); + ////console.log(xhr.status) + } + break; + default: + break; + } + } + xhr.open('GET', PAYSERVER + orderNo); + xhr.send(); + + } + var self = plus.webview.currentWebview(); + var type = self.type; + var data_1 = {}; + var isUseScore = 0; + var orderNo; + var priceT = 0; + var payCode = ''; + var userCoupon = ''; + var couponIds = []; + var areaId2 = ''; + // //console.log(type) + + mui.ajax(qlgUrl('app/carts/settlement'), { + data: { + type: type, + from: from_id + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data) + var data = toJson(data); + // //console.log(JSON.stringify(data)); + if (data.status == 1) { + var allallnum = 0; + data = data.data; + data_1 = data; + if (data.userAddress.addressId) { + var html = '
      收货人:' + + data.userAddress.userName + '
      ' + data.userAddress.userPhone + + '
      收货地址:' + data.userAddress.areaName + ' ' + data.userAddress.userAddress + + '
      '; + } else { + var html = + '
      请选择收货地址
      '; + } + $.each(data.carts, function() { + var allNum = 0; + html += '
      ' + this.shopName + + '
      '; + $.each(this.list, function() { + allNum += this.cartNum; + var price = ''; + if (this.isWhsle == 1) { + price = this.whslePrice; + } else if (this.specPrice != 'null') { + price = this.shopPrice; + } else { + price = this.specPrice; + } + var specNames = ''; + for (var i in this.specNames[0]) { + if (i == "catName") { + specNames = this.specNames[0][i] + ':'; + } else if (i == "itemName") { + specNames += this.specNames[0][i] + } + } + + html += '

      ' + this.goodsName + '

      '; + $.each(this.specNames, function() { + html += this.catName + ':' + this.itemName + ';'; + }); + + html += '

      ¥' + price + '

      ¥' + this.marketPrice + 'x' + + this.cartNum + '
      ' + }); + allallnum += allNum; + html += + '
      买家留言:
      '; + // if (this.coupons != '') { + // couponName = ''; + // html += + // '
      选择优惠券:
      '; + // } else { + html += ''; + //} + + html += '
      共' + allNum + + '件商品 小计:¥' + this.goodsMoney + ' + 运费:¥' + this.shippingMoney + + '
      '; + }); + html += '
      发货方式:
      '; + // $.each(data.userCoupon, function() { + // html += ''; + // }); + // html += '
      ' + //木吉抵扣 + if (data.is_seckilling == 1 || data.promotion_goods == 1 || data.ect_pay == 1) { + // data.useOrderScore=0; + } else { + // html += '
      木吉抵用    可抵用木吉:' + data.useOrderScore + '
      ' + + } + // html+='
      购买数量
      -+
      ' + // html += '
      木吉
      成交后奖励成交价20%的木吉
      '; + priceT = (Math.floor((+data.goodsTotalMoney - (+data.promotionMoney)) * 100)) / 100; + priceT = priceT >= 0 ? priceT : 0; + var html1 = '共' + allallnum + '件商品 合计:¥' + priceT + + '  '; + // if(data.ect_pay == 1) { + // var htmlpay = '

      ECT余额:' + data.userECT + '

      '; + // + // $('.pay_info .con_1').append(htmlpay); + // // $('.pay_info .con_1 .row').eq(0).attr('style','display: none;'); + // $('.pay_info .con_1 .row').eq(1).remove(); + // }; + $.each(data.payments, function(i, v) { + $.each(v, function() { + $('#pay_way,.pay_info .con_1').append('

      付款方式

      ' + this.payName + '

      '); + }) + }) + $('.con').html(html); + $('.js_r').html(html1); + $('#loginName').html(data.loginName); + $('.userMoney').html(data.userMoney); + + // 助购层级获取 + if(from_id == '3'){ + $("#selectHelpLevel").show(); + JZL.ajax(qlgUrl('app/user_level/TreeList'),{},function(_zgData){ + let _zgHtml = "" + for (let levelId in _zgData) { + let each = _zgData[levelId] + _zgHtml += '
      '+ + '

      '+each.level+'

      ' + } + $("#pay_select_level .con_1").html(_zgHtml) + }) + }else{ + $("#selectHelpLevel").hide(); + } + $('#goodsTotalMoney').html(priceT); + } else { + mui.alert(data.msg); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + //店铺优惠券 + $('.con').on('change', '.yhq_', function() { + userCoupon = $('#userCoupon').val(); + areaId2 = $('.address').attr('data-areaId2'); + couponIds = []; + $('select').each(function() { + couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); + }) + // var addressId = $('.address').attr('data-addressId') + var areaId2 = $('.address').attr('data-areaId2') + var couponIdsArr = couponIds.join(','); + mui.ajax(qlgUrl('app/carts/getMoney'), { + data: { + type: type, + areaId2: areaId2, + isUseScore: isUseScore, + useScore: data_1.useOrderScore, + couponIds: couponIdsArr, + recordId: userCoupon + + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + data = toJson(data); + // //console.log(data.msg) + if (data.status == 1) { + data_1.useOrderScore = data.data.maxScore; + $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); + priceT = data.data.realTotalMoney; + $('.js_r span j').html('¥' + data.data.realTotalMoney) + $('#goodsTotalMoney').html(data.data.realTotalMoney); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }); + //订单优惠券 + $('body').on('change', '#userCoupon,#deliverType', function() { + userCoupon = $('#userCoupon').val(); + areaId2 = $('.address').attr('data-areaId2'); + couponIds = []; + $('select').each(function() { + couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); + }) + // var addressId = $('.address').attr('data-addressId') + var areaId2 = $('.address').attr('data-areaId2') + var couponIdsArr = couponIds.join(','); + mui.ajax(hyhUrl('app/carts/getMoney'), { + data: { + type: type, + deliverType:$('#deliverType').val(), + areaId2: areaId2, + //isUseScore: isUseScore, + useScore: data_1.useOrderScore, + //couponIds: couponIdsArr, + //recordId: userCoupon + + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(JSON.stringify( data)) + data = toJson(data); + // //console.log(data.msg) + if (data.status == 1) { + data_1.useOrderScore = data.data.maxScore; + $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); + $('.js_r span j').html('¥' + data.data.realTotalMoney); + priceT = data.data.realTotalMoney; + $('#goodsTotalMoney').html(data.data.realTotalMoney); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }); + //是否使用木吉 +// $('.con').on('tap', '.checkout', function() { +// userCoupon = $('#userCoupon').val(); +// $(this).toggleClass('on'); +// if ($(this).hasClass('on')) { +// isUseScore = 1; +// } else { +// isUseScore = 0; +// } +// couponIds = []; +// $('select').each(function() { +// couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); +// }) +// couponIdsArr = couponIds.join(','); +// areaId2 = $('.address').attr('data-areaId2'); +// // //console.log(areaId2) +// // //console.log(couponIdsArr) +// // //console.log(data_1.userAddress.areaId2) +// // //console.log(data_1.userAddress) +// +// // //console.log( areaId2) +// // //console.log(isUseScore) +// // //console.log( data_1.useOrderScore) +// // //console.log(couponIdsArr) +// // //console.log(userCoupon); +// mui.ajax(hyhUrl('app/carts/getMoney'), { +// data: { +// type: type, +// areaId2: areaId2, +// isUseScore: isUseScore, +// useScore: data_1.useOrderScore, +// couponIds: couponIdsArr, +// recordId: userCoupon +// +// }, +// dataType: 'json', //服务器返回json格式数据 +// type: 'post', //HTTP请求类型 +// timeout: 10000, //超时时间设置为10秒; +// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; +// +// data = toJson(data); +// +// if (data.status == 1) { +// data_1.useOrderScore = data.data.maxScore; +// $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); +// // //console.log(data) +// // //console.log(data.data.shopFreight) +// // for(i in data.data){ +// // //console.log(i) +// // //console.log(data.data[i]) +// // } +// priceT = data.data.realTotalMoney; +// $('.js_r span j').html('¥' + data.data.realTotalMoney) +// $('#goodsTotalMoney').html(data.data.realTotalMoney); +// } else { +// mui.alert('发生错误请刷新后重试!'); +// // location.reload(); +// } +// }, +// error: function(xhr, type, errorThrown) { //异常处理; +// //alert(errorThrown); +// } +// }); +// }) + $('.footer').on('tap', '.btn_tj', function() { + payCode = $('.select_payway').attr('data-payCode'); + var that = $(this); + if (payCode == 'ect') { + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/ect/getToEctNum'), { + + data: { + total_money: priceT + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + var btnArray = ['是', '否']; + mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { + if (e.index == 1) { + that.removeAttr('disabled'); + return; + + } else { + var addressId = $('.address').attr('data-addressId'); + if (addressId) { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } else { + mui.alert('未设置收货地址!') + } + that.removeAttr('disabled'); + } + }) + } else { + mui.alert(data.msg); + return; + } + + } + }) + } else { + var addressId = $('.address').attr('data-addressId'); + if (addressId) { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } else { + mui.alert('未设置收货地址!') + } + } + + }) + + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.pay').css('display', 'block'); + $('.pay_way').css('display', 'none'); + }) + $('.bg').on('tap', '.mui-icon-closeempty', function() { + $('.bg').css('display', 'none'); + $(".pay").slideUp(300, function() { + + }); + }) + + $('#pay_way').on('tap', '.row', function() { + $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); + $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); + $('.select_payway .row_right o').html($(this).children('.row_left').html()); + $('.select_payway').attr('data-payCode', $(this).attr('data-payCode')) + $('.pay').css('display', 'block'); + $('#pay_way').css('display', 'none'); + + }) + $('.pay').on('tap', '.select_payway', function() { + if ($(this).attr('data-payCode') == 'ect') {} else { + $('.pay').css('display', 'none'); + $('#pay_way').css('display', 'block'); + } + + }) + // 助购层级选择 + $('.pay').on('tap', '#selectHelpLevel', function() { + $("#pay_select_level").show(); + }) + $("#pay_select_level .con_1").on('tap', '.row', function(e){ + $("#pay_select_level").hide(); + $("#displayHelpLevel").text(this.dataset.level_name) + for(var _k in this.dataset){document.getElementById("displayHelpLevel").dataset[_k] = this.dataset[_k]} + }) + var click = false; + $('.pay_btn').on('tap', function() { + + var addressId = $('.address').attr('data-addressId'); + var areaId = $('.address').attr('data-areaId'); + var that = $(this); + payCode = $('.select_payway').attr('data-payCode'); + var data_send = { + type: type, + s_addressId: addressId, + s_areaId: areaId, + payCode: payCode, + payType: 1, + isUseScore: isUseScore, + useScore: data_1.useOrderScore, + deliverType: $('#deliverType').val(), + isInvoice: 0, + invoiceId: 0, + invoiceClient: '', + recordId: userCoupon, + goodsType: from_id, + from: from_id, + } + if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){ + data_send["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"] + } + if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){ + data_send["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"] + } + if(document.getElementById("displayHelpLevel").dataset["level_no"] !== undefined){ + data_send["helpUserLevel"] = document.getElementById("displayHelpLevel").dataset["level_no"] + } + $('.remark').each(function() { + data_send['remark_' + ($(this).attr('data-shopid'))] = $(this).val(); + }); + $('select').each(function() { + data_send['couponId_' + ($(this).attr('data-shopid'))] = $(this).val(); + }) + if (true == click) return; + click = true; + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/orders/submit'), { + data: data_send, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(JSON.stringify(data)) + data = toJson(data); + if (data.status == 1) { + orderNo = data.data; + if (payCode == 'qlgpay') { + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: orderNo, + isBatch: 1 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + // //console.log(JSON.stringify(data)) + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#qlg_pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置操作密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + //return; + } + $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); + $('#productNum').val(data.data.product.useProduct); + if (data.data.product.useProduct > 0) { + var html1 = '

      抵扣额' + data.data.product.useProductOk + + '

      扣税 ' + data.data.product.useProductTaxFee + + '

      手续费 ' + data.data.product.useProductHandlingFee + + '

      '; + $('.productInfo_').html(html1) + // $('#productInfo').html('产品券[抵扣额:'+data.data.product.useProductOk+',扣税:'+data.data.product.useProductTaxFee+',手续费:'+data.data.product.useProductHandlingFee+']'); + } + $('#couponsNum').val(data.data.coupons.useCoupons); + if (data.data.coupons.useCoupons > 0) { + var html2 = '

      抵扣额' + data.data.coupons.useCouponsOk + + '

      扣税 ' + data.data.coupons.useCouponsTaxFee + + '

      手续费 ' + data.data.coupons.useCouponsHandlingFee + + '

      '; + $('.couponsInfo_').html(html2) + // $('#coupousInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + + // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); + } + $('#wangNum').val(data.data.wang.useWang); + $('#moneyNum').val(data.data.money.useMoney); + + } else { + mui.alert(data.msg) + } + }); + //显示支付页面 + } else if (payCode == 'wallets' || payCode == 'ect') { + //跳输入密码的页面 + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: data.data, + isBatch: 1 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置支付密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + } + } + }); + + } else if (payCode == 'alipays') { + pay('alipay', data.data); + // plus.nativeUI.showWaiting(); + // mui.post(hyhUrl('app/Alipays/payment'), { + // orderNo: data.data, + // isBatch: 1 + // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); + + } + } else { + mui.alert(data.msg); //'发生错误请刷新后重试!'); + if (-2 == data.status) { + JZL.openWindow('indent.html', 'waitPay', { + data_href: 'waitPay' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 500) + } else { + //location.reload(); + } + + //mui.back(); + + } + click = false; + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // //console.log(type) + // //console.log(errorThrown) + //mui.alert(errorThrown); + } + }) + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { + var payPwd = $('#payPwd').val(); + if (payPwd == '') { + mui.alert('支付密码不能为空!'); + return; + } + var that = $(this); + that.attr('disabled', 'disabled'); + var srcc = '' + if (payCode == 'qlgpay') { + srcc = 'payByQlg'; + } else if (payCode == 'ect') { + srcc = 'payByEct'; + } else { + srcc = 'payByWallet'; + } + JZL.ajax(hyhUrl('app/' + payCode + '/' + srcc), { + orderNo: orderNo, + isBatch: 1, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + + } else { + if (-1 == data.status) { + JZL.openWindow('indent.html', 'waitPay', { + data_href: 'waitPay' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + } else if (-2 == data.status) { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + } else if (-3 == data.status) { + + } else if (-4 == data.status) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + } + + } + that.removeAttr('disabled'); + }); + }) +}) diff --git a/static/app2/js/cooperative.js b/static/app2/js/cooperative.js old mode 100755 new mode 100644 index dfa3230..de49c37 --- a/static/app2/js/cooperative.js +++ b/static/app2/js/cooperative.js @@ -1,187 +1,187 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - JZL.getItems('auth_company'); - var id = ''; - var count = 0; - $('.header_con_bc').on('tap', function() { - JZL.saveItems('.localinp', 'auth_company'); - mui.toast('保存成功'); - }) - - if ('' == $('#headImg').val()) { - $("#headImgTag").attr("src", "../img/touxiang.jpg") - - } - JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { - isCompany: 1 - }, function(data) { - //console.log(data); - - if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 - count = 1; - $('.mobileCode').hide() - $('.userPhone').hide() - $('.payPwd').show() - id = data.data.id - - //赋值 - ////console.log(data); - mui.each(data.data, function(index, element) { - if ($('#' + index).attr("type") == "hidden") { - // var imgindex = index.substring(0, index.length - 3); - var imgindex = index + 'Tag' - var obj = '#' + imgindex - // //console.log('#' + imgindex + '') - if (imgindex != "") { - if ($(obj).is('img')) { - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index + '').val(element) - } - } - - } else { - $('#' + index).val(element) - } - - - }) - - } else { // 添加 - count = 0 - $('.userPhone').show() - $('.mobileCode').show() - $('.payPwd').hide() - JZL.getItems('auth_company'); - - } - - }) - mui('.mui-content').on('tap', '.yhk', function() { - JZL.openWindow('yhk.html', 'yhk.html'); - - }) - mui('.mui-content').on('tap', '.hhrrz', function() { - JZL.openWindow('hhrrz.html', 'hhrrz.html'); - - }) - - var wait = 120; - - function time() { - if (wait == 0) { - $('.HQYZM').removeAttr("disabled"); - $('.HQYZM').val("重新发送"); - wait = 120; - } else { - $('.HQYZM').attr("disabled", true); - $('.HQYZM').css("background", "#c0a0a0"); - $('.HQYZM').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - //获取验证码 - mui('.mui-table-view-cell').on('tap', '.HQYZM', function() { - var userPhone = $('.indiv-tel').val(); - // if (userPhone == '') { - // mui.alert('手机号不能为空!'); - // return; - // } - // 判断手机号码格式 - // if (!( - // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - // .test(userPhone))) { - // mui.alert("手机号码有误,请重填!"); - // return; - // } - // $(".HQYZM").attr("disabled", true); - JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { - userPhone: userPhone - }, function(data) { - //console.log(data); - if (1 == data.status) { - time(); - } - mui.toast(data.msg); - }) - - - }) - - // 上传头像 - $("#headerimg").on("tap", '#headImgTag', function() { - UP.init("headImg", "test", "headImgTag") - openCamera(); - }) - - $('.bc_btn').on('tap', function() { - - - var params = JZL.getParams(".inp"); - if ('' == params.trueName) { - mui.alert("请输入直营人姓名"); - return; - - } - if ('' == params.idCard) { - mui.alert("请输入身份证号"); - return; - - } - if ('' == params.companyName) { - mui.alert("请输入合作名称"); - return; - } - if ('' == params.companyAddress) { - mui.alert("请输入地址"); - return; - } - - - if ('' == params.companyName) { - mui.alert("请输入合作名称"); - return; - } - if (0 == count) { //添加 - if ('' == $('#mobileCode').val()) { - mui.alert("请输入验证码"); - return; - } - params.mobileCode = $('#mobileCode').val(); - - } else if (1 == count) { //编辑 - if ('' == $('#payPwd').val()) { - mui.alert("请输入操作密码"); - return; - } - params.authId = id; - params.payPwd = $('#payPwd').val(); - } - params.isCompany = 1 - JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { - //console.log(data); - if (data.status == 1) { - JZL.saveItems('.localinp', 'auth_company'); - localStorage.setItem("authType","2") - mui.toast("提交成功 请等待审核") - // $(".mui-table-view").attr("readonly", "readonly") - $(".mobileCode").hide() - $('.userPhone').hide() - mui.back(); - } else { - mui.alert(data.msg); - } - - }) - }) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + JZL.getItems('auth_company'); + var id = ''; + var count = 0; + $('.header_con_bc').on('tap', function() { + JZL.saveItems('.localinp', 'auth_company'); + mui.toast('保存成功'); + }) + + if ('' == $('#headImg').val()) { + $("#headImgTag").attr("src", "../img/touxiang.jpg") + + } + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { + isCompany: 1 + }, function(data) { + //console.log(data); + + if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 + count = 1; + $('.mobileCode').hide() + $('.userPhone').hide() + $('.payPwd').show() + id = data.data.id + + //赋值 + ////console.log(data); + mui.each(data.data, function(index, element) { + if ($('#' + index).attr("type") == "hidden") { + // var imgindex = index.substring(0, index.length - 3); + var imgindex = index + 'Tag' + var obj = '#' + imgindex + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else { + $('#' + index).val(element) + } + + + }) + + } else { // 添加 + count = 0 + $('.userPhone').show() + $('.mobileCode').show() + $('.payPwd').hide() + JZL.getItems('auth_company'); + + } + + }) + mui('.mui-content').on('tap', '.yhk', function() { + JZL.openWindow('yhk.html', 'yhk.html'); + + }) + mui('.mui-content').on('tap', '.hhrrz', function() { + JZL.openWindow('hhrrz.html', 'hhrrz.html'); + + }) + + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').css("background", "#c0a0a0"); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + //获取验证码 + mui('.mui-table-view-cell').on('tap', '.HQYZM', function() { + var userPhone = $('.indiv-tel').val(); + // if (userPhone == '') { + // mui.alert('手机号不能为空!'); + // return; + // } + // 判断手机号码格式 + // if (!( + // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + // .test(userPhone))) { + // mui.alert("手机号码有误,请重填!"); + // return; + // } + // $(".HQYZM").attr("disabled", true); + JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { + userPhone: userPhone + }, function(data) { + //console.log(data); + if (1 == data.status) { + time(); + } + mui.toast(data.msg); + }) + + + }) + + // 上传头像 + $("#headerimg").on("tap", '#headImgTag', function() { + UP.init("headImg", "test", "headImgTag") + openCamera(); + }) + + $('.bc_btn').on('tap', function() { + + + var params = JZL.getParams(".inp"); + if ('' == params.trueName) { + mui.alert("请输入直营人姓名"); + return; + + } + if ('' == params.idCard) { + mui.alert("请输入身份证号"); + return; + + } + if ('' == params.companyName) { + mui.alert("请输入合作名称"); + return; + } + if ('' == params.companyAddress) { + mui.alert("请输入地址"); + return; + } + + + if ('' == params.companyName) { + mui.alert("请输入合作名称"); + return; + } + if (0 == count) { //添加 + if ('' == $('#mobileCode').val()) { + mui.alert("请输入验证码"); + return; + } + params.mobileCode = $('#mobileCode').val(); + + } else if (1 == count) { //编辑 + if ('' == $('#payPwd').val()) { + mui.alert("请输入操作密码"); + return; + } + params.authId = id; + params.payPwd = $('#payPwd').val(); + } + params.isCompany = 1 + JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { + //console.log(data); + if (data.status == 1) { + JZL.saveItems('.localinp', 'auth_company'); + localStorage.setItem("authType","2") + mui.toast("提交成功 请等待审核") + // $(".mui-table-view").attr("readonly", "readonly") + $(".mobileCode").hide() + $('.userPhone').hide() + mui.back(); + } else { + mui.alert(data.msg); + } + + }) + }) }) diff --git a/static/app2/js/details.js b/static/app2/js/details.js old mode 100755 new mode 100644 index aac8373..77a6bfd --- a/static/app2/js/details.js +++ b/static/app2/js/details.js @@ -1,874 +1,888 @@ -var data = ''; -var data_saleSpec = {} -var arry_str = ''; -var data_bak = {}; -var shopQQ = ''; -var shopTle = ''; -var shopName=''; -var isDefaultArr = []; -var token = localStorage.getItem('token'); -var isShowWhsle = 0; -var seckilling_end_time = '' -var shareImgThumbs = []; -var shares = null; -var img_data=''; -var Intent = null, - File = null, - Uri = null, - main = null; - -//点击遮罩关闭 -$('.cclass_con').before('
      ') -$('.header_con').append(''); -function getNextDate(dayStr) { - var dd = new Date(dayStr); - dd.setDate(dd.getDate() + 1); - var y = dd.getFullYear(); - var m = dd.getMonth() + 1; //获取当前月份的日期 - var d = dd.getDate(); - return y + "/" + m + "/" + d + " 00:00:00"; -}; -//倒计时 -function countTime() { - - //获取当前时间 - var date = new Date(); - var now = date.getTime(); - //设置截止时间 - var endDate = new Date(getNextDate(seckilling_end_time * 1000)); - var end = endDate.getTime(); - //时间差 - var leftTime = seckilling_end_time * 1000 - now; - //定义变量 d,h,m,s保存倒计时的时间 - var d, h, m, s; - if(leftTime >= 0) { - d = Math.floor(leftTime / 1000 / 60 / 60 / 24); - h = Math.floor(leftTime / 1000 / 60 / 60); - m = Math.floor(leftTime / 1000 / 60 % 60); - s = Math.floor(leftTime / 1000 % 60); - //将倒计时赋值到div中 - if(d < 10) { - d = "0" + d; - } - if(h < 10) { - h = "0" + h; - } - if(m < 10) { - m = "0" + m; - } - if(s < 10) { - s = "0" + s; - } - // $("#_d").html(d); - $("#_h").html(h); - $("#_m").html(m); - $("#_s").html(s); - } - - //递归每秒调用countTime方法,显示动态时间效果 - setTimeout(countTime, 1000); - -} - - //秒杀限购四件 - var xg = ''; - $('.miaosha').append(xg); -//秒杀规格选择 -function miaoshaSaleSpec(specId, SaleSpec) { - for(i in SaleSpec) { - if(SaleSpec[i].id == specId) { - var data_sArry = i.split(':'); - var data_s = SaleSpec[i]; - arry_str = i; - isDefaultArr = i.split(':'); - $.each(data_sArry, function() { - var that = this; - $('.cclass1 .block').each(function() { - if($(this).attr('data-itemId') == that) { - $(this).addClass('on'); - $(this).parent().attr('data-class', that); - } - - }) - - }) - seckilling_end_time = data_s.seckilling_end_time; - html_miaosha = '

      ' + data_s.specPrice + '

      ¥' + data_s.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; - $('.miaosha').html(html_miaosha); - $('.cclass_con .cc2 p').html(data_s.specPrice); - $('.miaosha').css('display', 'block'); - $('.price').css('display', 'none'); - $('.price_old').css('display', 'none'); - countTime(); - $('.mujidikou').css('display', 'none'); - - } - } - -} -// H5 plus事件处理 -function plusReady() { - updateSerivces(); - if(plus.os.name == "Android") { - main = plus.android.runtimeMainActivity(); - Intent = plus.android.importClass("android.content.Intent"); - File = plus.android.importClass("java.io.File"); - Uri = plus.android.importClass("android.net.Uri"); - } -} -if(window.plus) { - plusReady(); -} else { - document.addEventListener("plusready", plusReady, false); -} - -/** - * - * 更新分享服务 - */ -function updateSerivces() { - plus.share.getServices(function(s) { - shares = {}; - for(var i in s) { - var t = s[i]; - shares[t.id] = t; - } - }, function(e) { - plus.nativeUI.toast("获取分享服务列表失败:" + e.message); - }); -} - -/** - * 分享操作 - * @param {JSON} sb 分享操作对象s.s为分享通道对象(plus.share.ShareService) - * @param {Boolean} bh 是否分享链接 - */ -function shareAction(sb, bh) { - if(!sb || !sb.s) { - plus.nativeUI.toast("无效的分享服务!"); - return; - } - - var msg = { - content: sharehrefDes.value, - extra: { - scene: sb.x - }, - type: "web" - }; - if(bh) { - msg.href = sharehref.value; - if(sharehrefTitle && sharehrefTitle.value != "") { - msg.title = sharehrefTitle.value; - } - if(sharehrefDes && sharehrefDes.value != "") { - msg.content = sharehrefDes.value; - } - // msg.thumbs = ["_www/logo.png"]; - msg.thumbs = $('.swiper-slide img').eq(0).attr('src') ? [$('.swiper-slide img').eq(0).attr('src') + '/thumb60'] : ["_www/logo.png"]; - - msg.pictures = ["_www/logo.png"]; - } else { - if(pic && pic.realUrl) { - msg.pictures = [pic.realUrl]; - } - } - // 发送分享 - if(sb.s.authenticated) { - // plus.nativeUI.toast("---已授权---"); - shareMessage(msg, sb.s); - } else { - plus.nativeUI.toast("---未授权---"); - sb.s.authorize(function() { - shareMessage(msg, sb.s); - }, function(e) { - plus.nativeUI.toast("认证授权失败:" + e.code + " - " + e.message); - - }); - } -} -/** - * 发送分享消息 - * @param {JSON} msg - * @param {plus.share.ShareService} s - */ -function shareMessage(msg, s) { - - // plus.nativeUI.toast(JSON.stringify(msg)); - s.send(msg, function() { - plus.nativeUI.toast("分享到\"" + s.description + "\"成功! "); - - }, function(e) { - plus.nativeUI.toast("分享到\"" + s.description + "\"失败 "); - - }); -} -// 分析链接 -function shareHref() { - var shareBts = []; - // 更新分享列表 - var ss = shares['weixin']; - ss && ss.nativeClient && (shareBts.push({ - title: '微信朋友圈', - s: ss, - x: 'WXSceneTimeline' - }), - shareBts.push({ - title: '微信好友', - s: ss, - x: 'WXSceneSession' - })); - - // 弹出分享列表 - shareBts.length > 0 ? plus.nativeUI.actionSheet({ - title: '分享注册链接', - cancel: '取消', - buttons: shareBts - }, function(e) { - (e.index > 0) && shareAction(shareBts[e.index - 1], true); - }) : plus.nativeUI.plus.nativeUI.toast('当前环境无法支持分享链接操作!'); -} - -function whslePrice(num, arry_str) { - for(var i in data_saleSpec) { - if(i == arry_str) { - // if(num >= (+(data_saleSpec[i].initNum)) && data_saleSpec[i].whslePrice > 0) { - if(isShowWhsle == 1 && data_saleSpec[i].whslePrice > 0) { - $('.cclass_con .cc2 o').html('批发单价:¥' + data_saleSpec[i].whslePrice); - $('.cclass_con .cc2 l').html('起批数:' + data_saleSpec[i].initNum + '件'); - } - } - } - for(var i in data_saleSpec) { - if(i == arry_str) { - $('.cclass_con .cc2 p').html('¥' + data_saleSpec[i].specPrice); - } - } -} -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var goodsType; - if (self.goodsType) { - goodsType=self.goodsType; - } - var goodsId = self.data_id; - var isEct = self.isEct; - var isMiaosha = self.isMiaosha; - var MiaoshaSaleSpec = self.MiaoshaSaleSpec; - var specsId = ''; -// //console.log(isMiaosha) - // isMiaosha = 1; - // MiaoshaSaleSpec = '0'; -// console.log(goodsId) - - // mui.ajax(hyhUrl('app/Goods/detail'), { - mui.ajax(qlgUrl('app/Goods/detail'), { - data: { - goodsId: goodsId - // goodsId: 1206 - // goodsId: 1203 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // console.log(data) - var data = toJson(data); - // console.log(data.status) - if(data.status == 1) { - // mui.alert('加载失败请重试!'); - - data = data.data; - data_bak = data; - shopQQ = data.shop.shopQQ; - shopTel = data.shop.phone; - var isEct = data.isEct; - shopName = data.shop.shopName; - // if(!shopQQ && shopTel) { - $('#lxkf').html('

      客服

      ') - // } - if(1 == data.isFavorites){ - $('#scbtn img').attr('src','../img/likelogo1.png') - $('#scbtn p').html("已收藏") - } - var html = '

      ECT专享价¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; - } else { - html += '

      ¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; - } - - // var str1 = '

      到手价¥' + Math.round(data.shopPrice * 0.8 * 100) / 100 + '

      ' - - html += '

      ' + data.goodsName + '

      '; - if(data.goodsTips) { - html += '

      ' + data.goodsTips + '

      '; - } - if(data.isFreeShipping == '1') { - html += '
      免运费'; - } else { - //html += '
      不包邮'; - html += '
      运费'+data.freight; - } - html += '月销:' + data.saleNum + '件
      ' - - html += '
      领取优惠券
      ';//
      木吉购买后可获得成交价格20%木吉
      - if(isEct != 1) { - //html += '
      木吉本商品可用木吉抵扣20%
      ' - } else {} - if(data.promotionList != '') { -// html += '
      促销信息 :' + data.promotionList.rewardTitle + '
      '; -// $.each(data.promotionList.json, function() { -// html += '

      满' + this.orderMoney + '元

      '; -// -// if(this.favourableJson.chk0 == true) { -// html += '
      减' + this.favourableJson.chk0val + '元
      '; -// } -// if(this.favourableJson.chk1 == true) { -// html += '
      送' + this.favourableJson.chk1val.text + '
      '; -// } -// if(this.favourableJson.chk2 == true) { -// html += '
      免运费
      '; -// } -// if(this.favourableJson.chk3 == true) { -// html += '
      送满' + this.favourableJson.chk3val.text + '元优惠券 满' + this.favourableJson.chk3val.data.useMoney + '元使用
      '; -// } -// -// }); -// -// html += '
      '; - } - var showShopMsg = '正品保证 '; - // if(1778 == data.shopId){ - // showShopMsg+='此商品拆封概不退货换'; - // showShopMsg+='温馨提示:不支持7天无理由退货'; - // - // } - html += '
      '+showShopMsg+'
      选择颜色分类 号码尺寸
      '; - if(data.oneAppraises == '') { - - } else { - var userImg = ''; - if(data.oneAppraises.userPhoto) { - userImg = hyhImgUrl(data.oneAppraises.userPhoto); - } else { - userImg = '../img/mujiimg.png' - } - - html += '

      商品评价(' + data.appraiseNum + ')

      ' + data.oneAppraises.loginName + '

      ' + data.oneAppraises.content + '
      ' + data.oneAppraises.goodsSpecNames + '
      查看全部评价
      '; - } - - img_data = data.goodsDesc.replace(/src=\"__ROOT__\//g, 'data-src="').replace(/data-echo=\"__ROOT__\//g, 'src="' + hyhImgUrl('')).replace(/src=\"\//g, 'src="' + hyhImgUrl('')); - img_data = img_data.replace(/src=\"http\:\/\/img.heyuanhui.cn\//g,'src="' + hyhImgUrl('')); - ////console.log(img_data) - html += '

      ' + data.shop.shopName + '

      ' + data.goodsCount + '
      全部宝贝
      ' + data.newGoodsCount + '
      上新宝贝
      ' + data.favoritesShopsNum + '
      关注人数
      宝贝描述 ' + data.shop.goodsScore + '
      卖家服务 ' + data.shop.serviceScore + '
      物流服务 ' + data.shop.timeScore + '
      '; - $('.con_').html(html); - - $('.cclass_con .img').html(''); - $('.cclass_con .cc2 p').html('¥' + data.shopPrice); - $('.cclass_con .cc2 span').html('库存' + data.goodsStock + '件'); - if(data.showWhsle == 1) { - isShowWhsle = 1; - } - $('#storebtn').attr('data-shopId', data.shopId); - $('.swiper-slide img').height($('.swiper-slide img').width()); - $('.swiper-slide').height($('.swiper-slide').width()); - //$('.swiper-slide').height($('.swiper-slide').width() * 460 / 750); - //$('.swiper-slide img').height($('.swiper-slide img').width() * 460 / 750); - - // $('.banner').height($('.banner').width()); - var swiper = new Swiper('.swiper-container', { - pagination: '.swiper-pagination', - paginationClickable: true, - spaceBetween: 30, - autoplay: 3000 - }); - var html1 = ''; - // var html1 = '
      '; - $.each(data.spec, function() { - html1 += '

      ' + this.name + '

      ' - $.each(this.list, function() { - // //console.log(this.itemId) - html1 += '
      ' + this.itemName + '
      ' - }); - html1 += '
      ' - }); - // html1+='
      ' - $('.ccclass').html(html1); - // var hahaha = mui('#hahaha').scroll(); - // $('.ccclass').height($('#hahaha').height()) - for(var i in data.saleSpec) { - data_saleSpec[i] = data.saleSpec[i]; - // if(data.saleSpec[i]["id"] == MiaoshaSaleSpec) { - // specsId = i - // arry_str = i; - // isDefaultArr = i.split(':'); - // } - if(data.saleSpec[i]["isDefault"] == 1) { - isDefaultArr = i.split(':'); - arry_str = i; - } - - } - if(data.couponList == '') { - $('.yyyhhhqqq').css('display', 'none'); - } else { - $.each(data.couponList, function() { - html2 += '

      ¥' + this.couponValue + '

      满' + this.useMoney + '元使用
      '; - }); - $('.yhqcon').html(html2); - } - - // if(isMiaosha == 1 || (data.is_seckilling&&data.is_seckilling == 1)||(data_saleSpec[arry_str].is_seckilling&&data_saleSpec[arry_str].is_seckilling==1)) { - var html_miaosha = '' - if(data.is_seckilling && data.is_seckilling == '1') { - $('.mujidikou').css('display', 'none'); - seckilling_end_time = data.seckilling_end_time; - html_miaosha = '

      ' + data.shopPrice + '

      ¥' + data.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; - - $('.miaosha').html(html_miaosha); - $('.miaosha').css('display', 'block'); - $('.price').css('display', 'none'); - $('.price_old').css('display', 'none'); - countTime(); - } else if(data_saleSpec[arry_str] && data_saleSpec[arry_str].is_seckilling && data_saleSpec[arry_str].is_seckilling == 1) { - miaoshaSaleSpec(data_saleSpec[arry_str].id, data_saleSpec); - } else if(isMiaosha == 1) { - miaoshaSaleSpec(MiaoshaSaleSpec, data_saleSpec); - } - // } - else { - $.each(isDefaultArr, function() { - var that = this; - $('.cclass1 .block').each(function() { - - if($(this).attr('data-itemId') == that) { - $(this).addClass('on'); - $(this).parent().attr('data-class', that); - } - - }) - - }) - } - } else if(data.status == -22) { - alert(data.msg); - mui.back(); - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - //console.log(errorThrown); - } - }); - var scroll = mui('.mui-scroll-wrapper').scroll({ - //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 - deceleration: 0.002 - }); - var show_img=false; - //导航栏渐变 - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - var num; - if(scroll.y >= -387 && scroll.y < 0) { - - num = scroll.y / -387; - // //console.log('渐变',num) - $('.header1').css({ - 'display': 'block', - 'opacity': num - }) - if(false == show_img){ - show_img=true; - $('.imgcon').html(img_data); - } - var num1 = 0.2 - num * 0.2; - } else if(scroll.y >= 0) { - num = 0; - // //console.log('透明',num) - $('.header1').css({ - 'display': 'none', - 'opacity': num - }) - } else if(scroll.y < -387) { - - num = 1; - // //console.log('不透明',num) - $('.header1').css({ - 'display': 'block', - 'opacity': num - }) - } - //导航栏自动切换 - if($('.imgcon').offset().top >= 66) { - $('#nav1').addClass("on").siblings().removeClass('on'); - } else if($('.imgcon').offset().top < 66) { - $('#nav3').addClass("on").siblings().removeClass('on'); - } - }) - - mui('.header').on('tap', '.icon-cart', function() { - JZL.openWindow('shoppingcart.html','shoppingcart.html'); - }); - //点击导航栏跳转 - mui('.nav').on('tap', '#nav1', function() { - mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); - $('#nav1').addClass("on").siblings().removeClass('on'); - }); - mui('.nav').on('tap', '#nav2', function() { - JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); - }); - mui('.nav').on('tap', '#nav3', function() { - mui('.mui-scroll-wrapper').scroll().scrollTo(0, -1124, 100); - $('#nav3').addClass("on").siblings().removeClass('on'); - }); - - mui('.con_').on('tap', '#changeclass', function() { - $('#changeclass_con').show(); - }) - - //选择类型 - mui('.ccclass').on('tap', '.block', function() { - $(this).addClass('on').siblings().removeClass('on'); - $(this).parent().attr('data-class', $(this).attr('data-itemId')); - - var data_itemId = $(this).attr('data-itemId'); - if($(this).attr('data-itemImg') != '') { - $('.cclass_con .img').html(''); - } - - var arry = []; - - $.each($('.cclass1'), function() { - arry.push($(this).attr('data-class')) - }); - arry.sort(function(a, b) { - return a - b; - }); - - arry_str = arry.join(':'); - - for(var i in data_saleSpec) { - if(i == arry_str) { - $('.cclass_con .cc2 p').html(data_saleSpec[i].specPrice); - $('.cclass_con .cc2 span').html('库存' + data_saleSpec[i].specStock + '件'); - - if(data_saleSpec[i].is_seckilling && data_saleSpec[i].is_seckilling == 1) { - miaoshaSaleSpec(data_saleSpec[i].id, data_saleSpec); - } else { - - $('.miaosha').html(''); - $('.miaosha').css('display', 'none'); - $('.price').html('¥' + data_saleSpec[i].specPrice); - $('.price_old').html('市场价 ¥' + data_saleSpec[i].marketPrice + ''); - $('.price').css('display', 'block'); - $('.price_old').css('display', 'block'); - } - } - } - - var num = +$('.change_num input').val(); - whslePrice(num, arry_str); - - }) - //跳转选择类型 - - $('.footer').on('tap', '.btn_ljgm', function() { - $('#changeclass_con').show(); - }) - //关闭 - mui('.cc2').on('tap', '.closecclass', function() { - $('#changeclass_con').hide(); - }) - - mui('.en').on('tap', '.engwc', function() { - $('#changeclass_con').hide(); - }) - - //改变数量 - mui('.change_num').on('tap', '.jia', function() { - // //console.log($(this).siblings('input').val()) - var num = +$(this).siblings('input').val() + 1; - if(num <= 0) { - alert('购买数最小为1!'); - return; - } - $(this).siblings('input').val(num); - whslePrice(num, arry_str) - }) - mui('.change_num').on('tap', '.jian', function() { - var num = +$(this).siblings('input').val() - 1; - if(num <= 0) { - alert('购买数最小为1!'); - return; - } - $(this).siblings('input').val(num); - whslePrice(num, arry_str) - }) - $('.change_num input').on('change', function() { - var num = +$(this).val(); - - whslePrice(num, arry_str); - }) - - mui('.mui-backdrop').on('tap', '.mask', function() { - $('#changeclass_con').hide(); - }) - //加入购物车&购买 - mui('.en').on('tap', '.enarr', function() { - - var that = $(this); - // var goodsId = goodsId; - var buyNum = $('.change_num input').val(); - var isGoodsSpecId = 0; - var goodsSpecId = 0; - var url = ''; - if($(this).hasClass('engwc')) { - url = 'addCart'; - } else if($(this).hasClass('ensure')) { - url = 'buy'; - } - // //console.log(data_bak.isSpec) - for(var i in data_saleSpec) { - if(i == arry_str) { - isGoodsSpecId = 1; - goodsSpecId = data_saleSpec[i].id; - } - } - if(isGoodsSpecId == 1) { - // goodsSpecId = arry_str; - } else if(data_bak.isSpec == 0) { - goodsSpecId = 0; - } else { - alert('请选择商品分类!'); - return - } - if(goodsType==2 & $(this).hasClass('engwc')) { - mui.alert ("助微吧商品不能加入购物车") - return; - } - // //console.log(arry_str) - // //console.log(goodsSpecId) - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/carts/' + url), { - headers: { - "HYH-Token": token - }, - data: { - if(goodsType){ - goodsType:goodsType - }, - goodsId: goodsId, - buyNum: buyNum, - goodsSpecId: goodsSpecId - - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - data = toJson(data); - // //console.log(data.msg); - // //console.log(data.status); - if(data.status == 1) { - if(url == 'buy') { - mui.openWindow({ - url: 'confirmOrder.html', - id: 'confirmOrder.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // goodsId: goodsId - - type: 1 - - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } else if(url == 'addCart') { - mui.alert('添加购物车成功!') - } - - } else { - mui.alert(data.msg); - //location.reload(); - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // alert(type); - } - }); - - }) - - //打开评价列表 - mui('.con_').on('tap', '.pjrk', function() { - JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); - }) - $('.footer').on('tap', '#scbtn', function() { - var goodId = goodsId; - var that = $(this); - if($('#scbtn p').html() == '收藏') { - mui.ajax(qlgUrl('app/Favorites/add'), { - - data: { - id: goodId, - type : 0 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if(data.status == 1) { - $('#scbtn p').html('已收藏'); - $('#scbtn p').css('color', '#E41F4A'); - $('#scbtn img').attr('src', '../img/likelogo1.png'); - // that.addClass('gz_btn1').removeClass('gz_btn'); - } else { - mui.alert(data.msg) - ////console.log(data.status) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // alert(type); - } - }); - } else { - mui.ajax(hyhUrl('app/Favorites/cancel'), { - - data: { - id: goodId, - type : 0 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if(data.status == 1) { - $('#scbtn p').html('收藏'); - $('#scbtn p').css('color', '#8f8f94'); - $('#scbtn img').attr('src', '../img/likelogo.png'); - // that.addClass('gz_btn1').removeClass('gz_btn'); - } else { - mui.alert(data.msg) - ////console.log(data.status) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // alert(type); - } - }); - } - - }) - $('.footer').on('tap', '#storebtn', function() { - var shopId = this.attributes["data-shopId"].nodeValue; - JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId,shopName:shopName}); - }) - $('.con').on('tap', '.shop_title p', function() { - var shopId = this.attributes["data-shopId"].nodeValue; - JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId}); - }) - //弹出优惠券 - $('.con_').on('tap', '.lq', function() { - $('#youhuiquan_con').css('display', 'block'); - }) - //关闭优惠券 - $('#youhuiquan_con').on('tap', '.thq_close', function() { - $('#youhuiquan_con').css('display', 'none'); - }) - //领取优惠券 - $('#youhuiquan_con').on('tap', '.lq_btn', function() { - var couponId = $(this).attr('data-couponId'); - mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { - headers: { - "HYH-Token": token - }, - data: { - couponId: couponId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - var data = toJson(data); - alert(data.msg); - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // alert(type); - } - }); - }) - //联系客服 - - $('#lxkf').on('tap', function() { - if(shopQQ) { - // location.href="http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes"; - // mui.back(); - // window.open("http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes") - if(plus.os.name == "iOS") { - plus.runtime.launchApplication({ - action: "mqq://im/chat?chat_type=wpa&uin=" + shopQQ + "&version=1&src_type=web" - }, function(e) { - plus.nativeUI.confirm("检查到您未安装qq,请先到appstore搜索下载?", function(i) { - if(i.index == 0) { - iosAppstore("itunes.apple.com/cn/app/mqq/"); - } - }); - }); - } else if(plus.os.name == "Android") { - var Intent = plus.android.importClass('android.content.Intent'); - var Uri = plus.android.importClass('android.net.Uri'); - var main = plus.android.runtimeMainActivity(); - var uri = Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin=" + shopQQ); - main.startActivity(new Intent(Intent.ACTION_VIEW, uri)); - } - } - }) - //分享 - $('.con_').on('tap', '#share', function() { - shareHref(); - }) - - - -}) -// var self = plus.webview.currentWebview(); +var data = ''; +var data_saleSpec = {} +var arry_str = ''; +var data_bak = {}; +var shopQQ = ''; +var shopTle = ''; +var shopName=''; +var isDefaultArr = []; +var token = localStorage.getItem('token'); +var isShowWhsle = 0; +var seckilling_end_time = '' +var shareImgThumbs = []; +var shares = null; +var img_data=''; +var Intent = null, + File = null, + Uri = null, + main = null; + +//点击遮罩关闭 +$('.cclass_con').before('
      ') +$('.header_con').append(''); +function getNextDate(dayStr) { + var dd = new Date(dayStr); + dd.setDate(dd.getDate() + 1); + var y = dd.getFullYear(); + var m = dd.getMonth() + 1; //获取当前月份的日期 + var d = dd.getDate(); + return y + "/" + m + "/" + d + " 00:00:00"; +}; +//倒计时 +function countTime() { + + //获取当前时间 + var date = new Date(); + var now = date.getTime(); + //设置截止时间 + var endDate = new Date(getNextDate(seckilling_end_time * 1000)); + var end = endDate.getTime(); + //时间差 + var leftTime = seckilling_end_time * 1000 - now; + //定义变量 d,h,m,s保存倒计时的时间 + var d, h, m, s; + if(leftTime >= 0) { + d = Math.floor(leftTime / 1000 / 60 / 60 / 24); + h = Math.floor(leftTime / 1000 / 60 / 60); + m = Math.floor(leftTime / 1000 / 60 % 60); + s = Math.floor(leftTime / 1000 % 60); + //将倒计时赋值到div中 + if(d < 10) { + d = "0" + d; + } + if(h < 10) { + h = "0" + h; + } + if(m < 10) { + m = "0" + m; + } + if(s < 10) { + s = "0" + s; + } + // $("#_d").html(d); + $("#_h").html(h); + $("#_m").html(m); + $("#_s").html(s); + } + + //递归每秒调用countTime方法,显示动态时间效果 + setTimeout(countTime, 1000); + +} + + //秒杀限购四件 + var xg = ''; + $('.miaosha').append(xg); +//秒杀规格选择 +function miaoshaSaleSpec(specId, SaleSpec) { + for(i in SaleSpec) { + if(SaleSpec[i].id == specId) { + var data_sArry = i.split(':'); + var data_s = SaleSpec[i]; + arry_str = i; + isDefaultArr = i.split(':'); + $.each(data_sArry, function() { + var that = this; + $('.cclass1 .block').each(function() { + if($(this).attr('data-itemId') == that) { + $(this).addClass('on'); + $(this).parent().attr('data-class', that); + } + + }) + + }) + seckilling_end_time = data_s.seckilling_end_time; + html_miaosha = '

      ' + data_s.specPrice + '

      ¥' + data_s.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; + $('.miaosha').html(html_miaosha); + $('.cclass_con .cc2 p').html(data_s.specPrice); + $('.miaosha').css('display', 'block'); + $('.price').css('display', 'none'); + $('.price_old').css('display', 'none'); + countTime(); + $('.mujidikou').css('display', 'none'); + + } + } + +} +// H5 plus事件处理 +function plusReady() { + updateSerivces(); + if(plus.os.name == "Android") { + main = plus.android.runtimeMainActivity(); + Intent = plus.android.importClass("android.content.Intent"); + File = plus.android.importClass("java.io.File"); + Uri = plus.android.importClass("android.net.Uri"); + } +} +if(window.plus) { + plusReady(); +} else { + document.addEventListener("plusready", plusReady, false); +} + +/** + * + * 更新分享服务 + */ +function updateSerivces() { + plus.share.getServices(function(s) { + shares = {}; + for(var i in s) { + var t = s[i]; + shares[t.id] = t; + } + }, function(e) { + plus.nativeUI.toast("获取分享服务列表失败:" + e.message); + }); +} + +/** + * 分享操作 + * @param {JSON} sb 分享操作对象s.s为分享通道对象(plus.share.ShareService) + * @param {Boolean} bh 是否分享链接 + */ +function shareAction(sb, bh) { + if(!sb || !sb.s) { + plus.nativeUI.toast("无效的分享服务!"); + return; + } + + var msg = { + content: sharehrefDes.value, + extra: { + scene: sb.x + }, + type: "web" + }; + if(bh) { + msg.href = sharehref.value; + if(sharehrefTitle && sharehrefTitle.value != "") { + msg.title = sharehrefTitle.value; + } + if(sharehrefDes && sharehrefDes.value != "") { + msg.content = sharehrefDes.value; + } + // msg.thumbs = ["_www/logo.png"]; + msg.thumbs = $('.swiper-slide img').eq(0).attr('src') ? [$('.swiper-slide img').eq(0).attr('src') + '/thumb60'] : ["_www/logo.png"]; + + msg.pictures = ["_www/logo.png"]; + } else { + if(pic && pic.realUrl) { + msg.pictures = [pic.realUrl]; + } + } + // 发送分享 + if(sb.s.authenticated) { + // plus.nativeUI.toast("---已授权---"); + shareMessage(msg, sb.s); + } else { + plus.nativeUI.toast("---未授权---"); + sb.s.authorize(function() { + shareMessage(msg, sb.s); + }, function(e) { + plus.nativeUI.toast("认证授权失败:" + e.code + " - " + e.message); + + }); + } +} +/** + * 发送分享消息 + * @param {JSON} msg + * @param {plus.share.ShareService} s + */ +function shareMessage(msg, s) { + + // plus.nativeUI.toast(JSON.stringify(msg)); + s.send(msg, function() { + plus.nativeUI.toast("分享到\"" + s.description + "\"成功! "); + + }, function(e) { + plus.nativeUI.toast("分享到\"" + s.description + "\"失败 "); + + }); +} +// 分析链接 +function shareHref() { + var shareBts = []; + // 更新分享列表 + var ss = shares['weixin']; + ss && ss.nativeClient && (shareBts.push({ + title: '微信朋友圈', + s: ss, + x: 'WXSceneTimeline' + }), + shareBts.push({ + title: '微信好友', + s: ss, + x: 'WXSceneSession' + })); + + // 弹出分享列表 + shareBts.length > 0 ? plus.nativeUI.actionSheet({ + title: '分享注册链接', + cancel: '取消', + buttons: shareBts + }, function(e) { + (e.index > 0) && shareAction(shareBts[e.index - 1], true); + }) : plus.nativeUI.plus.nativeUI.toast('当前环境无法支持分享链接操作!'); +} + +function whslePrice(num, arry_str) { + for(var i in data_saleSpec) { + if(i == arry_str) { + // if(num >= (+(data_saleSpec[i].initNum)) && data_saleSpec[i].whslePrice > 0) { + if(isShowWhsle == 1 && data_saleSpec[i].whslePrice > 0) { + $('.cclass_con .cc2 o').html('批发单价:¥' + data_saleSpec[i].whslePrice); + $('.cclass_con .cc2 l').html('起批数:' + data_saleSpec[i].initNum + '件'); + } + } + } + for(var i in data_saleSpec) { + if(i == arry_str) { + $('.cclass_con .cc2 p').html('¥' + data_saleSpec[i].specPrice); + } + } +} +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var goodsType; + if (self.goodsType) { + goodsType=self.goodsType; + } + var goodsId = self.data_id; + var isEct = self.isEct; + var isMiaosha = self.isMiaosha; + var MiaoshaSaleSpec = self.MiaoshaSaleSpec; + var specsId = ''; + from_id = self.from_id?self.from_id:0; +// //console.log(isMiaosha) + // isMiaosha = 1; + // MiaoshaSaleSpec = '0'; +// console.log(goodsId) + + // mui.ajax(hyhUrl('app/Goods/detail'), { + mui.ajax(qlgUrl('app/Goods/detail'), { + data: { + goodsId: goodsId + // goodsId: 1206 + // goodsId: 1203 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // console.log(data) + var data = toJson(data); + // console.log(data.status) + if(data.status == 1) { + // mui.alert('加载失败请重试!'); + + data = data.data; + data_bak = data; + shopQQ = data.shop.shopQQ; + shopTel = data.shop.phone; + var isEct = data.isEct; + shopName = data.shop.shopName; + // if(!shopQQ && shopTel) { + $('#lxkf').html('

      客服

      ') + // } + if(1 == data.isFavorites){ + $('#scbtn img').attr('src','../img/likelogo1.png') + $('#scbtn p').html("已收藏") + } + var html = '

      ECT专享价¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; + } else { + html += '

      ¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; + } + + // var str1 = '

      到手价¥' + Math.round(data.shopPrice * 0.8 * 100) / 100 + '

      ' + + html += '

      ' + data.goodsName + '

      '; + if(data.goodsTips) { + html += '

      ' + data.goodsTips + '

      '; + } + if(data.isFreeShipping == '1') { + html += '
      免运费'; + } else { + //html += '
      不包邮'; + html += '
      运费'+data.freight; + } + html += '月销:' + data.saleNum + '件
      ' + + html += '
      领取优惠券
      ';//
      木吉购买后可获得成交价格20%木吉
      + if(isEct != 1) { + //html += '
      木吉本商品可用木吉抵扣20%
      ' + } else {} + if(data.promotionList != '') { +// html += '
      促销信息 :' + data.promotionList.rewardTitle + '
      '; +// $.each(data.promotionList.json, function() { +// html += '

      满' + this.orderMoney + '元

      '; +// +// if(this.favourableJson.chk0 == true) { +// html += '
      减' + this.favourableJson.chk0val + '元
      '; +// } +// if(this.favourableJson.chk1 == true) { +// html += '
      送' + this.favourableJson.chk1val.text + '
      '; +// } +// if(this.favourableJson.chk2 == true) { +// html += '
      免运费
      '; +// } +// if(this.favourableJson.chk3 == true) { +// html += '
      送满' + this.favourableJson.chk3val.text + '元优惠券 满' + this.favourableJson.chk3val.data.useMoney + '元使用
      '; +// } +// +// }); +// +// html += '
      '; + } + var showShopMsg = '正品保证 '; + // if(1778 == data.shopId){ + // showShopMsg+='此商品拆封概不退货换'; + // showShopMsg+='温馨提示:不支持7天无理由退货'; + // + // } + html += '
      '+showShopMsg+'
      选择颜色分类 号码尺寸
      '; + if(data.oneAppraises == '') { + + } else { + var userImg = ''; + if(data.oneAppraises.userPhoto) { + userImg = hyhImgUrl(data.oneAppraises.userPhoto); + } else { + userImg = '../img/mujiimg.png' + } + + html += '

      商品评价(' + data.appraiseNum + ')

      ' + data.oneAppraises.loginName + '

      ' + data.oneAppraises.content + '
      ' + data.oneAppraises.goodsSpecNames + '
      查看全部评价
      '; + } + + img_data = data.goodsDesc.replace(/src=\"__ROOT__\//g, 'data-src="').replace(/data-echo=\"__ROOT__\//g, 'src="' + hyhImgUrl('')).replace(/src=\"\//g, 'src="' + hyhImgUrl('')); + img_data = img_data.replace(/src=\"http\:\/\/img.heyuanhui.cn\//g,'src="' + hyhImgUrl('')); + ////console.log(img_data) + html += '

      ' + data.shop.shopName + '

      ' + data.goodsCount + '
      全部宝贝
      ' + data.newGoodsCount + '
      上新宝贝
      ' + data.favoritesShopsNum + '
      关注人数
      宝贝描述 ' + data.shop.goodsScore + '
      卖家服务 ' + data.shop.serviceScore + '
      物流服务 ' + data.shop.timeScore + '
      '; + $('.con_').html(html); + + $('.cclass_con .img').html(''); + $('.cclass_con .cc2 p').html('¥' + data.shopPrice); + $('.cclass_con .cc2 span').html('库存' + data.goodsStock + '件'); + if(data.showWhsle == 1) { + isShowWhsle = 1; + } + $('#storebtn').attr('data-shopId', data.shopId); + $('.swiper-slide img').height($('.swiper-slide img').width()); + $('.swiper-slide').height($('.swiper-slide').width()); + //$('.swiper-slide').height($('.swiper-slide').width() * 460 / 750); + //$('.swiper-slide img').height($('.swiper-slide img').width() * 460 / 750); + + // $('.banner').height($('.banner').width()); + var swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + spaceBetween: 30, + autoplay: 3000 + }); + var html1 = ''; + // var html1 = '
      '; + $.each(data.spec, function() { + html1 += '

      ' + this.name + '

      ' + $.each(this.list, function() { + // //console.log(this.itemId) + html1 += '
      ' + this.itemName + '
      ' + }); + html1 += '
      ' + }); + // html1+='
      ' + $('.ccclass').html(html1); + // var hahaha = mui('#hahaha').scroll(); + // $('.ccclass').height($('#hahaha').height()) + for(var i in data.saleSpec) { + data_saleSpec[i] = data.saleSpec[i]; + // if(data.saleSpec[i]["id"] == MiaoshaSaleSpec) { + // specsId = i + // arry_str = i; + // isDefaultArr = i.split(':'); + // } + if(data.saleSpec[i]["isDefault"] == 1) { + isDefaultArr = i.split(':'); + arry_str = i; + } + + } + if(data.couponList == '') { + $('.yyyhhhqqq').css('display', 'none'); + } else { + $.each(data.couponList, function() { + html2 += '

      ¥' + this.couponValue + '

      满' + this.useMoney + '元使用
      '; + }); + $('.yhqcon').html(html2); + } + + // if(isMiaosha == 1 || (data.is_seckilling&&data.is_seckilling == 1)||(data_saleSpec[arry_str].is_seckilling&&data_saleSpec[arry_str].is_seckilling==1)) { + var html_miaosha = '' + if(data.is_seckilling && data.is_seckilling == '1') { + $('.mujidikou').css('display', 'none'); + seckilling_end_time = data.seckilling_end_time; + html_miaosha = '

      ' + data.shopPrice + '

      ¥' + data.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; + + $('.miaosha').html(html_miaosha); + $('.miaosha').css('display', 'block'); + $('.price').css('display', 'none'); + $('.price_old').css('display', 'none'); + countTime(); + } else if(data_saleSpec[arry_str] && data_saleSpec[arry_str].is_seckilling && data_saleSpec[arry_str].is_seckilling == 1) { + miaoshaSaleSpec(data_saleSpec[arry_str].id, data_saleSpec); + } else if(isMiaosha == 1) { + miaoshaSaleSpec(MiaoshaSaleSpec, data_saleSpec); + } + // } + else { + $.each(isDefaultArr, function() { + var that = this; + $('.cclass1 .block').each(function() { + + if($(this).attr('data-itemId') == that) { + $(this).addClass('on'); + $(this).parent().attr('data-class', that); + } + + }) + + }) + } + } else if(data.status == -22) { + alert(data.msg); + mui.back(); + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + //console.log(errorThrown); + } + }); + var scroll = mui('.mui-scroll-wrapper').scroll({ + //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 + deceleration: 0.002 + }); + var show_img=false; + //导航栏渐变 + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + var num; + if(scroll.y >= -387 && scroll.y < 0) { + + num = scroll.y / -387; + // //console.log('渐变',num) + $('.header1').css({ + 'display': 'block', + 'opacity': num + }) + if(false == show_img){ + show_img=true; + $('.imgcon').html(img_data); + } + var num1 = 0.2 - num * 0.2; + } else if(scroll.y >= 0) { + num = 0; + // //console.log('透明',num) + $('.header1').css({ + 'display': 'none', + 'opacity': num + }) + } else if(scroll.y < -387) { + + num = 1; + // //console.log('不透明',num) + $('.header1').css({ + 'display': 'block', + 'opacity': num + }) + } + //导航栏自动切换 + if($('.imgcon').offset().top >= 66) { + $('#nav1').addClass("on").siblings().removeClass('on'); + } else if($('.imgcon').offset().top < 66) { + $('#nav3').addClass("on").siblings().removeClass('on'); + } + }) + + mui('.header').on('tap', '.icon-cart', function() { + mui.openWindow({ + url: "shoppingcart.html", + id: "shoppingcart.html_"+from_id, + extras: { + from_id: from_id, + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }); + }); + //点击导航栏跳转 + mui('.nav').on('tap', '#nav1', function() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); + $('#nav1').addClass("on").siblings().removeClass('on'); + }); + mui('.nav').on('tap', '#nav2', function() { + JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); + }); + mui('.nav').on('tap', '#nav3', function() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, -1124, 100); + $('#nav3').addClass("on").siblings().removeClass('on'); + }); + + mui('.con_').on('tap', '#changeclass', function() { + $('#changeclass_con').show(); + }) + + //选择类型 + mui('.ccclass').on('tap', '.block', function() { + $(this).addClass('on').siblings().removeClass('on'); + $(this).parent().attr('data-class', $(this).attr('data-itemId')); + + var data_itemId = $(this).attr('data-itemId'); + if($(this).attr('data-itemImg') != '') { + $('.cclass_con .img').html(''); + } + + var arry = []; + + $.each($('.cclass1'), function() { + arry.push($(this).attr('data-class')) + }); + arry.sort(function(a, b) { + return a - b; + }); + + arry_str = arry.join(':'); + + for(var i in data_saleSpec) { + if(i == arry_str) { + $('.cclass_con .cc2 p').html(data_saleSpec[i].specPrice); + $('.cclass_con .cc2 span').html('库存' + data_saleSpec[i].specStock + '件'); + + if(data_saleSpec[i].is_seckilling && data_saleSpec[i].is_seckilling == 1) { + miaoshaSaleSpec(data_saleSpec[i].id, data_saleSpec); + } else { + + $('.miaosha').html(''); + $('.miaosha').css('display', 'none'); + $('.price').html('¥' + data_saleSpec[i].specPrice); + $('.price_old').html('市场价 ¥' + data_saleSpec[i].marketPrice + ''); + $('.price').css('display', 'block'); + $('.price_old').css('display', 'block'); + } + } + } + + var num = +$('.change_num input').val(); + whslePrice(num, arry_str); + + }) + //跳转选择类型 + + $('.footer').on('tap', '.btn_ljgm', function() { + $('#changeclass_con').show(); + }) + //关闭 + mui('.cc2').on('tap', '.closecclass', function() { + $('#changeclass_con').hide(); + }) + + mui('.en').on('tap', '.engwc', function() { + $('#changeclass_con').hide(); + }) + + //改变数量 + mui('.change_num').on('tap', '.jia', function() { + // //console.log($(this).siblings('input').val()) + var num = +$(this).siblings('input').val() + 1; + if(num <= 0) { + alert('购买数最小为1!'); + return; + } + $(this).siblings('input').val(num); + whslePrice(num, arry_str) + }) + mui('.change_num').on('tap', '.jian', function() { + var num = +$(this).siblings('input').val() - 1; + if(num <= 0) { + alert('购买数最小为1!'); + return; + } + $(this).siblings('input').val(num); + whslePrice(num, arry_str) + }) + $('.change_num input').on('change', function() { + var num = +$(this).val(); + + whslePrice(num, arry_str); + }) + + mui('.mui-backdrop').on('tap', '.mask', function() { + $('#changeclass_con').hide(); + }) + //加入购物车&购买 + mui('.en').on('tap', '.enarr', function() { + + var that = $(this); + // var goodsId = goodsId; + var buyNum = $('.change_num input').val(); + var isGoodsSpecId = 0; + var goodsSpecId = 0; + var url = ''; + if($(this).hasClass('engwc')) { + url = 'addCart'; + } else if($(this).hasClass('ensure')) { + url = 'buy'; + } + // //console.log(data_bak.isSpec) + for(var i in data_saleSpec) { + if(i == arry_str) { + isGoodsSpecId = 1; + goodsSpecId = data_saleSpec[i].id; + } + } + if(isGoodsSpecId == 1) { + // goodsSpecId = arry_str; + } else if(data_bak.isSpec == 0) { + goodsSpecId = 0; + } else { + alert('请选择商品分类!'); + return + } + if(goodsType==2 & from_id!=3 & $(this).hasClass('engwc')) { + mui.alert ("助微吧商品不能加入购物车") + return; + } + // //console.log(arry_str) + // //console.log(goodsSpecId) + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/carts/' + url), { + headers: { + "HYH-Token": token + }, + data: { + goodsType:from_id, + goodsId: goodsId, + buyNum: buyNum, + goodsSpecId: goodsSpecId, + from: from_id + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + data = toJson(data); + // //console.log(data.msg); + // //console.log(data.status); + if(data.status == 1) { + if(url == 'buy') { + mui.openWindow({ + url: 'confirmOrder.html', + id: 'confirmOrder.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // goodsId: goodsId + from: from_id, + type: 1 + + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } else if(url == 'addCart') { + mui.alert('添加购物车成功!') + } + + } else { + mui.alert(data.msg); + //location.reload(); + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + + }) + + //打开评价列表 + mui('.con_').on('tap', '.pjrk', function() { + JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); + }) + $('.footer').on('tap', '#scbtn', function() { + var goodId = goodsId; + var that = $(this); + if($('#scbtn p').html() == '收藏') { + mui.ajax(qlgUrl('app/Favorites/add'), { + + data: { + id: goodId, + type : 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + $('#scbtn p').html('已收藏'); + $('#scbtn p').css('color', '#E41F4A'); + $('#scbtn img').attr('src', '../img/likelogo1.png'); + // that.addClass('gz_btn1').removeClass('gz_btn'); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + } else { + mui.ajax(hyhUrl('app/Favorites/cancel'), { + + data: { + id: goodId, + type : 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + $('#scbtn p').html('收藏'); + $('#scbtn p').css('color', '#8f8f94'); + $('#scbtn img').attr('src', '../img/likelogo.png'); + // that.addClass('gz_btn1').removeClass('gz_btn'); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + } + + }) + $('.footer').on('tap', '#storebtn', function() { + var shopId = this.attributes["data-shopId"].nodeValue; + JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId,shopName:shopName}); + }) + $('.con').on('tap', '.shop_title p', function() { + var shopId = this.attributes["data-shopId"].nodeValue; + JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId}); + }) + //弹出优惠券 + $('.con_').on('tap', '.lq', function() { + $('#youhuiquan_con').css('display', 'block'); + }) + //关闭优惠券 + $('#youhuiquan_con').on('tap', '.thq_close', function() { + $('#youhuiquan_con').css('display', 'none'); + }) + //领取优惠券 + $('#youhuiquan_con').on('tap', '.lq_btn', function() { + var couponId = $(this).attr('data-couponId'); + mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { + headers: { + "HYH-Token": token + }, + data: { + couponId: couponId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + var data = toJson(data); + alert(data.msg); + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + }) + //联系客服 + + $('#lxkf').on('tap', function() { + if(shopQQ) { + // location.href="http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes"; + // mui.back(); + // window.open("http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes") + if(plus.os.name == "iOS") { + plus.runtime.launchApplication({ + action: "mqq://im/chat?chat_type=wpa&uin=" + shopQQ + "&version=1&src_type=web" + }, function(e) { + plus.nativeUI.confirm("检查到您未安装qq,请先到appstore搜索下载?", function(i) { + if(i.index == 0) { + iosAppstore("itunes.apple.com/cn/app/mqq/"); + } + }); + }); + } else if(plus.os.name == "Android") { + var Intent = plus.android.importClass('android.content.Intent'); + var Uri = plus.android.importClass('android.net.Uri'); + var main = plus.android.runtimeMainActivity(); + var uri = Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin=" + shopQQ); + main.startActivity(new Intent(Intent.ACTION_VIEW, uri)); + } + } + }) + //分享 + $('.con_').on('tap', '#share', function() { + shareHref(); + }) + + + +}) +// var self = plus.webview.currentWebview(); // //console.log(self.aaa) \ No newline at end of file diff --git a/static/app2/js/discounts.js b/static/app2/js/discounts.js old mode 100755 new mode 100644 index 2648c3e..5700646 --- a/static/app2/js/discounts.js +++ b/static/app2/js/discounts.js @@ -1,80 +1,80 @@ -jumpPage(); - -function jumpPage() { - //跳转页面 - var subpages = ['choiceness.html', 'dynamic.html', 'new_product.html']; - var subpage_style = { - top: '103px', - bottom: '0px', - scrollIndicator: 'none' - }; - - var aniShow = {}; //动画显示 - //当前激活选项 - var activeTab = subpages[0]; - //选项卡点击事件 - mui('.nav').on('tap', 'a', function(e) { - var targetTab = this.getAttribute('href'); - if(targetTab == activeTab) { - return; - } - //显示目标选项卡 - //若为iOS平台或非首次显示,则直接显示 - if(mui.os.ios || aniShow[targetTab]) { - plus.webview.show(targetTab); - } else { - //否则,使用fade-in动画,且保存变量 - var temp = {}; - temp[targetTab] = "true"; - mui.extend(aniShow, temp); - plus.webview.show(targetTab, "fade-in", 300); - } - //隐藏当前; - plus.webview.hide(activeTab); - //更改当前活跃的选项卡 - activeTab = targetTab; - - if(targetTab == 'choiceness.html') { - document.getElementsByClassName('p1')[1].classList.remove('on') - document.getElementsByClassName('p1')[2].classList.remove('on') - this.classList.add('on'); - } - - if(targetTab == 'dynamic.html') { - document.getElementsByClassName('p1')[0].classList.remove('on') - document.getElementsByClassName('p1')[2].classList.remove('on') - this.classList.add('on'); - } - - if(targetTab == 'new_product.html') { - document.getElementsByClassName('p1')[0].classList.remove('on') - document.getElementsByClassName('p1')[1].classList.remove('on') - this.classList.add('on'); - } - - }); - - //首次启动切滑效果 - - mui.plusReady(function() { - window.addEventListener('refresh', function(e) { - location.reload(); - }) - // launchScreen(); - // plus.navigator.setStatusBarStyle('dark'); - // //console.log(plus.navigator.getStatusBarStyle()) - var self = plus.webview.currentWebview(); - for(var i = 0; i < subpages.length; i++) { - var temp = {}; - //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create - var sub = plus.webview.create(subpages[i], subpages[i], subpage_style); - if(i > 0) { - sub.hide(); - } else { - temp[subpages[i]] = "true"; - mui.extend(aniShow, temp); //合并对象 - } - self.append(sub); - } - }); +jumpPage(); + +function jumpPage() { + //跳转页面 + var subpages = ['choiceness.html', 'dynamic.html', 'new_product.html']; + var subpage_style = { + top: '103px', + bottom: '0px', + scrollIndicator: 'none' + }; + + var aniShow = {}; //动画显示 + //当前激活选项 + var activeTab = subpages[0]; + //选项卡点击事件 + mui('.nav').on('tap', 'a', function(e) { + var targetTab = this.getAttribute('href'); + if(targetTab == activeTab) { + return; + } + //显示目标选项卡 + //若为iOS平台或非首次显示,则直接显示 + if(mui.os.ios || aniShow[targetTab]) { + plus.webview.show(targetTab); + } else { + //否则,使用fade-in动画,且保存变量 + var temp = {}; + temp[targetTab] = "true"; + mui.extend(aniShow, temp); + plus.webview.show(targetTab, "fade-in", 300); + } + //隐藏当前; + plus.webview.hide(activeTab); + //更改当前活跃的选项卡 + activeTab = targetTab; + + if(targetTab == 'choiceness.html') { + document.getElementsByClassName('p1')[1].classList.remove('on') + document.getElementsByClassName('p1')[2].classList.remove('on') + this.classList.add('on'); + } + + if(targetTab == 'dynamic.html') { + document.getElementsByClassName('p1')[0].classList.remove('on') + document.getElementsByClassName('p1')[2].classList.remove('on') + this.classList.add('on'); + } + + if(targetTab == 'new_product.html') { + document.getElementsByClassName('p1')[0].classList.remove('on') + document.getElementsByClassName('p1')[1].classList.remove('on') + this.classList.add('on'); + } + + }); + + //首次启动切滑效果 + + mui.plusReady(function() { + window.addEventListener('refresh', function(e) { + location.reload(); + }) + // launchScreen(); + // plus.navigator.setStatusBarStyle('dark'); + // //console.log(plus.navigator.getStatusBarStyle()) + var self = plus.webview.currentWebview(); + for(var i = 0; i < subpages.length; i++) { + var temp = {}; + //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create + var sub = plus.webview.create(subpages[i], subpages[i], subpage_style); + if(i > 0) { + sub.hide(); + } else { + temp[subpages[i]] = "true"; + mui.extend(aniShow, temp); //合并对象 + } + self.append(sub); + } + }); } \ No newline at end of file diff --git a/static/app2/js/distribution.js b/static/app2/js/distribution.js old mode 100755 new mode 100644 index e14f850..0c80aa2 --- a/static/app2/js/distribution.js +++ b/static/app2/js/distribution.js @@ -1,98 +1,98 @@ -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var userId = self.userId - var idx = 0; - var curIdx; - var productNum = ""; - var couponsNum = ''; - var click = false; - var type, payPwd, num; - //获取数据 - JZL.ajax(qlgUrl('app/users/getInvestmentMoney'), { - userId: userId - }, function(data) { - // console.log(data); - if (1 == data.status) { - var data = data.data; - productNum = data.productNum; - couponsNum = data.couponsNum; - $(".product .productNum").val(productNum); - - } - }) - - - $(".nav").on("tap", ".nav-item", function() { - curIdx = idx - idx = $(this).index() - - $(".nav .nav-item ").eq(idx).addClass("active") - $(".nav .nav-item ").not($(".nav .nav-item ").eq(idx)).removeClass("active") - $(".content .content_ ").eq(idx).show() - $(".content .content_ ").not($(".content .content_ ").eq(idx)).hide() - if (0 == idx) { //product - if (curIdx != idx) { - //获取数据 - $(".product .productNum").val(productNum); - } - - } else if (1 == idx) { //voucher - if (curIdx != idx) { - //获取数据 - $('.voucher .couponsNum ').val(couponsNum) - } - } - - }) - - - $(".down").on("tap", function() { - if (true == click) { - return - } - click = true; - - - if ('' == $('.product .productNum').val() || '' == $.trim($('.product .productNum').val())) { - mui.alert("券值不能为空"); - return; - } - if ($('.product .productNum').val() < 15) { - mui.alert("券值不能低于15 "); - return; - } - - if (0 == idx) { //product - num = parseFloat($('.product .productNum').val()) - type = 1; - payPwd = $('.proPassWord').val(); - - } - if (1 == idx) { //voucher - //ajax - num = parseFloat($('.voucher .couponsNum').val()) - type = 2; - payPwd = $('.vouPassWord').val(); - - } - if ('' == payPwd) { - mui.alert("操作密码不能为空"); - return; - } - console.log(idx); - JZL.ajax(qlgUrl("app/users/distributionInvestmentMoney"), { - userId: userId, - type: type, - num: num, - payPwd: payPwd - }, function(data) { - if (1 == data.status){ - mui.toast(data.msg) - mui.back(); - }else { - mui.alert (data.msg) - } - }) - - }) +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var userId = self.userId + var idx = 0; + var curIdx; + var productNum = ""; + var couponsNum = ''; + var click = false; + var type, payPwd, num; + //获取数据 + JZL.ajax(qlgUrl('app/users/getInvestmentMoney'), { + userId: userId + }, function(data) { + // console.log(data); + if (1 == data.status) { + var data = data.data; + productNum = data.productNum; + couponsNum = data.couponsNum; + $(".product .productNum").val(productNum); + + } + }) + + + $(".nav").on("tap", ".nav-item", function() { + curIdx = idx + idx = $(this).index() + + $(".nav .nav-item ").eq(idx).addClass("active") + $(".nav .nav-item ").not($(".nav .nav-item ").eq(idx)).removeClass("active") + $(".content .content_ ").eq(idx).show() + $(".content .content_ ").not($(".content .content_ ").eq(idx)).hide() + if (0 == idx) { //product + if (curIdx != idx) { + //获取数据 + $(".product .productNum").val(productNum); + } + + } else if (1 == idx) { //voucher + if (curIdx != idx) { + //获取数据 + $('.voucher .couponsNum ').val(couponsNum) + } + } + + }) + + + $(".down").on("tap", function() { + if (true == click) { + return + } + click = true; + + + if ('' == $('.product .productNum').val() || '' == $.trim($('.product .productNum').val())) { + mui.alert("券值不能为空"); + return; + } + if ($('.product .productNum').val() < 15) { + mui.alert("券值不能低于15 "); + return; + } + + if (0 == idx) { //product + num = parseFloat($('.product .productNum').val()) + type = 1; + payPwd = $('.proPassWord').val(); + + } + if (1 == idx) { //voucher + //ajax + num = parseFloat($('.voucher .couponsNum').val()) + type = 2; + payPwd = $('.vouPassWord').val(); + + } + if ('' == payPwd) { + mui.alert("操作密码不能为空"); + return; + } + console.log(idx); + JZL.ajax(qlgUrl("app/users/distributionInvestmentMoney"), { + userId: userId, + type: type, + num: num, + payPwd: payPwd + }, function(data) { + if (1 == data.status){ + mui.toast(data.msg) + mui.back(); + }else { + mui.alert (data.msg) + } + }) + + }) }) diff --git a/static/app2/js/editAddress.js b/static/app2/js/editAddress.js old mode 100755 new mode 100644 index f60150c..c6593af --- a/static/app2/js/editAddress.js +++ b/static/app2/js/editAddress.js @@ -1,299 +1,299 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var addressId = self.data_addressId ? self.data_addressId : 0; - var isParentId = 1; - var isProvince; - var isCity; - var userName = $('#userName'); - var userPhone = $('#userPhone'); - var province = $('#province'); - var city = $('#city'); - var Area = $('#area'); - var Textarea = $('textarea'); - var areaVal; - if (addressId != 0) { - $('.address_info').css('display', 'none'); - $('.add_info').css('display', 'block'); - mui.ajax(qlgUrl('app/useraddress/getById'), { - data: { - addressId: addressId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { - //console.log(data);//服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - //console.log(data); - userName.val(data.userName) - userPhone.val(data.userPhone) - $('.add_info').html(data.areaName) - Textarea.val(data.userAddress) - areaVal = data.areaId - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg) - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - mui.ajax(qlgUrl('app/areas/listQuery'), { - data: { - parentId: 0 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#province').html(html); - - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg) - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - $('.scroll_out_t').on('tap', '#province', function() { - if (isParentId == 1) { - isParentId = 0; - mui.ajax(qlgUrl('app/areas/listQuery'), { - data: { - parentId: 0 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#province').html(html); - var province = data[0].areaId; - mui.ajax(hyhUrl('app/areas/listQuery'), { - data: { - parentId: province - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#city').html(html); - var city = data[0].areaId; - mui.ajax(hyhUrl('app/areas/listQuery'), { - data: { - parentId: city - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#area').html(html); - isCity = city; - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - isProvince = province; - } else { - mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg) - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - - }) - $('.scroll_out_t').on('change', '#province', function() { - var province = $(this).val() - //console.log(province) - if (isProvince != province) { - mui.ajax(qlgUrl('app/areas/listQuery'), { - data: { - parentId: province - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#city').html(html); - // var city = data[0].areaId; - // mui.ajax(hyhUrl('app/areas/listQuery'), { - // data: { - // parentId: city - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // data = toJson(data); - // if(data.status == 1) { - // data = data.data; - var html = ''; - // $.each(data, function() { - // html += '' - // }); - $('#area').html(html); - // isCity = city; - // } else { - // mui.alert('发生错误请刷新后重试!'); - // // location.reload(); - // } - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - isProvince = province; - } else { - // mui.alert('发生错误请刷新后重试!'); - mui.alert(data.msg) - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - }) - $('.scroll_out_t').on('change', '#city', function() { - var city = $(this).val() - if (isCity != city) { - mui.ajax(qlgUrl('app/areas/listQuery'), { - data: { - parentId: city, - level: 2 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data, function() { - html += '' - }); - $('#area').html(html); - isCity = city; - } else { - mui.alert(data.msg) - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - }) - - $('.bc_btn').on('tap', function() { - var isDefault = $('input:radio[name="isDefault"]:checked').val() ? $('input:radio[name="isDefault"]:checked').val() : - 0; - areaVal = $('#area').val() ? $('#area').val() : areaVal; - var data = { - isDefault: isDefault, - addressId: addressId, - userName: $('#userName').val(), - areaId: areaVal, - userPhone: $('#userPhone').val(), - userAddress: $('textarea').val(), - } - mui.ajax(hyhUrl('app/useraddress/edits'), { - data: data, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - mui.back(); - } else { - mui.alert(data.msg) - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - $('.add_info').on('tap', function() { - $('.address_info').css('display', 'block'); - $('.add_info').css('display', 'none'); - }) - +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var addressId = self.data_addressId ? self.data_addressId : 0; + var isParentId = 1; + var isProvince; + var isCity; + var userName = $('#userName'); + var userPhone = $('#userPhone'); + var province = $('#province'); + var city = $('#city'); + var Area = $('#area'); + var Textarea = $('textarea'); + var areaVal; + if (addressId != 0) { + $('.address_info').css('display', 'none'); + $('.add_info').css('display', 'block'); + mui.ajax(qlgUrl('app/useraddress/getById'), { + data: { + addressId: addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { + //console.log(data);//服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + //console.log(data); + userName.val(data.userName) + userPhone.val(data.userPhone) + $('.add_info').html(data.areaName) + Textarea.val(data.userAddress) + areaVal = data.areaId + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#province').html(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('.scroll_out_t').on('tap', '#province', function() { + if (isParentId == 1) { + isParentId = 0; + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#province').html(html); + var province = data[0].areaId; + mui.ajax(hyhUrl('app/areas/listQuery'), { + data: { + parentId: province + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#city').html(html); + var city = data[0].areaId; + mui.ajax(hyhUrl('app/areas/listQuery'), { + data: { + parentId: city + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#area').html(html); + isCity = city; + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + isProvince = province; + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + + }) + $('.scroll_out_t').on('change', '#province', function() { + var province = $(this).val() + //console.log(province) + if (isProvince != province) { + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: province + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#city').html(html); + // var city = data[0].areaId; + // mui.ajax(hyhUrl('app/areas/listQuery'), { + // data: { + // parentId: city + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // data = toJson(data); + // if(data.status == 1) { + // data = data.data; + var html = ''; + // $.each(data, function() { + // html += '' + // }); + $('#area').html(html); + // isCity = city; + // } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + isProvince = province; + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + }) + $('.scroll_out_t').on('change', '#city', function() { + var city = $(this).val() + if (isCity != city) { + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: city, + level: 2 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#area').html(html); + isCity = city; + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + }) + + $('.bc_btn').on('tap', function() { + var isDefault = $('input:radio[name="isDefault"]:checked').val() ? $('input:radio[name="isDefault"]:checked').val() : + 0; + areaVal = $('#area').val() ? $('#area').val() : areaVal; + var data = { + isDefault: isDefault, + addressId: addressId, + userName: $('#userName').val(), + areaId: areaVal, + userPhone: $('#userPhone').val(), + userAddress: $('textarea').val(), + } + mui.ajax(hyhUrl('app/useraddress/edits'), { + data: data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.add_info').on('tap', function() { + $('.address_info').css('display', 'block'); + $('.add_info').css('display', 'none'); + }) + }) diff --git a/static/app2/js/essay.js b/static/app2/js/essay.js old mode 100755 new mode 100644 diff --git a/static/app2/js/essaylist.js b/static/app2/js/essaylist.js old mode 100755 new mode 100644 index 4b2fb77..7d9354f --- a/static/app2/js/essaylist.js +++ b/static/app2/js/essaylist.js @@ -1,9 +1,9 @@ -mui.plusReady(function () { - // var url ="", - $("body").on("tap" ,".add1",function () { - JZL.openWindow('addessay.html', 'addessay.html') - }) - $(".row_con").on("tap" ,".memorandum",function () { - JZL.openWindow('memorandumlist.html', 'memorandumlist.html') - }) +mui.plusReady(function () { + // var url ="", + $("body").on("tap" ,".add1",function () { + JZL.openWindow('addessay.html', 'addessay.html') + }) + $(".row_con").on("tap" ,".memorandum",function () { + JZL.openWindow('memorandumlist.html', 'memorandumlist.html') + }) }) \ No newline at end of file diff --git a/static/app2/js/friends.js b/static/app2/js/friends.js old mode 100755 new mode 100644 index 3a7b168..c32019c --- a/static/app2/js/friends.js +++ b/static/app2/js/friends.js @@ -1,53 +1,53 @@ -mui.plusReady(function() { - var level = ''; - JZL.ajax(qlgUrl('app/users/myFriend'), {}, function(data) { - //console.log(data); - if (1 == data.status) { - var data = data.data; - var html = '', - html1 = ''; - - html1 = '

      ' + data.pInfo.trueName + '' + data.pInfo.userStatus + - '

      ' + data.pInfo.userLevel + '' + data.pInfo.userPhone + - ''; - html = - '
      '; - // html1=data.user.loginName+" "+data.user.userId - $('.fri-con').html(html) - $('.shop_info').html(html1) - $('.userInfo').text(data.user.loginName) - //二维码生成 - // var content='' - var qrcode = new QRCode(document.getElementById("qrcode"), { - width: 100, //设置宽高 - height: 100 - }); - //console.log(data.share_url); - //$('body').append(''); - qrcode.makeCode(data.share_url); - // //console.log('http://t.ect99.com/mobile/users/reg?pName='+ data.user.loginName); - $('#qrcode').show(); - }else{ - mui.alert(data.msg) - } - }) - - $('body').on("tap", '.row', function() { - // alert(1) - level = $(this).attr('data-level'); - JZL.openWindow('friendsList.html', 'friendsList.html', { - 'level': level - }) - }) - - - -}) +mui.plusReady(function() { + var level = ''; + JZL.ajax(qlgUrl('app/users/myFriend'), {}, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + var html = '', + html1 = ''; + + html1 = '

      ' + data.pInfo.trueName + '' + data.pInfo.userStatus + + '

      ' + data.pInfo.userLevel + '' + data.pInfo.userPhone + + ''; + html = + '
      '; + // html1=data.user.loginName+" "+data.user.userId + $('.fri-con').html(html) + $('.shop_info').html(html1) + $('.userInfo').text(data.user.loginName) + //二维码生成 + // var content='' + var qrcode = new QRCode(document.getElementById("qrcode"), { + width: 100, //设置宽高 + height: 100 + }); + //console.log(data.share_url); + //$('body').append(''); + qrcode.makeCode(data.share_url); + // //console.log('http://t.ect99.com/mobile/users/reg?pName='+ data.user.loginName); + $('#qrcode').show(); + }else{ + mui.alert(data.msg) + } + }) + + $('body').on("tap", '.row', function() { + // alert(1) + level = $(this).attr('data-level'); + JZL.openWindow('friendsList.html', 'friendsList.html', { + 'level': level + }) + }) + + + +}) diff --git a/static/app2/js/friendsList.js b/static/app2/js/friendsList.js old mode 100755 new mode 100644 index 2c16bd5..b8b2679 --- a/static/app2/js/friendsList.js +++ b/static/app2/js/friendsList.js @@ -1,86 +1,86 @@ -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var userLevel = self.level - // mui.alert(userLevel) - var page = 1; - var pagesize = 10; - var isjiazai = 1; - getRecommend(page, pagesize) - - function getRecommend(page, pagesize) { - var recommenddata = { - page: page ? page : 1, - pagesize: pagesize ? pagesize : 10 - } - recommenddata.userLevel = userLevel; - if (-1 == userLevel) { - recommenddata.isLock = 1; - } else { - recommenddata.isLock = 0; - - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/users/myFriendList'), recommenddata, function(data) { - //console.log(data); - if (1 == data.status) { - var data = data.data; - var html = ''; - if (data.Rows == '') { - $('.fri-con').append( - '

      没有更多朋友

      '); - isjiazai = 0; - return; - } - mui.each(data.Rows, function() { - if (!this.lockReason || '' == this.lockReason) { - html += '
      ' + this.trueName + - '' + this.userPhone + '
      ' - } else { - html += '
      ' + this.trueName + - '' + this.userPhone + - '' + this.lockReason + - '8' + this.lockTime + - '小时' + this.createTime + '
      ' - - } - - }) - - if (page == 1) { - $('.fri-con').html(html); - } else { - $('.fri-con').append(html); - } - isjiazai = 1; - } else { - mui.alert(data.msg) - } - }) - } - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - // 判断默认行为是否可以被禁用 - if (e.cancelable) { - // 判断默认行为是否已经被禁用 - if (!e.defaultPrevented) { - e.preventDefault(); - } - } - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pagesize); - } - } - if (scroll.y > 80 && issx == 0) { - issx = 1; - setTimeout(function() { - location.reload() - }, 1000) - } - }, false) +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var userLevel = self.level + // mui.alert(userLevel) + var page = 1; + var pagesize = 10; + var isjiazai = 1; + getRecommend(page, pagesize) + + function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + recommenddata.userLevel = userLevel; + if (-1 == userLevel) { + recommenddata.isLock = 1; + } else { + recommenddata.isLock = 0; + + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/users/myFriendList'), recommenddata, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + var html = ''; + if (data.Rows == '') { + $('.fri-con').append( + '

      没有更多朋友

      '); + isjiazai = 0; + return; + } + mui.each(data.Rows, function() { + if (!this.lockReason || '' == this.lockReason) { + html += '
      ' + this.trueName + + '' + this.userPhone + '
      ' + } else { + html += '
      ' + this.trueName + + '' + this.userPhone + + '' + this.lockReason + + '8' + this.lockTime + + '小时' + this.createTime + '
      ' + + } + + }) + + if (page == 1) { + $('.fri-con').html(html); + } else { + $('.fri-con').append(html); + } + isjiazai = 1; + } else { + mui.alert(data.msg) + } + }) + } + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // 判断默认行为是否可以被禁用 + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + }, false) }) diff --git a/static/app2/js/goodsList.js b/static/app2/js/goodslist.js old mode 100755 new mode 100644 similarity index 97% rename from static/app2/js/goodsList.js rename to static/app2/js/goodslist.js index 706686d..6217bf4 --- a/static/app2/js/goodsList.js +++ b/static/app2/js/goodslist.js @@ -1,216 +1,219 @@ -var msort = 1; -var page = 1; -var condition = 2; -var desc = 0; -var catId; -var keyword; -var isjiazai = 1; -var count = 1; -var goodsType; - -function pullupRefresh() { - // setTimeout(function() { - - // mui('#pullrefresh').pullRefresh().endPullupToRefresh(); - count += 1; - - var data_set = { - page: count, - pagesize: 10, - condition: condition, - desc: desc - } - // //console.log(order_class) - if (catId) { - data_set.catId = catId; - } else if (keyword) { - data_set.keyword = keyword; - } - if (goodsType) { - data_set.goodsType = goodsType; - } - mui.ajax(qlgUrl('app/Goods/pageQuery'), { - - data: data_set, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - - var data = toJson(data); - data = data.data; - var html = ''; - if (data.Rows == '') { - $('.mui-scroll').append('

      没有更多商品

      '); - return; - } - $.each(data.Rows, function() { - html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率   ' + this.discountRate + - '%
      '; - // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; - }); - $('.recommend_con').append(html); - $('.rcb_img').height($('.rcb_img').width()); - isjiazai = 1; - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - // }, 500); -} - -/** - * 下拉刷新具体业务实现 - */ -// function pulldownRefresh() { -// setTimeout(function() { -// window.location.reload(); -// mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed -// }, 1500); -// } -mui.plusReady(function() { - var costnum = 0; - var self = plus.webview.currentWebview(); - catId = self.data_catId; - keyword = self.data_keyword; - goodsType = self.goodsType?self.goodsType :""; - $('.commoditylistnav').on('tap', '.nav_block', function() { - page = 1; - count = 1; - $(this).addClass('on').siblings().removeClass('on'); - - condition = $(this).attr('data-condition'); - - if ($('#cost_btn').hasClass('on')) { - - costnum += 1; - - if (costnum % 2 == 1) { - - $('#cost_btn').html('价格 '); - - desc = 1; - - } else if (costnum % 2 == 0) { - - $('#cost_btn').html('价格 '); - - desc = 0; - - } - - } else { - - $('#cost_btn').html('价格 ') - - costnum = 0; - desc = 0 - } - - var data = { - pagesize: 10, - page: 1, - condition: condition, - desc: desc, - goodsType :goodsType - } - if (catId) { - data.catId = catId; - } else if (keyword) { - data.keyword = keyword; - } - - mui.ajax(qlgUrl('app/Goods/pageQuery'), { - data: data, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - data = data.data; - var html = ''; - $.each(data.Rows, function() { - html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率   ' + - this.discountRate + - '%
      '; - // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; - }); - $('.recommend_con').html(html); - $('.rcb_img').height($('.rcb_img').width()); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - var data_1 = { - pagesize: 10, - page: 1, - condition: 2, - desc: 0 - } - if (catId) { - data_1.catId = catId; - } else if (keyword) { - data_1.keyword = keyword; - } - mui.ajax(qlgUrl('app/Goods/pageQuery'), { - data: data_1, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - data = data.data; - var html = ''; - $.each(data.Rows, function() { - html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率   ' + this.discountRate + - '%
      '; - // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; - }); - $('.recommend_con').html(html); - $('.rcb_img').height($('.rcb_img').width()); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - // //console.log(scroll.y); - // //console.log(scroll.maxScrollY); - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - isjiazai = 0; - pullupRefresh() - } - } - }) - -}) - -// setInterval(function() { -// $('.cnxh_block img').height($('.cnxh_block img').width()); -// $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); +var msort = 1; +var page = 1; +var condition = 2; +var desc = 0; +var catId; +var keyword; +var isjiazai = 1; +var count = 1; +var goodsType; + +function pullupRefresh() { + // setTimeout(function() { + + // mui('#pullrefresh').pullRefresh().endPullupToRefresh(); + count += 1; + + var data_set = { + page: count, + pagesize: 10, + condition: condition, + desc: desc + } + // //console.log(order_class) + if (catId) { + data_set.catId = catId; + } else if (keyword) { + data_set.keyword = keyword; + } + if (goodsType) { + data_set.goodsType = goodsType; + } + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + + data: data_set, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + + var data = toJson(data); + data = data.data; + var html = ''; + if (data.Rows == '') { + $('.mui-scroll').append('

      没有更多商品

      '); + return; + } + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').append(html); + $('.rcb_img').height($('.rcb_img').width()); + isjiazai = 1; + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + // }, 500); +} + +/** + * 下拉刷新具体业务实现 + */ +// function pulldownRefresh() { +// setTimeout(function() { +// window.location.reload(); +// mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed +// }, 1500); +// } +mui.plusReady(function() { + var costnum = 0; + var self = plus.webview.currentWebview(); + catId = self.data_catId; + keyword = self.data_keyword; + goodsType = self.goodsType?self.goodsType :""; + from_id = self.from_id?self.from_id:0; + $('.commoditylistnav').on('tap', '.nav_block', function() { + page = 1; + count = 1; + $(this).addClass('on').siblings().removeClass('on'); + + condition = $(this).attr('data-condition'); + + if ($('#cost_btn').hasClass('on')) { + + costnum += 1; + + if (costnum % 2 == 1) { + + $('#cost_btn').html('价格 '); + + desc = 1; + + } else if (costnum % 2 == 0) { + + $('#cost_btn').html('价格 '); + + desc = 0; + + } + + } else { + + $('#cost_btn').html('价格 ') + + costnum = 0; + desc = 0 + } + + var data = { + pagesize: 10, + page: 1, + condition: condition, + desc: desc, + goodsType :goodsType, + from: from_id + } + if (catId) { + data.catId = catId; + } else if (keyword) { + data.keyword = keyword; + } + + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + data: data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + data = data.data; + var html = ''; + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').html(html); + $('.rcb_img').height($('.rcb_img').width()); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + var data_1 = { + pagesize: 10, + page: 1, + condition: 2, + desc: 0, + from: from_id, + } + if (catId) { + data_1.catId = catId; + } else if (keyword) { + data_1.keyword = keyword; + } + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + data: data_1, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + data = data.data; + var html = ''; + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').html(html); + $('.rcb_img').height($('.rcb_img').width()); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // //console.log(scroll.y); + // //console.log(scroll.maxScrollY); + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + isjiazai = 0; + pullupRefresh() + } + } + }) + +}) + +// setInterval(function() { +// $('.cnxh_block img').height($('.cnxh_block img').width()); +// $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); // }, 100) diff --git a/static/app2/js/guide.js b/static/app2/js/guide.js old mode 100755 new mode 100644 diff --git a/static/app2/js/helpGet.js b/static/app2/js/helpGet.js new file mode 100644 index 0000000..1e1c0fd --- /dev/null +++ b/static/app2/js/helpGet.js @@ -0,0 +1,59 @@ +var pageSize = 10; +var count = 1; +var isLoading = false; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + + getvoucherList(count, pageSize); + + function getvoucherList(count, pageSize) { + if (true == isLoading) return; + isLoading = true; + JZL.ajax(qlgUrl('app/Uservouchers/getHelpGet'), { + page: count, + perPage: pageSize, + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // console.log(data); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows == '') { + $('.con').append( + '

      没有更多数据

      '); + return; + } + var html = '' + $.each(data.Rows, function() { + html += '
      ' + this.helpGet + + '
      ' + this.remark + '
      ' + this.createTime + + '
      '; + }) + if (count == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + } else { + mui.alert(data.msg) + } + isLoading = false; + }); + } + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + count++; + getvoucherList(count, pageSize) + } + } + }) +}) diff --git a/static/app2/js/hhrrz.js b/static/app2/js/hhrrz.js old mode 100755 new mode 100644 index 5867d55..92e58eb --- a/static/app2/js/hhrrz.js +++ b/static/app2/js/hhrrz.js @@ -1,44 +1,44 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - - - - var self = plus.webview.currentWebview(); - - mui('.block').on('tap', '.bj', function() { - JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); - - }) - $('.con').on('tap', '.del', function() { - var data_addressId = $(this).parent().attr('data-addressId'); - if (confirm('确认删除信息?')) { - mui.ajax(qlgUrl('app/Useraddress/del'), { - data: { - id: data_addressId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - location.reload() - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - - }) - $('.add1').on('tap', function() { - JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); - }) - +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + + + + var self = plus.webview.currentWebview(); + + mui('.block').on('tap', '.bj', function() { + JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); + + }) + $('.con').on('tap', '.del', function() { + var data_addressId = $(this).parent().attr('data-addressId'); + if (confirm('确认删除信息?')) { + mui.ajax(qlgUrl('app/Useraddress/del'), { + data: { + id: data_addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + location.reload() + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + + }) + $('.add1').on('tap', function() { + JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); + }) + }) diff --git a/static/app2/js/home.js b/static/app2/js/home.js old mode 100755 new mode 100644 index 8dd24af..949f971 --- a/static/app2/js/home.js +++ b/static/app2/js/home.js @@ -1,299 +1,303 @@ -// $('.saoyisao').css('display', 'none'); -$('#search').css('width', '80%'); -$('#search').css('left', '5%'); -$('.searchimg').css('left', '8%'); - - -var page = 1; -var pagesize = 10; -var isjiazai = 1; - -function getRecommend(page, pagesize) { - var recommenddata = { - page: page ? page : 1, - pagesize: pagesize ? pagesize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - mui.ajax(qlgUrl('addon/shuff-Shuff-recommend'), { - data: recommenddata, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data, 1); - if (data.status == 1) { - var html = ''; - var data = data.data; - if (data.Rows == '') { - $('.mui-scroll').append('

      没有更多商品

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - - html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      可用木吉抵扣20%货款
      '; - }); - - if (page == 1) { - $('#recommend_con').html(html); - } else { - $('#recommend_con').append(html); - } - isjiazai = 1; - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - - } else { - mui.alert(data.msg) - // //console.log(2) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - -} -mui.plusReady(function() { - var ua = navigator.userAgent.toLowerCase(); - var issx = 0; - - //bannerTop - mui.ajax(qlgUrl('addon/shuff-Shuff-homeCarousel'), { - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data, 1); - if (data.status == 1) { - var html = ''; - var data = data.data; - $.each(data, function() { - html += '
      '; - }); - $('#top_banner .swiper-wrapper').html(html); - var swiper = new Swiper('#top_banner', { - pagination: '#top_banner_pagination', - spaceBetween: 0, - loop: true, - autoplay: 3500, - autoplayDisableOnInteraction: false - }); - $('#top_banner').height($('#top_banner').width() * 460 / 750); - } else { - mui.alert(data.msg) - // //console.log(data.status) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - //为你推荐 - getRecommend(page, pagesize); - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pagesize); - } - } - }) - setInterval(function() { - - $('.add_top_left img').height($('.add_top_left img').width()); - $('.add_top_right_con img').height($('.add_top_right_con img').width()); - $('.add_bottom_con img').height($('.add_bottom_con img').width()); - - $('.rcb_img').height($('.rcb_img').width()); - - }, 100) - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (-scroll.y < 0) { - num = 0; - } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { - num = -scroll.y / 150; - } else { - num = 1; - } - $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') - - if (-scroll.y < 75) { - $('.saoyisao').attr('src', '../img/saoyisao.png'); - $('.msg').attr('src', '../img/icon_msg.png'); - $('.search').attr('src', '../img/icon_search.png'); - $('#search').css('background-color', 'white'); - // $('#search').css('color', 'black'); - // $('#keyword').css('color', 'black'); - $('.header').removeClass('shadown_wai'); - } else { - $('.saoyisao').attr('src', '../img/saoyisao1.png'); - $('.msg').attr('src', '../img/icon_msg1.png'); - $('.search').attr('src', '../img/icon_search1.png'); - $('#search').css('background-color', '#d8d8d8'); - // $('#search').css('color', 'white'); - // $('#keyword').css('color', 'white'); - $('.header').addClass('shadown_wai'); - } - - if (scroll.y > 80 && issx == 0) { - issx = 1; - setTimeout(function() { - location.reload() - }, 1000) - } - - }) - //轮播图跳转 - $('#top_banner').on('tap', '.swiper-slide', function() { - openAds($(this)); - }) - - var num = 0; - - - mui('.classify').on('tap', '.class_block', function() { - var classifyId = $(this).attr('data-classifyId'); - var url = 'orSupermarket.html'; - - if (classifyId == 5) { - url = 'classify.html'; - } - - mui.openWindow({ - url: url, - id: url, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - }, - extras: { - classifyId: classifyId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, - waiting: {} - }) - }) - - - - //搜索 - $('#keyword').on('focus', function() { - $(".search button").css('display', 'block'); - }) - $('#keyword').on('blur', function() { - $(".search button").css('display', 'none'); - }) - $(".search button").on('tap', function() { - var searchName = $('#keyword').val(); - var url = ''; - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - // //console.log($('.search select').val()) - if ($('.search select').val() == 0) { - url = 'goodslist.html'; - } else if ($('.search select').val() == 1) { - url = 'shopsList.html'; - } - - mui.openWindow({ - url: url, - id: url + searchName, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - }) - $("#keyword").on('keypress', function(e) { - var keycode = e.keyCode; - var searchName = $(this).val(); - var url = ''; - if (keycode == '13') { - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - // //console.log($('.search select').val()) - if ($('.search select').val() == 0) { - url = 'goodslist.html'; - } else if ($('.search select').val() == 1) { - url = 'shopsList.html'; - } - - mui.openWindow({ - url: url, - id: url + searchName, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - } - }); - +// $('.saoyisao').css('display', 'none'); +$('#search').css('width', '80%'); +$('#search').css('left', '5%'); +$('.searchimg').css('left', '8%'); + + +var page = 1; +var pagesize = 10; +var isjiazai = 1; +from_id = 0; + +function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + mui.ajax(qlgUrl('addon/shuff-Shuff-recommend'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.mui-scroll').append('

      没有更多商品

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      可用木吉抵扣20%货款
      '; + }); + + if (page == 1) { + $('#recommend_con').html(html); + } else { + $('#recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + } else { + mui.alert(data.msg) + // //console.log(2) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + +} +mui.plusReady(function() { + var ua = navigator.userAgent.toLowerCase(); + var issx = 0; + + //bannerTop + mui.ajax(qlgUrl('addon/shuff-Shuff-homeCarousel'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
      '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + $('#top_banner').height($('#top_banner').width() * 460 / 750); + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + //为你推荐 + getRecommend(page, pagesize); + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + }) + setInterval(function() { + + $('.add_top_left img').height($('.add_top_left img').width()); + $('.add_top_right_con img').height($('.add_top_right_con img').width()); + $('.add_bottom_con img').height($('.add_bottom_con img').width()); + + $('.rcb_img').height($('.rcb_img').width()); + + }, 100) + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + // $('#search').css('color', 'black'); + // $('#keyword').css('color', 'black'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + // $('#search').css('color', 'white'); + // $('#keyword').css('color', 'white'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + + }) + //轮播图跳转 + $('#top_banner').on('tap', '.swiper-slide', function() { + openAds($(this)); + }) + + var num = 0; + + + mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == 5) { + url = 'classify.html'; + } + + mui.openWindow({ + url: url, + id: url, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + from_id, + classifyId: classifyId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) + + + + //搜索 + $('#keyword').on('focus', function() { + $(".search button").css('display', 'block'); + }) + $('#keyword').on('blur', function() { + $(".search button").css('display', 'none'); + }) + $(".search button").on('tap', function() { + var searchName = $('#keyword').val(); + var url = ''; + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName, + from_id, + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }) + $("#keyword").on('keypress', function(e) { + var keycode = e.keyCode; + var searchName = $(this).val(); + var url = ''; + if (keycode == '13') { + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + from_id, + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + } + }); + }) diff --git a/static/app2/js/home_new.js b/static/app2/js/home_new.js old mode 100755 new mode 100644 index 190b5b5..8cd0109 --- a/static/app2/js/home_new.js +++ b/static/app2/js/home_new.js @@ -1,452 +1,452 @@ - -var timestamp1 = Date.parse(new Date()); -//$('.getquan').css('display', 'none'); -$('#search').css('width', '82%'); -$('#search').css('left', '5%'); -$('.searchimg').css('left', '8%'); -//$('.time').css('display', 'none'); -//首页navId -$('.class_block').eq(0).attr('data-classifyId', 0); -$('.class_block').eq(1).attr('data-classifyId', 2); -$('.class_block').eq(2).attr('data-classifyId', 4); -$('.class_block').eq(3).attr('data-classifyId', 3); -$('.class_block').eq(4).attr('data-classifyId', 9); -$('.class_block').eq(5).attr('data-classifyId', 1); -$('.class_block').eq(6).attr('data-classifyId', 10); -$('.class_block').eq(7).attr('data-classifyId', 11); -$('.class_block').eq(8).attr('data-classifyId', 12); -$('.class_block').eq(9).attr('data-classifyId', ''); -var $uList = $(".scroll-box ul"); -var timer = null; -//触摸清空定时器 -$uList.hover(function() { - clearInterval(timer); - }, - function() { //离开启动定时器 - timer = setInterval(function() { - scrollList($uList); - }, - 2000); - }).trigger("mouseleave"); //自动触发触摸事件 -//滚动动画 -function scrollList(obj) { - //获得当前
    • 的高度 - var scrollHeight = $("ul li:first").height(); - //滚动出一个
    • 的高度 - $uList.stop().animate({ - marginTop: -scrollHeight - }, - 600, - function() { - //动画结束后,将当前
        marginTop置为初始值0状态,再将第一个
      • 拼接到末尾。 - $uList.css({ - marginTop: 0 - }).find("li:first").appendTo($uList); - }); -} - -$('.bcon_left').height($('.bcon_left').width() * 345 / 185); - -$('.bcr_block').height($('.bcr_block').width()); -$('.addsct_block').height($('.addsct_block').width() * 225 / 355); -$('.addscb_block').height($('.addscb_block').width() * 260 / 180); - -var page = 1; -var pagesize = 10; -var isjiazai = 1; - -function getRecommend(page, pagesize) { - var recommenddata = { - page: page ? page : 1, - pagesize: pagesize ? pagesize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - mui.ajax(qlgUrl('app/index/getHotGoods'), { - data: recommenddata, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data); - - // var data = toJson(data, 1); - if (data.status == 1) { - //console.log(data); - - var html = ''; - var data = data.data; - if (data.Rows == '') { - $('.mui-scroll').append('

        没有更多商品

        '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - - html += '
        自营' + this.goodsName + '
        ¥' + this.shopPrice + - ' 满减
        '+this.saleNum+'人购买
        优惠率   '+this.discountRate+'%
        '; - }); - - if (page == 1) { - $('#recommend_con').html(html); - } else { - $('#recommend_con').append(html); - } - isjiazai = 1; - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - - } else { - // //console.log(2) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - -} - - -//滚动动画 -function scrollList(obj) { - //获得当前
      • 的高度 - var scrollHeight = $("ul li:first").height(); - //滚动出一个
      • 的高度 - $uList.stop().animate({ - marginTop: -scrollHeight - }, - 600, - function() { - //动画结束后,将当前
          marginTop置为初始值0状态,再将第一个
        • 拼接到末尾。 - $uList.css({ - marginTop: 0 - }).find("li:first").appendTo($uList); - }); -} -mui.plusReady(function() { - var ua = navigator.userAgent.toLowerCase(); - var issx = 0; - - if (timestamp1 <= 1550678400000) { - //活动弹窗 - var lxy_div = - '
          '; - - $('body').append(lxy_div); - } - //点击让遮罩层消失 - mui('body').on('tap', '#home_zhezhao', function() { - $('#home_zhezhao').css('display', 'none'); - }); - - //跳转活动会场 - mui('#home_zhezhao').on('tap', '.lxy_zz', function() { - mui.openWindow({ - url: 'journalism_con.html', - id: 'journalism_con.html21', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - }, - extras: { - data_articleId: 21 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, - waiting: {} - }) - }); -// 点击扫一扫 -$('.saoyisao').on('tap',function () { - JZL.openWindow('saoyisao.html','saoyisao.html') -}) - - //bannerTop - mui.ajax(qlgUrl('app/appport/appBanner'), { - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - var html = ''; - var data = data.data; - $.each(data, function() { - html += '
          '; - }); - $('#top_banner .swiper-wrapper').html(html); - var swiper = new Swiper('#top_banner', { - pagination: '#top_banner_pagination', - spaceBetween: 0, - loop: true, - autoplay: 3500, - autoplayDisableOnInteraction: false - }); - // console.log($('#top_banner').width()); - var topBannerheight=($('#top_banner').width() )* 460 / 750; - // console.log(topBannerheight); - $('#top_banner').height(($('#top_banner').width() )* 460 / 750); - localStorage.setItem('topBannerheight',topBannerheight) - } else { - // //console.log(data.status) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - //为你推荐 - getRecommend(page, pagesize); - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - // 判断默认行为是否可以被禁用 - if (e.cancelable) { - // 判断默认行为是否已经被禁用 - if (!e.defaultPrevented) { - e.preventDefault(); - } - } - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pagesize); - } - } - if (-scroll.y < 0) { - num = 0; - } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { - num = -scroll.y / 150; - } else { - num = 1; - } - $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') - - if (-scroll.y < 75) { - $('.saoyisao').attr('src', '../img/saoyisao.png'); - $('.msg').attr('src', '../img/icon_msg.png'); - $('.search').attr('src', '../img/icon_search.png'); - $('#search').css('background-color', 'white'); - // $('#search').css('color', 'black'); - // $('#keyword').css('color', 'black'); - $('.header').removeClass('shadown_wai'); - } else { - $('.saoyisao').attr('src', '../img/saoyisao1.png'); - $('.msg').attr('src', '../img/icon_msg1.png'); - $('.search').attr('src', '../img/icon_search1.png'); - $('#search').css('background-color', '#d8d8d8'); - // $('#search').css('color', 'white'); - // $('#keyword').css('color', 'white'); - $('.header').addClass('shadown_wai'); - } - - if (scroll.y > 80 && issx == 0) { - issx = 1; - setTimeout(function() { - location.reload() - }, 1000) - } - }, false) - setInterval(function() { - - $('.add_top_left img').height($('.add_top_left img').width()); - $('.add_top_right_con img').height($('.add_top_right_con img').width()); - $('.add_bottom_con img').height($('.add_bottom_con img').width()); - - $('.rcb_img').height($('.rcb_img').width()); - - }, 100) - //轮播图跳转 - $('#top_banner').on('tap', '.swiper-slide', function() { - openAds($(this)); - }) - - mui('body').on('tap', '.bannerAdd', function() { - localStorage.setItem('aaaaaa', 1); - }) - mui('.classify').on('tap', '.class_block', function() { - var classifyId = $(this).attr('data-classifyId'); - var url = 'orSupermarket.html'; - - if (classifyId == 0) { - url = 'self_shop.html'; - } - if (classifyId == '') { - url = 'classify.html'; - } - - mui.openWindow({ - url: url, - id: url, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - }, - extras: { - classifyId: classifyId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, - waiting: {} - }) - }) -// mui('body').on('tap', '.add_bcr', function() { -// //var brandId = $(this).attr('data-brandId'); -// -// // openAds($(this)); -// mui.openWindow({ -// url: 'storeout.html', -// id: 'storeout.html' + shopId, -// styles: { -// top: '0px', //新页面顶部位置 -// bottom: '0px', //新页面底部位置 -// }, -// extras: { -// shopId: shopId -// // ..... //自定义扩展参数,可以用来处理页面间传值 -// }, -// createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 -// show: {}, -// waiting: {} -// }) -// }) - - - //领券 - mui('body').on('tap', '.getquan', function() { - if (timestamp1 >= 1542470400000) { - mui.alert('敬请期待!'); - return; - } - mui.openWindow({ - url: 'god_ect.html', - id: 'god_ect.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - }, - extras: { - // data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, - waiting: {} - }) - }) - - //搜索 - $('#keyword').on('focus', function() { - $(".search button").css('display', 'block'); - }) - $('#keyword').on('blur', function() { - $(".search button").css('display', 'none'); - }) - $(".search button").on('tap', function() { - var searchName = $('#keyword').val(); - var url = ''; - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - // //console.log($('.search select').val()) - if ($('.search select').val() == 0) { - url = 'goodslist.html'; - } else if ($('.search select').val() == 1) { - url = 'shopsList.html'; - } - - mui.openWindow({ - url: url, - id: url + searchName, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) -$('#keyword').val("") - }) - $("#keyword").on('keypress', function(e) { - var keycode = e.keyCode; - var searchName = $(this).val(); - var url = ''; - if (keycode == '13') { - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - // //console.log($('.search select').val()) - if ($('.search select').val() == 0) { - url = 'goodslist.html'; - } else if ($('.search select').val() == 1) { - url = 'shopsList.html'; - } - - mui.openWindow({ - url: url, - id: url + searchName, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - } - }); -}) + +var timestamp1 = Date.parse(new Date()); +//$('.getquan').css('display', 'none'); +$('#search').css('width', '82%'); +$('#search').css('left', '5%'); +$('.searchimg').css('left', '8%'); +//$('.time').css('display', 'none'); +//首页navId +$('.class_block').eq(0).attr('data-classifyId', 0); +$('.class_block').eq(1).attr('data-classifyId', 2); +$('.class_block').eq(2).attr('data-classifyId', 4); +$('.class_block').eq(3).attr('data-classifyId', 3); +$('.class_block').eq(4).attr('data-classifyId', 9); +$('.class_block').eq(5).attr('data-classifyId', 1); +$('.class_block').eq(6).attr('data-classifyId', 10); +$('.class_block').eq(7).attr('data-classifyId', 11); +$('.class_block').eq(8).attr('data-classifyId', 12); +$('.class_block').eq(9).attr('data-classifyId', ''); +var $uList = $(".scroll-box ul"); +var timer = null; +//触摸清空定时器 +$uList.hover(function() { + clearInterval(timer); + }, + function() { //离开启动定时器 + timer = setInterval(function() { + scrollList($uList); + }, + 2000); + }).trigger("mouseleave"); //自动触发触摸事件 +//滚动动画 +function scrollList(obj) { + //获得当前
        • 的高度 + var scrollHeight = $("ul li:first").height(); + //滚动出一个
        • 的高度 + $uList.stop().animate({ + marginTop: -scrollHeight + }, + 600, + function() { + //动画结束后,将当前
            marginTop置为初始值0状态,再将第一个
          • 拼接到末尾。 + $uList.css({ + marginTop: 0 + }).find("li:first").appendTo($uList); + }); +} + +$('.bcon_left').height($('.bcon_left').width() * 345 / 185); + +$('.bcr_block').height($('.bcr_block').width()); +$('.addsct_block').height($('.addsct_block').width() * 225 / 355); +$('.addscb_block').height($('.addscb_block').width() * 260 / 180); + +var page = 1; +var pagesize = 10; +var isjiazai = 1; + +function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + mui.ajax(qlgUrl('app/index/getHotGoods'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data); + + // var data = toJson(data, 1); + if (data.status == 1) { + //console.log(data); + + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.mui-scroll').append('

            没有更多商品

            '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
            自营' + this.goodsName + '
            ¥' + this.shopPrice + + ' 满减
            '+this.saleNum+'人购买
            优惠率   '+this.discountRate+'%
            '; + }); + + if (page == 1) { + $('#recommend_con').html(html); + } else { + $('#recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + } else { + // //console.log(2) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + +} + + +//滚动动画 +function scrollList(obj) { + //获得当前
          • 的高度 + var scrollHeight = $("ul li:first").height(); + //滚动出一个
          • 的高度 + $uList.stop().animate({ + marginTop: -scrollHeight + }, + 600, + function() { + //动画结束后,将当前
              marginTop置为初始值0状态,再将第一个
            • 拼接到末尾。 + $uList.css({ + marginTop: 0 + }).find("li:first").appendTo($uList); + }); +} +mui.plusReady(function() { + var ua = navigator.userAgent.toLowerCase(); + var issx = 0; + + if (timestamp1 <= 1550678400000) { + //活动弹窗 + var lxy_div = + '
              '; + + $('body').append(lxy_div); + } + //点击让遮罩层消失 + mui('body').on('tap', '#home_zhezhao', function() { + $('#home_zhezhao').css('display', 'none'); + }); + + //跳转活动会场 + mui('#home_zhezhao').on('tap', '.lxy_zz', function() { + mui.openWindow({ + url: 'journalism_con.html', + id: 'journalism_con.html21', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + data_articleId: 21 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }); +// 点击扫一扫 +$('.saoyisao').on('tap',function () { + JZL.openWindow('saoyisao.html','saoyisao.html') +}) + + //bannerTop + mui.ajax(qlgUrl('app/appport/appBanner'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
              '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + // console.log($('#top_banner').width()); + var topBannerheight=($('#top_banner').width() )* 460 / 750; + // console.log(topBannerheight); + $('#top_banner').height(($('#top_banner').width() )* 460 / 750); + localStorage.setItem('topBannerheight',topBannerheight) + } else { + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + //为你推荐 + getRecommend(page, pagesize); + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // 判断默认行为是否可以被禁用 + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + // $('#search').css('color', 'black'); + // $('#keyword').css('color', 'black'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + // $('#search').css('color', 'white'); + // $('#keyword').css('color', 'white'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + }, false) + setInterval(function() { + + $('.add_top_left img').height($('.add_top_left img').width()); + $('.add_top_right_con img').height($('.add_top_right_con img').width()); + $('.add_bottom_con img').height($('.add_bottom_con img').width()); + + $('.rcb_img').height($('.rcb_img').width()); + + }, 100) + //轮播图跳转 + $('#top_banner').on('tap', '.swiper-slide', function() { + openAds($(this)); + }) + + mui('body').on('tap', '.bannerAdd', function() { + localStorage.setItem('aaaaaa', 1); + }) + mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == 0) { + url = 'self_shop.html'; + } + if (classifyId == '') { + url = 'classify.html'; + } + + mui.openWindow({ + url: url, + id: url, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + classifyId: classifyId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) +// mui('body').on('tap', '.add_bcr', function() { +// //var brandId = $(this).attr('data-brandId'); +// +// // openAds($(this)); +// mui.openWindow({ +// url: 'storeout.html', +// id: 'storeout.html' + shopId, +// styles: { +// top: '0px', //新页面顶部位置 +// bottom: '0px', //新页面底部位置 +// }, +// extras: { +// shopId: shopId +// // ..... //自定义扩展参数,可以用来处理页面间传值 +// }, +// createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 +// show: {}, +// waiting: {} +// }) +// }) + + + //领券 + mui('body').on('tap', '.getquan', function() { + if (timestamp1 >= 1542470400000) { + mui.alert('敬请期待!'); + return; + } + mui.openWindow({ + url: 'god_ect.html', + id: 'god_ect.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + // data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) + + //搜索 + $('#keyword').on('focus', function() { + $(".search button").css('display', 'block'); + }) + $('#keyword').on('blur', function() { + $(".search button").css('display', 'none'); + }) + $(".search button").on('tap', function() { + var searchName = $('#keyword').val(); + var url = ''; + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) +$('#keyword').val("") + }) + $("#keyword").on('keypress', function(e) { + var keycode = e.keyCode; + var searchName = $(this).val(); + var url = ''; + if (keycode == '13') { + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + } + }); +}) diff --git a/static/app2/js/income-details.js b/static/app2/js/income-details.js old mode 100755 new mode 100644 index a43f351..16f6043 --- a/static/app2/js/income-details.js +++ b/static/app2/js/income-details.js @@ -1,20 +1,20 @@ -mui.plusReady(function() { - var self=plus.webview.currentWebview(); - //console.log(self) - var shopId=self.id; - var data_href=self.data_href; - var data_expect=self.data_expect; - if('wait_money' == data_href){ - $('.title')="待收款" - } - if('comp_money' == data_href){ - $('.title')="已收款" - } - - - - - - - +mui.plusReady(function() { + var self=plus.webview.currentWebview(); + //console.log(self) + var shopId=self.id; + var data_href=self.data_href; + var data_expect=self.data_expect; + if('wait_money' == data_href){ + $('.title')="待收款" + } + if('comp_money' == data_href){ + $('.title')="已收款" + } + + + + + + + }) \ No newline at end of file diff --git a/static/app2/js/indent.js b/static/app2/js/indent.js old mode 100755 new mode 100644 index 9d0c5df..661fd0c --- a/static/app2/js/indent.js +++ b/static/app2/js/indent.js @@ -1,42 +1,68 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}) - -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - var data_href = self.data_href; - if(data_href == 'all') { - $('.title').html('全部订单'); - - } - if(data_href == 'waitPay') { - $('.title').html('待付款'); - } - if(data_href == 'waitDeliver') { - $('.title').html('待发货'); - } - if(data_href == 'waitReceive') { - $('.title').html('待收货'); - } - if(data_href == 'waitAppraise') { - $('.title').html('待评价'); - } - if(data_href == 'abnormal') { - $('.title').html('退款/售后'); - } - localStorage.setItem('order_class', data_href); - var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; - var sub = plus.webview.create('indentcon.html', data_href, { - top: bSize, - bottom: '0px', - scrollIndicator: 'none' - }); - self.append(sub); - +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}) + +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + var data_href = self.data_href; + if(data_href == 'all') { + $('.title').html('全部订单'); + } + if(data_href == 'waitPay') { + $('.title').html('待付款'); + } + if(data_href == 'waitDeliver') { + $('.title').html('待发货'); + } + if(data_href == 'waitReceive') { + $('.title').html('待收货'); + } + if(data_href == 'waitAppraise') { + $('.title').html('待评价'); + } + if(data_href == 'abnormal') { + $('.title').html('退款/售后'); + } + if(data_href == 'zgall') { + $('.title').html('助购吧全部订单'); + } + if(data_href == 'zgwaitDeliver') { + $('.title').html('助购吧待发货'); + } + if(data_href == 'zgwaitReceive') { + $('.title').html('助购吧待收货'); + } + if(data_href == 'zgwaitAppraise') { + $('.title').html('助购吧待评价'); + } + if(data_href == 'zgabnormal') { + $('.title').html('助购吧退款售后'); + } + if(data_href == 'mzgwaitConfirm') { + $('.title').html('我的助购吧待确认'); + } + if(data_href == 'mzgwaitPaid') { + $('.title').html('我的助购吧待付款'); + } + if(data_href == 'mzgwaitUpload') { + $('.title').html('我的助购吧待上传凭证'); + } + if(data_href == 'mzgwaitReceive') { + $('.title').html('我的助购吧待收货'); + } + localStorage.setItem('order_class', data_href); + var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var sub = plus.webview.create('indentcon.html', data_href, { + top: bSize, + bottom: '0px', + scrollIndicator: 'none' + }); + self.append(sub); + }) \ No newline at end of file diff --git a/static/app2/js/indentcon.js b/static/app2/js/indentcon.js old mode 100755 new mode 100644 index 7a93b48..5c4ad3b --- a/static/app2/js/indentcon.js +++ b/static/app2/js/indentcon.js @@ -1,939 +1,986 @@ -$('#content').after('
              '); -var pay_name = 0; -var token = localStorage.getItem('token'); -var order_class = localStorage.getItem('order_class'); -var orderNo; -var orderId; -var getReasonUrl = ''; -var priceT = 0; -var payCode = ''; -var wxChannel = null; // 微信支付 -var aliChannel = null; // 支付宝支付 -var channel = null; //支付通道 -mui.init({ - pullRefresh: { - container: '#pullrefresh', - down: { - style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 - color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 - height: '50px', //可选,默认50px.下拉刷新控件的高度, - range: '100px', //可选 默认100px,控件可下拉拖拽的范围 - offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 - // auto: true, //可选,默认false.首次加载自动上拉刷新一次 - contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 - contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 - contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 - contentnomore: '没有更多数据了', - callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; - }, - up: { - contentrefresh: '正在加载...', - callback: pullupRefresh - } - } -}); -var count = 1; - -function pullupRefresh() { - count += 1; - getData(count); - mui('#pullrefresh').pullRefresh().endPullupToRefresh(); -} - -/** - * 下拉刷新具体业务实现 - */ -function pulldownRefresh() { - setTimeout(function() { - window.location.reload(); - //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed - }, 1500); -} -var isLoad = false; - -function getData(page) { - if (true == isLoad) return; - isLoad = true; - JZL.ajax(qlgUrl('app/Orders/getOrderList'), { - type: order_class, - page: page, - pagesize: 10 - }, function(data) { - //console.log(data); - var data = toJson(data); - var html = '' - if ('' == data.data.Rows) { - mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); - return; - } - $.each(data.data.Rows, function() { - //this.pay_name = 1; - var shopConfirmHtml = ''; - if (this.orderStatus == 0) { - if (0 == this.shopConfirm) { - shopConfirmHtml = '
              待商家确认
              '; - } else if (1 == this.shopConfirm) { - shopConfirmHtml = '
              商家已确认
              '; - } else if (2 == this.shopConfirm) { - shopConfirmHtml = '
              商家未收款
              '; - } - } - html += '
              ' + this.shopName + - '
              商家电话:' + this.phone + '
              ' + shopConfirmHtml + '
              ' + - this.status + '
              ' - $.each(this.list, function() { - html += '

              ' + this.goodsName + '

              ' + this.goodsSpecNames + - '

              ¥' + this.goodsPrice + '

              ¥' + this.marketPrice + 'x' + - this.goodsNum + '
              '; - }) - html += '
              共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney + - '(含运费¥' + this.deliverMoney + ')
              '; - if (this.orderStatus == -2) { - html += '
              立即付款
              取消订单
              '; - } else if (this.orderStatus == 0) { - html += '
              上传凭证
              '; - if (this.noticeDeliver == 0) { - html += '
              取消订单
              '; - } else { - html += '
              取消订单
              '; - } - - } else if (this.orderStatus == 1) { - html += - '
              确认收货
              查看物流
              拒收
              延长收货
              '; - } else if (this.orderStatus == 2) { - if (this.isAppraise == 0) { - html += '
              立即评价
              '; - } else { - html += '
              查看评价
              '; - } - - } - if (this.orderStatus != 1 && this.orderStatus != -2 && this.isComplain == 0) { - html += '
              投诉
              '; - } - if (this.allowRefund == 1 && (this.orderStatus == -1 || this.orderStatus == -3)) { - html += '
              申请退款
              '; - } - - html += '
              ' - }) - - $('.con').append(html); - isLoad = false; - }) -} -mui.plusReady(function() { - - // window.addEventListener('refresh', function(e) { //执行刷新 - // location.reload(); - // }); - // //console.log(order_class) - if (order_class == 'all') { - order_class = ''; - } - getData(count); - - //支付插件 - plus.payment.getChannels(function(channels) { - for (var i in channels) { - if (channels[i].id == "wxpay") { - wxChannel = channels[i]; - } else { - aliChannel = channels[i]; - } - } - }, function(e) { - mui.alert("获取支付通道失败:" + e.message); - }); - // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; - var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=0&orderNo='); - // 2. 发起支付请求 - function pay(id, orderNo) { - // 从服务器请求支付订单 - var PAYSERVER = ''; - if (id == 'alipay') { - PAYSERVER = ALIPAYSERVER; - channel = aliChannel; - } else if (id == 'wxpay') { - PAYSERVER = WXPAYSERVER; - channel = wxChannel; - } else { - plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); - return; - } - var xhr = new XMLHttpRequest(); - // var amount = 1; - - xhr.onreadystatechange = function() { - switch (xhr.readyState) { - case 4: - if (xhr.status == 200) { - plus.payment.request(channel, xhr.responseText, function(result) { - plus.nativeUI.alert("支付成功!", function() { - // back(); - var targetTab = plus.webview.getWebviewById("templete/my.html"); - mui.fire(targetTab, 'refresh'); - location.reload(); - }); - }, function(error) { - // plus.nativeUI.alert("支付失败:" + error.code); - // plus.webview.getWebviewById('confirmOrder.html').close() - }); - } else { - mui.alert("获取订单信息失败!"); - //console.log(xhr.status) - } - break; - default: - break; - } - } - xhr.open('GET', PAYSERVER + orderNo); - xhr.send(); - - } - $('#pay_way,.pay_info .con_1').append( - '

              付款方式

              线下支付

              ' - ); - - // mui.ajax(hyhUrl('/app/Users/get_name_and_money'), { - // headers: { - // "HYH-Token": token - // }, - // data: {}, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // // //console.log(data) - // data = toJson(data); - // - // if(data.status == 1) { - // $('#loginName').html(data.data.name); - // $('.userMoney').html(data.data.money); - // var htmlpay = '

              ECT余额:' + data.data.userECT + '

              '; - // $('.pay_info .con_1').append(htmlpay); - // } else { - // mui.alert('发生错误请刷新后重试!'); - // // location.reload(); - // } - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }) - $('.con').on('tap', '.ljfk', function() { - var that = $(this); - pay_name = $(this).attr('data-payName'); - priceT = $(this).parent().siblings('.combination').children('o').html().slice(1); - $('#goodsTotalMoney').html($(this).parent().siblings('.combination').children('o').html()) - orderNo = $(this).parent().parent().attr('data-orderNo'); - if (pay_name == 1) { - $('.pay_info .con_1 .row').eq(1).attr('style', 'display: none;'); - $('.pay_info .con_1 .row').eq(2).addClass('on'); - that.attr('disabled', 'disabled'); - mui.ajax(hqlgUrl('app/ect/getToEctNum'), { - - data: { - total_money: priceT - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - var btnArray = ['是', '否']; - mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { - if (e.index == 1) { - return; - } else { - $('.bg').css('display', 'block'); - $(".pay").slideDown(300); - } - that.removeAttr('disabled'); - }) - } else { - mui.alert(data.msg); - that.removeAttr('disabled'); - return; - } - - } - }) - } else { - $('.pay_info .con_1 .row').eq(1).addClass('on'); - $('.pay_info .con_1 .row').eq(2).attr('style', 'display: none;'); - $('.bg').css('display', 'block'); - $(".pay").slideDown(300); - } - - }) - - $('.bg').on('tap', '.mui-icon-left-nav', function() { - $('.pay').css('display', 'block'); - $('.pay_way').css('display', 'none'); - }) - $('.bg').on('tap', '.mui-icon-closeempty', function() { - $('.bg').css('display', 'none'); - $(".pay").slideUp(300, function() { - - }); - }) - $('#pay_way').on('tap', '.row', function() { - $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); - $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); - $('.con_1 .on .row_right o').html($(this).children('.row_left').html()); - $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode')) - $('.pay').css('display', 'block'); - $('#pay_way').css('display', 'none'); - - }) - $('.pay').on('tap', '.con_1 .on', function() { - if ($(this).attr('data-payCode') == 'ect') { - - } else { - $('.pay').css('display', 'none'); - $('#pay_way').css('display', 'block'); - } - - }) - $('.pay_btn').on('tap', function() { - payCode = $('.con_1 .on').attr('data-payCode'); - ////console.log(payCode) - var that = $(this); - var data_ljfk = { - isBatch: 0, - orderNo: orderNo - } - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/orders/succeed'), { - data: data_ljfk, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - data = toJson(data); - - if (data.status == 1) { - if (payCode == 'qlgpay') { - JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { - orderNo: orderNo, - isBatch: 0 - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(JSON.stringify(data)); - var data = toJson(data); - // //console.log(JSON.stringify(data)) - if (data.status == 1) { - $('.pay').css('display', 'none'); - $('#qlg_pay_pwd').css('display', 'block'); - if (data.data.payPwd == '0') { - mui.alert('还未设置支付密码请先设置操作密码!'); - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - //return; - } - $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); - $('#productNum').val(data.data.product.useProduct); - if (data.data.product.useProduct > 0) { - var html1 = '

              抵扣额' + data.data.product.useProductOk + - '

              扣税 ' + data.data.product.useProductTaxFee + - '

              手续费 ' + data.data.product.useProductHandlingFee + - '

              '; - // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + - // ',手续费:' + data.data.product.useProductHandlingFee + ']'); - $('.productInfo_').html(html1) - - } - $('#couponsNum').val(data.data.coupons.useCoupons); - if (data.data.coupons.useCoupons > 0) { - var html2 = '

              抵扣额' + data.data.coupons.useCouponsOk + - '

              扣税 ' + data.data.coupons.useCouponsTaxFee + - '

              手续费 ' + data.data.coupons.useCouponsHandlingFee + - '

              '; - $('.couponsInfo_').html(html2) - // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + - // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); - } - $('#wangNum').val(data.data.wang.useWang); - $('#moneyNum').val(data.data.money.useMoney); - - } else { - mui.alert(data.msg) - } - }); - } else if (payCode == 'wallets' || payCode == 'ect') { - //跳输入密码的页面 - mui.ajax(hyhUrl('app/' + payCode + '/payment'), { - data: { - orderNo: orderNo, - isBatch: 0 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - var data = toJson(data); - if (data.status == 1) { - $('.pay').css('display', 'none'); - $('#pay_pwd').css('display', 'block'); - if (data.data.payPwd == '0') { - mui.alert('还未设置支付密码请先设置支付密码!'); - var url = 'setting_fogetPayPwd'; - mui.openWindow({ - url: url + '.html', - id: url + '.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - } else if (payCode == 'alipays') { - pay('alipay', orderNo); - // plus.nativeUI.showWaiting(); - // mui.post(hyhUrl('app/Alipays/payment'), { - // orderNo: data.data, - // isBatch: 1 - // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); - - } - - that.removeAttr('disabled'); - } else { - mui.alert(data.msg) - // mui.alert('发生错误请刷新后重试!'); - // location.reload(); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - mui.alert(type); - } - }) - }) - $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { - var url = 'setting_fogetPayPwd'; - JZL.openWindow(url + '.html', url + '.html'); - }) - $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { - // var self = plus.webview.currentWebview(); - // var data_href = self.id; - // //console.log(data_href) - // JZL.closeWindow('waitPay'); - //return; - var payPwd = $('#payPwd').val(); - if (payPwd == '') { - mui.alert('支付密码不能为空!'); - return; - } - var that = $(this); - that.attr('disabled', 'disabled') - var srcc = '' - if (payCode == 'qlgpay') { - srcc = 'payByQlg'; - } else if (payCode == 'ect') { - srcc = 'payByEct'; - } else { - srcc = 'payByWallet'; - } - - mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { - - data: { - orderNo: orderNo, - isBatch: 0, - payPwd: payPwd - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - var data = toJson(data); - mui.alert(data.msg) - //console.log(data.status) - if (data.status == 1) { - JZL.openWindow('indent.html', 'waitDeliver', { - data_href: 'waitDeliver' - }); - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - // JZL.closeWindow('indent.html'); - }, 700) - // var targetTab = plus.webview.getWebviewById("templete/my.html"); - // mui.fire(targetTab, 'refresh'); - // location.reload(); - } else { - - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - - mui('.con').on('tap', '.row_con', function() { - var data_order_id = $(this).attr('data-id'); - mui.openWindow({ - url: 'order_out.html', - id: 'order_out.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: data_order_id - // data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.con').on('tap', '.ckwl', function() { - var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); - JZL.openWindow('logistics.html', 'logistics.html', { - data_order_id: data_order_id - }); - }) - //上传凭证 - mui('.con').on('tap', '.uploadCertificate', function() { - var orderId = $(this).parent().parent().attr('data-id'); - // mui.alert('跳到上传凭证页'+orderId) - - JZL.openWindow('uploadVoucher.html', 'uploadVoucher.html' + orderId, { - orderId: orderId - }); - - }) - $('.con').on('tap', '.qxdd_js', function() { - orderNo = $(this).parent().parent().attr('data-orderNo'); - orderId = $(this).parent().parent().attr('data-id'); - if ($(this).html() == '取消订单') { - getReasonUrl = 'getCancelCause'; - } else if ($(this).html() == '拒收') { - getReasonUrl = 'getRejectCause'; - } else if ($(this).html() == '申请退款') { - getReasonUrl = 'getRefundCause'; - JZL.ajax(hyhUrl('/app/Orders/getRefund'), { - id: orderId - }, function(data) { //服务器返回响应 - // //console.log(JSON.stringify(data)); - var data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('qlgpay' == data.payFrom) { - html = ' 退款产品券数量:' + - ' 退款优惠券数量:' + - ' 退款旺旺券数量:' + - ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + - // '

              (金额不能超过¥' + data.realTotalMoney + - ')

              '; - } else { - html = '

              (金额不能超过¥' + data.realTotalMoney + - ')

              (积分数量:' + data.ectNum + ')

              '; - } - - $('.tui').html(html) - } else { - mui.alert(data.msg) - } - }); - } - $('.bg_').css('display', 'block'); - $('.bg_con').css('display', 'none'); - $('.bg_con').slideDown(300, function() {}); - - mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - var html = ''; - $.each(data.data, function() { - html += '' - }); - $('#select').html(html) - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - - $('.bg_').on('tap', '.en_false', function() { - $('.bg_').css('display', 'none'); - - }) - $('.bg_').on('tap', '.en_true', function() { - var setReasonUrl = ''; - var content = $('#content').val(); - var reason = $('#select').val(); - if ($('#select').val() == 0) { - mui.alert('请选择原因!'); - return; - } - if ($('#select').val() == 10000 && content == '') { - mui.alert('请输入其他原因!'); - return; - } - if (getReasonUrl == 'getCancelCause') { - setReasonUrl = 'cancellation'; - mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { - data: { - reason: reason, - id: orderId, - content: content - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - // mui.fire(list, 'refresh'); - if ('waitPay' == plus.webview.currentWebview().id) { - location.reload(); - } else { - JZL.openWindow('indent.html', 'abnormal', { - data_href: 'abnormal' - }); - setTimeout(function() { - //plus.webview.currentWebview().close(); - JZL.closeWindow(plus.webview.currentWebview().id); - }, 500) - } - // JZL.openWindow('indent.html', 'abnormal', { - // data_href: 'abnormal' - // }); - // setTimeout(function() { - // plus.webview.currentWebview().close(); - // // JZL.closeWindow(plus.webview.currentWebview().id); - // }, 500) - //location.reload(); - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else if (getReasonUrl == 'getRejectCause') { - setReasonUrl = 'reject'; - mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { - data: { - reason: reason, - id: orderId, - content: content - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - // mui.fire(list, 'refresh'); - location.reload(); - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else if (getReasonUrl == 'getRefundCause') { - var params = {} - // params.money = $('#Tmoney').val(); - // if (params.money < 0 || params.money == 0) { - // mui.alert('退款金额不能为0!'); - // return; - // } - params.productNum = $('#productNum').val(); - params.couponsNum = $('#couponsNum').val(); - params.wangNum = $('#wangNum').val(); - params.reason = reason; - params.id = orderId; - params.content = content; - JZL.ajax(qlgUrl('app/Orderrefunds/refund'), params, function(data) { - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload(); - - } - }) - - } - - }) - - $('.con').on('tap', '.yssh', function() { - orderNo = $(this).parent().parent().attr('data-orderNo'); - orderId = $(this).parent().parent().attr('data-id'); - if (confirm('你要延长收货么?')) { - mui.ajax(qlgUrl('/app/orders/delay'), { - headers: { - "HYH-Token": token - }, - data: { - id: orderId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - ////console.log(data.data.goodsFavoritesNum) - ////console.log(data.data.Rows) - var data = toJson(data); - ////console.log(data.status) - if (data.status == 1) { - mui.alert(data.msg); - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - } - }) - - $('.con').on('tap', '.qrsh', function() { - //$('.bg_').css('display', 'block'); - orderNo = $(this).parent().parent().attr('data-orderNo'); - orderId = $(this).parent().parent().attr('data-id'); - if (confirm('确认收货?')) { - mui.ajax(hyhUrl('/app/Orders/receive'), { - headers: { - "HYH-Token": token - }, - data: { - id: orderId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - ////console.log(data.data.goodsFavoritesNum) - ////console.log(data.data.Rows) - var data = toJson(data); - ////console.log(data.status) - if (data.status == 1) { - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload() - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - } - - }) - $('#select').on('change', function() { - if ($(this).val() == '10000') { - $('#content').css('display', 'block'); - } else { - $('#content').css('display', 'none'); - } - }) - //跳转到评价 - mui('.con').on('tap', '.ljpj', function() { - var oId = $(this).parent().parent().attr('data-id'); - mui.openWindow({ - url: 'pj.html', - id: 'pj.html' + oId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: oId - // data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - //跳转到评价 - mui('.con').on('tap', '.ckpj', function() { - var oId = $(this).parent().parent().attr('data-id'); - mui.openWindow({ - url: 'pj.html', - id: 'pj.html' + oId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: oId - // data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - //跳转到评价 - mui('.con').on('tap', '.tsdd', function() { - var oId = $(this).parent().parent().attr('data-id'); - mui.openWindow({ - url: 'complain.html', - id: 'complain.html' + oId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: oId - // data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - +$('#content').after('
              '); +var pay_name = 0; +var token = localStorage.getItem('token'); +var order_class = localStorage.getItem('order_class'); +var orderNo; +var orderId; +var getReasonUrl = ''; +var priceT = 0; +var payCode = ''; +var wxChannel = null; // 微信支付 +var aliChannel = null; // 支付宝支付 +var channel = null; //支付通道 +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + contentnomore: '没有更多数据了', + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + } + } +}); +var count = 1; + +function pullupRefresh() { + count += 1; + getData(count); + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); +} + +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +var isLoad = false; + +function getData(page) { + if (true == isLoad) return; + isLoad = true; + JZL.ajax(qlgUrl('app/Orders/getOrderList'), { + type: order_class, + page: page, + pagesize: 10 + }, function(data) { + var data = toJson(data); + var html = '' + if ('' == data.data.Rows) { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); + $('.con').append("
              无数据
              "); + return; + } + $.each(data.data.Rows, function() { + //this.pay_name = 1; + var shopConfirmHtml = ''; + if (this.orderStatus == 0) { + if (0 == this.shopConfirm) { + shopConfirmHtml = '
              待商家确认
              '; + } else if (1 == this.shopConfirm) { + shopConfirmHtml = '
              商家已确认
              '; + } else if (2 == this.shopConfirm) { + shopConfirmHtml = '
              商家未收款
              '; + } + } + html += '
              ' + this.shopName + + '
              商家电话:' + this.phone + '
              ' + shopConfirmHtml + '
              ' + + this.status + '
              ' + $.each(this.list, function() { + html += '

              ' + this.goodsName + '

              ' + this.goodsSpecNames + + '

              ¥' + this.goodsPrice + '

              ¥' + this.marketPrice + 'x' + + this.goodsNum + '
              '; + }) + html += '
              共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney + + '(含运费¥' + this.deliverMoney + ')
              '; + if(this.goodsType == 3){ + html += '
              由第'+this.helpUserLevel+'层助购
              '; + } + html += '
              '; + if (this.orderStatus == -2) { + html += '
              立即付款
              取消订单
              '; + } else if (this.orderStatus == 0) { + html += '
              上传凭证
              '; + if (this.noticeDeliver == 0) { + html += '
              取消订单
              '; + } else { + html += '
              取消订单
              '; + } + + } else if (this.orderStatus == 1) { + html += + '
              确认收货
              查看物流
              拒收
              延长收货
              '; + } else if (this.orderStatus == 2) { + if (this.isAppraise == 0) { + html += '
              立即评价
              '; + } else { + html += '
              查看评价
              '; + } + + } + if (this.orderStatus != 1 && this.orderStatus != -2 && this.isComplain == 0) { + html += '
              投诉
              '; + } + if (this.allowRefund == 1 && (this.orderStatus == -1 || this.orderStatus == -3)) { + html += '
              申请退款
              '; + } + + html += '
              ' + }) + $('.con').append(html); + isLoad = false; + }) +} +mui.plusReady(function() { + + // window.addEventListener('refresh', function(e) { //执行刷新 + // location.reload(); + // }); + // //console.log(order_class) + if (order_class == 'all') { + order_class = ''; + } + getData(count); + + //支付插件 + plus.payment.getChannels(function(channels) { + for (var i in channels) { + if (channels[i].id == "wxpay") { + wxChannel = channels[i]; + } else { + aliChannel = channels[i]; + } + } + }, function(e) { + mui.alert("获取支付通道失败:" + e.message); + }); + // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; + var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=0&orderNo='); + // 2. 发起支付请求 + function pay(id, orderNo) { + // 从服务器请求支付订单 + var PAYSERVER = ''; + if (id == 'alipay') { + PAYSERVER = ALIPAYSERVER; + channel = aliChannel; + } else if (id == 'wxpay') { + PAYSERVER = WXPAYSERVER; + channel = wxChannel; + } else { + plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); + return; + } + var xhr = new XMLHttpRequest(); + // var amount = 1; + + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case 4: + if (xhr.status == 200) { + plus.payment.request(channel, xhr.responseText, function(result) { + plus.nativeUI.alert("支付成功!", function() { + // back(); + var targetTab = plus.webview.getWebviewById("templete/my.html"); + mui.fire(targetTab, 'refresh'); + location.reload(); + }); + }, function(error) { + // plus.nativeUI.alert("支付失败:" + error.code); + // plus.webview.getWebviewById('confirmOrder.html').close() + }); + } else { + mui.alert("获取订单信息失败!"); + //console.log(xhr.status) + } + break; + default: + break; + } + } + xhr.open('GET', PAYSERVER + orderNo); + xhr.send(); + + } + $('#pay_way,.pay_info .con_1').append( + '

              付款方式

              线下支付

              ' + ); + + // mui.ajax(hyhUrl('/app/Users/get_name_and_money'), { + // headers: { + // "HYH-Token": token + // }, + // data: {}, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(data) + // data = toJson(data); + // + // if(data.status == 1) { + // $('#loginName').html(data.data.name); + // $('.userMoney').html(data.data.money); + // var htmlpay = '

              ECT余额:' + data.data.userECT + '

              '; + // $('.pay_info .con_1').append(htmlpay); + // } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }) + $('.con').on('tap', '.ljfk', function() { + var that = $(this); + pay_name = $(this).attr('data-payName'); + priceT = $(this).parent().siblings('.combination').children('o').html().slice(1); + $('#goodsTotalMoney').html($(this).parent().siblings('.combination').children('o').html()) + orderNo = $(this).parent().parent().attr('data-orderNo'); + var goodsType = $(this).parent().parent().attr('data-goodsType'); + if (pay_name == 1) { + $('.pay_info .con_1 .row').eq(0).attr('style', 'display: none;'); + $('.pay_info .con_1 .row').eq(2).addClass('on'); + that.attr('disabled', 'disabled'); + mui.ajax(hqlgUrl('app/ect/getToEctNum'), { + + data: { + total_money: priceT + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + var btnArray = ['是', '否']; + mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { + if (e.index == 1) { + return; + } else { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } + that.removeAttr('disabled'); + }) + } else { + mui.alert(data.msg); + that.removeAttr('disabled'); + return; + } + } + }) + } else { + $('.pay_info .con_1 .row').eq(2).addClass('on'); + $('.pay_info .con_1 .row').eq(3).attr('style', 'display: none;'); + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } + $('#loginName').html(localStorage.getItem("userName")); + // 助购层级获取 + if(goodsType == '3'){ + var helpUserId = $(this).parent().parent().attr('data-helpUserId'); + var helpUserLevel = $(this).parent().parent().attr('data-helpUserLevel'); + var helpUserName = $(this).parent().parent().attr('data-helpUserName'); + $("#selectHelpLevel").show().data("user_id", helpUserId).data("user_name", helpUserName); + $("#displayHelpLevel").text("第"+helpUserLevel+"层") + var _tmp = document.getElementById("displayHelpLevel"); + _tmp.dataset["user_id"]=helpUserId; + _tmp.dataset["user_name"]=helpUserName; + _tmp.dataset["level_id"]=helpUserLevel; + JZL.ajax(qlgUrl('app/user_level/TreeList'),{},function(_zgData){ + let _zgHtml = "" + for (let levelId in _zgData) { + let each = _zgData[levelId] + _zgHtml += '
              '+ + '

              '+each.level+'

              ' + } + $("#pay_select_level .con_1").html(_zgHtml) + }) + }else{ + $("#selectHelpLevel").hide(); + } + }) + + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.pay').css('display', 'block'); + $('.pay_way').css('display', 'none'); + }) + $('.bg').on('tap', '.mui-icon-closeempty', function() { + $('.bg').css('display', 'none'); + $(".pay").slideUp(300, function() { + + }); + }) + $('#pay_way').on('tap', '.row', function() { + $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); + $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); + $('.con_1 .on .row_right o').html($(this).children('.row_left').html()); + $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode')) + $('.pay').css('display', 'block'); + $('#pay_way').css('display', 'none'); + + }) + $('.pay').on('tap', '.con_1 .on', function() { + if ($(this).attr('data-payCode') == 'ect') { + + } else { + $('.pay').css('display', 'none'); + $('#pay_way').css('display', 'block'); + } + + }) + // 助购层级选择 + $('.pay').on('tap', '#selectHelpLevel', function() { + $("#pay_select_level").show(); + }) + $("#pay_select_level .con_1").on('tap', '.row', function(e){ + $("#pay_select_level").hide(); + $("#displayHelpLevel").text(this.dataset.level_name) + for(var _k in this.dataset){document.getElementById("displayHelpLevel").dataset[_k] = this.dataset[_k]} + }) + $('.pay_btn').on('tap', function() { + payCode = $('.con_1 .on').attr('data-payCode'); + ////console.log(payCode) + var that = $(this); + var data_ljfk = { + isBatch: 0, + orderNo: orderNo + } + if(document.getElementById("displayHelpLevel").dataset["level_id"] !== undefined){ + data_ljfk["helpLevel"] = document.getElementById("displayHelpLevel").dataset["level_id"] + } + if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){ + data_ljfk["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"] + } + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/orders/succeed'), { + data: data_ljfk, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + + if (data.status == 1) { + if (payCode == 'qlgpay') { + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: orderNo, + isBatch: 0 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + // //console.log(JSON.stringify(data)) + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#qlg_pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置操作密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + //return; + } + $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); + $('#productNum').val(data.data.product.useProduct); + if (data.data.product.useProduct > 0) { + var html1 = '

              抵扣额' + data.data.product.useProductOk + + '

              扣税 ' + data.data.product.useProductTaxFee + + '

              手续费 ' + data.data.product.useProductHandlingFee + + '

              '; + // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + + // ',手续费:' + data.data.product.useProductHandlingFee + ']'); + $('.productInfo_').html(html1) + + } + $('#couponsNum').val(data.data.coupons.useCoupons); + if (data.data.coupons.useCoupons > 0) { + var html2 = '

              抵扣额' + data.data.coupons.useCouponsOk + + '

              扣税 ' + data.data.coupons.useCouponsTaxFee + + '

              手续费 ' + data.data.coupons.useCouponsHandlingFee + + '

              '; + $('.couponsInfo_').html(html2) + // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + + // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); + } + $('#wangNum').val(data.data.wang.useWang); + $('#moneyNum').val(data.data.money.useMoney); + + } else { + mui.alert(data.msg) + } + }); + } else if (payCode == 'wallets' || payCode == 'ect') { + //跳输入密码的页面 + mui.ajax(hyhUrl('app/' + payCode + '/payment'), { + data: { + orderNo: orderNo, + isBatch: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data); + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置支付密码!'); + var url = 'setting_fogetPayPwd'; + mui.openWindow({ + url: url + '.html', + id: url + '.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + } else if (payCode == 'alipays') { + pay('alipay', orderNo); + // plus.nativeUI.showWaiting(); + // mui.post(hyhUrl('app/Alipays/payment'), { + // orderNo: data.data, + // isBatch: 1 + // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); + + } + + that.removeAttr('disabled'); + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + mui.alert(type); + } + }) + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { + // var self = plus.webview.currentWebview(); + // var data_href = self.id; + // //console.log(data_href) + // JZL.closeWindow('waitPay'); + //return; + var payPwd = $('#payPwd').val(); + if (payPwd == '') { + mui.alert('支付密码不能为空!'); + return; + } + var that = $(this); + that.attr('disabled', 'disabled') + var srcc = '' + if (payCode == 'qlgpay') { + srcc = 'payByQlg'; + } else if (payCode == 'ect') { + srcc = 'payByEct'; + } else { + srcc = 'payByWallet'; + } + var postData = { + orderNo: orderNo, + isBatch: 0, + payPwd: payPwd + } + if(document.getElementById("displayHelpLevel").dataset["user_id"] !== undefined){ + postData["helpUserId"] = document.getElementById("displayHelpLevel").dataset["user_id"] + } + if(document.getElementById("displayHelpLevel").dataset["level_no"] !== undefined){ + postData["helpUserLevel"] = document.getElementById("displayHelpLevel").dataset["level_no"] + } + mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { + + data: postData, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data); + mui.alert(data.msg) + //console.log(data.status) + if (data.status == 1) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + // JZL.closeWindow('indent.html'); + }, 700) + // var targetTab = plus.webview.getWebviewById("templete/my.html"); + // mui.fire(targetTab, 'refresh'); + // location.reload(); + } else { + + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + + mui('.con').on('tap', '.row_con', function() { + var data_order_id = $(this).attr('data-id'); + mui.openWindow({ + url: 'order_out.html', + id: 'order_out.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: data_order_id + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.ckwl', function() { + var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); + JZL.openWindow('logistics.html', 'logistics.html', { + data_order_id: data_order_id + }); + }) + //上传凭证 + mui('.con').on('tap', '.uploadCertificate', function() { + var orderId = $(this).parent().parent().attr('data-id'); + // mui.alert('跳到上传凭证页'+orderId) + + JZL.openWindow('uploadVoucher.html', 'uploadVoucher.html' + orderId, { + orderId: orderId + }); + + }) + $('.con').on('tap', '.qxdd_js', function() { + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if ($(this).html() == '取消订单') { + getReasonUrl = 'getCancelCause'; + } else if ($(this).html() == '拒收') { + getReasonUrl = 'getRejectCause'; + } else if ($(this).html() == '申请退款') { + getReasonUrl = 'getRefundCause'; + JZL.ajax(hyhUrl('/app/Orders/getRefund'), { + id: orderId + }, function(data) { //服务器返回响应 + // //console.log(JSON.stringify(data)); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('qlgpay' == data.payFrom) { + html = ' 退款产品券数量:' + + ' 退款优惠券数量:' + + ' 退款旺旺券数量:' + + ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + + // '

              (金额不能超过¥' + data.realTotalMoney + + ')

              '; + } else { + html = '

              (金额不能超过¥' + data.realTotalMoney + + ')

              (积分数量:' + data.ectNum + ')

              '; + } + + $('.tui').html(html) + } else { + mui.alert(data.msg) + } + }); + } + $('.bg_').css('display', 'block'); + $('.bg_con').css('display', 'none'); + $('.bg_con').slideDown(300, function() {}); + + mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + var html = ''; + $.each(data.data, function() { + html += '' + }); + $('#select').html(html) + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + + $('.bg_').on('tap', '.en_false', function() { + $('.bg_').css('display', 'none'); + + }) + $('.bg_').on('tap', '.en_true', function() { + var setReasonUrl = ''; + var content = $('#content').val(); + var reason = $('#select').val(); + if ($('#select').val() == 0) { + mui.alert('请选择原因!'); + return; + } + if ($('#select').val() == 10000 && content == '') { + mui.alert('请输入其他原因!'); + return; + } + if (getReasonUrl == 'getCancelCause') { + setReasonUrl = 'cancellation'; + mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + if ('waitPay' == plus.webview.currentWebview().id) { + location.reload(); + } else { + JZL.openWindow('indent.html', 'abnormal', { + data_href: 'abnormal' + }); + setTimeout(function() { + //plus.webview.currentWebview().close(); + JZL.closeWindow(plus.webview.currentWebview().id); + }, 500) + } + // JZL.openWindow('indent.html', 'abnormal', { + // data_href: 'abnormal' + // }); + // setTimeout(function() { + // plus.webview.currentWebview().close(); + // // JZL.closeWindow(plus.webview.currentWebview().id); + // }, 500) + //location.reload(); + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRejectCause') { + setReasonUrl = 'reject'; + mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + location.reload(); + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRefundCause') { + var params = {} + // params.money = $('#Tmoney').val(); + // if (params.money < 0 || params.money == 0) { + // mui.alert('退款金额不能为0!'); + // return; + // } + params.productNum = $('#productNum').val(); + params.couponsNum = $('#couponsNum').val(); + params.wangNum = $('#wangNum').val(); + params.reason = reason; + params.id = orderId; + params.content = content; + JZL.ajax(qlgUrl('app/Orderrefunds/refund'), params, function(data) { + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload(); + + } + }) + + } + + }) + + $('.con').on('tap', '.yssh', function() { + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if (confirm('你要延长收货么?')) { + mui.ajax(qlgUrl('/app/orders/delay'), { + headers: { + "HYH-Token": token + }, + data: { + id: orderId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data.data.goodsFavoritesNum) + ////console.log(data.data.Rows) + var data = toJson(data); + ////console.log(data.status) + if (data.status == 1) { + mui.alert(data.msg); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + } + }) + + $('.con').on('tap', '.qrsh', function() { + //$('.bg_').css('display', 'block'); + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if (confirm('确认收货?')) { + mui.ajax(hyhUrl('/app/Orders/receive'), { + headers: { + "HYH-Token": token + }, + data: { + id: orderId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data.data.goodsFavoritesNum) + ////console.log(data.data.Rows) + var data = toJson(data); + ////console.log(data.status) + if (data.status == 1) { + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload() + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + } + + }) + $('#select').on('change', function() { + if ($(this).val() == '10000') { + $('#content').css('display', 'block'); + } else { + $('#content').css('display', 'none'); + } + }) + //跳转到评价 + mui('.con').on('tap', '.ljpj', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'pj.html', + id: 'pj.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + //跳转到评价 + mui('.con').on('tap', '.ckpj', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'pj.html', + id: 'pj.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + //跳转到评价 + mui('.con').on('tap', '.tsdd', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'complain.html', + id: 'complain.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + }) diff --git a/static/app2/js/index.js b/static/app2/js/index.js old mode 100755 new mode 100644 index e66df04..1e5b423 --- a/static/app2/js/index.js +++ b/static/app2/js/index.js @@ -33,12 +33,12 @@ mui.back = function() { }, 2000); return false; } else { - if (new Date().getTime() - firstBackbutton < 2000) { - if (mui.os.ios) { + if (new Date().getTime() - firstBackbutton < 2000){ + if (mui.os.ios){ const threadClass = plus.ios.importClass("NSThread"); const mainThread = plus.ios.invoke(threadClass, "mainThread"); plus.ios.invoke(mainThread, "exit"); - } else { + } else{ plus.runtime.quit(); } } @@ -46,25 +46,26 @@ mui.back = function() { }; //获取cid用于推送 mui.plusReady(function() { - // var cid = plus.push.getClientInfo().clientid; - var timer = 0; - timer = setInterval(function() { - getData(); - }, 3000) + // var cid = plus.push.getClientInfo().clientid; + // var timer = 0; + // timer = setInterval(function() { + // getData(); + // }, 3000) getData(); function getData() { if (!localStorage.getItem('isFirstDownlodad')) { localStorage.setItem('isFirstDownlodad', true); + } - mui.ajax('http://www.juzi199.com/get_version_new.php?' + Math.random(), { + mui.ajax('http://qlg.tsgz.moe:233/get_version_new.php?' + Math.random(), { data: {}, dataType: 'json', //服务器返回json格式数据 type: 'post', //HTTP请求类型 timeout: 10000, //超时时间设置为10秒; success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;clearInterval(timer) - clearInterval(timer); + // clearInterval(timer); localStorage.setItem('version', data.version); if (0 == is_juzi_online) { localStorage.setItem('cssUrl', "../css/"); @@ -79,7 +80,7 @@ mui.plusReady(function() { var ipxSizeBottom = 0; if (/iphone/gi.test(navigator.userAgent) && ((screen.height == 812 && screen.width == 375) || (screen.height == 896 && screen.width == 414) || (screen.height == 1792 / 3 && screen.width == 828 / 3))) { - + ipxSizeTop = 24; ipxSizeBottom = 34; //$('.mui-bar').attr('style', "bottom: 34px;") @@ -98,4 +99,4 @@ mui.plusReady(function() { }); } -}) +}) diff --git a/static/app2/js/individual.js b/static/app2/js/individual.js old mode 100755 new mode 100644 index 699c580..b7e8807 --- a/static/app2/js/individual.js +++ b/static/app2/js/individual.js @@ -1,179 +1,179 @@ -mui.plusReady(function() { - var wait = 120; - var count = 0; - var authId = ''; - JZL.getItems('auth_personal'); - - $('.header_con_bc').on('tap', function() { - JZL.saveItems('.localinp', 'auth_personal'); - mui.toast('保存成功'); - }) - // //console.log($('#headImg').val()); - - if ('' == $('#headImg').val()) { - $("#headImgTag").attr("src", "../img/touxiang.jpg") - } - if ('' == $('#accountBookImg').val()) { - $("#accountBookImgTag").attr("src", "../img/hukou.jpg") - } - - JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(data) { - //console.log(data); - // //console.log(typeof(data.data)); - if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 - count = 1; - authId = data.data.id - $('.mobileCode').hide() - $('.userPhone').hide() - $('.payPwd').show() - mui.each(data.data, function(index, element) { - if ($('#' + index).attr("type") == "hidden") { - // var imgindex = index.substring(0, index.length - 3); - var imgindex = index + 'Tag' - var obj = '#' + imgindex - // //console.log('#' + imgindex + '') - if (imgindex != "") { - if ($(obj).is('img')) { - $(obj).attr("src", hyhImgUrl(element)) - $('#' + index + '').val(element) - } - } - - } else { - $('#' + index).val(element) - } - - - }) - // if (data.status == 1) { - // $('.qrbb').show(); - // $('.qrrz').show(); - // } else { - // $('.qrbb').hide(); - // $('.qrrz').hide(); - // } - } else { - //console.log(2222); - $('.userPhone').show() - $('.mobileCode').show() - $('.payPwd').hide() - JZL.getItems('auth_company'); - } - }) - - function time() { - if (wait == 0) { - $('.HQYZM').removeAttr("disabled"); - $('.HQYZM').html("重新发送"); - wait = 120; - } else { - $('.HQYZM').attr("disabled", true); - $('.HQYZM').html("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - $(".HQYZM").on("tap", function() { - var userPhone = $('#userPhone').val(); - if ('' == userPhone) { - mui.alert("请输入手机号") - return; - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(userPhone))) { - mui.alert("手机号码有误,请重填!"); - return; - } - $(".HQYZM").attr("disabled", true); - - JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { - userPhone: userPhone - }, function(data) { - //console.log(data); - if (data.status == 1) { - time(); - $('.YZM').focus(); - } else { - mui.alert(data.msg); - } - - }) - }) - - $('.bc_btn').on('tap', function() { - var params = JZL.getParams(".inp"); - if ('' == params.houseAddress) { - mui.alert("请输入地址"); - return; - } - if ('' == params.householdIdCard) { - mui.alert("请输入身份证号"); - return; - - } - if ('' == params.householdName) { - mui.alert("请输入户主姓名"); - return; - - } - if (0 == count) { - if ('' == params.mobileCode) { - mui.alert("请输入验证码"); - return; - - } - } else if (1 == count) { - if ('' == params.payPwd) { - mui.alert("请输入操作密码"); - return; - } - params.authId = authId; - } - - //console.log(params); - JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { - //console.log(data); - if (data.status == 1) { - - JZL.saveItems('.localinp', 'auth_personal'); - localStorage.setItem("authType","1") - mui.toast("提交成功 请等待审核") - // $(".mui-table-view").attr("readonly", "readonly") - $(".mobileCode").attr("display", "none") - mui.back(); - } else { - mui.alert(data.msg); - } - - }) - }) - - mui('.mui-table-content').on('tap', '.qrbb', function() { - JZL.openWindow('qrbb.html', 'qrbb.html'); - - }) - mui('.mui-table-content').on('tap', '.qrrz', function() { - JZL.openWindow('qrrz.html', 'qrrz.html'); - - }) - - - $(".ossfile").on("tap", '#accountBookImgTag', function() { - UP.init("accountBookImg", "test", "accountBookImgTag") - - // UP.init("id", "test", "imgId") - - openCamera(); - }) - //更换头像 - $("#headerimg").on("tap", '#headImgTag', function() { - UP.init("headImg", "test", "headImgTag") - openCamera(); - }) - - +mui.plusReady(function() { + var wait = 120; + var count = 0; + var authId = ''; + JZL.getItems('auth_personal'); + + $('.header_con_bc').on('tap', function() { + JZL.saveItems('.localinp', 'auth_personal'); + mui.toast('保存成功'); + }) + // //console.log($('#headImg').val()); + + if ('' == $('#headImg').val()) { + $("#headImgTag").attr("src", "../img/touxiang.jpg") + } + if ('' == $('#accountBookImg').val()) { + $("#accountBookImgTag").attr("src", "../img/hukou.jpg") + } + + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(data) { + //console.log(data); + // //console.log(typeof(data.data)); + if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 + count = 1; + authId = data.data.id + $('.mobileCode').hide() + $('.userPhone').hide() + $('.payPwd').show() + mui.each(data.data, function(index, element) { + if ($('#' + index).attr("type") == "hidden") { + // var imgindex = index.substring(0, index.length - 3); + var imgindex = index + 'Tag' + var obj = '#' + imgindex + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else { + $('#' + index).val(element) + } + + + }) + // if (data.status == 1) { + // $('.qrbb').show(); + // $('.qrrz').show(); + // } else { + // $('.qrbb').hide(); + // $('.qrrz').hide(); + // } + } else { + //console.log(2222); + $('.userPhone').show() + $('.mobileCode').show() + $('.payPwd').hide() + JZL.getItems('auth_company'); + } + }) + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').html("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').html("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + $(".HQYZM").on("tap", function() { + var userPhone = $('#userPhone').val(); + if ('' == userPhone) { + mui.alert("请输入手机号") + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + $(".HQYZM").attr("disabled", true); + + JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { + userPhone: userPhone + }, function(data) { + //console.log(data); + if (data.status == 1) { + time(); + $('.YZM').focus(); + } else { + mui.alert(data.msg); + } + + }) + }) + + $('.bc_btn').on('tap', function() { + var params = JZL.getParams(".inp"); + if ('' == params.houseAddress) { + mui.alert("请输入地址"); + return; + } + if ('' == params.householdIdCard) { + mui.alert("请输入身份证号"); + return; + + } + if ('' == params.householdName) { + mui.alert("请输入户主姓名"); + return; + + } + if (0 == count) { + if ('' == params.mobileCode) { + mui.alert("请输入验证码"); + return; + + } + } else if (1 == count) { + if ('' == params.payPwd) { + mui.alert("请输入操作密码"); + return; + } + params.authId = authId; + } + + //console.log(params); + JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { + //console.log(data); + if (data.status == 1) { + + JZL.saveItems('.localinp', 'auth_personal'); + localStorage.setItem("authType","1") + mui.toast("提交成功 请等待审核") + // $(".mui-table-view").attr("readonly", "readonly") + $(".mobileCode").attr("display", "none") + mui.back(); + } else { + mui.alert(data.msg); + } + + }) + }) + + mui('.mui-table-content').on('tap', '.qrbb', function() { + JZL.openWindow('qrbb.html', 'qrbb.html'); + + }) + mui('.mui-table-content').on('tap', '.qrrz', function() { + JZL.openWindow('qrrz.html', 'qrrz.html'); + + }) + + + $(".ossfile").on("tap", '#accountBookImgTag', function() { + UP.init("accountBookImg", "test", "accountBookImgTag") + + // UP.init("id", "test", "imgId") + + openCamera(); + }) + //更换头像 + $("#headerimg").on("tap", '#headImgTag', function() { + UP.init("headImg", "test", "headImgTag") + openCamera(); + }) + + }) diff --git a/static/app2/js/invest.js b/static/app2/js/invest.js old mode 100755 new mode 100644 index d45b2db..5303cda --- a/static/app2/js/invest.js +++ b/static/app2/js/invest.js @@ -1,27 +1,27 @@ -mui.plusReady(function () { - var userId=""; - var shopName=""; - // 获取数据 - JZL.ajax(qlgUrl('app/users/familyInvestmentList'),{},function (data ) { - console.log(data); - var html =""; - if (1 == data.status){ - var data = data.data - $.each(data,function () { - html+='
              '+this.companyName+'
              合作人'+this.count +'人
              '+formatDate(new Date(this.createTime*1000))+'创建
              '+this.stake+'%

              持股

              '+this.companyAddress+'
              ' - }) - - $('.con').append(html) - - } - - }) - - - $("body").on("tap",".con_",function () { - userId=$(this).attr("data-id") - shopName=$(this).attr("data-shopName") - - JZL.openWindow('investdetail.html', 'investdetail.html',{userId : userId,shopName:shopName}) - }) +mui.plusReady(function () { + var userId=""; + var shopName=""; + // 获取数据 + JZL.ajax(qlgUrl('app/users/familyInvestmentList'),{},function (data ) { + console.log(data); + var html =""; + if (1 == data.status){ + var data = data.data + $.each(data,function () { + html+='
              '+this.companyName+'
              合作人'+this.count +'人
              '+formatDate(new Date(this.createTime*1000))+'创建
              '+this.stake+'%

              持股

              '+this.companyAddress+'
              ' + }) + + $('.con').append(html) + + } + + }) + + + $("body").on("tap",".con_",function () { + userId=$(this).attr("data-id") + shopName=$(this).attr("data-shopName") + + JZL.openWindow('investdetail.html', 'investdetail.html',{userId : userId,shopName:shopName}) + }) }) \ No newline at end of file diff --git a/static/app2/js/investdetail.js b/static/app2/js/investdetail.js old mode 100755 new mode 100644 index ece77e0..f8d4f58 --- a/static/app2/js/investdetail.js +++ b/static/app2/js/investdetail.js @@ -1,24 +1,24 @@ -mui.plusReady(function () { - var self =plus.webview.currentWebview() - var userId = self.userId; - var shopName = self.shopName; - var html = ""; - - // console.log(self.userId); - //获取数据 - JZL.ajax(qlgUrl("app/users/investmentInfo"),{userId:userId},function (data) { - console.log(data); - if (1 == data.status) { - var data =data.data; - html ='
              '+shopName+'
              ' - $.each(data,function () { - html += '
              '+ this.uName+'
              '+this.positionName+'
              '+formatDate(new Date(this.createTime*1000))+'加入
              '+this.stake+'%

              持股

              ' - }) - $('.con').html(html) - } - }) - - $('.down').on ("tap",".btn",function () { - JZL.openWindow("distribution.html","distribution.html",{userId :userId}) - }) +mui.plusReady(function () { + var self =plus.webview.currentWebview() + var userId = self.userId; + var shopName = self.shopName; + var html = ""; + + // console.log(self.userId); + //获取数据 + JZL.ajax(qlgUrl("app/users/investmentInfo"),{userId:userId},function (data) { + console.log(data); + if (1 == data.status) { + var data =data.data; + html ='
              '+shopName+'
              ' + $.each(data,function () { + html += '
              '+ this.uName+'
              '+this.positionName+'
              '+formatDate(new Date(this.createTime*1000))+'加入
              '+this.stake+'%

              持股

              ' + }) + $('.con').html(html) + } + }) + + $('.down').on ("tap",".btn",function () { + JZL.openWindow("distribution.html","distribution.html",{userId :userId}) + }) }) \ No newline at end of file diff --git a/static/app2/js/jquery-3.2.1.min.js b/static/app2/js/jquery-3.2.1.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/jquery-ui.min.js b/static/app2/js/jquery-ui.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/jquery.cookie.js b/static/app2/js/jquery.cookie.js old mode 100755 new mode 100644 diff --git a/static/app2/js/jquery.qtip.min.js b/static/app2/js/jquery.qtip.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/jquery.validate.min.js b/static/app2/js/jquery.validate.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/login.js b/static/app2/js/login.js old mode 100755 new mode 100644 index 381d559..cc1227d --- a/static/app2/js/login.js +++ b/static/app2/js/login.js @@ -10,6 +10,8 @@ mui.init({ } }); mui.plusReady(function() { + localStorage.removeItem("userId") + localStorage.removeItem("userName") $('.loginbg').height(window.screen.height); $('.btn').attr('id','Tcaptcha'); $('.btn').attr('data-appid','2089606583'); @@ -65,6 +67,8 @@ mui.plusReady(function() { $('.btn').attr('disabled', 'disabled'); var captcha1 = new TencentCaptcha(document.getElementById('Tcaptcha')); captcha1.show(); + // 修复点登陆的时候弹出输入法 + $("input").blur() setTimeout(function(){ $('.feedback-group',document.getElementById('tcaptcha_iframe').contentWindow.document).hide(); // $('.feedback-group',document.frames("")).hide(); diff --git a/static/app2/js/logistics.js b/static/app2/js/logistics.js old mode 100755 new mode 100644 index cbdc8ad..4495fb5 --- a/static/app2/js/logistics.js +++ b/static/app2/js/logistics.js @@ -1,15 +1,15 @@ -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - var data_order_id = self.data_order_id; - localStorage.setItem('data_order_id', data_order_id); - var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; - var sub = plus.webview.create('logisticscon.html', 'logisticscon.html', { - top: bSize, - bottom: '0', - scrollIndicator: 'none' - }); - self.append(sub); - - +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + var data_order_id = self.data_order_id; + localStorage.setItem('data_order_id', data_order_id); + var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var sub = plus.webview.create('logisticscon.html', 'logisticscon.html', { + top: bSize, + bottom: '0', + scrollIndicator: 'none' + }); + self.append(sub); + + }) \ No newline at end of file diff --git a/static/app2/js/logisticscon.js b/static/app2/js/logisticscon.js old mode 100755 new mode 100644 index 4ec8482..b5cadb1 --- a/static/app2/js/logisticscon.js +++ b/static/app2/js/logisticscon.js @@ -1,50 +1,50 @@ -$('.summarize').html(''); -mui.plusReady(function() { - var data_order_id = localStorage.getItem('data_order_id'); - var token = localStorage.getItem('token'); - var nwaiting = plus.nativeUI.showWaiting(); - mui.ajax(hyhUrl('app/Orders/findExpress'), { - - data: { - orderId: data_order_id - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - nwaiting.close(); - var data = toJson(data); - if(!data.express){ - data=data.data; - } - var html = '

              物流状态: ' + data.express.stateTxt + '

              承运来源:' + data.express.expressName + '

              运单编号:' + data.express.expressNo + '

                '; - if(data.status == 200 || data.status == 1) { - var data_ = data.data; - if(data.data.length > 1) { - var d_1 = data.data[0].time; - var d_2 = data.data[data.data.length - 1].time; - var e_1 = new Date(d_1).getTime(); - var e_2 = new Date(d_2).getTime(); - if(e_1 < e_2) { - data_.reverse(); - } - } - - $.each(data_, function() { - html += '
              • ' + this.context + '

                ' + this.time + '

              • ' - }); - - } else { - // mui.alert(data.status); - } - html += '
              ' - $('.con').html(html); - document.getElementsByTagName('li')[0].className = 'first'; - }, - error: function(xhr, type, errorThrown) { //异常处理; - nwaiting.close(); - // mui.alert(type); - } - }); - +$('.summarize').html(''); +mui.plusReady(function() { + var data_order_id = localStorage.getItem('data_order_id'); + var token = localStorage.getItem('token'); + var nwaiting = plus.nativeUI.showWaiting(); + mui.ajax(hyhUrl('app/Orders/findExpress'), { + + data: { + orderId: data_order_id + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + nwaiting.close(); + var data = toJson(data); + if(!data.express){ + data=data.data; + } + var html = '

              物流状态: ' + data.express.stateTxt + '

              承运来源:' + data.express.expressName + '

              运单编号:' + data.express.expressNo + '

                '; + if(data.status == 200 || data.status == 1) { + var data_ = data.data; + if(data.data.length > 1) { + var d_1 = data.data[0].time; + var d_2 = data.data[data.data.length - 1].time; + var e_1 = new Date(d_1).getTime(); + var e_2 = new Date(d_2).getTime(); + if(e_1 < e_2) { + data_.reverse(); + } + } + + $.each(data_, function() { + html += '
              • ' + this.context + '

                ' + this.time + '

              • ' + }); + + } else { + // mui.alert(data.status); + } + html += '
              ' + $('.con').html(html); + document.getElementsByTagName('li')[0].className = 'first'; + }, + error: function(xhr, type, errorThrown) { //异常处理; + nwaiting.close(); + // mui.alert(type); + } + }); + }) \ No newline at end of file diff --git a/static/app2/js/lrz.bundle.js b/static/app2/js/lrz.bundle.js old mode 100755 new mode 100644 diff --git a/static/app2/js/main_guide.js b/static/app2/js/main_guide.js old mode 100755 new mode 100644 index 968c02f..57daf11 --- a/static/app2/js/main_guide.js +++ b/static/app2/js/main_guide.js @@ -1,86 +1,86 @@ -mui.init({ - swipeBack: true //启用右滑关闭功能 -}); -/**/ -mui.back = function() {}; -mui.plusReady(function() { - var showGuide = plus.storage.getItem("lauchFlag"); - if(showGuide) { - //有值,说明已经显示过了,无需显示//关闭splash页面; - plus.navigator.closeSplashscreen(); - closeGuide(); - }else{ - launchScreen(); - } - function launchScreen() { - mui.ajax('http://www.juzi199.com/get_startup.php', { - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - aysnc:false, - success: function(data) {//服务器返回响应,根据响应结果,分析是否登录成功; - if(1 == data.show){ - var html = ''; - var indicatorHtml = ''; - $.each(data.img, function() { - html += '
              '; - indicatorHtml+='
              '; - }); - $(".mui-slider-group").html(html); - $(".mui-slider-indicator").html(indicatorHtml); - $('.mui-slider-item').first().addClass('mui-slider-item-duplicate'); - $('.mui-slider-item').last().append(''); - $('.mui-indicator').first().addClass('mui-active'); - setTimeout(function(){ - plus.navigator.closeSplashscreen(); - },1000) - }else{ - plus.navigator.closeSplashscreen(); - closeGuide(); - } - //if(data.img.count() == 1){ - - //} - - }, - error: function(xhr, type, errorThrown) { - //异常处理; - //alert(errorThrown); - } - }); - setTimeout(function(){ - closeGuide(); - },6000) - } - mui('body').on('tap', '#close', function(){ - closeGuide(); - }) -// document.addEventListener('tap', function() { -// // //console.log("addEventListener: newintent"); -// //console.log(1) -// }, false); - - function closeGuide(){ - //显示启动导航 - mui.openWindow({ - id: 'index', - url: 'index.html', - show: { - }, - waiting: { - autoShow: false - } - }); - setTimeout(function(){ - //plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示 - //plus.storage.removeItem("lauchFlag"); - //plus.navigator.setFullscreen(false); - plus.webview.currentWebview().close(); - },1000) - } -}); - -//立即体验按钮点击事件 -//document.getElementById("close").addEventListener('tap', function(event) { -// +mui.init({ + swipeBack: true //启用右滑关闭功能 +}); +/**/ +mui.back = function() {}; +mui.plusReady(function() { + var showGuide = plus.storage.getItem("lauchFlag"); + if(showGuide) { + //有值,说明已经显示过了,无需显示//关闭splash页面; + plus.navigator.closeSplashscreen(); + closeGuide(); + }else{ + launchScreen(); + } + function launchScreen() { + mui.ajax('http://www.juzi199.com/get_startup.php', { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + aysnc:false, + success: function(data) {//服务器返回响应,根据响应结果,分析是否登录成功; + if(1 == data.show){ + var html = ''; + var indicatorHtml = ''; + $.each(data.img, function() { + html += '
              '; + indicatorHtml+='
              '; + }); + $(".mui-slider-group").html(html); + $(".mui-slider-indicator").html(indicatorHtml); + $('.mui-slider-item').first().addClass('mui-slider-item-duplicate'); + $('.mui-slider-item').last().append(''); + $('.mui-indicator').first().addClass('mui-active'); + setTimeout(function(){ + plus.navigator.closeSplashscreen(); + },1000) + }else{ + plus.navigator.closeSplashscreen(); + closeGuide(); + } + //if(data.img.count() == 1){ + + //} + + }, + error: function(xhr, type, errorThrown) { + //异常处理; + //alert(errorThrown); + } + }); + setTimeout(function(){ + closeGuide(); + },6000) + } + mui('body').on('tap', '#close', function(){ + closeGuide(); + }) +// document.addEventListener('tap', function() { +// // //console.log("addEventListener: newintent"); +// //console.log(1) +// }, false); + + function closeGuide(){ + //显示启动导航 + mui.openWindow({ + id: 'index', + url: 'index.html', + show: { + }, + waiting: { + autoShow: false + } + }); + setTimeout(function(){ + //plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示 + //plus.storage.removeItem("lauchFlag"); + //plus.navigator.setFullscreen(false); + plus.webview.currentWebview().close(); + },1000) + } +}); + +//立即体验按钮点击事件 +//document.getElementById("close").addEventListener('tap', function(event) { +// //}, false); \ No newline at end of file diff --git a/static/app2/js/mapcommon.js b/static/app2/js/mapcommon.js old mode 100755 new mode 100644 index 6c08d47..042920c --- a/static/app2/js/mapcommon.js +++ b/static/app2/js/mapcommon.js @@ -1,347 +1,347 @@ -// var num = 1 / window.devicePixelRatio; -// // document.querySelector('meta').setAttribute('name', 'viewport') -// //document.querySelector('meta').setAttribute('content', 'width=device-width, initial-scale=' + num + ', maximum-scale=' + num + ', minimum-scale=' + num + ', user-scalable=no'); -// // document.querySelector('meta').setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no'); -// -// // browserRedirect(); -// function browserRedirect() { -// var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); -// var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); -// var width = w > h ? h : w; -// var sUserAgent = navigator.userAgent.toLowerCase(); -// var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; -// var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; -// var bIsMidp = sUserAgent.match(/midp/i) == "midp"; -// var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; -// var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; -// var bIsAndroid = sUserAgent.match(/android/i) == "android"; -// var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; -// var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; -// var bIsWX = sUserAgent.match(/MicroMessenger/i) == "micromessenger"; -// // document.writeln("您的浏览设备为:"); -// if(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM || bIsWX) { -// width = width; -// // document.writeln("phone"); -// } else { -// width = 640; -// // document.writeln("pc"); -// } -// var fz = ~~(width * 64000 / 100) / 6400; -// document.getElementsByTagName("html")[0].style.cssText = 'font-size: ' + fz + "px"; -// var realfz = ~~(+window.getComputedStyle(document.getElementsByTagName("html")[0]).fontSize.replace('px', '') * 6400) / 6400 -// if(fz !== realfz) { -// document.getElementsByTagName("html")[0].style.cssText = 'font-size:' + fz * (fz / realfz) + "px"; -// } -// -// } -// window.onresize = function(){ -// browserRedirect(); -// } - - -var EARTH_RADIUS = 6378137.0; //单位M - -var PI = Math.PI; - -function getRad(d) { - - return d * PI / 180.0; - -} - -// var dis = getFlatternDistance(118.515179,37.478422,118.51471,37.475623); - -/** - - * approx distance between two points on earth ellipsoid - - * @param {Object} lat1 - - * @param {Object} lng1 - - * @param {Object} lat2 - - * @param {Object} lng2 - - */ - -function getFlatternDistance(lat1, lng1, lat2, lng2) { - - var f = getRad((lat1 + lat2) / 2); - - var g = getRad((lat1 - lat2) / 2); - - var l = getRad((lng1 - lng2) / 2); - - var sg = Math.sin(g); - - var sl = Math.sin(l); - - var sf = Math.sin(f); - - var s, c, w, r, d, h1, h2; - - var a = EARTH_RADIUS; - - var fl = 1 / 298.257; - - sg = sg * sg; - - sl = sl * sl; - - sf = sf * sf; - - s = sg * (1 - sl) + (1 - sf) * sl; - - c = (1 - sg) * (1 - sl) + sf * sl; - - w = Math.atan(Math.sqrt(s / c)); - - r = Math.sqrt(s * c) / w; - - d = 2 * w * a; - - h1 = (3 * r - 1) / 2 / c; - - h2 = (3 * r + 1) / 2 / s; - - return d * (1 + fl * (h1 * sf * (1 - sg) - h2 * (1 - sf) * sg)); - -} -/** - * 获取省份 - */ -function get_province() { - var url = '/index.php?m=Admin&c=Api&a=getRegion&level=1&parent_id=0'; - $.ajax({ - type: "GET", - url: url, - error: function(request) { - alert("服务器繁忙, 请联系管理员!"); - return; - }, - success: function(v) { - v = '' + v; - $('#province').empty().html(v); - } - }); -} - - -/** - * 获取城市 - * @param t 省份select对象 - */ -function get_city(t) { - var parent_id = $(t).val(); - if (!parent_id > 0) { - return; - } - $('#twon').empty().css('display', 'none'); - var url = '/index.php?m=Home&c=Api&a=getRegion&level=2&parent_id=' + parent_id; - $.ajax({ - type: "GET", - url: url, - error: function(request) { - alert("服务器繁忙, 请联系管理员!"); - return; - }, - success: function(v) { - v = '' + v; - $('#city').empty().html(v); - } - }); -} - -/** - * 获取地区 - * @param t 城市select对象 - */ -function get_area(t) { - var parent_id = $(t).val(); - if (!parent_id > 0) { - return; - } - var url = '/index.php?m=Home&c=Api&a=getRegion&level=3&parent_id=' + parent_id; - $.ajax({ - type: "GET", - url: url, - error: function(request) { - alert("服务器繁忙, 请联系管理员!"); - return; - }, - success: function(v) { - v = '' + v; - $('#district').empty().html(v); - } - }); -} -// 获取最后一级乡镇 -function get_twon(obj) { - var parent_id = $(obj).val(); - var url = '/index.php?m=Home&c=Api&a=getTwon&parent_id=' + parent_id; - $.ajax({ - type: "GET", - url: url, - success: function(res) { - if (parseInt(res) == 0) { - $('#twon').empty().css('display', 'none'); - } else { - $('#twon').css('display', 'block'); - $('#twon').empty().html(res); - } - } - }); -} - -// 点击收藏商品 -function collect_goods(goods_id) { - $.ajax({ - type: "GET", - dataType: "json", - url: "/index.php?m=Home&c=goods&a=collect_goods&goods_id=" + goods_id, //+tab, - success: function(data) { - alert(data.msg); - } - }); -} - - -//加载地图 -function getMap(lng, lat) { -// var pcenter = new plus.maps.Point(lng,lat); // 地图中心点 -// var map = new plus.maps.Map('allmap'); -// map.centerAndZoom(pcenter, 15); // 设置地图的中心点和缩放级别 -// map.showUserLocation( true ); // 设置是否显示用户的位置 -// 还有很多属性可以设置,请参考官方文档 - var map = new BMap.Map("allmap"); - // var point = new BMap.Point("{$apply_info['lng']|default=118.514285}", "{$apply_info['lat']|default=37.478362}"); - var point = new BMap.Point(lng, lat); - map.centerAndZoom(point, 16); - var marker = new BMap.Marker(point); - map.clearOverlays(); - map.addOverlay(marker); - marker.setAnimation(BMAP_ANIMATION_BOUNCE); - function showInfo(e) { - parent.selectCallBack('data_lng', 'data_lat', document.getElementById('lng').value, document.getElementById('lat').value); - } - function showPoint(e) { - - document.getElementById('lat').value = e.point.lat; - document.getElementById('lng').value = e.point.lng; - var p = new BMap.Point(e.point.lng, e.point.lat); - var mk = new BMap.Marker(p); - map.clearOverlays(); - map.addOverlay(mk); - mk.setAnimation(BMAP_ANIMATION_BOUNCE); - // //console.log(BMAP_ANIMATION_BOUNCE); - } - map.enableScrollWheelZoom(true); - map.addControl(new BMap.NavigationControl()); - map.addEventListener("click", showPoint); - - function G(id) { - return document.getElementById(id); - } - - var ac = new BMap.Autocomplete({ - "input": "shopAddress", - "location": map - }); - ac.addEventListener("onhighlight", function(e) { - var str = ""; - var _value = e.fromitem.value; - var value = ""; - if (e.fromitem.index > -1) { - value = _value.province + _value.city + _value.district + _value.street + _value.business; - } - str = "FromItem
              index = " + e.fromitem.index + "
              value = " + value; - - value = ""; - if (e.toitem.index > -1) { - _value = e.toitem.value; - value = _value.province + _value.city + _value.district + _value.street + _value.business; - } - str += "
              ToItem
              index = " + e.toitem.index + "
              value = " + value; - // G("searchResultPanel").innerHTML = str; - }); - var myValue; - ac.addEventListener("onconfirm", function(e) { - var _value = e.item.value; - myValue = _value.province + _value.city + _value.district + _value.street + _value.business; - G("searchResultPanel").innerHTML = "onconfirm
              index = " + e.item.index + "
              myValue = " + myValue; - - setPlace(); - }); - function setPlace() { - map.clearOverlays(); - - function myFun() { - var pp = local.getResults().getPoi(0).point; - map.centerAndZoom(pp, 18); - map.addOverlay(new BMap.Marker(pp)); - } - var local = new BMap.LocalSearch(map, { - onSearchComplete: myFun - }); - local.search(myValue); - } -} - - - -// 读取本地地址 -function getLocation(callback) { - // var object = obj; - plus.geolocation.getCurrentPosition(function(res) { - //成功回调 - var obj = new Object(); - obj.status = 1; - obj.lat = res.coords.latitude; //纬度 - obj.lng = res.coords.longitude; //经度 - callback(obj); - }, function(e) { - //失败回调 - //console.log('Gelocation Error: code - ' + e.code + '; message - ' + e.message); - switch (e.code) { - case 10: - obj.errStr = '请开启应用的定位权限'; - break; - case 9: - //mui.alert('请开启手机定位服务'); - obj.errStr = '请开启手机定位服务'; - break; - case 2: - if (e.message.indexOf("[geolocation:13]") > -1) { - //如果网络开启,定位失败,提示检查定位权限 - obj.errStr = '请开启应用的定位权限'; - } - if (e.message.indexOf("[geolocation:14]") > -1) { - //如果应用的权限开了,提示网络异常 - obj.errStr = '请检查网络是否正常'; - } - break; - case e.PERMISSION_DENIED: - obj.errStr = '请求定位被拒绝'; - break; - case e.POSITION_UNAVAILABLE: - obj.errStr = "位置信息不可用"; - break; - case e.TIMEOUT: - obj.errStr = "获取位置信息超时"; - break; - case e.UNKNOWN_ERROR: - obj.errStr = "未知错误"; - break; - } - - var obj = new Object(); - obj.errCode = e.code; - obj.status = 0; - callback(obj); - }, { - //超时未获取到经纬度信息 执行失败回调 (默认为5秒) - timeout: 3000 - }); - //JZL.saveItems('.user_pos', 'user_pos'); -} +// var num = 1 / window.devicePixelRatio; +// // document.querySelector('meta').setAttribute('name', 'viewport') +// //document.querySelector('meta').setAttribute('content', 'width=device-width, initial-scale=' + num + ', maximum-scale=' + num + ', minimum-scale=' + num + ', user-scalable=no'); +// // document.querySelector('meta').setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no'); +// +// // browserRedirect(); +// function browserRedirect() { +// var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); +// var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); +// var width = w > h ? h : w; +// var sUserAgent = navigator.userAgent.toLowerCase(); +// var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; +// var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; +// var bIsMidp = sUserAgent.match(/midp/i) == "midp"; +// var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; +// var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; +// var bIsAndroid = sUserAgent.match(/android/i) == "android"; +// var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; +// var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; +// var bIsWX = sUserAgent.match(/MicroMessenger/i) == "micromessenger"; +// // document.writeln("您的浏览设备为:"); +// if(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM || bIsWX) { +// width = width; +// // document.writeln("phone"); +// } else { +// width = 640; +// // document.writeln("pc"); +// } +// var fz = ~~(width * 64000 / 100) / 6400; +// document.getElementsByTagName("html")[0].style.cssText = 'font-size: ' + fz + "px"; +// var realfz = ~~(+window.getComputedStyle(document.getElementsByTagName("html")[0]).fontSize.replace('px', '') * 6400) / 6400 +// if(fz !== realfz) { +// document.getElementsByTagName("html")[0].style.cssText = 'font-size:' + fz * (fz / realfz) + "px"; +// } +// +// } +// window.onresize = function(){ +// browserRedirect(); +// } + + +var EARTH_RADIUS = 6378137.0; //单位M + +var PI = Math.PI; + +function getRad(d) { + + return d * PI / 180.0; + +} + +// var dis = getFlatternDistance(118.515179,37.478422,118.51471,37.475623); + +/** + + * approx distance between two points on earth ellipsoid + + * @param {Object} lat1 + + * @param {Object} lng1 + + * @param {Object} lat2 + + * @param {Object} lng2 + + */ + +function getFlatternDistance(lat1, lng1, lat2, lng2) { + + var f = getRad((lat1 + lat2) / 2); + + var g = getRad((lat1 - lat2) / 2); + + var l = getRad((lng1 - lng2) / 2); + + var sg = Math.sin(g); + + var sl = Math.sin(l); + + var sf = Math.sin(f); + + var s, c, w, r, d, h1, h2; + + var a = EARTH_RADIUS; + + var fl = 1 / 298.257; + + sg = sg * sg; + + sl = sl * sl; + + sf = sf * sf; + + s = sg * (1 - sl) + (1 - sf) * sl; + + c = (1 - sg) * (1 - sl) + sf * sl; + + w = Math.atan(Math.sqrt(s / c)); + + r = Math.sqrt(s * c) / w; + + d = 2 * w * a; + + h1 = (3 * r - 1) / 2 / c; + + h2 = (3 * r + 1) / 2 / s; + + return d * (1 + fl * (h1 * sf * (1 - sg) - h2 * (1 - sf) * sg)); + +} +/** + * 获取省份 + */ +function get_province() { + var url = '/index.php?m=Admin&c=Api&a=getRegion&level=1&parent_id=0'; + $.ajax({ + type: "GET", + url: url, + error: function(request) { + alert("服务器繁忙, 请联系管理员!"); + return; + }, + success: function(v) { + v = '' + v; + $('#province').empty().html(v); + } + }); +} + + +/** + * 获取城市 + * @param t 省份select对象 + */ +function get_city(t) { + var parent_id = $(t).val(); + if (!parent_id > 0) { + return; + } + $('#twon').empty().css('display', 'none'); + var url = '/index.php?m=Home&c=Api&a=getRegion&level=2&parent_id=' + parent_id; + $.ajax({ + type: "GET", + url: url, + error: function(request) { + alert("服务器繁忙, 请联系管理员!"); + return; + }, + success: function(v) { + v = '' + v; + $('#city').empty().html(v); + } + }); +} + +/** + * 获取地区 + * @param t 城市select对象 + */ +function get_area(t) { + var parent_id = $(t).val(); + if (!parent_id > 0) { + return; + } + var url = '/index.php?m=Home&c=Api&a=getRegion&level=3&parent_id=' + parent_id; + $.ajax({ + type: "GET", + url: url, + error: function(request) { + alert("服务器繁忙, 请联系管理员!"); + return; + }, + success: function(v) { + v = '' + v; + $('#district').empty().html(v); + } + }); +} +// 获取最后一级乡镇 +function get_twon(obj) { + var parent_id = $(obj).val(); + var url = '/index.php?m=Home&c=Api&a=getTwon&parent_id=' + parent_id; + $.ajax({ + type: "GET", + url: url, + success: function(res) { + if (parseInt(res) == 0) { + $('#twon').empty().css('display', 'none'); + } else { + $('#twon').css('display', 'block'); + $('#twon').empty().html(res); + } + } + }); +} + +// 点击收藏商品 +function collect_goods(goods_id) { + $.ajax({ + type: "GET", + dataType: "json", + url: "/index.php?m=Home&c=goods&a=collect_goods&goods_id=" + goods_id, //+tab, + success: function(data) { + alert(data.msg); + } + }); +} + + +//加载地图 +function getMap(lng, lat) { +// var pcenter = new plus.maps.Point(lng,lat); // 地图中心点 +// var map = new plus.maps.Map('allmap'); +// map.centerAndZoom(pcenter, 15); // 设置地图的中心点和缩放级别 +// map.showUserLocation( true ); // 设置是否显示用户的位置 +// 还有很多属性可以设置,请参考官方文档 + var map = new BMap.Map("allmap"); + // var point = new BMap.Point("{$apply_info['lng']|default=118.514285}", "{$apply_info['lat']|default=37.478362}"); + var point = new BMap.Point(lng, lat); + map.centerAndZoom(point, 16); + var marker = new BMap.Marker(point); + map.clearOverlays(); + map.addOverlay(marker); + marker.setAnimation(BMAP_ANIMATION_BOUNCE); + function showInfo(e) { + parent.selectCallBack('data_lng', 'data_lat', document.getElementById('lng').value, document.getElementById('lat').value); + } + function showPoint(e) { + + document.getElementById('lat').value = e.point.lat; + document.getElementById('lng').value = e.point.lng; + var p = new BMap.Point(e.point.lng, e.point.lat); + var mk = new BMap.Marker(p); + map.clearOverlays(); + map.addOverlay(mk); + mk.setAnimation(BMAP_ANIMATION_BOUNCE); + // //console.log(BMAP_ANIMATION_BOUNCE); + } + map.enableScrollWheelZoom(true); + map.addControl(new BMap.NavigationControl()); + map.addEventListener("click", showPoint); + + function G(id) { + return document.getElementById(id); + } + + var ac = new BMap.Autocomplete({ + "input": "shopAddress", + "location": map + }); + ac.addEventListener("onhighlight", function(e) { + var str = ""; + var _value = e.fromitem.value; + var value = ""; + if (e.fromitem.index > -1) { + value = _value.province + _value.city + _value.district + _value.street + _value.business; + } + str = "FromItem
              index = " + e.fromitem.index + "
              value = " + value; + + value = ""; + if (e.toitem.index > -1) { + _value = e.toitem.value; + value = _value.province + _value.city + _value.district + _value.street + _value.business; + } + str += "
              ToItem
              index = " + e.toitem.index + "
              value = " + value; + // G("searchResultPanel").innerHTML = str; + }); + var myValue; + ac.addEventListener("onconfirm", function(e) { + var _value = e.item.value; + myValue = _value.province + _value.city + _value.district + _value.street + _value.business; + G("searchResultPanel").innerHTML = "onconfirm
              index = " + e.item.index + "
              myValue = " + myValue; + + setPlace(); + }); + function setPlace() { + map.clearOverlays(); + + function myFun() { + var pp = local.getResults().getPoi(0).point; + map.centerAndZoom(pp, 18); + map.addOverlay(new BMap.Marker(pp)); + } + var local = new BMap.LocalSearch(map, { + onSearchComplete: myFun + }); + local.search(myValue); + } +} + + + +// 读取本地地址 +function getLocation(callback) { + // var object = obj; + plus.geolocation.getCurrentPosition(function(res) { + //成功回调 + var obj = new Object(); + obj.status = 1; + obj.lat = res.coords.latitude; //纬度 + obj.lng = res.coords.longitude; //经度 + callback(obj); + }, function(e) { + //失败回调 + //console.log('Gelocation Error: code - ' + e.code + '; message - ' + e.message); + switch (e.code) { + case 10: + obj.errStr = '请开启应用的定位权限'; + break; + case 9: + //mui.alert('请开启手机定位服务'); + obj.errStr = '请开启手机定位服务'; + break; + case 2: + if (e.message.indexOf("[geolocation:13]") > -1) { + //如果网络开启,定位失败,提示检查定位权限 + obj.errStr = '请开启应用的定位权限'; + } + if (e.message.indexOf("[geolocation:14]") > -1) { + //如果应用的权限开了,提示网络异常 + obj.errStr = '请检查网络是否正常'; + } + break; + case e.PERMISSION_DENIED: + obj.errStr = '请求定位被拒绝'; + break; + case e.POSITION_UNAVAILABLE: + obj.errStr = "位置信息不可用"; + break; + case e.TIMEOUT: + obj.errStr = "获取位置信息超时"; + break; + case e.UNKNOWN_ERROR: + obj.errStr = "未知错误"; + break; + } + + var obj = new Object(); + obj.errCode = e.code; + obj.status = 0; + callback(obj); + }, { + //超时未获取到经纬度信息 执行失败回调 (默认为5秒) + timeout: 10000 + }); + //JZL.saveItems('.user_pos', 'user_pos'); +} diff --git a/static/app2/js/memorandumlist.js b/static/app2/js/memorandumlist.js old mode 100755 new mode 100644 index c1d997f..d1e6797 --- a/static/app2/js/memorandumlist.js +++ b/static/app2/js/memorandumlist.js @@ -1,7 +1,7 @@ -mui.plusReady(function () { - - - $("body").on("tap" ,".add1",function () { - JZL.openWindow('addmemorandum.html', 'addmemorandum.html') - }) +mui.plusReady(function () { + + + $("body").on("tap" ,".add1",function () { + JZL.openWindow('addmemorandum.html', 'addmemorandum.html') + }) }) \ No newline at end of file diff --git a/static/app2/js/mui.js b/static/app2/js/mui.js old mode 100755 new mode 100644 diff --git a/static/app2/js/mui.min.js b/static/app2/js/mui.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/my.js b/static/app2/js/my.js old mode 100755 new mode 100644 index a99b40a..7a0e811 --- a/static/app2/js/my.js +++ b/static/app2/js/my.js @@ -1,624 +1,635 @@ -$('.mui-scroll').css('background', 'url(http://img.juzi199.com/static/app2/img/user_center.png) no-repeat center top'); -$('.mui-scroll').css('background-size', '100%'); - -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var token = localStorage.getItem('token'); - var authType = 0; //0 未认证 1 个人认证 2 合作认证 - var userId = 0; - var authTypeText = ""; - var authTypeStatus = ""; - var reasonsForRefusal = ""; - // $('.nblock').on('tap',function () { - // - // }) -var localAuthType = localStorage.getItem("authType"); - - // if (token) { - // console.log(token); - - JZL.ajax(qlgUrl('app/users/getIndex'), {}, function(data) { - // console.log(data); //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - userId = parseInt(data.data.user.userId); - authType = parseInt(data.data.user.authType); - var imgurl = data.data.user.userPhoto ? hyhImgUrl(data.data.user.userPhoto) : '../img/mujiimg.png'; - if(1 == localAuthType){ - //本地申请亲人认证 - JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(result) { - authTypeText = "个人认证" - if (0 == result.data.status) { - authTypeStatus = "待审核" - } else if (1 == result.data.status) { - authTypeStatus = "已通过" - localStorage.setItem("authType","0") - } else if (2 == result.data.status) { - $('.mydata').on('tap', '.cooperative', function() { - JZL.openWindow('cooperative.html', 'cooperative.html') - }) - $('.mydata').on('tap', '.individual', function() { - JZL.openWindow('individual.html', 'individual.html') - }) - - authTypeStatus = "已拒绝"; - reasonsForRefusal = result.data.reasonsForRefusal; - var html1 = '

              ' + data.data.user.loginName + - '

              ' + authTypeText + - '' + authTypeStatus + - '

              ' + reasonsForRefusal + - '

              '; - $('.con1').html(html1); - } - - }) - }else if(2 == localAuthType){ - //本地申请合作认证 - JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { - isCompany: 1 - }, function(res) { - console.log(res); - authTypeText = "合作认证" - if (0 == res.data.status) { - authTypeStatus = "待审核" - } else if (1 == res.data.status) { - authTypeStatus = "已通过" - localStorage.setItem("authType","0") - - } else if (2 == res.data.status) { - $('.mydata').on('tap', '.cooperative', function() { - JZL.openWindow('cooperative.html', 'cooperative.html') - }) - $('.mydata').on('tap', '.individual', function() { - JZL.openWindow('individual.html', 'individual.html') - }) - authTypeStatus = "已拒绝"; - reasonsForRefusal = res.data.reasonsForRefusal; - var html1 = '

              ' + data.data.user.loginName + - '

              ' + authTypeText + - '' + authTypeStatus + - '

              ' + reasonsForRefusal + - '

              '; - $('.con1').html(html1); - } - - }) - }else{ - if(1 == authType){ - //个体认证 - authTypeText = "个人认证" - authTypeStatus = "已通过" - $('.cooperative img').attr('src', "../img/trade1.png") - $('.mydata').on('tap', '.cooperative', function() { - mui.alert('已认证 无需再次认证') - }) - $('.mydata').on('tap', '.individual', function() { - JZL.openWindow('individual.html', 'individual.html') - }) - - }else if(2 == authType){ - //合作认证 - authTypeText = "合作认证" - authTypeStatus = "已通过" - $('.individual img').attr('src', "../img/renzheng1.png") - $('.mydata').on('tap', '.individual', function() { - mui.alert('已认证 无需再次认证') - }) - $('.mydata').on('tap', '.cooperative', function() { - JZL.openWindow('cooperative.html', 'cooperative.html') - }) - }else{ - //未申请认证 - if (userId > 0) { - authTypeText = "未认证 请认证" - $('.mydata').on('tap', '.cooperative', function() { - JZL.openWindow('cooperative.html', 'cooperative.html') - }) - $('.mydata').on('tap', '.individual', function() { - JZL.openWindow('individual.html', 'individual.html') - }) - } - } - } -// if (2 == authType) { -// JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { -// isCompany: 1 -// }, function(res) { -// console.log(res); -// authTypeText = "合作认证" -// if (0 == res.data.status) { -// authTypeStatus = "待审核" -// } else if (1 == res.data.status) { -// authTypeStatus = "已通过" -// -// } else if (2 == res.data.status) { -// authTypeStatus = "已拒绝"; -// reasonsForRefusal = res.data.reasonsForRefusal; -// } -// -// }) -// } else if (1 == authType) { -// JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(result) { -// console.log(result); -// authTypeText = "个人认证" -// if (0 == result.data.status) { -// authTypeStatus = "待审核" -// } else if (1 == result.data.status) { -// authTypeStatus = "已通过" -// -// } else if (2 == result.data.status) { -// authTypeStatus = "已拒绝"; -// reasonsForRefusal = result.data.reasonsForRefusal; -// } -// -// }) -// } - // setTimeout(function () { - var html1 = '

              ' + data.data.user.loginName + - '

              ' + authTypeText + - '' + authTypeStatus + - '

              ' + reasonsForRefusal + - '

              '; - $('.con1').html(html1); - // },200) - $('.header').html(""); - // $('.header').html(html); - $('.con .login').css('display', 'none') - - $('.nav').css('display', 'none') - $('.myYouhuiquan_con').addClass("myYouhuiquan_con1") - $('.myYouhuiquan').removeClass("shadown_wai") - $('#expectedProductNum').html(+data.data.expectedProductNum); - $('#expectedCouponsNum').html(+data.data.expectedCouponsNum); - $('#expectedWangNum').html(+data.data.expectedWangNum); - $('#couponsNum').html(+data.data.user.couponsNum); - $('#productNum').html(+data.data.user.productNum); - $('#wangNum').html(+data.data.user.wangNum); - - mui.ajax(qlgUrl('app/users/getFavoritesNum'), { - headers: { - "HYH-Token": token - }, - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - var data = toJson(data, 1); - if (data.status == 1) { - // //console.log(data.data.goodsFavoritesNum) - var html = '

              ' + data.data.goodsFavoritesNum + - '

              收藏夹

              ' + data.data.shopFavoritesNum + - '

              关注店铺

              ' + data.data.shareNum + - '

              我的分享

              '; - $('.nav').html(html); - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - // 订单个数 - mui.ajax(qlgUrl('app/users/getOrderNum'), { - headers: { - "HYH-Token": token - }, - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // console.log(data); - // //console.log(data.data.goodsFavoritesNum) - var data = toJson(data, 1); - if (data.status == 1) { - - var html = '
              ' + data.data.order.waitPay + - '

              待付款

              ' + - data.data.order.waitSend + - '

              待发货

              ' + - data.data.order.waitReceive + - '

              待收货

              ' + - data.data.order.waitAppraise + - '

              待评价

              ' + - data.data.order.cancelNum + - '

              退款/售后

              '; - $('.order .order_con').html(html); - $('.num').each(function() { - if ($(this).html() == '0') { - $(this).css('display', 'none'); - } - }) - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - $('.mydata-content').on('tap', '.friends', function() { - if ("undefined" != typeof(cooperativeData) && "undefined" != typeof(individualData)) { - mui.alert('请先进行认证') - return; - } else { - JZL.openWindow('friends.html', 'friends.html') - } - - }) - - $('.mydata-content').on('tap', '.applicationopen', function() { - if (authType > 0) { - JZL.openWindow('applicationopen.html', 'applicationopen.html') - } else { - mui.alert('请先进行认证') - } - - }) - $('.mydata-content').on('tap', '.myshops', function() { - if (authType > 0) { - JZL.openWindow('myshops.html', 'myshops.html') - } else { - mui.alert('请先进行认证') - } - - }) - $('.mydata-content').on('tap', '.setting', function() { - JZL.openWindow('setting.html', 'setting.html') - }) - $('.mydata-content').on('tap', '.shoppingcart', function() { - JZL.openWindow('shoppingcart.html', 'shoppingcart.html') - }) - - $('.mydata-content').on('tap', '.shangdu', function() { - if (authType == 2) { - JZL.openWindow('shangdu.html', 'shangdu.html') - } else if (authType == 0) { - mui.alert('请先进行认证') - } else if (authType == 1) { - mui.alert('只有合作认证才可以申请商都') - } - }) - $('.mydata-content').on('tap', '.supermarket', function() { - if (2 == authType) { - JZL.openWindow('supermarket.html', 'supermarket.html') - } else if (0 == authType) { - mui.alert('请先进行认证') - } else if (1 == authType) { - mui.alert('只有合作认证才可以申请商超') - } - }) - $('.mydata-content').on('tap', '.commercial', function() { - if (2 == authType) { - JZL.openWindow('commercial.html', 'commercial.html') - } else if (0 == authType) { - mui.alert('请先进行认证') - } else if (1 == authType) { - mui.alert('只有合作认证才可以申请商厦') - } - }) -// setTimeout(function() { -// //console.log(authType); -// if (2 == authType) { // 合作认证 -// $('.individual img').attr('src', "../img/renzheng1.png") -// $('.mydata').on('tap', '.individual', function() { -// mui.alert('已认证 无需再次认证') -// }) -// $('.mydata').on('tap', '.cooperative', function() { -// JZL.openWindow('cooperative.html', 'cooperative.html') -// }) -// } else if (1 == authType) { // 个体认证 -// $('.cooperative img').attr('src', "../img/trade1.png") -// $('.mydata').on('tap', '.cooperative', function() { -// mui.alert('已认证 无需再次认证') -// }) -// $('.mydata').on('tap', '.individual', function() { -// JZL.openWindow('individual.html', 'individual.html') -// }) -// } else if (userId > 0) { -// $('.mydata').on('tap', '.cooperative', function() { -// JZL.openWindow('cooperative.html', 'cooperative.html') -// }) -// $('.mydata').on('tap', '.individual', function() { -// JZL.openWindow('individual.html', 'individual.html') -// }) -// } -// -// }, 500) - - - } else { - // mui.alert(data.msg) - //console.log(data.status) - } - - }) - - // } else { - // // $('.con').attr('display','block') - // - // // JZL.openWindow('login.html', 'login.html'); - // } - - $('.mydata-content').on('tap', '.zhuweiba', function() { //助威吧 - // JZL.openWindow('essay.html', 'essay.html') - mui.alert("功能开发中......") - - }) - $('.mydata-content').on('tap', '.essaylist', function() { //烂笔头 - // JZL.openWindow('essaylist.html', 'essaylist.html') - // mui.alert("功能开发中......") - - }) - - $('.mydata-content').on('tap', '.touzi', function() { //投资 - // JZL.openWindow('invest.html', 'invest.html') - // mui.alert("功能开发中......") - - }) - $('.mydata-content').on('tap', '.shenqingweiba', function() { //申请微吧 - // JZL.openWindow('essay.html', 'essay.html') - mui.alert("功能开发中......") - - }) - $('.moneycon').on('tap', '.moneycon_', function() { - - if ($(this).children('p').attr('id') == 'userECT') { - mui.openWindow({ - url: 'ect_index.html', - id: 'ect_index.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } - - }) - // 跳转到券值 - $('.myYouhuiquan').on('tap', '.indent_btn', function() { //预获 已获优惠券 - var data_href = $(this).attr('data-href') - var data_type = $(this).attr('data-type') - var data_expect = $(this).attr('data-expect') - // var data_href = this.attributes["data-href"].nodeValue; - //console.log(data_href); - JZL.openWindow("vouchers.html", "vouchers.html", { - data_href: data_href, - data_type: data_type, - data_expect: data_expect - }) - - }) - //跳转到劵包 - $('.moneycon').on('tap', '.moneycon_', function() { - if ($(this).children('p').attr('id') == 'userJuan') { - mui.openWindow({ - url: 'juan_index.html', - id: 'juan_index.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } - - }) - - $('.mydata-content').on('tap', '.userPaymentvoucher', function() { //首页付款凭证 - // JZL.openWindow('paymentvoucher.html', 'paymentvoucher.html') - mui.alert("功能开发中......") - - }) - //订单按钮 - mui('.order').on('tap', '.indent_btn', function() { - var data_href = this.attributes["data-href"].nodeValue; - // //console.log(this.attributes["data-id"].nodeValue); - mui.openWindow({ - url: 'indent.html', - id: data_href, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.my').on('tap', '.share', function() { - mui.openWindow({ - url: 'share.html', - id: 'share.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_userId: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - - mui(".nav").on('tap', '.nblock', function() { - // var tj = plus.webview.create('search.html'); - // tj.show(); - // mui.alert(e.target.attributes["data-id"].nodeValue); - // var data_href = this.attributes["data-href"].nodeValue; - // var url = 'collect.html'; - // if (data_href == 'share_user_list.html') { - // url = 'share_user_list.html'; - // } - // // //console.log(this.attributes["data-id"].nodeValue); - // mui.openWindow({ - // url: url, - // id: url, - // styles: { - // top: '0px', //新页面顶部位置 - // bottom: '0px', //新页面底部位置 - // width: '100%', //新页面宽度,默认为100% - // height: '100%' //新页面高度,默认为100% - // }, - // extras: { - // data_href: data_href - // // ..... //自定义扩展参数,可以用来处理页面间传值 - // }, - // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - // show: { - // // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // // extras: {} //窗口动画是否使用图片加速 - // }, - // waiting: { - // autoShow: true, //自动显示等待框,默认为true - // title: '正在加载...', //等待对话框上显示的提示内容 - // options: { - // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // // ...... - // } - // } - // }) - }) - - - window.addEventListener('refresh', function(e) { //执行刷新 - location.reload(); - }); - - // - mui('.my').on('tap', '.seeting', function() { - JZL.openWindow('setting.html', 'setting.html') - }) - - // 登录 - $('.my').on('tap', '.login', function() { - mui.openWindow({ - url: 'login.html', - id: 'login.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - - - +$('.mui-scroll').css('background', 'url(http://img.juzi199.com/static/app2/img/user_center.png) no-repeat center top'); +$('.mui-scroll').css('background-size', '100%'); + +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var token = localStorage.getItem('token'); + var authType = 0; //0 未认证 1 个人认证 2 合作认证 + var userId = 0; + var authTypeText = ""; + var authTypeStatus = ""; + var reasonsForRefusal = ""; + // $('.nblock').on('tap',function () { + // + // }) +var localAuthType = localStorage.getItem("authType"); + + // if (token) { + // console.log(token); + + JZL.ajax(qlgUrl('app/users/getIndex'), {}, function(data) { + // console.log(data); //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + userId = parseInt(data.data.user.userId); + authType = parseInt(data.data.user.authType); + localStorage.setItem("userId", userId); + localStorage.setItem("userName", data.data.user.loginName) + var imgurl = data.data.user.userPhoto ? hyhImgUrl(data.data.user.userPhoto) : '../img/mujiimg.png'; + if(1 == localAuthType){ + //本地申请亲人认证 + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(result) { + authTypeText = "个人认证" + if (0 == result.data.status) { + authTypeStatus = "待审核" + } else if (1 == result.data.status) { + authTypeStatus = "已通过" + localStorage.setItem("authType","0") + } else if (2 == result.data.status) { + $('.mydata').on('tap', '.cooperative', function() { + JZL.openWindow('cooperative.html', 'cooperative.html') + }) + $('.mydata').on('tap', '.individual', function() { + JZL.openWindow('individual.html', 'individual.html') + }) + + authTypeStatus = "已拒绝"; + reasonsForRefusal = result.data.reasonsForRefusal; + var html1 = '

              ' + data.data.user.loginName + + '

              ' + authTypeText + + '' + authTypeStatus + + '

              ' + reasonsForRefusal + + '

              '; + $('.con1').html(html1); + } + + }) + }else if(2 == localAuthType){ + //本地申请合作认证 + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { + isCompany: 1 + }, function(res) { + console.log(res); + authTypeText = "合作认证" + if (0 == res.data.status) { + authTypeStatus = "待审核" + } else if (1 == res.data.status) { + authTypeStatus = "已通过" + localStorage.setItem("authType","0") + + } else if (2 == res.data.status) { + $('.mydata').on('tap', '.cooperative', function() { + JZL.openWindow('cooperative.html', 'cooperative.html') + }) + $('.mydata').on('tap', '.individual', function() { + JZL.openWindow('individual.html', 'individual.html') + }) + authTypeStatus = "已拒绝"; + reasonsForRefusal = res.data.reasonsForRefusal; + var html1 = '

              ' + data.data.user.loginName + + '

              ' + authTypeText + + '' + authTypeStatus + + '

              ' + reasonsForRefusal + + '

              '; + $('.con1').html(html1); + } + + }) + }else{ + if(1 == authType){ + //个体认证 + authTypeText = "个人认证" + authTypeStatus = "已通过" + $('.cooperative img').attr('src', "../img/trade1.png") + $('.mydata').on('tap', '.cooperative', function() { + mui.alert('已认证 无需再次认证') + }) + $('.mydata').on('tap', '.individual', function() { + JZL.openWindow('individual.html', 'individual.html') + }) + + }else if(2 == authType){ + //合作认证 + authTypeText = "合作认证" + authTypeStatus = "已通过" + $('.individual img').attr('src', "../img/renzheng1.png") + $('.mydata').on('tap', '.individual', function() { + mui.alert('已认证 无需再次认证') + }) + $('.mydata').on('tap', '.cooperative', function() { + JZL.openWindow('cooperative.html', 'cooperative.html') + }) + }else{ + //未申请认证 + if (userId > 0) { + authTypeText = "未认证 请认证" + $('.mydata').on('tap', '.cooperative', function() { + JZL.openWindow('cooperative.html', 'cooperative.html') + }) + $('.mydata').on('tap', '.individual', function() { + JZL.openWindow('individual.html', 'individual.html') + }) + } + } + } +// if (2 == authType) { +// JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { +// isCompany: 1 +// }, function(res) { +// console.log(res); +// authTypeText = "合作认证" +// if (0 == res.data.status) { +// authTypeStatus = "待审核" +// } else if (1 == res.data.status) { +// authTypeStatus = "已通过" +// +// } else if (2 == res.data.status) { +// authTypeStatus = "已拒绝"; +// reasonsForRefusal = res.data.reasonsForRefusal; +// } +// +// }) +// } else if (1 == authType) { +// JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(result) { +// console.log(result); +// authTypeText = "个人认证" +// if (0 == result.data.status) { +// authTypeStatus = "待审核" +// } else if (1 == result.data.status) { +// authTypeStatus = "已通过" +// +// } else if (2 == result.data.status) { +// authTypeStatus = "已拒绝"; +// reasonsForRefusal = result.data.reasonsForRefusal; +// } +// +// }) +// } + // setTimeout(function () { + var html1 = '

              ' + data.data.user.loginName + + '

              ' + authTypeText + + '' + authTypeStatus + + '

              ' + reasonsForRefusal + + '

              '; + $('.con1').html(html1); + // },200) + $('.header').html(""); + // $('.header').html(html); + $('.con .login').css('display', 'none') + + $('.nav').css('display', 'none') + $('.myYouhuiquan_con').addClass("myYouhuiquan_con1") + $('.myYouhuiquan').removeClass("shadown_wai") + $('#expectedProductNum').html(+data.data.expectedProductNum); + $('#expectedCouponsNum').html(+data.data.expectedCouponsNum); + $('#expectedWangNum').html(+data.data.expectedWangNum); + $('#couponsNum').html(+data.data.alreadyCouponsNum); + $('#productNum').html(+data.data.alreadyProductNum); + $('#wangNum').html(+data.data.user.wangNum); + + mui.ajax(qlgUrl('app/users/getFavoritesNum'), { + headers: { + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data, 1); + if (data.status == 1) { + // //console.log(data.data.goodsFavoritesNum) + var html = '

              ' + data.data.goodsFavoritesNum + + '

              收藏夹

              ' + data.data.shopFavoritesNum + + '

              关注店铺

              ' + data.data.shareNum + + '

              我的分享

              '; + $('.nav').html(html); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + // 订单个数 + mui.ajax(qlgUrl('app/users/getOrderNum'), { + headers: { + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // console.log(data); + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data, 1); + if (data.status == 1) { + + var html = '
              ' + data.data.order.waitPay + + '

              待付款

              ' + + data.data.order.waitSend + + '

              待发货

              ' + + data.data.order.waitReceive + + '

              待收货

              ' + + data.data.order.waitAppraise + + '

              待评价

              ' + + data.data.order.cancelNum + + '

              退款/售后

              '; + $('.order .order_con').html(html); + $('.num').each(function() { + if ($(this).html() == '0') { + $(this).css('display', 'none'); + } + }) + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('.mydata-content').on('tap', '.friends', function() { + if ("undefined" != typeof(cooperativeData) && "undefined" != typeof(individualData)) { + mui.alert('请先进行认证') + return; + } else { + JZL.openWindow('friends.html', 'friends.html') + } + + }) + + $('.mydata-content').on('tap', '.applicationopen', function() { + if (authType > 0) { + JZL.openWindow('applicationopen.html', 'applicationopen.html') + } else { + mui.alert('请先进行认证') + } + + }) + $('.mydata-content').on('tap', '.myshops', function() { + if (authType > 0) { + JZL.openWindow('myshops.html', 'myshops.html') + } else { + mui.alert('请先进行认证') + } + + }) + $('.mydata-content').on('tap', '.setting', function() { + JZL.openWindow('setting.html', 'setting.html') + }) + $('.mydata-content').on('tap', '.shoppingcart', function() { + JZL.openWindow('shoppingcart_warp.html', 'shoppingcart_warp.html') + }) + $('.mydata-content').on('tap', '.shangdu', function() { + if (authType == 2) { + JZL.openWindow('shangdu.html', 'shangdu.html') + } else if (authType == 0) { + mui.alert('请先进行认证') + } else if (authType == 1) { + mui.alert('只有合作认证才可以申请商都') + } + }) + $('.mydata-content').on('tap', '.supermarket', function() { + if (2 == authType) { + JZL.openWindow('supermarket.html', 'supermarket.html') + } else if (0 == authType) { + mui.alert('请先进行认证') + } else if (1 == authType) { + mui.alert('只有合作认证才可以申请商超') + } + }) + $('.mydata-content').on('tap', '.commercial', function() { + if (2 == authType) { + JZL.openWindow('commercial.html', 'commercial.html') + } else if (0 == authType) { + mui.alert('请先进行认证') + } else if (1 == authType) { + mui.alert('只有合作认证才可以申请商厦') + } + }) + $('.mydata-content').on('tap', '.help_sale', function() { + JZL.openWindow('my_help_sale.html', 'my_help_sale.html') + }) +// setTimeout(function() { +// //console.log(authType); +// if (2 == authType) { // 合作认证 +// $('.individual img').attr('src', "../img/renzheng1.png") +// $('.mydata').on('tap', '.individual', function() { +// mui.alert('已认证 无需再次认证') +// }) +// $('.mydata').on('tap', '.cooperative', function() { +// JZL.openWindow('cooperative.html', 'cooperative.html') +// }) +// } else if (1 == authType) { // 个体认证 +// $('.cooperative img').attr('src', "../img/trade1.png") +// $('.mydata').on('tap', '.cooperative', function() { +// mui.alert('已认证 无需再次认证') +// }) +// $('.mydata').on('tap', '.individual', function() { +// JZL.openWindow('individual.html', 'individual.html') +// }) +// } else if (userId > 0) { +// $('.mydata').on('tap', '.cooperative', function() { +// JZL.openWindow('cooperative.html', 'cooperative.html') +// }) +// $('.mydata').on('tap', '.individual', function() { +// JZL.openWindow('individual.html', 'individual.html') +// }) +// } +// +// }, 500) + + + } else { + // mui.alert(data.msg) + //console.log(data.status) + } + + }) + + // } else { + // // $('.con').attr('display','block') + // + // // JZL.openWindow('login.html', 'login.html'); + // } + + $('.mydata-content').on('tap', '.zhuweiba', function() { //助威吧 + // JZL.openWindow('essay.html', 'essay.html') + mui.alert("功能开发中......") + + }) + let CoUnTeR = 0 + $('.mydata-content').on('tap', '.essaylist', function() { //烂笔头 + // JZL.openWindow('essaylist.html', 'essaylist.html') + if(CoUnTeR < 5){ + CoUnTeR ++; + mui.alert("功能开发中......") + }else{ + JZL.openWindow('notepad.html', 'notepad.html') + CoUnTeR = 0; + } + + }) + + $('.mydata-content').on('tap', '.touzi', function() { //投资 + // JZL.openWindow('invest.html', 'invest.html') + // mui.alert("功能开发中......") + + }) + $('.mydata-content').on('tap', '.shenqingweiba', function() { //申请微吧 + // JZL.openWindow('essay.html', 'essay.html') + mui.alert("功能开发中......") + + }) + $('.moneycon').on('tap', '.moneycon_', function() { + + if ($(this).children('p').attr('id') == 'userECT') { + mui.openWindow({ + url: 'ect_index.html', + id: 'ect_index.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + + }) + // 跳转到券值 + $('.myYouhuiquan').on('tap', '.indent_btn', function() { //预获 已获优惠券 + var data_href = $(this).attr('data-href') + var data_type = $(this).attr('data-type') + var data_expect = $(this).attr('data-expect') + // var data_href = this.attributes["data-href"].nodeValue; + //console.log(data_href); + JZL.openWindow("vouchers.html", "vouchers.html", { + data_href: data_href, + data_type: data_type, + data_expect: data_expect + }) + + }) + //跳转到劵包 + $('.moneycon').on('tap', '.moneycon_', function() { + if ($(this).children('p').attr('id') == 'userJuan') { + mui.openWindow({ + url: 'juan_index.html', + id: 'juan_index.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + + }) + + $('.mydata-content').on('tap', '.userPaymentvoucher', function() { //首页付款凭证 + // JZL.openWindow('paymentvoucher.html', 'paymentvoucher.html') + mui.alert("功能开发中......") + + }) + //订单按钮 + mui('.order').on('tap', '.indent_btn', function() { + var data_href = this.attributes["data-href"].nodeValue; + // //console.log(this.attributes["data-id"].nodeValue); + mui.openWindow({ + url: 'indent.html', + id: data_href, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.my').on('tap', '.share', function() { + mui.openWindow({ + url: 'share.html', + id: 'share.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_userId: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + + mui(".nav").on('tap', '.nblock', function() { + // var tj = plus.webview.create('search.html'); + // tj.show(); + // mui.alert(e.target.attributes["data-id"].nodeValue); + // var data_href = this.attributes["data-href"].nodeValue; + // var url = 'collect.html'; + // if (data_href == 'share_user_list.html') { + // url = 'share_user_list.html'; + // } + // // //console.log(this.attributes["data-id"].nodeValue); + // mui.openWindow({ + // url: url, + // id: url, + // styles: { + // top: '0px', //新页面顶部位置 + // bottom: '0px', //新页面底部位置 + // width: '100%', //新页面宽度,默认为100% + // height: '100%' //新页面高度,默认为100% + // }, + // extras: { + // data_href: data_href + // // ..... //自定义扩展参数,可以用来处理页面间传值 + // }, + // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + // show: { + // // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // // extras: {} //窗口动画是否使用图片加速 + // }, + // waiting: { + // autoShow: true, //自动显示等待框,默认为true + // title: '正在加载...', //等待对话框上显示的提示内容 + // options: { + // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // // ...... + // } + // } + // }) + }) + + + window.addEventListener('refresh', function(e) { //执行刷新 + location.reload(); + }); + + // + mui('.my').on('tap', '.seeting', function() { + JZL.openWindow('setting.html', 'setting.html') + }) + + // 登录 + $('.my').on('tap', '.login', function() { + mui.openWindow({ + url: 'login.html', + id: 'login.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + + + }) diff --git a/static/app2/js/my_help_sale.js b/static/app2/js/my_help_sale.js new file mode 100644 index 0000000..d7fe4e3 --- /dev/null +++ b/static/app2/js/my_help_sale.js @@ -0,0 +1,181 @@ +mui.plusReady(function(){ + JZL.ajax(qlgUrl('app/user_level/index'), {}, function(data) { + // console.log(data); //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + console.log(data); + for (let i in data) { + let each = data[i]; + $("#helpSaleTable").append('
              '+each.count+''+each.total+''+ + ''+each.level+'
              ') + } + }) + + $("#userName").text(localStorage.getItem("userName")) + JZL.ajax(qlgUrl('app/users/getIndex'), {}, function(data) { + // console.log(data); //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + userId = parseInt(data.data.user.userId); + localStorage.setItem("userName", data.data.user.loginName) + $("#userName").text(data.data.user.loginName) + $("#preGetCouponCount").text("预获产品券:¥"+data.data.expectedProductNum); + } + }) + $("#preGetCoupon").on("tap",function(){ + JZL.openWindow("vouchers.html", "vouchers.html", { + data_href: 'expectedProduct', + data_type: '1', + data_expect: '1' + }) + }) + $(".ZGYH").on("tap",function(){ + JZL.openWindow("helpGet.html", "helpGet.html") + }) + $("#myHelpSaleOrder").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'zgall', + extras: { + data_href: 'zgall' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".waitSend").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'zgwaitDeliver', + extras: { + data_href: 'zgwaitDeliver' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".waitDeliver").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'zgwaitReceive', + extras: { + data_href: 'zgwaitReceive' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".waitAppraise").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'zgwaitAppraise', + extras: { + data_href: 'zgwaitAppraise' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".abnormal").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'zgabnormal', + extras: { + data_href: 'zgabnormal' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".helpSaleConfirm").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'mzgwaitConfirm', + extras: { + data_href: 'mzgwaitConfirm' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".helpSalePaid").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'mzgwaitPaid', + extras: { + data_href: 'mzgwaitPaid' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".helpSaleUpload").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'mzgwaitUpload', + extras: { + data_href: 'mzgwaitUpload' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".helpSaleRecive").on("tap", function(){ + mui.openWindow({ + url: 'indent.html', + id: 'mzgwaitReceive', + extras: { + data_href: 'mzgwaitReceive' + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + } + }) + }) + $(".helpSaleCart").on("tap", function(){ + mui.openWindow({ + url: "shoppingcart.html", + id: "shoppingcart.html_3", + extras: { + from_id: 3, + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + $("#toHelpSale").on("tap", function(){ + JZL.openWindow('zhugouba.html', 'zhugouba.html'); + }) +}) \ No newline at end of file diff --git a/static/app2/js/myshop.js b/static/app2/js/myshop.js old mode 100755 new mode 100644 index 4e6a6ce..6f466e0 --- a/static/app2/js/myshop.js +++ b/static/app2/js/myshop.js @@ -1,194 +1,203 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - $('.orange').html("¥000.00") - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - //console.log(shopId); - $('.seeting').on("tap", function() { - JZL.openWindow('shopsetting.html', parseInt(shopId)) - }) - $('.money').on('tap', function() { - JZL.openWindow('cash-out.html', parseInt(shopId)) - }) - // $('.money').on('tap','.myYouhuiquan_cb',function () { - // var data_href=$(this).attr('data-href') - // var data_expect =$(this).attr('data_expect') - // //console.log(data_href) - // JZL.openWindow('income-details.html',parseInt(shopId),{data_href:data_href,data_expect:data_expect}) - // }) - // $('.money').on('tap',function () { - // JZL.openWindow('paymentvoucher.html',parseInt(shopId)) - // }) - // 获取商家首页信息 - JZL.ajax(qlgUrl('app/shops/shopInfo'), { - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status) { - data = data.data; - // //console.log(data.status); - var html = ""; - var html1 = ""; - html = '

              ' + data.shopName + '

              ' + data.userName + - '' + data.phone + '' - $('.shop_info').html(html) - $('.wait_money .orange').text('¥' + data.waitPayMoneyNum); - $('.comp_money .orange').text('¥' + data.receivedPayMoneyNum); - var html1 = '
              ' + data.waitPayNum + - '

              待付款

              ' + - data.waitConfirmNum + - '

              待确认

              ' + - data.waitDeliverNum + - '

              待发货

              ' + - data.waitReceiveNum + - '

              待收货

              ' + - data.abnormal + '

              退款/售后

              '; - $('.line_order .order_con').html(html1); - $('.num').each(function() { - if ($(this).html() == '0') { - $(this).css('display', 'none'); - } - }) - }else{ - mui.alert(data.msg) - } - }) - - mui('.order').on('tap', '.indent_btn', function() { - var data_href = this.attributes["data-href"].nodeValue; - JZL.openWindow("shop_indent.html", data_href, { - data_href: data_href, - shopId: shopId - }) - - }) - mui('.order').on('tap', '.pingzheng', function() { - // var data_href = this.attributes["data-href"].nodeValue; - JZL.openWindow("paymentVoucher.html", parseInt(shopId)) - - }) - mui('.order').on('tap', '.tixian', function() { - // var data_href = this.attributes["data-href"].nodeValue; - JZL.openWindow('cash-out.html', parseInt(shopId)) - - }) - getRecommend(nowpage, pagesize) - // 获取店铺商品 - var nowpage = 1; - var pagesize = 10; - var isload = false; - - function getRecommend(nowpage, pagesize) { - var recommenddata = { - nowpage: nowpage ? nowpage : 1, - pagesize: pagesize ? pagesize : 10 - } - recommenddata.shopId = shopId - - if (isload == true) { - return; - } - isload = true - mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { - data: recommenddata, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data); - - // var data = toJson(data, 1); - if (data.status == 1) { - //console.log(data); - - var html = ''; - var data = data.data; - if (data.Rows == '') { - $('.mui-scroll').append( - '

              没有更多商品

              '); - - return; - } - $.each(data.Rows, function() { - html += '
              ' + this.goodsName + - '
              价格¥' + this.shopPrice + - '
              优惠率' + this.discountRate + - '%
              ' - // html += '
              '+ this.goodsName + '
              ¥' + this.shopPrice + - // ' 满减
              '+this.saleNum+'人购买
              优惠率   '+this.discountRate+'%
              '; - }); - - if (nowpage == 1) { - // //console.log(222); - $('.shop-goods-content').html(html); - } else { - $('.shop-goods-content').append(html); - } - - // $('.rcb_title span').each(function() { - // if ($(this).attr('data-goodsId') == 1) { - // $(this).css('display', 'none'); - // } - // }) - $('.sdg-img').height($('.sdg-img').width()); - - } else{ - mui.alert(data.msg) - } - isload - false - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - - } - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - // 判断默认行为是否可以被禁用 - if (e.cancelable) { - // 判断默认行为是否已经被禁用 - if (!e.defaultPrevented) { - e.preventDefault(); - } - } - if (scroll.y == scroll.maxScrollY) { - if (isload = true) { - nowpage++; - getRecommend(nowpage, pagesize); - } - } - }) - - $('.shop-goods').on('tap', '.shop-goods-detail', function() { - var good_id = $(this).attr('data-goodsId'); - JZL.openWindow('details.html', parseInt(good_id), { - shopId: shopId, - data_id: good_id - }) - - }) - - - - - - - - - - - - - - - - +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + $('.orange').html("¥000.00") + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + //console.log(shopId); + $('.seeting').on("tap", function() { + JZL.openWindow('shopsetting.html', parseInt(shopId)) + }) + $('.money').on('tap', function() { + JZL.openWindow('cash-out.html', parseInt(shopId)) + }) + // $('.money').on('tap','.myYouhuiquan_cb',function () { + // var data_href=$(this).attr('data-href') + // var data_expect =$(this).attr('data_expect') + // //console.log(data_href) + // JZL.openWindow('income-details.html',parseInt(shopId),{data_href:data_href,data_expect:data_expect}) + // }) + // $('.money').on('tap',function () { + // JZL.openWindow('paymentvoucher.html',parseInt(shopId)) + // }) + // 获取商家首页信息 + JZL.ajax(qlgUrl('app/shops/shopInfo'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + data = data.data; + // //console.log(data.status); + var html = ""; + var html1 = ""; + html = '

              ' + data.shopName + '

              ' + data.userName + + '' + data.phone + '' + $('.shop_info').html(html) + $('.wait_money .orange').text('¥' + data.waitPayMoneyNum); + $('.comp_money .orange').text('¥' + data.receivedPayMoneyNum); + var html1 = '
              ' + data.waitPayNum + + '

              待付款

              ' + + data.waitConfirmNum + + '

              待确认

              ' + + data.waitDeliverNum + + '

              待发货

              ' + + data.waitReceiveNum + + '

              待收货

              ' + + data.abnormal + '

              退款/售后

              '; + $('.line_order .order_con').html(html1); + $('.num').each(function() { + if ($(this).html() == '0') { + $(this).css('display', 'none'); + } + }) + }else{ + mui.alert(data.msg) + } + }) + + mui('.order').on('tap', '.indent_btn', function() { + var data_href = this.attributes["data-href"].nodeValue; + JZL.openWindow("shop_indent.html", data_href, { + data_href: data_href, + shopId: shopId + }) + + }) + mui('.order').on('tap', '.pingzheng', function() { + // var data_href = this.attributes["data-href"].nodeValue; + JZL.openWindow("paymentVoucher.html", parseInt(shopId)) + + }) + mui('.order').on('tap', '.tixian', function() { + // var data_href = this.attributes["data-href"].nodeValue; + JZL.openWindow('cash-out.html', parseInt(shopId)) + + }) + getRecommend(nowpage, pagesize) + // 获取店铺商品 + var nowpage = 1; + var pagesize = 10; + var isload = false; + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y >= scroll.maxScrollY) { + if (isload == false) { + nowpage++; + // getShops(nowPage, pageSize); + console.log(nowpage) + getRecommend(nowpage, pagesize) + } + } + }) + function getRecommend(nowpage, pagesize) { + var recommenddata = { + page: nowpage ? nowpage : 1, + pageSize: pagesize ? pagesize : 10 + } + recommenddata.shopId = shopId + + if (isload == true) { + return; + } + isload = true + mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data); + + // var data = toJson(data, 1); + if (data.status == 1) { + //console.log(data); + + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.mui-scroll').append( + '

              没有更多商品

              '); + + return; + } + $.each(data.Rows, function() { + html += '
              ' + this.goodsName + + '
              价格¥' + this.shopPrice + + '
              优惠率' + this.discountRate + + '%
              ' + // html += '
              '+ this.goodsName + '
              ¥' + this.shopPrice + + // ' 满减
              '+this.saleNum+'人购买
              优惠率   '+this.discountRate+'%
              '; + }); + + if (nowpage == 1) { + // //console.log(222); + $('.shop-goods-content').html(html); + } else { + $('.shop-goods-content').append(html); + } + + // $('.rcb_title span').each(function() { + // if ($(this).attr('data-goodsId') == 1) { + // $(this).css('display', 'none'); + // } + // }) + $('.sdg-img').height($('.sdg-img').width()); + + } else{ + mui.alert(data.msg) + } + isload = false + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + } + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // 判断默认行为是否可以被禁用 + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isload = true) { + nowpage++; + getRecommend(nowpage, pagesize); + } + } + }) + + $('.shop-goods').on('tap', '.shop-goods-detail', function() { + var good_id = $(this).attr('data-goodsId'); + JZL.openWindow('details.html', parseInt(good_id), { + shopId: shopId, + data_id: good_id + }) + + }) + + + + + + + + + + + + + + + + }) diff --git a/static/app2/js/myshops.js b/static/app2/js/myshops.js old mode 100755 new mode 100644 index e2dea2c..6f0d574 --- a/static/app2/js/myshops.js +++ b/static/app2/js/myshops.js @@ -1,316 +1,316 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var authType = localStorage.getItem('authType') - var supermarket = '', - commercial = '', - shangdu = ''; - var scinfo = '', - ssinfo = '', - sdinfo = ''; - var shopName = ''; - var scshopId = '', - ssshopId = "", - sdshopId = ''; - var scid = '', - ssid = '', - sdid = ''; - $('.nc').hide(); - $('.ic').hide(); - // 获取商超商厦申请记录 - // //console.log(authType); - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 2 - }, function(data) { //shangchang - // console.log(data) - if ("undefined" != typeof(data.data)) { - scshopId = data.data.shopId; - scid = data.data.id; - - if (0 == data.data.status) { - scinfo = "待审核" - } - if (1 == data.data.status) { - scinfo = "已通过" - } - if (2 == data.data.status) { - scinfo = "已拒绝" - } - - }else{ - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 2, - status:1 - }, function(data) { //shangchang - // console.log(data) - if ("undefined" != typeof(data.data)) { - scshopId = data.data.shopId; - scid = data.data.id; - - if (0 == data.data.status) { - scinfo = "待审核" - } - if (1 == data.data.status) { - scinfo = "已通过" - } - if (2 == data.data.status) { - scinfo = "已拒绝" - } - - } - - - }) - } - - - }) - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 3 - }, function(data) { //xiaodian - // console.log(data) - if ("undefined" != typeof(data.data)) { - - if (0 == data.data.status) { - ssinfo = "待审核" - } - if (1 == data.data.status) { - ssinfo = "已通过" - } - if (2 == data.data.status) { - ssinfo = "已拒绝" - } - ssid = data.data.id; - - ssshopId = data.data.shopId; - // ssinfo=data.data.status; - - }else{ - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 3, - status:1 - }, function(data) { //xiaodian - // console.log(data) - if ("undefined" != typeof(data.data)) { - - if (0 == data.data.status) { - ssinfo = "待审核" - } - if (1 == data.data.status) { - ssinfo = "已通过" - } - if (2 == data.data.status) { - ssinfo = "已拒绝" - } - ssid = data.data.id; - - ssshopId = data.data.shopId; - // ssinfo=data.data.status; - - } - }) - } - }) - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 4 - }, function(data) { //shangchangkefu - // console.log(data) - if ("undefined" != typeof(data.data)) { - - if (0 == data.data.status) { - sdinfo = "待审核" - } - if (1 == data.data.status) { - sdinfo = "已通过" - } - if (2 == data.data.status) { - sdinfo = "已拒绝" - } - sdid = data.data.id; - - sdshopId = data.data.shopId; - // sdinfo = data.data.status; - // shangdu = '' - }else{ - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 4, - status:1 - }, function(data) { //shangchangkefu - // console.log(data) - if ("undefined" != typeof(data.data)) { - - if (0 == data.data.status) { - sdinfo = "待审核" - } - if (1 == data.data.status) { - sdinfo = "已通过" - } - if (2 == data.data.status) { - sdinfo = "已拒绝" - } - sdid = data.data.id; - - sdshopId = data.data.shopId; - // sdinfo = data.data.status; - // shangdu = '' - } - }) - } - }) - JZL.ajax(qlgUrl('app/shops/userShopList'), {}, function(data) { - if (1 == data.status) { - var data = data.data; - var html = ''; - var info = "", - infotext; - $.each(data, function() { - if (this.status == 0) { - info = "待审核", - infotext = "编辑" - } else if (this.status == 1) { - info = "已通过"; - infotext = "进入店铺" - - } else if (this.status == 2) { - info = "已拒绝"; - infotext = "编辑" - } - html = '

              ' + - this.shopName + '

              ' + info + - '

              商超

              ' + - scinfo + - '

              商厦

              ' + - ssinfo + '

              商都

              ' + - sdinfo + '

              ' + infotext + - '

              删除

              '; - // html = '
              ' + - // this.shopName + - // '

              ' + - // info + - // '

              ' + - // infotext + - // '

              删除

              '; - // - $('.con').append(html); - }) - }else{ - mui.alert(data.msg) - } - }) - setTimeout(function() { - $.each($(".list"), function() { - var shop_id = $(this).attr("data-id"); - if (shop_id == scshopId) { - $(this).find($('.listcenter .supermaket')).show() - // $(this).find($('.listcenter .supermaket .namecom')).html('商超') - // $(this).find($('.listcenter .shopname .scinfo')).show() - $(this).find($('.listcenter .shopname .scinfo')).html(scinfo) - } - if (shop_id == ssshopId) { - $(this).find($('.listcenter .commercial')).show() - // $(this).find($('.listcenter .commercial .namecom')).html('商厦') - // $(this).find($('.listcenter .shopname .ssinfo')).show() - $(this).find($('.listcenter .shopname .ssinfo')).html(ssinfo) - } - if (shop_id == sdshopId) { - $(this).find($('.listcenter .shangdu')).show() - - // $(this).find($('.listcenter .shangdu .namecom')).html('商都') - // $(this).find($('.listcenter .shopname .sdinfo')).show() - - $(this).find($('.listcenter .shopname .sdinfo')).html(sdinfo) - } - }) - }, 1000) - // 申请店铺 - $('.add1').on('tap', function() { - JZL.openWindow('applicationopen.html', 'applicationopen.html'); - }) - - //编辑店铺 - var shopId = ''; - mui('.con').on('tap', '.bj', function() { - shopId = $(this).parents().parents().parents().attr("data-id"); - var status = $(this).parents().parents().parents().attr("data-info"); - - if (1 == status) { - JZL.openWindow('myshop.html', shopId, { - 'shopId': shopId - }); - - // JZL.openWindow('storeout.html', shopId); - } else { - JZL.openWindow('applicationopen.html', shopId, { - 'status': status, - 'shopId': shopId - }); - // JZL.openWindow('myshop.html', shopId); - - } - }) - mui('.con').on('tap', '.supermaket', function() { - if (scinfo != "已通过") { - JZL.openWindow('supermarket.html', 'supermarket.html', { - scid: scid - }) - } - }) - mui('.con').on('tap', '.commercial', function() { - if (ssinfo != "已通过") { - JZL.openWindow('commercial.html', 'commercial.html', { - ssid: ssid - }) - } - }) - mui('.con').on('tap', '.shangdu', function() { - if (sdinfo != "已通过") { - JZL.openWindow('shangdu.html', 'shangdu.html', { - sdid: sdid - }) - } - }) - //删除店铺 - mui('.con').on('tap', '.del', function() { - - shopId = $(this).parents().parents().parents().attr("data-id"); - - if (confirm('确认删除?')) { - var lxy_div = - '

              请输入操作密码

              '; - $('body').append(lxy_div); - $('.lxy_zz').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - }) - mui('.lxy_zz_btn').on('tap', '.cancle', function() { - $('#home_zhezhao').remove(); - return; - }) - - mui('.lxy_zz_btn').on('tap', '.sure', function() { - var payPwd = $('.payword').val(); - if (payPwd == '') { - mui.alert("请输入密码") - } - JZL.ajax(qlgUrl('app/shops/delShop'), { - shopId: shopId, - payPwd: payPwd - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data, 1); - console.log(data); - if (data.status == 1) { - $('#home_zhezhao').remove(); - mui.toast(data.msg) - location.reload() - }else{ - mui.alert(data.msg) - } - }) - - }) - } - }) -}) +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var authType = localStorage.getItem('authType') + var supermarket = '', + commercial = '', + shangdu = ''; + var scinfo = '', + ssinfo = '', + sdinfo = ''; + var shopName = ''; + var scshopId = '', + ssshopId = "", + sdshopId = ''; + var scid = '', + ssid = '', + sdid = ''; + $('.nc').hide(); + $('.ic').hide(); + // 获取商超商厦申请记录 + // //console.log(authType); + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 2 + }, function(data) { //shangchang + // console.log(data) + if ("undefined" != typeof(data.data)) { + scshopId = data.data.shopId; + scid = data.data.id; + + if (0 == data.data.status) { + scinfo = "待审核" + } + if (1 == data.data.status) { + scinfo = "已通过" + } + if (2 == data.data.status) { + scinfo = "已拒绝" + } + + }else{ + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 2, + status:1 + }, function(data) { //shangchang + // console.log(data) + if ("undefined" != typeof(data.data)) { + scshopId = data.data.shopId; + scid = data.data.id; + + if (0 == data.data.status) { + scinfo = "待审核" + } + if (1 == data.data.status) { + scinfo = "已通过" + } + if (2 == data.data.status) { + scinfo = "已拒绝" + } + + } + + + }) + } + + + }) + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 3 + }, function(data) { //xiaodian + // console.log(data) + if ("undefined" != typeof(data.data)) { + + if (0 == data.data.status) { + ssinfo = "待审核" + } + if (1 == data.data.status) { + ssinfo = "已通过" + } + if (2 == data.data.status) { + ssinfo = "已拒绝" + } + ssid = data.data.id; + + ssshopId = data.data.shopId; + // ssinfo=data.data.status; + + }else{ + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 3, + status:1 + }, function(data) { //xiaodian + // console.log(data) + if ("undefined" != typeof(data.data)) { + + if (0 == data.data.status) { + ssinfo = "待审核" + } + if (1 == data.data.status) { + ssinfo = "已通过" + } + if (2 == data.data.status) { + ssinfo = "已拒绝" + } + ssid = data.data.id; + + ssshopId = data.data.shopId; + // ssinfo=data.data.status; + + } + }) + } + }) + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 4 + }, function(data) { //shangchangkefu + // console.log(data) + if ("undefined" != typeof(data.data)) { + + if (0 == data.data.status) { + sdinfo = "待审核" + } + if (1 == data.data.status) { + sdinfo = "已通过" + } + if (2 == data.data.status) { + sdinfo = "已拒绝" + } + sdid = data.data.id; + + sdshopId = data.data.shopId; + // sdinfo = data.data.status; + // shangdu = '' + }else{ + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 4, + status:1 + }, function(data) { //shangchangkefu + // console.log(data) + if ("undefined" != typeof(data.data)) { + + if (0 == data.data.status) { + sdinfo = "待审核" + } + if (1 == data.data.status) { + sdinfo = "已通过" + } + if (2 == data.data.status) { + sdinfo = "已拒绝" + } + sdid = data.data.id; + + sdshopId = data.data.shopId; + // sdinfo = data.data.status; + // shangdu = '' + } + }) + } + }) + JZL.ajax(qlgUrl('app/shops/userShopList'), {}, function(data) { + if (1 == data.status) { + var data = data.data; + var html = ''; + var info = "", + infotext; + $.each(data, function() { + if (this.status == 0) { + info = "待审核", + infotext = "编辑" + } else if (this.status == 1) { + info = "已通过"; + infotext = "进入店铺" + + } else if (this.status == 2) { + info = "已拒绝"; + infotext = "编辑" + } + html = '

              ' + + this.shopName + '

              ' + info + + '

              商超

              ' + + scinfo + + '

              商厦

              ' + + ssinfo + '

              商都

              ' + + sdinfo + '

              ' + infotext + + '

              删除

              '; + // html = '
              ' + + // this.shopName + + // '

              ' + + // info + + // '

              ' + + // infotext + + // '

              删除

              '; + // + $('.con').append(html); + }) + }else{ + mui.alert(data.msg) + } + }) + setTimeout(function() { + $.each($(".list"), function() { + var shop_id = $(this).attr("data-id"); + if (shop_id == scshopId) { + $(this).find($('.listcenter .supermaket')).show() + // $(this).find($('.listcenter .supermaket .namecom')).html('商超') + // $(this).find($('.listcenter .shopname .scinfo')).show() + $(this).find($('.listcenter .shopname .scinfo')).html(scinfo) + } + if (shop_id == ssshopId) { + $(this).find($('.listcenter .commercial')).show() + // $(this).find($('.listcenter .commercial .namecom')).html('商厦') + // $(this).find($('.listcenter .shopname .ssinfo')).show() + $(this).find($('.listcenter .shopname .ssinfo')).html(ssinfo) + } + if (shop_id == sdshopId) { + $(this).find($('.listcenter .shangdu')).show() + + // $(this).find($('.listcenter .shangdu .namecom')).html('商都') + // $(this).find($('.listcenter .shopname .sdinfo')).show() + + $(this).find($('.listcenter .shopname .sdinfo')).html(sdinfo) + } + }) + }, 1000) + // 申请店铺 + $('.add1').on('tap', function() { + JZL.openWindow('applicationopen.html', 'applicationopen.html'); + }) + + //编辑店铺 + var shopId = ''; + mui('.con').on('tap', '.bj', function() { + shopId = $(this).parents().parents().parents().attr("data-id"); + var status = $(this).parents().parents().parents().attr("data-info"); + + if (1 == status) { + JZL.openWindow('myshop.html', shopId, { + 'shopId': shopId + }); + + // JZL.openWindow('storeout.html', shopId); + } else { + JZL.openWindow('applicationopen.html', shopId, { + 'status': status, + 'shopId': shopId + }); + // JZL.openWindow('myshop.html', shopId); + + } + }) + mui('.con').on('tap', '.supermaket', function() { + if (scinfo != "已通过") { + JZL.openWindow('supermarket.html', 'supermarket.html', { + scid: scid + }) + } + }) + mui('.con').on('tap', '.commercial', function() { + if (ssinfo != "已通过") { + JZL.openWindow('commercial.html', 'commercial.html', { + ssid: ssid + }) + } + }) + mui('.con').on('tap', '.shangdu', function() { + if (sdinfo != "已通过") { + JZL.openWindow('shangdu.html', 'shangdu.html', { + sdid: sdid + }) + } + }) + //删除店铺 + mui('.con').on('tap', '.del', function() { + + shopId = $(this).parents().parents().parents().attr("data-id"); + + if (confirm('确认删除?')) { + var lxy_div = + '

              请输入操作密码

              '; + $('body').append(lxy_div); + $('.lxy_zz').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + mui('.lxy_zz_btn').on('tap', '.cancle', function() { + $('#home_zhezhao').remove(); + return; + }) + + mui('.lxy_zz_btn').on('tap', '.sure', function() { + var payPwd = $('.payword').val(); + if (payPwd == '') { + mui.alert("请输入密码") + } + JZL.ajax(qlgUrl('app/shops/delShop'), { + shopId: shopId, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + console.log(data); + if (data.status == 1) { + $('#home_zhezhao').remove(); + mui.toast(data.msg) + location.reload() + }else{ + mui.alert(data.msg) + } + }) + + }) + } + }) +}) diff --git a/static/app2/js/notepad.js b/static/app2/js/notepad.js new file mode 100644 index 0000000..b9bdc5c --- /dev/null +++ b/static/app2/js/notepad.js @@ -0,0 +1,57 @@ +mui.plusReady(function(){ + // some ajax + $(".footer").on("tap", ()=>{ + app.create() + }) +}) +const app = new Vue({ + el: '#app', + data() { + return { + noteData: [ + ], + counter: 0 + } + }, + created() { + console.log("Vue") + }, + methods: { + triggerDelete(index) { + this.$set(this.noteData[index], 'currentDelete', true) + }, + cancelDelete(index){ + this.$set(this.noteData[index], 'currentDelete', false) + }, + confirmDelete(index){ + console.log("删除", this.noteData[index]) + // some ajax + mui.toast("删除") + window.location.reload() + }, + edit(index){ + console.log("编辑", this.noteData[index]) + // some ajax + mui.toast("编辑") + window.location.reload() + }, + create(){ + // some jump + if(this.counter < 10){ + mui.toast("跳转") + this.counter ++ ; + }else{ + mui.toast("开发中") + this.counter = 0; + JZL.openWindow('trade_rule.html', 'trade_rule.html') + } + } + }, + mounted() { + // some ajax + this.noteData = [ + {id: 1, name: '功能正在开发中', created_at: "2019-09-09 18:00:01", updated_at: "2019-09-09 18:09:09"}, + {id: 2, name: '只是一个DEMO页', created_at: "2019-09-09 19:00:01", updated_at: "2019-09-09 20:09:09"}, + ] + } +}) \ No newline at end of file diff --git a/static/app2/js/order_con.js b/static/app2/js/order_con.js old mode 100755 new mode 100644 index a1eb4ab..babe4e3 --- a/static/app2/js/order_con.js +++ b/static/app2/js/order_con.js @@ -1,115 +1,115 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - var data_order_id = localStorage.getItem('data_order_id'); -// //console.log(data_order_id) - mui.ajax(hyhUrl('app/Orders/getDetail'), { - headers: { - "HYH-Token": token - }, - data: { - id: data_order_id - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - var data = toJson(data.data); - var html = '

              ' + data.status + '

              收货人:' + data.userName + '
              ' + data.userPhone + '
              收货地址:' + data.userAddress + '

              发票信息

              发票抬头 ' + data.invoiceClient + '

              ' + data.shopName + '
              '; - $.each(data.goods, function() { - html += '

              ' + this.goodsName + '

              ' + this.goodsSpecNames + '

              ¥' + this.goodsPrice + '

              ¥' + this.marketPrice + 'x' + this.goodsNum + '
              ' - }); - - // html += '
              商品总价
              ¥' + data.goodsMoney + '
              运费(快递)
              ¥' + data.deliverMoney + '
              订单总价
              ¥' + data.totalMoney + '
              实付款
              ¥' + data.realTotalMoney + '
              积分
              奖励积分' + data.orderScore + '

              联系卖家

              订单编号:' + data.orderNo + '

              创建时间:' + data.createTime + '

              '; - html += '
              商品总价
              ¥' + data.goodsMoney + '
              运费(快递)
              ¥' + data.deliverMoney + '
              订单总价
              ¥' + data.totalMoney + '
              产品券
              ¥' + data.productNum + '【税费:' +data.productHandlingFee+',手续费:'+data.productTaxFee+'】
              优惠券
              ¥' + data.couponsNum + '【税费:' +data.couponsHandlingFee+',手续费:'+data.couponsTaxFee+'】
              旺旺券
              ¥' + data.wangNum + '
              现金
              ¥' + data.moneyNum + '
    • 联系卖家

      订单编号:' + data.orderNo + '

      创建时间:' + data.createTime + '

      '; - - if(data.deliveryTime != null) { - html += '

      发货时间:' + data.deliveryTime + '

      ' - } - if(data.deliveryTime != null) { - html += '

      成交时间:' + data.receiveTime + '

      ' - } - - html += '
      '; - - $('.con').html(html); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - $('.con').on('tap', '.row_title', function() { - var shopId = $(this).attr('data-shopId'); - var url = 'storeout.html'; - if(shopId==1){ -// url='self_shop.html' - } - mui.openWindow({ - url: url, - id: url+shopId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - shopId: shopId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - }) - $('.con').on('tap', '.row_block', function() { - var goodsId = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + goodsId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: goodsId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var data_order_id = localStorage.getItem('data_order_id'); +// //console.log(data_order_id) + mui.ajax(hyhUrl('app/Orders/getDetail'), { + headers: { + "HYH-Token": token + }, + data: { + id: data_order_id + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data.data); + var html = '

      ' + data.status + '

      收货人:' + data.userName + '
      ' + data.userPhone + '
      收货地址:' + data.userAddress + '

      发票信息

      发票抬头 ' + data.invoiceClient + '

      ' + data.shopName + '
      '; + $.each(data.goods, function() { + html += '

      ' + this.goodsName + '

      ' + this.goodsSpecNames + '

      ¥' + this.goodsPrice + '

      ¥' + this.marketPrice + 'x' + this.goodsNum + '
      ' + }); + + // html += '
      商品总价
      ¥' + data.goodsMoney + '
      运费(快递)
      ¥' + data.deliverMoney + '
      订单总价
      ¥' + data.totalMoney + '
      实付款
      ¥' + data.realTotalMoney + '
      积分
      奖励积分' + data.orderScore + '

      联系卖家

      订单编号:' + data.orderNo + '

      创建时间:' + data.createTime + '

      '; + html += '
      商品总价
      ¥' + data.goodsMoney + '
      运费(快递)
      ¥' + data.deliverMoney + '
      订单总价
      ¥' + data.totalMoney + '
      产品券
      ¥' + data.productNum + '【税费:'+data.productTaxFee+',手续费:' +data.productHandlingFee+'】
      优惠券
      ¥' + data.couponsNum + '【税费:' +data.couponsHandlingFee+',手续费:'+data.couponsTaxFee+'】
      旺旺券
      ¥' + data.wangNum + '
      现金
      ¥' + data.moneyNum + '

      联系卖家

      订单编号:' + data.orderNo + '

      创建时间:' + data.createTime + '

      '; + + if(data.deliveryTime != null) { + html += '

      发货时间:' + data.deliveryTime + '

      ' + } + if(data.deliveryTime != null) { + html += '

      成交时间:' + data.receiveTime + '

      ' + } + + html += '
      '; + + $('.con').html(html); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('.con').on('tap', '.row_title', function() { + var shopId = $(this).attr('data-shopId'); + var url = 'storeout.html'; + if(shopId==1){ +// url='self_shop.html' + } + mui.openWindow({ + url: url, + id: url+shopId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + shopId: shopId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }) + $('.con').on('tap', '.row_block', function() { + var goodsId = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + goodsId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: goodsId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) }) \ No newline at end of file diff --git a/static/app2/js/order_out.js b/static/app2/js/order_out.js old mode 100755 new mode 100644 index bb40629..29b46f5 --- a/static/app2/js/order_out.js +++ b/static/app2/js/order_out.js @@ -1,53 +1,53 @@ -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - var data_order_id = self.data_order_id; - var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; - var sub = plus.webview.create('order_con.html', 'order_con.html', { - top: bSize, - bottom: '49px', - scrollIndicator: 'none' - }); - self.append(sub); - localStorage.setItem('data_order_id', data_order_id); - if(!data_order_id) { - $('#ckwl').css('display', 'none') - } - mui(".btns").on('tap', '#ckwl', function() { - // var tj = plus.webview.create('search.html'); - // tj.show(); - // mui.alert(e.target.attributes["data-id"].nodeValue); - // //console.log(this.attributes["data-id"].nodeValue); - mui.openWindow({ - url: 'logistics.html', - id: 'logistics.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: data_order_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + var data_order_id = self.data_order_id; + var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var sub = plus.webview.create('order_con.html', 'order_con.html', { + top: bSize, + bottom: '49px', + scrollIndicator: 'none' + }); + self.append(sub); + localStorage.setItem('data_order_id', data_order_id); + if(!data_order_id) { + $('#ckwl').css('display', 'none') + } + mui(".btns").on('tap', '#ckwl', function() { + // var tj = plus.webview.create('search.html'); + // tj.show(); + // mui.alert(e.target.attributes["data-id"].nodeValue); + // //console.log(this.attributes["data-id"].nodeValue); + mui.openWindow({ + url: 'logistics.html', + id: 'logistics.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: data_order_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) }) \ No newline at end of file diff --git a/static/app2/js/paymentVoucher.js b/static/app2/js/paymentVoucher.js old mode 100755 new mode 100644 index 6dfbe2c..cca7443 --- a/static/app2/js/paymentVoucher.js +++ b/static/app2/js/paymentVoucher.js @@ -1,277 +1,277 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - - var comName = "山东省全亮共信息科技有限公司"; - var cardNum = "810102701421013395"; - var cardBank = "日照银行股份有限公司泰安路支行"; - $('.comName ').val(comName) - $('.comNameBtn').attr("data-value", comName) - $('.cardNum ').val(cardNum) - $('.cardNumBtn').attr("data-value", cardNum) - $('.cardBank ').val(cardBank) - $('.cardBankBtn').attr("data-value", cardBank) - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - var type = 0; //0 huozhe 1 - - if ("undefined" != typeof(self.type)) { - type = self.type - } - if (0 == type) { - getuncommitted(); - } else if (1 == type) { - getcommitted(); - } - $('.con_con_com').eq(type).show().siblings().hide(); - $('.con_nav').on("tap", ".nav_header", function() { - type = $(this).index(); - $(this).addClass('active').siblings().removeClass('active'); - $('.con_con_com').eq(type).show().siblings().hide(); - if (0 == type) { - getuncommitted(); - } else if (1 == type) { - getcommitted(); - } - }) - $('.committed').on("tap", ".row_title", function() { - var idx = $(this).index(); - // //console.log(idx); - $('.row_cont').eq(idx).toggle() - }) - $('.committed').on("tap", ".oper", function(e) { - e.preventDefault(); - e.stopPropagation() - id = $(this).parents().parents().attr("data-id") - id = parseInt(id); - //console.log(id); - JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { - orderId: id, - shopId: shopId - }) - }) - // $('.btns').on('tap', '.bc_btn', function() { - // var idx = $(this).index() - // JZL.openWindow("uploadVoucher.html", "uploadVoucher.html") - // }) - // 获取未提交凭证 - getuncommitted(); - - function getuncommitted() { - JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { - shopId: shopId, - type: 0 - }, function(data) { - //console.log(data) - if ("undefined" != typeof data.data) { - - var html = ''; - var youhui = 0; - var payable = 0; - mui.each(data.data, function() { - payable = Math.abs(this.payable); - youhui = Math.abs(youhui) + payable; - - html += '
      ' + this.status + - '
      优惠款' + payable + - '
      ' - - mui.each(this.list, function() { - - html += '

      ' + this.goodsName + '

      ' + - this.goodsSpecNames + '

      ¥' + this.goodsPrice + '

      ' - }); - youhui = youhui.toFixed(2); - html += '
      共' + this.list.length + '件商品 合计¥' + this.realTotalMoney + - '(含运费¥' + this.deliverMoney + ')
      订单完成时间:' + this.receiveTime + - '
      ' - - }) - html += - '
      ' + - data.data.length + '笔订单 优惠款' + youhui + - '
      提交凭证
      ' - } else { - - html = '

      没有更多订单了

      '; - // html = '
      ' - } - $('.uncommitted .con_con_com_').html(html); - }) - } - var i = 0; - //全选或者全不选 - $('body').on('change', '#checkall', function() { - checkAll('.check1', $(this).prop("checked")); - if (false == $(this).prop("checked")) { - $('.orderNo').html("0") - $('.youhuiNo').html("0") - } else { - var youhui = 0; - $('.orderNo').html($('.check1').length) - mui.each($('.indent_youhui span'), function() { - youhui += Number($(this).text()) - }) - $('.youhuiNo').html(youhui) - } - // if (0 == i) { - // $('input[name="check1"]').prop('checked', true); - // i = 1; - // } else { - // / $('input[name="check1"]').prop('checked', false); - // i = 0; - // } - }) - // checkAll('.check1',$('#checkall').checked); - function checkAll(domName, isChecked) { - //console.log(isChecked); - $(domName).prop("checked", isChecked); - } - - function checkNum() { - var length = $('input[name=check1]:checked').length; - var len = $('input[name=check1]').length; - - if (length == len) { - $('#checkall').prop('checked', true); - } else { - $('#checkall').prop('checked', false); - } - var youhui = 0; - $.each($('input[name="check1"]:checked'), function() { - youhui += Number($(this).attr('data-payable')); - - }) - $('.orderNo').html(length); - $('.youhuiNo').html(youhui); - - } - $('body').on('change', '.check1', function() { - checkNum(); - }) - var click = 0 - $('body').on('tap', ".bc_btn", function() { - if (0 == $('input[name="check1"]:checked').length) { - mui.alert("请选择至少一个订单") - return; - } - if (1 == click) { - return; - } - click = 1; - var orderIdsArr = []; - $.each($('input[name="check1"]:checked'), function() { - orderIdsArr.push($(this).parents().parents().parents().attr('data-id')) - }) - orderIds = orderIdsArr.join(',') - - - JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { - shopId: shopId, - orderIds: orderIds - }) - }) - var isjiazai = false; - - function getcommitted(page, PerPage) { - var recommenddata = { - page: page ? page : 1, - PerPage: PerPage ? PerPage : 10 - } - if (isjiazai == true) { - return; - } - isjiazai = true; - - - JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { - shopId: shopId, - type: 1 - }, function(data) { - //console.log(data); - if (1 == data.status) { - var data = data.data; - var html = ''; - var totPayable = 0; - if (data.Rows == '') { - $('.committed ').append( - '

      没有更多订单了

      '); - return; - } - $.each(data.Rows, function() { - totPayable = 0; - if ("已通过" == this.statusStr) { - html += '
      提交时间:' + this.createTime + - '' + this.statusStr + '
      ' - } else { - html += '
      提交时间:' + this.createTime + - '' + this.statusStr + - '
      ' - } - - $.each(this.list, function() { - totPayable += Number(this.payable) - html += '
      订单编号:' + this.orderNo + - '
      优惠金额:' + this.payable + '
      ' - }) - totPayable = totPayable.toFixed(2) - - html += '
      总计优惠款:' + totPayable + '
      ' - }) - if (page == 1) { - $('.committed').html(html); - } else { - $('.committed').append(html); - } - } else { - mui.alert(data.msg) - } - }) - } - - mui('body').on('tap', '.btn', function() { - // 每次触发事件就会使用 innerText 获取纯文本。 - var copy_content = $(this).attr("data-value"); - - // var copy_content = this.innerText; - // 加了一个确认框 让用户选择是否复制 - // mui.confirm('您要复制内容吗?', '小禾CRM', ['取消', '复制内容'], function (e) { - // if (e.index == 1) { - //判断是安卓还是ios - if (mui.os.ios) { - // ios 的方法 这个我没具体研究过 直接拿来用了 - var UIPasteboard = plus.ios.importClass("UIPasteboard"); - var generalPasteboard = UIPasteboard.generalPasteboard(); - //设置 复制的内容也就是 触发事件 innerText 获取的内容 - generalPasteboard.plusCallMethod({ - setValue: copy_content, - forPasteboardType: "public.utf8-plain-text" - }); - generalPasteboard.plusCallMethod({ - valueForPasteboardType: "public.utf8-plain-text" - }); - // 在上边都走完 给用户一个提示 - mui.toast('复制成功') - } else { - //安卓 的方法 这个我没具体研究过 直接拿来用了 - var context = plus.android.importClass("android.content.Context"); - var main = plus.android.runtimeMainActivity(); - var clip = main.getSystemService(context.CLIPBOARD_SERVICE); - plus.android.invoke(clip, "setText", copy_content); - // 在上边都走完 给用户一个提示 - mui.toast('复制成功') - } - // } - }) - - - +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + + var comName = "山东省全亮共信息科技有限公司"; + var cardNum = "810102701421013395"; + var cardBank = "日照银行股份有限公司泰安路支行"; + $('.comName ').val(comName) + $('.comNameBtn').attr("data-value", comName) + $('.cardNum ').val(cardNum) + $('.cardNumBtn').attr("data-value", cardNum) + $('.cardBank ').val(cardBank) + $('.cardBankBtn').attr("data-value", cardBank) + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + var type = 0; //0 huozhe 1 + + if ("undefined" != typeof(self.type)) { + type = self.type + } + if (0 == type) { + getuncommitted(); + } else if (1 == type) { + getcommitted(); + } + $('.con_con_com').eq(type).show().siblings().hide(); + $('.con_nav').on("tap", ".nav_header", function() { + type = $(this).index(); + $(this).addClass('active').siblings().removeClass('active'); + $('.con_con_com').eq(type).show().siblings().hide(); + if (0 == type) { + getuncommitted(); + } else if (1 == type) { + getcommitted(); + } + }) + $('.committed').on("tap", ".row_title", function() { + var idx = $(this).index(); + // //console.log(idx); + $('.row_cont').eq(idx).toggle() + }) + $('.committed').on("tap", ".oper", function(e) { + e.preventDefault(); + e.stopPropagation() + id = $(this).parents().parents().attr("data-id") + id = parseInt(id); + //console.log(id); + JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { + orderId: id, + shopId: shopId + }) + }) + // $('.btns').on('tap', '.bc_btn', function() { + // var idx = $(this).index() + // JZL.openWindow("uploadVoucher.html", "uploadVoucher.html") + // }) + // 获取未提交凭证 + getuncommitted(); + + function getuncommitted() { + JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { + shopId: shopId, + type: 0 + }, function(data) { + //console.log(data) + if ("undefined" != typeof data.data) { + + var html = ''; + var youhui = 0; + var payable = 0; + mui.each(data.data, function() { + payable = Math.abs(this.payable); + youhui = Math.abs(youhui) + payable; + + html += '
      ' + this.status + + '
      优惠款' + payable + + '
      ' + + mui.each(this.list, function() { + + html += '

      ' + this.goodsName + '

      ' + + this.goodsSpecNames + '

      ¥' + this.goodsPrice + '

      ' + }); + youhui = youhui.toFixed(2); + html += '
      共' + this.list.length + '件商品 合计¥' + this.realTotalMoney + + '(含运费¥' + this.deliverMoney + ')
      订单完成时间:' + this.receiveTime + + '
      ' + + }) + html += + '
      ' + + data.data.length + '笔订单 优惠款' + youhui + + '
      提交凭证
      ' + } else { + + html = '

      没有更多订单了

      '; + // html = '
      ' + } + $('.uncommitted .con_con_com_').html(html); + }) + } + var i = 0; + //全选或者全不选 + $('body').on('change', '#checkall', function() { + checkAll('.check1', $(this).prop("checked")); + if (false == $(this).prop("checked")) { + $('.orderNo').html("0") + $('.youhuiNo').html("0") + } else { + var youhui = 0; + $('.orderNo').html($('.check1').length) + mui.each($('.indent_youhui span'), function() { + youhui += Number($(this).text()) + }) + $('.youhuiNo').html(youhui) + } + // if (0 == i) { + // $('input[name="check1"]').prop('checked', true); + // i = 1; + // } else { + // / $('input[name="check1"]').prop('checked', false); + // i = 0; + // } + }) + // checkAll('.check1',$('#checkall').checked); + function checkAll(domName, isChecked) { + //console.log(isChecked); + $(domName).prop("checked", isChecked); + } + + function checkNum() { + var length = $('input[name=check1]:checked').length; + var len = $('input[name=check1]').length; + + if (length == len) { + $('#checkall').prop('checked', true); + } else { + $('#checkall').prop('checked', false); + } + var youhui = 0; + $.each($('input[name="check1"]:checked'), function() { + youhui += Number($(this).attr('data-payable')); + + }) + $('.orderNo').html(length); + $('.youhuiNo').html(youhui); + + } + $('body').on('change', '.check1', function() { + checkNum(); + }) + var click = 0 + $('body').on('tap', ".bc_btn", function() { + if (0 == $('input[name="check1"]:checked').length) { + mui.alert("请选择至少一个订单") + return; + } + if (1 == click) { + return; + } + click = 1; + var orderIdsArr = []; + $.each($('input[name="check1"]:checked'), function() { + orderIdsArr.push($(this).parents().parents().parents().attr('data-id')) + }) + orderIds = orderIdsArr.join(',') + + + JZL.openWindow("shoperUploadVoucher.html", "shoperUploadVoucher.html", { + shopId: shopId, + orderIds: orderIds + }) + }) + var isjiazai = false; + + function getcommitted(page, PerPage) { + var recommenddata = { + page: page ? page : 1, + PerPage: PerPage ? PerPage : 10 + } + if (isjiazai == true) { + return; + } + isjiazai = true; + + + JZL.ajax(qlgUrl('app/Shoporders/getCertificate'), { + shopId: shopId, + type: 1 + }, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + var html = ''; + var totPayable = 0; + if (data.Rows == '') { + $('.committed ').append( + '

      没有更多订单了

      '); + return; + } + $.each(data.Rows, function() { + totPayable = 0; + if ("已通过" == this.statusStr) { + html += '
      提交时间:' + this.createTime + + '' + this.statusStr + '
      ' + } else { + html += '
      提交时间:' + this.createTime + + '' + this.statusStr + + '
      ' + } + + $.each(this.list, function() { + totPayable += Number(this.payable) + html += '
      订单编号:' + this.orderNo + + '
      优惠金额:' + this.payable + '
      ' + }) + totPayable = totPayable.toFixed(2) + + html += '
      总计优惠款:' + totPayable + '
      ' + }) + if (page == 1) { + $('.committed').html(html); + } else { + $('.committed').append(html); + } + } else { + mui.alert(data.msg) + } + }) + } + + mui('body').on('tap', '.btn', function() { + // 每次触发事件就会使用 innerText 获取纯文本。 + var copy_content = $(this).attr("data-value"); + + // var copy_content = this.innerText; + // 加了一个确认框 让用户选择是否复制 + // mui.confirm('您要复制内容吗?', '小禾CRM', ['取消', '复制内容'], function (e) { + // if (e.index == 1) { + //判断是安卓还是ios + if (mui.os.ios) { + // ios 的方法 这个我没具体研究过 直接拿来用了 + var UIPasteboard = plus.ios.importClass("UIPasteboard"); + var generalPasteboard = UIPasteboard.generalPasteboard(); + //设置 复制的内容也就是 触发事件 innerText 获取的内容 + generalPasteboard.plusCallMethod({ + setValue: copy_content, + forPasteboardType: "public.utf8-plain-text" + }); + generalPasteboard.plusCallMethod({ + valueForPasteboardType: "public.utf8-plain-text" + }); + // 在上边都走完 给用户一个提示 + mui.toast('复制成功') + } else { + //安卓 的方法 这个我没具体研究过 直接拿来用了 + var context = plus.android.importClass("android.content.Context"); + var main = plus.android.runtimeMainActivity(); + var clip = main.getSystemService(context.CLIPBOARD_SERVICE); + plus.android.invoke(clip, "setText", copy_content); + // 在上边都走完 给用户一个提示 + mui.toast('复制成功') + } + // } + }) + + + }) diff --git a/static/app2/js/perfect-scrollbar.min.js b/static/app2/js/perfect-scrollbar.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/photoswipe-ui-default.min.js b/static/app2/js/photoswipe-ui-default.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/photoswipe.js b/static/app2/js/photoswipe.js old mode 100755 new mode 100644 diff --git a/static/app2/js/pj.js b/static/app2/js/pj.js old mode 100755 new mode 100644 index 22ae733..1d41ede --- a/static/app2/js/pj.js +++ b/static/app2/js/pj.js @@ -1,236 +1,236 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - var self = plus.webview.currentWebview(); - var data_order_id = self.data_order_id; - mui.ajax(qlgUrl('app/Orders/getOrderAppraise'), { - headers: { - "HYH-Token": token - }, - data: { - oId: data_order_id - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - data = data.data - var html = ''; - var i = 0; - $.each(data.Rows, function() { - if (this.appraise == null) { - html += '

      ' + - this.goodsName + - '

      商品评分

      服务评分

      时效评分

      你的浏览器不支持flash,Silverlight或者HTML5!
      ' - i++; - } else { - html += '

      ' + - this.goodsName + '

      商品评分

      服务评分

      时效评分

      ' + - this.appraise.content + '

      ' - - $.each(this.appraise.images, function() { - html += '' - }); - - - - html += '
      '; - } - }); - $('.con').html(html) - $('.star').each(function() { - if ($(this).attr('data-isPj') == 1) { - var num = +$(this).parent().attr('data-' + $(this).parent().attr('data-class')) - 1 - $(this).children().eq(num).children().addClass('star_on').removeClass('star_off') - $(this).children().eq(num).prevAll().children().addClass('star_on').removeClass('star_off') - $(this).children().eq(num).nextAll().children().addClass('star_off').removeClass('star_on') - } - }) - var btnArr = []; - - $('.selectfiles').each(function(num) { - btnArr.push($(this).attr('id')); - }) - - $.each(btnArr, function(i, n) { - var self = this.toString(); - var that = document.getElementById(this); - var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: self, - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - dir: 'appraises', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - }, - { - title: "Zip files", - extensions: "zip,rar" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementsByClassName('ossfile')[i].innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false, 'appraises'); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if (info.status == 200) { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - }, - - Error: function(up, err) { - if (err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if (err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if (err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } - }); - - uploader.init(); - }); - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - $('.con').on('tap', '.star_a', function() { - if ($(this).parent().attr('data-isPj') == 1) { - return; - } - $(this).children().addClass('star_on').removeClass('star_off'); - $(this).prevAll().children().addClass('star_on').removeClass('star_off'); - $(this).nextAll().children().addClass('star_off').removeClass('star_on'); - $(this).parent().parent().attr('data-' + $(this).parent().parent().attr('data-class'), $(this).index() + 1); - }) - - $('.con').on('tap', '.tijiao', function() { - var goodsId = $(this).parent().attr('data-goodsId'); - var goodsSpecId = $(this).parent().attr('data-goodsSpecId'); - var orderId = $(this).parent().attr('data-orderId'); - var orderGoodsId = $(this).parent().attr('data-orderGoodsId'); - var timeScore = $(this).siblings('.row[data-class*=timeScore]').attr('data-timeScore'); - var goodsScore = $(this).siblings('.row[data-class*=goodsScore]').attr('data-goodsScore'); - var serviceScore = $(this).siblings('.row[data-class*=serviceScore]').attr('data-serviceScore'); - var content = $(this).siblings('.purchase').children('textarea').val(); - var that = $(this); - var imagesArr = []; - $(this).siblings('.purchase').children('.up_out').children('.ossfile').children('.files_out').children('b').children( - 'img').each(function() { - imagesArr.push($(this).attr('data-src')) - }) - var images = imagesArr.join(','); - if (timeScore == 0 || serviceScore == 0 || serviceScore == 0) { - mui.alert('评分必须1-5分之间!'); - return; - } - if (content.length < 3) { - mui.alert('评论最少3个字!'); - return; - } - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/Goodsappraises/add'), { - headers: { - "HYH-Token": token - }, - data: { - goodsId: goodsId, - goodsSpecId: goodsSpecId, - orderId: orderId, - orderGoodsId: orderGoodsId, - timeScore: timeScore, - goodsScore: goodsScore, - serviceScore: serviceScore, - content: content, - images: images - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - mui.alert(data.msg) - if (data.status == 1) { - location.reload(); - } else { - mui.alert(data.msg) - } - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var self = plus.webview.currentWebview(); + var data_order_id = self.data_order_id; + mui.ajax(qlgUrl('app/Orders/getOrderAppraise'), { + headers: { + "HYH-Token": token + }, + data: { + oId: data_order_id + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + data = data.data + var html = ''; + var i = 0; + $.each(data.Rows, function() { + if (this.appraise == null) { + html += '

      ' + + this.goodsName + + '

      商品评分

      服务评分

      时效评分

      你的浏览器不支持flash,Silverlight或者HTML5!
      ' + i++; + } else { + html += '

      ' + + this.goodsName + '

      商品评分

      服务评分

      时效评分

      ' + + this.appraise.content + '

      ' + + $.each(this.appraise.images, function() { + html += '' + }); + + + + html += '
      '; + } + }); + $('.con').html(html) + $('.star').each(function() { + if ($(this).attr('data-isPj') == 1) { + var num = +$(this).parent().attr('data-' + $(this).parent().attr('data-class')) - 1 + $(this).children().eq(num).children().addClass('star_on').removeClass('star_off') + $(this).children().eq(num).prevAll().children().addClass('star_on').removeClass('star_off') + $(this).children().eq(num).nextAll().children().addClass('star_off').removeClass('star_on') + } + }) + var btnArr = []; + + $('.selectfiles').each(function(num) { + btnArr.push($(this).attr('id')); + }) + + $.each(btnArr, function(i, n) { + var self = this.toString(); + var that = document.getElementById(this); + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: self, + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + dir: 'appraises', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + }, + { + title: "Zip files", + extensions: "zip,rar" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementsByClassName('ossfile')[i].innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false, 'appraises'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if (info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if (err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if (err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if (err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); + }); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('.con').on('tap', '.star_a', function() { + if ($(this).parent().attr('data-isPj') == 1) { + return; + } + $(this).children().addClass('star_on').removeClass('star_off'); + $(this).prevAll().children().addClass('star_on').removeClass('star_off'); + $(this).nextAll().children().addClass('star_off').removeClass('star_on'); + $(this).parent().parent().attr('data-' + $(this).parent().parent().attr('data-class'), $(this).index() + 1); + }) + + $('.con').on('tap', '.tijiao', function() { + var goodsId = $(this).parent().attr('data-goodsId'); + var goodsSpecId = $(this).parent().attr('data-goodsSpecId'); + var orderId = $(this).parent().attr('data-orderId'); + var orderGoodsId = $(this).parent().attr('data-orderGoodsId'); + var timeScore = $(this).siblings('.row[data-class*=timeScore]').attr('data-timeScore'); + var goodsScore = $(this).siblings('.row[data-class*=goodsScore]').attr('data-goodsScore'); + var serviceScore = $(this).siblings('.row[data-class*=serviceScore]').attr('data-serviceScore'); + var content = $(this).siblings('.purchase').children('textarea').val(); + var that = $(this); + var imagesArr = []; + $(this).siblings('.purchase').children('.up_out').children('.ossfile').children('.files_out').children('b').children( + 'img').each(function() { + imagesArr.push($(this).attr('data-src')) + }) + var images = imagesArr.join(','); + if (timeScore == 0 || serviceScore == 0 || serviceScore == 0) { + mui.alert('评分必须1-5分之间!'); + return; + } + if (content.length < 3) { + mui.alert('评论最少3个字!'); + return; + } + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/Goodsappraises/add'), { + headers: { + "HYH-Token": token + }, + data: { + goodsId: goodsId, + goodsSpecId: goodsSpecId, + orderId: orderId, + orderGoodsId: orderGoodsId, + timeScore: timeScore, + goodsScore: goodsScore, + serviceScore: serviceScore, + content: content, + images: images + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + mui.alert(data.msg) + if (data.status == 1) { + location.reload(); + } else { + mui.alert(data.msg) + } + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) }) diff --git a/static/app2/js/plupload.full.min.js b/static/app2/js/plupload.full.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/properties.js b/static/app2/js/properties.js old mode 100755 new mode 100644 index 3ebfedf..aff89c7 --- a/static/app2/js/properties.js +++ b/static/app2/js/properties.js @@ -1,106 +1,106 @@ -mui.plusReady(function() { - - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - //console.log(shopId); - var page = 1; - var pageSize = 10; - var isloading = false; - getRecommend(page, pageSize); - - function getRecommend(page, pageSize) { - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 10 - } - recommenddata.shopId = shopId - if (isloading == true) { - return; - } else { - isloading = false; - } - isloading == true - JZL.ajax(qlgUrl("app/shops/getSpecs"), recommenddata, function(data) { - //console.log(data); - if (data.status == 1) { - var html = ''; - var data = data.data; - if ('' == data.Rows) { - //console.log("去" ); - $('.con').append( - '

      没有更多数据

      '); - return; - } - $.each(data.Rows, function() { - html += '
      ' - - if (page == 1) { - $('.con_con').html(html); - } else { - $('.con_con').append(html); - } - - }) - } else { - mui.alert(data.msg) - } - isloading == false; - }) - - } - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isloading == true) { - page++; - getRecommend(page, pageSize); - } - } - }) - var specCatsId = ""; - mui('.con').on('tap', '.bj', function() { - - // //console.log(1); - specCatsId = $(this).parent().parent().attr("data-id"); - //console.log(specCatsId); - var setName = $(this).parent().parent().find("label").text(); - //console.log(setName); - - JZL.openWindow("addproperties.html", parseInt(shopId), { - "specCatsId": specCatsId, - "setName": setName - }) - }) - //删除 - $('.con').on('tap', '.del', function() { - specCatsId = $(this).parent().parent().attr("data-id"); - - if (confirm('确认删除?')) { - JZL.ajax(qlgUrl('app/shops/delSpecSet'), { - id: specCatsId, - shopId: shopId - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data, 1); - //console.log(1); - //console.log(data); - if (data.status == 1) { - - location.reload() - } else { - mui.alert(data.msg) - } - }) - - } - }) - - $('.add1').on('tap', function() { - JZL.openWindow('addproperties.html',parseInt(shopId)); - }) - +mui.plusReady(function() { + + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + //console.log(shopId); + var page = 1; + var pageSize = 10; + var isloading = false; + getRecommend(page, pageSize); + + function getRecommend(page, pageSize) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 10 + } + recommenddata.shopId = shopId + if (isloading == true) { + return; + } else { + isloading = false; + } + isloading == true + JZL.ajax(qlgUrl("app/shops/getSpecs"), recommenddata, function(data) { + //console.log(data); + if (data.status == 1) { + var html = ''; + var data = data.data; + if ('' == data.Rows) { + //console.log("去" ); + $('.con').append( + '

      没有更多数据

      '); + return; + } + $.each(data.Rows, function() { + html += '
      ' + + if (page == 1) { + $('.con_con').html(html); + } else { + $('.con_con').append(html); + } + + }) + } else { + mui.alert(data.msg) + } + isloading == false; + }) + + } + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isloading == true) { + page++; + getRecommend(page, pageSize); + } + } + }) + var specCatsId = ""; + mui('.con').on('tap', '.bj', function() { + + // //console.log(1); + specCatsId = $(this).parent().parent().attr("data-id"); + //console.log(specCatsId); + var setName = $(this).parent().parent().find("label").text(); + //console.log(setName); + + JZL.openWindow("addproperties.html", parseInt(shopId), { + "specCatsId": specCatsId, + "setName": setName + }) + }) + //删除 + $('.con').on('tap', '.del', function() { + specCatsId = $(this).parent().parent().attr("data-id"); + + if (confirm('确认删除?')) { + JZL.ajax(qlgUrl('app/shops/delSpecSet'), { + id: specCatsId, + shopId: shopId + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + //console.log(1); + //console.log(data); + if (data.status == 1) { + + location.reload() + } else { + mui.alert(data.msg) + } + }) + + } + }) + + $('.add1').on('tap', function() { + JZL.openWindow('addproperties.html',parseInt(shopId)); + }) + }) diff --git a/static/app2/js/qrbb.js b/static/app2/js/qrbb.js old mode 100755 new mode 100644 index a670935..3d7c050 --- a/static/app2/js/qrbb.js +++ b/static/app2/js/qrbb.js @@ -1,111 +1,111 @@ -mui.plusReady(function() { - - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var page = 1; - var pageSize = 10; - // var isloading = false; - getRecommend(); - - function getRecommend() { - - // //console.log(recommenddata); - //获取亲人报备列表 - JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportSelect'), {}, function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - if (data.status == 1) { - var html = ''; - var data = data.data; - if (data == '') { - $('.con').append('

      没有更多数据

      '); - return; - } - $.each(data, function() { - html += '

      ' + this.familyName + '(' + this.familyRelations + - ')

      '; - }) - $('.con').html(html); - } else { - mui.alert(data.msg) - } - }); - - - } - // document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - // if (scroll.y == scroll.maxScrollY) { - // if (isloading == true) { - // page++; - // getRecommend(page, pageSize); - // } - // } - // }) - - var qrbbid; - mui('.con').on('tap', '.bj', function() { - qrbbid = $(this).attr('data-id') - - JZL.openWindow('addqrbb.html', qrbbid); - - }) - $('.con').on('tap', '.del', function() { - qrbbid = $(this).attr('data-id') - if (confirm('确认删除?')) { - var lxy_div = - '

      请输入操作密码

      '; - - $('body').append(lxy_div); - - $('.lxy_zz').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - }) - mui('.lxy_zz_btn').on('tap', '.cancle', function() { - // $('#home_zhezhao').css('display', 'none'); - $('#home_zhezhao').remove(); - return; - - }) - - mui('.lxy_zz_btn').on('tap', '.sure', function() { - var payPwd = $('.payword').val(); - //console.log(payPwd); - if (payPwd == '') { - mui.alert("请输入密码") - } - JZL.ajax(qlgUrl('app/auth/delAuthFamily'), { - isReport: 1, - id: qrbbid, - payPwd: payPwd - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - var data = toJson(data, 1); - if (data.status == 1) { - $('#home_zhezhao').remove(); - location.reload() - } else { - mui.alert(data.msg) - } - }) - - }); - } - - }) - /* mui('.mui-content').on('tap','.qrrz',function(){ - JZL.openWindow('qrrz.html', 'qrrz.html'); - - }) */ - $('.add1').on('tap', function() { - JZL.openWindow('addqrbb.html', 'addqrbb.html'); - }) - - - - +mui.plusReady(function() { + + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var page = 1; + var pageSize = 10; + // var isloading = false; + getRecommend(); + + function getRecommend() { + + // //console.log(recommenddata); + //获取亲人报备列表 + JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportSelect'), {}, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + if (data.status == 1) { + var html = ''; + var data = data.data; + if (data == '') { + $('.con').append('

      没有更多数据

      '); + return; + } + $.each(data, function() { + html += '

      ' + this.familyName + '(' + this.familyRelations + + ')

      '; + }) + $('.con').html(html); + } else { + mui.alert(data.msg) + } + }); + + + } + // document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // if (scroll.y == scroll.maxScrollY) { + // if (isloading == true) { + // page++; + // getRecommend(page, pageSize); + // } + // } + // }) + + var qrbbid; + mui('.con').on('tap', '.bj', function() { + qrbbid = $(this).attr('data-id') + + JZL.openWindow('addqrbb.html', qrbbid); + + }) + $('.con').on('tap', '.del', function() { + qrbbid = $(this).attr('data-id') + if (confirm('确认删除?')) { + var lxy_div = + '

      请输入操作密码

      '; + + $('body').append(lxy_div); + + $('.lxy_zz').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + mui('.lxy_zz_btn').on('tap', '.cancle', function() { + // $('#home_zhezhao').css('display', 'none'); + $('#home_zhezhao').remove(); + return; + + }) + + mui('.lxy_zz_btn').on('tap', '.sure', function() { + var payPwd = $('.payword').val(); + //console.log(payPwd); + if (payPwd == '') { + mui.alert("请输入密码") + } + JZL.ajax(qlgUrl('app/auth/delAuthFamily'), { + isReport: 1, + id: qrbbid, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data, 1); + if (data.status == 1) { + $('#home_zhezhao').remove(); + location.reload() + } else { + mui.alert(data.msg) + } + }) + + }); + } + + }) + /* mui('.mui-content').on('tap','.qrrz',function(){ + JZL.openWindow('qrrz.html', 'qrrz.html'); + + }) */ + $('.add1').on('tap', function() { + JZL.openWindow('addqrbb.html', 'addqrbb.html'); + }) + + + + }) diff --git a/static/app2/js/qrcode.js b/static/app2/js/qrcode.js old mode 100755 new mode 100644 diff --git a/static/app2/js/qrrz.js b/static/app2/js/qrrz.js old mode 100755 new mode 100644 index a2ecb39..84e3a0f --- a/static/app2/js/qrrz.js +++ b/static/app2/js/qrrz.js @@ -1,114 +1,114 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - //获取亲人认证列表 - var page = 1; - var pageSize = 10; - var isjiazai = 1; - getRecommend(page, pageSize); - - function getRecommend(page, pageSize) { - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalSelect'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - if (data.status == 1) { - var html = ''; - var data = data.data; - if ('' == data.Rows) { - $('.mui-scroll').append( - '

      没有更多数据

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - html += '

      ' + this.familyName + - '(' + this.familyRelations + - ')

      '; - // //console.log(this.id); - - - }) - if (page == 1) { - $('.con').html(html); - } else { - $('.con').append(html); - } - } else { - - } - isjiazai = 1; - }) - } - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pageSize); - } - } - }) - var qrrzid; - // 编辑 - mui('.con').on('tap', '.bj', function() { - - qrrzid = $(this).attr('data-id'); - //console.log(qrrzid); - JZL.openWindow('addqrrz.html', qrrzid); - }) - // 删除 - $('.con').on('tap', '.del', function() { - qrrzid = $(this).attr('data-id'); - if (confirm('确认删除?')) { - var lxy_div = - '

      请输入操作密码

      '; - $('body').append(lxy_div); - $('.lxy_zz').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - }) - mui('.lxy_zz_btn').on('tap', '.cancle', function() { - $('#home_zhezhao').remove(); - return; - }) - - mui('.lxy_zz_btn').on('tap', '.sure', function() { - var payPwd = $('.payword').val(); - if (payPwd == '') { - mui.alert("请输入密码") - } - JZL.ajax(qlgUrl('app/auth/delAuthFamily'), { - id: qrrzid, - payPwd: payPwd - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data, 1); - - if (data.status == 1) { - $('#home_zhezhao').remove(); - location.reload() - } - }) - - }) - } - }) - $('.add1').on('tap', function() { - JZL.openWindow('addqrrz.html', 'addqrrz.html'); - - }) - - - - -}) +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + //获取亲人认证列表 + var page = 1; + var pageSize = 10; + var isjiazai = 1; + getRecommend(page, pageSize); + + function getRecommend(page, pageSize) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalSelect'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + if (data.status == 1) { + var html = ''; + var data = data.data; + if ('' == data.Rows) { + $('.mui-scroll').append( + '

      没有更多数据

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + html += '

      ' + this.familyName + + '(' + this.familyRelations + + ')

      '; + // //console.log(this.id); + + + }) + if (page == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + } else { + + } + isjiazai = 1; + }) + } + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } + }) + var qrrzid; + // 编辑 + mui('.con').on('tap', '.bj', function() { + + qrrzid = $(this).attr('data-id'); + //console.log(qrrzid); + JZL.openWindow('addqrrz.html', qrrzid); + }) + // 删除 + $('.con').on('tap', '.del', function() { + qrrzid = $(this).attr('data-id'); + if (confirm('确认删除?')) { + var lxy_div = + '

      请输入操作密码

      '; + $('body').append(lxy_div); + $('.lxy_zz').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + mui('.lxy_zz_btn').on('tap', '.cancle', function() { + $('#home_zhezhao').remove(); + return; + }) + + mui('.lxy_zz_btn').on('tap', '.sure', function() { + var payPwd = $('.payword').val(); + if (payPwd == '') { + mui.alert("请输入密码") + } + JZL.ajax(qlgUrl('app/auth/delAuthFamily'), { + id: qrrzid, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + + if (data.status == 1) { + $('#home_zhezhao').remove(); + location.reload() + } + }) + + }) + } + }) + $('.add1').on('tap', function() { + JZL.openWindow('addqrrz.html', 'addqrrz.html'); + + }) + + + + +}) diff --git a/static/app2/js/recommend.js b/static/app2/js/recommend.js old mode 100755 new mode 100644 index 6df2458..2a0cf82 --- a/static/app2/js/recommend.js +++ b/static/app2/js/recommend.js @@ -1,45 +1,46 @@ -mui.plusReady(function() { - - //跳转到商品详情 - mui("body").on('tap', '.recommend_con_block', function() { - // var tj = plus.webview.create('search.html'); - // tj.show(); - // mui.alert(e.target.attributes["data-id"].nodeValue); - var data_id = this.attributes["data-goodsId"].nodeValue; - var goodsType =$(this).attr('data-goodsType') - // //console.log(this.attributes["data-id"].nodeValue); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + data_id, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: data_id, - goodsType : goodsType?goodsType :"" - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - +mui.plusReady(function() { + + //跳转到商品详情 + mui("body").on('tap', '.recommend_con_block', function() { + // var tj = plus.webview.create('search.html'); + // tj.show(); + // mui.alert(e.target.attributes["data-id"].nodeValue); + var data_id = this.attributes["data-goodsId"].nodeValue; + var goodsType =$(this).attr('data-goodsType'); + // //console.log(this.attributes["data-id"].nodeValue); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + data_id, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: data_id, + goodsType : goodsType?goodsType :"", + from_id: from_id?from_id:0 + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + }) \ No newline at end of file diff --git a/static/app2/js/reg.js b/static/app2/js/reg.js old mode 100755 new mode 100644 index aebde9f..e89896d --- a/static/app2/js/reg.js +++ b/static/app2/js/reg.js @@ -1,499 +1,499 @@ -// mui.init({ -// beforeback: function() { //获得父页面的webview -// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 -// mui.fire(list, 'refresh'); -// //返回true,继续页面关闭逻辑 -// return true; -// } -// }); - -mui.plusReady(function() { - - var wait = 120; - - // 判断用户名是否存在 - $('#loginName').on('blur', function() { - var loginName = $('#loginName').val(); - JZL.ajax('http://t.ect99.com/app/users/check_login_name', { - loginName: loginName - }, function(data) { - // console.log(data); - if (1 != data.status) { - mui.alert(data.msg) - } - }) - }) - - function GetQueryString(name) { - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); - console.log(reg); - var r = window.location.search.substr(1).match(reg); - if (r != null) - return unescape(r[2]); - return null; - } - - var pName = GetQueryString('pName') ? GetQueryString('pName') : localStorage.getItem('pName'); - -// if (!pName) { -// pName = localStorage.getItem('pName'); -// var indexNum = pName.indexOf('&'); -// if (indexNum > 0) { -// pName = pName.slice(0, indexNum); -// } -// } -// - if (pName) { - console.log(pName); -// $('#pName').val(pname);; -// $('#pName').attr('disabled', 'disabled'); - } - // 推荐人信息 - //var PName = ""; - $('#pName').on('blur', function() { - pName = $('#pName').val(); - if ('' != pName) { - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(pName))) { - mui.alert("手机号码有误,请重填!"); - return; - } - $('.pNameCode').show(); - - mui('.row').on('tap', '#mobileCode1', function() { - $(this).attr("disabled", true); - JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { - userPhone: pName - }, function(data) { - if (1 == data.status) { - time() - } else { - mui.alert(data.msg); - } - $('#mobileCode1').removeAttr('disabled'); - - }) - }) - - - - } else { - $('.pNameCode').hide(); - } - - }) - // JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) { - // // console.log(data); - // - // if (1 != data.status) { - // mui.alert(data.msg) - // } - // }) - function time() { - if (wait == 0) { - $('#mobileCode').removeAttr("disabled"); - $('#mobileCode').val("重新发送"); - wait = 120; - } else { - $('#mobileCode').attr("disabled", true); - $('#mobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - //获取验证码 - mui('.row').on('tap', '#mobileCode', function() { - var loginName = $('#loginName').val(); - if (loginName == '') { - mui.alert('手机号不能为空!'); - return; - } - // if (!( - // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - // .test(loginName))) { - // mui.alert("手机号码有误,请重填!"); - // return; - // } - $(this).attr("disabled", true); - mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { - - data: { - userPhone: loginName - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - console.log(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - time(); - } else { - mui.alert(data.msg); - } - $('#mobileCode').removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - mui.alert(type) - // mui.alert(type); - } - }); - }) - //注册协议 - mui.ajax('http://t.ect99.com/app/Tags/articleDetail', { - data: { - articleId: 114 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { - console.log(data); - // if(data.status==1){ - // console.log(1); - var html1 = '' - html1 = '

      ' + data.articleContent + '

      ' - $('.zcxycontent').append(html1) - // } - }, - error: function(xhr, type, errorThrown) { - - } - }); - //上传图片 - - var files = []; //存储文件信息的数组 - var fname = ""; //表示文件名,例如 XXXX.jpg; - var expire = 0; - var pathName = ''; - var inpId = ''; - var keyname = ''; - var imgId = ''; - var isZip = 1; - var qualityNum = 90; - var response = ';' - var UP = UP || {}; - UP.isBatch = 0; - UP.init = function(inputId, path, imageId, isBatch, isZipImg, quality) { - inpId = inputId; - pathName = path; - imgId = imageId; - if (typeof(isBatch) != 'undefined') { - UP.isBatch = isBatch; - } - if (typeof(isZipImg) != 'undefined') { - // console.log(typeof(isZipImg)); - isZip = isZipImg; - } - if (typeof(quality) != 'undefined') { - qualityNum = quality; - } - - } - - function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - // console.log(dir) - serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; - // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; - - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText; - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - - } - - function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if (expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - response = obj; - // console.log(obj); - } - return response; - }; - // 上传文件 - function upload(callback) { - // console.log(files); - if (files.length <= 0) { - mui.toast('没有添加上传文件'); - return; - } - var obj = get_signature(); - if (obj) { - server = obj['host']; - policyBase64 = obj['policy']; - accessid = obj['accessid']; - signature = obj['signature']; - expire = parseInt(obj['expire']); - callbackbody = obj['callback']; - path = obj['dir']; - - } else { - mui.toast('初始化失败'); - return; - } - - var wt = plus.nativeUI.showWaiting(); - var task = plus.uploader.createUpload(server, { - method: "POST" - }, function(t, status) { - //上传完成 - if (status == 200) { - wt.close(); - if (1 == UP.isBatch) { - callback(t, status, keyname, server + '/' + keyname); - } else { - document.getElementById(inpId).value = keyname; - var ele = document.getElementById(imgId); - ele.src = server + '/' + keyname; - ele.setAttribute('data-src', keyname); - mui.toast('上传成功'); - //至此上传成功,上传后的图片完整地址为server+testName - //keyname - } - - } else { - wt.close(); - mui.toast('上传失败:' + status); - } - }); - var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg - keyname = path + new Date().getTime() + suffix1; - task.addData("key", keyname); - task.addData("policy", policyBase64); - task.addData("OSSAccessKeyId", accessid); - task.addData("success_action_status", "200"); - // task.addData("callback", callbackbody); - task.addData("signature", signature); - var f = files[files.length - 1]; - // console.log(f) - - task.addFile(f.path, { - key: "file", - name: "file", - mime: "image/jpeg" - }); - //files.length = 0; - task.start(); - - } - - //得到文件名的后缀 - function get_suffix(filename) { - var pos = filename.lastIndexOf('.'); - var suffix = ''; - if (pos != -1) { - suffix = filename.substring(pos) - } - return suffix; - } - // 拍照添加文件 - function appendByCamera(callback) { - plus.camera.getCamera().captureImage(function(p) { - uploadImg(p, callback); - }); - } - // 从相册添加文件 - function appendByGallery(callback) { - plus.gallery.pick(function(p) { - uploadImg(p, callback); - }); - } - - // 添加文件 - var index = 1; - - function uploadImg(p, callback) { - if (1 == isZip) { - compressImg(p, callback); - } else { - appendFile(p, callback) - } - } - - function appendFile(p, callback) { - // var fe = document.getElementById(fileId); - var n = p.substr(p.lastIndexOf('/') + 1); - // fname = n/////////; - files.push({ - name: "uploadkey" + index, - path: p - }); - //console.log(3); - // index++; - upload(callback); - } - - function compressImg(src, callback) { - var filename = src.substring(src.lastIndexOf('/') + 1); - var opions = { - src: src, - dst: '_doc/tmp/' + filename, - overwrite: true, - //width: '300px', //这里指定了宽度,同样可以修改 - format: 'jpg', - quality: qualityNum //图片质量不再修改,以免失真 - }; - var successCB = function(evt) { - // console.log(JSON.stringify(evt)); - fname = filename; - // files[0]={ - // name: "uploadkey", - // path: evt.target - // }; - files.push({ - name: "uploadkey" + index, - path: evt.target - }); - // index++; - //上传 - upload(callback); - //_this.avatar(evt.target); - }; - var errorCB = function(err) { - appendFile(src, callback); - - //console.log(JSON.stringify(err)); - //mui.toast("图片压缩失败");i m - }; - plus.zip.compressImage(opions, successCB, errorCB); - }; - - function openCamera(callback) { - plus.nativeUI.actionSheet({ - cancel: "取消", - buttons: [{ - title: "拍照" - }, - { - title: "从相册中选择" - } - ] - }, function(e) { //1 是拍照 2 从相册中选择 - switch (e.index) { - case 1: - appendByCamera(callback); - break; - case 2: - appendByGallery(callback); - break; - } - }); - } - $(".photos").on("tap", '.regConfirm', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("regConfirmImg", "test", "regConfirmImg") - openCamera() - }) - - - mui('.down').on('tap', '.btn', function() { - var loginName = $('#loginName').val(); - var mobileCode = $('.yzm').val(); - var loginPwd = $('#loginPwd').val(); - var reUserPwd = $('#reUserPwd').val(); - var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : ""; //推荐人验证码 - - - pName = $('#pName').val(); - - // var verifyCode = $('.tpyzm').val(); - var regConfirmImg = $('#regConfirmImg').val(); - if (loginName == '') { - mui.alert('手机号不能为空!'); - return; - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(loginName))) { - mui.alert("手机号码有误,请重填!"); - return; - } - if (mobileCode == '') { - mui.alert('验证码不能为空!'); - return; - } - if (loginPwd == '') { - mui.alert('密码不能为空!'); - return; - } - if (reUserPwd == '') { - mui.alert('确认密码不能为空!'); - return; - } - if (loginPwd.length < 6) { - mui.alert('密码不能小于6位!'); - return; - } - if (!(loginPwd == reUserPwd)) { - mui.alert('两次密码不一致!'); - return; - } - if (regConfirmImg == '') { - mui.alert('请上传确认书照片'); - return; - } - if (pName != '') { - if ('' == mobileCode1) { - mui.alert('请输入推荐人验证码'); - return; - } - } - $(this).attr("disabled", true); - mui.ajax('http://t.ect99.com/app/users/register', { - data: { - loginName: loginName, - mobileCode: mobileCode, - loginPwd: loginPwd, - reUserPwd: reUserPwd, - pName: pName, - nameType: 3, - regConfirmImg: regConfirmImg, - mobileCode1: mobileCode1 - // verifyCode: verifyCode - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - mui.alert(data.msg); - - if (data.status == 1) { - // mui.back(); - plus.runtime.open - } else { - // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); - } - $('.btn').removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type); - } - }); - - }) - +// mui.init({ +// beforeback: function() { //获得父页面的webview +// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 +// mui.fire(list, 'refresh'); +// //返回true,继续页面关闭逻辑 +// return true; +// } +// }); + +mui.plusReady(function() { + + var wait = 120; + + // 判断用户名是否存在 + $('#loginName').on('blur', function() { + var loginName = $('#loginName').val(); + JZL.ajax('http://t.ect99.com/app/users/check_login_name', { + loginName: loginName + }, function(data) { + // console.log(data); + if (1 != data.status) { + mui.alert(data.msg) + } + }) + }) + + function GetQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + console.log(reg); + var r = window.location.search.substr(1).match(reg); + if (r != null) + return unescape(r[2]); + return null; + } + + var pName = GetQueryString('pName') ? GetQueryString('pName') : localStorage.getItem('pName'); + +// if (!pName) { +// pName = localStorage.getItem('pName'); +// var indexNum = pName.indexOf('&'); +// if (indexNum > 0) { +// pName = pName.slice(0, indexNum); +// } +// } +// + if (pName) { + console.log(pName); +// $('#pName').val(pname);; +// $('#pName').attr('disabled', 'disabled'); + } + // 推荐人信息 + //var PName = ""; + $('#pName').on('blur', function() { + pName = $('#pName').val(); + if ('' != pName) { + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pName))) { + mui.alert("手机号码有误,请重填!"); + return; + } + $('.pNameCode').show(); + + mui('.row').on('tap', '#mobileCode1', function() { + $(this).attr("disabled", true); + JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { + userPhone: pName + }, function(data) { + if (1 == data.status) { + time() + } else { + mui.alert(data.msg); + } + $('#mobileCode1').removeAttr('disabled'); + + }) + }) + + + + } else { + $('.pNameCode').hide(); + } + + }) + // JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) { + // // console.log(data); + // + // if (1 != data.status) { + // mui.alert(data.msg) + // } + // }) + function time() { + if (wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + //获取验证码 + mui('.row').on('tap', '#mobileCode', function() { + var loginName = $('#loginName').val(); + if (loginName == '') { + mui.alert('手机号不能为空!'); + return; + } + // if (!( + // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + // .test(loginName))) { + // mui.alert("手机号码有误,请重填!"); + // return; + // } + $(this).attr("disabled", true); + mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { + + data: { + userPhone: loginName + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + console.log(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + time(); + } else { + mui.alert(data.msg); + } + $('#mobileCode').removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + mui.alert(type) + // mui.alert(type); + } + }); + }) + //注册协议 + mui.ajax('http://t.ect99.com/app/Tags/articleDetail', { + data: { + articleId: 114 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { + console.log(data); + // if(data.status==1){ + // console.log(1); + var html1 = '' + html1 = '

      ' + data.articleContent + '

      ' + $('.zcxycontent').append(html1) + // } + }, + error: function(xhr, type, errorThrown) { + + } + }); + //上传图片 + + var files = []; //存储文件信息的数组 + var fname = ""; //表示文件名,例如 XXXX.jpg; + var expire = 0; + var pathName = ''; + var inpId = ''; + var keyname = ''; + var imgId = ''; + var isZip = 1; + var qualityNum = 90; + var response = ';' + var UP = UP || {}; + UP.isBatch = 0; + UP.init = function(inputId, path, imageId, isBatch, isZipImg, quality) { + inpId = inputId; + pathName = path; + imgId = imageId; + if (typeof(isBatch) != 'undefined') { + UP.isBatch = isBatch; + } + if (typeof(isZipImg) != 'undefined') { + // console.log(typeof(isZipImg)); + isZip = isZipImg; + } + if (typeof(quality) != 'undefined') { + qualityNum = quality; + } + + } + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // console.log(dir) + serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; + // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; + + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText; + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + } + + function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if (expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + response = obj; + // console.log(obj); + } + return response; + }; + // 上传文件 + function upload(callback) { + // console.log(files); + if (files.length <= 0) { + mui.toast('没有添加上传文件'); + return; + } + var obj = get_signature(); + if (obj) { + server = obj['host']; + policyBase64 = obj['policy']; + accessid = obj['accessid']; + signature = obj['signature']; + expire = parseInt(obj['expire']); + callbackbody = obj['callback']; + path = obj['dir']; + + } else { + mui.toast('初始化失败'); + return; + } + + var wt = plus.nativeUI.showWaiting(); + var task = plus.uploader.createUpload(server, { + method: "POST" + }, function(t, status) { + //上传完成 + if (status == 200) { + wt.close(); + if (1 == UP.isBatch) { + callback(t, status, keyname, server + '/' + keyname); + } else { + document.getElementById(inpId).value = keyname; + var ele = document.getElementById(imgId); + ele.src = server + '/' + keyname; + ele.setAttribute('data-src', keyname); + mui.toast('上传成功'); + //至此上传成功,上传后的图片完整地址为server+testName + //keyname + } + + } else { + wt.close(); + mui.toast('上传失败:' + status); + } + }); + var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg + keyname = path + new Date().getTime() + suffix1; + task.addData("key", keyname); + task.addData("policy", policyBase64); + task.addData("OSSAccessKeyId", accessid); + task.addData("success_action_status", "200"); + // task.addData("callback", callbackbody); + task.addData("signature", signature); + var f = files[files.length - 1]; + // console.log(f) + + task.addFile(f.path, { + key: "file", + name: "file", + mime: "image/jpeg" + }); + //files.length = 0; + task.start(); + + } + + //得到文件名的后缀 + function get_suffix(filename) { + var pos = filename.lastIndexOf('.'); + var suffix = ''; + if (pos != -1) { + suffix = filename.substring(pos) + } + return suffix; + } + // 拍照添加文件 + function appendByCamera(callback) { + plus.camera.getCamera().captureImage(function(p) { + uploadImg(p, callback); + }); + } + // 从相册添加文件 + function appendByGallery(callback) { + plus.gallery.pick(function(p) { + uploadImg(p, callback); + }); + } + + // 添加文件 + var index = 1; + + function uploadImg(p, callback) { + if (1 == isZip) { + compressImg(p, callback); + } else { + appendFile(p, callback) + } + } + + function appendFile(p, callback) { + // var fe = document.getElementById(fileId); + var n = p.substr(p.lastIndexOf('/') + 1); + // fname = n/////////; + files.push({ + name: "uploadkey" + index, + path: p + }); + //console.log(3); + // index++; + upload(callback); + } + + function compressImg(src, callback) { + var filename = src.substring(src.lastIndexOf('/') + 1); + var opions = { + src: src, + dst: '_doc/tmp/' + filename, + overwrite: true, + //width: '300px', //这里指定了宽度,同样可以修改 + format: 'jpg', + quality: qualityNum //图片质量不再修改,以免失真 + }; + var successCB = function(evt) { + // console.log(JSON.stringify(evt)); + fname = filename; + // files[0]={ + // name: "uploadkey", + // path: evt.target + // }; + files.push({ + name: "uploadkey" + index, + path: evt.target + }); + // index++; + //上传 + upload(callback); + //_this.avatar(evt.target); + }; + var errorCB = function(err) { + appendFile(src, callback); + + //console.log(JSON.stringify(err)); + //mui.toast("图片压缩失败");i m + }; + plus.zip.compressImage(opions, successCB, errorCB); + }; + + function openCamera(callback) { + plus.nativeUI.actionSheet({ + cancel: "取消", + buttons: [{ + title: "拍照" + }, + { + title: "从相册中选择" + } + ] + }, function(e) { //1 是拍照 2 从相册中选择 + switch (e.index) { + case 1: + appendByCamera(callback); + break; + case 2: + appendByGallery(callback); + break; + } + }); + } + $(".photos").on("tap", '.regConfirm', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("regConfirmImg", "test", "regConfirmImg") + openCamera() + }) + + + mui('.down').on('tap', '.btn', function() { + var loginName = $('#loginName').val(); + var mobileCode = $('.yzm').val(); + var loginPwd = $('#loginPwd').val(); + var reUserPwd = $('#reUserPwd').val(); + var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : ""; //推荐人验证码 + + + pName = $('#pName').val(); + + // var verifyCode = $('.tpyzm').val(); + var regConfirmImg = $('#regConfirmImg').val(); + if (loginName == '') { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(loginName))) { + mui.alert("手机号码有误,请重填!"); + return; + } + if (mobileCode == '') { + mui.alert('验证码不能为空!'); + return; + } + if (loginPwd == '') { + mui.alert('密码不能为空!'); + return; + } + if (reUserPwd == '') { + mui.alert('确认密码不能为空!'); + return; + } + if (loginPwd.length < 6) { + mui.alert('密码不能小于6位!'); + return; + } + if (!(loginPwd == reUserPwd)) { + mui.alert('两次密码不一致!'); + return; + } + if (regConfirmImg == '') { + mui.alert('请上传确认书照片'); + return; + } + if (pName != '') { + if ('' == mobileCode1) { + mui.alert('请输入推荐人验证码'); + return; + } + } + $(this).attr("disabled", true); + mui.ajax('http://t.ect99.com/app/users/register', { + data: { + loginName: loginName, + mobileCode: mobileCode, + loginPwd: loginPwd, + reUserPwd: reUserPwd, + pName: pName, + nameType: 3, + regConfirmImg: regConfirmImg, + mobileCode1: mobileCode1 + // verifyCode: verifyCode + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + mui.alert(data.msg); + + if (data.status == 1) { + // mui.back(); + plus.runtime.open + } else { + // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); + } + $('.btn').removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type); + } + }); + + }) + }) diff --git a/static/app2/js/register.js b/static/app2/js/register.js old mode 100755 new mode 100644 index 4a872fe..eb388ab --- a/static/app2/js/register.js +++ b/static/app2/js/register.js @@ -1,201 +1,201 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - //返回true,继续页面关闭逻辑 - return true; - } -}); - -mui.plusReady(function() { - var wait = 120; - // var html = - // '
      验证码:
      '; - // - // $('.con').append(html); - // 判断用户名是否存在 - $('#loginName').on('blur', function() { - var loginName = $('#loginName').val(); - if ('' == loginName) { - mui.mui.alert('用户名不能为空') - return; - } - if (6 > loginName.length) { - mui.alert('用户名不能小于6个字符') - return; - } - JZL.ajax(qlgUrl('app/users/check_login_name'), { - loginName: loginName - }, function(data) { - // //console.log(data); - if (1 != data.status) { - mui.alert(data.msg) - } - }) - }) - // 推荐人信息 - $('.pNameCode').hide(); - - var PName = ""; - $('#pName').on('blur', function() { - pName = $('#pName').val(); - if ('' != pName) { - - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(pName))) { - mui.alert("手机号码有误,请重填!"); - return; - } - $('.pNameCode').show(); - mui('.row').on('tap', '#getMobileCode', function() { - var that=$(this) - that.attr("disabled", true); - JZL.ajax(qlgUrl('app/users/getPhoneVerifyCode'), { - userPhone: pName - }, function(data) { - if (1 == data.status) { - time() - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - - }) - }) - - - - } else { - $('.pNameCode').hide(); - } - - }) - - function time() { - if (wait == 0) { - $('#getMobileCode').removeAttr("disabled"); - $('#getMobileCode').val("重新发送"); - wait = 120; - } else { - $('#getMobileCode').attr("disabled", true); - $('#getMobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - - //注册协议 - mui.ajax(qlgUrl('app/Tags/articleDetail'), { - data: { - articleId: 114 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { - //console.log(data); - // if(data.status==1){ - // //console.log(1); - - $('.zcxycontent').html(data.articleContent) - // } - }, - error: function(xhr, type, errorThrown) { - - } - }); - //上传图片 - $(".photos").on("tap", '.regConfirm', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("regConfirmImg", "test", "regConfirm") - openCamera() - }) - - - mui('.down').on('tap', '.btn', function() { - var loginName = $('#loginName').val(); - // var mobileCode = $('.yzm').val(); - var loginPwd = $('#loginPwd').val(); - var reUserPwd = $('#reUserPwd').val(); - var mobileCode = $('#mobileCode').val() ? $('#mobileCode').val() : ""; //推荐人验证码 - var payPwd = $('#loginPaywd').val(); - var reUserPaywd = $('#reUserPaywd').val(); - var pName = $('#pName').val(); - - // var verifyCode = $('.tpyzm').val(); - var regConfirmImg = $('#regConfirmImg').val(); - if (loginName == '') { - mui.alert('用户名不能为空!'); - return; - } - if (loginPwd.length < 6) { - mui.alert('登录密码不能小于6位!'); - return; - } - if (!(loginPwd == reUserPwd)) { - mui.alert('两次登录密码不一致!'); - return; - } - if (payPwd.length < 6) { - mui.alert('操作密码不能小于6位!'); - return; - } - if (payPwd != reUserPaywd) { - mui.alert('两次操作密码不一致!'); - return; - } - if (regConfirmImg == '') { - mui.alert('请上传确认书照片'); - return; - } - if (pName != '') { - if ('' == mobileCode) { - mui.alert('请输入推荐人验证码'); - return; - } - } - var ajaxData={ - loginName: loginName, - // mobileCode: mobileCode, - loginPwd: loginPwd, - payPwd: payPwd, - pName: pName, - // nameType: 3, - regConfirmImg: regConfirmImg, - mobileCode: mobileCode - }; - - var that = $(this) - that.attr("disabled", true); - - mui.ajax(qlgUrl('app/users/register'), { - data:ajaxData, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - mui.alert(data.msg); - - if (data.status == 1) { - mui.back(); - } else { - // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type); - } - }); - - }) - -}) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + } +}); + +mui.plusReady(function() { + var wait = 120; + // var html = + // '
      验证码:
      '; + // + // $('.con').append(html); + // 判断用户名是否存在 + $('#loginName').on('blur', function() { + var loginName = $('#loginName').val(); + if ('' == loginName) { + mui.mui.alert('用户名不能为空') + return; + } + if (6 > loginName.length) { + mui.alert('用户名不能小于6个字符') + return; + } + JZL.ajax(qlgUrl('app/users/check_login_name'), { + loginName: loginName + }, function(data) { + // //console.log(data); + if (1 != data.status) { + mui.alert(data.msg) + } + }) + }) + // 推荐人信息 + $('.pNameCode').hide(); + + var PName = ""; + $('#pName').on('blur', function() { + pName = $('#pName').val(); + if ('' != pName) { + + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pName))) { + mui.alert("手机号码有误,请重填!"); + return; + } + $('.pNameCode').show(); + mui('.row').on('tap', '#getMobileCode', function() { + var that=$(this) + that.attr("disabled", true); + JZL.ajax(qlgUrl('app/users/getPhoneVerifyCode'), { + userPhone: pName + }, function(data) { + if (1 == data.status) { + time() + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + + }) + }) + + + + } else { + $('.pNameCode').hide(); + } + + }) + + function time() { + if (wait == 0) { + $('#getMobileCode').removeAttr("disabled"); + $('#getMobileCode').val("重新发送"); + wait = 120; + } else { + $('#getMobileCode').attr("disabled", true); + $('#getMobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + + //注册协议 + mui.ajax(qlgUrl('app/Tags/articleDetail'), { + data: { + articleId: 114 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { + //console.log(data); + // if(data.status==1){ + // //console.log(1); + + $('.zcxycontent').html(data.articleContent) + // } + }, + error: function(xhr, type, errorThrown) { + + } + }); + //上传图片 + $(".photos").on("tap", '.regConfirm', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("regConfirmImg", "test", "regConfirm") + openCamera() + }) + + + mui('.down').on('tap', '.btn', function() { + var loginName = $('#loginName').val(); + // var mobileCode = $('.yzm').val(); + var loginPwd = $('#loginPwd').val(); + var reUserPwd = $('#reUserPwd').val(); + var mobileCode = $('#mobileCode').val() ? $('#mobileCode').val() : ""; //推荐人验证码 + var payPwd = $('#loginPaywd').val(); + var reUserPaywd = $('#reUserPaywd').val(); + var pName = $('#pName').val(); + + // var verifyCode = $('.tpyzm').val(); + var regConfirmImg = $('#regConfirmImg').val(); + if (loginName == '') { + mui.alert('用户名不能为空!'); + return; + } + if (loginPwd.length < 6) { + mui.alert('登录密码不能小于6位!'); + return; + } + if (!(loginPwd == reUserPwd)) { + mui.alert('两次登录密码不一致!'); + return; + } + if (payPwd.length < 6) { + mui.alert('操作密码不能小于6位!'); + return; + } + if (payPwd != reUserPaywd) { + mui.alert('两次操作密码不一致!'); + return; + } + if (regConfirmImg == '') { + mui.alert('请上传确认书照片'); + return; + } + if (pName != '') { + if ('' == mobileCode) { + mui.alert('请输入推荐人验证码'); + return; + } + } + var ajaxData={ + loginName: loginName, + // mobileCode: mobileCode, + loginPwd: loginPwd, + payPwd: payPwd, + pName: pName, + // nameType: 3, + regConfirmImg: regConfirmImg, + mobileCode: mobileCode + }; + + var that = $(this) + that.attr("disabled", true); + + mui.ajax(qlgUrl('app/users/register'), { + data:ajaxData, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + mui.alert(data.msg); + + if (data.status == 1) { + mui.back(); + } else { + // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type); + } + }); + + }) + +}) diff --git a/static/app2/js/register1.js b/static/app2/js/register1.js old mode 100755 new mode 100644 index ed290d6..e1f1e61 --- a/static/app2/js/register1.js +++ b/static/app2/js/register1.js @@ -1,471 +1,471 @@ -// mui.init({ -// beforeback: function() { //获得父页面的webview -// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 -// mui.fire(list, 'refresh'); -// //返回true,继续页面关闭逻辑 -// return true; -// } -// }); - -mui.plusReady(function() { - var wait = 120; - // var html = - // '
      验证码:
      '; - // - // $('.con').append(html); - // 判断手机号是否存在 格式是否正确 - $('#loginName').on('blur', function() { - var loginName = $('#loginName').val(); - JZL.ajax('http://t.ect99.com/app/users/check_login_name', { - loginName: loginName - }, function(data) { - // //console.log(data); - if (1 != data.status) { - mui.alert(data.msg) - } - }) - }) - // 推荐人信息 - $('.pNameCode').hide(); - - var PName=""; - $('#pName').on('blur', function() { - pName = $('#pName').val(); - if ('' != pName) { - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(pName))) { - mui.alert("手机号码有误,请重填!"); - return; - } - $('.pNameCode').show(); - - mui('.row').on('tap', '#mobileCode1', function() { - $(this).attr("disabled", true); - JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode',{userPhone:pName},function (data) { - if (1==data.status) { - time() - }else { - mui.alert(data.msg); - } - $('#mobileCode1').removeAttr('disabled'); - - }) -}) - - - - } else { - $('.pNameCode').hide(); - } - - }) -// JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) { -// // //console.log(data); -// -// if (1 != data.status) { -// mui.alert(data.msg) -// } -// }) - function time() { - if (wait == 0) { - $('#mobileCode').removeAttr("disabled"); - $('#mobileCode').val("重新发送"); - wait = 120; - } else { - $('#mobileCode').attr("disabled", true); - $('#mobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time() - }, - 1000) - } - } - //获取验证码 - mui('.row').on('tap', '#mobileCode', function() { - var loginName = $('#loginName').val(); - if (loginName == '') { - mui.alert('手机号不能为空!'); - return; - } - // if (!( - // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - // .test(loginName))) { - // mui.alert("手机号码有误,请重填!"); - // return; - // } - $(this).attr("disabled", true); - mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { - - data: { - userPhone: loginName - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - //console.log(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - time(); - } else { - mui.alert(data.msg); - } - $('#mobileCode').removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - mui.alert(type) - // mui.alert(type); - } - }); - }) - //注册协议 - mui.ajax('http://t.ect99.com/app/Tags/articleDetail', { - data: { - articleId: 114 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { - //console.log(data); - // if(data.status==1){ - // //console.log(1); - var html1 = '' - html1 = '

      ' + data.articleContent + '

      ' - $('.zcxycontent').append(html1) - // } - }, - error: function(xhr, type, errorThrown) { - - } - }); - //上传图片 - - var files = []; //存储文件信息的数组 - var fname = ""; //表示文件名,例如 XXXX.jpg; - var expire = 0; - var pathName = ''; - var inpId = ''; - var keyname = ''; - var imgId=''; - var isZip=1; - var qualityNum=90; - var response=';' - var UP = UP || {}; - UP.isBatch=0; - UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) { - inpId = inputId; - pathName = path; - imgId = imageId; - if(typeof(isBatch) != 'undefined'){ - UP.isBatch = isBatch; - } - if(typeof(isZipImg) != 'undefined'){ - // //console.log(typeof(isZipImg)); - isZip = isZipImg; - } - if(typeof(quality) != 'undefined'){ - qualityNum = quality; - } - - } - - function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - // //console.log(dir) - serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; - // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; - - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText; - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - - } - - function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if (expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - response = obj; - // //console.log(obj); - } - return response; - }; - // 上传文件 - function upload(callback) { - // //console.log(files); - if (files.length <= 0) { - mui.toast('没有添加上传文件'); - return; - } - var obj = get_signature(); - if (obj) { - server = obj['host']; - policyBase64 = obj['policy']; - accessid = obj['accessid']; - signature = obj['signature']; - expire = parseInt(obj['expire']); - callbackbody = obj['callback']; - path = obj['dir']; - - } else { - mui.toast('初始化失败'); - return; - } - - var wt = plus.nativeUI.showWaiting(); - var task = plus.uploader.createUpload(server, { - method: "POST" - }, function(t, status) { - //上传完成 - if (status == 200) { - wt.close(); - if(1 == UP.isBatch){ - callback(t,status,keyname,server + '/'+keyname); - }else{ - document.getElementById(inpId).value = keyname; - var ele=document.getElementById(imgId); - ele.src=server + '/'+keyname; - ele.setAttribute('data-src',keyname); - mui.toast('上传成功'); - //至此上传成功,上传后的图片完整地址为server+testName - //keyname - } - - } else { - wt.close(); - mui.toast('上传失败:' + status); - } - }); - var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg - keyname = path + new Date().getTime() + suffix1; - task.addData("key", keyname); - task.addData("policy", policyBase64); - task.addData("OSSAccessKeyId", accessid); - task.addData("success_action_status", "200"); - // task.addData("callback", callbackbody); - task.addData("signature", signature); - var f = files[files.length-1]; - // //console.log(f) - - task.addFile(f.path, { - key: "file", - name: "file", - mime: "image/jpeg" - }); - //files.length = 0; - task.start(); - - } - - //得到文件名的后缀 - function get_suffix(filename) { - var pos = filename.lastIndexOf('.'); - var suffix = ''; - if (pos != -1) { - suffix = filename.substring(pos) - } - return suffix; - } - // 拍照添加文件 - function appendByCamera(callback) { - plus.camera.getCamera().captureImage(function(p) { - uploadImg(p,callback); - }); - } - // 从相册添加文件 - function appendByGallery(callback) { - plus.gallery.pick(function(p) { - uploadImg(p,callback); - }); - } - - // 添加文件 - var index = 1; - function uploadImg(p,callback){ - if(1 == isZip){ - compressImg(p,callback); - }else{ - appendFile(p,callback) - } - } - function appendFile(p,callback) { - // var fe = document.getElementById(fileId); - var n = p.substr(p.lastIndexOf('/') + 1); - fname = n; - files.push({ - name: "uploadkey" + index, - path: p - }); - ////console.log(3); - // index++; - upload(callback); - } - function compressImg(src,callback) { - var filename = src.substring(src.lastIndexOf('/') + 1); - var opions = { - src: src, - dst: '_doc/tmp/' + filename, - overwrite: true, - //width: '300px', //这里指定了宽度,同样可以修改 - format: 'jpg', - quality: qualityNum //图片质量不再修改,以免失真 - }; - var successCB = function(evt) { - // //console.log(JSON.stringify(evt)); - fname = filename; - // files[0]={ - // name: "uploadkey", - // path: evt.target - // }; - files.push({ - name: "uploadkey" + index, - path: evt.target - }); - // index++; - //上传 - upload(callback); - //_this.avatar(evt.target); - }; - var errorCB = function(err) { - appendFile(src,callback); - ////console.log(JSON.stringify(err)); - //mui.toast("图片压缩失败"); - }; - plus.zip.compressImage(opions, successCB, errorCB); - }; - function openCamera(callback) { - plus.nativeUI.actionSheet({ - cancel: "取消", - buttons: [{ - title: "拍照" - }, - { - title: "从相册中选择" - } - ] - }, function(e) { //1 是拍照 2 从相册中选择 - switch (e.index) { - case 1: - appendByCamera(callback); - break; - case 2: - appendByGallery(callback); - break; - } - }); - } - $(".photos").on("tap", '.regConfirm', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("regConfirmImg", "test", "regConfirmImg") - openCamera() - }) - - - mui('.down').on('tap', '.btn', function() { - var loginName = $('#loginName').val(); - var mobileCode = $('.yzm').val(); - var loginPwd = $('#loginPwd').val(); - var reUserPwd = $('#reUserPwd').val(); - var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : "";//推荐人验证码 - - - pName = $('#pName').val(); - - // var verifyCode = $('.tpyzm').val(); - var regConfirmImg = $('#regConfirmImg').val(); - if (loginName == '') { - mui.alert('手机号不能为空!'); - return; - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(loginName))) { - mui.alert("手机号码有误,请重填!"); - return; - } - if (mobileCode == '') { - mui.alert('验证码不能为空!'); - return; - } - if (loginPwd == '') { - mui.alert('密码不能为空!'); - return; - } - if (reUserPwd == '') { - mui.alert('确认密码不能为空!'); - return; - } - if (loginPwd.length < 6) { - mui.alert('密码不能小于6位!'); - return; - } - if (!(loginPwd == reUserPwd)) { - mui.alert('两次密码不一致!'); - return; - } - if (regConfirmImg == '') { - mui.alert('请上传确认书照片'); - return; - } - if (pName != '') { - if(''==mobileCode1){ - mui.alert('请输入推荐人验证码'); - return; - } - } - $(this).attr("disabled", true); - mui.ajax('http://t.ect99.com/app/users/register', { - data: { - loginName: loginName, - mobileCode: mobileCode, - loginPwd: loginPwd, - reUserPwd: reUserPwd, - pName: pName, - nameType: 3, - regConfirmImg: regConfirmImg, - mobileCode1:mobileCode1 - // verifyCode: verifyCode - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - //服务器返回响应,根据响应结果,分析是否登录成功; - mui.alert(data.msg); - - if (data.status == 1) { - // mui.back(); - plus.runtime.open - } else { - // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); - } - $('.btn').removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type); - } - }); - - }) - -}) +// mui.init({ +// beforeback: function() { //获得父页面的webview +// var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 +// mui.fire(list, 'refresh'); +// //返回true,继续页面关闭逻辑 +// return true; +// } +// }); + +mui.plusReady(function() { + var wait = 120; + // var html = + // '
      验证码:
      '; + // + // $('.con').append(html); + // 判断手机号是否存在 格式是否正确 + $('#loginName').on('blur', function() { + var loginName = $('#loginName').val(); + JZL.ajax('http://t.ect99.com/app/users/check_login_name', { + loginName: loginName + }, function(data) { + // //console.log(data); + if (1 != data.status) { + mui.alert(data.msg) + } + }) + }) + // 推荐人信息 + $('.pNameCode').hide(); + + var PName=""; + $('#pName').on('blur', function() { + pName = $('#pName').val(); + if ('' != pName) { + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pName))) { + mui.alert("手机号码有误,请重填!"); + return; + } + $('.pNameCode').show(); + + mui('.row').on('tap', '#mobileCode1', function() { + $(this).attr("disabled", true); + JZL.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode',{userPhone:pName},function (data) { + if (1==data.status) { + time() + }else { + mui.alert(data.msg); + } + $('#mobileCode1').removeAttr('disabled'); + + }) +}) + + + + } else { + $('.pNameCode').hide(); + } + + }) +// JZL.ajax(qlgUrl('app/users/check_login_name'),{loginName:loginName},function (data) { +// // //console.log(data); +// +// if (1 != data.status) { +// mui.alert(data.msg) +// } +// }) + function time() { + if (wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + //获取验证码 + mui('.row').on('tap', '#mobileCode', function() { + var loginName = $('#loginName').val(); + if (loginName == '') { + mui.alert('手机号不能为空!'); + return; + } + // if (!( + // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + // .test(loginName))) { + // mui.alert("手机号码有误,请重填!"); + // return; + // } + $(this).attr("disabled", true); + mui.ajax('http://t.ect99.com/app/users/getPhoneVerifyCode', { + + data: { + userPhone: loginName + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + //console.log(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + time(); + } else { + mui.alert(data.msg); + } + $('#mobileCode').removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + mui.alert(type) + // mui.alert(type); + } + }); + }) + //注册协议 + mui.ajax('http://t.ect99.com/app/Tags/articleDetail', { + data: { + articleId: 114 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { + //console.log(data); + // if(data.status==1){ + // //console.log(1); + var html1 = '' + html1 = '

      ' + data.articleContent + '

      ' + $('.zcxycontent').append(html1) + // } + }, + error: function(xhr, type, errorThrown) { + + } + }); + //上传图片 + + var files = []; //存储文件信息的数组 + var fname = ""; //表示文件名,例如 XXXX.jpg; + var expire = 0; + var pathName = ''; + var inpId = ''; + var keyname = ''; + var imgId=''; + var isZip=1; + var qualityNum=90; + var response=';' + var UP = UP || {}; + UP.isBatch=0; + UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) { + inpId = inputId; + pathName = path; + imgId = imageId; + if(typeof(isBatch) != 'undefined'){ + UP.isBatch = isBatch; + } + if(typeof(isZipImg) != 'undefined'){ + // //console.log(typeof(isZipImg)); + isZip = isZipImg; + } + if(typeof(quality) != 'undefined'){ + qualityNum = quality; + } + + } + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // //console.log(dir) + serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; + // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; + + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText; + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + } + + function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if (expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + response = obj; + // //console.log(obj); + } + return response; + }; + // 上传文件 + function upload(callback) { + // //console.log(files); + if (files.length <= 0) { + mui.toast('没有添加上传文件'); + return; + } + var obj = get_signature(); + if (obj) { + server = obj['host']; + policyBase64 = obj['policy']; + accessid = obj['accessid']; + signature = obj['signature']; + expire = parseInt(obj['expire']); + callbackbody = obj['callback']; + path = obj['dir']; + + } else { + mui.toast('初始化失败'); + return; + } + + var wt = plus.nativeUI.showWaiting(); + var task = plus.uploader.createUpload(server, { + method: "POST" + }, function(t, status) { + //上传完成 + if (status == 200) { + wt.close(); + if(1 == UP.isBatch){ + callback(t,status,keyname,server + '/'+keyname); + }else{ + document.getElementById(inpId).value = keyname; + var ele=document.getElementById(imgId); + ele.src=server + '/'+keyname; + ele.setAttribute('data-src',keyname); + mui.toast('上传成功'); + //至此上传成功,上传后的图片完整地址为server+testName + //keyname + } + + } else { + wt.close(); + mui.toast('上传失败:' + status); + } + }); + var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg + keyname = path + new Date().getTime() + suffix1; + task.addData("key", keyname); + task.addData("policy", policyBase64); + task.addData("OSSAccessKeyId", accessid); + task.addData("success_action_status", "200"); + // task.addData("callback", callbackbody); + task.addData("signature", signature); + var f = files[files.length-1]; + // //console.log(f) + + task.addFile(f.path, { + key: "file", + name: "file", + mime: "image/jpeg" + }); + //files.length = 0; + task.start(); + + } + + //得到文件名的后缀 + function get_suffix(filename) { + var pos = filename.lastIndexOf('.'); + var suffix = ''; + if (pos != -1) { + suffix = filename.substring(pos) + } + return suffix; + } + // 拍照添加文件 + function appendByCamera(callback) { + plus.camera.getCamera().captureImage(function(p) { + uploadImg(p,callback); + }); + } + // 从相册添加文件 + function appendByGallery(callback) { + plus.gallery.pick(function(p) { + uploadImg(p,callback); + }); + } + + // 添加文件 + var index = 1; + function uploadImg(p,callback){ + if(1 == isZip){ + compressImg(p,callback); + }else{ + appendFile(p,callback) + } + } + function appendFile(p,callback) { + // var fe = document.getElementById(fileId); + var n = p.substr(p.lastIndexOf('/') + 1); + fname = n; + files.push({ + name: "uploadkey" + index, + path: p + }); + ////console.log(3); + // index++; + upload(callback); + } + function compressImg(src,callback) { + var filename = src.substring(src.lastIndexOf('/') + 1); + var opions = { + src: src, + dst: '_doc/tmp/' + filename, + overwrite: true, + //width: '300px', //这里指定了宽度,同样可以修改 + format: 'jpg', + quality: qualityNum //图片质量不再修改,以免失真 + }; + var successCB = function(evt) { + // //console.log(JSON.stringify(evt)); + fname = filename; + // files[0]={ + // name: "uploadkey", + // path: evt.target + // }; + files.push({ + name: "uploadkey" + index, + path: evt.target + }); + // index++; + //上传 + upload(callback); + //_this.avatar(evt.target); + }; + var errorCB = function(err) { + appendFile(src,callback); + ////console.log(JSON.stringify(err)); + //mui.toast("图片压缩失败"); + }; + plus.zip.compressImage(opions, successCB, errorCB); + }; + function openCamera(callback) { + plus.nativeUI.actionSheet({ + cancel: "取消", + buttons: [{ + title: "拍照" + }, + { + title: "从相册中选择" + } + ] + }, function(e) { //1 是拍照 2 从相册中选择 + switch (e.index) { + case 1: + appendByCamera(callback); + break; + case 2: + appendByGallery(callback); + break; + } + }); + } + $(".photos").on("tap", '.regConfirm', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("regConfirmImg", "test", "regConfirmImg") + openCamera() + }) + + + mui('.down').on('tap', '.btn', function() { + var loginName = $('#loginName').val(); + var mobileCode = $('.yzm').val(); + var loginPwd = $('#loginPwd').val(); + var reUserPwd = $('#reUserPwd').val(); + var mobileCode1 = $('#mobileCode1').val() ? $('#mobileCode1').val() : "";//推荐人验证码 + + + pName = $('#pName').val(); + + // var verifyCode = $('.tpyzm').val(); + var regConfirmImg = $('#regConfirmImg').val(); + if (loginName == '') { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(loginName))) { + mui.alert("手机号码有误,请重填!"); + return; + } + if (mobileCode == '') { + mui.alert('验证码不能为空!'); + return; + } + if (loginPwd == '') { + mui.alert('密码不能为空!'); + return; + } + if (reUserPwd == '') { + mui.alert('确认密码不能为空!'); + return; + } + if (loginPwd.length < 6) { + mui.alert('密码不能小于6位!'); + return; + } + if (!(loginPwd == reUserPwd)) { + mui.alert('两次密码不一致!'); + return; + } + if (regConfirmImg == '') { + mui.alert('请上传确认书照片'); + return; + } + if (pName != '') { + if(''==mobileCode1){ + mui.alert('请输入推荐人验证码'); + return; + } + } + $(this).attr("disabled", true); + mui.ajax('http://t.ect99.com/app/users/register', { + data: { + loginName: loginName, + mobileCode: mobileCode, + loginPwd: loginPwd, + reUserPwd: reUserPwd, + pName: pName, + nameType: 3, + regConfirmImg: regConfirmImg, + mobileCode1:mobileCode1 + // verifyCode: verifyCode + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + mui.alert(data.msg); + + if (data.status == 1) { + // mui.back(); + plus.runtime.open + } else { + // $('.yzmhh').attr('src', hyhUrl('mobile/users/getverify?rnd=' + Math.random())); + } + $('.btn').removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type); + } + }); + + }) + +}) diff --git a/static/app2/js/reviewsmanage.js b/static/app2/js/reviewsmanage.js old mode 100755 new mode 100644 diff --git a/static/app2/js/saoyisao.js b/static/app2/js/saoyisao.js old mode 100755 new mode 100644 index 9ca22d2..5ba2e70 --- a/static/app2/js/saoyisao.js +++ b/static/app2/js/saoyisao.js @@ -1,77 +1,77 @@ -scan = null; //扫描对象 - mui.plusReady(function() { - mui.init(); - startRecognize(); - }); - - function startRecognize() { - try { - var filter; - //自定义的扫描控件样式 - var styles = { - frameColor: "#29E52C", - scanbarColor: "#29E52C", - background: "" - } - //扫描控件构造 - scan = new plus.barcode.Barcode('bcid', filter, styles); - scan.onmarked = onmarked; - scan.onerror = onerror; - scan.start(); - //打开关闭闪光灯处理 - var flag = false; - document.getElementById("turnTheLight").addEventListener('tap', function() { - if(flag == false) { - scan.setFlash(true); - flag = true; - } else { - scan.setFlash(false); - flag = false; - } - }); - } catch(e) { - mui.alert("出现错误啦:\n" + e); - } - }; - - function onerror(e) { - mui.alert(e); - }; - - function onmarked(type, result) { - var text = ''; - switch(type) { - case plus.barcode.QR: - text = 'QR: '; - break; - case plus.barcode.EAN13: - text = '条码: '; - break; - case plus.barcode.EAN8: - text = '条码: '; - break; - } - - if('http' == result.substring(0,4)){ - console.log(result); - plus.runtime.openURL(result); - }else{ - mui.alert(text + " : " + result); - } - - scan.cancel(); - scan.close(); -// scanDoit(result) - - }; - - // 从相册中选择二维码图片 - function scanPicture() { - plus.gallery.pick(function(path) { - plus.barcode.scan(path, onmarked, function(error) { - plus.nativeUI.alert("无法识别此图片"); - }); - }, function(err) { - plus.nativeUI.alert("Failed: " + err.message); - }); +scan = null; //扫描对象 + mui.plusReady(function() { + mui.init(); + startRecognize(); + }); + + function startRecognize() { + try { + var filter; + //自定义的扫描控件样式 + var styles = { + frameColor: "#29E52C", + scanbarColor: "#29E52C", + background: "" + } + //扫描控件构造 + scan = new plus.barcode.Barcode('bcid', filter, styles); + scan.onmarked = onmarked; + scan.onerror = onerror; + scan.start(); + //打开关闭闪光灯处理 + var flag = false; + document.getElementById("turnTheLight").addEventListener('tap', function() { + if(flag == false) { + scan.setFlash(true); + flag = true; + } else { + scan.setFlash(false); + flag = false; + } + }); + } catch(e) { + mui.alert("出现错误啦:\n" + e); + } + }; + + function onerror(e) { + mui.alert(e); + }; + + function onmarked(type, result) { + var text = ''; + switch(type) { + case plus.barcode.QR: + text = 'QR: '; + break; + case plus.barcode.EAN13: + text = '条码: '; + break; + case plus.barcode.EAN8: + text = '条码: '; + break; + } + + if('http' == result.substring(0,4)){ + console.log(result); + plus.runtime.openURL(result); + }else{ + mui.alert(text + " : " + result); + } + + scan.cancel(); + scan.close(); +// scanDoit(result) + + }; + + // 从相册中选择二维码图片 + function scanPicture() { + plus.gallery.pick(function(path) { + plus.barcode.scan(path, onmarked, function(error) { + plus.nativeUI.alert("无法识别此图片"); + }); + }, function(err) { + plus.nativeUI.alert("Failed: " + err.message); + }); } \ No newline at end of file diff --git a/static/app2/js/self_shop.js b/static/app2/js/self_shop.js old mode 100755 new mode 100644 index b1fd8f0..5345061 --- a/static/app2/js/self_shop.js +++ b/static/app2/js/self_shop.js @@ -1,327 +1,328 @@ -$('.getquan').css('display', 'none'); -// $('#search').css('width', '80%'); -$('.saoyisao').hide(); -$('.class_block').eq(0).attr('data-classifyId', 5); -$('.class_block').eq(1).attr('data-classifyId', 6); -$('.class_block').eq(2).attr('data-classifyId', 7); -$('.class_block').eq(3).attr('data-classifyId', 8); -$('.class_block').eq(4).attr('data-classifyId', ''); -$('.zya_block').addClass('add_'); -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - //返回true,继续页面关闭逻辑 - return true; - }, -}); -var data = ''; -var addr = ''; -var lat = '', - lat1 = '', - lng = ''; -var page = 1; -var pageSize = 5; -var count = 1; -var isjiazai = 1; -var nowPage = 1; -var isLoading = false; -mui.plusReady(function() { - getLocation(); - function getLocation() { - if (navigator.geolocation) { - plus.geolocation.getCurrentPosition(showPosition, showError); - - } else { - mui.alert("手机不支持定位") - } - } - function showPosition(position) { - - lat = position.coords.latitude; - lng = position.coords.longitude; - localStorage.setItem('lat', lat); - localStorage.setItem('lng', lng); - getShopList(nowPage, pageSize); - addr = position.address.city; - localStorage.setItem('addr', addr); - $('#location').html(addr); - $('#location-r').html(addr); - - } - - function showError(error) { - switch (error.code) { - case error.TIMEOUT: - mui.alert('请求超时,请重试') - break; - case error.POSITION_UNAVAILABLE: - mui.alert('定位不到你的地址') - break; - case error.PERMISSION_DENIED: - // case 22: - mui.alert('您拒绝了地理位置请求') - break; - case error.UNKNOWN_ERROR: - mui.alert('未知错误') - break; - default: - mui.alert(error.message) - break; - } - getShopList(nowPage, pageSize); - } - //bannerTop - mui.ajax(qlgUrl('app/shopping/getCarousel'), { - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - var html = ''; - var data = data.data; - $.each(data, function() { - html += '
      '; - }); - $('#top_banner .swiper-wrapper').html(html); - var swiper = new Swiper('#top_banner', { - pagination: '#top_banner_pagination', - spaceBetween: 0, - loop: true, - autoplay: 3500, - autoplayDisableOnInteraction: false - }); - var topBannerheight = localStorage.getItem('topBannerheight') - - $('#top_banner').height(topBannerheight) - // $('#top_banner').height(($('#top_banner').width() )* 460 / 750); - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - - mui('.con').on('tap', '.bc_img', function() { - var goodsId = $(this).attr('data-goodsId'); - JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId}); - }) - function getShopList(nowPage, pageSize) { - - lat = localStorage.getItem('lat'); - lng = localStorage.getItem('lng'); - - if (null == lat) { - lat = 36.659565; - lng = 117.125824; - } - var recommenddata = { - shopType: 1, - page: nowPage ? nowPage : 1, - perPage: pageSize ? pageSize : 10, - lat: lat, - lng: lng - } - if (true == isLoading) return; - isLoading = true; - //console.log(lat); - JZL.ajax(hyhUrl('app/shopping/getShops'), recommenddata, function(data) { - - var html = ''; - if (1 == data.status) { - var data = data.data; - // console.log(data); - if ('' == data.Rows) { - $('.shoplist').append( - '

      没有更多数据

      '); - // isLoading = false; - return; - } - $.each(data.Rows, function(index, element) { - html += - '
      ' + - this.shopName + '进店逛逛
      ' - if (0 != this.goods.length) { - $.each(this.goods, function(idx, ele) { - - html += '
      ¥' + this.shopPrice + '
      ' - }) - } - - html += '
      距离:' + this.distance / 1000 + - '公里
      ' - }) - if (nowPage == 1) { - $('.shoplist').html(html); - } else { - $('.shoplist').append(html); - } - isLoading = false; - } else { - mui.alert(data.msg) - } - }) - } - //加载 - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isLoading == false) { - nowPage++; - // getShops(nowPage, pageSize); - getShopList(nowPage, pageSize) - } - } - }) - mui('.shoplist').on('tap', '.shops-content1-title', function() { - // var goodsId = $(this).attr('data-goodsId'); - var shopName = $(this).attr("data-shopName"); - var shopId = $(this).attr("data-shopId"); - JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId}); - }) -}) - -//获取推荐页 -function getRecommend(page, pagesize) { - var recommenddata = { - type:1, - page: page ? page : 1, - pagesize: pageSize ? pageSize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) { - // console.log(data); - // if (data.status == 1) { - var html = ''; - // var data = data.data; - if (data.Rows == '') { - $('.self_shop_rem').append( - '

      没有更多商品

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - html += '
      ' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率  ' + this.discountRate + - '
      '; - }); - - if (page == 1) { - $('.recommend_con').html(html); - } else { - $('.recommend_con').append(html); - } - isjiazai = 1; - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - - // } else { - // mui.alert(data.msg) - // } - }) -} -$('.bcon_left').height($('.bcon_left').width() * 345 / 185); -$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185); -$('.bcr_block').height($('.bcr_block').width()); -$('.addsct_block').height($('.addsct_block').width() * 225 / 355); -$('.addscb_block').height($('.addscb_block').width() * 260 / 180); -$('.zya_block').height($('.zya_block').width() * 185 / 355); - -var issx = 0; - -// 轮播图跳转 -$('#slider').on('tap', '.swiper-slide', function() { - openAds($(this)); -}) - -//导航栏 -document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (-scroll.y < 0) { - num = 0; - } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { - num = -scroll.y / 150; - } else { - num = 1; - } - $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') - - if (-scroll.y < 75) { - $('.saoyisao').attr('src', '../img/saoyisao.png'); - $('.msg').attr('src', '../img/icon_msg.png'); - $('.search').attr('src', '../img/icon_search.png'); - $('#search').css('background-color', 'white'); - $('.header').removeClass('shadown_wai'); - } else { - $('.saoyisao').attr('src', '../img/saoyisao1.png'); - $('.msg').attr('src', '../img/icon_msg1.png'); - $('.search').attr('src', '../img/icon_search1.png'); - $('#search').css('background-color', '#d8d8d8'); - $('.header').addClass('shadown_wai'); - } - - if (scroll.y > 80 && issx == 0) { - issx = 1; - setTimeout(function() { - location.reload() - }, 1000) - } -}) -mui('.classify').on('tap', '.class_block', function() { - var classifyId = $(this).attr('data-classifyId'); - var url = 'orSupermarket.html'; - - if (classifyId == '') { - url = 'ac3.html'; - } - JZL.openWindow(url, url, {classifyId: classifyId}); -}) - -//为你推荐 -getRecommend(page, pageSize); -document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pageSize); - } - } -}) -//搜索 -$('.header').on('focus', '#keyword', function() { - $(".search button").css('display', 'block'); -}) -$('.header').on('blur', '#keyword', function() { - $(".search button").css('display', 'none'); -}) -$(".header").on('tap', '.search button', function(e) { - var searchName = $('#keyword').val(); - JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName}); - $('#keyword').val("") - // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName}); - //JZL.openWindow('shopgoodList.html', 'shopgoodList.html', {data_keyword: searchName}); -}); -//跳转商品详情页 -mui("body").on('tap', '.bc_img', function() { - var goodsId = $(this).attr('data-goodsId'); - var shopId = $(this).parent().parent().attr('data-shopId'); - JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId}); +$('.getquan').css('display', 'none'); +// $('#search').css('width', '80%'); +$('.saoyisao').hide(); +$('.class_block').eq(0).attr('data-classifyId', 5); +$('.class_block').eq(1).attr('data-classifyId', 6); +$('.class_block').eq(2).attr('data-classifyId', 7); +$('.class_block').eq(3).attr('data-classifyId', 8); +$('.class_block').eq(4).attr('data-classifyId', ''); +$('.zya_block').addClass('add_'); +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + }, +}); +var data = ''; +var addr = ''; +var lat = '', + lat1 = '', + lng = ''; +var page = 1; +var pageSize = 5; +var count = 1; +var isjiazai = 1; +var nowPage = 1; +var isLoading = false; +mui.plusReady(function() { + from_id=1; + getLocation(); + function getLocation() { + if (navigator.geolocation) { + plus.geolocation.getCurrentPosition(showPosition, showError); + + } else { + mui.alert("手机不支持定位") + } + } + function showPosition(position) { + + lat = position.coords.latitude; + lng = position.coords.longitude; + localStorage.setItem('lat', lat); + localStorage.setItem('lng', lng); + getShopList(nowPage, pageSize); + addr = position.address.city; + localStorage.setItem('addr', addr); + $('#location').html(addr); + $('#location-r').html(addr); + + } + + function showError(error) { + switch (error.code) { + case error.TIMEOUT: + mui.alert('请求超时,请重试') + break; + case error.POSITION_UNAVAILABLE: + mui.alert('定位不到你的地址') + break; + case error.PERMISSION_DENIED: + // case 22: + mui.alert('您拒绝了地理位置请求') + break; + case error.UNKNOWN_ERROR: + mui.alert('未知错误') + break; + default: + mui.alert(error.message) + break; + } + getShopList(nowPage, pageSize); + } + //bannerTop + mui.ajax(qlgUrl('app/shopping/getCarousel'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
      '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + var topBannerheight = localStorage.getItem('topBannerheight') + + $('#top_banner').height(topBannerheight) + // $('#top_banner').height(($('#top_banner').width() )* 460 / 750); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + mui('.con').on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId}); + }) + function getShopList(nowPage, pageSize) { + + lat = localStorage.getItem('lat'); + lng = localStorage.getItem('lng'); + + if (null == lat) { + lat = 36.659565; + lng = 117.125824; + } + var recommenddata = { + shopType: 1, + page: nowPage ? nowPage : 1, + perPage: pageSize ? pageSize : 10, + lat: lat, + lng: lng + } + if (true == isLoading) return; + isLoading = true; + //console.log(lat); + JZL.ajax(hyhUrl('app/shopping/getShops'), recommenddata, function(data) { + + var html = ''; + if (1 == data.status) { + var data = data.data; + // console.log(data); + if ('' == data.Rows) { + $('.shoplist').append( + '

      没有更多数据

      '); + // isLoading = false; + return; + } + $.each(data.Rows, function(index, element) { + html += + '
      ' + + this.shopName + '进店逛逛
      ' + if (0 != this.goods.length) { + $.each(this.goods, function(idx, ele) { + + html += '
      ¥' + this.shopPrice + '
      ' + }) + } + + html += '
      距离:' + this.distance / 1000 + + '公里
      ' + }) + if (nowPage == 1) { + $('.shoplist').html(html); + } else { + $('.shoplist').append(html); + } + isLoading = false; + } else { + mui.alert(data.msg) + } + }) + } + //加载 + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + nowPage++; + // getShops(nowPage, pageSize); + getShopList(nowPage, pageSize) + } + } + }) + mui('.shoplist').on('tap', '.shops-content1-title', function() { + // var goodsId = $(this).attr('data-goodsId'); + var shopName = $(this).attr("data-shopName"); + var shopId = $(this).attr("data-shopId"); + JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId}); + }) +}) + +//获取推荐页 +function getRecommend(page, pagesize) { + var recommenddata = { + type:1, + page: page ? page : 1, + pagesize: pageSize ? pageSize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) { + // console.log(data); + // if (data.status == 1) { + var html = ''; + // var data = data.data; + if (data.Rows == '') { + $('.self_shop_rem').append( + '

      没有更多商品

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + html += '
      ' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率  ' + this.discountRate + + '
      '; + }); + + if (page == 1) { + $('.recommend_con').html(html); + } else { + $('.recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + // } else { + // mui.alert(data.msg) + // } + }) +} +$('.bcon_left').height($('.bcon_left').width() * 345 / 185); +$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185); +$('.bcr_block').height($('.bcr_block').width()); +$('.addsct_block').height($('.addsct_block').width() * 225 / 355); +$('.addscb_block').height($('.addscb_block').width() * 260 / 180); +$('.zya_block').height($('.zya_block').width() * 185 / 355); + +var issx = 0; + +// 轮播图跳转 +$('#slider').on('tap', '.swiper-slide', function() { + openAds($(this)); +}) + +//导航栏 +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } +}) +mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == '') { + url = 'ac3.html'; + } + JZL.openWindow(url, url, {classifyId: classifyId}); +}) + +//为你推荐 +getRecommend(page, pageSize); +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } +}) +//搜索 +$('.header').on('focus', '#keyword', function() { + $(".search button").css('display', 'block'); +}) +$('.header').on('blur', '#keyword', function() { + $(".search button").css('display', 'none'); +}) +$(".header").on('tap', '.search button', function(e) { + var searchName = $('#keyword').val(); + JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName}); + $('#keyword').val("") + // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName}); + //JZL.openWindow('shopgoodList.html', 'shopgoodList.html', {data_keyword: searchName}); +}); +//跳转商品详情页 +mui("body").on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + var shopId = $(this).parent().parent().attr('data-shopId'); + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId}); }) diff --git a/static/app2/js/setting.js b/static/app2/js/setting.js old mode 100755 new mode 100644 index 32b4146..1ce7749 --- a/static/app2/js/setting.js +++ b/static/app2/js/setting.js @@ -1,67 +1,81 @@ -$('.header_con .title').html('设置'); -$('#setting_loginInfo').hide(); -$('#connect_our').hide(); -mui.plusReady(function() { - var token = localStorage.getItem('token'); - mui('.block').on('tap', '.row', function() { - var url = $(this).attr('id'); - mui.openWindow({ - url: url + '.html', - id: url + '.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - $('.loginout').on('tap', function() { - ////console.log(111) - mui.ajax(qlgUrl('app/users/logout'), { - headers: { - "HYH-Token": token - }, - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - localStorage.removeItem("token"); - mui.fire(plus.webview.getWebviewById('templete/my.html'), 'refresh'); - mui.fire(plus.webview.getWebviewById('templete/shoppingcart.html'), 'refresh'); - mui.back(); - var data = toJson(data, 1); - if(data.status == 1) { - - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) +$('.header_con .title').html('设置'); +$('#setting_loginInfo').hide(); +$('#connect_our').hide(); +mui.plusReady(function() { + var token = localStorage.getItem('token'); + mui('.block').on('tap', '.row', function() { + var url = $(this).attr('id'); + mui.openWindow({ + url: url + '.html', + id: url + '.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + $('.loginout').on('tap', function() { + ////console.log(111) + mui.ajax(qlgUrl('app/users/logout'), { + headers: { + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + localStorage.removeItem("token"); + localStorage.removeItem("userId"); + localStorage.removeItem("userName"); + mui.fire(plus.webview.getWebviewById('templete/my.html'), 'refresh'); + mui.fire(plus.webview.getWebviewById('templete/shoppingcart_warp.html'), 'refresh'); + mui.back(); + var data = toJson(data, 1); + if(data.status == 1) { + + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.cancellation').on("tap", function(){ + JZL.openWindow('cancellation.html', 'cancellation.html', {user_id: localStorage.getItem("userId")}); + }) + let counter = 0; + $('.title').on("tap", function(){ + if(counter < 20){ + counter ++ ; + }else{ + counter = 0; + $(".hide").removeClass("hide") + } + }) }) \ No newline at end of file diff --git a/static/app2/js/setting_address.js b/static/app2/js/setting_address.js old mode 100755 new mode 100644 index 45bef1d..98eb8dd --- a/static/app2/js/setting_address.js +++ b/static/app2/js/setting_address.js @@ -1,183 +1,183 @@ -$('.header_con .title').html('编辑收货地址'); - -$('.mui-scroll-wrapper').addClass('scroll_out_t').removeClass('scroll_out'); -$('.footer_btn').css('z-index', '10000') - -mui.init({ - beforeback: function() { //获得父页面的webview - //触发父页面的自定义事件(refresh),从而进行刷新 - - //返回true,继续页面关闭逻辑 - return true; - } -}); -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var self = plus.webview.currentWebview(); - var isOrder = self.data_isOrder; - if (isOrder == true) { - $('.con').on('tap', '.block', function() { - var addressId = $(this).attr('data-addressId'); - localStorage.setItem('addressId', addressId); - var list = plus.webview.currentWebview().opener(); - mui.fire(list, 'setAddress'); - mui.back(); - }) - } - mui.ajax(qlgUrl('app/useraddress/getList'), { - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - data = data.data; - var html = ''; - $.each(data.addressList, function() { - html += '

      ' + this.userName + - '

      ' + this.userPhone + '

      ' + this.areaName + ' ' + this.userAddress + - '


      设为默认地址

      ' - }); - $('.con').html(html) - $('.btnout').each(function(num) { - if ($(this).attr('data-isDefault') == 1) { - $(this).children('.btn').addClass('on') - } - }) - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - $('body').on('tap', '.footer_btn', function() { - mui.openWindow({ - url: 'editAddress.html', - id: 'editAddress.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - - $('.con').on('tap', '.bj', function(e) { - e.stopPropagation(); - var data_addressId = $(this).parent().attr('data-addressId'); - mui.openWindow({ - url: 'editAddress.html', - id: 'editAddress.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_addressId: data_addressId - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - $('.con').on('tap', '.del', function() { - var data_addressId = $(this).parent().attr('data-addressId'); - if (confirm('确认删除地址?')) { - mui.ajax(hyhUrl('app/Useraddress/del'), { - data: { - id: data_addressId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - location.reload() - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - - }) - $('.con').on('tap', '.btnout', function() { - $('.btnout').children('.btn').removeClass('on'); - $(this).children('.btn').addClass('on'); - var addressId = $(this).parent().attr('data-addressId') - mui.ajax(hyhUrl('app/Useraddress/setDefault'), { - data: { - id: addressId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - location.reload() - - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) +$('.header_con .title').html('编辑收货地址'); + +$('.mui-scroll-wrapper').addClass('scroll_out_t').removeClass('scroll_out'); +$('.footer_btn').css('z-index', '10000') + +mui.init({ + beforeback: function() { //获得父页面的webview + //触发父页面的自定义事件(refresh),从而进行刷新 + + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var self = plus.webview.currentWebview(); + var isOrder = self.data_isOrder; + if (isOrder == true) { + $('.con').on('tap', '.block', function() { + var addressId = $(this).attr('data-addressId'); + localStorage.setItem('addressId', addressId); + var list = plus.webview.currentWebview().opener(); + mui.fire(list, 'setAddress'); + mui.back(); + }) + } + mui.ajax(qlgUrl('app/useraddress/getList'), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data.addressList, function() { + html += '

      ' + this.userName + + '

      ' + this.userPhone + '

      ' + this.areaName + ' ' + this.userAddress + + '


      设为默认地址

      ' + }); + $('.con').html(html) + $('.btnout').each(function(num) { + if ($(this).attr('data-isDefault') == 1) { + $(this).children('.btn').addClass('on') + } + }) + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('body').on('tap', '.footer_btn', function() { + mui.openWindow({ + url: 'editAddress.html', + id: 'editAddress.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + + $('.con').on('tap', '.bj', function(e) { + e.stopPropagation(); + var data_addressId = $(this).parent().attr('data-addressId'); + mui.openWindow({ + url: 'editAddress.html', + id: 'editAddress.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_addressId: data_addressId + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + $('.con').on('tap', '.del', function() { + var data_addressId = $(this).parent().attr('data-addressId'); + if (confirm('确认删除地址?')) { + mui.ajax(hyhUrl('app/Useraddress/del'), { + data: { + id: data_addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + location.reload() + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + + }) + $('.con').on('tap', '.btnout', function() { + $('.btnout').children('.btn').removeClass('on'); + $(this).children('.btn').addClass('on'); + var addressId = $(this).parent().attr('data-addressId') + mui.ajax(hyhUrl('app/Useraddress/setDefault'), { + data: { + id: addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + location.reload() + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) }) diff --git a/static/app2/js/setting_fogetPayPwd.js b/static/app2/js/setting_fogetPayPwd.js old mode 100755 new mode 100644 index 60b7b5e..68532da --- a/static/app2/js/setting_fogetPayPwd.js +++ b/static/app2/js/setting_fogetPayPwd.js @@ -1,200 +1,200 @@ $('#newPass').attr('type','text'); -$('#newPass2').attr('type','text'); - -mui.plusReady(function() { - var token = localStorage.getItem('token'); - var wait = 120; - - function time() { - - if(wait == 0) { - $('#mobileCode').removeAttr("disabled"); - $('#mobileCode').val("重新发送"); - wait = 120; - } else { - $('#mobileCode').attr("disabled", true); - $('#mobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time(); - }, - 1000) - } - - } - - mui.ajax(hyhUrl('app/users/backPayPass'), {  - headers: {  - "HYH-Token": token - }, - data: {}, - dataType: 'json', //服务器返回json格式数据   - type: 'post', //HTTP请求类型   - timeout: 10000, //超时时间设置为10秒;   - success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   - var data = toJson(data); - if(data.status == 1) { - data = data.data; - if(data.userPhone) { - $('#userPhone').val(data.userPhone); - $('#userPhone').attr('disabled', 'disabled'); - } else { - alert('未绑定手机请先绑定手机!'); - mui.openWindow({ - url: 'setting_phone.html', - id: 'setting_phone.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - } - } else { - alert(data.msg); - } - - }, - error: function(xhr, type, errorThrown) {           //异常处理;   - // alert(type);       - }   - });  - mui('.row').on('tap', '#mobileCode', function() { - var that = $(this); - - $(this).attr("disabled", true); - mui.ajax(hyhUrl('app/users/backpayCode'), {  - - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - var data = toJson(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if(data.status == 1) { - time(); - } else { - alert(data.msg) - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // alert(type) - // alert(type);       - } - });  - }) - mui('.down').on('tap', '#true', function() { - var phoneCode = $('#phoneCode').val(); - var that = $(this); - if(phoneCode == '') { - alert('验证码不能为空!'); - return; - } else if(phoneCode.length < 4) { - alert('验证码格式不正确!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/users/verifybackPay'), {  - headers: {  - "HYH-Token": token - }, - data: { - phoneCode: phoneCode - }, - dataType: 'json', //服务器返回json格式数据   - type: 'post', //HTTP请求类型   - timeout: 10000, //超时时间设置为10秒;   - success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   - // console.log(data.data.goodsFavoritesNum) - // console.log(data.data.Rows) - var data = toJson(data); - if(data.status == 1) { - $('#con1').css('display', 'none'); - $('#down1').css('display', 'none'); - $('#con2').css('display', 'block'); - $('#down2').css('display', 'block'); - } else { - alert(data.msg); - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) {           //异常处理;   - // alert(type);       - }   - });  - - }) - mui('.down').on('tap', '#true2', function() { - var newPass = $('#newPass').val(); - var newPass2 = $('#newPass2').val(); - var that = $(this); - if(newPass == '') { - alert('支付密码不能为空!'); - return; - } else if(newPass.length != 6) { - alert('支付密码为6位!'); - return; - } else if(newPass != newPass2) { - alert('两次支付密码不相同!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/users/resetbackPay'), {  - headers: {  - "HYH-Token": token - }, - data: { - newPass: newPass - }, - dataType: 'json', //服务器返回json格式数据   - type: 'post', //HTTP请求类型   - timeout: 10000, //超时时间设置为10秒;   - success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   - // console.log(data.data.goodsFavoritesNum) - // console.log(data.data.Rows) - var data = toJson(data); - if(data.status == 1) { - alert(data.msg); - mui.back(); - } else { - alert(data.msg); - } - that.removeAttr('disabled') - }, - error: function(xhr, type, errorThrown) {           //异常处理;   - // alert(type);       - }   - });  - - }) - +$('#newPass2').attr('type','text'); + +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var wait = 120; + + function time() { + + if(wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time(); + }, + 1000) + } + + } + + mui.ajax(hyhUrl('app/users/backPayPass'), {  + headers: {  + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据   + type: 'post', //HTTP请求类型   + timeout: 10000, //超时时间设置为10秒;   + success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   + var data = toJson(data); + if(data.status == 1) { + data = data.data; + if(data.userPhone) { + $('#userPhone').val(data.userPhone); + $('#userPhone').attr('disabled', 'disabled'); + } else { + alert('未绑定手机请先绑定手机!'); + mui.openWindow({ + url: 'setting_phone.html', + id: 'setting_phone.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + } else { + alert(data.msg); + } + + }, + error: function(xhr, type, errorThrown) {           //异常处理;   + // alert(type);       + }   + });  + mui('.row').on('tap', '#mobileCode', function() { + var that = $(this); + + $(this).attr("disabled", true); + mui.ajax(hyhUrl('app/users/backpayCode'), {  + + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + var data = toJson(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if(data.status == 1) { + time(); + } else { + alert(data.msg) + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // alert(type) + // alert(type);       + } + });  + }) + mui('.down').on('tap', '#true', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if(phoneCode == '') { + alert('验证码不能为空!'); + return; + } else if(phoneCode.length < 4) { + alert('验证码格式不正确!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/users/verifybackPay'), {  + headers: {  + "HYH-Token": token + }, + data: { + phoneCode: phoneCode + }, + dataType: 'json', //服务器返回json格式数据   + type: 'post', //HTTP请求类型   + timeout: 10000, //超时时间设置为10秒;   + success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   + // console.log(data.data.goodsFavoritesNum) + // console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + $('#con1').css('display', 'none'); + $('#down1').css('display', 'none'); + $('#con2').css('display', 'block'); + $('#down2').css('display', 'block'); + } else { + alert(data.msg); + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) {           //异常处理;   + // alert(type);       + }   + });  + + }) + mui('.down').on('tap', '#true2', function() { + var newPass = $('#newPass').val(); + var newPass2 = $('#newPass2').val(); + var that = $(this); + if(newPass == '') { + alert('支付密码不能为空!'); + return; + } else if(newPass.length != 6) { + alert('支付密码为6位!'); + return; + } else if(newPass != newPass2) { + alert('两次支付密码不相同!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/users/resetbackPay'), {  + headers: {  + "HYH-Token": token + }, + data: { + newPass: newPass + }, + dataType: 'json', //服务器返回json格式数据   + type: 'post', //HTTP请求类型   + timeout: 10000, //超时时间设置为10秒;   + success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;   + // console.log(data.data.goodsFavoritesNum) + // console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + alert(data.msg); + mui.back(); + } else { + alert(data.msg); + } + that.removeAttr('disabled') + }, + error: function(xhr, type, errorThrown) {           //异常处理;   + // alert(type);       + }   + });  + + }) + }) \ No newline at end of file diff --git a/static/app2/js/setting_fogetPwd.js b/static/app2/js/setting_fogetPwd.js old mode 100755 new mode 100644 index e243908..78e19bc --- a/static/app2/js/setting_fogetPwd.js +++ b/static/app2/js/setting_fogetPwd.js @@ -1,208 +1,208 @@ -mui.plusReady(function() { - var wait = 120; - - function time() { - - if (wait == 0) { - $('#mobileCode').removeAttr("disabled"); - $('#mobileCode').val("重新发送"); - wait = 120; - } else { - $('#mobileCode').attr("disabled", true); - $('#mobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time(); - }, - 1000) - } - - } - - mui('.row').on('tap', '#mobileCode', function() { - var that = $(this); - - $(this).attr("disabled", true); - mui.ajax(qlgUrl('app/users/getfindPhone'), { - - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - var data = toJson(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - time(); - } else { - mui.alert(data.msg) - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type) - // mui.alert(type); - } - }); - }) - mui('.down').on('tap', '#true0', function() { - var loginName0 = $('#loginName0').val(); - var that = $(this); - if (loginName0 == '') { - mui.alert('用户名不能为空!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/findPass'), { - - data: { - loginName: loginName0, - step: 1 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - $('#con0').css('display', 'none'); - $('#down0').css('display', 'none'); - $('#con1').css('display', 'block'); - $('#down1').css('display', 'block'); - mui.ajax(hyhUrl('app/users/forgetPasst'), { - - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - $('#loginName').val(data.data.loginName); - $('#loginName').attr('disabled', 'disabled'); - $('#userPhone').val(data.data.userPhone); - $('#userPhone').attr('disabled', 'disabled'); - - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - mui('.down').on('tap', '#true', function() { - var phoneCode = $('#phoneCode').val(); - var that = $(this); - if (phoneCode == '') { - mui.alert('验证码不能为空!'); - return; - } else if (phoneCode.length < 4) { - mui.alert('验证码格式不正确!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/findPass'), { - data: { - Checkcode: phoneCode, - modes: 1, - step: 2 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - ////console.log(data); - //alert(1) - document.getElementById("con1").style.display = "none"; - document.getElementById("down1").style.display = "none"; - document.getElementById("con2").style.display = "block"; - document.getElementById("down2").style.display = "block"; - - //$('#con1').css('display', 'none'); - //$('#down1').css('display', 'none'); - //$('#con2').css('display', 'block'); - //$('#down2').css('display', 'block'); - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) { //异常处理; - mui.alert(type); - } - }); - - }) - mui('.down').on('tap', '#true2', function() { - var loginPwd = $('#loginPwd').val(); - var repassword = $('#repassword').val(); - var that = $(this); - if (loginPwd == '') { - mui.alert('登录密码不能为空!'); - return; - } else if (loginPwd.length < 6) { - mui.alert('登录密码最少为6位!'); - return; - } else if (loginPwd != repassword) { - mui.alert('两次支付密码不相同!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/findPass'), { - data: { - step: 3, - loginPwd: loginPwd, - repassword: repassword - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - mui.alert(data.msg); - mui.back(); - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - +mui.plusReady(function() { + var wait = 120; + + function time() { + + if (wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time(); + }, + 1000) + } + + } + + mui('.row').on('tap', '#mobileCode', function() { + var that = $(this); + + $(this).attr("disabled", true); + mui.ajax(qlgUrl('app/users/getfindPhone'), { + + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + var data = toJson(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + time(); + } else { + mui.alert(data.msg) + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type) + // mui.alert(type); + } + }); + }) + mui('.down').on('tap', '#true0', function() { + var loginName0 = $('#loginName0').val(); + var that = $(this); + if (loginName0 == '') { + mui.alert('用户名不能为空!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/findPass'), { + + data: { + loginName: loginName0, + step: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + $('#con0').css('display', 'none'); + $('#down0').css('display', 'none'); + $('#con1').css('display', 'block'); + $('#down1').css('display', 'block'); + mui.ajax(hyhUrl('app/users/forgetPasst'), { + + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + $('#loginName').val(data.data.loginName); + $('#loginName').attr('disabled', 'disabled'); + $('#userPhone').val(data.data.userPhone); + $('#userPhone').attr('disabled', 'disabled'); + + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + mui('.down').on('tap', '#true', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if (phoneCode == '') { + mui.alert('验证码不能为空!'); + return; + } else if (phoneCode.length < 4) { + mui.alert('验证码格式不正确!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/findPass'), { + data: { + Checkcode: phoneCode, + modes: 1, + step: 2 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + ////console.log(data); + //alert(1) + document.getElementById("con1").style.display = "none"; + document.getElementById("down1").style.display = "none"; + document.getElementById("con2").style.display = "block"; + document.getElementById("down2").style.display = "block"; + + //$('#con1').css('display', 'none'); + //$('#down1').css('display', 'none'); + //$('#con2').css('display', 'block'); + //$('#down2').css('display', 'block'); + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + mui.alert(type); + } + }); + + }) + mui('.down').on('tap', '#true2', function() { + var loginPwd = $('#loginPwd').val(); + var repassword = $('#repassword').val(); + var that = $(this); + if (loginPwd == '') { + mui.alert('登录密码不能为空!'); + return; + } else if (loginPwd.length < 6) { + mui.alert('登录密码最少为6位!'); + return; + } else if (loginPwd != repassword) { + mui.alert('两次支付密码不相同!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/findPass'), { + data: { + step: 3, + loginPwd: loginPwd, + repassword: repassword + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + mui.alert(data.msg); + mui.back(); + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + }) diff --git a/static/app2/js/setting_loginInfo.js b/static/app2/js/setting_loginInfo.js old mode 100755 new mode 100644 index 76fcf0a..2e7a688 --- a/static/app2/js/setting_loginInfo.js +++ b/static/app2/js/setting_loginInfo.js @@ -1,34 +1,34 @@ -mui('.block').on('tap', '.row', function() { - var url = $(this).attr('id'); - mui.openWindow({ - url: url + '.html', - id: url + '.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) +mui('.block').on('tap', '.row', function() { + var url = $(this).attr('id'); + mui.openWindow({ + url: url + '.html', + id: url + '.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) }) \ No newline at end of file diff --git a/static/app2/js/setting_payPwd.js b/static/app2/js/setting_payPwd.js old mode 100755 new mode 100644 index 4d9220b..29af7f3 --- a/static/app2/js/setting_payPwd.js +++ b/static/app2/js/setting_payPwd.js @@ -1,58 +1,58 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - - mui('.down').on('tap', '#true', function() { - var that = $(this) - var oldPass = $('#oldPass').val(); - var newPass = $('#newPass').val(); - var newPass2 = $('#newPass2').val(); - - if (oldPass == '') { - mui.alert('原支付密码不能为空!'); - return; - } - if (newPass == '') { - mui.alert('新支付密码不能为空!'); - return; - } - if (newPass.length != 6) { - mui.alert('新支付密码长度为6位!'); - return; - } - if (!(newPass == newPass2)) { - mui.alert('两次支付密码不一致!'); - return; - } - - $(this).attr("disabled", true); - mui.ajax(qlgUrl('app/users/editpayPwd'), { - - data: { - oldPass: oldPass, - newPass: newPass, - reNewPass: newPass2 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - var data = toJson(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - mui.alert(data.msg); - mui.back(); - - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type) - } - }); - }) - +mui.plusReady(function() { + var token = localStorage.getItem('token'); + + mui('.down').on('tap', '#true', function() { + var that = $(this) + var oldPass = $('#oldPass').val(); + var newPass = $('#newPass').val(); + var newPass2 = $('#newPass2').val(); + + if (oldPass == '') { + mui.alert('原支付密码不能为空!'); + return; + } + if (newPass == '') { + mui.alert('新支付密码不能为空!'); + return; + } + if (newPass.length != 6) { + mui.alert('新支付密码长度为6位!'); + return; + } + if (!(newPass == newPass2)) { + mui.alert('两次支付密码不一致!'); + return; + } + + $(this).attr("disabled", true); + mui.ajax(qlgUrl('app/users/editpayPwd'), { + + data: { + oldPass: oldPass, + newPass: newPass, + reNewPass: newPass2 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + var data = toJson(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + mui.alert(data.msg); + mui.back(); + + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type) + } + }); + }) + }) diff --git a/static/app2/js/setting_phone.js b/static/app2/js/setting_phone.js old mode 100755 new mode 100644 index a77d2e8..b5d5cf7 --- a/static/app2/js/setting_phone.js +++ b/static/app2/js/setting_phone.js @@ -1,258 +1,258 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - var isBang = 0; - var isOver = 1; - var wait = 120; - var wait1 = 120; - - function time() { - - if (wait == 0) { - $('#mobileCode').removeAttr("disabled"); - $('#mobileCode').val("重新发送"); - wait = 120; - } else { - $('#mobileCode').attr("disabled", true); - $('#mobileCode').val("重新发送(" + wait + ")"); - wait--; - setTimeout(function() { - time(); - }, - 1000) - } - - } - - function time1() { - - if (wait1 == 0) { - $('#mobileCode1').removeAttr("disabled"); - $('#mobileCode1').val("重新发送"); - wait1 = 120; - } else { - $('#mobileCode1').attr("disabled", true); - $('#mobileCode1').val("重新发送(" + wait1 + ")"); - wait1--; - setTimeout(function() { - time1(); - }, - 1000) - } - - } - mui.ajax(qlgUrl('app/users/editPhone'), { - headers: { - "HYH-Token": token - }, - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data); - if (data.status == 1) { - data = data.data; - - if (data.userPhone) { - isBang = 1; - $('#userPhone').val(data.userPhone); - $('#userPhone').attr('disabled', 'disabled'); - $('#next_btn').css('display', 'block'); - } else { - $('#true').css('display', 'block'); - } - } else { - mui.alert(data.msg); - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - mui('.row').on('tap', '.codeBtn', function() { - var that = $(this) - var userPhone = $('#userPhone').val(); - var url = $(this).attr('id') == 'mobileCode' ? 'sendCodeEdit' : 'sendCodeTie' - if (isBang == 0 || isOver == 0) { - if (userPhone == '') { - mui.alert('手机号不能为空!'); - return; - - } - if (!( - /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ - .test(userPhone))) { - mui.alert("手机号码有误,请重填!"); - return; - } - } else { - userPhone = ''; - } - - $(this).attr("disabled", true); - mui.ajax(qlgUrl('app/users/' + url), { - - data: { - userPhone: userPhone - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - var data = toJson(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - - if (that.attr('id') == 'mobileCode') { - time(); - } else if (that.attr('id') == 'mobileCode1') { - time1(); - } - - } else { - mui.alert(data.msg) - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type) - // mui.alert(type); - } - }); - }) - //未绑定手机 - mui('.down').on('tap', '#true', function() { - var phoneCode = $('#phoneCode').val(); - var that = $(this); - if (phoneCode == '') { - mui.alert('验证码不能为空!'); - return; - } else if (phoneCode.length < 4) { - mui.alert('验证码格式不正确!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/phoneEdit'), { - headers: { - "HYH-Token": token - }, - data: { - phoneCode: phoneCode - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - mui.alert(data.msg); - mui.back(); - - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled') - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - //已绑定手机 1 - mui('.down').on('tap', '#next_btn', function() { - var phoneCode = $('#phoneCode').val(); - var that = $(this); - if (phoneCode == '') { - mui.alert('验证码不能为空!'); - return; - } else if (phoneCode.length < 4) { - mui.alert('验证码格式不正确!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/phoneEdito'), { - headers: { - "HYH-Token": token - }, - data: { - phoneCode: phoneCode - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - $('#next_btn').css('display', 'none'); - $('#next_true').css('display', 'block'); - $('#userPhone').removeAttr('disabled'); - $('#userPhone').val(''); - $('#phoneCode').val(''); - $('#mobileCode').css('display', 'none'); - $('#mobileCode1').css('display', 'block'); - isOver = 0; - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - //已绑定手机 2 - mui('.down').on('tap', '#next_true', function() { - var phoneCode = $('#phoneCode').val(); - var that = $(this); - if (phoneCode == '') { - mui.alert('验证码不能为空!'); - return; - } else if (phoneCode.length < 4) { - mui.alert('验证码格式不正确!'); - return; - } - - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/users/phoneEdit'), { - headers: { - "HYH-Token": token - }, - data: { - phoneCode: phoneCode - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - mui.alert(data.msg); - mui.back(); - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var isBang = 0; + var isOver = 1; + var wait = 120; + var wait1 = 120; + + function time() { + + if (wait == 0) { + $('#mobileCode').removeAttr("disabled"); + $('#mobileCode').val("重新发送"); + wait = 120; + } else { + $('#mobileCode').attr("disabled", true); + $('#mobileCode').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time(); + }, + 1000) + } + + } + + function time1() { + + if (wait1 == 0) { + $('#mobileCode1').removeAttr("disabled"); + $('#mobileCode1').val("重新发送"); + wait1 = 120; + } else { + $('#mobileCode1').attr("disabled", true); + $('#mobileCode1').val("重新发送(" + wait1 + ")"); + wait1--; + setTimeout(function() { + time1(); + }, + 1000) + } + + } + mui.ajax(qlgUrl('app/users/editPhone'), { + headers: { + "HYH-Token": token + }, + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + data = data.data; + + if (data.userPhone) { + isBang = 1; + $('#userPhone').val(data.userPhone); + $('#userPhone').attr('disabled', 'disabled'); + $('#next_btn').css('display', 'block'); + } else { + $('#true').css('display', 'block'); + } + } else { + mui.alert(data.msg); + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + mui('.row').on('tap', '.codeBtn', function() { + var that = $(this) + var userPhone = $('#userPhone').val(); + var url = $(this).attr('id') == 'mobileCode' ? 'sendCodeEdit' : 'sendCodeTie' + if (isBang == 0 || isOver == 0) { + if (userPhone == '') { + mui.alert('手机号不能为空!'); + return; + + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + } else { + userPhone = ''; + } + + $(this).attr("disabled", true); + mui.ajax(qlgUrl('app/users/' + url), { + + data: { + userPhone: userPhone + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + var data = toJson(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + + if (that.attr('id') == 'mobileCode') { + time(); + } else if (that.attr('id') == 'mobileCode1') { + time1(); + } + + } else { + mui.alert(data.msg) + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type) + // mui.alert(type); + } + }); + }) + //未绑定手机 + mui('.down').on('tap', '#true', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if (phoneCode == '') { + mui.alert('验证码不能为空!'); + return; + } else if (phoneCode.length < 4) { + mui.alert('验证码格式不正确!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/phoneEdit'), { + headers: { + "HYH-Token": token + }, + data: { + phoneCode: phoneCode + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + mui.alert(data.msg); + mui.back(); + + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + //已绑定手机 1 + mui('.down').on('tap', '#next_btn', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if (phoneCode == '') { + mui.alert('验证码不能为空!'); + return; + } else if (phoneCode.length < 4) { + mui.alert('验证码格式不正确!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/phoneEdito'), { + headers: { + "HYH-Token": token + }, + data: { + phoneCode: phoneCode + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + $('#next_btn').css('display', 'none'); + $('#next_true').css('display', 'block'); + $('#userPhone').removeAttr('disabled'); + $('#userPhone').val(''); + $('#phoneCode').val(''); + $('#mobileCode').css('display', 'none'); + $('#mobileCode1').css('display', 'block'); + isOver = 0; + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + //已绑定手机 2 + mui('.down').on('tap', '#next_true', function() { + var phoneCode = $('#phoneCode').val(); + var that = $(this); + if (phoneCode == '') { + mui.alert('验证码不能为空!'); + return; + } else if (phoneCode.length < 4) { + mui.alert('验证码格式不正确!'); + return; + } + + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/users/phoneEdit'), { + headers: { + "HYH-Token": token + }, + data: { + phoneCode: phoneCode + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + mui.alert(data.msg); + mui.back(); + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + }) diff --git a/static/app2/js/setting_pwd.js b/static/app2/js/setting_pwd.js old mode 100755 new mode 100644 index 2569bd1..0395d59 --- a/static/app2/js/setting_pwd.js +++ b/static/app2/js/setting_pwd.js @@ -1,60 +1,60 @@ -mui.plusReady(function() { - var token = localStorage.getItem('token'); - - mui('.down').on('tap', '#true', function() { - var that = $(this) - var oldPass = $('#oldPass').val(); - var newPass = $('#newPass').val(); - var newPass2 = $('#newPass2').val(); - - if(oldPass == '') { - mui.alert('原支付密码不能为空!'); - return; - } - if(newPass == '') { - mui.alert('新支付密码不能为空!'); - return; - } - if(newPass.length < 6) { - mui.alert('新支付密码不能小于6位!'); - return; - } - if(!(newPass == newPass2)) { - mui.alert('两次支付密码不一致!'); - return; - } - - $(this).attr("disabled", true); - mui.ajax(qlgUrl('app/users/editloginPwd'), { - - data: { - oldPass: oldPass, - newPass: newPass - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒 - success: function(data) { - var data = toJson(data); - //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data.status) - if(data.status == 1) { - - mui.alert(data.msg); - mui.back(); - - } else { - mui.alert(data.msg); - } - that.removeAttr('disabled'); - }, - - error: function(xhr, type, errorThrown) { - //异常处理; - // mui.alert(type) - // mui.alert(type); - } - }); - }) - +mui.plusReady(function() { + var token = localStorage.getItem('token'); + + mui('.down').on('tap', '#true', function() { + var that = $(this) + var oldPass = $('#oldPass').val(); + var newPass = $('#newPass').val(); + var newPass2 = $('#newPass2').val(); + + if(oldPass == '') { + mui.alert('原支付密码不能为空!'); + return; + } + if(newPass == '') { + mui.alert('新支付密码不能为空!'); + return; + } + if(newPass.length < 6) { + mui.alert('新支付密码不能小于6位!'); + return; + } + if(!(newPass == newPass2)) { + mui.alert('两次支付密码不一致!'); + return; + } + + $(this).attr("disabled", true); + mui.ajax(qlgUrl('app/users/editloginPwd'), { + + data: { + oldPass: oldPass, + newPass: newPass + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒 + success: function(data) { + var data = toJson(data); + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data.status) + if(data.status == 1) { + + mui.alert(data.msg); + mui.back(); + + } else { + mui.alert(data.msg); + } + that.removeAttr('disabled'); + }, + + error: function(xhr, type, errorThrown) { + //异常处理; + // mui.alert(type) + // mui.alert(type); + } + }); + }) + }) \ No newline at end of file diff --git a/static/app2/js/setting_recive.js b/static/app2/js/setting_recive.js new file mode 100644 index 0000000..49ef140 --- /dev/null +++ b/static/app2/js/setting_recive.js @@ -0,0 +1,32 @@ +mui.plusReady(function(){ + + // TODO: some ajax + document.getElementById("realname").value = ''; + document.getElementById("bank_name").value = ''; + document.getElementById("bank_no").value = ''; + document.getElementById("alipay_recive").value = ''; + document.getElementById("wechat_recive").value = ''; + + $(".photos").on("tap", 'img', function() { + var _input = $(this).parent().parent().parent().prev()[0]; + UP.init(_input.id, "test", this.id) + openCamera() + }) + + mui(".down").on("tap", "#true", function(){ + var realname = document.getElementById("realname").value; + var bankName = document.getElementById("bank_name").value; + var bankNo = document.getElementById("bank_no").value; + var alipayRecive = document.getElementById("alipay_recive").value; + var wechatRecive = document.getElementById("wechat_recive").value; + + var data = { + realname, + bankName, + bankNo, + alipayRecive, + wechatRecive, + } + console.log(data) + }) +}) \ No newline at end of file diff --git a/static/app2/js/setting_user.js b/static/app2/js/setting_user.js old mode 100755 new mode 100644 index 0a0dd05..8b0f102 --- a/static/app2/js/setting_user.js +++ b/static/app2/js/setting_user.js @@ -1,39 +1,39 @@ -$('.header_con .title').html('个人信息'); - -$('.block').addClass('scroll_out_t') - -mui('.block').on('tap', '.row', function() { - var url = $(this).attr('id'); - //console.log($(this)); - mui.openWindow({ - url: url + '.html', - id: url + '.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_href: data_href - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) +$('.header_con .title').html('个人信息'); + +$('.block').addClass('scroll_out_t') + +mui('.block').on('tap', '.row', function() { + var url = $(this).attr('id'); + //console.log($(this)); + mui.openWindow({ + url: url + '.html', + id: url + '.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) }) \ No newline at end of file diff --git a/static/app2/js/shangdu.js b/static/app2/js/shangdu.js old mode 100755 new mode 100644 index c574e3d..97327f6 --- a/static/app2/js/shangdu.js +++ b/static/app2/js/shangdu.js @@ -1,225 +1,226 @@ -mui.plusReady(function() { - // 获取申请信息 - var self = plus.webview.currentWebview(); - //console.log(self); - var id = self.ssid ? self.ssid : ''; - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 4 - }, function(data) { - //console.log(data); - if (1 == data.status & undefined != data.data) { - var data = data.data; - - if (0 == data.status || 2 == data.status) { - if (id == '') { - id = data.id - } - - getShopList(data.shopId); - - $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) - $('#confirmImg').val(data.confirmImg) - - var imgs = data.shopImg - imgs = Array.from(imgs.split(',')) - //console.log(imgs); - var html = ""; - mui.each(imgs, function(index, element) { - //console.log(index, element); - html += '
      '; - }) - // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - var maxNum = imgs.length - 1; - // //console.log(maxNum); - // //console.log(num); - // if (num == maxNum) { - maxNum++; - html += '
      '; - $(".batchImg").html(html); - // } - - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 117 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - - } else if (1 == data.status) { - //tiaozhuandao shangdu yemian - } - } else { - getShopList(); - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 117 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - } - }) - - - - - - - // 上传图片 - $('.photos_con').on('tap', '.confirm', function() { - UP.init("confirmImg", "test", "confirm") - openCamera() - }) - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - - that.html(html); - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - //删除照片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - // //console.log(this); - var that = $(this) - //var idx = that.parent().attr('data-id'); - //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; - } - }) - - // 获取店铺信息 - function getShopList(defaultShopId) { - - JZL.ajax(qlgUrl('app/shops/userShopList'), { - shopType: 1 - }, function(data) { - //console.log(data); - if (1 == data.status) { - var html = ""; - html = ``; - if (undefined == typeof defaultShop) { - - mui.each(data.data, function() { - // //console.log(index, element); - html += ``; - }) - } else { - mui.each(data.data, function() { - if (this.shopId == defaultShopId) { - selected = 'selected'; - } else { - selected = ''; - } - html += ``; - }) - - } - $("#shopId").html(html) - } else { - mui.alert(data.msg) - } - // }) - }) - - - } - - - - - - let click = 0 - $('.down').on('tap', '.btn', function() { - - if (click == 1) { - return; - } - click = 1 - var imgs = ''; - var data = $('input[name="gallery[]"]'); - //console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - }) - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - $('#shopImg').val(imgs); - if ('' == $('#shopId option:selected').val()) { - mui.alert('请选择要升级的店铺名称') - return; - } - - if ('' == $('#confirmImg').val()) { - mui.alert('请上传确认书照片') - return; - } - if ('' == $('#shopImg').val()) { - mui.alert('请上传店铺照片') - return; - } - - - var params = JZL.getParams(".inp"); - - // var shopId=$("#chooseshop option:selected").val() - // //console.log(shopId); - // params.shopId=shopId; - params.applyLevel = 4; - if ("" != id) { - params.id = id; - - } - JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { - //console.log(data); - if (1 == data.status) { - mui.back() - } else { - mui.alert(data.msg) - } - }) - }) - - - - +from_id = 1 +mui.plusReady(function() { + // 获取申请信息 + var self = plus.webview.currentWebview(); + //console.log(self); + var id = self.ssid ? self.ssid : ''; + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 4 + }, function(data) { + //console.log(data); + if (1 == data.status & undefined != data.data) { + var data = data.data; + + if (0 == data.status || 2 == data.status) { + if (id == '') { + id = data.id + } + + getShopList(data.shopId); + + $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) + $('#confirmImg').val(data.confirmImg) + + var imgs = data.shopImg + imgs = Array.from(imgs.split(',')) + //console.log(imgs); + var html = ""; + mui.each(imgs, function(index, element) { + //console.log(index, element); + html += '
      '; + }) + // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + var maxNum = imgs.length - 1; + // //console.log(maxNum); + // //console.log(num); + // if (num == maxNum) { + maxNum++; + html += '
      '; + $(".batchImg").html(html); + // } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 117 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + + } else if (1 == data.status) { + //tiaozhuandao shangdu yemian + } + } else { + getShopList(); + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 117 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + } + }) + + + + + + + // 上传图片 + $('.photos_con').on('tap', '.confirm', function() { + UP.init("confirmImg", "test", "confirm") + openCamera() + }) + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + that.html(html); + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + //删除照片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // //console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + + // 获取店铺信息 + function getShopList(defaultShopId) { + + JZL.ajax(qlgUrl('app/shops/userShopList'), { + shopType: 1 + }, function(data) { + //console.log(data); + if (1 == data.status) { + var html = ""; + html = ``; + if (undefined == typeof defaultShop) { + + mui.each(data.data, function() { + // //console.log(index, element); + html += ``; + }) + } else { + mui.each(data.data, function() { + if (this.shopId == defaultShopId) { + selected = 'selected'; + } else { + selected = ''; + } + html += ``; + }) + + } + $("#shopId").html(html) + } else { + mui.alert(data.msg) + } + // }) + }) + + + } + + + + + + let click = 0 + $('.down').on('tap', '.btn', function() { + + if (click == 1) { + return; + } + click = 1 + var imgs = ''; + var data = $('input[name="gallery[]"]'); + //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + }) + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + $('#shopImg').val(imgs); + if ('' == $('#shopId option:selected').val()) { + mui.alert('请选择要升级的店铺名称') + return; + } + + if ('' == $('#confirmImg').val()) { + mui.alert('请上传确认书照片') + return; + } + if ('' == $('#shopImg').val()) { + mui.alert('请上传店铺照片') + return; + } + + + var params = JZL.getParams(".inp"); + + // var shopId=$("#chooseshop option:selected").val() + // //console.log(shopId); + // params.shopId=shopId; + params.applyLevel = 4; + if ("" != id) { + params.id = id; + + } + JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { + //console.log(data); + if (1 == data.status) { + mui.back() + } else { + mui.alert(data.msg) + } + }) + }) + + + + }) diff --git a/static/app2/js/shop_decorate.js b/static/app2/js/shop_decorate.js old mode 100755 new mode 100644 index 5ce4dd9..aca419c --- a/static/app2/js/shop_decorate.js +++ b/static/app2/js/shop_decorate.js @@ -1,126 +1,126 @@ -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId = self.id; - //获取店铺相册 - JZL.ajax(qlgUrl('app/shops/getShopImg'), { - shopId: shopId - }, function(data) { - //console.log(data); - if (1 == data.status && '' != data.data.shopImg) { - $('#shop').attr('src', hyhImgUrl(data.data.shopImg)) - $('#shopImg').val(data.data.shopImg) - if ('' != data.data.shopAds) { - var shopAds = data.data.shopAds; - - ads = shopAds.split(",") - //console.log(ads); - var html = ''; - mui.each(ads, function(index, element) { - //console.log(element); - html += '
      ' - }) - var maxNum = ads.length; - html += '
      '; - $('.batchImg').html(html) - - } - - } else { - mui.alert(data.msg) - } - }) - - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - - that.html(html); - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - - - $(".oneImg").on("tap", '#shop', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("shopImg", "test", "shop") - openCamera() - }) - // 删除图片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - // //console.log(this); - var that = $(this) - //var idx = that.parent().attr('data-id'); - //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; - } - }) - // 提交 - var click = false; - $('.bc_btn').on('tap', function() { - if (click == true) { - return - } - - var imgs = ''; - var data = $('input[name="gallery[]"]'); - // //console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - - }) - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - $('#shopAds').val(imgs); - if ($.trim($('#shopImg').val()) == '') { - mui.alert("请上传店铺主图") - return - } - if ($.trim($('#shopAds').val()) == '') { - mui.alert("请上传店铺图片") - return - } - var params = JZL.getParams(".inp"); - params.shopId = shopId; - click == true; - JZL.ajax(qlgUrl('app/shops/uploadShopImg'), params, function(data) { - if (data.status == 1) { - mui.toast('保存成功'); - mui.back(); - } else { - mui.alert(data.msg); - } - }) - }) - - - +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + //获取店铺相册 + JZL.ajax(qlgUrl('app/shops/getShopImg'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status && '' != data.data.shopImg) { + $('#shop').attr('src', hyhImgUrl(data.data.shopImg)) + $('#shopImg').val(data.data.shopImg) + if ('' != data.data.shopAds) { + var shopAds = data.data.shopAds; + + ads = shopAds.split(",") + //console.log(ads); + var html = ''; + mui.each(ads, function(index, element) { + //console.log(element); + html += '
      ' + }) + var maxNum = ads.length; + html += '
      '; + $('.batchImg').html(html) + + } + + } else { + mui.alert(data.msg) + } + }) + + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + that.html(html); + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + + + $(".oneImg").on("tap", '#shop', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("shopImg", "test", "shop") + openCamera() + }) + // 删除图片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // //console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + // 提交 + var click = false; + $('.bc_btn').on('tap', function() { + if (click == true) { + return + } + + var imgs = ''; + var data = $('input[name="gallery[]"]'); + // //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + $('#shopAds').val(imgs); + if ($.trim($('#shopImg').val()) == '') { + mui.alert("请上传店铺主图") + return + } + if ($.trim($('#shopAds').val()) == '') { + mui.alert("请上传店铺图片") + return + } + var params = JZL.getParams(".inp"); + params.shopId = shopId; + click == true; + JZL.ajax(qlgUrl('app/shops/uploadShopImg'), params, function(data) { + if (data.status == 1) { + mui.toast('保存成功'); + mui.back(); + } else { + mui.alert(data.msg); + } + }) + }) + + + }) diff --git a/static/app2/js/shop_indent.js b/static/app2/js/shop_indent.js old mode 100755 new mode 100644 index 6e6a85e..cba2acf --- a/static/app2/js/shop_indent.js +++ b/static/app2/js/shop_indent.js @@ -1,44 +1,44 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } -}) -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId=self.shopId; - var data_href = self.data_href; - if(data_href == 'all') { - $('.title').html('全部订单'); - - } - if(data_href == 'waitPay') { - $('.title').html('待付款'); - } - if(data_href == 'waitDeliver') { - $('.title').html('待发货'); - } - if(data_href == 'waitReceive') { - $('.title').html('待收货'); - } - if(data_href == 'waitConfirm') { - $('.title').html('待确认'); - } - if(data_href == 'abnormal') { - $('.title').html('退款/售后'); - } - localStorage.setItem('shop_order_class', data_href); - var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; - var sub = plus.webview.create('shop_indentcon.html', data_href, { - top: bSize, - bottom: '0px', - scrollIndicator: 'none', - - },{ shopId:shopId}); - self.append(sub); - +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}) +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId=self.shopId; + var data_href = self.data_href; + if(data_href == 'all') { + $('.title').html('全部订单'); + + } + if(data_href == 'waitPay') { + $('.title').html('待付款'); + } + if(data_href == 'waitDeliver') { + $('.title').html('待发货'); + } + if(data_href == 'waitReceive') { + $('.title').html('待收货'); + } + if(data_href == 'waitConfirm') { + $('.title').html('待确认'); + } + if(data_href == 'abnormal') { + $('.title').html('退款/售后'); + } + localStorage.setItem('shop_order_class', data_href); + var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var sub = plus.webview.create('shop_indentcon.html', data_href, { + top: bSize, + bottom: '0px', + scrollIndicator: 'none', + + },{ shopId:shopId}); + self.append(sub); + }) \ No newline at end of file diff --git a/static/app2/js/shop_indentcon.js b/static/app2/js/shop_indentcon.js old mode 100755 new mode 100644 index eeafb1e..393abff --- a/static/app2/js/shop_indentcon.js +++ b/static/app2/js/shop_indentcon.js @@ -1,831 +1,831 @@ -$('#content').after('
      '); -var pay_name = 0; -var token = localStorage.getItem('token'); -var order_class = localStorage.getItem('shop_order_class'); -var orderNo; -var orderId; -var getReasonUrl = ''; -var priceT = 0; -var payCode = ''; -var shopId = ''; -var wxChannel = null; // 微信支付 -var aliChannel = null; // 支付宝支付 -var channel = null; //支付通道 -mui.init({ - pullRefresh: { - container: '#pullrefresh', - down: { - style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 - color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 - height: '50px', //可选,默认50px.下拉刷新控件的高度, - range: '100px', //可选 默认100px,控件可下拉拖拽的范围 - offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 - // auto: true, //可选,默认false.首次加载自动上拉刷新一次 - contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 - contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 - contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 - contentnomore: '没有更多数据了', - callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; - }, - up: { - contentrefresh: '正在加载...', - callback: pullupRefresh - }, - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - } - } -}); -var count = 1; - -function pullupRefresh() { - count += 1; - getData(count); - mui('#pullrefresh').pullRefresh().endPullupToRefresh(); -} -// //console.log(order_class); -/** - * 下拉刷新具体业务实现 - */ -function pulldownRefresh() { - setTimeout(function() { - window.location.reload(); - //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed - }, 1500); -} -var isLoad = false; - -function getData(page) { - if (true == isLoad) return; - isLoad = true; - JZL.ajax(qlgUrl('app/Shoporders/getSellerOrderList'), { - type: order_class, - shopId: shopId, - page: page, - pagesize: 10 - }, function(data) { - //console.log(data); - var data = toJson(data); - var html = '', - html1 = ""; - if (1 == data.status) { - // console.log(data); - if ('' == data.data.Rows) { - mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); - return; - } - $.each(data.data.Rows, function() { - //this.pay_name = 1; - var shopConfirmHtml = ''; - // console.log(this.orderStatus); - // if ( == 0) { - // if (0 == this.shopConfirm) { - // shopConfirmHtml = '
      待商家确认
      '; - // } else if (1 == this.shopConfirm) { - // shopConfirmHtml = '
      商家已确认
      '; - // }else if (2 == this.shopConfirm) { - // shopConfirmHtml = '
      商家未收款
      '; - // } - // } - // html += '
      ' + this.shopName + - // '
      ' + - // this.status + '
      ' + shopConfirmHtml + '
      商家电话:'+this.phone+'
      ' - html += '
      订单编号:' + this.orderNo + - '
      ' + this.createTime + - '
      ' - $.each(this.list, function() { - html += '

      ' + this.goodsName + - '

      ' + this.goodsSpecNames + '

      ¥' + this.goodsPrice + - '

      x' + this.goodsNum + - '
      优惠优惠:0.52优惠:0.52
      ' - // html += '

      ' + this.goodsName + '

      ' + this.goodsSpecNames + - // '

      ¥' + this.goodsPrice + '

      ¥' + this.marketPrice + 'x' + - // this.goodsNum + '
      '; - }) - - html += - '
      共' + - this.list.length + '件商品 合计:¥' + this.realTotalMoney + '(含运费¥0.00)
      ' - html += - '' - // html += '
      共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney + - // '(含运费¥' + this.deliverMoney + ')
      '; - if (this.orderStatus == -2) { //未付款 - html += '
      未付款
      ' - // html += '
      立即付款
      取消订单
      '; - } else if (this.orderStatus == -1) { - if (1 == this.isPay) { - if (1 == this.isRefund) { - //yituikuan - // html += '
      已退款
      ' - html += - '
      已退款
      订单已取消
      ' - } else { - //tuikuancaozuoanniu - // html += '
      确认退款
      ' - html += - '
      确认退款
      订单已取消
      ' - - } - } else { - html += '
      订单已取消
      ' - } //0 daiqueren 1 queren 2 jujue - } else if (this.orderStatus == 0) { - if (1 == this.shopConfirm) { - html += '
      确认发货
      ' - } else if (0 == this.shopConfirm) { - html += '
      确认收款
      ' - } else if (2 == this.shopConfirm) { - html += - '
      确认收款
      已拒绝
      ' - - } - - // html +='
      确认发货
      ' - //html += - // '
      确认发货
      确认收款
      ' - } else if (this.orderStatus == 1) { - html += '
      已发货
      配送中
      ' - } else if (this.orderStatus == 2) { - html += - '
      已完成
      提交凭证
      ' - } else if (this.orderStatus == -3) { - // html += '
      用户拒收
      ' - if (1 == this.isPay) { - if (1 == this.isRefund) { - //yituikuan - html += - '
      已退款
      用户拒收
      ' - - } else { - //tuikuancaozuoanniu - // html += '
      确认退款
      ' - html += - '
      确认退款
      用户拒收
      ' - } - } - } - - // if(-1 == this.orderStatus || -3 ==this.orderStatus){ - // if(1 == this.isPay){ - // if(1 == this.isRefund){ - // //yituikuan - // html += '
      已退款
      ' - // - // }else{ - // //tuikuancaozuoanniu - // html += '
      确认退款
      ' - // - // } - // } - // } - html1 = '产品券:' + this.productNum + '优惠券:' + this.couponsNum + '
      旺旺券:' + - this.wangNum + ''; - html += '
      ' - }) - - $('.con').append(html); - $(".rcb").html(html1) - } else { - mui.alert(data.msg) - } - isLoad = false; - }) -} -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - // //console.log(self); - shopId = self.shopId; - getData(count); - // window.addEventListener('refresh', function(e) { //执行刷新 - // location.reload(); - // }); - // //console.log(order_class) - if (order_class == 'all') { - order_class = ''; - - } - // 已付款 店家确认收款 - $('.con').on('tap', '.qrsk', function() { - orderId = $(this).parent().parent().attr('data-id'); - $('.bg').css('display', 'block') - $('#querenshoukuan').css('display', 'block') - }) - $('#querenshoukuan').on('tap', '.pay_btn', function() { - // orderId = $(this).parent().parent().attr('data-id'); - var confirmType = $('#querenshoukuan input[type="radio"]:checked').val(); - //console.log(confirmType,orderId,shopId); - JZL.ajax(qlgUrl('app/Shoporders/orderConfirm'), { - confirmType: confirmType, - shopId: shopId, - id: orderId - }, function(data) { - // console.log(data); - if (1 == data.status) { - $('.bg').css('display', 'none') - $('#querenshoukuan').css('display', 'none') - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload() - - // mui.back(); - } else { - mui.alert(data.msg) - } - }) - }) - // 店家确认退款 - var content = ""; - $('.con').on('tap', '.qrtk', function() { - orderId = $(this).parent().parent().attr('data-id'); - $('.bg').css('display', 'block') - $('#querentuikuan').css('display', 'block') - }) - $('#querentuikuan').on('tap', '.pay_btn', function() { - // orderId = $(this).parent().parent().attr('data-id'); - var confirmType = $('#querentuikuan input[type="radio"]:checked').val(); - content = $("#refuse_con").val() - // console.log(confirmType, orderId, shopId, content, $("#refuse_con")); - if (-1 == confirmType) { - if ('' == $.trim($("#refuse_con").val())) { - mui.alert("请输入拒绝原因") - return - } else {} - } - JZL.ajax(qlgUrl('app/Shoporders/shopRefund'), { - refundStatus: confirmType, - content: content, - shopId: shopId, - id: orderId - }, function(data) { - //console.log(data); - if (1 == data.status) { - $('.bg').css('display', 'none') - $('#querentuikuan').css('display', 'none') - // location.reload(); - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload() - // mui.back(); - } else { - mui.alert(data.msg) - } - - }) - }) - // 已付款 店家发货 - $('.con').on('tap', '.qrfh', function() { - orderId = $(this).parent().parent().attr("data-id") - $('.bg').show(); - $('.delivery').show(); - JZL.ajax(qlgUrl('app/Orders/getExpress'), {}, function(data) { - // //console.log(data); - if (data.status == 1) { - // html = ''; - var html = '' - mui.each(data.data, function(index, element) { - html += '' - }) - $('#expressId').append(html) - } else { - mui.alert(data.msg) - } - }) - - }) - // 选择快递公司名称 - - - - //确认发货 - $('.delivery').on('tap', '.pay_btn', function() { - if (0 == $('#expressId option:selected').val()) { - mui.alert('请选择快递公司名称') - return; - } - if ('' == $('#expressNo').val()) { - mui.alert('请输入快递单号') - return; - } - var pargams = {} - pargams.expressNo = $('#expressNo').val(); - pargams.expressId = $('#expressId').val(); - pargams.id = orderId; - pargams.shopId = shopId; - JZL.ajax(qlgUrl('app/ShopOrders/deliver'), pargams, function(data) { - // console.log(data); - if (1 == data.status) { - // var data = data.data; - mui.toast(data.msg) - $('.delivery').css('display', 'none') - $('.bg').css('display', 'none') - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload() - - } else { - mui.alert(data.msg) - } - - }) - }) - // 返回 - $('.bg').on('tap', '.mui-icon-left-nav', function() { - // $('.pay').css('display', 'block'); - $('.bg').css('display', 'none'); - $('.pay_way').css('display', 'none'); - }) - //提交凭证 - $('.con').on('tap', '.tjpz', function() { - var orderId = $(this).parent().parent().attr("data-id") - JZL.openWindow('shoperUploadVoucher.html', 'shoperUploadVoucher.html', { - orderIds: orderId, - shopId: shopId, - }); - }) - - // 关闭 - $('.bg').on('tap', '.mui-icon-closeempty', function() { - $('.bg').css('display', 'none'); - // $(".pay").slideUp(300, function() { - // - // }); - }) - // - - // $('#pay_way').on('tap', '.row', function() { - // $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); - // $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); - // $('.con_1 .on .row_right o').html($(this).children('.row_left').html()); - // $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode')) - // $('.pay').css('display', 'block'); - // $('#pay_way').css('display', 'none'); - // - // }) - // $('.pay').on('tap', '.con_1 .on', function() { - // if ($(this).attr('data-payCode') == 'ect') { - // - // } else { - // $('.pay').css('display', 'none'); - // $('#pay_way').css('display', 'block'); - // } - // - // }) - // $('.pay_btn').on('tap', function() { - // payCode = $('.con_1 .on').attr('data-payCode'); - // ////console.log(payCode) - // var that = $(this); - // var data_ljfk = { - // isBatch: 0, - // orderNo: orderNo - // } - // that.attr('disabled', 'disabled'); - // mui.ajax(hyhUrl('app/orders/succeed'), { - // data: data_ljfk, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // data = toJson(data); - // - // if (data.status == 1) { - // if (payCode == 'qlgpay') { - // JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { - // orderNo: orderNo, - // isBatch: 0 - // }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // // //console.log(JSON.stringify(data)); - // var data = toJson(data); - // // //console.log(JSON.stringify(data)) - // if (data.status == 1) { - // $('.pay').css('display', 'none'); - // $('#qlg_pay_pwd').css('display', 'block'); - // if (data.data.payPwd == '0') { - // mui.alert('还未设置支付密码请先设置操作密码!'); - // var url = 'setting_fogetPayPwd'; - // JZL.openWindow(url + '.html', url + '.html'); - // //return; - // } - // $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); - // $('#productNum').val(data.data.product.useProduct); - // if (data.data.product.useProduct > 0) { - // var html1 = '

      抵扣额' + data.data.product.useProductOk + - // '

      扣税 ' + data.data.product.useProductTaxFee + - // '

      手续费 ' + data.data.product.useProductHandlingFee + - // '

      '; - // // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + - // // ',手续费:' + data.data.product.useProductHandlingFee + ']'); - // $('.productInfo_').html(html1) - // - // } - // $('#couponsNum').val(data.data.coupons.useCoupons); - // if (data.data.coupons.useCoupons > 0) { - // var html2 = '

      抵扣额' + data.data.coupons.useCouponsOk + - // '

      扣税 ' + data.data.coupons.useCouponsTaxFee + - // '

      手续费 ' + data.data.coupons.useCouponsHandlingFee + - // '

      '; - // $('.couponsInfo_').html(html2) - // // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + - // // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); - // } - // $('#wangNum').val(data.data.wang.useWang); - // $('#moneyNum').val(data.data.money.useMoney); - // - // } else { - // mui.alert(data.msg) - // } - // }); - // } else if (payCode == 'wallets' || payCode == 'ect') { - // //跳输入密码的页面 - // mui.ajax(hyhUrl('app/' + payCode + '/payment'), { - // data: { - // orderNo: orderNo, - // isBatch: 0 - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // // //console.log(data.data.goodsFavoritesNum) - // var data = toJson(data); - // if (data.status == 1) { - // $('.pay').css('display', 'none'); - // $('#pay_pwd').css('display', 'block'); - // if (data.data.payPwd == '0') { - // mui.alert('还未设置支付密码请先设置支付密码!'); - // var url = 'setting_fogetPayPwd'; - // mui.openWindow({ - // url: url + '.html', - // id: url + '.html', - // styles: { - // top: '0px', //新页面顶部位置 - // bottom: '0px', //新页面底部位置 - // width: '100%', //新页面宽度,默认为100% - // height: '100%' //新页面高度,默认为100% - // }, - // extras: { - // // data_href: data_href - // // ..... //自定义扩展参数,可以用来处理页面间传值 - // }, - // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - // show: { - // // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // // extras: {} //窗口动画是否使用图片加速 - // }, - // waiting: { - // autoShow: true, //自动显示等待框,默认为true - // title: '正在加载...', //等待对话框上显示的提示内容 - // options: { - // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // // ...... - // } - // } - // }) - // } - // } - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - // - // } else if (payCode == 'alipays') { - // pay('alipay', orderNo); - // // plus.nativeUI.showWaiting(); - // // mui.post(hyhUrl('app/Alipays/payment'), { - // // orderNo: data.data, - // // isBatch: 1 - // // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); - // - // } - // - // that.removeAttr('disabled'); - // } else { - // mui.alert('发生错误请刷新后重试!'); - // // location.reload(); - // } - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - // } - // }) - // }) - // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { - // var url = 'setting_fogetPayPwd'; - // JZL.openWindow(url + '.html', url + '.html'); - // }) - // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { - // // var self = plus.webview.currentWebview(); - // // var data_href = self.id; - // // //console.log(data_href) - // // JZL.closeWindow('waitPay'); - // //return; - // var payPwd = $('#payPwd').val(); - // if (payPwd == '') { - // mui.alert('支付密码不能为空!'); - // return; - // } - // var that = $(this); - // that.attr('disabled', 'disabled') - // var srcc = '' - // if (payCode == 'qlgpay') { - // srcc = 'payByQlg'; - // } else if (payCode == 'ect') { - // srcc = 'payByEct'; - // } else { - // srcc = 'payByWallet'; - // } - // - // mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { - // - // data: { - // orderNo: orderNo, - // isBatch: 0, - // payPwd: payPwd - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // // //console.log(data.data.goodsFavoritesNum) - // var data = toJson(data); - // mui.alert(data.msg) - // //console.log(data.status) - // if (data.status == 1) { - // JZL.openWindow('indent.html', 'waitDeliver', { - // data_href: 'waitDeliver' - // }); - // setTimeout(function() { - // JZL.closeWindow(plus.webview.currentWebview().id); - // // JZL.closeWindow('indent.html'); - // }, 700) - // // var targetTab = plus.webview.getWebviewById("templete/my.html"); - // // mui.fire(targetTab, 'refresh'); - // // location.reload(); - // } else { - // - // } - // that.removeAttr('disabled') - // - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - // - // }) - - mui('.con').on('tap', '.row_con', function() { - var data_order_id = $(this).attr('data-id'); - mui.openWindow({ - url: 'order_out.html', - id: 'order_out.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_order_id: data_order_id - // data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.con').on('tap', '.ckwl', function() { - var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); - JZL.openWindow('logistics.html', 'logistics.html', { - data_order_id: data_order_id - }); - }) - //上传凭证 - mui('.con').on('tap', '.uploadCertificate', function() { - var orderId = $(this).parent().parent().attr('data-id'); - // mui.alert('跳到上传凭证页' + orderId) - JZL.openWindow("uploadVoucher.html", "uploadVoucher.html", { - orderId: orderId - }) - }) - $('.con').on('tap', '.qxdd_js', function() { - orderNo = $(this).parent().parent().attr('data-orderNo'); - orderId = $(this).parent().parent().attr('data-id'); - if ($(this).html() == '取消订单') { - getReasonUrl = 'getCancelCause'; - } else if ($(this).html() == '拒收') { - getReasonUrl = 'getRejectCause'; - } else if ($(this).html() == '申请退款') { - getReasonUrl = 'getRefundCause'; - JZL.ajax(hyhUrl('/app/Orders/getRefund'), { - id: orderId - }, function(data) { //服务器返回响应 - // //console.log(JSON.stringify(data)); - var data = toJson(data); - if (data.status == 1) { - data = data.data; - var html = ''; - if ('qlgpay' == data.payFrom) { - html = ' 退款产品券数量:' + - ' 退款优惠券数量:' + - ' 退款旺旺券数量:' + - ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + - // '

      (金额不能超过¥' + data.realTotalMoney + - ')

      '; - } else { - html = '

      (金额不能超过¥' + data.realTotalMoney + - ')

      (积分数量:' + data.ectNum + ')

      '; - } - - $('.tui').html(html) - } else { - mui.alert(data.msg) - } - }); - } - $('.bg_').css('display', 'block'); - $('.bg_con').css('display', 'none'); - $('.bg_con').slideDown(300, function() {}); - mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - var html = ''; - $.each(data.data, function() { - html += '' - }); - $('#select').html(html) - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - - $('.bg_').on('tap', '.en_false', function() { - $('.bg_').css('display', 'none'); - - }) - $('.bg_').on('tap', '.en_true', function() { - var setReasonUrl = ''; - var content = $('#content').val(); - var reason = $('#select').val(); - if ($('#select').val() == 0) { - mui.alert('请选择原因!'); - return; - } - if ($('#select').val() == 10000 && content == '') { - mui.alert('请输入其他原因!'); - return; - } - if (getReasonUrl == 'getCancelCause') { - setReasonUrl = 'cancellation'; - mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { - data: { - reason: reason, - id: orderId, - content: content - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - // mui.fire(list, 'refresh'); - if ('waitPay' == plus.webview.currentWebview().id) { - location.reload(); - } else { - JZL.openWindow('indent.html', 'abnormal', { - data_href: 'abnormal' - }); - setTimeout(function() { - //plus.webview.currentWebview().close(); - JZL.closeWindow(plus.webview.currentWebview().id); - }, 500) - } - // JZL.openWindow('indent.html', 'abnormal', { - // data_href: 'abnormal' - // }); - // setTimeout(function() { - // plus.webview.currentWebview().close(); - // // JZL.closeWindow(plus.webview.currentWebview().id); - // }, 500) - //location.reload(); - - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else if (getReasonUrl == 'getRejectCause') { - setReasonUrl = 'reject'; - mui.ajax(hyhUrl('app/Orders/' + setReasonUrl), { - data: { - reason: reason, - id: orderId, - content: content - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - // mui.fire(list, 'refresh'); - location.reload(); - - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } else if (getReasonUrl == 'getRefundCause') { - var params = {} - // params.money = $('#Tmoney').val(); - // if (params.money < 0 || params.money == 0) { - // mui.alert('退款金额不能为0!'); - // return; - // } - params.productNum = $('#productNum').val(); - params.couponsNum = $('#couponsNum').val(); - params.wangNum = $('#wangNum').val(); - params.reason = reason; - params.id = orderId; - params.content = content; - JZL.ajax(hyhUrl('app/Orderrefunds/refund'), params, function(data) { - var data = toJson(data); - mui.alert(data.msg); - if (data.status == 1) { - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - location.reload(); - } - }) - } - }) - $('#select').on('change', function() { - if ($(this).val() == '10000') { - $('#content').css('display', 'block'); - } else { - $('#content').css('display', 'none'); - } - }) +$('#content').after('
      '); +var pay_name = 0; +var token = localStorage.getItem('token'); +var order_class = localStorage.getItem('shop_order_class'); +var orderNo; +var orderId; +var getReasonUrl = ''; +var priceT = 0; +var payCode = ''; +var shopId = ''; +var wxChannel = null; // 微信支付 +var aliChannel = null; // 支付宝支付 +var channel = null; //支付通道 +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + contentnomore: '没有更多数据了', + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + }, + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } + } +}); +var count = 1; + +function pullupRefresh() { + count += 1; + getData(count); + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); +} +// //console.log(order_class); +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +var isLoad = false; + +function getData(page) { + if (true == isLoad) return; + isLoad = true; + JZL.ajax(qlgUrl('app/Shoporders/getSellerOrderList'), { + type: order_class, + shopId: shopId, + page: page, + pagesize: 10 + }, function(data) { + //console.log(data); + var data = toJson(data); + var html = '', + html1 = ""; + if (1 == data.status) { + // console.log(data); + if ('' == data.data.Rows) { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); + return; + } + $.each(data.data.Rows, function() { + //this.pay_name = 1; + var shopConfirmHtml = ''; + // console.log(this.orderStatus); + // if ( == 0) { + // if (0 == this.shopConfirm) { + // shopConfirmHtml = '
      待商家确认
      '; + // } else if (1 == this.shopConfirm) { + // shopConfirmHtml = '
      商家已确认
      '; + // }else if (2 == this.shopConfirm) { + // shopConfirmHtml = '
      商家未收款
      '; + // } + // } + // html += '
      ' + this.shopName + + // '
      ' + + // this.status + '
      ' + shopConfirmHtml + '
      商家电话:'+this.phone+'
      ' + html += '
      订单编号:' + this.orderNo + + '
      ' + this.createTime + + '
      ' + $.each(this.list, function() { + html += '

      ' + this.goodsName + + '

      ' + this.goodsSpecNames + '

      ¥' + this.goodsPrice + + '

      x' + this.goodsNum + + '
      优惠优惠:0.52优惠:0.52
      ' + // html += '

      ' + this.goodsName + '

      ' + this.goodsSpecNames + + // '

      ¥' + this.goodsPrice + '

      ¥' + this.marketPrice + 'x' + + // this.goodsNum + '
      '; + }) + + html += + '
      共' + + this.list.length + '件商品 合计:¥' + this.realTotalMoney + '(含运费¥0.00)
      ' + html += + '' + // html += '
      共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney + + // '(含运费¥' + this.deliverMoney + ')
      '; + if (this.orderStatus == -2) { //未付款 + html += '
      未付款
      ' + // html += '
      立即付款
      取消订单
      '; + } else if (this.orderStatus == -1) { + if (1 == this.isPay) { + if (1 == this.isRefund) { + //yituikuan + // html += '
      已退款
      ' + html += + '
      已退款
      订单已取消
      ' + } else { + //tuikuancaozuoanniu + // html += '
      确认退款
      ' + html += + '
      确认退款
      订单已取消
      ' + + } + } else { + html += '
      订单已取消
      ' + } //0 daiqueren 1 queren 2 jujue + } else if (this.orderStatus == 0) { + if (1 == this.shopConfirm) { + html += '
      确认发货
      ' + } else if (0 == this.shopConfirm) { + html += '
      确认收款
      ' + } else if (2 == this.shopConfirm) { + html += + '
      确认收款
      已拒绝
      ' + + } + + // html +='
      确认发货
      ' + //html += + // '
      确认发货
      确认收款
      ' + } else if (this.orderStatus == 1) { + html += '
      已发货
      配送中
      ' + } else if (this.orderStatus == 2) { + html += + '
      已完成
      提交凭证
      ' + } else if (this.orderStatus == -3) { + // html += '
      用户拒收
      ' + if (1 == this.isPay) { + if (1 == this.isRefund) { + //yituikuan + html += + '
      已退款
      用户拒收
      ' + + } else { + //tuikuancaozuoanniu + // html += '
      确认退款
      ' + html += + '
      确认退款
      用户拒收
      ' + } + } + } + + // if(-1 == this.orderStatus || -3 ==this.orderStatus){ + // if(1 == this.isPay){ + // if(1 == this.isRefund){ + // //yituikuan + // html += '
      已退款
      ' + // + // }else{ + // //tuikuancaozuoanniu + // html += '
      确认退款
      ' + // + // } + // } + // } + html1 = '产品券:' + this.productNum + '优惠券:' + this.couponsNum + '
      旺旺券:' + + this.wangNum + ''; + html += '
      ' + }) + + $('.con').append(html); + $(".rcb").html(html1) + } else { + mui.alert(data.msg) + } + isLoad = false; + }) +} +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + // //console.log(self); + shopId = self.shopId; + getData(count); + // window.addEventListener('refresh', function(e) { //执行刷新 + // location.reload(); + // }); + // //console.log(order_class) + if (order_class == 'all') { + order_class = ''; + + } + // 已付款 店家确认收款 + $('.con').on('tap', '.qrsk', function() { + orderId = $(this).parent().parent().attr('data-id'); + $('.bg').css('display', 'block') + $('#querenshoukuan').css('display', 'block') + }) + $('#querenshoukuan').on('tap', '.pay_btn', function() { + // orderId = $(this).parent().parent().attr('data-id'); + var confirmType = $('#querenshoukuan input[type="radio"]:checked').val(); + //console.log(confirmType,orderId,shopId); + JZL.ajax(qlgUrl('app/Shoporders/orderConfirm'), { + confirmType: confirmType, + shopId: shopId, + id: orderId + }, function(data) { + // console.log(data); + if (1 == data.status) { + $('.bg').css('display', 'none') + $('#querenshoukuan').css('display', 'none') + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload() + + // mui.back(); + } else { + mui.alert(data.msg) + } + }) + }) + // 店家确认退款 + var content = ""; + $('.con').on('tap', '.qrtk', function() { + orderId = $(this).parent().parent().attr('data-id'); + $('.bg').css('display', 'block') + $('#querentuikuan').css('display', 'block') + }) + $('#querentuikuan').on('tap', '.pay_btn', function() { + // orderId = $(this).parent().parent().attr('data-id'); + var confirmType = $('#querentuikuan input[type="radio"]:checked').val(); + content = $("#refuse_con").val() + // console.log(confirmType, orderId, shopId, content, $("#refuse_con")); + if (-1 == confirmType) { + if ('' == $.trim($("#refuse_con").val())) { + mui.alert("请输入拒绝原因") + return + } else {} + } + JZL.ajax(qlgUrl('app/Shoporders/shopRefund'), { + refundStatus: confirmType, + content: content, + shopId: shopId, + id: orderId + }, function(data) { + //console.log(data); + if (1 == data.status) { + $('.bg').css('display', 'none') + $('#querentuikuan').css('display', 'none') + // location.reload(); + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload() + // mui.back(); + } else { + mui.alert(data.msg) + } + + }) + }) + // 已付款 店家发货 + $('.con').on('tap', '.qrfh', function() { + orderId = $(this).parent().parent().attr("data-id") + $('.bg').show(); + $('.delivery').show(); + JZL.ajax(qlgUrl('app/Orders/getExpress'), {}, function(data) { + // //console.log(data); + if (data.status == 1) { + // html = ''; + var html = '' + mui.each(data.data, function(index, element) { + html += '' + }) + $('#expressId').append(html) + } else { + mui.alert(data.msg) + } + }) + + }) + // 选择快递公司名称 + + + + //确认发货 + $('.delivery').on('tap', '.pay_btn', function() { + if (0 == $('#expressId option:selected').val()) { + mui.alert('请选择快递公司名称') + return; + } + if ('' == $('#expressNo').val()) { + mui.alert('请输入快递单号') + return; + } + var pargams = {} + pargams.expressNo = $('#expressNo').val(); + pargams.expressId = $('#expressId').val(); + pargams.id = orderId; + pargams.shopId = shopId; + JZL.ajax(qlgUrl('app/ShopOrders/deliver'), pargams, function(data) { + // console.log(data); + if (1 == data.status) { + // var data = data.data; + mui.toast(data.msg) + $('.delivery').css('display', 'none') + $('.bg').css('display', 'none') + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload() + + } else { + mui.alert(data.msg) + } + + }) + }) + // 返回 + $('.bg').on('tap', '.mui-icon-left-nav', function() { + // $('.pay').css('display', 'block'); + $('.bg').css('display', 'none'); + $('.pay_way').css('display', 'none'); + }) + //提交凭证 + $('.con').on('tap', '.tjpz', function() { + var orderId = $(this).parent().parent().attr("data-id") + JZL.openWindow('shoperUploadVoucher.html', 'shoperUploadVoucher.html', { + orderIds: orderId, + shopId: shopId, + }); + }) + + // 关闭 + $('.bg').on('tap', '.mui-icon-closeempty', function() { + $('.bg').css('display', 'none'); + // $(".pay").slideUp(300, function() { + // + // }); + }) + // + + // $('#pay_way').on('tap', '.row', function() { + // $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); + // $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); + // $('.con_1 .on .row_right o').html($(this).children('.row_left').html()); + // $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode')) + // $('.pay').css('display', 'block'); + // $('#pay_way').css('display', 'none'); + // + // }) + // $('.pay').on('tap', '.con_1 .on', function() { + // if ($(this).attr('data-payCode') == 'ect') { + // + // } else { + // $('.pay').css('display', 'none'); + // $('#pay_way').css('display', 'block'); + // } + // + // }) + // $('.pay_btn').on('tap', function() { + // payCode = $('.con_1 .on').attr('data-payCode'); + // ////console.log(payCode) + // var that = $(this); + // var data_ljfk = { + // isBatch: 0, + // orderNo: orderNo + // } + // that.attr('disabled', 'disabled'); + // mui.ajax(hyhUrl('app/orders/succeed'), { + // data: data_ljfk, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // data = toJson(data); + // + // if (data.status == 1) { + // if (payCode == 'qlgpay') { + // JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + // orderNo: orderNo, + // isBatch: 0 + // }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(JSON.stringify(data)); + // var data = toJson(data); + // // //console.log(JSON.stringify(data)) + // if (data.status == 1) { + // $('.pay').css('display', 'none'); + // $('#qlg_pay_pwd').css('display', 'block'); + // if (data.data.payPwd == '0') { + // mui.alert('还未设置支付密码请先设置操作密码!'); + // var url = 'setting_fogetPayPwd'; + // JZL.openWindow(url + '.html', url + '.html'); + // //return; + // } + // $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); + // $('#productNum').val(data.data.product.useProduct); + // if (data.data.product.useProduct > 0) { + // var html1 = '

      抵扣额' + data.data.product.useProductOk + + // '

      扣税 ' + data.data.product.useProductTaxFee + + // '

      手续费 ' + data.data.product.useProductHandlingFee + + // '

      '; + // // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + + // // ',手续费:' + data.data.product.useProductHandlingFee + ']'); + // $('.productInfo_').html(html1) + // + // } + // $('#couponsNum').val(data.data.coupons.useCoupons); + // if (data.data.coupons.useCoupons > 0) { + // var html2 = '

      抵扣额' + data.data.coupons.useCouponsOk + + // '

      扣税 ' + data.data.coupons.useCouponsTaxFee + + // '

      手续费 ' + data.data.coupons.useCouponsHandlingFee + + // '

      '; + // $('.couponsInfo_').html(html2) + // // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + + // // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); + // } + // $('#wangNum').val(data.data.wang.useWang); + // $('#moneyNum').val(data.data.money.useMoney); + // + // } else { + // mui.alert(data.msg) + // } + // }); + // } else if (payCode == 'wallets' || payCode == 'ect') { + // //跳输入密码的页面 + // mui.ajax(hyhUrl('app/' + payCode + '/payment'), { + // data: { + // orderNo: orderNo, + // isBatch: 0 + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(data.data.goodsFavoritesNum) + // var data = toJson(data); + // if (data.status == 1) { + // $('.pay').css('display', 'none'); + // $('#pay_pwd').css('display', 'block'); + // if (data.data.payPwd == '0') { + // mui.alert('还未设置支付密码请先设置支付密码!'); + // var url = 'setting_fogetPayPwd'; + // mui.openWindow({ + // url: url + '.html', + // id: url + '.html', + // styles: { + // top: '0px', //新页面顶部位置 + // bottom: '0px', //新页面底部位置 + // width: '100%', //新页面宽度,默认为100% + // height: '100%' //新页面高度,默认为100% + // }, + // extras: { + // // data_href: data_href + // // ..... //自定义扩展参数,可以用来处理页面间传值 + // }, + // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + // show: { + // // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // // extras: {} //窗口动画是否使用图片加速 + // }, + // waiting: { + // autoShow: true, //自动显示等待框,默认为true + // title: '正在加载...', //等待对话框上显示的提示内容 + // options: { + // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // // ...... + // } + // } + // }) + // } + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + // + // } else if (payCode == 'alipays') { + // pay('alipay', orderNo); + // // plus.nativeUI.showWaiting(); + // // mui.post(hyhUrl('app/Alipays/payment'), { + // // orderNo: data.data, + // // isBatch: 1 + // // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); + // + // } + // + // that.removeAttr('disabled'); + // } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + // } + // }) + // }) + // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { + // var url = 'setting_fogetPayPwd'; + // JZL.openWindow(url + '.html', url + '.html'); + // }) + // $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { + // // var self = plus.webview.currentWebview(); + // // var data_href = self.id; + // // //console.log(data_href) + // // JZL.closeWindow('waitPay'); + // //return; + // var payPwd = $('#payPwd').val(); + // if (payPwd == '') { + // mui.alert('支付密码不能为空!'); + // return; + // } + // var that = $(this); + // that.attr('disabled', 'disabled') + // var srcc = '' + // if (payCode == 'qlgpay') { + // srcc = 'payByQlg'; + // } else if (payCode == 'ect') { + // srcc = 'payByEct'; + // } else { + // srcc = 'payByWallet'; + // } + // + // mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { + // + // data: { + // orderNo: orderNo, + // isBatch: 0, + // payPwd: payPwd + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(data.data.goodsFavoritesNum) + // var data = toJson(data); + // mui.alert(data.msg) + // //console.log(data.status) + // if (data.status == 1) { + // JZL.openWindow('indent.html', 'waitDeliver', { + // data_href: 'waitDeliver' + // }); + // setTimeout(function() { + // JZL.closeWindow(plus.webview.currentWebview().id); + // // JZL.closeWindow('indent.html'); + // }, 700) + // // var targetTab = plus.webview.getWebviewById("templete/my.html"); + // // mui.fire(targetTab, 'refresh'); + // // location.reload(); + // } else { + // + // } + // that.removeAttr('disabled') + // + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + // + // }) + + mui('.con').on('tap', '.row_con', function() { + var data_order_id = $(this).attr('data-id'); + mui.openWindow({ + url: 'order_out.html', + id: 'order_out.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: data_order_id + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.ckwl', function() { + var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); + JZL.openWindow('logistics.html', 'logistics.html', { + data_order_id: data_order_id + }); + }) + //上传凭证 + mui('.con').on('tap', '.uploadCertificate', function() { + var orderId = $(this).parent().parent().attr('data-id'); + // mui.alert('跳到上传凭证页' + orderId) + JZL.openWindow("uploadVoucher.html", "uploadVoucher.html", { + orderId: orderId + }) + }) + $('.con').on('tap', '.qxdd_js', function() { + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if ($(this).html() == '取消订单') { + getReasonUrl = 'getCancelCause'; + } else if ($(this).html() == '拒收') { + getReasonUrl = 'getRejectCause'; + } else if ($(this).html() == '申请退款') { + getReasonUrl = 'getRefundCause'; + JZL.ajax(hyhUrl('/app/Orders/getRefund'), { + id: orderId + }, function(data) { //服务器返回响应 + // //console.log(JSON.stringify(data)); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('qlgpay' == data.payFrom) { + html = ' 退款产品券数量:' + + ' 退款优惠券数量:' + + ' 退款旺旺券数量:' + + ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + + // '

      (金额不能超过¥' + data.realTotalMoney + + ')

      '; + } else { + html = '

      (金额不能超过¥' + data.realTotalMoney + + ')

      (积分数量:' + data.ectNum + ')

      '; + } + + $('.tui').html(html) + } else { + mui.alert(data.msg) + } + }); + } + $('.bg_').css('display', 'block'); + $('.bg_con').css('display', 'none'); + $('.bg_con').slideDown(300, function() {}); + mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + var html = ''; + $.each(data.data, function() { + html += '' + }); + $('#select').html(html) + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + + $('.bg_').on('tap', '.en_false', function() { + $('.bg_').css('display', 'none'); + + }) + $('.bg_').on('tap', '.en_true', function() { + var setReasonUrl = ''; + var content = $('#content').val(); + var reason = $('#select').val(); + if ($('#select').val() == 0) { + mui.alert('请选择原因!'); + return; + } + if ($('#select').val() == 10000 && content == '') { + mui.alert('请输入其他原因!'); + return; + } + if (getReasonUrl == 'getCancelCause') { + setReasonUrl = 'cancellation'; + mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + if ('waitPay' == plus.webview.currentWebview().id) { + location.reload(); + } else { + JZL.openWindow('indent.html', 'abnormal', { + data_href: 'abnormal' + }); + setTimeout(function() { + //plus.webview.currentWebview().close(); + JZL.closeWindow(plus.webview.currentWebview().id); + }, 500) + } + // JZL.openWindow('indent.html', 'abnormal', { + // data_href: 'abnormal' + // }); + // setTimeout(function() { + // plus.webview.currentWebview().close(); + // // JZL.closeWindow(plus.webview.currentWebview().id); + // }, 500) + //location.reload(); + + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRejectCause') { + setReasonUrl = 'reject'; + mui.ajax(hyhUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + location.reload(); + + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRefundCause') { + var params = {} + // params.money = $('#Tmoney').val(); + // if (params.money < 0 || params.money == 0) { + // mui.alert('退款金额不能为0!'); + // return; + // } + params.productNum = $('#productNum').val(); + params.couponsNum = $('#couponsNum').val(); + params.wangNum = $('#wangNum').val(); + params.reason = reason; + params.id = orderId; + params.content = content; + JZL.ajax(hyhUrl('app/Orderrefunds/refund'), params, function(data) { + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload(); + } + }) + } + }) + $('#select').on('change', function() { + if ($(this).val() == '10000') { + $('#content').css('display', 'block'); + } else { + $('#content').css('display', 'none'); + } + }) }) diff --git a/static/app2/js/shoperUploadVoucher.js b/static/app2/js/shoperUploadVoucher.js old mode 100755 new mode 100644 index 79c2335..af253d2 --- a/static/app2/js/shoperUploadVoucher.js +++ b/static/app2/js/shoperUploadVoucher.js @@ -1,67 +1,67 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - }, -}) -mui.plusReady(function() { - var orderId = '', - id = '', - shopId = ''; - - var self = plus.webview.currentWebview(); - //console.log(self); - orderIds = self.orderIds; - shopId = self.shopId; - if ('undefined' != typeof self.orderId) { - id = self.orderId - } - if (id > 0) { //bianji - JZL.ajax(qlgUrl('app/shopOrders/getCertificateInfo'), { - shopId: shopId, - id: id - }, function(data) { - //console.log(data); - $('#content').val(data.data.content); - $('#img').attr('src', hyhImgUrl(data.data.imgUrl)) - $('#imgUrl').val(data.data.imgUrl) - }) - } - // 上传图片 - $(".oneImg").on("tap", '#img', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - UP.init("imgUrl", "test", "img") - openCamera() - }) - - var click = false; - $(".con").on("tap", '.bc_btn', function() { - if (true == click) return; - click = true; - var params = JZL.getParams(".inp"); - params.orderIds = orderIds; - params.shopId = shopId; - if (id > 0) { - params.id = id; - } - if ('' == $.trim($('#content').val())) { - mui.alert("请输入凭证说明") - return; - } - if ('' == $('#imgUrl').val()) { - mui.alert("请上传凭证图片") - return; - } - JZL.ajax(qlgUrl('app/Shoporders/uploadCertificate'), params, function(data) { - //console.log(data); - if (-1 == data.status) { - mui.alert(data.msg) - mui.back(); - } else { - mui.alert(data.msg) - } - }) - }) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + }, +}) +mui.plusReady(function() { + var orderId = '', + id = '', + shopId = ''; + + var self = plus.webview.currentWebview(); + //console.log(self); + orderIds = self.orderIds; + shopId = self.shopId; + if ('undefined' != typeof self.orderId) { + id = self.orderId + } + if (id > 0) { //bianji + JZL.ajax(qlgUrl('app/shopOrders/getCertificateInfo'), { + shopId: shopId, + id: id + }, function(data) { + //console.log(data); + $('#content').val(data.data.content); + $('#img').attr('src', hyhImgUrl(data.data.imgUrl)) + $('#imgUrl').val(data.data.imgUrl) + }) + } + // 上传图片 + $(".oneImg").on("tap", '#img', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + UP.init("imgUrl", "test", "img") + openCamera() + }) + + var click = false; + $(".con").on("tap", '.bc_btn', function() { + if (true == click) return; + click = true; + var params = JZL.getParams(".inp"); + params.orderIds = orderIds; + params.shopId = shopId; + if (id > 0) { + params.id = id; + } + if ('' == $.trim($('#content').val())) { + mui.alert("请输入凭证说明") + return; + } + if ('' == $('#imgUrl').val()) { + mui.alert("请上传凭证图片") + return; + } + JZL.ajax(qlgUrl('app/Shoporders/uploadCertificate'), params, function(data) { + //console.log(data); + if (-1 == data.status) { + mui.alert(data.msg) + mui.back(); + } else { + mui.alert(data.msg) + } + }) + }) }) diff --git a/static/app2/js/shopgoodlist.js b/static/app2/js/shopgoodlist.js old mode 100755 new mode 100644 index ebefc13..1b21bbf --- a/static/app2/js/shopgoodlist.js +++ b/static/app2/js/shopgoodlist.js @@ -1,100 +1,100 @@ -mui.plusReady(function() { - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - var self = plus.webview.currentWebview(); - // //console.log(self); - var shopId = self.id; - $('.add1').on('tap', function() { - JZL.openWindow('addgoods.html', parseInt(shopId)); - }) - //获取商品列表 - var page = 1; - var pageSize = 10; - var isjiazai = 1; - getRecommend(page, pageSize); - - function getRecommend(page, pageSize) { - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 10 - } - recommenddata.shopId = shopId - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shops/getGoodsList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - if (data.status == 1) { - var html = ''; - var status = ''; - var data = data.data; - var status = ""; - if ('' == data.Rows) { - $('.mui-scroll').append( - '

      没有更多数据

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - // //console.log(this.goodsStatus); - if (0 == this.goodsStatus) { - status = "等待审核" - } - if (1 == this.goodsStatus) { - status = "已上架" - } - if (-1 == this.goodsStatus) { - status = "已拒绝" - } - html += '

      ' + this.goodsName + '

      价格:' + - this.shopPrice + - '

      ' + status + - '

      ' - }) - $('.con').append(html); - } else { - mui.alert(data.msg) - } - isjiazai = 1; - }) - } - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pageSize); - } - } - }) - var goodsId = ""; - var isSpec = ""; - $('.con').on('tap', '.bj', function() { - goodsId = $(this).attr('data-id') - isSpec = $(this).parent().parent().parent().attr("data-spec") - isSale = $(this).parent().parent().parent().attr("data-sale") - JZL.openWindow('addgoods.html', parseInt(shopId), { - goodsId: goodsId, - isSpec: isSpec, - isSale: isSale - }); - }) - $('.con').on('tap', '.del', function() { - goodsId = $(this).attr('data-id') - if (confirm('确认删除?')) { - JZL.ajax(qlgUrl("app/shops/delGoods"), { - shopId: shopId, - goodsId: goodsId - }, function() { - $(this).parent().parent().parent().remove(); - location.reload() - }) - } - }) +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + var self = plus.webview.currentWebview(); + // //console.log(self); + var shopId = self.id; + $('.add1').on('tap', function() { + JZL.openWindow('addgoods.html', parseInt(shopId)); + }) + //获取商品列表 + var page = 1; + var pageSize = 10; + var isjiazai = 1; + getRecommend(page, pageSize); + + function getRecommend(page, pageSize) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 10 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getGoodsList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + if (data.status == 1) { + var html = ''; + var status = ''; + var data = data.data; + var status = ""; + if ('' == data.Rows) { + $('.mui-scroll').append( + '

      没有更多数据

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + // //console.log(this.goodsStatus); + if (0 == this.goodsStatus) { + status = "等待审核" + } + if (1 == this.goodsStatus) { + status = "已上架" + } + if (-1 == this.goodsStatus) { + status = "已拒绝" + } + html += '

      ' + this.goodsName + '

      价格:' + + this.shopPrice + + '

      ' + status + + '

      ' + }) + $('.con').append(html); + } else { + mui.alert(data.msg) + } + isjiazai = 1; + }) + } + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } + }) + var goodsId = ""; + var isSpec = ""; + $('.con').on('tap', '.bj', function() { + goodsId = $(this).attr('data-id') + isSpec = $(this).parent().parent().parent().attr("data-spec") + isSale = $(this).parent().parent().parent().attr("data-sale") + JZL.openWindow('addgoods.html', parseInt(shopId), { + goodsId: goodsId, + isSpec: isSpec, + isSale: isSale + }); + }) + $('.con').on('tap', '.del', function() { + goodsId = $(this).attr('data-id') + if (confirm('确认删除?')) { + JZL.ajax(qlgUrl("app/shops/delGoods"), { + shopId: shopId, + goodsId: goodsId + }, function() { + $(this).parent().parent().parent().remove(); + location.reload() + }) + } + }) }) diff --git a/static/app2/js/shoppingcart.js b/static/app2/js/shoppingcart.js old mode 100755 new mode 100644 index 8a72424..6b72f21 --- a/static/app2/js/shoppingcart.js +++ b/static/app2/js/shoppingcart.js @@ -1,586 +1,611 @@ -var num = 1; -var isOver = 1; -$('.mui-action-back').show(); - -function getMsg(pageNum, pagesizeNum) { - - var data_msg = { - page: pageNum ? pageNum : 1, - pagesize: pagesizeNum ? pagesizeNum : 10 - } - - if (isOver == 0) { - return; - } else { - isOver = 0; - } - mui.ajax(qlgUrl('app/Articles/headLine'), { - - // mui.ajax(kxUrl('app/Articles/headLine'), { - data: data_msg, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - var html = ''; - data = data.data; - if (data.Rows == '') { - if (pageNum == 1) { - $('.recommend_con').html( - '

      没有更多内容

      '); - } else if (pageNum > 1) { - $('.recommend_con').append( - '

      没有更多内容

      '); - } - - isOver = 0; - return; - } - $.each(data.Rows, function() { - html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      '; - }); - - if (pageNum == 1) { - $('.recommend_con').html(html); - } else if (pageNum > 1) { - $('.recommend_con').append(html); - } - $('.recommend_title').css('display', 'block'); - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - isOver = 1; - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - -} - - - -mui.plusReady(function() { - // var scroll = mui('.mui-scroll-wrapper').scroll({ - // deceleration: 0.002 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 - // }); - window.addEventListener('refresh', function(e) { - location.reload(); - }) - getMsg(num, 10); - - function getCost() { - var cost = 0; - $('.check2').each(function() { - if ($(this).children().hasClass('check_1')) { - - cost += ((+$(this).siblings('.b_con_r1').children('.bz').children('.cost').children('o').html()) * (+$(this).siblings( - '.b_con_r1').children('.bz').children('.num').children('o').html())) - } - }) - - $('.js_r span j').html('¥' + cost.toFixed(2)); - } - - function isChecks() { - - $('.check1').each(function() { - var isChecks = 1; - $(this).parent().siblings().children().find('.checks').each(function() { - if ($(this).hasClass('check_0')) { - isChecks = 0; - } - }) - if (isChecks == 0) { - $(this).children().removeClass('check_1').addClass('check_0'); - } else { - $(this).children().removeClass('check_0').addClass('check_1'); - } - }) - - } - mui.ajax(qlgUrl('app/carts/index'), { - // mui.ajax(hyhUrl('app/carts/index'), { - data: {}, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - var data = toJson(data, 1); - if (data.status == 1) { - data = data.data; - var html = ''; - $('header').html('购物车(' + data.all_carts_num + ')'); - var allids = []; - $.each(data.carts, function() { - var ids = []; - - $.each(this.list, function() { - ids.push(this.cartId); - allids.push(this.cartId); - }); - var idsStr = ids.join(','); - html += '
      '; - $.each(this.list, function() { - - html += '

      ' + - this.goodsName + '

      '; - $.each(this.specNames, function() { - html += this.catName + ':' + this.itemName + ';'; - }); - var price; - if (this.specPrice != null) { - price = this.specPrice; - } else { - price = this.shopPrice; - } - html += '

      ' + price + - '  ¥' + this.marketPrice + - '×' + this.cartNum + - '
      '; - }); - - html += '
      '; - - }); - var allIdsStr = allids.join(','); - - $('.con_').html(html) - $('.check').attr('data-allIdsStr', allIdsStr); - $('.checks').each(function() { - if ($(this).parent().attr('data-isCheck') == '1') { - $(this).removeClass('check_0').addClass('check_1'); - } - }) - getCost(); - isChecks(); - } else { - mui.alert(data.msg) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - $('.con_').on('tap', '.b_link', function() { - var shopId = $(this).children('a').attr('data-shopId'); - var url = 'storeout.html'; - if (shopId == 1) { - // url='self_shop.html' - } - mui.openWindow({ - url: url, - id: url + shopId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - shopId: shopId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - $('.con_').on('tap', '.b_con_r1', function() { - var data_id = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + data_id, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: data_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - - $('.check').on('tap', function() { - var isCheck; - var ids = $(this).attr('data-allIdsStr'); - if ($('.check').children('.checks').hasClass('check_0')) { - $('.check').children('.checks').removeClass('check_0').addClass('check_1'); - $('.check1').children('.checks').removeClass('check_0').addClass('check_1'); - $('.check2').children('.checks').removeClass('check_0').addClass('check_1'); - isCheck = 1; - } else { - $('.check').children('.checks').removeClass('check_1').addClass('check_0'); - $('.check1').children('.checks').removeClass('check_1').addClass('check_0'); - $('.check2').children('.checks').removeClass('check_1').addClass('check_0'); - isCheck = 0; - } - getCost(); - isChecks(); - mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), { - data: { - ids: ids, - isCheck: isCheck - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }); - - $('.con_').on('tap', '.check1', function(e) { - e.stopPropagation(); - var that = $(this); - var isCheck; - var ids = $(this).attr('data-idsStr'); - $('.check').children('.checks').removeClass('check_1').addClass('check_0'); - if (that.children('.checks').hasClass('check_0')) { - isCheck = 1; - that.children('.checks').removeClass('check_0').addClass('check_1'); - that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_0').addClass( - 'check_1'); - } else { - isCheck = 0; - that.children('.checks').removeClass('check_1').addClass('check_0'); - that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_1').addClass( - 'check_0'); - } - getCost(); - isChecks(); - that.attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), { - data: { - ids: ids, - isCheck: isCheck - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data); - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }); - - $('.con_').on('tap', '.check2', function(e) { - ////console.log() - e.stopPropagation(); - var isCheck; - var cartId = $(this).attr('data-cartId'); - var that = $(this); - var buyNum = $(this).attr('data-cartNum'); - $('.check').children('.checks').removeClass('check_1').addClass('check_0'); - if ($(this).children().hasClass('check_0')) { - $(this).parent().parent().siblings().children('.check1').children('.checks').removeClass('check_1').addClass( - 'check_0'); - $(this).children('.checks').removeClass('check_0').addClass('check_1'); - isCheck = 1; - } else { - $(this).children('.checks').removeClass('check_1').addClass('check_0'); - isCheck = 0; - } - getCost(); - isChecks() - $(this).attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/carts/changeCartGoods'), { - data: { - id: cartId, - isCheck: isCheck, - buyNum: buyNum - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data, 1); - that.removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }); - - $('.con_').on('tap', '.btn_bj', function(e) { - e.stopPropagation() - if ($(this).html() == '编辑') { - $(this).html('完成'); - $(this).parent().siblings().children().find('.b_con_r1').css('display', 'none'); - $(this).parent().siblings().children().find('.b_con_r2').css('display', 'block'); - } else { - $(this).html('编辑'); - $(this).parent().siblings().children().find('.b_con_r2').css('display', 'none'); - $(this).parent().siblings().children().find('.b_con_r1').css('display', 'block'); - var inputArr = $(this).parent().siblings().find('input') - - $(this).parent().siblings().find('.num').each(function(num) { - $(this).html('×' + inputArr.eq(num).val() + ''); - }) - - } - // //console.log($(this).parent().siblings().find('.commodity_num')) - // //console.log($(this).parent().siblings().find('input')); - if ($(this).html() == '完成') { - return; - } - getCost() - }) - - $('.con_').on('tap', '.jia', function() { - // //console.log($(this).siblings('input').val()) - var that = $(this); - var cartId = $(this).parent().attr('data-cartId') - var num = +$(this).siblings('input').val() + 1; - if (num <= 0) { - mui.alert('购买数最小为1!'); - return; - } - $('.jia').attr('disabled', 'disabled'); - $('.jian').attr('disabled', 'disabled'); - $('input').attr('disabled', 'disabled'); - mui.ajax(hyhUrl('app/carts/changeCartGoods'), { - data: { - id: cartId, - buyNum: num - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data, 1); - that.siblings('input').val(num); - $('.jia').removeAttr('disabled'); - $('.jian').removeAttr('disabled'); - $('input').removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - $('.con_').on('tap', '.jian', function() { - var that = $(this); - var cartId = $(this).parent().attr('data-cartId') - var num = +$(this).siblings('input').val() - 1; - if (num <= 0) { - mui.alert('购买数最小为1!'); - return; - } - $('.jia').attr('disabled', 'disabled'); - $('.jian').attr('disabled', 'disabled'); - $('input').attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/carts/changeCartGoods'), { - data: { - id: cartId, - buyNum: num - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data, 1); - that.siblings('input').val(num); - $('.jia').removeAttr('disabled'); - $('.jian').removeAttr('disabled'); - $('input').removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - $('.con_').on('blur', 'input', function() { - var that = $(this); - var cartId = $(this).parent().attr('data-cartId') - var num = +$(this).val(); - if (num <= 0) { - mui.alert('购买数最小为1!'); - return; - } - $('.jia').attr('disabled', 'disabled'); - $('.jian').attr('disabled', 'disabled'); - $('input').attr('disabled', 'disabled'); - mui.ajax(qlgUrl('app/carts/changeCartGoods'), { - data: { - id: cartId, - buyNum: num - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data, 1); - that.siblings('input').val(num); - $('.jia').removeAttr('disabled'); - $('.jian').removeAttr('disabled'); - $('input').removeAttr('disabled'); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - - $('.con_').on('tap', '.b_con_r2_del', function() { - var cartId = $(this).attr('data-cartId'); - - if (confirm('确定删除?')) { - mui.ajax(hyhUrl('app/carts/delCart'), { - data: { - id: cartId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; - var data = toJson(data, 1); - location.reload(); - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - } - }) - - // $('.changeclass').on('tap', '.selectclass', function() { - // $('.mui-backdrop').show(); - // }) - - //选择类型 - // $('.cclass1').on('tap', '.block', function() { - // $(this).addClass('on').siblings().removeClass('on'); - // $(this).parent().attr('data-class', $(this).html()); - // }) - - // $('.closecclass').on('tap', function() { - // $('.mui-backdrop').css('display', 'none'); - // }) - - // $('.ensure').on('tap', function() { - // $('.mui-backdrop').css('display', 'none'); - // }) - - mui('.js').on('tap', '.btn_tj', function() { - var check_length = $('.check_1').length; - if (check_length == 0) { - mui.alert('请选择商品结算!'); - return; - } - mui.openWindow({ - url: 'confirmOrder.html', - id: 'confirmOrder.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - // data_id: data_id - - type: 0 - - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - setTimeout(function() { - JZL.closeWindow(plus.webview.currentWebview().id); - }, 1000) - }) - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isOver == 1) { - num++; - getMsg(num, 10); - } - } - }) +var num = 1; +var isOver = 1; +$('.mui-action-back').show(); + +function getMsg(pageNum, pagesizeNum) { + + var data_msg = { + from: from_id, + page: pageNum ? pageNum : 1, + pagesize: pagesizeNum ? pagesizeNum : 10 + } + + if (isOver == 0) { + return; + } else { + isOver = 0; + } + mui.ajax(qlgUrl('app/Articles/headLine'), { + + // mui.ajax(kxUrl('app/Articles/headLine'), { + data: data_msg, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + data = data.data; + if (data.Rows == '') { + if (pageNum == 1) { + $('.recommend_con').html( + '

      没有更多内容

      '); + } else if (pageNum > 1) { + $('.recommend_con').append( + '

      没有更多内容

      '); + } + + isOver = 0; + return; + } + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      '; + }); + + if (pageNum == 1) { + $('.recommend_con').html(html); + } else if (pageNum > 1) { + $('.recommend_con').append(html); + } + $('.recommend_title').css('display', 'block'); + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + isOver = 1; + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + +} + + + +mui.plusReady(function() { + // var scroll = mui('.mui-scroll-wrapper').scroll({ + // deceleration: 0.002 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 + // }); + var self = plus.webview.currentWebview(); + from_id = self.from_id?self.from_id:0; + switch(from_id){ + case 1: + $(".title").text("逛商都购物车") + break + case 2: + $(".title").text("助微吧购物车") + break + case 3: + $(".title").text("助购吧购物车") + break + } + window.addEventListener('refresh', function(e) { + location.reload(); + }) + getMsg(num, 10); + + function getCost() { + var cost = 0; + $('.check2').each(function() { + if ($(this).children().hasClass('check_1')) { + + cost += ((+$(this).siblings('.b_con_r1').children('.bz').children('.cost').children('o').html()) * (+$(this).siblings( + '.b_con_r1').children('.bz').children('.num').children('o').html())) + } + }) + + $('.js_r span j').html('¥' + cost.toFixed(2)); + } + + function isChecks() { + + $('.check1').each(function() { + var isChecks = 1; + $(this).parent().siblings().children().find('.checks').each(function() { + if ($(this).hasClass('check_0')) { + isChecks = 0; + } + }) + if (isChecks == 0) { + $(this).children().removeClass('check_1').addClass('check_0'); + } else { + $(this).children().removeClass('check_0').addClass('check_1'); + } + }) + if($('.check2 .check_1').length===0 && $('.check2 .check_0').length > 0){ + $(".js .checks").removeClass('check_1').addClass('check_0'); + }else{ + $(".js .checks").removeClass('check_0').addClass('check_1'); + } + $(".btn_tj").text("结算("+$(".check2 .check_1").length+")") + } + mui.ajax(qlgUrl('app/carts/index'), { + // mui.ajax(hyhUrl('app/carts/index'), { + data: {from:from_id}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + data = data.data; + var html = ''; + $('header').html('购物车(' + data.all_carts_num + ')'); + var allids = []; + $.each(data.carts, function() { + var ids = []; + + $.each(this.list, function() { + ids.push(this.cartId); + allids.push(this.cartId); + }); + var idsStr = ids.join(','); + html += '
      '; + $.each(this.list, function() { + + html += '

      ' + + this.goodsName + '

      '; + $.each(this.specNames, function() { + html += this.catName + ':' + this.itemName + ';'; + }); + var price; + if (this.specPrice != null) { + price = this.specPrice; + } else { + price = this.shopPrice; + } + html += '

      ' + price + + '  ¥' + this.marketPrice + + '×' + this.cartNum + + '
      '; + }); + + html += '
      '; + + }); + var allIdsStr = allids.join(','); + + $('.con_').html(html) + $('.check').attr('data-allIdsStr', allIdsStr); + $('.checks').each(function() { + if ($(this).parent().attr('data-isCheck') == '1') { + $(this).removeClass('check_0').addClass('check_1'); + } + }) + getCost(); + isChecks(); + } else { + mui.alert(data.msg) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + $('.con_').on('tap', '.b_link', function() { + var shopId = $(this).children('a').attr('data-shopId'); + var url = 'storeout.html'; + if (shopId == 1) { + // url='self_shop.html' + } + mui.openWindow({ + url: url, + id: url + shopId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + shopId: shopId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + $('.con_').on('tap', '.b_con_r1', function() { + var data_id = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + data_id, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: data_id, + from_id: from_id, + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + + $('.check').on('tap', function() { + var isCheck; + var ids = $(this).attr('data-allIdsStr'); + if ($('.check').children('.checks').hasClass('check_0')) { + $('.check').children('.checks').removeClass('check_0').addClass('check_1'); + $('.check1').children('.checks').removeClass('check_0').addClass('check_1'); + $('.check2').children('.checks').removeClass('check_0').addClass('check_1'); + isCheck = 1; + } else { + $('.check').children('.checks').removeClass('check_1').addClass('check_0'); + $('.check1').children('.checks').removeClass('check_1').addClass('check_0'); + $('.check2').children('.checks').removeClass('check_1').addClass('check_0'); + isCheck = 0; + } + getCost(); + isChecks(); + mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), { + data: { + from: from_id, + ids: ids, + isCheck: isCheck + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }); + + $('.con_').on('tap', '.check1', function(e) { + e.stopPropagation(); + var that = $(this); + var isCheck; + var ids = $(this).attr('data-idsStr'); + $('.check').children('.checks').removeClass('check_1').addClass('check_0'); + if (that.children('.checks').hasClass('check_0')) { + isCheck = 1; + that.children('.checks').removeClass('check_0').addClass('check_1'); + that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_0').addClass( + 'check_1'); + } else { + isCheck = 0; + that.children('.checks').removeClass('check_1').addClass('check_0'); + that.parent().siblings().children().find('.check2').children('.checks').removeClass('check_1').addClass( + 'check_0'); + } + getCost(); + isChecks(); + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/carts/batchChangeCartGoods'), { + data: { + from: from_id, + ids: ids, + isCheck: isCheck + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data); + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }); + + $('.con_').on('tap', '.check2', function(e) { + ////console.log() + e.stopPropagation(); + var isCheck; + var cartId = $(this).attr('data-cartId'); + var that = $(this); + var buyNum = $(this).attr('data-cartNum'); + $('.check').children('.checks').removeClass('check_1').addClass('check_0'); + if ($(this).children().hasClass('check_0')) { + $(this).parent().parent().siblings().children('.check1').children('.checks').removeClass('check_1').addClass( + 'check_0'); + $(this).children('.checks').removeClass('check_0').addClass('check_1'); + isCheck = 1; + } else { + $(this).children('.checks').removeClass('check_1').addClass('check_0'); + isCheck = 0; + } + getCost(); + isChecks() + $(this).attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/carts/changeCartGoods'), { + data: { + from: from_id, + id: cartId, + isCheck: isCheck, + buyNum: buyNum + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data, 1); + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }); + + $('.con_').on('tap', '.btn_bj', function(e) { + e.stopPropagation() + if ($(this).html() == '编辑') { + $(this).html('完成'); + $(this).parent().siblings().children().find('.b_con_r1').css('display', 'none'); + $(this).parent().siblings().children().find('.b_con_r2').css('display', 'block'); + } else { + $(this).html('编辑'); + $(this).parent().siblings().children().find('.b_con_r2').css('display', 'none'); + $(this).parent().siblings().children().find('.b_con_r1').css('display', 'block'); + var inputArr = $(this).parent().siblings().find('input') + + $(this).parent().siblings().find('.num').each(function(num) { + $(this).html('×' + inputArr.eq(num).val() + ''); + }) + + } + // //console.log($(this).parent().siblings().find('.commodity_num')) + // //console.log($(this).parent().siblings().find('input')); + if ($(this).html() == '完成') { + return; + } + getCost() + }) + + $('.con_').on('tap', '.jia', function() { + // //console.log($(this).siblings('input').val()) + var that = $(this); + var cartId = $(this).parent().attr('data-cartId') + var num = +$(this).siblings('input').val() + 1; + if (num <= 0) { + mui.alert('购买数最小为1!'); + return; + } + $('.jia').attr('disabled', 'disabled'); + $('.jian').attr('disabled', 'disabled'); + $('input').attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/carts/changeCartGoods'), { + data: { + from: from_id, + id: cartId, + buyNum: num + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data, 1); + that.siblings('input').val(num); + $('.jia').removeAttr('disabled'); + $('.jian').removeAttr('disabled'); + $('input').removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.con_').on('tap', '.jian', function() { + var that = $(this); + var cartId = $(this).parent().attr('data-cartId') + var num = +$(this).siblings('input').val() - 1; + if (num <= 0) { + mui.alert('购买数最小为1!'); + return; + } + $('.jia').attr('disabled', 'disabled'); + $('.jian').attr('disabled', 'disabled'); + $('input').attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/carts/changeCartGoods'), { + data: { + id: cartId, + buyNum: num + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data, 1); + that.siblings('input').val(num); + $('.jia').removeAttr('disabled'); + $('.jian').removeAttr('disabled'); + $('input').removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.con_').on('blur', 'input', function() { + var that = $(this); + var cartId = $(this).parent().attr('data-cartId') + var num = +$(this).val(); + if (num <= 0) { + mui.alert('购买数最小为1!'); + return; + } + $('.jia').attr('disabled', 'disabled'); + $('.jian').attr('disabled', 'disabled'); + $('input').attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/carts/changeCartGoods'), { + data: { + from: from_id, + id: cartId, + buyNum: num + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data, 1); + that.siblings('input').val(num); + $('.jia').removeAttr('disabled'); + $('.jian').removeAttr('disabled'); + $('input').removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + + $('.con_').on('tap', '.b_con_r2_del', function() { + var cartId = $(this).attr('data-cartId'); + + if (confirm('确定删除?')) { + mui.ajax(hyhUrl('app/carts/delCart'), { + data: { + from: from_id, + id: cartId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否;登录成功; + var data = toJson(data, 1); + location.reload(); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + }) + + // $('.changeclass').on('tap', '.selectclass', function() { + // $('.mui-backdrop').show(); + // }) + + //选择类型 + // $('.cclass1').on('tap', '.block', function() { + // $(this).addClass('on').siblings().removeClass('on'); + // $(this).parent().attr('data-class', $(this).html()); + // }) + + // $('.closecclass').on('tap', function() { + // $('.mui-backdrop').css('display', 'none'); + // }) + + // $('.ensure').on('tap', function() { + // $('.mui-backdrop').css('display', 'none'); + // }) + + mui('.js').on('tap', '.btn_tj', function() { + var check_length = $('.con_ .check_1').length; + if (check_length == 0) { + mui.alert('请选择商品结算!'); + return; + } + mui.openWindow({ + url: 'confirmOrder.html', + id: 'confirmOrder.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_id: data_id + type: 0, + from: from_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 1000) + }) + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isOver == 1) { + num++; + getMsg(num, 10); + } + } + }) }) diff --git a/static/app2/js/shopsList.js b/static/app2/js/shopsList.js old mode 100755 new mode 100644 index 874b210..f1a6fe8 --- a/static/app2/js/shopsList.js +++ b/static/app2/js/shopsList.js @@ -1,148 +1,148 @@ -var page = 1; -var pagesize = 10; -var condition = 1; -var isjiazai = 1; -var desc = 0; - - -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - keyword = self.data_keyword; - goodsType = self.goodsType ? self.goodsType :'' - function getData(page, pagesize, condition, keyword, desc,goodsType) { - var data_set = { - page: page, - pagesize: pagesize, - condition: condition, - keyword: keyword, - desc: desc, - goodsType:goodsType - } - mui.ajax(qlgUrl('app/shops/pageQuery'), { - - data: data_set, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - - var data = toJson(data); - data = data.data; - var html = ''; - if (data.Rows == '') { - $('.mui-scroll').append('

      没有更多店铺

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - html += '

      ' + this.shopName + - '

      ' + this.shopCompany + - '

      进店
      '; - - $.each(this.goods, function() { - html += '

      ¥' + this.shopPrice + '

      '; - }); - html += '
      ' - }); - if (page == 1) { - $('.con').html(html); - } else { - $('.con').append(html); - } - isjiazai = 1; - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // alert(type); - } - }); - } - - getData(page, pagesize, 1, keyword, 0, goodsType ) - mui('.con').on('tap', '.b_title', function() { - var shopId = $(this).attr('data-shopId'); - var url = 'storeout.html'; - if (shopId == 1) { - // url='self_shop.html' - } - mui.openWindow({ - url: url, - id: url + shopId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - shopId: shopId - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - mui('.con').on('tap', '.bc_img', function() { - var goodId = $(this).attr('data-goodId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + goodId, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: goodId, - goodsType:goodsType - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - isjiazai = 0; - page++; - getData(page, pagesize, 1, keyword, 0) - } - } - }) +var page = 1; +var pagesize = 10; +var condition = 1; +var isjiazai = 1; +var desc = 0; + + +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + keyword = self.data_keyword; + goodsType = self.goodsType ? self.goodsType :'' + function getData(page, pagesize, condition, keyword, desc,goodsType) { + var data_set = { + page: page, + pagesize: pagesize, + condition: condition, + keyword: keyword, + desc: desc, + goodsType:goodsType + } + mui.ajax(qlgUrl('app/shops/pageQuery'), { + + data: data_set, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + + var data = toJson(data); + data = data.data; + var html = ''; + if (data.Rows == '') { + $('.mui-scroll').append('

      没有更多店铺

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + html += '

      ' + this.shopName + + '

      ' + this.shopCompany + + '

      进店
      '; + + $.each(this.goods, function() { + html += '

      ¥' + this.shopPrice + '

      '; + }); + html += '
      ' + }); + if (page == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + isjiazai = 1; + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + } + + getData(page, pagesize, 1, keyword, 0, goodsType ) + mui('.con').on('tap', '.b_title', function() { + var shopId = $(this).attr('data-shopId'); + var url = 'storeout.html'; + if (shopId == 1) { + // url='self_shop.html' + } + mui.openWindow({ + url: url, + id: url + shopId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + shopId: shopId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.bc_img', function() { + var goodId = $(this).attr('data-goodId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + goodId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: goodId, + goodsType:goodsType + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + isjiazai = 0; + page++; + getData(page, pagesize, 1, keyword, 0) + } + } + }) }) diff --git a/static/app2/js/shopsetting.js b/static/app2/js/shopsetting.js old mode 100755 new mode 100644 index 1d2e3f1..5acaa5e --- a/static/app2/js/shopsetting.js +++ b/static/app2/js/shopsetting.js @@ -1,19 +1,19 @@ -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - //console.log(self); - var shopId=self.id; - var shopIdObj = { - id: self.id - } - $('.row').on("tap", function() { - - var URL = $(this).attr("data-url"); - //console.log(URL); - // JZL.openWindow('income-details.html', 'income-details.html') - JZL.openWindow(URL + '.html',parseInt(shopId)) - - }) - - -}) +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId=self.id; + var shopIdObj = { + id: self.id + } + $('.row').on("tap", function() { + + var URL = $(this).attr("data-url"); + //console.log(URL); + // JZL.openWindow('income-details.html', 'income-details.html') + JZL.openWindow(URL + '.html',parseInt(shopId)) + + }) + + +}) diff --git a/static/app2/js/start.js b/static/app2/js/start.js old mode 100755 new mode 100644 index 2ae9c0e..e4f433e --- a/static/app2/js/start.js +++ b/static/app2/js/start.js @@ -1,6 +1,6 @@ function init(data) { - ////console.log(data.apk_version) - // //console.log(localStorage.getItem('jsUrl')) + //console.log(data.apk_version) + // console.log(localStorage.getItem('jsUrl')) apk_version = data.apk_version; apkUrl = data.apk_down_url; iosUrl = data.ios_down_url; @@ -39,42 +39,20 @@ function init(data) { } }); } else if(/android/.test(ua)) { - if(apk_version > ver) { if(must_update == 0) { if(confirm("发现新版本:V" + apk_version + "是否更新")) { - var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) { - if(status == 200) { - plus.nativeUI.toast("正在准备环境,请稍后!"); - sleep(1000); - var path = d.filename; //下载apk - plus.runtime.install(path); // 自动安装apk文件 - } else { - mui.alert('版本更新失败:' + status); - } - }); - dtask.start(); + downloadUpdate(apkUrl) } } else { if(confirm("发现新版本:V" + apk_version + "是否更新")) { - var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) { - if(status == 200) { - plus.nativeUI.toast("正在准备环境,请稍后!"); - sleep(1000); - var path = d.filename; //下载apk - plus.runtime.install(path); // 自动安装apk文件 - } else { - mui.alert('版本更新失败:' + status); - } - }); - dtask.start(); + downloadUpdate(apkUrl) } else { plus.runtime.quit(); } } - } else { - // //console.log('当前版本号已是最新'); + // console.log('当前版本号已是最新'); return; } } @@ -82,12 +60,49 @@ function init(data) { }) }) }; - +function downloadUpdate(apkUrl){ + let waiting = plus.nativeUI.showWaiting("正在下载更新包"); + var dtask = plus.downloader.createDownload(apkUrl, {}, function(d, status) { + if(status == 200) { + waiting.close() + plus.nativeUI.toast("正在准备环境,请稍后!"); + var path = d.filename; //下载apk + plus.runtime.install(path,{},function(){ + plus.nativeUI.alert("应用资源更新完成!",function(){ + plus.runtime.restart(); + }); + },function(e){ + plus.nativeUI.alert("更新失败["+e.code+"]:"+e.message); + }); // 自动安装apk文件 + } else { + waiting.setTitle("下载失败") + setTimeout(function(){waiting.close()}, 2000) + mui.alert('版本更新失败:' + status); + } + }); + dtask.start(); + dtask.addEventListener("statechanged",function(download, status) { + if(download.state != 4){ + var text = "("+(download.downloadedSize*100/download.totalSize).toFixed(2)+"%)" + waiting.setTitle('正在下载'+text) + } + if(download.state == 4){ + // 下载完成 + if(status == 200){ + waiting.close() + }else{ + waiting.setTitle("下载失败") + setTimeout(function(){waiting.close()}, 2000) + } + console.log("Download success: " + download.getFileName()); + } + },false) +} function jumpPage(ipxSizeBottom) { //跳转页面 var bSize = 50 + (+ipxSizeBottom) + 'px'; - var subpages = ['templete/home.html', 'templete/shops.html', '', 'templete/zhuweiba.html', + var subpages = ['templete/home.html', 'templete/shops.html', 'templete/zhugouba.html', 'templete/zhuweiba.html', 'templete/my.html' ]; var subpage_style = { @@ -102,13 +117,15 @@ function jumpPage(ipxSizeBottom) { window.addEventListener('refresh', function(e) { var my = plus.webview.getWebviewById('templete/my.html'); //触发父页面的自定义事件(refresh),从而进行刷新 var zhuweiba = plus.webview.getWebviewById('templete/zhuweiba.html'); //触发父页面的自定义事件(refresh),从而进行刷新 + var zhugouba = plus.webview.getWebviewById('templete/zhugouba.html'); //触发父页面的自定义事件(refresh),从而进行刷新 mui.fire(my, 'refresh'); mui.fire(zhuweiba, 'refresh'); + mui.fire(zhugouba, 'refresh'); }) // launchScreen(); plus.screen.lockOrientation("portrait-primary"); // plus.navigator.setStatusBarStyle('dark'); - // //console.log(plus.navigator.getStatusBarStyle()) + // console.log(plus.navigator.getStatusBarStyle()) var self = plus.webview.currentWebview(); for (var i = 0; i < subpages.length; i++) { var temp = {}; @@ -159,7 +176,41 @@ function jumpPage(ipxSizeBottom) { if (targetTab == 'templete/zhuweiba.html') { var targetTab = plus.webview.getWebviewById(targetTab); - mui.fire(targetTab, 'refresh'); + mui.fire(targetTab, 'refresh'); + var token = localStorage.getItem("token"); + if (!token) { + mui.openWindow({ + url: 'templete/login.html', + id: 'templete/login.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } } if (targetTab == 'templete/my.html') { var targetTab = plus.webview.getWebviewById(targetTab); @@ -175,13 +226,26 @@ function jumpPage(ipxSizeBottom) { width: '100%', //新页面宽度,默认为100% height: '100%' //新页面高度,默认为100% }, - extras: {}, - createNew: false, - show: {}, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, waiting: { autoShow: true, //自动显示等待框,默认为true title: '正在加载...', //等待对话框上显示的提示内容 - options: {} + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } } }) } @@ -190,17 +254,20 @@ function jumpPage(ipxSizeBottom) { } function nav(num) { -//console.log(num); $('.mui-tab-item span .img').each(function(a) { - - if (a == 2) { - - } else if (num == a && a != 2) { - // //console.log(a); - $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_1.png?version='+localStorage.getItem('version')); + if (num == a) { + if(a == 2){ + $(this).attr('src', './img/2_1.png'); + }else{ + $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_1.png?version='+localStorage.getItem('version')); + } } else { - $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_0.png?version='+localStorage.getItem('version')); - } + if(a == 2){ + $(this).attr('src', './img/2_0.png'); + }else{ + $(this).attr('src', 'http://img.zgqlg.com.cn/static/app2/img/nav_' + a + '_0.png?version='+localStorage.getItem('version')); + } + } }) } @@ -222,6 +289,7 @@ document.addEventListener('plusready', function() { }, false); // 判断启动方式 function checkArguments() { + // console.log("plus.runtime.launcher: " + plus.runtime.launcher); var args = plus.runtime.arguments; if (args) { // 处理args参数,如打开新页面等 @@ -229,7 +297,7 @@ function checkArguments() { var id; var datago = {}; var arrgo = args.slice(args.indexOf('//') + 2).split(': '); - // //console.log(args.slice(args.indexOf('//')+2).split(':')) + // console.log(args.slice(args.indexOf('//')+2).split(':')) if (arrgo[0] == 'goods_id') { url = 'details.html'; id = arrgo[1]; @@ -257,11 +325,21 @@ function checkArguments() { }, extras: datago, createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: {}, + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, waiting: { autoShow: true, //自动显示等待框,默认为true title: '正在加载...', //等待对话框上显示的提示内容 - options: {} + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } } }) } @@ -270,5 +348,6 @@ function checkArguments() { // 处理从后台恢复 document.addEventListener('newintent', function() { + // console.log("addEventListener: newintent"); checkArguments(); }, false); diff --git a/static/app2/js/store_commodity.js b/static/app2/js/store_commodity.js old mode 100755 new mode 100644 index cd5fe59..76fcab5 --- a/static/app2/js/store_commodity.js +++ b/static/app2/js/store_commodity.js @@ -1,305 +1,309 @@ -$('.recommend_con').html(''); -var msort = 1; -var shopId = localStorage.getItem('shopId'); -var nowpage = 1; -var condition = 1; -var desc = 0; -var pagesize = 5; -var isload = false; -mui.init({ - pullRefresh: { - container: '#pullrefresh', - down: { - style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 - color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 - height: '50px', //可选,默认50px.下拉刷新控件的高度, - range: '100px', //可选 默认100px,控件可下拉拖拽的范围 - offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 - // auto: true, //可选,默认false.首次加载自动上拉刷新一次 - contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 - contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 - contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 - callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; - }, - up: { - contentrefresh: '正在加载...', - callback: pullupRefresh - } - } -}); -var count = 1; - -function pullupRefresh() { - setTimeout(function() { - // window.location.reload(); - mui('#pullrefresh').pullRefresh().endPullupToRefresh(); - nowpage += 1 - mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { - data: { - page: nowpage, - PerPage: 10, - shopId: shopId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - - // var data = toJson(data, 1); - if (data.status == 1) { - //console.log(data); - - var html = ''; - var data = data.data; - if (data.Rows == '') { - // $('.recommend_con').append( - // '

      没有更多商品

      '); - $('.mui-pull-caption').html("没有更多商品") - - return; - } - $.each(data.Rows, function() { - html += '
      ' + this.goodsName + - '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率   ' + this.discountRate + - '%
      '; - }); - - $('#recommend_con_').append(html); - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - mui.alert(errorThrown); - } - }); - // //console.log(order_class) - // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { - // - // data: { - // page: count, - // shopId: shopId, - // pageSize: 10, - // msort: condition, - // mdesc: desc - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // // //console.log(data.data.goodsFavoritesNum) - // // //console.log(data.data.Rows) - // - // var data = toJson(data); - // data = data.data; - // var html = ''; - // $.each(data.Rows, function() { - // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' - // }); - // $('.recommend_con').append(html); - // - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - }, 500); -} - -/** - * 下拉刷新具体业务实现 - */ -function pulldownRefresh() { - setTimeout(function() { - window.location.reload(); - mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed - }, 1500); -} -mui.plusReady(function() { - var costnum = 0; - getRecommend(nowpage, pagesize) - $('.commoditylistnav').on('tap', '.nav_block', function() { - page = 1; - count = 1; - $(this).addClass('on').siblings().removeClass('on'); - condition = $(this).attr('data-condition'); - if ($('#cost_btn').hasClass('on')) { - costnum += 1; - if (costnum % 2 == 1) { - $('#cost_btn').html('价格 '); - desc = 0; - } else if (costnum % 2 == 0) { - $('#cost_btn').html('价格 '); - desc = 1; - } - } else { - $('#cost_btn').html('价格 ') - costnum = 0; - desc = 1 - } - // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { - // data: { - // shopId: shopId, - // pageSize: 10, - // page: 1, - // msort: condition, - // mdesc: desc - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data); - // data = data.data; - // var html = ''; - // $.each(data.Rows, function() { - // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' - // }); - // $('.recommend_con').html(html); - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - }) - // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { - // data: { - // shopId: shopId, - // pageSize: 10, - // page: 1, - // msort: 1, - // mdesc: 0 - // }, - // dataType: 'json', //服务器返回json格式数据 - // type: 'post', //HTTP请求类型 - // timeout: 10000, //超时时间设置为10秒; - // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // var data = toJson(data); - // data = data.data; - // var html = ''; - // $.each(data.Rows, function() { - // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' - // }); - // $('.recommend_con').html(html); - // $('.recommend_con_block .img').height($('.recommend_con_block .img').width()); - // - // // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198); - // }, - // error: function(xhr, type, errorThrown) { //异常处理; - // // mui.alert(type); - // } - // }); - $('.recommend_con').on('tap', '.recommend_con_block', function() { - var good_id = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + good_id, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: good_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - - - - function getRecommend(nowpage, pagesize) { - var recommenddata = { - page: nowpage ? nowpage : 1, - PerPage: pagesize ? pagesize : 10 - } - recommenddata.shopId = shopId - //console.log(recommenddata); - if (isload == true) { - return; - } - isload = true - mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { - data: recommenddata, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - console.log(recommenddata); - - // var data = toJson(data, 1); - if (data.status == 1) { - console.log(data); - - var html = ''; - var data = data.data; - if (data.Rows == '') { - $('.recommend_con').append( - '

      没有更多商品

      '); - - return; - } - $.each(data.Rows, function() { - html += '
      ' + this.goodsName + - '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率   ' + this.discountRate + - '%
      '; - }); - if (nowpage == 1) { - //console.log(222); - $('#recommend_con_').html(html); - } else { - $('#recommend_con_').append(html); - } - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - } else { - mui.alert(data.msg) - } - isload = false - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - } -}) - -setInterval(function() { - $('.recommend_con_block img').height($('.recommend_con_block img').width()); - // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198); +$('.recommend_con').html(''); +var msort = 1; +var shopId = localStorage.getItem('shopId'); +var nowpage = 1; +var condition = 1; +var desc = 0; +var pagesize = 5; +var isload = false; +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + } + } +}); +var count = 1; + +function pullupRefresh() { + setTimeout(function() { + // window.location.reload(); + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); + nowpage += 1 + mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { + data: { + from_id, + page: nowpage, + PerPage: 10, + shopId: shopId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + + // var data = toJson(data, 1); + if (data.status == 1) { + //console.log(data); + + var html = ''; + var data = data.data; + if (data.Rows == '') { + // $('.recommend_con').append( + // '

      没有更多商品

      '); + $('.mui-pull-caption').html("没有更多商品") + + return; + } + $.each(data.Rows, function() { + html += '
      ' + this.goodsName + + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + }); + + $('#recommend_con_').append(html); + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + mui.alert(errorThrown); + } + }); + // //console.log(order_class) + // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { + // + // data: { + // page: count, + // shopId: shopId, + // pageSize: 10, + // msort: condition, + // mdesc: desc + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(data.data.goodsFavoritesNum) + // // //console.log(data.data.Rows) + // + // var data = toJson(data); + // data = data.data; + // var html = ''; + // $.each(data.Rows, function() { + // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' + // }); + // $('.recommend_con').append(html); + // + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + }, 500); +} + +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +mui.plusReady(function() { + var costnum = 0; + var self = plus.webview.currentWebview(); + from_id = self.from_id?self.from_id:0; + getRecommend(nowpage, pagesize) + $('.commoditylistnav').on('tap', '.nav_block', function() { + page = 1; + count = 1; + $(this).addClass('on').siblings().removeClass('on'); + condition = $(this).attr('data-condition'); + if ($('#cost_btn').hasClass('on')) { + costnum += 1; + if (costnum % 2 == 1) { + $('#cost_btn').html('价格 '); + desc = 0; + } else if (costnum % 2 == 0) { + $('#cost_btn').html('价格 '); + desc = 1; + } + } else { + $('#cost_btn').html('价格 ') + costnum = 0; + desc = 1 + } + // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { + // data: { + // shopId: shopId, + // pageSize: 10, + // page: 1, + // msort: condition, + // mdesc: desc + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data); + // data = data.data; + // var html = ''; + // $.each(data.Rows, function() { + // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' + // }); + // $('.recommend_con').html(html); + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + }) + // mui.ajax(hyhUrl('app/Shops/getShopGoods'), { + // data: { + // shopId: shopId, + // pageSize: 10, + // page: 1, + // msort: 1, + // mdesc: 0 + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data); + // data = data.data; + // var html = ''; + // $.each(data.Rows, function() { + // html += '
      自营'+this.goodsName+'
      ¥'+this.shopPrice+'满减
      可用木吉抵扣20%货款
      ' + // }); + // $('.recommend_con').html(html); + // $('.recommend_con_block .img').height($('.recommend_con_block .img').width()); + // + // // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198); + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + $('.recommend_con').on('tap', '.recommend_con_block', function() { + var good_id = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + good_id, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: good_id, + from_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + + + + function getRecommend(nowpage, pagesize) { + var recommenddata = { + page: nowpage ? nowpage : 1, + PerPage: pagesize ? pagesize : 10 + } + recommenddata.shopId = shopId + //console.log(recommenddata); + if (isload == true) { + return; + } + isload = true + mui.ajax(qlgUrl('app/Shopping/getShopIndexGoodsList'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + console.log(recommenddata); + + // var data = toJson(data, 1); + if (data.status == 1) { + console.log(data); + + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.recommend_con').append( + '

      没有更多商品

      '); + + return; + } + $.each(data.Rows, function() { + html += '
      ' + this.goodsName + + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + }); + if (nowpage == 1) { + //console.log(222); + $('#recommend_con_').html(html); + } else { + $('#recommend_con_').append(html); + } + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + } else { + mui.alert(data.msg) + } + isload = false + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + } +}) + +setInterval(function() { + $('.recommend_con_block img').height($('.recommend_con_block img').width()); + // $('.recommend_con_block').height($('.recommend_con_block').width() * 266 / 198); }, 100) diff --git a/static/app2/js/store_home.1.js b/static/app2/js/store_home.1.js old mode 100755 new mode 100644 index b907f33..2a7d54f --- a/static/app2/js/store_home.1.js +++ b/static/app2/js/store_home.1.js @@ -1,306 +1,309 @@ -$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png')); -$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png')); -$('.recommend_title img').eq(0).css('display', 'none'); -$('.recommend_title img').eq(1).css('display', 'none'); -var shopId = localStorage.getItem('shopId'); -mui.plusReady(function() { - // var data = JSON.parse(localStorage.getItem('shop_data')); - // var Intent = plus.android.importClass("android.content.Intent"); - // //console.log(Intent) - // - mui.ajax(ectUrl('app/Shops/getHome'), { - data: { - shopId: shopId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - if (data.status == 1) { - var data = data.data; - if (data.shop.shopAds.length > 0) { - var html = ''; - $.each(data.shop.shopAds, function() { - html += '
      ' - }); - $('#top_banner .swiper-wrapper').html(html); - var swiper = new Swiper('#top_banner', { - pagination: '#top_banner_pagination', - spaceBetween: 0, - loop: true, - autoplay: 3500, - autoplayDisableOnInteraction: false - }); - $('#top_banner').height($('#top_banner').width() * 420 / 715); - $('#top_banner img').height($('#top_banner img').width() * 420 / 715); - } else { - $('#top_banner').remove() - } - - if (data.couponList.coupons.length > 0) { - var html_ = ''; - $.each(data.couponList.coupons, function(num) { - html_ += '

      点击领取

      满' + this.useMoney + '使用

      ' + this.couponValue + - '

      ' - }); - $('#timer_swiper .swiper-wrapper').html(html_); - $('.recommend_title img').eq(0).css('display', 'block'); - var swiper = new Swiper('#timer_swiper', { - slidesPerView: 2.3, - paginationClickable: true, - spaceBetween: 0, - freeMode: true - }); - $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300); - $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300); - } else { - $('.time').css('display', 'none'); - } - - // var html3 = ''; - // $.each(data.shopcats, function() { - // html3 += '
      ' + this.catName + '
      '; - // }); - // $('.label').html(html3); - // $('.l_block').each(function(num) { - // if((num + 1) % 4 == 0) { - // $(this).addClass('lbrr'); - // } - // }) - var html4 = ''; - if (data.rec == '') { - $('.recommend_title').eq(1).css('display', 'none'); - } else { - $.each(data.rec, function() { - html4 += '
      自营' + this.goodsName + - '
      ¥' + this.shopPrice + - '满减
      可用木吉抵扣20%货款
      ' - }); - $('.recommend_con').html(html4); - $('.recommend_title img').eq(1).css('display', 'block'); - $('.rcb_img').height($('.rcb_img').width()) - } - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - //领取优惠券 - $('.time').on('tap', '.home_yhj', function() { - var couponId = $(this).attr('data-couponId'); - mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { - // headers: { - // "HYH-Token": token - // }, - data: { - couponId: couponId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - var data = toJson(data); - mui.alert(data.msg); - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - $('.recommend_con').on('tap', '.recommend_con_block', function() { - var good_id = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + good_id, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: good_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - localStorage.setItem('shop_data', ''); -}) - -setInterval(function() { - $('.cnxh_block img').height($('.cnxh_block img').width()); - $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); -}, 200) - -var scheme = ""; -var arr = []; -var title = {}; -$('.go').on("tap", function() { - if (0 == arr.length) { - //console.log(111) - } - //底部弹出选择地图软件 - plus.nativeUI.actionSheet({ - title: "请选择!", - cancel: "取消", - buttons: arr - }, function(e) { - var title = arr[e.index - 1].title; - // var i1 = new Intent(); - switch (title) { - case "百度地图": - // plus.runtime.openURL( "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=40.007623,116.360582&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", function(error){ alert("打开百度地图失败")}); - launchTest() -// if (plus.os.name == "Android") { -// plus.runtime.launchApplication({ -// pname: "com.android.browser", -// extra: { -// // url: "://map/direction?origin=latlng:33,33|name:我的位置&destination=latlng:43.335,39.966|name:beijing&mode=driving", -// // url:"://map/direction?destination=latlng:33,44|name:geijign&mode=driving&" + // 导航路线方式 -// // "region=武汉" -// -// url:"http://www.html5plus.org" -// -// // url :"baidumap://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit" -// // url : "http://api.map.baidu.com/direction?origin=latlng:42.111,111|name:当前位置&destination=latlng:31,111|name:终点&mode=driving®ion=中国&output=html" -// } -// }, function(e) { -// alert("Open system default browser failed: " + e.message); -// -// }); -// } else if (plus.os.name == "iOS") { -// plus.runtime.launchApplication({ -// action: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335, 39.966|name:beijing&mode=driving"//"第三方提供的uri" -// }, function(e) { -// alert("Open system default browser failed: " + e.message); -// }); -// } - break; - case "高德地图": - - } - }); - - - -}) -var maps=[{pname:'com.baidu.BaiduMap',action:'baidumap',name:'百度地图'},{pname:'com.autonavi.minimap',action:'iosamap',name:'高德地图'},{pname:'com.google.android.apps.maps',action:'com.google.android.apps.maps',name:'谷歌地图'},{pname:'com.tencent.map',action:'com.google.android.apps.maps',name:'腾讯地图'}] -// checkApp("com.baidu.BaiduMap", "baidumap", "百度地图") -// checkApp("com.autonavi.minimap", "iosamap", "高德地图") -// checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图") -// 判断地图软件是否安装 -// maps= toJson(maps) -// //console.log(maps) -// $.each(maps,function(i,v){ -// -// var that=this -// -// checkApp(that.pname, that.action, that.name) -// }) -// function checkApp(pn, ac, name) { -// if (plus.runtime.isApplicationExist({ -// pname: pn,//包名 -// action: ac //ios包名 -// })) { -// // //console.log("微信应用已安装"); -// title = { -// title: name -// }; -// arr.push(title) -// } else { -// // //console.log("微信应用未安装"); -// // title={}; -// // arr.push(title) -// -// } -// } - -function launchTest() { - if (plus.os.name == "Android") { - plus.runtime.launchApplication( {pname:"com.baidu.BaiduMap" - ,extra:{url:"://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit&sy=3&index=0&target=1&src=andr.baidu.openAPIdemo"}}, function ( e ) { - alert( "Open system default browser failed: " + e.message );}) -// plus.runtime.launchApplication({ -// -// pname: "com.baidu.BaiduMap", -// // pname: "bdapp", -// -// // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super; -// -// extra: { -// url:"baidumap://map/bikenavi?origin=39.98871,116.43234&destination=39.91441,116.40405&coord_type=bd09ll&src=andr.baidu.openAPIdemo" -// // url:"bdapp://map/direction?destination=latlng:31,111|name:终点&mode=driving®ion=中国&src=andr.baidu.openAPIdemo" -// // url:"http://baidu.com" -// // url:"com.baidu.BaiduMap://map/direction?origin=中关村&destination=五道口&mode=driving®ion=北京 " -// // url: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335,39.966|name:beijing&mode=driving" -// } -// }, function(e) { -// alert("Open system default browser failed: " + e.message); -// -// }); - } else if (plus.os.name == "iOS") { - plus.runtime.launchApplication({ - action: "第三方提供的uri" - }, function(e) { - alert("Open system default browser failed: " + e.message); - }); - } -} - - launchTest() - - - - - - -mui('.gothere').on("tap", ".gt_con", function(e) { - var idx = $(this).index(); - var html = ''; - - switch (idx) { - case 0: - - break; - case 1: - - break; - case 2: - // $('.gt_con_con1').css('display','none') - - $('.gt_con_con').toggle() - html = - '
      ' - $('.row .name').css("width", "60%") - $('.gt_con_con').html(html) - break; - - } -}) +$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png')); +$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png')); +$('.recommend_title img').eq(0).css('display', 'none'); +$('.recommend_title img').eq(1).css('display', 'none'); +var shopId = localStorage.getItem('shopId'); +mui.plusReady(function() { + // var data = JSON.parse(localStorage.getItem('shop_data')); + // var Intent = plus.android.importClass("android.content.Intent"); + // //console.log(Intent) + // + var self = plus.webview.currentWebview(); + from_id = self.from_id?self.from_id:0; + mui.ajax(ectUrl('app/Shops/getHome'), { + data: { + shopId: shopId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + if (data.status == 1) { + var data = data.data; + if (data.shop.shopAds.length > 0) { + var html = ''; + $.each(data.shop.shopAds, function() { + html += '
      ' + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + $('#top_banner').height($('#top_banner').width() * 420 / 715); + $('#top_banner img').height($('#top_banner img').width() * 420 / 715); + } else { + $('#top_banner').remove() + } + + if (data.couponList.coupons.length > 0) { + var html_ = ''; + $.each(data.couponList.coupons, function(num) { + html_ += '

      点击领取

      满' + this.useMoney + '使用

      ' + this.couponValue + + '

      ' + }); + $('#timer_swiper .swiper-wrapper').html(html_); + $('.recommend_title img').eq(0).css('display', 'block'); + var swiper = new Swiper('#timer_swiper', { + slidesPerView: 2.3, + paginationClickable: true, + spaceBetween: 0, + freeMode: true + }); + $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300); + $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300); + } else { + $('.time').css('display', 'none'); + } + + // var html3 = ''; + // $.each(data.shopcats, function() { + // html3 += '
      ' + this.catName + '
      '; + // }); + // $('.label').html(html3); + // $('.l_block').each(function(num) { + // if((num + 1) % 4 == 0) { + // $(this).addClass('lbrr'); + // } + // }) + var html4 = ''; + if (data.rec == '') { + $('.recommend_title').eq(1).css('display', 'none'); + } else { + $.each(data.rec, function() { + html4 += '
      自营' + this.goodsName + + '
      ¥' + this.shopPrice + + '满减
      可用木吉抵扣20%货款
      ' + }); + $('.recommend_con').html(html4); + $('.recommend_title img').eq(1).css('display', 'block'); + $('.rcb_img').height($('.rcb_img').width()) + } + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + //领取优惠券 + $('.time').on('tap', '.home_yhj', function() { + var couponId = $(this).attr('data-couponId'); + mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { + // headers: { + // "HYH-Token": token + // }, + data: { + couponId: couponId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + var data = toJson(data); + mui.alert(data.msg); + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.recommend_con').on('tap', '.recommend_con_block', function() { + var good_id = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + good_id, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: good_id, + from_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + localStorage.setItem('shop_data', ''); +}) + +setInterval(function() { + $('.cnxh_block img').height($('.cnxh_block img').width()); + $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); +}, 200) + +var scheme = ""; +var arr = []; +var title = {}; +$('.go').on("tap", function() { + if (0 == arr.length) { + //console.log(111) + } + //底部弹出选择地图软件 + plus.nativeUI.actionSheet({ + title: "请选择!", + cancel: "取消", + buttons: arr + }, function(e) { + var title = arr[e.index - 1].title; + // var i1 = new Intent(); + switch (title) { + case "百度地图": + // plus.runtime.openURL( "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=40.007623,116.360582&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", function(error){ alert("打开百度地图失败")}); + launchTest() +// if (plus.os.name == "Android") { +// plus.runtime.launchApplication({ +// pname: "com.android.browser", +// extra: { +// // url: "://map/direction?origin=latlng:33,33|name:我的位置&destination=latlng:43.335,39.966|name:beijing&mode=driving", +// // url:"://map/direction?destination=latlng:33,44|name:geijign&mode=driving&" + // 导航路线方式 +// // "region=武汉" +// +// url:"http://www.html5plus.org" +// +// // url :"baidumap://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit" +// // url : "http://api.map.baidu.com/direction?origin=latlng:42.111,111|name:当前位置&destination=latlng:31,111|name:终点&mode=driving®ion=中国&output=html" +// } +// }, function(e) { +// alert("Open system default browser failed: " + e.message); +// +// }); +// } else if (plus.os.name == "iOS") { +// plus.runtime.launchApplication({ +// action: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335, 39.966|name:beijing&mode=driving"//"第三方提供的uri" +// }, function(e) { +// alert("Open system default browser failed: " + e.message); +// }); +// } + break; + case "高德地图": + + } + }); + + + +}) +var maps=[{pname:'com.baidu.BaiduMap',action:'baidumap',name:'百度地图'},{pname:'com.autonavi.minimap',action:'iosamap',name:'高德地图'},{pname:'com.google.android.apps.maps',action:'com.google.android.apps.maps',name:'谷歌地图'},{pname:'com.tencent.map',action:'com.google.android.apps.maps',name:'腾讯地图'}] +// checkApp("com.baidu.BaiduMap", "baidumap", "百度地图") +// checkApp("com.autonavi.minimap", "iosamap", "高德地图") +// checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图") +// 判断地图软件是否安装 +// maps= toJson(maps) +// //console.log(maps) +// $.each(maps,function(i,v){ +// +// var that=this +// +// checkApp(that.pname, that.action, that.name) +// }) +// function checkApp(pn, ac, name) { +// if (plus.runtime.isApplicationExist({ +// pname: pn,//包名 +// action: ac //ios包名 +// })) { +// // //console.log("微信应用已安装"); +// title = { +// title: name +// }; +// arr.push(title) +// } else { +// // //console.log("微信应用未安装"); +// // title={}; +// // arr.push(title) +// +// } +// } + +function launchTest() { + if (plus.os.name == "Android") { + plus.runtime.launchApplication( {pname:"com.baidu.BaiduMap" + ,extra:{url:"://map/direction?origin=name:对外经贸大学|latlng:39.98871,116.43234&destination=西直门&coord_type=bd09ll&mode=transit&sy=3&index=0&target=1&src=andr.baidu.openAPIdemo"}}, function ( e ) { + alert( "Open system default browser failed: " + e.message );}) +// plus.runtime.launchApplication({ +// +// pname: "com.baidu.BaiduMap", +// // pname: "bdapp", +// +// // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super; +// +// extra: { +// url:"baidumap://map/bikenavi?origin=39.98871,116.43234&destination=39.91441,116.40405&coord_type=bd09ll&src=andr.baidu.openAPIdemo" +// // url:"bdapp://map/direction?destination=latlng:31,111|name:终点&mode=driving®ion=中国&src=andr.baidu.openAPIdemo" +// // url:"http://baidu.com" +// // url:"com.baidu.BaiduMap://map/direction?origin=中关村&destination=五道口&mode=driving®ion=北京 " +// // url: "://map/direction?origin=latlng:114,33|name:我的位置&destination=latlng:116.335,39.966|name:beijing&mode=driving" +// } +// }, function(e) { +// alert("Open system default browser failed: " + e.message); +// +// }); + } else if (plus.os.name == "iOS") { + plus.runtime.launchApplication({ + action: "第三方提供的uri" + }, function(e) { + alert("Open system default browser failed: " + e.message); + }); + } +} + + launchTest() + + + + + + +mui('.gothere').on("tap", ".gt_con", function(e) { + var idx = $(this).index(); + var html = ''; + + switch (idx) { + case 0: + + break; + case 1: + + break; + case 2: + // $('.gt_con_con1').css('display','none') + + $('.gt_con_con').toggle() + html = + '
      ' + $('.row .name').css("width", "60%") + $('.gt_con_con').html(html) + break; + + } +}) diff --git a/static/app2/js/store_home.js b/static/app2/js/store_home.js old mode 100755 new mode 100644 index 71a50ab..69dfc11 --- a/static/app2/js/store_home.js +++ b/static/app2/js/store_home.js @@ -1,351 +1,352 @@ -$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png')); -$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png')); -$('.recommend_title img').eq(0).css('display', 'none'); -$('.recommend_title img').eq(1).css('display', 'none'); - var shopId = localStorage.getItem('shopId'); - var shopLat = localStorage.getItem('shopLat'); - var shopLng = localStorage.getItem('shopLng'); - var shopName = localStorage.getItem('shopName'); - var phone = localStorage.getItem('phone'); - var userName = localStorage.getItem('userName'); -mui.plusReady(function() { - // var data = JSON.parse(localStorage.getItem('shop_data')); -var self = plus.webview.currentWebview(); - var userLat=''; - var userLng=''; - var scheme = ""; - var arr = []; - var title = {}; - var shopAddress=""; - // 加载地图 - getLocation(function(data) { - // console.log(data); - if (1 == data.status) { - $('#lng').val(data.lng); - $('#lat').val(data.lat); - getMap(shopLng, shopLat) - // //console.log(JSON.stringify(data)); - } else { - mui.alert(data.errStr); - return; - } - }); - $.getJSON('http://api.map.baidu.com/geocoder/v2/?ak=Zm7kae5pzZogp8a0uwIOlyyz&callback=?&location='+shopLat+','+shopLng+'&output=json&pois=1',function(res){ - // //console.log(res); - //addressComponent => {city: "广州市", district: "天河区", province: "广东省", street: "广州大道", street_number: "中922号-之101-128"} - // //console.log(res.result.addressComponent.city) - $(".shopAddress").html(res.result.formatted_address); - // $("#location-r").html(res.result.addressComponent.city); - - }) -// $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(){ -// alert(remote_ip_info.country);//国家 -// alert(remote_ip_info.province);//省份 -// alert(remote_ip_info.city);//城市 -// }); -// 获取用户地址 - -plus.geolocation.getCurrentPosition(function (p) { - //console.log(p.coords.latitude); - //console.log(p.coords.longitude); -userLat=p.coords.latitude; -userLng=p.coords.longitude -},function (err) { - -}) -// mui.ajax(ectUrl('app/Shops/getHome'), { -// data: { -// shopId: shopId -// }, -// dataType: 'json', //服务器返回json格式数据 -// type: 'post', //HTTP请求类型 -// timeout: 10000, //超时时间设置为10秒; -// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; -// -// if (data.status == 1) { -// var data = data.data; -// if (data.shop.shopAds.length > 0) { -// var html = ''; -// $.each(data.shop.shopAds, function() { -// html += '
      ' -// }); -// $('#top_banner .swiper-wrapper').html(html); -// var swiper = new Swiper('#top_banner', { -// pagination: '#top_banner_pagination', -// spaceBetween: 0, -// loop: true, -// autoplay: 3500, -// autoplayDisableOnInteraction: false -// }); -// $('#top_banner').height($('#top_banner').width() * 420 / 715); -// $('#top_banner img').height($('#top_banner img').width() * 420 / 715); -// } else { -// $('#top_banner').remove() -// } -// -// if (data.couponList.coupons.length > 0) { -// var html_ = ''; -// $.each(data.couponList.coupons, function(num) { -// html_ += '

      点击领取

      满' + this.useMoney + '使用

      ' + this.couponValue + -// '

      ' -// }); -// $('#timer_swiper .swiper-wrapper').html(html_); -// $('.recommend_title img').eq(0).css('display', 'block'); -// var swiper = new Swiper('#timer_swiper', { -// slidesPerView: 2.3, -// paginationClickable: true, -// spaceBetween: 0, -// freeMode: true -// }); -// $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300); -// $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300); -// } else { -// $('.time').css('display', 'none'); -// } -// -// // var html3 = ''; -// // $.each(data.shopcats, function() { -// // html3 += '
      ' + this.catName + '
      '; -// // }); -// // $('.label').html(html3); -// // $('.l_block').each(function(num) { -// // if((num + 1) % 4 == 0) { -// // $(this).addClass('lbrr'); -// // } -// // }) -// var html4 = ''; -// if (data.rec == '') { -// $('.recommend_title').eq(1).css('display', 'none'); -// } else { -// $.each(data.rec, function() { -// html4 += '
      自营' + this.goodsName + -// '
      ¥' + this.shopPrice + -// '满减
      可用木吉抵扣20%货款
      ' -// }); -// $('.recommend_con').html(html4); -// $('.recommend_title img').eq(1).css('display', 'block'); -// $('.rcb_img').height($('.rcb_img').width()) -// } -// } else { -// mui.alert(data.msg) -// } -// }, -// error: function(xhr, type, errorThrown) { //异常处理; -// // mui.alert(type); -// } -// }); - //领取优惠券 - $('.time').on('tap', '.home_yhj', function() { - var couponId = $(this).attr('data-couponId'); - mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { - // headers: { - // "HYH-Token": token - // }, - data: { - couponId: couponId - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - - var data = toJson(data); - mui.alert(data.msg); - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - }) - $('.recommend_con').on('tap', '.recommend_con_block', function() { - var good_id = $(this).attr('data-goodsId'); - mui.openWindow({ - url: 'details.html', - id: 'details.html' + good_id, - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_id: good_id - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - }) - localStorage.setItem('shop_data', ''); - - - setInterval(function() { - $('.cnxh_block img').height($('.cnxh_block img').width()); - $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); - }, 200) - - - - - - $('.go').on("tap", function() { - isHasApp() - }) - - - var maps = [{ - pname: 'com.baidu.BaiduMap', - action: 'baidumap', - name: '百度地图' - }, { - pname: 'com.autonavi.minimap', - action: 'iosamap', - name: '高德地图' - } - // , { - // pname: 'com.google.android.apps.maps', - // action: 'com.google.android.apps.maps', - // name: '谷歌地图' - // } - // , { - // pname: 'com.tencent.map', - // action: 'com.google.android.apps.maps', - // name: '腾讯地图' - // }, - ] - // checkApp("com.baidu.BaiduMap", "baidumap", "百度地图") - // checkApp("com.autonavi.minimap", "iosamap", "高德地图") - // checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图") - // 判断地图软件是否安装 - // maps= toJson(maps) - // //console.log(maps) - $.each(maps, function(i, v) {//不能写进点击事件函数里 不然点击一次增加一个title - var that = this - checkApp(that.pname, that.action, that.name) - }) - function isHasApp() { - if (0 == arr.length) { -// plus.nativeUI.confirm("没有地图软件??请安装", function(i) { -// if (0 == i.index) { - var startpos= bMapTransQQMap(userLng, userLat) - var endpos = bMapTransQQMap(shopLng, shopLat) - //console.log(userLng); - var urlStr = encodeURI('http://uri.amap.com/navigation?from='+startpos.lng+','+startpos.lat+',startpoint&to='+endpos.lng+','+endpos.lat+',endpoint&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0') -plus.runtime.openURL(urlStr) -// plus.runtime.openURL('http://uri.amap.com/navigation?from=116.43234,39.98871,当前位置&to=121,31,站点&mode=car&src=公司名称&callnative=0' // androidMarket('com.baidu.BaiduMap') -// // } -// -// ) - return false - } - openMapApp() - } - - function openMapApp() { - //底部弹出选择地图软件 - plus.nativeUI.actionSheet({ - title: "请选择!", - cancel: "取消", - buttons: arr - }, function(e) { - - var title = arr[e.index - 1].title; - // var i1 = new Intent(); - switch (title) { - case "百度地图": - // if (plus.os.name == "Android") { - // plus.runtime.openURL( - // "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=31.236244,121.480239&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", - // function(error) { - // mui.alert('打开' + title + '失败'); - // }); - // } - goMaps( - "baidumap://map/direction?origin=我的位置&destination="+shopLat+","+shopLng+"&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu" - ) - - break; - case "高德地图": - - var endpos = bMapTransQQMap(shopLng, shopLat) - // plus.runtime.openURL('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng + - // '&mode=driving®ion=www&output=html&src="全亮共"', - // function(e) { - // mui.alert('打开' + title + '失败'); - // }) - goMaps('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng + - '&mode=driving®ion='+shopName+'&output=html&src="全亮共"') - - break; - } - }) - } - - function goMaps(url) { - var mContext = plus.android.runtimeMainActivity(); - var Uri = plus.android.importClass('android.net.Uri'); - var Intent = plus.android.importClass('android.content.Intent'); - var intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - mContext.startActivity(intent); - } - - function checkApp(pn, ac, name) { // pname:android 包名 action:ios包名 name:用作底部弹出 - - if (plus.runtime.isApplicationExist({ - pname: pn, //包名 - action: ac //ios包名 - })) { - // //console.log("微信应用已安装"); - title = { - title: name - }; - arr.push(title) - } else { - // //console.log("微信应用未安装"); - // title={}; - // arr.push(title) - - } - } - - mui('.gothere').on("tap", ".gt_con", function(e) { - var idx = $(this).index(); - var html = ''; - switch (idx) { - case 0: - break; - case 1: - break; - case 2: - // $('.gt_con_con1').css('display','none') - - $('.gt_con_con').toggle() - html = - '
      ' - $('.row .name').css("width", "60%") - $('.gt_con_con').html(html) - break; - - } - }) -}) +$('.recommend_title img').eq(0).attr('src', hyhImgUrl('static/app2/img/goods_title.png')); +$('.recommend_title img').eq(1).attr('src', hyhImgUrl('static/app2/img/coupon_title.png')); +$('.recommend_title img').eq(0).css('display', 'none'); +$('.recommend_title img').eq(1).css('display', 'none'); + var shopId = localStorage.getItem('shopId'); + var shopLat = localStorage.getItem('shopLat'); + var shopLng = localStorage.getItem('shopLng'); + var shopName = localStorage.getItem('shopName'); + var phone = localStorage.getItem('phone'); + var userName = localStorage.getItem('userName'); +mui.plusReady(function() { + // var data = JSON.parse(localStorage.getItem('shop_data')); +var self = plus.webview.currentWebview(); +from_id = self.from_id?self.from_id:0; + var userLat=''; + var userLng=''; + var scheme = ""; + var arr = []; + var title = {}; + var shopAddress=""; + // 加载地图 + getLocation(function(data) { + // console.log(data); + if (1 == data.status) { + $('#lng').val(data.lng); + $('#lat').val(data.lat); + getMap(shopLng, shopLat) + // //console.log(JSON.stringify(data)); + } else { + mui.alert(data.errStr); + return; + } + }); + $.getJSON('http://api.map.baidu.com/geocoder/v2/?ak=Zm7kae5pzZogp8a0uwIOlyyz&callback=?&location='+shopLat+','+shopLng+'&output=json&pois=1',function(res){ + // //console.log(res); + //addressComponent => {city: "广州市", district: "天河区", province: "广东省", street: "广州大道", street_number: "中922号-之101-128"} + // //console.log(res.result.addressComponent.city) + $(".shopAddress").html(res.result.formatted_address); + // $("#location-r").html(res.result.addressComponent.city); + + }) +// $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js',function(){ +// alert(remote_ip_info.country);//国家 +// alert(remote_ip_info.province);//省份 +// alert(remote_ip_info.city);//城市 +// }); +// 获取用户地址 + +plus.geolocation.getCurrentPosition(function (p) { + //console.log(p.coords.latitude); + //console.log(p.coords.longitude); +userLat=p.coords.latitude; +userLng=p.coords.longitude +},function (err) { + +}) +// mui.ajax(ectUrl('app/Shops/getHome'), { +// data: { +// shopId: shopId +// }, +// dataType: 'json', //服务器返回json格式数据 +// type: 'post', //HTTP请求类型 +// timeout: 10000, //超时时间设置为10秒; +// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; +// +// if (data.status == 1) { +// var data = data.data; +// if (data.shop.shopAds.length > 0) { +// var html = ''; +// $.each(data.shop.shopAds, function() { +// html += '
      ' +// }); +// $('#top_banner .swiper-wrapper').html(html); +// var swiper = new Swiper('#top_banner', { +// pagination: '#top_banner_pagination', +// spaceBetween: 0, +// loop: true, +// autoplay: 3500, +// autoplayDisableOnInteraction: false +// }); +// $('#top_banner').height($('#top_banner').width() * 420 / 715); +// $('#top_banner img').height($('#top_banner img').width() * 420 / 715); +// } else { +// $('#top_banner').remove() +// } +// +// if (data.couponList.coupons.length > 0) { +// var html_ = ''; +// $.each(data.couponList.coupons, function(num) { +// html_ += '

      点击领取

      满' + this.useMoney + '使用

      ' + this.couponValue + +// '

      ' +// }); +// $('#timer_swiper .swiper-wrapper').html(html_); +// $('.recommend_title img').eq(0).css('display', 'block'); +// var swiper = new Swiper('#timer_swiper', { +// slidesPerView: 2.3, +// paginationClickable: true, +// spaceBetween: 0, +// freeMode: true +// }); +// $('#timer_swiper .swiper-slide img').height($('#timer_swiper .swiper-slide img').width() * 140 / 300); +// $('#timer_swiper .swiper-slide').height($('#timer_swiper .swiper-slide').width() * 190 / 300); +// } else { +// $('.time').css('display', 'none'); +// } +// +// // var html3 = ''; +// // $.each(data.shopcats, function() { +// // html3 += '
      ' + this.catName + '
      '; +// // }); +// // $('.label').html(html3); +// // $('.l_block').each(function(num) { +// // if((num + 1) % 4 == 0) { +// // $(this).addClass('lbrr'); +// // } +// // }) +// var html4 = ''; +// if (data.rec == '') { +// $('.recommend_title').eq(1).css('display', 'none'); +// } else { +// $.each(data.rec, function() { +// html4 += '
      自营' + this.goodsName + +// '
      ¥' + this.shopPrice + +// '满减
      可用木吉抵扣20%货款
      ' +// }); +// $('.recommend_con').html(html4); +// $('.recommend_title img').eq(1).css('display', 'block'); +// $('.rcb_img').height($('.rcb_img').width()) +// } +// } else { +// mui.alert(data.msg) +// } +// }, +// error: function(xhr, type, errorThrown) { //异常处理; +// // mui.alert(type); +// } +// }); + //领取优惠券 + $('.time').on('tap', '.home_yhj', function() { + var couponId = $(this).attr('data-couponId'); + mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { + // headers: { + // "HYH-Token": token + // }, + data: { + couponId: couponId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + var data = toJson(data); + mui.alert(data.msg); + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.recommend_con').on('tap', '.recommend_con_block', function() { + var good_id = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + good_id, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: good_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + localStorage.setItem('shop_data', ''); + + + setInterval(function() { + $('.cnxh_block img').height($('.cnxh_block img').width()); + $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); + }, 200) + + + + + + $('.go').on("tap", function() { + isHasApp() + }) + + + var maps = [{ + pname: 'com.baidu.BaiduMap', + action: 'baidumap', + name: '百度地图' + }, { + pname: 'com.autonavi.minimap', + action: 'iosamap', + name: '高德地图' + } + // , { + // pname: 'com.google.android.apps.maps', + // action: 'com.google.android.apps.maps', + // name: '谷歌地图' + // } + // , { + // pname: 'com.tencent.map', + // action: 'com.google.android.apps.maps', + // name: '腾讯地图' + // }, + ] + // checkApp("com.baidu.BaiduMap", "baidumap", "百度地图") + // checkApp("com.autonavi.minimap", "iosamap", "高德地图") + // checkApp("com.google.android.apps.maps", "com.google.android.apps.maps", "谷歌地图") + // 判断地图软件是否安装 + // maps= toJson(maps) + // //console.log(maps) + $.each(maps, function(i, v) {//不能写进点击事件函数里 不然点击一次增加一个title + var that = this + checkApp(that.pname, that.action, that.name) + }) + function isHasApp() { + if (0 == arr.length) { +// plus.nativeUI.confirm("没有地图软件??请安装", function(i) { +// if (0 == i.index) { + var startpos= bMapTransQQMap(userLng, userLat) + var endpos = bMapTransQQMap(shopLng, shopLat) + //console.log(userLng); + var urlStr = encodeURI('http://uri.amap.com/navigation?from='+startpos.lng+','+startpos.lat+',startpoint&to='+endpos.lng+','+endpos.lat+',endpoint&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0') +plus.runtime.openURL(urlStr) +// plus.runtime.openURL('http://uri.amap.com/navigation?from=116.43234,39.98871,当前位置&to=121,31,站点&mode=car&src=公司名称&callnative=0' // androidMarket('com.baidu.BaiduMap') +// // } +// +// ) + return false + } + openMapApp() + } + + function openMapApp() { + //底部弹出选择地图软件 + plus.nativeUI.actionSheet({ + title: "请选择!", + cancel: "取消", + buttons: arr + }, function(e) { + + var title = arr[e.index - 1].title; + // var i1 = new Intent(); + switch (title) { + case "百度地图": + // if (plus.os.name == "Android") { + // plus.runtime.openURL( + // "baidumap://map/direction?origin=latlng:39.98871,116.43234|name:我的位置&destination=31.236244,121.480239&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu", + // function(error) { + // mui.alert('打开' + title + '失败'); + // }); + // } + goMaps( + "baidumap://map/direction?origin=我的位置&destination="+shopLat+","+shopLng+"&mode=driving&src=webapp.navi.hanguosoft.yinyijianghu" + ) + + break; + case "高德地图": + + var endpos = bMapTransQQMap(shopLng, shopLat) + // plus.runtime.openURL('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng + + // '&mode=driving®ion=www&output=html&src="全亮共"', + // function(e) { + // mui.alert('打开' + title + '失败'); + // }) + goMaps('androidamap://navi?sourceApplication=nyx_super&lat=' + endpos.lat + '&lon=' + endpos.lng + + '&mode=driving®ion='+shopName+'&output=html&src="全亮共"') + + break; + } + }) + } + + function goMaps(url) { + var mContext = plus.android.runtimeMainActivity(); + var Uri = plus.android.importClass('android.net.Uri'); + var Intent = plus.android.importClass('android.content.Intent'); + var intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + mContext.startActivity(intent); + } + + function checkApp(pn, ac, name) { // pname:android 包名 action:ios包名 name:用作底部弹出 + + if (plus.runtime.isApplicationExist({ + pname: pn, //包名 + action: ac //ios包名 + })) { + // //console.log("微信应用已安装"); + title = { + title: name + }; + arr.push(title) + } else { + // //console.log("微信应用未安装"); + // title={}; + // arr.push(title) + + } + } + + mui('.gothere').on("tap", ".gt_con", function(e) { + var idx = $(this).index(); + var html = ''; + switch (idx) { + case 0: + break; + case 1: + break; + case 2: + // $('.gt_con_con1').css('display','none') + + $('.gt_con_con').toggle() + html = + '
      ' + $('.row .name').css("width", "60%") + $('.gt_con_con').html(html) + break; + + } + }) +}) diff --git a/static/app2/js/store_info.js b/static/app2/js/store_info.js old mode 100755 new mode 100644 diff --git a/static/app2/js/storeout.js b/static/app2/js/storeout.js old mode 100755 new mode 100644 index 0361f85..b5e10ea --- a/static/app2/js/storeout.js +++ b/static/app2/js/storeout.js @@ -1,323 +1,325 @@ -//$('.searchcon').css('display', 'none'); -$('.title').css('width', '50%'); -$('.gz_btn').hide() -// var data = ''; -localStorage.removeItem('shopId'); -localStorage.removeItem('shopLat'); -localStorage.removeItem('shopLng'); -localStorage.removeItem('shopName'); -localStorage.removeItem('phone'); -localStorage.removeItem('userName'); -// $('.nav').html( -// '首页商品上新活动' -// ); -// $('.searchcon').html( -// '
      ' -// ); -mui.plusReady(function() { - var self = plus.webview.currentWebview(); - var shopId = self.shopId; - var shopName = self.shopName; - var shopLat=""; - var shopLng=''; - var phone=''; - var userName=''; - $('.title').html(shopName) - localStorage.setItem('shopId', shopId); - localStorage.setItem('shopName', shopName); - - JZL.ajax(qlgUrl('app/shopping/getShopInfo'),{ - shopId:shopId - },function (data) { - // console.log(data); - if (data.status == 1) { - var html = ''; - var data = data.data; - shopLat=data.lat; - shopLng=data.lng; - phone=data.phone; - userName=data.userName; - //console.log(shopLng); - localStorage.setItem('shopLat', shopLat); - localStorage.setItem('shopLng', shopLng); - localStorage.setItem('phone', phone); - localStorage.setItem('userName', userName); - var imgs=data.shopAds.split(","); - var firstImg = ''; - var endImg=''; - $.each(imgs, function(index,val) { - if(index == 0) firstImg='
      '; - if(index == imgs.length-1) endImg='
      '; - ////console.log(val); - html+='
      '; - //html += '
      '; - }); - $('#imgsw').html(html); - $('#imgsw').prepend(endImg); - $('#imgsw').append(firstImg); - var slider = mui("#slider"); - slider.slider({ - interval: 2000 - }); - //$('#top_banner .swiper-wrapper').html(html); - // var swiper = new Swiper('#top_banner', { - // pagination: '#top_banner_pagination', - // spaceBetween: 0, - // loop: true, - // autoplay: 3500, - // autoplayDisableOnInteraction: false - // }); - $('#slider').height($('#slider').width() * 460 / 750); - } else{ - mui.alert(data.msg) - } - }) - // mui('.search').on('tap', '.classmenu', function() { - // shopId = this.attributes["data-shopid"].nodeValue; - // // //console.log(this.attributes["data-id"].nodeValue); - // mui.openWindow({ - // url: 'store_class.html', - // id: 'store_class.html', - // styles: { - // top: '0px', //新页面顶部位置 - // bottom: '0px', //新页面底部位置 - // width: '100%', //新页面宽度,默认为100% - // height: '100%' //新页面高度,默认为100% - // }, - // extras: { - // shopId: shopId - // // ..... //自定义扩展参数,可以用来处理页面间传值 - // }, - // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - // show: { - // // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // // extras: {} //窗口动画是否使用图片加速 - // }, - // waiting: { - // autoShow: true, //自动显示等待框,默认为true - // title: '正在加载...', //等待对话框上显示的提示内容 - // options: { - // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // // ...... - // } - // } - // }) - // }) -// mui('.footer').on('tap', '#dpxq', function() { -// //console.log(11); -// var w = plus.webview.create('store_info.html'); -// w.show() -// }) -// mui('.footer').on('tap', '#rmfl', function() { -// -// $('.rmfl').css('display', 'block') -// }) - // mui('.con').on('tap', '.gz_btn', function() { - mui('.header_con').on('tap', '.gz_btn', function() { - // var shopId = shopId; - var that = $(this); - //console.log(shopId) - mui.ajax(qlgUrl('app/Favorites/add'), { - data: { - id: shopId, - type: 1 - }, - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data) - // //console.log(data.data.goodsFavoritesNum) - // //console.log(data.data.Rows) - var data = toJson(data); - if (data.status == 1) { - that.html('已关注'); - that.addClass('gz_btn1').removeClass('gz_btn'); - } else { - ////console.log(data.status) - } - - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(type); - } - }); - - }) - $('.header').on('focus', '#keyword', function() { - $(".searchcon button").css('display', 'block'); - }) - $('.header').on('blur', '#keyword', function() { - $(".searchcon button").css('display', 'none'); - }) - - //店铺搜索 - $(".header").on('keypress', '#keyword', function(e) { - var keycode = e.keyCode; - var searchName = $('#keyword').val(); - if(keycode == '13') { - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - mui.openWindow({ - url: 'shopGoodsList.html', - id: 'shopGoodsList.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - } - }); - $(".header").on('tap', '.searchcon button', function(e) { - var searchName = $('#keyword').val(); - // e.preventDefault(); - // //console.log(searchName) - //请求搜索接口 - mui.openWindow({ - url: 'shopGoodsList.html', - id: 'shopGoodsList.html', - styles: { - top: '0px', //新页面顶部位置 - bottom: '0px', //新页面底部位置 - width: '100%', //新页面宽度,默认为100% - height: '100%' //新页面高度,默认为100% - }, - extras: { - data_keyword: searchName - // ..... //自定义扩展参数,可以用来处理页面间传值 - }, - createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 - show: { - // autoShow: true, //页面loaded事件发生后自动显示,默认为true - // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; - // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; - // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 - // extras: {} //窗口动画是否使用图片加速 - }, - waiting: { - autoShow: true, //自动显示等待框,默认为true - title: '正在加载...', //等待对话框上显示的提示内容 - options: { - // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 - // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 - // ...... - } - } - }) - - }); - -}) - -function jumpPage() { - //跳转页面 - // var bSize = 190 + (+localStorage.getItem('ipxSizeTop')) + 'px'; - var bSize = +localStorage.getItem('topBannerheight')+42+'px'; - var subpages = ['store_home.html', 'store_commodity.html']; - // var subpages = ['store_home.html', 'store_commodity.html', 'store_new.html', 'store_activity.html']; - // top: bSize, - var subpage_style = { - top: bSize, - bottom: '0', - scrollIndicator: 'none' - }; - - var aniShow = {}; //动画显示 - //当前激活选项 - var activeTab = subpages[0]; - //选项卡点击事件 - // mui('.footer').on('tap', 'a', function(e) { - - mui('.nav').on('tap', 'a', function(e) { - var targetTab = this.getAttribute('href'); - // //console.log(targetTab); - if (targetTab == activeTab) { - return; - } - //显示目标选项卡 - //若为iOS平台或非首次显示,则直接显示 - if (mui.os.ios || aniShow[targetTab]) { - plus.webview.show(targetTab); - } else { - //否则,使用fade-in动画,且保存变量 - var temp = {}; - temp[targetTab] = "true"; - mui.extend(aniShow, temp); - plus.webview.show(targetTab, "fade-in", 300); - - } - //隐藏当前; - plus.webview.hide(activeTab); - //更改当前活跃的选项卡 - activeTab = targetTab; - - // var html = $(this).html(); - // html = html.substring(0, html.indexOf('.png')) + '_on.png">'; - // $(this).html(html); - $(this).addClass('on').siblings().removeClass('on'); - // $(this).siblings().each(function() { - // if($(this).html().indexOf('_on') == -1) { - // return - // } - // html = $(this).html().substring(0, $(this).html().indexOf('_on')) - // html = html + '.png">'; - // $(this).html(html) - // }) - }); - - //首次启动切滑效果 - - mui.plusReady(function() { - // launchScreen(); - // plus.navigator.setStatusBarStyle('dark'); - // //console.log(plus.navigator.getStatusBarStyle()) - var self = plus.webview.currentWebview(); - shopId = self.shopId; - // console.log(shopId); - localStorage.setItem('shopId', shopId); - - for (var i = 0; i < subpages.length; i++) { - var temp = {}; - //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create - var sub = plus.webview.create(subpages[i], subpages[i], subpage_style); - if (i > 0) { - sub.hide(); - } else { - temp[subpages[i]] = "true"; - mui.extend(aniShow, temp); //合并对象 - } - self.append(sub); - } - }); -} -jumpPage(); - +//$('.searchcon').css('display', 'none'); +$('.title').css('width', '50%'); +$('.gz_btn').hide() +// var data = ''; +localStorage.removeItem('shopId'); +localStorage.removeItem('shopLat'); +localStorage.removeItem('shopLng'); +localStorage.removeItem('shopName'); +localStorage.removeItem('phone'); +localStorage.removeItem('userName'); +// $('.nav').html( +// '首页商品上新活动' +// ); +// $('.searchcon').html( +// '
      ' +// ); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var shopId = self.shopId; + var shopName = self.shopName; + from_id = self.from_id?self.from_id:0 + var shopLat=""; + var shopLng=''; + var phone=''; + var userName=''; + $('.title').html(shopName) + localStorage.setItem('shopId', shopId); + localStorage.setItem('shopName', shopName); + + JZL.ajax(qlgUrl('app/shopping/getShopInfo'),{ + shopId:shopId + },function (data) { + // console.log(data); + if (data.status == 1) { + var html = ''; + var data = data.data; + shopLat=data.lat; + shopLng=data.lng; + phone=data.phone; + userName=data.loginName; + //console.log(shopLng); + localStorage.setItem('shopLat', shopLat); + localStorage.setItem('shopLng', shopLng); + localStorage.setItem('phone', phone); + localStorage.setItem('userName', userName); + var imgs=data.shopAds.split(","); + var firstImg = ''; + var endImg=''; + $.each(imgs, function(index,val) { + if(index == 0) firstImg='
      '; + if(index == imgs.length-1) endImg='
      '; + ////console.log(val); + html+='
      '; + //html += '
      '; + }); + $('#imgsw').html(html); + $('#imgsw').prepend(endImg); + $('#imgsw').append(firstImg); + var slider = mui("#slider"); + slider.slider({ + interval: 2000 + }); + //$('#top_banner .swiper-wrapper').html(html); + // var swiper = new Swiper('#top_banner', { + // pagination: '#top_banner_pagination', + // spaceBetween: 0, + // loop: true, + // autoplay: 3500, + // autoplayDisableOnInteraction: false + // }); + $('#slider').height($('#slider').width() * 460 / 750); + } else{ + mui.alert(data.msg) + } + }) + // mui('.search').on('tap', '.classmenu', function() { + // shopId = this.attributes["data-shopid"].nodeValue; + // // //console.log(this.attributes["data-id"].nodeValue); + // mui.openWindow({ + // url: 'store_class.html', + // id: 'store_class.html', + // styles: { + // top: '0px', //新页面顶部位置 + // bottom: '0px', //新页面底部位置 + // width: '100%', //新页面宽度,默认为100% + // height: '100%' //新页面高度,默认为100% + // }, + // extras: { + // shopId: shopId + // // ..... //自定义扩展参数,可以用来处理页面间传值 + // }, + // createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + // show: { + // // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // // extras: {} //窗口动画是否使用图片加速 + // }, + // waiting: { + // autoShow: true, //自动显示等待框,默认为true + // title: '正在加载...', //等待对话框上显示的提示内容 + // options: { + // // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // // ...... + // } + // } + // }) + // }) +// mui('.footer').on('tap', '#dpxq', function() { +// //console.log(11); +// var w = plus.webview.create('store_info.html'); +// w.show() +// }) +// mui('.footer').on('tap', '#rmfl', function() { +// +// $('.rmfl').css('display', 'block') +// }) + // mui('.con').on('tap', '.gz_btn', function() { + mui('.header_con').on('tap', '.gz_btn', function() { + // var shopId = shopId; + var that = $(this); + //console.log(shopId) + mui.ajax(qlgUrl('app/Favorites/add'), { + data: { + id: shopId, + type: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data) + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + that.html('已关注'); + that.addClass('gz_btn1').removeClass('gz_btn'); + } else { + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + $('.header').on('focus', '#keyword', function() { + $(".searchcon button").css('display', 'block'); + }) + $('.header').on('blur', '#keyword', function() { + $(".searchcon button").css('display', 'none'); + }) + + //店铺搜索 + $(".header").on('keypress', '#keyword', function(e) { + var keycode = e.keyCode; + var searchName = $('#keyword').val(); + if(keycode == '13') { + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + mui.openWindow({ + url: 'shopGoodsList.html', + id: 'shopGoodsList.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + } + }); + $(".header").on('tap', '.searchcon button', function(e) { + var searchName = $('#keyword').val(); + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + mui.openWindow({ + url: 'shopGoodsList.html', + id: 'shopGoodsList.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }); + +}) + +function jumpPage() { + //跳转页面 + // var bSize = 190 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var bSize = +localStorage.getItem('topBannerheight')+42+'px'; + var subpages = ['store_home.html', 'store_commodity.html']; + // var subpages = ['store_home.html', 'store_commodity.html', 'store_new.html', 'store_activity.html']; + // top: bSize, + var subpage_style = { + top: bSize, + bottom: '0', + scrollIndicator: 'none' + }; + + var aniShow = {}; //动画显示 + //当前激活选项 + var activeTab = subpages[0]; + //选项卡点击事件 + // mui('.footer').on('tap', 'a', function(e) { + + mui('.nav').on('tap', 'a', function(e) { + var targetTab = this.getAttribute('href'); + // //console.log(targetTab); + if (targetTab == activeTab) { + return; + } + //显示目标选项卡 + //若为iOS平台或非首次显示,则直接显示 + if (mui.os.ios || aniShow[targetTab]) { + plus.webview.show(targetTab); + } else { + //否则,使用fade-in动画,且保存变量 + var temp = {}; + temp[targetTab] = "true"; + mui.extend(aniShow, temp); + plus.webview.show(targetTab, "fade-in", 300); + + } + //隐藏当前; + plus.webview.hide(activeTab); + //更改当前活跃的选项卡 + activeTab = targetTab; + + // var html = $(this).html(); + // html = html.substring(0, html.indexOf('.png')) + '_on.png">'; + // $(this).html(html); + $(this).addClass('on').siblings().removeClass('on'); + // $(this).siblings().each(function() { + // if($(this).html().indexOf('_on') == -1) { + // return + // } + // html = $(this).html().substring(0, $(this).html().indexOf('_on')) + // html = html + '.png">'; + // $(this).html(html) + // }) + }); + + //首次启动切滑效果 + + mui.plusReady(function() { + // launchScreen(); + // plus.navigator.setStatusBarStyle('dark'); + // //console.log(plus.navigator.getStatusBarStyle()) + var self = plus.webview.currentWebview(); + shopId = self.shopId; + from_id = self.from_id?self.from_id:0; + // console.log(shopId); + localStorage.setItem('shopId', shopId); + + for (var i = 0; i < subpages.length; i++) { + var temp = {}; + //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create + var sub = plus.webview.create(subpages[i], subpages[i], subpage_style, {from_id}); + if (i > 0) { + sub.hide(); + } else { + temp[subpages[i]] = "true"; + mui.extend(aniShow, temp); //合并对象 + } + self.append(sub); + } + }); +} +jumpPage(); + diff --git a/static/app2/js/supermarket.js b/static/app2/js/supermarket.js old mode 100755 new mode 100644 index f290ac9..a6c7a39 --- a/static/app2/js/supermarket.js +++ b/static/app2/js/supermarket.js @@ -1,225 +1,225 @@ -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - //console.log(self); - - - var id = self.scid ? self.scid : ''; - JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { - applyLevel: 2 - }, function(data) { - //console.log(data); - if (1 == data.status && undefined != data.data) { - var data = data.data; - - if (0 == data.status || 2 == data.status) { - //console.log(id); - if (id == "") { - id = data.id - } - getShopList(data.shopId); - - $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) - $('#confirmImg').val(data.confirmImg) - - var imgs = data.shopImg - imgs = Array.from(imgs.split(',')) - //console.log(imgs); - var html = ""; - mui.each(imgs, function(index, element) { - //console.log(index, element); - html += '
      '; - }) - // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - var maxNum = imgs.length - 1; - // //console.log(maxNum); - // //console.log(num); - // if (num == maxNum) { - maxNum++; - html += '
      '; - $(".batchImg").html(html); - // } - - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 115 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - - } else if (1 == data.status) { - //tiaozhuandao shangdu yemian - } - } else if ('' == data.data) { - getShopList(); - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 115 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - } - }) - // 上传图片 - $('.photos_con').on('tap', '.confirm', function() { - UP.init("confirmImg", "test", "confirm") - openCamera() - }) - $(".batchImg").on("tap", '.galleryImg', function() { - var num = $(this).attr('data-id'); - UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); - var that = $(this); - openCamera(function(t, status, fileName, serverName) { - var html = '
      '; - - that.html(html); - - var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (num == maxNum) { - maxNum++; - html = '
      '; - $(".batchImg").append(html); - } - }); - }) - //删除照片 - $(".batchImg").on('tap', '.delete', function(e) { - - e.preventDefault(); - e.stopPropagation() - - // //console.log(this); - var that = $(this) - //var idx = that.parent().attr('data-id'); - //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; - if (confirm('确认删除图片?')) { - that.parent().remove() - //delete galleryarr[idx]; - } - }) - //获取协议 - JZL.ajax(qlgUrl('app/Tags/articleDetail'), { - articleId: 115 - }, function(data) { - //console.log(data); - // if (1==data.status) { - // $('.zcxycontent').html(data.data.articleContent) - $('.zcxycontent').html(data.articleContent) - - // } - - }) - //获取店铺信息 - getShopList() - - function getShopList(defaultShopId) { - - JZL.ajax(qlgUrl('app/shops/userShopList'), { - shopType: 1 - }, function(data) { - //console.log(data); - if (1 == data.status) { - var html = ""; - html = ``; - if (undefined == typeof defaultShop) { - - mui.each(data.data, function() { - // //console.log(index, element); - html += ``; - }) - } else { - mui.each(data.data, function() { - if (this.shopId == defaultShopId) { - selected = 'selected'; - } else { - selected = ''; - } - html += ``; - }) - - } - $("#shopId").html(html) - } else { - mui.alert(data.msg) - } - // }) - }) - - - } - let click = 0; - $('.down').on('tap', '.btn', function() { - - if (click == 1) { - return; - } - click = 1 - var imgs = ''; - var data = $('input[name="gallery[]"]'); - //console.log(data); - $.each(data, function() { - if ('' != $(this).val()) - imgs = $(this).val() + ',' + imgs; - }) - imgs = imgs.substring(0, imgs.lastIndexOf(',')); - $('#shopImg').val(imgs); - if ('' == $('#shopId option:selected').val()) { - mui.alert('请选择要升级的店铺名称') - return; - } - - if ('' == $('#confirmImg').val()) { - mui.alert('请上传确认书照片') - return; - } - if ('' == $('#shopImg').val()) { - mui.alert('请上传店铺照片') - return; - } - - - var params = JZL.getParams(".inp"); - params.applyLevel = 2; - if ("" != id) { - params.id = id; - //console.log(params.id); - } - JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { - // //console.log(data); - if (1 == data.status) { - // mui.back() - } else { - mui.alert(data.msg) - } - }) - }) - - - - +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self); + + + var id = self.scid ? self.scid : ''; + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 2 + }, function(data) { + //console.log(data); + if (1 == data.status && undefined != data.data) { + var data = data.data; + + if (0 == data.status || 2 == data.status) { + //console.log(id); + if (id == "") { + id = data.id + } + getShopList(data.shopId); + + $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) + $('#confirmImg').val(data.confirmImg) + + var imgs = data.shopImg + imgs = Array.from(imgs.split(',')) + //console.log(imgs); + var html = ""; + mui.each(imgs, function(index, element) { + //console.log(index, element); + html += '
      '; + }) + // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + var maxNum = imgs.length - 1; + // //console.log(maxNum); + // //console.log(num); + // if (num == maxNum) { + maxNum++; + html += '
      '; + $(".batchImg").html(html); + // } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 115 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + + } else if (1 == data.status) { + //tiaozhuandao shangdu yemian + } + } else if ('' == data.data) { + getShopList(); + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 115 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + } + }) + // 上传图片 + $('.photos_con').on('tap', '.confirm', function() { + UP.init("confirmImg", "test", "confirm") + openCamera() + }) + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + that.html(html); + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + //删除照片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // //console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 115 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + //获取店铺信息 + getShopList() + + function getShopList(defaultShopId) { + + JZL.ajax(qlgUrl('app/shops/userShopList'), { + shopType: 1 + }, function(data) { + //console.log(data); + if (1 == data.status) { + var html = ""; + html = ``; + if (undefined == typeof defaultShop) { + + mui.each(data.data, function() { + // //console.log(index, element); + html += ``; + }) + } else { + mui.each(data.data, function() { + if (this.shopId == defaultShopId) { + selected = 'selected'; + } else { + selected = ''; + } + html += ``; + }) + + } + $("#shopId").html(html) + } else { + mui.alert(data.msg) + } + // }) + }) + + + } + let click = 0; + $('.down').on('tap', '.btn', function() { + + if (click == 1) { + return; + } + click = 1 + var imgs = ''; + var data = $('input[name="gallery[]"]'); + //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + }) + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + $('#shopImg').val(imgs); + if ('' == $('#shopId option:selected').val()) { + mui.alert('请选择要升级的店铺名称') + return; + } + + if ('' == $('#confirmImg').val()) { + mui.alert('请上传确认书照片') + return; + } + if ('' == $('#shopImg').val()) { + mui.alert('请上传店铺照片') + return; + } + + + var params = JZL.getParams(".inp"); + params.applyLevel = 2; + if ("" != id) { + params.id = id; + //console.log(params.id); + } + JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { + // //console.log(data); + if (1 == data.status) { + // mui.back() + } else { + mui.alert(data.msg) + } + }) + }) + + + + }) diff --git a/static/app2/js/swiper.min.js b/static/app2/js/swiper.min.js old mode 100755 new mode 100644 diff --git a/static/app2/js/test.js b/static/app2/js/test.js old mode 100755 new mode 100644 index c05bc22..76dea9f --- a/static/app2/js/test.js +++ b/static/app2/js/test.js @@ -1,104 +1,104 @@ -mui.plusReady(function() { - var btnArr = []; - - $('.selectfiles').each(function(num) { - btnArr.push($(this).attr('id')); - }) - - $.each(btnArr, function(i, n) { - var self = this.toString(); - var that = document.getElementById(this); - var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: self, - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - dir:'appraises', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - }, - { - title: "Zip files", - extensions: "zip,rar" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementsByClassName('ossfile')[i].innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false,'appraises'); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if(info.status == 200) { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - //console.log(JSON.stringify(up)) - //console.log(JSON.stringify(file)) - //console.log(JSON.stringify(info)) - //console.log(file.name); - //console.log((hyhImgUrl(get_uploaded_object_name(file.name)))); - }, - - Error: function(up, err) { - if(err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if(err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if(err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } - }); - - uploader.init(); - - -}) - }); - +mui.plusReady(function() { + var btnArr = []; + + $('.selectfiles').each(function(num) { + btnArr.push($(this).attr('id')); + }) + + $.each(btnArr, function(i, n) { + var self = this.toString(); + var that = document.getElementById(this); + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: self, + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + dir:'appraises', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + }, + { + title: "Zip files", + extensions: "zip,rar" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementsByClassName('ossfile')[i].innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false,'appraises'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if(info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + //console.log(JSON.stringify(up)) + //console.log(JSON.stringify(file)) + //console.log(JSON.stringify(info)) + //console.log(file.name); + //console.log((hyhImgUrl(get_uploaded_object_name(file.name)))); + }, + + Error: function(up, err) { + if(err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if(err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if(err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); + + +}) + }); + \ No newline at end of file diff --git a/static/app2/js/trade_rule.js b/static/app2/js/trade_rule.js new file mode 100644 index 0000000..31ce60a --- /dev/null +++ b/static/app2/js/trade_rule.js @@ -0,0 +1,28 @@ +mui.plusReady(function(){ + // some ajax +}) +const app = new Vue({ + el: '#app', + data() { + return { + ruleData: [ + ] + } + }, + created() { + console.log("Vue") + }, + methods: { + detail(index){ + console.log(this.ruleData[index]) + // some jump + } + }, + mounted() { + // some ajax + this.ruleData = [ + {id: 1, name: '这个是个开发中的页面呢', announced_at: "2019-09-09 18:09:01"}, + {id: 2, name: '待我来继续开发呢', announced_at: "2019-09-09 19:09:01"}, + ] + } +}) \ No newline at end of file diff --git a/static/app2/js/upload.js b/static/app2/js/upload.js old mode 100755 new mode 100644 index a98f0b9..6c7c85c --- a/static/app2/js/upload.js +++ b/static/app2/js/upload.js @@ -1,134 +1,134 @@ -accessid = '' -accesskey = '' -host = '' -policyBase64 = '' -signature = '' -callbackbody = '' -filename = '' -key = '' -expire = 0 -g_object_name = '' -g_object_name_type = '' -now = timestamp = Date.parse(new Date()) / 1000; -dir = 'images' - -function send_request() { - var xmlhttp = null; - if(window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if(window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if(xmlhttp != null) { -// //console.log(dir) - serverUrl = hyhUrl('oss/get.php?dir='+dir); - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - -}; - -function check_object_radio() { - var tt = document.getElementsByName('myradio'); - for(var i = 0; i < tt.length; i++) { - if(tt[i].checked) { - g_object_name_type = tt[i].value; - break; - } - } -} - -function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if(expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - host = obj['host'] - policyBase64 = obj['policy'] - accessid = obj['accessid'] - signature = obj['signature'] - expire = parseInt(obj['expire']) - callbackbody = obj['callback'] - key = obj['dir'] - return true; - } - return false; -}; - -function random_string(len) {   - len = len || 32;   - var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';   - var maxPos = chars.length;   - var pwd = '';   - for(i = 0; i < len; i++) {   - pwd += chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} - -function get_suffix(filename) { - pos = filename.lastIndexOf('.') - suffix = '' - if(pos != -1) { - suffix = filename.substring(pos) - } - return suffix; -} - -function calculate_object_name(filename) { - if(g_object_name_type == 'local_name') { - g_object_name += "${filename}" - } else if(g_object_name_type == 'random_name') { - suffix = get_suffix(filename) - g_object_name = key + random_string(10) + suffix - } - return '' -} - -function get_uploaded_object_name(filename) { - if(g_object_name_type == 'local_name') { - tmp_name = g_object_name - tmp_name = tmp_name.replace("${filename}", filename); - return tmp_name - } else if(g_object_name_type == 'random_name') { - return g_object_name - } -} - -function set_upload_param(up, filename, ret,savedir) { - dir = savedir; - if(ret == false) { - ret = get_signature() - } - //console.log(filename); - g_object_name = key; - //console.log(g_object_name); - if(filename != '') { - suffix = get_suffix(filename) - calculate_object_name(filename) - } - - - //console.log(g_object_name); -// alert(g_object_name) -// //console.log(g_object_name); - new_multipart_params = { - 'key': g_object_name, - 'policy': policyBase64, - 'OSSAccessKeyId': accessid, - 'success_action_status': '200', //让服务端返回200,不然,默认会返回204 - 'callback': callbackbody, - 'signature': signature, - }; -// //console.log(callbackbody); - up.setOption({ - 'url': host, - 'multipart_params': new_multipart_params - }); - up.start(); +accessid = '' +accesskey = '' +host = '' +policyBase64 = '' +signature = '' +callbackbody = '' +filename = '' +key = '' +expire = 0 +g_object_name = '' +g_object_name_type = '' +now = timestamp = Date.parse(new Date()) / 1000; +dir = 'images' + +function send_request() { + var xmlhttp = null; + if(window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if(window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if(xmlhttp != null) { +// //console.log(dir) + serverUrl = hyhUrl('oss/get.php?dir='+dir); + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + +}; + +function check_object_radio() { + var tt = document.getElementsByName('myradio'); + for(var i = 0; i < tt.length; i++) { + if(tt[i].checked) { + g_object_name_type = tt[i].value; + break; + } + } +} + +function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if(expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + host = obj['host'] + policyBase64 = obj['policy'] + accessid = obj['accessid'] + signature = obj['signature'] + expire = parseInt(obj['expire']) + callbackbody = obj['callback'] + key = obj['dir'] + return true; + } + return false; +}; + +function random_string(len) {   + len = len || 32;   + var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';   + var maxPos = chars.length;   + var pwd = '';   + for(i = 0; i < len; i++) {   + pwd += chars.charAt(Math.floor(Math.random() * maxPos)); + } + return pwd; +} + +function get_suffix(filename) { + pos = filename.lastIndexOf('.') + suffix = '' + if(pos != -1) { + suffix = filename.substring(pos) + } + return suffix; +} + +function calculate_object_name(filename) { + if(g_object_name_type == 'local_name') { + g_object_name += "${filename}" + } else if(g_object_name_type == 'random_name') { + suffix = get_suffix(filename) + g_object_name = key + random_string(10) + suffix + } + return '' +} + +function get_uploaded_object_name(filename) { + if(g_object_name_type == 'local_name') { + tmp_name = g_object_name + tmp_name = tmp_name.replace("${filename}", filename); + return tmp_name + } else if(g_object_name_type == 'random_name') { + return g_object_name + } +} + +function set_upload_param(up, filename, ret,savedir) { + dir = savedir; + if(ret == false) { + ret = get_signature() + } + //console.log(filename); + g_object_name = key; + //console.log(g_object_name); + if(filename != '') { + suffix = get_suffix(filename) + calculate_object_name(filename) + } + + + //console.log(g_object_name); +// alert(g_object_name) +// //console.log(g_object_name); + new_multipart_params = { + 'key': g_object_name, + 'policy': policyBase64, + 'OSSAccessKeyId': accessid, + 'success_action_status': '200', //让服务端返回200,不然,默认会返回204 + 'callback': callbackbody, + 'signature': signature, + }; +// //console.log(callbackbody); + up.setOption({ + 'url': host, + 'multipart_params': new_multipart_params + }); + up.start(); } \ No newline at end of file diff --git a/static/app2/js/upload1.js b/static/app2/js/upload1.js old mode 100755 new mode 100644 index 96cf7c8..c92a4a0 --- a/static/app2/js/upload1.js +++ b/static/app2/js/upload1.js @@ -1,306 +1,306 @@ -accessid = '' -accesskey = '' -host = '' -policyBase64 = '' -signature = '' -callbackbody = '' -filename = '' -key = '' -expire = 0 -g_object_name = '' -g_object_name_type = '' -now = timestamp = Date.parse(new Date()) / 1000; - -function send_request() { - var xmlhttp = null; - if(window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if(window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if(xmlhttp != null) { - serverUrl = '../php/get.php' - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText - } else { - mui.alert("Your browser does not support XMLHTTP."); - } -}; - -function check_object_radio() { - var tt = document.getElementsByName('myradio'); - for(var i = 0; i < tt.length; i++) { - if(tt[i].checked) { - g_object_name_type = tt[i].value; - break; - } - } -} - -function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if(expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - host = obj['host'] - policyBase64 = obj['policy'] - accessid = obj['accessid'] - signature = obj['signature'] - expire = parseInt(obj['expire']) - callbackbody = obj['callback'] - key = obj['dir'] - return true; - } - return false; -}; - -function random_string(len) {   - len = len || 32;   - var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';   - var maxPos = chars.length;   - var pwd = '';   - for(i = 0; i < len; i++) {   - pwd += chars.charAt(Math.floor(Math.random() * maxPos)); - } - return pwd; -} - -function get_suffix(filename) { - pos = filename.lastIndexOf('.') - suffix = '' - if(pos != -1) { - suffix = filename.substring(pos) - } - return suffix; -} - -function calculate_object_name(filename) { - if(g_object_name_type == 'local_name') { - g_object_name += "${filename}" - } else if(g_object_name_type == 'random_name') { - suffix = get_suffix(filename) - g_object_name = key + random_string(10) + suffix - } - return '' -} - -function get_uploaded_object_name(filename) { - if(g_object_name_type == 'local_name') { - tmp_name = g_object_name - tmp_name = tmp_name.replace("${filename}", filename); - return tmp_name - } else if(g_object_name_type == 'random_name') { - return g_object_name - } -} - -function set_upload_param(up, filename, ret) { - if(ret == false) { - ret = get_signature() - } - g_object_name = key; - if(filename != '') { - suffix = get_suffix(filename) - calculate_object_name(filename) - } - new_multipart_params = { - 'key': g_object_name, - 'policy': policyBase64, - 'OSSAccessKeyId': accessid, - 'success_action_status': '200', //让服务端返回200,不然,默认会返回204 - 'callback': callbackbody, - 'signature': signature, - }; - - up.setOption({ - 'url': host, - 'multipart_params': new_multipart_params - }); - - up.start(); -} -var html = ''; -for(i = 0; i < 3; i++) { - html += '
      你的浏览器不支持flash,Silverlight或者HTML5!
      ' -} - -$('.con').html(html) - -var btnArr = []; - -$('.selectfiles').each(function(num) { - btnArr.push($(this).attr('id')); -}) - -$.each(btnArr, function(i, n) { - var self = this.toString(); - var that = document.getElementById(this); - var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: self, - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - }, - { - title: "Zip files", - extensions: "zip,rar" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementsByClassName('ossfile')[i].innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if(info.status == 200) { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - }, - - Error: function(up, err) { - if(err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if(err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if(err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } - }); - - uploader.init(); -}); - -var uploader = new plupload.Uploader({ - runtimes: 'html5,flash,silverlight,html4', - browse_button: 'selectfiles', - //multi_selection: false, - // container: document.getElementById('container'), - flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', - silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', - url: 'http://oss.aliyuncs.com', - - filters: { - mime_types: [ //只允许上传图片和zip,rar文件 - { - title: "Image files", - extensions: "jpg,gif,png,bmp" - }, - { - title: "Zip files", - extensions: "zip,rar" - } - ], - max_file_size: '10mb', //最大只能上传10mb的文件 - prevent_duplicates: true //不允许选取重复文件 - }, - - init: { - PostInit: function() { - document.getElementById('ossfile').innerHTML = ''; - // document.getElementById('postfiles').onclick = function() { - // set_upload_param(uploader, '', false); - // return false; - // }; - uploader.bind('FilesAdded', function() { - set_upload_param(uploader, '', false); - return false; - }); - }, - - FilesAdded: function(up, files) { - plupload.each(files, function(file) { - document.getElementById('ossfile').innerHTML += '
      ' + - '
      ' + - '
      '; - }); - }, - - BeforeUpload: function(up, file) { - check_object_radio(); - set_upload_param(up, file.name, true); - }, - - UploadProgress: function(up, file) { - var d = document.getElementById(file.id); - d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; - var prog = d.getElementsByTagName('div')[0]; - var progBar = prog.getElementsByTagName('div')[0] - progBar.style.width = 2 * file.percent + 'px'; - progBar.setAttribute('aria-valuenow', file.percent); - }, - - FileUploaded: function(up, file, info) { - if(info.status == 200) { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; - } else { - document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; - } - }, - - Error: function(up, err) { - if(err.code == -600) { - mui.alert("\n选择的文件太大了"); - } else if(err.code == -601) { - mui.alert("\n选择的文件后缀不对"); - } else if(err.code == -602) { - mui.alert("\n这个文件已经上传过一遍了"); - } else { - mui.alert("\nError xml:" + err.response); - } - } - } -}); - +accessid = '' +accesskey = '' +host = '' +policyBase64 = '' +signature = '' +callbackbody = '' +filename = '' +key = '' +expire = 0 +g_object_name = '' +g_object_name_type = '' +now = timestamp = Date.parse(new Date()) / 1000; + +function send_request() { + var xmlhttp = null; + if(window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if(window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if(xmlhttp != null) { + serverUrl = '../php/get.php' + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } +}; + +function check_object_radio() { + var tt = document.getElementsByName('myradio'); + for(var i = 0; i < tt.length; i++) { + if(tt[i].checked) { + g_object_name_type = tt[i].value; + break; + } + } +} + +function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if(expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + host = obj['host'] + policyBase64 = obj['policy'] + accessid = obj['accessid'] + signature = obj['signature'] + expire = parseInt(obj['expire']) + callbackbody = obj['callback'] + key = obj['dir'] + return true; + } + return false; +}; + +function random_string(len) {   + len = len || 32;   + var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';   + var maxPos = chars.length;   + var pwd = '';   + for(i = 0; i < len; i++) {   + pwd += chars.charAt(Math.floor(Math.random() * maxPos)); + } + return pwd; +} + +function get_suffix(filename) { + pos = filename.lastIndexOf('.') + suffix = '' + if(pos != -1) { + suffix = filename.substring(pos) + } + return suffix; +} + +function calculate_object_name(filename) { + if(g_object_name_type == 'local_name') { + g_object_name += "${filename}" + } else if(g_object_name_type == 'random_name') { + suffix = get_suffix(filename) + g_object_name = key + random_string(10) + suffix + } + return '' +} + +function get_uploaded_object_name(filename) { + if(g_object_name_type == 'local_name') { + tmp_name = g_object_name + tmp_name = tmp_name.replace("${filename}", filename); + return tmp_name + } else if(g_object_name_type == 'random_name') { + return g_object_name + } +} + +function set_upload_param(up, filename, ret) { + if(ret == false) { + ret = get_signature() + } + g_object_name = key; + if(filename != '') { + suffix = get_suffix(filename) + calculate_object_name(filename) + } + new_multipart_params = { + 'key': g_object_name, + 'policy': policyBase64, + 'OSSAccessKeyId': accessid, + 'success_action_status': '200', //让服务端返回200,不然,默认会返回204 + 'callback': callbackbody, + 'signature': signature, + }; + + up.setOption({ + 'url': host, + 'multipart_params': new_multipart_params + }); + + up.start(); +} +var html = ''; +for(i = 0; i < 3; i++) { + html += '
      你的浏览器不支持flash,Silverlight或者HTML5!
      ' +} + +$('.con').html(html) + +var btnArr = []; + +$('.selectfiles').each(function(num) { + btnArr.push($(this).attr('id')); +}) + +$.each(btnArr, function(i, n) { + var self = this.toString(); + var that = document.getElementById(this); + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: self, + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + }, + { + title: "Zip files", + extensions: "zip,rar" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementsByClassName('ossfile')[i].innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementsByClassName('ossfile')[i].innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if(info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if(err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if(err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if(err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); +}); + +var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: 'selectfiles', + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + }, + { + title: "Zip files", + extensions: "zip,rar" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementById('ossfile').innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementById('ossfile').innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if(info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if(err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if(err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if(err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } +}); + uploader.init(); \ No newline at end of file diff --git a/static/app2/js/uploadVoucher.js b/static/app2/js/uploadVoucher.js old mode 100755 new mode 100644 index 0a39dee..c5d7f95 --- a/static/app2/js/uploadVoucher.js +++ b/static/app2/js/uploadVoucher.js @@ -1,48 +1,50 @@ -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'reload'); - //返回true,继续页面关闭逻辑 - return true; - }, -}) -mui.plusReady(function() { - var orderId = ''; - var self = plus.webview.currentWebview() - orderId = self.orderId - // 上传图片 - $(".oneImg").on("tap", '#img', function() { - // UP.init("accountBookImg", "test", "accountBookImgTag") - - UP.init("imgUrl", "test", "img") - openCamera() - }) - - var click = false; - $("body").on("tap", '.bc_btn', function() { - if (click == true) return; - - click = true; - var params = JZL.getParams(".inp"); - params.orderId = orderId - if ('' == $.trim($('#content').val())) { - mui.alert("请输入凭证说明") - return; - } - if ('' == $('#imgUrl').val()) { - mui.alert("请上传凭证图片") - return; - } - - JZL.ajax(qlgUrl('app/orders/uploadCertificate'), params, function(data) { - if (1 == data.status) { - mui.alert(data.msg); - mui.back() - } else { - mui.alert(data.msg) - } - }) - - - }) +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + }, +}) +mui.plusReady(function() { + var orderId = ''; + var self = plus.webview.currentWebview() + orderId = self.orderId + // 上传图片 + $(".oneImg").on("tap", '#img', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("imgUrl", "test", "img") + openCamera() + }) + + var click = false; + $("body").on("tap", '.bc_btn', function() { + if (click == true) return; + + click = true; + var params = JZL.getParams(".inp"); + params.orderId = orderId + if ('' == $.trim($('#content').val())) { + mui.alert("请输入凭证说明") + click = false; + return; + } + if ('' == $('#imgUrl').val()) { + mui.alert("请上传凭证图片") + click = false; + return; + } + + JZL.ajax(qlgUrl('app/orders/uploadCertificate'), params, function(data) { + if (1 == data.status) { + mui.alert(data.msg); + mui.back() + } else { + mui.alert(data.msg) + } + }) + + + }) }) diff --git a/static/app2/js/uploader.js b/static/app2/js/uploader.js old mode 100755 new mode 100644 index b453401..6454476 --- a/static/app2/js/uploader.js +++ b/static/app2/js/uploader.js @@ -1,226 +1,226 @@ -var files = []; //存储文件信息的数组 -var fname = ""; //表示文件名,例如 XXXX.jpg; -var expire = 0; -var pathName = ''; -var inpId = ''; -var keyname = ''; -var imgId=''; -var isZip=1; -var qualityNum=90; -var response=';' -var UP = UP || {}; -UP.isBatch=0; -UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) { - inpId = inputId; - pathName = path; - imgId = imageId; - if(typeof(isBatch) != 'undefined'){ - UP.isBatch = isBatch; - } - if(typeof(isZipImg) != 'undefined'){ - // //console.log(typeof(isZipImg)); - isZip = isZipImg; - } - if(typeof(quality) != 'undefined'){ - qualityNum = quality; - } - -} - -function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - // //console.log(dir) - serverUrl = qlgUrl('oss/get.php?dir=' + pathName); - // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; - - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText; - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - -} - -function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if (expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - response = obj; - // //console.log(obj); - } - return response; -}; -// 上传文件 -function upload(callback) { - // //console.log(files); - if (files.length <= 0) { - mui.toast('没有添加上传文件'); - return; - } - var obj = get_signature(); - if (obj) { - server = obj['host']; - policyBase64 = obj['policy']; - accessid = obj['accessid']; - signature = obj['signature']; - expire = parseInt(obj['expire']); - callbackbody = obj['callback']; - path = obj['dir']; - - } else { - mui.toast('初始化失败'); - return; - } - - var wt = plus.nativeUI.showWaiting(); - var task = plus.uploader.createUpload(server, { - method: "POST" - }, function(t, status) { - //上传完成 - if (status == 200) { - wt.close(); - if(1 == UP.isBatch){ - callback(t,status,keyname,server + '/'+keyname); - }else{ - document.getElementById(inpId).value = keyname; - var ele=document.getElementById(imgId); - ele.src=server + '/'+keyname; - ele.setAttribute('data-src',keyname); - mui.toast('上传成功'); - //至此上传成功,上传后的图片完整地址为server+testName - //keyname - } - - } else { - wt.close(); - mui.toast('上传失败:' + status); - } - }); - var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg - keyname = path + new Date().getTime() + suffix1; - task.addData("key", keyname); - task.addData("policy", policyBase64); - task.addData("OSSAccessKeyId", accessid); - task.addData("success_action_status", "200"); - // task.addData("callback", callbackbody); - task.addData("signature", signature); - var f = files[files.length-1]; - // //console.log(f) - - task.addFile(f.path, { - key: "file", - name: "file", - mime: "image/jpeg" - }); - //files.length = 0; - task.start(); - -} - -//得到文件名的后缀 -function get_suffix(filename) { - var pos = filename.lastIndexOf('.'); - var suffix = ''; - if (pos != -1) { - suffix = filename.substring(pos) - } - return suffix; -} -// 拍照添加文件 -function appendByCamera(callback) { - plus.camera.getCamera().captureImage(function(p) { - uploadImg(p,callback); - }); -} -// 从相册添加文件 -function appendByGallery(callback) { - plus.gallery.pick(function(p) { - uploadImg(p,callback); - }); -} - -// 添加文件 -var index = 1; -function uploadImg(p,callback){ - if(1 == isZip){ - compressImg(p,callback); - }else{ - appendFile(p,callback) - } -} -function appendFile(p,callback) { - // var fe = document.getElementById(fileId); - var n = p.substr(p.lastIndexOf('/') + 1); - fname = n; - files.push({ - name: "uploadkey" + index, - path: p - }); - ////console.log(3); - // index++; - upload(callback); -} -function compressImg(src,callback) { - var filename = src.substring(src.lastIndexOf('/') + 1); - var opions = { - src: src, - dst: '_doc/tmp/' + filename, - overwrite: true, - //width: '300px', //这里指定了宽度,同样可以修改 - format: 'jpg', - quality: qualityNum //图片质量不再修改,以免失真 - }; - var successCB = function(evt) { - // //console.log(JSON.stringify(evt)); - fname = filename; -// files[0]={ -// name: "uploadkey", -// path: evt.target -// }; - files.push({ - name: "uploadkey" + index, - path: evt.target - }); - // index++; - //上传 - upload(callback); - //_this.avatar(evt.target); - }; - var errorCB = function(err) { - appendFile(src,callback); - ////console.log(JSON.stringify(err)); - //mui.toast("图片压缩失败"); - }; - plus.zip.compressImage(opions, successCB, errorCB); -}; -function openCamera(callback) { - plus.nativeUI.actionSheet({ - cancel: "取消", - buttons: [{ - title: "拍照" - }, - { - title: "从相册中选择" - } - ] - }, function(e) { //1 是拍照 2 从相册中选择 - switch (e.index) { - case 1: - appendByCamera(callback); - break; - case 2: - appendByGallery(callback); - break; - } - }); +var files = []; //存储文件信息的数组 +var fname = ""; //表示文件名,例如 XXXX.jpg; +var expire = 0; +var pathName = ''; +var inpId = ''; +var keyname = ''; +var imgId=''; +var isZip=1; +var qualityNum=90; +var response=';' +var UP = UP || {}; +UP.isBatch=0; +UP.init = function(inputId, path,imageId,isBatch,isZipImg,quality) { + inpId = inputId; + pathName = path; + imgId = imageId; + if(typeof(isBatch) != 'undefined'){ + UP.isBatch = isBatch; + } + if(typeof(isZipImg) != 'undefined'){ + // //console.log(typeof(isZipImg)); + isZip = isZipImg; + } + if(typeof(quality) != 'undefined'){ + qualityNum = quality; + } + +} + +function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // //console.log(dir) + serverUrl = qlgUrl('oss/get.php?dir=' + pathName); + // serverUrl = 'https://img.zgqlg.com.cn/oss/get.php?dir=' + pathName; + + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText; + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + +} + +function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if (expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + response = obj; + // //console.log(obj); + } + return response; +}; +// 上传文件 +function upload(callback) { + // //console.log(files); + if (files.length <= 0) { + mui.toast('没有添加上传文件'); + return; + } + var obj = get_signature(); + if (obj) { + server = obj['host']; + policyBase64 = obj['policy']; + accessid = obj['accessid']; + signature = obj['signature']; + expire = parseInt(obj['expire']); + callbackbody = obj['callback']; + path = obj['dir']; + + } else { + mui.toast('初始化失败'); + return; + } + + var wt = plus.nativeUI.showWaiting(); + var task = plus.uploader.createUpload(server, { + method: "POST" + }, function(t, status) { + //上传完成 + if (status == 200) { + wt.close(); + if(1 == UP.isBatch){ + callback(t,status,keyname,server + '/'+keyname); + }else{ + document.getElementById(inpId).value = keyname; + var ele=document.getElementById(imgId); + ele.src=server + '/'+keyname; + ele.setAttribute('data-src',keyname); + mui.toast('上传成功'); + //至此上传成功,上传后的图片完整地址为server+testName + //keyname + } + + } else { + wt.close(); + mui.toast('上传失败:' + status); + } + }); + var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg + keyname = path + new Date().getTime() + suffix1; + task.addData("key", keyname); + task.addData("policy", policyBase64); + task.addData("OSSAccessKeyId", accessid); + task.addData("success_action_status", "200"); + // task.addData("callback", callbackbody); + task.addData("signature", signature); + var f = files[files.length-1]; + // //console.log(f) + + task.addFile(f.path, { + key: "file", + name: "file", + mime: "image/jpeg" + }); + //files.length = 0; + task.start(); + +} + +//得到文件名的后缀 +function get_suffix(filename) { + var pos = filename.lastIndexOf('.'); + var suffix = ''; + if (pos != -1) { + suffix = filename.substring(pos) + } + return suffix; +} +// 拍照添加文件 +function appendByCamera(callback) { + plus.camera.getCamera().captureImage(function(p) { + uploadImg(p,callback); + }); +} +// 从相册添加文件 +function appendByGallery(callback) { + plus.gallery.pick(function(p) { + uploadImg(p,callback); + }); +} + +// 添加文件 +var index = 1; +function uploadImg(p,callback){ + if(1 == isZip){ + compressImg(p,callback); + }else{ + appendFile(p,callback) + } +} +function appendFile(p,callback) { + // var fe = document.getElementById(fileId); + var n = p.substr(p.lastIndexOf('/') + 1); + fname = n; + files.push({ + name: "uploadkey" + index, + path: p + }); + ////console.log(3); + // index++; + upload(callback); +} +function compressImg(src,callback) { + var filename = src.substring(src.lastIndexOf('/') + 1); + var opions = { + src: src, + dst: '_doc/tmp/' + filename, + overwrite: true, + //width: '300px', //这里指定了宽度,同样可以修改 + format: 'jpg', + quality: qualityNum //图片质量不再修改,以免失真 + }; + var successCB = function(evt) { + // //console.log(JSON.stringify(evt)); + fname = filename; +// files[0]={ +// name: "uploadkey", +// path: evt.target +// }; + files.push({ + name: "uploadkey" + index, + path: evt.target + }); + // index++; + //上传 + upload(callback); + //_this.avatar(evt.target); + }; + var errorCB = function(err) { + appendFile(src,callback); + ////console.log(JSON.stringify(err)); + //mui.toast("图片压缩失败"); + }; + plus.zip.compressImage(opions, successCB, errorCB); +}; +function openCamera(callback) { + plus.nativeUI.actionSheet({ + cancel: "取消", + buttons: [{ + title: "拍照" + }, + { + title: "从相册中选择" + } + ] + }, function(e) { //1 是拍照 2 从相册中选择 + switch (e.index) { + case 1: + appendByCamera(callback); + break; + case 2: + appendByGallery(callback); + break; + } + }); } \ No newline at end of file diff --git a/static/app2/js/uploaderBatch.js b/static/app2/js/uploaderBatch.js old mode 100755 new mode 100644 index f98393f..28906ba --- a/static/app2/js/uploaderBatch.js +++ b/static/app2/js/uploaderBatch.js @@ -1,219 +1,219 @@ -var files = []; //存储文件信息的数组 -var fname = ""; //表示文件名,例如 XXXX.jpg; -var expire = 0; -var pathName = ''; -var keyname = ''; -var isZip=1; -var qualityNum=90; -var UP = UP || {}; -UP.isOk=0; -UP.init = function( path,isZipImg,quality) { - pathName = path; - if(typeof(isZipImg) != 'undefined'){ - // //console.log(typeof(isZipImg)); - isZip = isZipImg; - } - if(typeof(quality) != 'undefined'){ - qualityNum = quality; - } -} - -function send_request() { - var xmlhttp = null; - if (window.XMLHttpRequest) { - xmlhttp = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - - if (xmlhttp != null) { - // //console.log(dir) - serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; - xmlhttp.open("GET", serverUrl, false); - xmlhttp.send(null); - return xmlhttp.responseText - } else { - mui.alert("Your browser does not support XMLHTTP."); - } - -} - -function get_signature() { - //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 - now = timestamp = Date.parse(new Date()) / 1000; - if (expire < now + 3) { - body = send_request() - var obj = eval("(" + body + ")"); - // //console.log(obj); - return obj; - } - return false; -}; -// 上传文件 -function uploadInit(){ - // //console.log(files); - if (files.length <= 0) { - mui.toast('没有添加上传文件'); - return; - } - var obj = get_signature(); - if (obj) { - server = obj['host']; - policyBase64 = obj['policy']; - accessid = obj['accessid']; - signature = obj['signature']; - expire = parseInt(obj['expire']); - callbackbody = obj['callback']; - path = obj['dir']; - - } else { - mui.toast('初始化失败'); - return; - } - var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg - keyname = path + new Date().getTime() + suffix1; - task.addData("key", keyname); - task.addData("policy", policyBase64); - task.addData("OSSAccessKeyId", accessid); - task.addData("success_action_status", "200"); - // task.addData("callback", callbackbody); - task.addData("signature", signature); - var f = files[files.length-1]; - // //console.log(f) - - task.addFile(f.path, { - key: "file", - name: "file", - mime: "image/jpeg" - }); - //files.length = 0; - return true; -} -// //上传完成 -// if (status == 200) { -// -// //console.log(inpId); -// document.getElementById(inpId).value = keyname; -// var ele=document.getElementById(imgId); -// ele.src=server + '/'+keyname; -// ele.setAttribute('data-src',keyname); -// wt.close(); -// mui.toast('上传成功'); -// UP.isOk=1; -// if(1 == UP.isOk){ -// var html='
      '; -// if($('#galleryImg['+num+']').length>0){ -// $('#galleryImg['+num+']').parent().html(html); -// -// -// }else{ -// $(".photos_con").append(html); -// var maxNum = $('.photos_con').children('.galleryImg').length-1; -// if(num >= maxNum){ -// html='
      '; -// $(".photos_con").append(html); -// } -// -// } -// } - //至此上传成功,上传后的图片完整地址为server+testName - - -//得到文件名的后缀 -function get_suffix(filename) { - var pos = filename.lastIndexOf('.'); - var suffix = ''; - if (pos != -1) { - suffix = filename.substring(pos) - } - return suffix; -} -// 拍照添加文件 -function appendByCamera() { - plus.camera.getCamera().captureImage(function(p) { - uploadImg(p); - }); -} -// 从相册添加文件 -function appendByGallery() { - plus.gallery.pick(function(p) { - uploadImg(p); - }); -} - -// 添加文件 -var index = 1; -function uploadImg(p){ - UP.isOk=0; - if(1 == isZip){ - compressImg(p); - }else{ - appendFile(p) - } -} -function appendFile(p) { - // var fe = document.getElementById(fileId); - var n = p.substr(p.lastIndexOf('/') + 1); - fname = n; - files.push({ - name: "uploadkey" + index, - path: p - }); - ////console.log(3); - // index++; - upload(); -} -function compressImg(src) { - var filename = src.substring(src.lastIndexOf('/') + 1); - var opions = { - src: src, - dst: '_doc/tmp/' + filename, - overwrite: true, - //width: '300px', //这里指定了宽度,同样可以修改 - format: 'jpg', - quality: qualityNum //图片质量不再修改,以免失真 - }; - var successCB = function(evt) { - // //console.log(JSON.stringify(evt)); - fname = filename; -// files[0]={ -// name: "uploadkey", -// path: evt.target -// }; - files.push({ - name: "uploadkey" + index, - path: evt.target - }); - // index++; - //上传 - upload(); - //_this.avatar(evt.target); - }; - var errorCB = function(err) { - appendFile(src); - ////console.log(JSON.stringify(err)); - //mui.toast("图片压缩失败"); - }; - plus.zip.compressImage(opions, successCB, errorCB); -}; -function openCamera() { - plus.nativeUI.actionSheet({ - cancel: "取消", - buttons: [{ - title: "拍照" - }, - { - title: "从相册中选择" - } - ] - }, function(e) { //1 是拍照 2 从相册中选择 - switch (e.index) { - case 1: - appendByCamera(); - break; - case 2: - appendByGallery(); - break; - } - }); +var files = []; //存储文件信息的数组 +var fname = ""; //表示文件名,例如 XXXX.jpg; +var expire = 0; +var pathName = ''; +var keyname = ''; +var isZip=1; +var qualityNum=90; +var UP = UP || {}; +UP.isOk=0; +UP.init = function( path,isZipImg,quality) { + pathName = path; + if(typeof(isZipImg) != 'undefined'){ + // //console.log(typeof(isZipImg)); + isZip = isZipImg; + } + if(typeof(quality) != 'undefined'){ + qualityNum = quality; + } +} + +function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // //console.log(dir) + serverUrl = 'http://t.ect99.com/oss/get.php?dir=' + pathName; + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + +} + +function get_signature() { + //可以判断当前expire是否超过了当前时间,如果超过了当前时间,就重新取一下.3s 做为缓冲 + now = timestamp = Date.parse(new Date()) / 1000; + if (expire < now + 3) { + body = send_request() + var obj = eval("(" + body + ")"); + // //console.log(obj); + return obj; + } + return false; +}; +// 上传文件 +function uploadInit(){ + // //console.log(files); + if (files.length <= 0) { + mui.toast('没有添加上传文件'); + return; + } + var obj = get_signature(); + if (obj) { + server = obj['host']; + policyBase64 = obj['policy']; + accessid = obj['accessid']; + signature = obj['signature']; + expire = parseInt(obj['expire']); + callbackbody = obj['callback']; + path = obj['dir']; + + } else { + mui.toast('初始化失败'); + return; + } + var suffix1 = get_suffix(fname); //文件后缀 例如 .jpg + keyname = path + new Date().getTime() + suffix1; + task.addData("key", keyname); + task.addData("policy", policyBase64); + task.addData("OSSAccessKeyId", accessid); + task.addData("success_action_status", "200"); + // task.addData("callback", callbackbody); + task.addData("signature", signature); + var f = files[files.length-1]; + // //console.log(f) + + task.addFile(f.path, { + key: "file", + name: "file", + mime: "image/jpeg" + }); + //files.length = 0; + return true; +} +// //上传完成 +// if (status == 200) { +// +// //console.log(inpId); +// document.getElementById(inpId).value = keyname; +// var ele=document.getElementById(imgId); +// ele.src=server + '/'+keyname; +// ele.setAttribute('data-src',keyname); +// wt.close(); +// mui.toast('上传成功'); +// UP.isOk=1; +// if(1 == UP.isOk){ +// var html='
      '; +// if($('#galleryImg['+num+']').length>0){ +// $('#galleryImg['+num+']').parent().html(html); +// +// +// }else{ +// $(".photos_con").append(html); +// var maxNum = $('.photos_con').children('.galleryImg').length-1; +// if(num >= maxNum){ +// html='
      '; +// $(".photos_con").append(html); +// } +// +// } +// } + //至此上传成功,上传后的图片完整地址为server+testName + + +//得到文件名的后缀 +function get_suffix(filename) { + var pos = filename.lastIndexOf('.'); + var suffix = ''; + if (pos != -1) { + suffix = filename.substring(pos) + } + return suffix; +} +// 拍照添加文件 +function appendByCamera() { + plus.camera.getCamera().captureImage(function(p) { + uploadImg(p); + }); +} +// 从相册添加文件 +function appendByGallery() { + plus.gallery.pick(function(p) { + uploadImg(p); + }); +} + +// 添加文件 +var index = 1; +function uploadImg(p){ + UP.isOk=0; + if(1 == isZip){ + compressImg(p); + }else{ + appendFile(p) + } +} +function appendFile(p) { + // var fe = document.getElementById(fileId); + var n = p.substr(p.lastIndexOf('/') + 1); + fname = n; + files.push({ + name: "uploadkey" + index, + path: p + }); + ////console.log(3); + // index++; + upload(); +} +function compressImg(src) { + var filename = src.substring(src.lastIndexOf('/') + 1); + var opions = { + src: src, + dst: '_doc/tmp/' + filename, + overwrite: true, + //width: '300px', //这里指定了宽度,同样可以修改 + format: 'jpg', + quality: qualityNum //图片质量不再修改,以免失真 + }; + var successCB = function(evt) { + // //console.log(JSON.stringify(evt)); + fname = filename; +// files[0]={ +// name: "uploadkey", +// path: evt.target +// }; + files.push({ + name: "uploadkey" + index, + path: evt.target + }); + // index++; + //上传 + upload(); + //_this.avatar(evt.target); + }; + var errorCB = function(err) { + appendFile(src); + ////console.log(JSON.stringify(err)); + //mui.toast("图片压缩失败"); + }; + plus.zip.compressImage(opions, successCB, errorCB); +}; +function openCamera() { + plus.nativeUI.actionSheet({ + cancel: "取消", + buttons: [{ + title: "拍照" + }, + { + title: "从相册中选择" + } + ] + }, function(e) { //1 是拍照 2 从相册中选择 + switch (e.index) { + case 1: + appendByCamera(); + break; + case 2: + appendByGallery(); + break; + } + }); } \ No newline at end of file diff --git a/static/app2/js/uploadqiniu.js b/static/app2/js/uploadqiniu.js old mode 100755 new mode 100644 index 725a0ce..9445677 --- a/static/app2/js/uploadqiniu.js +++ b/static/app2/js/uploadqiniu.js @@ -1,92 +1,92 @@ -function uploadInit(btnId,containerId,textElemId) { - // 获取相关 DOM 节点的 ID -// var btnId = editor.imgMenuId; -// var containerId = editor.toolbarElemId; -// var textElemId = editor.textElemId; -// var btnId =''; -// var containerId ='' -// var textElemId = '' - // 创建上传对象 - var uploader = new Qiniu.uploader({ - runtimes: 'html5,flash,html4', //上传模式,依次退化 - browse_button: btnId, //上传选择的点选按钮,**必需** - uptoken_url: '/uptoken', - //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) - // uptoken : '', - //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 - // unique_names: true, - // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) - // save_key: true, - // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 - domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', - //bucket 域名,下载资源时用到,**必需** - container: containerId, //上传区域DOM ID,默认是browser_button的父元素, - max_file_size: '100mb', //最大文件体积限制 - flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 - filters: { - mime_types: [ - //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) - { title: "图片文件", extensions: "jpg,gif,png,bmp" } - ] - }, - max_retries: 3, //上传失败最大重试次数 - dragdrop: true, //开启可拖曳上传 - drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 - chunk_size: '4mb', //分块上传时,每片的体积 - auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 - init: { - 'FilesAdded': function(up, files) { - plupload.each(files, function(file) { - // 文件添加进队列后,处理相关的事情 - printLog('on FilesAdded'); - }); - }, - 'BeforeUpload': function(up, file) { - // 每个文件上传前,处理相关的事情 - printLog('on BeforeUpload'); - }, - 'UploadProgress': function(up, file) { - // 显示进度 - printLog('进度 ' + file.percent) - }, - 'FileUploaded': function(up, file, info) { - // 每个文件上传成功后,处理相关的事情 - // 其中 info 是文件上传成功后,服务端返回的json,形式如 - // { - // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", - // "key": "gogopher.jpg" - // } - printLog(info); - // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html - - var domain = up.getOption('domain'); - var res = $.parseJSON(info); - var sourceLink = domain + res.key; //获取上传成功后的文件的Url - - printLog(sourceLink); - - // 插入图片到editor - editor.cmd.do('insertHtml', '') - }, - 'Error': function(up, err, errTip) { - //上传出错时,处理相关的事情 - printLog('on Error'); - }, - 'UploadComplete': function() { - //队列文件处理完毕后,处理相关的事情 - printLog('on UploadComplete'); - } - // Key 函数如果有需要自行配置,无特殊需要请注释 - //, - // 'Key': function(up, file) { - // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 - // // 该配置必须要在 unique_names: false , save_key: false 时才生效 - // var key = ""; - // // do something with key here - // return key - // } - } - // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 - // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs - }); -} +function uploadInit(btnId,containerId,textElemId) { + // 获取相关 DOM 节点的 ID +// var btnId = editor.imgMenuId; +// var containerId = editor.toolbarElemId; +// var textElemId = editor.textElemId; +// var btnId =''; +// var containerId ='' +// var textElemId = '' + // 创建上传对象 + var uploader = new Qiniu.uploader({ + runtimes: 'html5,flash,html4', //上传模式,依次退化 + browse_button: btnId, //上传选择的点选按钮,**必需** + uptoken_url: '/uptoken', + //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) + // uptoken : '', + //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 + // unique_names: true, + // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) + // save_key: true, + // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 + domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', + //bucket 域名,下载资源时用到,**必需** + container: containerId, //上传区域DOM ID,默认是browser_button的父元素, + max_file_size: '100mb', //最大文件体积限制 + flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 + filters: { + mime_types: [ + //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) + { title: "图片文件", extensions: "jpg,gif,png,bmp" } + ] + }, + max_retries: 3, //上传失败最大重试次数 + dragdrop: true, //开启可拖曳上传 + drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 + chunk_size: '4mb', //分块上传时,每片的体积 + auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 + init: { + 'FilesAdded': function(up, files) { + plupload.each(files, function(file) { + // 文件添加进队列后,处理相关的事情 + printLog('on FilesAdded'); + }); + }, + 'BeforeUpload': function(up, file) { + // 每个文件上传前,处理相关的事情 + printLog('on BeforeUpload'); + }, + 'UploadProgress': function(up, file) { + // 显示进度 + printLog('进度 ' + file.percent) + }, + 'FileUploaded': function(up, file, info) { + // 每个文件上传成功后,处理相关的事情 + // 其中 info 是文件上传成功后,服务端返回的json,形式如 + // { + // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", + // "key": "gogopher.jpg" + // } + printLog(info); + // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html + + var domain = up.getOption('domain'); + var res = $.parseJSON(info); + var sourceLink = domain + res.key; //获取上传成功后的文件的Url + + printLog(sourceLink); + + // 插入图片到editor + editor.cmd.do('insertHtml', '') + }, + 'Error': function(up, err, errTip) { + //上传出错时,处理相关的事情 + printLog('on Error'); + }, + 'UploadComplete': function() { + //队列文件处理完毕后,处理相关的事情 + printLog('on UploadComplete'); + } + // Key 函数如果有需要自行配置,无特殊需要请注释 + //, + // 'Key': function(up, file) { + // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 + // // 该配置必须要在 unique_names: false , save_key: false 时才生效 + // var key = ""; + // // do something with key here + // return key + // } + } + // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs + }); +} diff --git a/static/app2/js/vouchers.js b/static/app2/js/vouchers.js old mode 100755 new mode 100644 index e6b79f6..bff4f29 --- a/static/app2/js/vouchers.js +++ b/static/app2/js/vouchers.js @@ -1,92 +1,92 @@ -var vouchersType = '', - isExpected = ''; -var data_href = ''; -var pageSize = 10; -var count = 1; -var isLoading = false; -mui.plusReady(function() { - - var self = plus.webview.currentWebview(); - - vouchersType = self.data_type; - isExpected = self.data_expect; - data_href = self.data_href; - - getvoucherList(count, pageSize); - - switch (data_href) { - case "expectedProduct": - $('.title').html('预获产品券'); - - break; - case "expectedCoupons": - $('.title').text('预获优惠券'); - break; - case "expectedWang": - $('.title').text('预获旺旺券'); - break - case "coupons": - $('.title').text('已获优惠券'); - break - case "product": - $('.title').text('已获产品券'); - break - case "wang": - $('.title').text('已获旺旺券'); - break - - } - - - function getvoucherList(count, pageSize) { - if (true == isLoading) return; - isLoading = true; - JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), { - page: count, - perPage: pageSize, - vouchersType: vouchersType, - isExpected: isExpected, - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - // console.log(data); - var data = toJson(data); - if (data.status == 1) { - data = data.data; - if (data.Rows == '') { - $('.con').append( - '

      没有更多数据

      '); - return; - } - var html = '' - $.each(data.Rows, function() { - html += '
      ' + this.num + - '
      ' + this.remark + '
      ' + this.createTime + - '
      '; - }) - if (count == 1) { - $('.con').html(html); - } else { - $('.con').append(html); - } - } else { - mui.alert(data.msg) - } - isLoading = false; - }); - } - - - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (e.cancelable) { - // 判断默认行为是否已经被禁用 - if (!e.defaultPrevented) { - e.preventDefault(); - } - } - if (scroll.y == scroll.maxScrollY) { - if (isLoading == false) { - count++; - getvoucherList(count, pageSize) - } - } - }) +var vouchersType = '', + isExpected = ''; +var data_href = ''; +var pageSize = 10; +var count = 1; +var isLoading = false; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + + vouchersType = self.data_type; + isExpected = self.data_expect; + data_href = self.data_href; + + getvoucherList(count, pageSize); + + switch (data_href) { + case "expectedProduct": + $('.title').html('预获产品券'); + + break; + case "expectedCoupons": + $('.title').text('预获优惠券'); + break; + case "expectedWang": + $('.title').text('预获旺旺券'); + break + case "coupons": + $('.title').text('已获优惠券'); + break + case "product": + $('.title').text('已获产品券'); + break + case "wang": + $('.title').text('已获旺旺券'); + break + + } + + + function getvoucherList(count, pageSize) { + if (true == isLoading) return; + isLoading = true; + JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), { + page: count, + perPage: pageSize, + vouchersType: vouchersType, + isExpected: isExpected, + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // console.log(data); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows == '') { + $('.con').append( + '

      没有更多数据

      '); + return; + } + var html = '' + $.each(data.Rows, function() { + html += '
      ' + this.num + + '
      ' + this.remark + '
      ' + this.createTime + + '
      '; + }) + if (count == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + } else { + mui.alert(data.msg) + } + isLoading = false; + }); + } + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + count++; + getvoucherList(count, pageSize) + } + } + }) }) diff --git a/static/app2/js/yhk.js b/static/app2/js/yhk.js old mode 100755 new mode 100644 index 1600e80..29a8b38 --- a/static/app2/js/yhk.js +++ b/static/app2/js/yhk.js @@ -1,124 +1,124 @@ -mui.plusReady(function() { - - window.addEventListener('reload', function(e) { //执行刷新 - location.reload(); - }); - - $('.add1').on('tap', function() { - JZL.openWindow('addyhk.html', 'addyhk.html'); - }) - var yhkid; - mui('.con').on('tap', '.bj', function() { - yhkid = $(this).attr("data-id"); - JZL.openWindow('addyhk.html', yhkid); - }) - - var page = 1; - var pageSize = 10; - var isjiazai = 1; - getRecommend(page, pageSize); - - function getRecommend(page, pageSize) { - var recommenddata = { - page: page ? page : 1, - pageSize: pageSize ? pageSize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/auth/getCompanyBankList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - if (data.status == 1) { - var html = ''; - var data = data.data; - if ('' == data.Rows) { - $('.mui-scroll').append( - '

      没有更多数据

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - html += '

      ' + this.accountName + - '(' + this.bankNo + - ')

      '; - // //console.log(this.id); - - - }) - if (page == 1) { - $('.con').html(html); - } else { - $('.con').append(html); - } - } else { - mui.alert(data.msg) - } - isjiazai = 1; - }) - - } - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pageSize); - } - } - }) - - $('.con').on('tap', '.del', function() { - - yhkid = $(this).attr('data-id'); - if (confirm('确认删除?')) { - var lxy_div = - '

      请输入操作密码

      '; - - $('body').append(lxy_div); - - $('.lxy_zz').on('tap', function(e) { - e.preventDefault(); - e.stopPropagation() - - }) - mui('.lxy_zz_btn').on('tap', '.cancle', function() { - $('#home_zhezhao').remove(); - return; - }) - - mui('.lxy_zz_btn').on('tap', '.sure', function() { - var payPwd = $('.payword').val(); - if (payPwd == '') { - mui.alert("请输入密码") - } - - JZL.ajax(qlgUrl('app/auth/delCompanyBank'), { - id: yhkid, - payPwd: payPwd - }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - //console.log(data); - var data = toJson(data, 1); - if (data.status == 1) { - $('#home_zhezhao').remove(); - location.reload() - - } else { - mui.alert(data.msg) - } - }) - // //console.log(data_addressId); - // mui.ajax(hyhUrl('app/Useraddress/del'), { - - }); - } - - }) - - - - - +mui.plusReady(function() { + + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + + $('.add1').on('tap', function() { + JZL.openWindow('addyhk.html', 'addyhk.html'); + }) + var yhkid; + mui('.con').on('tap', '.bj', function() { + yhkid = $(this).attr("data-id"); + JZL.openWindow('addyhk.html', yhkid); + }) + + var page = 1; + var pageSize = 10; + var isjiazai = 1; + getRecommend(page, pageSize); + + function getRecommend(page, pageSize) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/auth/getCompanyBankList'), recommenddata, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + if (data.status == 1) { + var html = ''; + var data = data.data; + if ('' == data.Rows) { + $('.mui-scroll').append( + '

      没有更多数据

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + html += '

      ' + this.accountName + + '(' + this.bankNo + + ')

      '; + // //console.log(this.id); + + + }) + if (page == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + } else { + mui.alert(data.msg) + } + isjiazai = 1; + }) + + } + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } + }) + + $('.con').on('tap', '.del', function() { + + yhkid = $(this).attr('data-id'); + if (confirm('确认删除?')) { + var lxy_div = + '

      请输入操作密码

      '; + + $('body').append(lxy_div); + + $('.lxy_zz').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + + }) + mui('.lxy_zz_btn').on('tap', '.cancle', function() { + $('#home_zhezhao').remove(); + return; + }) + + mui('.lxy_zz_btn').on('tap', '.sure', function() { + var payPwd = $('.payword').val(); + if (payPwd == '') { + mui.alert("请输入密码") + } + + JZL.ajax(qlgUrl('app/auth/delCompanyBank'), { + id: yhkid, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data, 1); + if (data.status == 1) { + $('#home_zhezhao').remove(); + location.reload() + + } else { + mui.alert(data.msg) + } + }) + // //console.log(data_addressId); + // mui.ajax(hyhUrl('app/Useraddress/del'), { + + }); + } + + }) + + + + + }) diff --git a/static/app2/js/zepto.min.js b/static/app2/js/zepto.min.js old mode 100755 new mode 100644 index 8a76710..428f84a --- a/static/app2/js/zepto.min.js +++ b/static/app2/js/zepto.min.js @@ -1,2 +1,2 @@ -/* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ +/* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ (function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/static/app2/js/zhugouba.js b/static/app2/js/zhugouba.js new file mode 100644 index 0000000..1dbc5da --- /dev/null +++ b/static/app2/js/zhugouba.js @@ -0,0 +1,332 @@ +$('.getquan').css('display', 'none'); +// $('#search').css('width', '80%'); +$('.saoyisao').hide(); +$('.class_block').eq(0).attr('data-classifyId', 5); +$('.class_block').eq(1).attr('data-classifyId', 6); +$('.class_block').eq(2).attr('data-classifyId', 7); +$('.class_block').eq(3).attr('data-classifyId', 8); +$('.class_block').eq(4).attr('data-classifyId', ''); +$('.zya_block').addClass('add_'); +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + }, +}); +var data = ''; +var addr = ''; +var lat = '', + lat1 = '', + lng = ''; +var page = 1; +var pageSize = 5; +var count = 1; +var isjiazai = 1; +var nowPage = 1; +var isLoading = false; +from_id=3; +mui.plusReady(function() { + getLocation(); + function getLocation() { + if (navigator.geolocation) { + plus.geolocation.getCurrentPosition(showPosition, showError); + + } else { + mui.alert("手机不支持定位") + } + } + function showPosition(position) { + + lat = position.coords.latitude; + lng = position.coords.longitude; + localStorage.setItem('lat', lat); + localStorage.setItem('lng', lng); + getShopList(nowPage, pageSize); + addr = position.address.city; + localStorage.setItem('addr', addr); + $('#location').html(addr); + $('#location-r').html(addr); + } + + function showError(error) { + switch (error.code) { + case error.TIMEOUT: + mui.alert('请求超时,请重试') + break; + case error.POSITION_UNAVAILABLE: + mui.alert('定位不到你的地址') + break; + case error.PERMISSION_DENIED: + // case 22: + mui.alert('您拒绝了地理位置请求') + break; + case error.UNKNOWN_ERROR: + mui.alert('未知错误') + break; + default: + console.log(error) + break; + } + getShopList(nowPage, pageSize); + } + //bannerTop + mui.ajax(qlgUrl('app/shopping/getHelpShopCarousel'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
      '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + var topBannerheight = localStorage.getItem('topBannerheight') + + $('#top_banner').height(topBannerheight) + // $('#top_banner').height(($('#top_banner').width() )* 460 / 750); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + mui('.con').on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId, from_id:3, from_id:3}); + }) + function getShopList(nowPage, pageSize) { + + lat = localStorage.getItem('lat'); + lng = localStorage.getItem('lng'); + + if (null == lat) { + lat = 36.659565; + lng = 117.125824; + } + var recommenddata = { + shopType: 3, + page: nowPage ? nowPage : 1, + perPage: pageSize ? pageSize : 10, + lat: lat, + lng: lng, + } + if (true == isLoading) return; + isLoading = true; + //console.log(lat); + JZL.ajax(hyhUrl('app/shopping/getHelpShops'), recommenddata, function(data) { + var html = ''; + var shopLevel + if (1 == data.status) { + var data = data.data; + // console.log(data); + if ('' == data.Rows) { + $('.shoplist').append( + '

      没有更多数据

      '); + // isLoading = false; + return; + } + $.each(data.Rows, function(index, element) { + shopLevel = this.shopLevel + if(0==shopLevel){ + shopLevel ='' + } + html += + '
      ' + + this.shopName + ''+ shopLevel + '
      进店逛逛
      ' + if (0 != this.goods.length) { + $.each(this.goods, function(idx, ele) { + + html += '
      ¥' + this.shopPrice + '
      ' + }) + } + + html += '
      距离:' + this.distance / 1000 + + '公里
      ' + }) + if (nowPage == 1) { + $('.shoplist').html(html); + } else { + $('.shoplist').append(html); + } + isLoading = false; + } else { + mui.alert(data.msg) + } + }) + } + //加载 + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + nowPage++; + // getShops(nowPage, pageSize); + getShopList(nowPage, pageSize) + } + } + }) + mui('.shoplist').on('tap', '.shops-content1-title', function() { + // var goodsId = $(this).attr('data-goodsId'); + var shopName = $(this).attr("data-shopName"); + var shopId = $(this).attr("data-shopId"); + JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId,from_id:from_id}); + }) +}) + +//获取推荐页 +function getRecommend(page, pagesize) { + var recommenddata = { + type : 3 , + page: page ? page : 1, + pagesize: pageSize ? pageSize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) { + // console.log(data); + // if (data.status == 1) { + var html = ''; + // var data = data.data; + if (data.Rows == '') { + $('.self_shop_rem').append( + '

      没有更多商品

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
      ' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率  ' + this.discountRate + + '
      '; + }); + + if (page == 1) { + $('.recommend_con').html(html); + } else { + $('.recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + // } else { + // mui.alert(data.msg) + // } + }) +} +$('.bcon_left').height($('.bcon_left').width() * 345 / 185); +$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185); +$('.bcr_block').height($('.bcr_block').width()); +$('.addsct_block').height($('.addsct_block').width() * 225 / 355); +$('.addscb_block').height($('.addscb_block').width() * 260 / 180); +$('.zya_block').height($('.zya_block').width() * 185 / 355); + +var issx = 0; + +// 轮播图跳转 +$('#slider').on('tap', '.swiper-slide', function() { + openAds($(this)); +}) + +//导航栏 +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } +}) +mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == '') { + url = 'ac3.html'; + } + JZL.openWindow(url, url, {classifyId: classifyId}); +}) + +//为你推荐 +getRecommend(page, pageSize); +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } +}) +//搜索 +$('.header').on('focus', '#keyword', function() { + $(".search button").css('display', 'block'); +}) +$('.header').on('blur', '#keyword', function() { + $(".search button").css('display', 'none'); +}) +$(".header").on('tap', '.search button', function(e) { + var searchName = $('#keyword').val(); + // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName,goodsType:2}); + JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName,goodsType :3, from_id:3}); + $('#keyword').val("") +}); +//跳转商品详情页 +mui("body").on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + var shopId = $(this).parent().parent().attr('data-shopId'); + var goodsType=$(this).attr('data-goodsType') + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId,goodsType : 3, from_id:3}); +}) diff --git a/static/app2/js/zhuweiba.js b/static/app2/js/zhuweiba.js old mode 100755 new mode 100644 index de7df83..a747e2f --- a/static/app2/js/zhuweiba.js +++ b/static/app2/js/zhuweiba.js @@ -1,332 +1,333 @@ -$('.getquan').css('display', 'none'); -// $('#search').css('width', '80%'); -$('.saoyisao').hide(); -$('.class_block').eq(0).attr('data-classifyId', 5); -$('.class_block').eq(1).attr('data-classifyId', 6); -$('.class_block').eq(2).attr('data-classifyId', 7); -$('.class_block').eq(3).attr('data-classifyId', 8); -$('.class_block').eq(4).attr('data-classifyId', ''); -$('.zya_block').addClass('add_'); -mui.init({ - beforeback: function() { //获得父页面的webview - var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 - mui.fire(list, 'refresh'); - //返回true,继续页面关闭逻辑 - return true; - }, -}); -var data = ''; -var addr = ''; -var lat = '', - lat1 = '', - lng = ''; -var page = 1; -var pageSize = 5; -var count = 1; -var isjiazai = 1; -var nowPage = 1; -var isLoading = false; -mui.plusReady(function() { - getLocation(); - function getLocation() { - if (navigator.geolocation) { - plus.geolocation.getCurrentPosition(showPosition, showError); - - } else { - mui.alert("手机不支持定位") - } - } - function showPosition(position) { - - lat = position.coords.latitude; - lng = position.coords.longitude; - localStorage.setItem('lat', lat); - localStorage.setItem('lng', lng); - getShopList(nowPage, pageSize); - addr = position.address.city; - localStorage.setItem('addr', addr); - $('#location').html(addr); - $('#location-r').html(addr); - } - - function showError(error) { - switch (error.code) { - case error.TIMEOUT: - mui.alert('请求超时,请重试') - break; - case error.POSITION_UNAVAILABLE: - mui.alert('定位不到你的地址') - break; - case error.PERMISSION_DENIED: - // case 22: - mui.alert('您拒绝了地理位置请求') - break; - case error.UNKNOWN_ERROR: - mui.alert('未知错误') - break; - default: - mui.alert(error.message) - break; - } - getShopList(nowPage, pageSize); - } - //bannerTop - mui.ajax(qlgUrl('app/shopping/getHelpCarousel'), { - dataType: 'json', //服务器返回json格式数据 - type: 'post', //HTTP请求类型 - timeout: 10000, //超时时间设置为10秒; - success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; - if (data.status == 1) { - var html = ''; - var data = data.data; - $.each(data, function() { - html += '
      '; - }); - $('#top_banner .swiper-wrapper').html(html); - var swiper = new Swiper('#top_banner', { - pagination: '#top_banner_pagination', - spaceBetween: 0, - loop: true, - autoplay: 3500, - autoplayDisableOnInteraction: false - }); - var topBannerheight = localStorage.getItem('topBannerheight') - - $('#top_banner').height(topBannerheight) - // $('#top_banner').height(($('#top_banner').width() )* 460 / 750); - } else { - mui.alert(data.msg) - } - }, - error: function(xhr, type, errorThrown) { //异常处理; - // mui.alert(errorThrown); - } - }); - - mui('.con').on('tap', '.bc_img', function() { - var goodsId = $(this).attr('data-goodsId'); - JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId}); - }) - function getShopList(nowPage, pageSize) { - - lat = localStorage.getItem('lat'); - lng = localStorage.getItem('lng'); - - if (null == lat) { - lat = 36.659565; - lng = 117.125824; - } - var recommenddata = { - shopType: 1, - page: nowPage ? nowPage : 1, - perPage: pageSize ? pageSize : 10, - lat: lat, - lng: lng, - } - if (true == isLoading) return; - isLoading = true; - //console.log(lat); - JZL.ajax(hyhUrl('app/shopping/getHelpShops'), recommenddata, function(data) { - - var html = ''; - var shopLevel - if (1 == data.status) { - var data = data.data; - // console.log(data); - if ('' == data.Rows) { - $('.shoplist').append( - '

      没有更多数据

      '); - // isLoading = false; - return; - } - $.each(data.Rows, function(index, element) { - shopLevel = this.shopLevel - if(0==shopLevel){ - shopLevel ='' - } - html += - '
      ' + - this.shopName + ''+ shopLevel + '
      进店逛逛
      ' - if (0 != this.goods.length) { - $.each(this.goods, function(idx, ele) { - - html += '
      ¥' + this.shopPrice + '
      ' - }) - } - - html += '
      距离:' + this.distance / 1000 + - '公里
      ' - }) - if (nowPage == 1) { - $('.shoplist').html(html); - } else { - $('.shoplist').append(html); - } - isLoading = false; - } else { - mui.alert(data.msg) - } - }) - } - //加载 - document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isLoading == false) { - nowPage++; - // getShops(nowPage, pageSize); - getShopList(nowPage, pageSize) - } - } - }) - mui('.shoplist').on('tap', '.shops-content1-title', function() { - // var goodsId = $(this).attr('data-goodsId'); - var shopName = $(this).attr("data-shopName"); - var shopId = $(this).attr("data-shopId"); - JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId}); - }) -}) - -//获取推荐页 -function getRecommend(page, pagesize) { - var recommenddata = { - type : 2 , - page: page ? page : 1, - pagesize: pageSize ? pageSize : 10 - } - if (isjiazai == 0) { - return; - } else { - isjiazai = 0; - } - JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) { - // console.log(data); - // if (data.status == 1) { - var html = ''; - // var data = data.data; - if (data.Rows == '') { - $('.self_shop_rem').append( - '

      没有更多商品

      '); - isjiazai = 0; - return; - } - $.each(data.Rows, function() { - - html += '
      ' + this.goodsName + '
      ¥' + this.shopPrice + - ' 满减
      ' + this.saleNum + - '人购买
      优惠率  ' + this.discountRate + - '
      '; - }); - - if (page == 1) { - $('.recommend_con').html(html); - } else { - $('.recommend_con').append(html); - } - isjiazai = 1; - $('.rcb_title span').each(function() { - if ($(this).attr('data-goodsId') == 1) { - $(this).css('display', 'none'); - } - }) - $('.rcb_img').height($('.rcb_img').width()); - - // } else { - // mui.alert(data.msg) - // } - }) -} -$('.bcon_left').height($('.bcon_left').width() * 345 / 185); -$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185); -$('.bcr_block').height($('.bcr_block').width()); -$('.addsct_block').height($('.addsct_block').width() * 225 / 355); -$('.addscb_block').height($('.addscb_block').width() * 260 / 180); -$('.zya_block').height($('.zya_block').width() * 185 / 355); - -var issx = 0; - -// 轮播图跳转 -$('#slider').on('tap', '.swiper-slide', function() { - openAds($(this)); -}) - -//导航栏 -document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (-scroll.y < 0) { - num = 0; - } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { - num = -scroll.y / 150; - } else { - num = 1; - } - $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') - - if (-scroll.y < 75) { - $('.saoyisao').attr('src', '../img/saoyisao.png'); - $('.msg').attr('src', '../img/icon_msg.png'); - $('.search').attr('src', '../img/icon_search.png'); - $('#search').css('background-color', 'white'); - $('.header').removeClass('shadown_wai'); - } else { - $('.saoyisao').attr('src', '../img/saoyisao1.png'); - $('.msg').attr('src', '../img/icon_msg1.png'); - $('.search').attr('src', '../img/icon_search1.png'); - $('#search').css('background-color', '#d8d8d8'); - $('.header').addClass('shadown_wai'); - } - - if (scroll.y > 80 && issx == 0) { - issx = 1; - setTimeout(function() { - location.reload() - }, 1000) - } -}) -mui('.classify').on('tap', '.class_block', function() { - var classifyId = $(this).attr('data-classifyId'); - var url = 'orSupermarket.html'; - - if (classifyId == '') { - url = 'ac3.html'; - } - JZL.openWindow(url, url, {classifyId: classifyId}); -}) - -//为你推荐 -getRecommend(page, pageSize); -document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { - if (scroll.y == scroll.maxScrollY) { - if (isjiazai == 1) { - page++; - getRecommend(page, pageSize); - } - } -}) -//搜索 -$('.header').on('focus', '#keyword', function() { - $(".search button").css('display', 'block'); -}) -$('.header').on('blur', '#keyword', function() { - $(".search button").css('display', 'none'); -}) -$(".header").on('tap', '.search button', function(e) { - var searchName = $('#keyword').val(); - // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName,goodsType:2}); - JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName,goodsType :2}); - $('#keyword').val("") -}); -//跳转商品详情页 -mui("body").on('tap', '.bc_img', function() { - var goodsId = $(this).attr('data-goodsId'); - var shopId = $(this).parent().parent().attr('data-shopId'); - var goodsType=$(this).attr('data-goodsType') - JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId,goodsType : goodsType}); +$('.getquan').css('display', 'none'); +// $('#search').css('width', '80%'); +$('.saoyisao').hide(); +$('.class_block').eq(0).attr('data-classifyId', 5); +$('.class_block').eq(1).attr('data-classifyId', 6); +$('.class_block').eq(2).attr('data-classifyId', 7); +$('.class_block').eq(3).attr('data-classifyId', 8); +$('.class_block').eq(4).attr('data-classifyId', ''); +$('.zya_block').addClass('add_'); +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + }, +}); +var data = ''; +var addr = ''; +var lat = '', + lat1 = '', + lng = ''; +var page = 1; +var pageSize = 5; +var count = 1; +var isjiazai = 1; +var nowPage = 1; +var isLoading = false; +from_id= 2; +mui.plusReady(function() { + getLocation(); + function getLocation() { + if (navigator.geolocation) { + plus.geolocation.getCurrentPosition(showPosition, showError); + + } else { + mui.alert("手机不支持定位") + } + } + function showPosition(position) { + + lat = position.coords.latitude; + lng = position.coords.longitude; + localStorage.setItem('lat', lat); + localStorage.setItem('lng', lng); + getShopList(nowPage, pageSize); + addr = position.address.city; + localStorage.setItem('addr', addr); + $('#location').html(addr); + $('#location-r').html(addr); + } + + function showError(error) { + switch (error.code) { + case error.TIMEOUT: + mui.alert('请求超时,请重试') + break; + case error.POSITION_UNAVAILABLE: + mui.alert('定位不到你的地址') + break; + case error.PERMISSION_DENIED: + // case 22: + mui.alert('您拒绝了地理位置请求') + break; + case error.UNKNOWN_ERROR: + mui.alert('未知错误') + break; + default: + console.log(error) + break; + } + getShopList(nowPage, pageSize); + } + //bannerTop + mui.ajax(qlgUrl('app/shopping/getHelpCarousel'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
      '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + var topBannerheight = localStorage.getItem('topBannerheight') + + $('#top_banner').height(topBannerheight) + // $('#top_banner').height(($('#top_banner').width() )* 460 / 750); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + mui('.con').on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId, from_id: 2}); + }) + function getShopList(nowPage, pageSize) { + + lat = localStorage.getItem('lat'); + lng = localStorage.getItem('lng'); + + if (null == lat) { + lat = 36.659565; + lng = 117.125824; + } + var recommenddata = { + shopType: 1, + page: nowPage ? nowPage : 1, + perPage: pageSize ? pageSize : 10, + lat: lat, + lng: lng, + } + if (true == isLoading) return; + isLoading = true; + //console.log(lat); + JZL.ajax(hyhUrl('app/shopping/getHelpShops'), recommenddata, function(data) { + + var html = ''; + var shopLevel + if (1 == data.status) { + var data = data.data; + // console.log(data); + if ('' == data.Rows) { + $('.shoplist').append( + '

      没有更多数据

      '); + // isLoading = false; + return; + } + $.each(data.Rows, function(index, element) { + shopLevel = this.shopLevel + if(0==shopLevel){ + shopLevel ='' + } + html += + '
      ' + + this.shopName + ''+ shopLevel + '
      进店逛逛
      ' + if (0 != this.goods.length) { + $.each(this.goods, function(idx, ele) { + + html += '
      ¥' + this.shopPrice + '
      ' + }) + } + + html += '
      距离:' + this.distance / 1000 + + '公里
      ' + }) + if (nowPage == 1) { + $('.shoplist').html(html); + } else { + $('.shoplist').append(html); + } + isLoading = false; + } else { + mui.alert(data.msg) + } + }) + } + //加载 + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + nowPage++; + // getShops(nowPage, pageSize); + getShopList(nowPage, pageSize) + } + } + }) + mui('.shoplist').on('tap', '.shops-content1-title', function() { + // var goodsId = $(this).attr('data-goodsId'); + var shopName = $(this).attr("data-shopName"); + var shopId = $(this).attr("data-shopId"); + JZL.openWindow('storeout.html', 'storeout.html', {shopName: shopName,shopId: shopId, from_id:2}); + }) +}) + +//获取推荐页 +function getRecommend(page, pagesize) { + var recommenddata = { + type : 2 , + page: page ? page : 1, + pagesize: pageSize ? pageSize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shopping/getGoods'), recommenddata, function(data) { + // console.log(data); + // if (data.status == 1) { + var html = ''; + // var data = data.data; + if (data.Rows == '') { + $('.self_shop_rem').append( + '

      没有更多商品

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
      ' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率  ' + this.discountRate + + '
      '; + }); + + if (page == 1) { + $('.recommend_con').html(html); + } else { + $('.recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + // } else { + // mui.alert(data.msg) + // } + }) +} +$('.bcon_left').height($('.bcon_left').width() * 345 / 185); +$('.bcon_left img').height($('.bcon_left img').width() * 345 / 185); +$('.bcr_block').height($('.bcr_block').width()); +$('.addsct_block').height($('.addsct_block').width() * 225 / 355); +$('.addscb_block').height($('.addscb_block').width() * 260 / 180); +$('.zya_block').height($('.zya_block').width() * 185 / 355); + +var issx = 0; + +// 轮播图跳转 +$('#slider').on('tap', '.swiper-slide', function() { + openAds($(this)); +}) + +//导航栏 +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } +}) +mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == '') { + url = 'ac3.html'; + } + JZL.openWindow(url, url, {classifyId: classifyId}); +}) + +//为你推荐 +getRecommend(page, pageSize); +document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pageSize); + } + } +}) +//搜索 +$('.header').on('focus', '#keyword', function() { + $(".search button").css('display', 'block'); +}) +$('.header').on('blur', '#keyword', function() { + $(".search button").css('display', 'none'); +}) +$(".header").on('tap', '.search button', function(e) { + var searchName = $('#keyword').val(); + // JZL.openWindow('shopsList.html', 'shopsList.html', {data_keyword: searchName,goodsType:2}); + JZL.openWindow('goodslist.html', 'goodslist.html', {data_keyword: searchName,goodsType :2, from_id:2}); + $('#keyword').val("") +}); +//跳转商品详情页 +mui("body").on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + var shopId = $(this).parent().parent().attr('data-shopId'); + var goodsType=$(this).attr('data-goodsType') + JZL.openWindow('details.html', 'details.html' + goodsId, {data_id: goodsId,shopId: shopId,goodsType : goodsType, from_id:2}); })