start.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="pages">
  3. <view class="empty_item" v-if="show">
  4. <image mode="widthFix" src="../../static/empty.jpg"></image>
  5. <view class="error-text">设备SN:{{sn}}</view>
  6. <view class="error-text">{{errorText}}</view>
  7. </view>
  8. </view>
  9. </template>
  10. <script setup>
  11. export default {
  12. data(){
  13. return {
  14. sn:this.api.getSn(),
  15. errorText:'系统异常',
  16. show:false,
  17. }
  18. },
  19. onShow(){
  20. this.getEquipmentInfo()
  21. },
  22. methods: {
  23. // 获取数据
  24. getEquipmentInfo() {
  25. this.loading = true
  26. let that = this,
  27. url = "app/api/getEquipmentInfo",
  28. params = {
  29. eqSn_equal: this.sn
  30. }
  31. that.api.request(url, params, "get").then((res) => {
  32. uni.redirectTo({
  33. url:"/pages/index/index"+res.factory.type
  34. })
  35. }).catch((res) => {
  36. console.log(res)
  37. this.show=true
  38. if(res.data && res.data.msg){
  39. that.errorText = res.data.msg
  40. }
  41. })
  42. // this.request({
  43. // pageSize: this.pageSize,
  44. // pageCurrent: pageCurrent,
  45. // value: value,
  46. // success: res => {
  47. // // console.log('data', res);
  48. // this.tableData = res.data
  49. // this.total = res.total
  50. // this.loading = false
  51. // }
  52. // })
  53. },
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .pages{
  59. background: #fff;
  60. text-align: center;
  61. min-height: 100vh;
  62. .empty_item{
  63. padding-top: 10%;
  64. }
  65. .error-text{
  66. font-size: 40rpx;
  67. line-height: 80rpx;
  68. }
  69. }
  70. </style>