orderRes.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <div class="orderRes" style="padding-top: 46px">
  3. <van-nav-bar title="下单结果" class="van-nav-bar-my-fixed" fixed />
  4. <div class="page-main" v-loading="loading">
  5. <img :src="img" class="page-main-img" alt="" />
  6. <!-- <div class="dagou" :class="{ ok: ok }">
  7. <svg width="100" height="100">
  8. <circle
  9. fill="none"
  10. stroke="#a67e4b"
  11. stroke-width="5"
  12. cx="50"
  13. cy="50"
  14. r="47.5"
  15. class="circle"
  16. transform="rotate(-90 50 50)"
  17. />
  18. <polyline
  19. fill="none"
  20. stroke="#a67e4b"
  21. stroke-width="6"
  22. points="16.5,53.5 45.25,71 78,34.5"
  23. stroke-linecap="round"
  24. stroke-linejoin="round"
  25. class="tick"
  26. />
  27. </svg>
  28. </div> -->
  29. <div class="tc" style="margin: -10px 0 30px 0">
  30. <p style="color: #a67e4b">恭喜您,下单成功!</p>
  31. </div>
  32. <div class="yingdao clear" v-if="ok">
  33. <van-button
  34. round
  35. type="info"
  36. class="fr"
  37. size="small"
  38. @click="goto('/oDetail')"
  39. >订单详情</van-button
  40. >
  41. <van-button round class="fr" size="small" @click="goto('/home/paddy')"
  42. >返回首页</van-button
  43. >
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import asyncRequest from "@/apis/order/index";
  50. import resToken from "@/mixins/resToken";
  51. export default {
  52. mixins: [resToken],
  53. components: {
  54. // "van-cell": cell,
  55. // "van-list": List,
  56. // "van-tab": Tab,
  57. // "van-tabs": Tabs,
  58. },
  59. data() {
  60. return {
  61. //初始小球不显示
  62. img: require("@/assets/img/state@2x.png"),
  63. resData: null,
  64. id: "",
  65. ok: false,
  66. loading: true,
  67. };
  68. },
  69. async created() {
  70. this.ok = false;
  71. this.id = this.$route.query.id ? this.$route.query.id : "0";
  72. if (this.id !== "0") {
  73. await this.initData();
  74. }
  75. },
  76. methods: {
  77. goto(url) {
  78. let model = {
  79. path: url,
  80. };
  81. if (url == "/oDetail") {
  82. model.query = {
  83. id: this.id,
  84. };
  85. }
  86. this.$router.replace(model);
  87. },
  88. async initData() {
  89. this.loading = true;
  90. const res = await asyncRequest.detail({ id: this.id });
  91. this.loading = false;
  92. if (res && res.code === 0) {
  93. this.ok = true;
  94. this.resData = res.data;
  95. } else if (res && res.code >= 100 && res.code <= 104) {
  96. await this.logout();
  97. } else {
  98. this.show_title(res.msg);
  99. }
  100. },
  101. },
  102. };
  103. </script>
  104. <style lang="scss" scoped>
  105. .orderRes {
  106. width: 100%;
  107. height: 100%;
  108. background: #e6e6dc !important;
  109. .page-main {
  110. width: 100%;
  111. text-align: center;
  112. .page-main-img {
  113. box-sizing: border-box;
  114. display: inline-block;
  115. padding:50px 0 8px 0;
  116. width: 35%;
  117. }
  118. }
  119. .dagou {
  120. display: flex;
  121. width: 100%;
  122. justify-content: center;
  123. align-content: center;
  124. align-items: center;
  125. height: 150px;
  126. margin: 3vh 0;
  127. flex-direction: column;
  128. h2 {
  129. font-family: Arial, Helvetica, sans-serif;
  130. font-size: 36px;
  131. margin-top: 40px;
  132. color: #333;
  133. }
  134. .circle {
  135. stroke-dasharray: 597;
  136. stroke-dashoffset: 597;
  137. }
  138. .tick {
  139. stroke-dasharray: 175;
  140. stroke-dashoffset: 175;
  141. }
  142. @keyframes circle {
  143. from {
  144. stroke-dashoffset: 597;
  145. }
  146. to {
  147. stroke-dashoffset: 1194;
  148. }
  149. }
  150. @keyframes tick {
  151. from {
  152. stroke-dashoffset: 175;
  153. }
  154. to {
  155. stroke-dashoffset: 0;
  156. }
  157. }
  158. &.ok .circle {
  159. animation: circle 1s ease-in-out;
  160. animation-fill-mode: forwards;
  161. }
  162. &.ok .tick {
  163. animation: tick 1s ease-in-out;
  164. animation-fill-mode: forwards;
  165. animation-delay: 0.95s;
  166. }
  167. }
  168. .yingdao {
  169. padding: 5px 16px;
  170. box-sizing: border-box;
  171. button {
  172. width: 30.5%;
  173. &:first-child {
  174. margin: 0 13% 0 6.5%;
  175. color: #333;
  176. background: linear-gradient(0deg, #a67e4b, #efc180);
  177. // background: linear-gradient(0deg, #f4d022 0%, #f4d022 100%);
  178. border: 0;
  179. }
  180. &:last-child {
  181. margin: 0 6.5% 0 13%;
  182. color: #333;
  183. // background: #f2f2f2;
  184. border: 1px solid #333;
  185. background: transparent;
  186. // border-color: rgb(255, 131, 39);
  187. // color: rgb(255, 131, 39);
  188. }
  189. }
  190. }
  191. }
  192. // .code-main {
  193. // padding: 16px 16px 10px 16px;
  194. // img {
  195. // display: inline-block;
  196. // width: 80%;
  197. // margin: 0 10% 5px 10%;
  198. // }
  199. // p {
  200. // text-align: center;
  201. // line-height: 25px;
  202. // }
  203. // }
  204. // .mine-cell-list {
  205. // border-top: 0.01rem solid #ebedf0;
  206. // border-bottom: 0.01rem solid #ebedf0;
  207. // }
  208. // .mine-logout {
  209. // padding: 100px 20px 0 20px;
  210. // button {
  211. // width: 100%;
  212. // border: 0;
  213. // }
  214. // }
  215. // .mine-service {
  216. // padding: 16px 16px 16px 16px;
  217. // background: #fff;
  218. // .mine-service-title {
  219. // color: #000;
  220. // font-size: 18px;
  221. // font-weight: bolder;
  222. // padding: 0 3px 3px 3px;
  223. // }
  224. // ul {
  225. // width: 100%;
  226. // // border-top: 0.01rem solid #ebedf0;
  227. // li {
  228. // float: left;
  229. // width: 50%;
  230. // position: relative;
  231. // padding: 8px 0 0 0;
  232. // img.service-bg {
  233. // float: left;
  234. // margin: 0;
  235. // height: 75px;
  236. // width: 100%;
  237. // }
  238. // div {
  239. // position: absolute;
  240. // top: 0;
  241. // left: 0;
  242. // width: 100%;
  243. // padding: 20px;
  244. // box-sizing: border-box;
  245. // p {
  246. // float: left;
  247. // width: calc(100% - 40px);
  248. // color: #fff;
  249. // height: 45px;
  250. // line-height: 45px;
  251. // font-size: 16px;
  252. // text-align: center;
  253. // // padding: 0 5% 0 0;
  254. // box-sizing: border-box;
  255. // font-weight: bolder;
  256. // }
  257. // img {
  258. // float: left;
  259. // width: 40px;
  260. // box-sizing: border-box;
  261. // padding: 2% 2%;
  262. // height: 45px;
  263. // width: 40px;
  264. // }
  265. // }
  266. // &:nth-child(1) {
  267. // padding-right: 3px;
  268. // // padding-top: 6px;
  269. // // padding-bottom: 5px;
  270. // }
  271. // &:nth-child(2) {
  272. // padding-left: 3px;
  273. // // div {
  274. // // img {
  275. // // padding: 2% 0;
  276. // // }
  277. // // }
  278. // }
  279. // }
  280. // }
  281. // }
  282. // .mine-resume {
  283. // padding-top: 46px;
  284. // position: relative;
  285. // box-sizing: border-box;
  286. // width: 100%;
  287. // height: 246px;
  288. // .edit {
  289. // position: absolute;
  290. // right: 0;
  291. // top: 98px;
  292. // background: #04d1dc;
  293. // height: 30px;
  294. // line-height: 30px;
  295. // color: #fff;
  296. // padding: 0 10px 0 16px;
  297. // border-top-left-radius: 15px;
  298. // font-size: 14px;
  299. // border-bottom-left-radius: 15px;
  300. // }
  301. // .mineBg {
  302. // width: 100%;
  303. // display: inline-block;
  304. // height: 200px;
  305. // }
  306. // .mine-resume-main {
  307. // position: absolute;
  308. // padding-top: 46px;
  309. // top: 0;
  310. // left: 0;
  311. // width: 100%;
  312. // z-index: 2;
  313. // ul {
  314. // width: 100%;
  315. // li {
  316. // float: left;
  317. // width: calc(100% - 155px);
  318. // &:first-child {
  319. // width: 125px;
  320. // height: 100%;
  321. // padding: 58px 5px 0 16px;
  322. // text-align: center;
  323. // img {
  324. // width: 48px;
  325. // height: 48px;
  326. // border: 1px solid #eee;
  327. // display: inline-block;
  328. // border-radius: 50%;
  329. // padding: 8px;
  330. // }
  331. // }
  332. // &:nth-child(2) {
  333. // // padding: 40px 0 0 0;
  334. // padding: 52px 0 0 0;
  335. // color: #fff;
  336. // font-size: 16px;
  337. // p::before,
  338. // p::after,
  339. // b::after,
  340. // b::before {
  341. // clear: both;
  342. // content: "";
  343. // box-sizing: border-box;
  344. // }
  345. // p {
  346. // width: 100%;
  347. // height: 40px;
  348. // line-height: 40px;
  349. // > span {
  350. // float: left;
  351. // &:first-child {
  352. // width: 120px;
  353. // display: inline-block;
  354. // overflow: hidden;
  355. // }
  356. // }
  357. // b {
  358. // float: left;
  359. // font-weight: lighter;
  360. // height: 27px;
  361. // width: 70px;
  362. // margin: 4px 0 0 0;
  363. // vertical-align: top;
  364. // border-radius: 18px;
  365. // border: 1px solid #fff;
  366. // text-align: center;
  367. // i {
  368. // vertical-align: top;
  369. // font-size: 14px;
  370. // height: 25px;
  371. // line-height: 25px;
  372. // }
  373. // span {
  374. // clear: both;
  375. // padding: 0 4px 0 4px;
  376. // vertical-align: top;
  377. // font-size: 12px;
  378. // height: 25px;
  379. // line-height: 25px;
  380. // }
  381. // }
  382. // }
  383. // }
  384. // }
  385. // }
  386. // }
  387. // .mine-unresume-main {
  388. // position: absolute;
  389. // padding-top: 46px;
  390. // top: 0;
  391. // left: 0;
  392. // width: 100%;
  393. // z-index: 2;
  394. // text-align: center;
  395. // img {
  396. // width: 48px;
  397. // height: 48px;
  398. // border: 1px solid #eee;
  399. // display: inline-block;
  400. // border-radius: 50%;
  401. // padding: 8px;
  402. // margin: 50px 0 0 0;
  403. // }
  404. // div {
  405. // width: 100%;
  406. // padding: 12px 0 0 0;
  407. // b {
  408. // display: inline-block;
  409. // font-weight: lighter;
  410. // height: 27px;
  411. // width: 60px;
  412. // margin: 4px 0 0 0;
  413. // vertical-align: top;
  414. // border-radius: 18px;
  415. // border: 1px solid #fff;
  416. // text-align: center;
  417. // color: #fff;
  418. // i {
  419. // vertical-align: top;
  420. // font-size: 14px;
  421. // height: 25px;
  422. // line-height: 25px;
  423. // }
  424. // span {
  425. // clear: both;
  426. // padding: 0 4px 0 4px;
  427. // vertical-align: top;
  428. // font-size: 12px;
  429. // height: 25px;
  430. // line-height: 25px;
  431. // }
  432. // }
  433. // }
  434. // }
  435. // }
  436. // .color_ {
  437. // // color: rgb(64, 120, 202);
  438. // }
  439. // input[type="search"]::-webkit-search-cancel-button {
  440. // -webkit-appearance: none;
  441. // }
  442. // .search {
  443. // input {
  444. // background: rgba(242, 242, 247, 1);
  445. // border-radius: 15px;
  446. // height: 30px;
  447. // text-align: center;
  448. // }
  449. // }
  450. // .doge {
  451. // width: 140px;
  452. // height: 72px;
  453. // margin-top: 8px;
  454. // border-radius: 4px;
  455. // }
  456. // .tiaojian {
  457. // padding-bottom: 10px;
  458. // .search-tab {
  459. // font-size: 12px;
  460. // color: #333333;
  461. // .van-cell__right-icon {
  462. // color: #cccccc;
  463. // font-size: 12px;
  464. // line-height: normal;
  465. // height: auto;
  466. // }
  467. // .van-cell__right-icon::before {
  468. // -webkit-transform: rotate(90deg);
  469. // transform: rotate(90deg);
  470. // -webkit-transition: -webkit-transform 0.3s;
  471. // transition: -webkit-transform 0.3s;
  472. // transition: transform 0.3s;
  473. // transition: transform 0.3s, -webkit-transform 0.3s;
  474. // margin-top: 2px;
  475. // }
  476. // }
  477. // .search-tab.active {
  478. // color: rgb(64, 120, 202);
  479. // .van-cell__right-icon::before {
  480. // -webkit-transform: rotate(-90deg);
  481. // transform: rotate(-90deg);
  482. // color: rgb(64, 120, 202);
  483. // }
  484. // }
  485. // .search-tab.colorActive {
  486. // color: rgb(64, 120, 202);
  487. // .van-cell__right-icon::before {
  488. // color: rgb(64, 120, 202);
  489. // }
  490. // }
  491. // }
  492. // .tab-content {
  493. // overflow: hidden;
  494. // .tab-content-list {
  495. // overflow-y: auto;
  496. // div:nth-child(1) {
  497. // margin-top: 0px;
  498. // }
  499. // }
  500. // }
  501. </style>