error.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <view class="content padding-horizontal-main tc">
  4. <view class="margin-top-xxxl">
  5. <icon type="warn" size="16" color="#f00" class="va-m" />
  6. <view class="cr-red va-m dis-inline-block margin-left-sm">
  7. <block v-if="(params || null) != null && (params.msg || null) != null">{{params.msg}}</block>
  8. <block v-else>异常错误</block>
  9. </view>
  10. </view>
  11. <view class="margin-top-xxl">
  12. <button type="default" size="mini" class="bg-main br-main cr-white round text-size-sm padding-left-xxxl padding-right-xxxl padding-top-xs padding-bottom-xs margin-top-xl" @tap="back_event">返回</button>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. const app = getApp();
  19. import base64 from '../../common/js/lib/base64.js';
  20. export default {
  21. data() {
  22. return {
  23. params: null
  24. };
  25. },
  26. components: {},
  27. props: {},
  28. // 页面加载初始化
  29. onLoad(params) {
  30. console.log(params);
  31. if((params.msg || null) != null) {
  32. params['msg'] = base64.decode(decodeURIComponent(params.msg));
  33. }console.log(params);
  34. this.setData({
  35. params: params
  36. });
  37. },
  38. // 页面显示
  39. onShow() {
  40. // 分享菜单处理
  41. app.globalData.page_share_handle();
  42. },
  43. // 方法
  44. methods: {
  45. // 返回
  46. back_event(e) {
  47. var pages = getCurrentPages();
  48. if(pages > 1) {
  49. uni.navigateBack();
  50. } else {
  51. uni.switchTab({
  52. url: app.globalData.data.tabbar_pages[0]
  53. });
  54. }
  55. }
  56. }
  57. };
  58. </script>
  59. <style>
  60. .content {
  61. padding-top: 30%;
  62. }
  63. </style>