天波h5前端应用
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div class="active-container" v-show="isPageShow">
  3. <div class="header">
  4. <van-icon name="passed" size="80" color="green" v-if="isActive"/>
  5. <van-icon name="warning-o" size="80" color="red" v-else/>
  6. </div>
  7. <div class="main">
  8. <div class="text success" v-if="isActive">
  9. <p>激活成功,请重启设备,看到连接平台</p>
  10. <div class="img">图标<img src="../../assets/online.png"/>后,则可正常使用。</div>
  11. </div>
  12. <div class="text fail" v-else>
  13. <p>电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。</p>
  14. </div>
  15. </div>
  16. <van-button type="primary" size="large" @click="onBackHome">返回首页</van-button>
  17. </div>
  18. </template>
  19. <script>
  20. import { isNotNull} from "@/utils/index";
  21. import APIWx from "@/api/wx";
  22. export default {
  23. name:'',
  24. data(){
  25. return {
  26. isPageShow: false,
  27. isActive: null,
  28. }
  29. },
  30. created() {
  31. this.effective();
  32. },
  33. methods: {
  34. // 激活接口
  35. effective() {
  36. this.$toast.loading('激活中,请稍候...');
  37. let reqBody = {
  38. imei: this.$route.query.serialNo,
  39. iccid: this.$route.query.iccid || '',
  40. issue: Number(this.$route.query.issue) || 0
  41. };
  42. APIWx.Effective(reqBody)
  43. .then(res => {
  44. console.log("res", res);
  45. let data = res.data;
  46. console.log("data", data);
  47. this.$toast.clear();
  48. if(data.stateCode !== 1) {
  49. /* this.$dialog.confirm({
  50. title: '温馨提示',
  51. message: `${data.message}`,
  52. showCancelButton: false
  53. }) */
  54. this.isPageShow = true;
  55. this.isActive = false;
  56. } else if(data.stateCode === 0 && data.message !== null) {
  57. /* this.$dialog.confirm({
  58. title: '温馨提示',
  59. message: `电话卡激活失败!请进行实名认证与绑定SIM卡。如您已实名认证,请5分钟后,再进行设备绑定。`,
  60. showCancelButton: false
  61. }) */
  62. this.isPageShow = true;
  63. this.isActive = false;
  64. } else if (data.stateCode === 1 && data.message !== 'ok') {
  65. /* this.$dialog.confirm({
  66. title: "SIM卡激活成功",
  67. message: '卡激活成功,5分钟后则可正常使用。',
  68. showCancelButton: false,
  69. confirmButtonText: '返回首页'}).then(() => {
  70. document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
  71. }); */
  72. this.isPageShow = true;
  73. this.isActive = true;
  74. } else if (data.stateCode === 1 && data.message === 'ok') {
  75. /* this.$dialog.confirm({
  76. title: "SIM卡激活成功",
  77. message: '卡激活成功,5分钟后则可正常使用。',
  78. showCancelButton: false,
  79. confirmButtonText: '返回首页'
  80. }).then(() => {
  81. document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
  82. }); */
  83. this.isPageShow = true;
  84. this.isActive = true;
  85. }
  86. })
  87. .catch(error => {
  88. console.log("出错了:;", error);
  89. this.$dialog.confirm({
  90. title: '温馨提示',
  91. message: `${error.message}`,
  92. showCancelButton: false
  93. })
  94. }).finally(() => {
  95. this.$toast.clear();
  96. })
  97. },
  98. onBackHome() {
  99. document.location.replace(" https://xrpt.jiankangtongxue.cn/WCUParentWebUI.WX/Home/")
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .active-container {
  106. height: 100vh;
  107. padding: 40px 40px;
  108. .header {
  109. padding: 10px 0;
  110. @include center();
  111. }
  112. .main {
  113. width: 100%;
  114. padding: 10px;
  115. display: flex;
  116. justify-content: flex-start;
  117. align-items: flex-start;
  118. flex-direction: column;
  119. .text, p {
  120. width: 100%;
  121. font-size: 16px;
  122. text-align: left;
  123. font-weight: 500;
  124. margin: 5px 0;
  125. img {
  126. height: 25px;
  127. width: 60px;
  128. margin: 0 5px;
  129. }
  130. .img {
  131. display: flex;
  132. justify-content: flex-start;
  133. align-items: center;
  134. }
  135. }
  136. }
  137. .van-button {
  138. margin-top: 20px;
  139. }
  140. }
  141. </style>