sim.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 44px;">
  5. <view style="position: fixed;z-index: 100;width: 100%;">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="sim卡详情"></uni-nav-bar>
  7. </view>
  8. <view class="sim_info">
  9. <view class="sim_info_title">
  10. <image :src="'http://static.yfpyx.com/bigdata_app'+'/image/cb/sim1.png'" mode=""></image>
  11. <p>sim卡查询</p>
  12. </view>
  13. <view class="sim_info_text">
  14. <p>运营商:{{siminfo.data.carrier}}</p>
  15. <p>ICCID:{{iccid}}</p>
  16. <p>状态:{{state[siminfo.data.account_status]}}</p>
  17. <p>套餐:{{siminfo.data.data_plan}}MB</p>
  18. <p>已用流量:{{siminfo.data.data_usage}}MB</p>
  19. <p>剩余流量:{{siminfo.data.data_balance}}MB</p>
  20. <p>到期时间:{{siminfo.data.outbound_date|timeFormat()}}</p>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. iccid: '',
  31. siminfo: {
  32. data: {
  33. carrier: "--",
  34. account_status: "--",
  35. data_plan: "--",
  36. data_usage: "--",
  37. data_balance: "--",
  38. outbound_date: ""
  39. }
  40. },
  41. state: ['未知', '测试期', '沉默期', '使用中', '停机', '停机保号', '预销号', '销号'],
  42. id: ''
  43. }
  44. },
  45. methods: {
  46. async simid(data) { //设备列表
  47. const res = await this.$myRequest({
  48. url: '/api/api_gateway?method=forecast.send_control.device_sim',
  49. data: {
  50. d_id: data,
  51. type: 'sim'
  52. }
  53. })
  54. if(res.length!=0){
  55. this.iccid = res[0].iccid
  56. this.simdata(this.iccid)
  57. }
  58. },
  59. async simdata(data) { //设备列表
  60. const res = await this.$myRequest({
  61. url: '/api/api_gateway?method=forecast.send_control.sim_query',
  62. data: {
  63. iccid: data
  64. }
  65. })
  66. // console.log()
  67. this.siminfo = res.data
  68. console.log(this.siminfo.data)
  69. },
  70. clickLeft() {
  71. uni.navigateBack({
  72. delta: 1
  73. })
  74. }
  75. },
  76. onLoad(option) {
  77. console.log(option)
  78. this.id = option.id
  79. this.simid(this.id)
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. .sim_info {
  85. width: 90%;
  86. position: absolute;
  87. top: 54px;
  88. left: 5%;
  89. box-shadow: 0 0 10rpx #bcb9ca;
  90. padding: 30rpx 20rpx 50rpx;
  91. border-radius: 20rpx;
  92. box-sizing: border-box;
  93. .sim_info_title {
  94. width: 100%;
  95. display: flex;
  96. image {
  97. width: 24rpx;
  98. height: 32rpx;
  99. margin: 6rpx 20rpx 0 0;
  100. }
  101. p {
  102. font-weight: 700;
  103. }
  104. }
  105. .sim_info_text {
  106. width: 100%;
  107. padding-left: 44rpx;
  108. p {
  109. height: 30rpx;
  110. margin-top: 20rpx;
  111. font-size: 26rpx;
  112. }
  113. }
  114. }
  115. </style>