paySuccess.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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.9rem;
  101. font-weight: 500;
  102. height: 2.2rem;
  103. line-height: 2.2px;
  104. color: #050505;
  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: 1.5rem;
  121. padding-top: 2rem;
  122. display: flex;
  123. flex-direction: column;
  124. }
  125. .logoImg {
  126. object-fit: contain;
  127. height: 2rem;
  128. margin-bottom: 1rem;
  129. }
  130. .successTip {
  131. height: 1.2rem;
  132. opacity: 1;
  133. font-size: 0.8rem;
  134. font-family: PingFangSC, PingFangSC-Semibold;
  135. font-weight: 600;
  136. text-align: center;
  137. color: #0b5afe;
  138. line-height: 1.2rem;
  139. }
  140. .price {
  141. font-size: 20px;
  142. color: #333333;
  143. }
  144. .priceNumber {
  145. font-size: 1.2rem;
  146. font-weight: 700;
  147. margin-left: 0.2rem;
  148. font-family: DINAlternate, DINAlternate-Bold;
  149. }
  150. .payTxt {
  151. color: rgba(0, 0, 0, 0.65);
  152. margin-right: 0.4rem;
  153. }
  154. .time {
  155. color: rgba(0, 0, 0, 0.65);
  156. font-weight: 500;
  157. }
  158. .timeItem {
  159. background: rgba(0, 0, 0, 0.04);
  160. border-radius: 0.1rem;
  161. padding: 0.1rem;
  162. }
  163. .timeSplit {
  164. margin: 0 0.2rem;
  165. }
  166. .order {
  167. color: rgba(0, 0, 0, 0.65);
  168. margin-bottom: 0.8rem;
  169. margin-left: 1.5rem;
  170. margin-right: 1.5rem;
  171. text-align: left;
  172. display: flex;
  173. align-items: center;
  174. justify-content: space-between;
  175. }
  176. .orderTxt {
  177. opacity: 1;
  178. font-size: 0.7rem;
  179. font-family: MicrosoftYaHei, MicrosoftYaHei-Regular;
  180. font-weight: 400;
  181. text-align: right;
  182. color: #22242e;
  183. }
  184. .orderTxt_l {
  185. opacity: 1;
  186. font-size: 0.7rem;
  187. font-family: MicrosoftYaHei, MicrosoftYaHei-Regular;
  188. font-weight: 400;
  189. text-align: left;
  190. color: #6c6e75;
  191. }
  192. .payType {
  193. text-align: left;
  194. box-sizing: border-box;
  195. }
  196. .checkout-list-item {
  197. display: flex;
  198. align-items: center;
  199. padding: 0.75rem 0;
  200. margin: 0 0.8rem;
  201. border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  202. justify-content: space-between;
  203. }
  204. .checkout-list-item-inner {
  205. display: flex;
  206. align-items: center;
  207. }
  208. .checkout-payIcon {
  209. margin-right: 0.8rem;
  210. }
  211. .checkout-pay-title {
  212. margin-right: 0.75rem;
  213. }
  214. .checkout-recommend {
  215. width: 2rem;
  216. height: 1.2rem;
  217. border: 1px solid var(--theme);
  218. border-radius: 0.1rem;
  219. color: var(--theme);
  220. font-weight: 400;
  221. font-size: 0.6rem;
  222. line-height: 1.2rem;
  223. text-align: center;
  224. }
  225. .checkout-list-item:last-of-type {
  226. border-bottom: none;
  227. }
  228. .checkout-radio {
  229. width: 0.8rem;
  230. height: 0.8rem;
  231. background-color: #ffffff;
  232. border: solid 1px #dddddd;
  233. -webkit-border-radius: 50%;
  234. border-radius: 50%;
  235. font-size: 0.7rem;
  236. margin: 0;
  237. padding: 0;
  238. position: relative;
  239. display: inline-block;
  240. vertical-align: top;
  241. cursor: default;
  242. -webkit-appearance: none;
  243. -webkit-user-select: none;
  244. user-select: none;
  245. -webkit-transition: background-color ease 0.1s;
  246. transition: background-color ease 0.1s;
  247. }
  248. .checkout-radio:checked {
  249. background-color: var(--theme);
  250. border: solid 1px var(--theme);
  251. text-align: center;
  252. background-clip: padding-box;
  253. }
  254. .checkout-radio:checked:before,
  255. .checkout-radio.checkout-checked:before,
  256. .checkout-radio:checked:after,
  257. .checkout-radio.checkout-checked:after {
  258. content: '';
  259. width: 0.4rem;
  260. height: 0.25rem;
  261. position: absolute;
  262. top: 50%;
  263. left: 50%;
  264. margin-left: -0.2rem;
  265. margin-top: -0.15rem;
  266. background: transparent;
  267. border: 1px solid #ffffff;
  268. border-top: none;
  269. border-right: none;
  270. z-index: 2;
  271. -webkit-border-radius: 0;
  272. border-radius: 0;
  273. -webkit-transform: rotate(-45deg);
  274. transform: rotate(-45deg);
  275. }
  276. .title {
  277. font-weight: 500;
  278. padding: 0.8rem 0 0.8rem 0.8rem;
  279. }
  280. .payTxt {
  281. margin: 0 0.8rem;
  282. }
  283. .footer {
  284. position: absolute;
  285. bottom: 1.7rem;
  286. left: 0;
  287. width: 100%;
  288. z-index: 10;
  289. text-align: center;
  290. display: flex;
  291. flex-direction: column;
  292. align-items: center;
  293. cursor: pointer;
  294. }
  295. .payBtn {
  296. width: 18rem;
  297. height: 2.5rem;
  298. background: #5568d5;
  299. border-radius: 0.2rem;
  300. color: rgba(255, 255, 255, 0.85);
  301. line-height: 2.5rem;
  302. margin-bottom: 0.8rem;
  303. border: none;
  304. cursor: pointer;
  305. appearance: none;
  306. }
  307. .brand {
  308. display: flex;
  309. align-items: center;
  310. width: 100%;
  311. justify-content: center;
  312. }
  313. .brandImg {
  314. height: 1rem;
  315. min-height: 0.8rem;
  316. object-fit: contain;
  317. margin-right: 0.3rem;
  318. }
  319. .brandtxt {
  320. font-size: 0.6rem;
  321. color: rgba(0, 0, 0, 0.45);
  322. }
  323. </style>
  324. </head>
  325. <body>
  326. <div class="h5Container">
  327. <div class="logo">
  328. <img class="logoImg" src="img/success1.png" alt="Logo" />
  329. <div class="successTip">支付成功</div>
  330. </div>
  331. <div class="price mb16">
  332. <span>¥</span>
  333. <span class="priceNumber" id="priceNumber">793.21</span>
  334. </div>
  335. <div class="order">
  336. <span class="orderTxt">订单编号</span>
  337. <span class="orderTxt" id="orderId">207084835060</span>
  338. </div>
  339. <div class="order">
  340. <span class="orderTxt">支付时间</span>
  341. <span class="orderTxt" id="payTime">2021-06-25 11:21</span>
  342. </div>
  343. <div class="order">
  344. <span class="orderTxt">支付方式</span>
  345. <span class="orderTxt" id="payType">微信支付</span>
  346. </div>
  347. <div class="footer">
  348. <div onClick="toHome()" style="background-color: #0B5AFE" class="payBtn">
  349. 返回商家
  350. </div><div class="brand">
  351. <img class="brandImg" src="img/defaultLogo.png" alt="logo" title="logo" />
  352. <span class="brandtxt">提供技术支持</span>
  353. </div></div>
  354. </div>
  355. </body>
  356. <script src="https://cdn.cloudpnr.com/opps/libs/jquery/jquery-2.1.2.min.js"></script>
  357. <script src="https://cdn.cloudpnr.com/opps/libs/dayjs/dayjs-1.10.4.min.js"></script>
  358. <script src="./config/index.js"></script>
  359. <script>
  360. function toHome() {
  361. var backHomeUrl = configObj.mobile.backHomeUrl;
  362. location.href = backHomeUrl ? backHomeUrl : jumpLink('goodsDetail.html');
  363. }
  364. function jumpLink(urlName) {
  365. const origin = location.origin;
  366. const pathname = location.pathname;
  367. const urlAry = pathname.split('/');
  368. urlAry.pop();
  369. urlAry.push(urlName);
  370. const urlStr = urlAry.join('/');
  371. const link = origin + urlStr;
  372. return link;
  373. }
  374. window.addEventListener('load', () => {
  375. const state = { title: 'init', url: '#' };
  376. window.history.pushState(state, 'init', '#');
  377. });
  378. window.addEventListener('popstate', () => {
  379. toHome();
  380. });
  381. $(function () {
  382. var price = GetQueryString('price');
  383. var mer_ord_id = localStorage.getItem('mer_ord_id');
  384. var payTime = dayjs(localStorage.getItem('end_time')).format('YYYY-MM-DD HH:mm:ss');
  385. $('#priceNumber').text(price);
  386. $('#orderId').text(mer_ord_id);
  387. $('#payTime').text(payTime);
  388. var payTypeText = isInWeiXinApp ? '微信支付' : isInUnionApp ? '云闪付' : '支付宝';
  389. $('#payType').text(payTypeText);
  390. });
  391. </script>
  392. </html>