payFail.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta
  7. name="viewport"
  8. content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0"
  9. />
  10. <title>支付结果</title>
  11. <script>
  12. (function (WIN) {
  13. var setFontSize = (WIN.setFontSize = function (_width) {
  14. var docEl = document.documentElement;
  15. // 获取当前窗口的宽度
  16. var width = _width || docEl.clientWidth || docEl.getBoundingClientRect().width;
  17. if (width > 420) {
  18. width = 420;
  19. }
  20. // 在375px上,1rem = 20px
  21. var rem = width / 18.75;
  22. docEl.style.fontSize = rem + 'px';
  23. // 部分机型上的误差、兼容性处理
  24. var actualSize =
  25. WIN.getComputedStyle && parseFloat(WIN.getComputedStyle(docEl)['font-size']);
  26. if (actualSize !== rem && actualSize > 0 && Math.abs(actualSize - rem) > 1) {
  27. var remScaled = (rem * rem) / actualSize;
  28. docEl.style.fontSize = rem + 'px';
  29. }
  30. });
  31. var timer;
  32. //函数节流
  33. function dbcRefresh() {
  34. clearTimeout(timer);
  35. timer = setTimeout(setFontSize, 100);
  36. }
  37. //窗口更新动态改变 font-size
  38. WIN.addEventListener('resize', dbcRefresh, false);
  39. //页面显示时计算一次
  40. WIN.addEventListener(
  41. 'pageshow',
  42. function (e) {
  43. if (e.persisted) {
  44. dbcRefresh();
  45. }
  46. },
  47. false
  48. );
  49. setFontSize();
  50. })(window);
  51. </script>
  52. <script src="./util.js"></script>
  53. <style>
  54. @media only screen and (min-width: 400px) {
  55. body {
  56. font-size: 21.33333333px !important;
  57. }
  58. }
  59. @media only screen and (min-width: 414px) {
  60. body {
  61. font-size: 21px !important;
  62. }
  63. }
  64. @media only screen and (min-width: 480px) {
  65. body {
  66. font-size: 25.6px !important;
  67. }
  68. }
  69. * {
  70. padding: 0;
  71. margin: 0;
  72. }
  73. body,
  74. html {
  75. height: 100%;
  76. width: 100%;
  77. background: #ffffff;
  78. }
  79. .h5Container {
  80. width: 100%;
  81. max-width: 18.75rem;
  82. margin: 0 auto;
  83. height: 100%;
  84. left: 0;
  85. right: 0;
  86. top: 0;
  87. bottom: 0;
  88. text-align: center;
  89. box-sizing: border-box;
  90. font-size: 0.7rem;
  91. }
  92. .mb16 {
  93. margin-bottom: 2rem;
  94. }
  95. .headerTitle {
  96. padding-top: 2.7rem;
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. font-size: 0.8rem;
  101. font-weight: 500;
  102. height: 2.2rem;
  103. line-height: 2.2px;
  104. color: rgba(0, 0, 0, 0.85);
  105. }
  106. .el-icon-close {
  107. position: absolute;
  108. left: 0.8rem;
  109. top: 3rem;
  110. width: 0.7rem;
  111. height: 0.7rem;
  112. opacity: 1;
  113. color: rgba(0, 0, 0, 0.45);
  114. }
  115. .divider {
  116. height: 1px;
  117. background: rgba(0, 0, 0, 0.04);
  118. }
  119. .logo {
  120. margin-bottom: 2rem;
  121. padding-top: 4rem;
  122. display: flex;
  123. flex-direction: column;
  124. }
  125. .logoImg {
  126. object-fit: contain;
  127. height: 2.4rem;
  128. margin-bottom: 1rem;
  129. }
  130. .failTip {
  131. opacity: 1;
  132. font-size: 0.8rem;
  133. font-family: PingFangSC, PingFangSC-Semibold;
  134. font-weight: 400;
  135. text-align: center;
  136. color: #e74e4e;
  137. margin-bottom: 0.5rem;
  138. }
  139. .failInfo {
  140. opacity: 1;
  141. font-size: 0.7rem;
  142. font-family: PingFangSC, PingFangSC-Regular;
  143. font-weight: 400;
  144. text-align: center;
  145. color: #6c6e75;
  146. line-height: 1.1rem;
  147. letter-spacing: 1px;
  148. }
  149. .price {
  150. color: #333333;
  151. }
  152. .priceNumber {
  153. font-size: 1.2rem;
  154. font-weight: 700;
  155. margin-left: 0.2rem;
  156. font-family: DINAlternate, DINAlternate-Bold;
  157. }
  158. .payTxt {
  159. color: rgba(0, 0, 0, 0.65);
  160. margin-right: 0.4rem;
  161. }
  162. .time {
  163. color: rgba(0, 0, 0, 0.65);
  164. font-weight: 500;
  165. }
  166. .timeItem {
  167. background: rgba(0, 0, 0, 0.04);
  168. border-radius: 0.1rem;
  169. padding: 0.1rem;
  170. }
  171. .timeSplit {
  172. margin: 0 0.2rem;
  173. }
  174. .order {
  175. color: rgba(0, 0, 0, 0.65);
  176. margin-bottom: 0.8rem;
  177. margin-left: 1rem;
  178. margin-right: 1rem;
  179. text-align: left;
  180. display: flex;
  181. align-items: center;
  182. justify-content: space-between;
  183. }
  184. .orderTxt {
  185. opacity: 1;
  186. font-size: 0.7rem;
  187. font-family: MicrosoftYaHei, MicrosoftYaHei-Regular;
  188. font-weight: 400;
  189. text-align: right;
  190. color: #22242e;
  191. }
  192. .orderTxt_l {
  193. opacity: 1;
  194. font-size: 0.7rem;
  195. font-family: MicrosoftYaHei, MicrosoftYaHei-Regular;
  196. font-weight: 400;
  197. text-align: left;
  198. color: #6c6e75;
  199. }
  200. .payType {
  201. text-align: left;
  202. box-sizing: border-box;
  203. }
  204. .checkout-list-item {
  205. display: flex;
  206. align-items: center;
  207. padding: 0.75rem 0;
  208. margin: 0 0.8rem;
  209. border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  210. justify-content: space-between;
  211. }
  212. .checkout-list-item-inner {
  213. display: flex;
  214. align-items: center;
  215. }
  216. .checkout-payIcon {
  217. margin-right: 0.8rem;
  218. }
  219. .checkout-pay-title {
  220. margin-right: 0.75rem;
  221. }
  222. .checkout-recommend {
  223. width: 2rem;
  224. height: 1.2rem;
  225. border: 1px solid var(--theme);
  226. border-radius: 0.1rem;
  227. color: var(--theme);
  228. font-weight: 400;
  229. font-size: 0.6rem;
  230. line-height: 1.2rem;
  231. text-align: center;
  232. }
  233. .checkout-list-item:last-of-type {
  234. border-bottom: none;
  235. }
  236. .checkout-radio {
  237. width: 0.8rem;
  238. height: 0.8rem;
  239. background-color: #ffffff;
  240. border: solid 1px #dddddd;
  241. -webkit-border-radius: 50%;
  242. border-radius: 50%;
  243. font-size: 0.7rem;
  244. margin: 0;
  245. padding: 0;
  246. position: relative;
  247. display: inline-block;
  248. vertical-align: top;
  249. cursor: default;
  250. -webkit-appearance: none;
  251. -webkit-user-select: none;
  252. user-select: none;
  253. -webkit-transition: background-color ease 0.1s;
  254. transition: background-color ease 0.1s;
  255. }
  256. .checkout-radio:checked {
  257. background-color: var(--theme);
  258. border: solid 1px var(--theme);
  259. text-align: center;
  260. background-clip: padding-box;
  261. }
  262. .checkout-radio:checked:before,
  263. .checkout-radio.checkout-checked:before,
  264. .checkout-radio:checked:after,
  265. .checkout-radio.checkout-checked:after {
  266. content: '';
  267. width: 0.4rem;
  268. height: 0.25rem;
  269. position: absolute;
  270. top: 50%;
  271. left: 50%;
  272. margin-left: -0.2rem;
  273. margin-top: -0.15rem;
  274. background: transparent;
  275. border: 1px solid #ffffff;
  276. border-top: none;
  277. border-right: none;
  278. z-index: 2;
  279. -webkit-border-radius: 0;
  280. border-radius: 0;
  281. -webkit-transform: rotate(-45deg);
  282. transform: rotate(-45deg);
  283. }
  284. .title {
  285. font-weight: 500;
  286. padding: 0.8rem 0 0.8rem 0.8rem;
  287. }
  288. .payTxt {
  289. margin: 0 0.8rem;
  290. }
  291. .footer {
  292. position: absolute;
  293. bottom: 1.7rem;
  294. left: 0;
  295. width: 100%;
  296. z-index: 10;
  297. text-align: center;
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. cursor: pointer;
  302. }
  303. .payBtn {
  304. width: 18rem;
  305. height: 2.5rem;
  306. background: #5568d5;
  307. border-radius: 0.2rem;
  308. color: rgba(255, 255, 255, 0.85);
  309. line-height: 2.5rem;
  310. margin-bottom: 0.8rem;
  311. border: none;
  312. cursor: pointer;
  313. appearance: none;
  314. }
  315. .brand {
  316. display: flex;
  317. align-items: center;
  318. width: 100%;
  319. justify-content: center;
  320. }
  321. .brandImg {
  322. height: 1rem;
  323. min-height: 0.8rem;
  324. object-fit: contain;
  325. margin-right: 0.3rem;
  326. }
  327. .brandtxt {
  328. font-size: 0.6rem;
  329. font-family: MicrosoftYaHei, MicrosoftYaHei-Regular;
  330. font-weight: 400;
  331. text-align: left;
  332. color: #999999;
  333. }
  334. </style>
  335. </head>
  336. <body>
  337. <div class="h5Container">
  338. <div class="logo">
  339. <img class="logoImg" src="img/fail1.png" alt="Logo" />
  340. <div class="failTip">支付失败</div>
  341. <div class="failInfo">订单超时自动关闭,请重新发起支付。</div>
  342. </div>
  343. <div class="price mb16">
  344. <span>¥</span>
  345. <span class="priceNumber" id="priceNumber">793.21</span>
  346. </div>
  347. <div class="order">
  348. <span class="orderTxt">订单编号</span>
  349. <span class="orderTxt" id="orderId">207084835060</span>
  350. </div>
  351. <div class="footer">
  352. <div onClick="toHome()" style="background-color: #0B5AFE" class="payBtn">
  353. 返回商家
  354. </div><div class="brand">
  355. <img class="brandImg" src="img/defaultLogo.png" alt="logo" title="logo" />
  356. <span class="brandtxt">提供技术支持</span>
  357. </div></div>
  358. </div>
  359. </body>
  360. <script src="https://cdn.cloudpnr.com/opps/libs/jquery/jquery-2.1.2.min.js"></script>
  361. <script src="https://cdn.cloudpnr.com/opps/libs/dayjs/dayjs-1.10.4.min.js"></script>
  362. <script src="./config/index.js"></script>
  363. <script>
  364. function toHome() {
  365. var backHomeUrl = configObj.mobile.backHomeUrl;
  366. location.href = backHomeUrl ? backHomeUrl : jumpLink('goodsDetail.html');
  367. }
  368. function jumpLink(urlName) {
  369. const origin = location.origin;
  370. const pathname = location.pathname;
  371. const urlAry = pathname.split('/');
  372. urlAry.pop();
  373. urlAry.push(urlName);
  374. const urlStr = urlAry.join('/');
  375. const link = origin + urlStr;
  376. return link;
  377. }
  378. window.addEventListener('load', () => {
  379. const state = { title: 'init', url: '#' };
  380. window.history.pushState(state, 'init', '#');
  381. });
  382. window.addEventListener('popstate', () => {
  383. toHome();
  384. });
  385. $(function () {
  386. var price = GetQueryString('price');
  387. console.log('-log- ~ price', price);
  388. var mer_ord_id = localStorage.getItem('mer_ord_id');
  389. $('#priceNumber').text(price);
  390. $('#orderId').text(mer_ord_id);
  391. });
  392. </script>
  393. </html>