myShop.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <link rel="stylesheet" href="../css/reset.css">
  7. <script src="../js/flexible.js"></script>
  8. <script src="../js/api.js"></script>
  9. <script src="../js/checkLanguage.js"></script>
  10. <style>
  11. html{
  12. background-color: #f2f2f2;
  13. font-family: "Adobe 黑体 Std R";
  14. }
  15. html,body,main{
  16. height: 100%;
  17. }
  18. #header {
  19. height: 1.17rem;
  20. line-height: 1.17rem;
  21. color: #fdfbfb;
  22. position: relative;
  23. /*box-sizing: content-box;*/
  24. }
  25. .headerBG{
  26. width: 100%;
  27. height: 1.17rem;
  28. position: absolute;
  29. left: 0;
  30. top: 0;
  31. z-index: -1;
  32. }
  33. #backBtn {
  34. width: 1.2rem;
  35. height: 1.17rem;
  36. text-align: center;
  37. font-size: .64rem;
  38. position: absolute;
  39. left: 0;
  40. bottom: 0;
  41. }
  42. #backBtn img{
  43. display: inline-block;
  44. width: 50%;
  45. height: 40%;
  46. }
  47. .headTit {
  48. text-align: center;
  49. height: 1.17rem;
  50. font-size: .48rem;
  51. font-weight: normal;
  52. }
  53. .headGN {
  54. position: absolute;
  55. right: 0;
  56. bottom: 0;
  57. }
  58. .headGN li {
  59. display: none;
  60. width: 1.2rem;
  61. height: 1.17rem;
  62. font-size: .38rem;
  63. }
  64. .headGN li.active {
  65. display: block;
  66. }
  67. main{
  68. overflow-x: hidden;
  69. overflow-y: auto;
  70. }
  71. main>div{
  72. background-color: #fff;
  73. padding: 0 .33rem;
  74. border-top: 1px solid #eee;
  75. border-bottom: 1px solid #eee;
  76. }
  77. .shopData{
  78. height: 2.12rem;
  79. }
  80. .shopData>div{
  81. height: 100%;
  82. }
  83. .shopImg{
  84. width: 1.34rem;
  85. height: 1.34rem;
  86. padding: .38rem 0 .38rem 0;
  87. margin-right: .26rem;
  88. }
  89. .shopNameDiv{
  90. padding: .52rem 0 .4rem;
  91. }
  92. .shopNameDiv>p{
  93. height: .5rem;
  94. }
  95. .shopNameDiv>p:first-of-type{
  96. margin-bottom: .14rem;
  97. }
  98. .shopName{
  99. font-size: .4rem;
  100. color: #3d3d3d;
  101. }
  102. .companyName{
  103. font-size: .34rem;
  104. color: #f7941d;
  105. }
  106. .guarantee{
  107. display: inline-block;
  108. width: .42rem;
  109. height: .44rem;
  110. margin-left: .21rem;
  111. margin-right: .1rem;
  112. vertical-align: sub;
  113. }
  114. .isGuarantee,.isPartner{
  115. color: #818181;
  116. font-size: .26rem;
  117. }
  118. .partner{
  119. display: inline-block;
  120. width: .56rem;
  121. height: .42rem;
  122. margin-left: .21rem;
  123. margin-right: .1rem;
  124. vertical-align: sub;
  125. }
  126. .h3{
  127. height: 1.14rem;
  128. line-height: 1.14rem;
  129. font-size: .37rem;
  130. font-weight: 300;
  131. font-family: "Adobe 黑体 Std R";
  132. color: #3d3d3d;
  133. padding: 0 .33rem;
  134. }
  135. .noCircuit{
  136. height: 2.89rem;
  137. line-height: 2.89rem;
  138. text-align: center;
  139. font-size: .37rem;
  140. background-color: #fff;
  141. color: #3d3d3d;
  142. }
  143. .tjlxAddBtn,.qblxAddBtn{
  144. height: 1.08rem;
  145. line-height: 1.08rem;
  146. margin-top: .15rem;
  147. }
  148. .addLXIcon{
  149. display: inline-block;
  150. width: .48rem;
  151. height: .48rem;
  152. margin-right: .14rem;
  153. vertical-align: sub;
  154. }
  155. .addText{
  156. font-size: .4rem;
  157. font-weight: 300;
  158. font-family: "Adobe 黑体 Std R";
  159. }
  160. .jt{
  161. display: inline-block;
  162. width: .2rem;
  163. height: .33rem;
  164. }
  165. .qblx,.tjlx{
  166. padding: 0;
  167. background-color: #efefef;
  168. }
  169. .qblx>.Circuit:first-of-type,.tjlx>.Circuit:first-of-type{
  170. margin-top: 0;
  171. }
  172. .Circuit{
  173. padding: .25rem .33rem;
  174. background-color: #fff;
  175. margin-top: .25rem;
  176. }
  177. .Circuit>div:first-of-type{
  178. width: 70%;
  179. }
  180. .Circuit>div:last-of-type{
  181. width: 29%;
  182. text-align: right;
  183. }
  184. .originIcon{
  185. display: inline-block;
  186. width: .32rem;
  187. height: .32rem;
  188. margin-right: .08rem;
  189. margin-left: -.04rem;
  190. vertical-align: middle;
  191. }
  192. .terminusIconIcon{
  193. display: inline-block;
  194. width: .26rem;
  195. height: .34rem;
  196. margin-right: .13rem;
  197. vertical-align: middle;
  198. }
  199. .originTxt,.terminusIconTxt{
  200. color: #3d3d3d;
  201. font-size: .32rem;
  202. }
  203. .yl span{
  204. color: #f7941d;
  205. font-size: .32rem;
  206. /*font-family: "Myriad Pro";*/
  207. margin:0 .32rem .2rem 0;
  208. letter-spacing: .5px;
  209. }
  210. .jg,.yxq{
  211. color: #818181;
  212. font-size: .32rem;
  213. }
  214. .yxq{
  215. letter-spacing: 1px;
  216. }
  217. .origin,.terminusIcon,.jg{
  218. margin-bottom: .2rem;
  219. }
  220. .transportation{
  221. display: inline-block;
  222. width: .64rem;
  223. height: .64rem;
  224. margin:0 .18rem .26rem 0;
  225. }
  226. .voyage{
  227. color: #13c1cc;
  228. font-size: .3rem;
  229. margin-bottom: .2rem;
  230. }
  231. .ydBtn{
  232. margin-bottom: .3rem;
  233. }
  234. .ydBtn,.xqBtn{
  235. display: inline-block;
  236. width: 1.85rem;
  237. height: .62rem;
  238. line-height: .62rem;
  239. color: #fff;
  240. font-size: .3rem;
  241. text-align: center;
  242. border-radius: .5rem;
  243. margin-right: -.12rem;
  244. }
  245. .orange-btn {
  246. background-image: linear-gradient(50deg, #f7841d, #fcb316); }
  247. .hid{
  248. display: none;
  249. }
  250. </style>
  251. </head>
  252. <body class="flex-wrap flex-column">
  253. <div id="header">
  254. <img src="../images/headerBG.jpg" alt=" " class="headerBG">
  255. <i id="backBtn"><img src="../images/backBtn.png" alt=""></i>
  256. <h3 class="headTit"></h3>
  257. <ul class="headGN">
  258. <!--<li class="active"><i>设置</i></li>-->
  259. </ul>
  260. </div>
  261. <main class="flex-con">
  262. <div class="shopData clearFix">
  263. <div class="shopImg left"><img src="../images/shopImg.jpg" alt=""></div>
  264. <div class="left shopNameDiv">
  265. <p><span class="shopName con1"></span><span class="isGuarantee"><i class="guarantee"><img src="../images/guarantee1.png" alt=""></i><span class="guaranteeTxt con2"></span></span><span class="isPartner"><i class="partner"><img src="../images/partner1.png" alt=""></i><span class="partnerTxt con3"></span></span></p>
  266. <p><span class="companyName" id="companyName"></span></p>
  267. </div>
  268. </div>
  269. <h3 class="h3" id="h3"></h3>
  270. <div class="tjlx" id="evaluation"></div>
  271. <!--<div class="tjlxAddBtn"><i class="addLXIcon"><img src="../images/addLX.png" alt=""></i><span class="addText">添加推荐</span><i class="right jt"><img src="../images/addJT.png" alt=""></i></div>-->
  272. <!--<h3 class="h3">全部线路</h3>
  273. <div class="qblx">
  274. <div class="Circuit clearFix">
  275. <div class="left">
  276. <div class="origin"><span class="originIcon"><img src="../images/origin.png" alt=""></span><span class="originTxt">北京首都国际机场·中国</span></div>
  277. <div class="terminusIcon"><span class="terminusIconIcon"><img src="../images/terminusIcon.png" alt=""></span><span class="terminusIconTxt">汉堡机场·德国</span></div>
  278. <div class="yl clearFix"><span class="left">USD/2362/20GP</span><span class="left">USD/4162/40GP</span><span class="left">USD/4162/40HQ</span></div>
  279. <div class="jg">截关:&nbsp;二/四/五</div>
  280. <div class="yxq">有效期:&nbsp;2017-1-1</div>
  281. </div>
  282. <div class="right">
  283. <div class="transportation"><img src="../images/aircraft.png" alt=""></div>
  284. <div class="voyage">航程4天</div>
  285. <div class="ydBtn"><img src="../images/shopBook.png" alt=""></div>
  286. <div class="xqBtn"><img src="../images/detail.png" alt=""></div>
  287. </div>
  288. </div>
  289. <div class="noCircuit hid">你尚未发布任何运价</div>-->
  290. </div>
  291. <div class="qblxAddBtn"><i class="addLXIcon"><img src="../images/addLX.png" alt=""></i><span class="addText btn1"></span><i class="right jt"><img src="../images/addJT.png" alt=""></i></div>
  292. </main>
  293. <script type="text/javascript">
  294. try {
  295. var text=languages.myShop;
  296. $api.dom(".headTit").innerText=text.tit;
  297. $api.dom(".con1").innerText=text.con1;
  298. $api.dom(".con2").innerText=text.con2;
  299. $api.dom(".con3").innerText=text.con3;
  300. $api.dom("#h3").innerText=text.h3;
  301. $api.dom(".btn1").innerText=text.btn1;
  302. }catch (e){
  303. alert(languages.all.list5)
  304. }
  305. </script>
  306. <script src="../js/doT.min.js" type="text/javascript" charset="utf-8"></script>
  307. <script src="../js/publicData.js"></script>
  308. <script src="../js/jquery-3.1.0.min.js"></script>
  309. <script id="evaluationtmpl" type="text/x-dot-template">
  310. {{ for(var prop in it['data']) { }}
  311. <div class="Circuit clearFix">
  312. <div class="left">
  313. <div class="origin"><span class="originIcon"><img src="../images/origin.png" alt=""></span><span class="originTxt">{{= it['data'][prop]["pol_country"] }}·{{= it['data'][prop]["pol_name"] }}</span></div>
  314. <div class="terminusIcon"><span class="terminusIconIcon"><img src="../images/terminusIcon.png" alt=""></span><span class="terminusIconTxt">{{= it['data'][prop]["pod_country"] }}·{{= it['data'][prop]["pod_name"] }}</span></div>
  315. <div class="yl clearFix">
  316. {{ for(var i in it['data'][prop]["money"]) { }}
  317. <span class="left">
  318. {{= it['data'][prop]["money"][i]["code"] }}{{= it['data'][prop]["money"][i]["price"] }}/{{= it['data'][prop]["money"][i]["theCode"] }}
  319. </span>
  320. {{ } }}
  321. </div>
  322. <div class="jg">{{=it['languages']['list1']}}:&nbsp;{{= it['data'][prop]['detail']["dateOfEndGate"] }}</div>
  323. <div class="yxq">{{=it['languages']['list2']}}:&nbsp;{{= it['data'][prop]['detail']["dateTo"] }}</div>
  324. </div>
  325. <div class="right">
  326. {{? it['data'][prop]["nameCn"] =="海运" }}
  327. <div class="transportation"><img src="../images/ship.png" alt=""></div>
  328. {{?? it['data'][prop]["nameCn"] =="空运"}}
  329. <div class="transportation"><img src="../images/aircraft.png" alt=""></div>
  330. {{?? it['data'][prop]["nameCn"] =="铁路"}}
  331. <div class="transportation"><img src="../images/train.png" alt=""></div>
  332. {{?? it['data'][prop]["nameCn"] =="集卡"}}
  333. <div class="transportation"><img src="../images/trucks.png" alt=""></div>
  334. {{?? it['data'][prop]["nameCn"] =="联运"}}
  335. <div class="transportation"><img src="../images/traffic.png" alt=""></div>
  336. {{?}}
  337. <div class="voyage">{{=it['languages']['list3']}}{{ if(it['data'][prop]['detail']["timeSpendDay"]){ }}{{= it['data'][prop]['detail']["timeSpendDay"] }}{{=it['languages']['list4']}}{{ } }}{{ if(it['data'][prop]['detail']["timeSpendHour"]){ }}{{= it['data'][prop]['detail']["timeSpendHour"] }}{{=it['languages']['list5']}}{{ } }}</div>
  338. <div class="ydBtn TJ orange-btn" rel='{{= it["data"][prop]["id"] }}'>{{=it['languages']['btn2']}}</div>
  339. <div class="xqBtn XG orange-btn" rel='{{= it["data"][prop]["id"] }}'>{{=it['languages']['btn3']}}</div>
  340. </div>
  341. </div>
  342. {{ } }}
  343. </script>
  344. <script>
  345. apiready=function () {
  346. api.showProgress({
  347. title: languages.all.list21+'...',
  348. text: languages.all.list25+'...',
  349. modal: false
  350. });
  351. var backBtn=$api.dom("#backBtn"),qblxAddBtn=$api.dom(".qblxAddBtn"),companyName=$api.dom("#companyName"),isGuarantee=$api.dom(".isGuarantee"),
  352. isPartner=$api.dom(".isPartner"),partner=$api.dom(".partner"),guaranteeTxt=$api.dom(".guaranteeTxt"),partnerTxt=$api.dom(".partnerTxt");
  353. var service=$api.getStorage("serviceStatus");
  354. var userInfo=$api.getStorage("user"),bl=false;
  355. if(service['assurance']=="1"){
  356. $api.dom(isGuarantee,'img').src="../images/guarantee2.png";
  357. guaranteeTxt.innerText="";
  358. }
  359. if(service['partner']=="1"){
  360. $api.dom(isGuarantee,'img').src="../images/guarantee2.png";
  361. guaranteeTxt.innerText="";
  362. }
  363. if(userInfo['company'].length){
  364. for(var i in userInfo['company']){
  365. if(bl) continue;
  366. if(userInfo['company'][i]['isVerify']==1){
  367. companyName.innerText=userInfo['company'][i]['companyName'];
  368. bl=true;
  369. }else {
  370. companyName.innerText=userInfo['company'][i]['companyName'];
  371. }
  372. }
  373. }else {
  374. $api.dom("#companyName").innerText=languages.all.list4;
  375. }
  376. var issueArr=["issuePutaway","issueAudit","issueSoldOut","issueNotPass"];
  377. getdata();
  378. qblxAddBtn.onclick=function () {
  379. api.execScript({
  380. name: 'root',
  381. script: 'toFrame(1);'
  382. });
  383. setTimeout(function () {
  384. api.execScript({
  385. name: 'root',
  386. script: 'toContentFrame('+0+',"'+issueArr[0]+'");'
  387. });
  388. setTimeout(function () {
  389. api.closeToWin({
  390. name: 'root'
  391. });
  392. },200)
  393. },300)
  394. }
  395. isGuarantee.onclick=function () {
  396. api.openWin({
  397. name: "paidService",
  398. url: 'paidService.html',
  399. reload:true,
  400. pageParam: {index: 1,winName:"myShop"}
  401. });
  402. }
  403. isPartner.onclick=function () {
  404. api.openWin({
  405. name: "paidService",
  406. url: 'paidService.html',
  407. reload:true,
  408. pageParam: {index: 2,winName:"myShop"}
  409. });
  410. }
  411. function getdata() {
  412. api.ajax({
  413. url: pageUrl + "shop/my_shop",
  414. method: 'get',
  415. timeout: 30,
  416. dataType: 'json',
  417. returnAll: false,
  418. headers: {
  419. "Content-Type": "application/json"
  420. },
  421. data: {
  422. values: {
  423. id:$api.getStorage("user").id
  424. }
  425. }
  426. }, function(ret, err) {
  427. api.hideProgress();
  428. console.log(JSON.stringify(ret))
  429. if(ret.data=="未获得资源"||ret==""){
  430. $("#evaluation").html('<div class="noCircuit">'+languages.myShop.remind2+'</div>');
  431. return;
  432. }
  433. var  dataEval  =  ret;
  434. dataEval.languages=languages.myShop;
  435. var  evalText  =  doT.template($("#evaluationtmpl").text());
  436. $("#evaluation").html(evalText(dataEval));
  437. setTJ();
  438. toXG();
  439. })
  440. }
  441. backBtn.onclick=function () {
  442. toBack();
  443. }
  444. api.addEventListener({
  445. name:'keyback'
  446. },function(ret, err){
  447. toBack()
  448. });
  449. function toBack() {
  450. api.closeToWin({
  451. name: 'root'
  452. });
  453. }
  454. function setTJ() {
  455. var evaluation=$api.dom("#evaluation"),TJS=$api.domAll(evaluation,".TJ"),isClick=false;
  456. for(var num=0,len=TJS.length;num<len;num++){
  457. !function (i) {
  458. TJS[i].onclick=function () {
  459. if(isClick) return;
  460. isClick=true;
  461. api.showProgress({
  462. title: languages.all.list21+'...',
  463. text: languages.all.list25+'...',
  464. modal: true
  465. });
  466. var id=this.getAttribute("rel"),isTop=0,that=this;
  467. api.ajax({
  468. url: pageUrl+'Price/set_top',
  469. method: 'post',
  470. timeout: 30,
  471. dataType: 'json',
  472. returnAll: false,
  473. data: {
  474. values: {
  475. id: id,
  476. isbegTop:isTop
  477. }
  478. }
  479. }, function (ret, err) {
  480. var txt="";
  481. isClick=false;
  482. api.hideProgress();
  483. if(ret.status=="200"){
  484. getdata();
  485. api.execScript({
  486. name: 'root',
  487. frameName:'issuePutaway',
  488. script: ' getData(true,1);;'
  489. });
  490. api.toast({
  491. msg: languages.myShop.remind1,
  492. duration: 2000,
  493. location: 'bottom'
  494. });
  495. }else {
  496. api.toast({
  497. msg: languages.all.list48,
  498. duration: 2000,
  499. location: 'bottom'
  500. });
  501. }
  502. });
  503. }
  504. }(num)
  505. }
  506. }
  507. function toXG() {
  508. var evaluation=$api.dom("#evaluation"),XJS=$api.domAll(evaluation,".XG");
  509. for(var num=0,len=XJS.length;num<len;num++){
  510. !function (i) {
  511. XJS[i].onclick=function () {
  512. var id=this.getAttribute("rel"),that=this;
  513. api.openWin({
  514. name: 'issueDetails',
  515. url: 'issueDetails.html',
  516. pageParam: {id: id,isXG:false}
  517. });
  518. }
  519. }(num)
  520. }
  521. }
  522. }
  523. </script>
  524. </body>
  525. </html>