oderSuccess.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div>
  3. <van-nav-bar class="navBar" title="下单成功" />
  4. <div style=" background-color: rgb(74, 202, 109);
  5. color: #fff;
  6. width: 132px;
  7. height: 132px;
  8. border-radius: 106px;
  9. text-align: center;
  10. line-height: 190px; margin: 38% auto 80px;">
  11. <van-icon name="success" size="80"/>
  12. </div>
  13. <van-row gutter="20" style="text-align: center">
  14. <van-col span="12"><van-button icon="home" style="width: 120px" size="small" round type="primary" @click="goback">去首页</van-button>
  15. </van-col>
  16. <van-col span="12"><van-button icon="guide-o" style="width: 120px" size="small" round type="info" @click="visite">继续拜访</van-button></van-col>
  17. </van-row>
  18. </div>
  19. </template>
  20. <script>
  21. import {addstoreRegister, addVisitsPosition, checkVisit, mobileReposition} from "@/api";
  22. import axios from "axios";
  23. import home from "@/assets/Icon/home.png";
  24. import {getVisitsParams} from "@/api/inventory";
  25. export default {
  26. name: "success",
  27. data(){
  28. return{
  29. fromValue:{},
  30. home:home,
  31. }
  32. },
  33. created() {
  34. this.addstoreRegister()
  35. },
  36. watch: {
  37. $route(to, from) {
  38. if (to.path == "/success") {
  39. this.addstoreRegister()
  40. }
  41. }
  42. },
  43. methods: {
  44. addstoreRegister() {
  45. getVisitsParams({storeCode: this.$route.query.storeCode}).then(res => {
  46. this.fromValue = res.data
  47. })
  48. },
  49. goback() {
  50. window.location.replace(window.location.origin + "/mobile/")
  51. },
  52. visite() {
  53. if (this.fromValue != undefined) {
  54. if (this.fromValue.url != undefined) {
  55. window.location.replace(window.location.origin + "/mobile" + this.fromValue.url)
  56. } else {
  57. this.$dialog.alert({
  58. message: "拜访地址有误,请联系管理员!",
  59. }).then(() => {
  60. });
  61. }
  62. } else {
  63. this.$dialog.alert({
  64. message: "拜访地址有误,请联系管理员!",
  65. }).then(() => {
  66. });
  67. }
  68. }
  69. }
  70. }
  71. </script>