payOrderDetail.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <!DOCTYPE html>
  2. <html class="remModel">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="Cache-Control" content="no-cache,no-store,no-siteapp,must-revalidate">
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="expires" content="0">
  8. <meta name="author" content="">
  9. <meta name="description" content=""/>
  10. <meta name="keywords" content="扫码支付,线上投币,运营数据,物联网"/>
  11. <meta name="format-detection" content="telephone=no,email=no">
  12. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
  13. <title>订单详情</title>
  14. <link rel="stylesheet" href="https://cdn.washpayer.com/components/lib/mui.min.css">
  15. <link rel="stylesheet" href="/components/custom/css/common.css"/>
  16. <link rel="stylesheet" href="/app/css/xyf.common.min.css">
  17. <style>
  18. html, body, .order-detail-list {
  19. height: 100%;
  20. }
  21. /**表格*/
  22. .order-detail-list .order-goods-list {
  23. overflow-y: auto;
  24. padding-bottom: 54px;
  25. }
  26. /*卡片布局*/
  27. .order-detail-card .card-left {
  28. line-height: 1;
  29. }
  30. .order-detail-card .main-info {
  31. font-size: .3rem;
  32. color: rgba(0, 0, 0, .9);
  33. }
  34. .order-detail-card .sub-info {
  35. font-size: .26rem;
  36. color: #8f8f94;
  37. line-height: 1;
  38. }
  39. .order-detail-card .price {
  40. text-align: right;
  41. }
  42. .order-detail-card .number {
  43. text-align: right;
  44. }
  45. .order-detail-list .order-info-card {
  46. background: #fff;
  47. padding: 10px 15px;
  48. }
  49. .order-info-card .main-info {
  50. font-size: .36rem;
  51. line-height: .6rem;
  52. }
  53. .order-bottom-info .sub-info {
  54. font-size: .24rem;
  55. color: #555;
  56. line-height: .3rem;
  57. }
  58. .order-info-card2 {
  59. margin-top: 10px;
  60. }
  61. /**底部**/
  62. .order-detail-list .handle-panel {
  63. background: #fff;
  64. position: relative;
  65. width: 100%;
  66. left: 0;
  67. bottom: 0;
  68. border-top: 1px solid #c8c7cc;
  69. text-align: right;
  70. padding: 10px 15px;
  71. margin-top: 10px;
  72. }
  73. .order-detail-list .handle-panel .mui-btn {
  74. margin-left: 10px;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div class="order-detail-list">
  80. <div class="order-goods-list">
  81. <div id="pullrefresh" class="pullrefresh">
  82. <div class="scrollloadContainer">
  83. <ul class="mui-table-view scrollload-content">
  84. </ul>
  85. </div>
  86. </div>
  87. <div class="order-info-card">
  88. <div class="mui-row order-detail-card ">
  89. <div class="mui-col-sm-8 mui-col-xs-8">
  90. <div><span class="main-info">实付款</span></div>
  91. </div>
  92. <div class="mui-col-sm-4 mui-col-xs-4">
  93. <div class="main-info price c-red totalFee">¥30</div>
  94. </div>
  95. </div>
  96. </div>
  97. <div class=" order-info-card order-info-card2">
  98. <div class="mui-row order-detail-card ">
  99. <div class="mui-col-sm-11 mui-col-xs-12 order-bottom-info">
  100. <div><span class="sub-info orderNo" id="orderNoRow">订单编号: <span id="orderNo"></span><span
  101. class="c-primary"> 复制</span></span></div>
  102. <div><span class="sub-info payType"></span></div>
  103. <div><span class="sub-info createdTime"></span></div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="handle-panel btn-list">
  109. <button type="button" class="mui-btn mui-btn-outlined cancelBtn" onclick="cancel()">取消订单</button>
  110. <button type="button" class="mui-btn mui-btn-danger mui-btn-outlined payBtn" onclick="pay()">付款</button>
  111. </div>
  112. </div>
  113. <script type="text/html" id="model">
  114. <li class="mui-table-view-cell">
  115. <div class="mui-row order-detail-card">
  116. <div class="mui-col-sm-8 mui-col-xs-8 card-left">
  117. <p><span class="main-info name"></span></p>
  118. </div>
  119. <div class="mui-col-sm-4 mui-col-xs-4">
  120. <p class="main-info price"></p>
  121. <p class="sub-info number"></p>
  122. </div>
  123. </div>
  124. </li>
  125. </script>
  126. <div class="load-mask " id="agreeDialog" style="display: none">
  127. <div class="friendly-dialog">
  128. <div class="friendly-dialog-close iconfont icon-close-dark" onclick="closeAgree()">
  129. </div>
  130. <div class="friendly-dialog-body">
  131. 为了防止您遗忘充值,系统建议您将所有设备配置为SIM卡到期自动续费,避免SIM卡过期,业务无法正常运营。
  132. </div>
  133. <div class="friendly-dialog-footer">
  134. <button type="button" onclick="agreeAutoPay()" class="mui-btn mui-btn-primary mui-col-sm-4 mui-col-xs-4">同意
  135. </button>
  136. </div>
  137. </div>
  138. </div>
  139. <script src="https://cdn.washpayer.com/components/lib/jquery.min.js"></script>
  140. <script src="https://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
  141. <script src="https://cdn.washpayer.com/npm/clipboard@2.0.4/dist/clipboard.min.js"></script>
  142. <script src="https://cdn.washpayer.com/components/lib/mui.min.js"></script>
  143. <script src="/components/custom/js/common.js"></script>
  144. <script src="/app/js/xyf.common.js"></script>
  145. <script src="/app/js/pay.js"></script>
  146. <script>
  147. var inhouseApp = localStorage.getItem("inhouseApp")
  148. var orderNo = getQueryString("orderNo");
  149. var totalFee = null;
  150. //初始化数据加载组件
  151. $(function () {
  152. pullupRefresh();
  153. function pullupRefresh() {
  154. var url = "/dealer/sim/order/detail?random=" + Math.random() * 1000;
  155. var data = {"orderNo": orderNo};
  156. sendRequest(url, "GET", data, function (res) {
  157. var panel = $(".scrollload-content");
  158. if (res.result == 1) {
  159. var length = res.para.items.length;
  160. for (var i = 0; i < length; i++) {
  161. var obj = res.para.items[i];
  162. var html = $("#model").html();
  163. html = $(html);
  164. html.find(".name").text(obj.name);
  165. html.find(".price").text("¥" + obj.price);
  166. html.find(".number").text("X" + obj.number);
  167. panel.append(html);
  168. }
  169. $(".totalFee").text("¥" + res.para.totalFee);
  170. $("#orderNo").text("" + res.para.orderNo);
  171. $(".createdTime").text("创建时间: " + res.para.createdTime);
  172. res.para.setSimChargeAuto && $(".payType").text('充值方式: 系统自动充值')
  173. totalFee = res.para.totalFee;
  174. changeBtnStatus(res.para.status)
  175. } else {
  176. mui.toast(res.description);
  177. }
  178. });
  179. }
  180. });
  181. //修改付款按钮状态
  182. function changeBtnStatus(status) {
  183. var text = "等待支付"
  184. if (status === "Paid") {
  185. $(".payBtn,.cancelBtn").hide();
  186. text = "交易成功"
  187. } else if (status === "Cancel") {
  188. $(".payBtn,.cancelBtn").hide();
  189. text = "订单已取消"
  190. }
  191. if ($('.handle-panel .mui-btn:visible').length === 0) {
  192. $('.handle-panel').hide();
  193. }
  194. $(".status").text(text);
  195. }
  196. // 同意续费,全部设备
  197. function agreeAutoPay() {
  198. sendRequest({
  199. url: '/dealer/setSimChargeAuto',
  200. type: "POST",
  201. data: null,
  202. contentType: "json",
  203. success: function (res) {
  204. if (res.result === 1) {
  205. mui.toast("设置自动续费成功");
  206. closeAgree()
  207. } else {
  208. mui.toast(res.description);
  209. }
  210. }
  211. });
  212. }
  213. function closeAgree(){
  214. $('#agreeDialog').removeClass('active').hide();
  215. setTimeout(function () {
  216. history.back()
  217. }, 1000);
  218. }
  219. //调用充值
  220. function pay() {
  221. var openId = localStorage.getItem("simOpenId")
  222. goPay({"orderNo": orderNo, "totalFee": totalFee, front_url: location.href, openId: openId}, function () {
  223. mui.toast("支付成功");
  224. if (inhouseApp === 'true') {
  225. $('#agreeDialog').addClass('active').show();
  226. }
  227. changeBtnStatus("Paid");
  228. })
  229. }
  230. function cancel() {
  231. sendRequest({
  232. url: '/dealer/sim/order/cancel',
  233. type: "POST",
  234. data: {orderNo: orderNo},
  235. contentType: "json",
  236. success: function (res) {
  237. if (res.result === 1) {
  238. mui.toast("已取消,即将返回上一页");
  239. changeBtnStatus("Cancel");
  240. setTimeout(function () {
  241. history.back()
  242. }, 2000);
  243. } else {
  244. mui.toast(res.description);
  245. }
  246. }
  247. });
  248. }
  249. function bindCopyLink() {
  250. var clipboard = new ClipboardJS('#orderNoRow', {
  251. text: function (trigger) {
  252. var value = $('#orderNo').text()
  253. return value
  254. }
  255. });
  256. clipboard.on('success', function (e) {
  257. mui.toast('复制成功')
  258. });
  259. }
  260. bindCopyLink()
  261. </script>
  262. </body>
  263. </html>