sim.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 64px;">
  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(res.data)
  67. this.siminfo = res.data
  68. },
  69. clickLeft() {
  70. uni.navigateBack({
  71. delta: 1
  72. })
  73. }
  74. },
  75. onLoad(option) {
  76. console.log(option)
  77. this.id = option.id
  78. this.simid(this.id)
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. .sim_info {
  84. width: 90%;
  85. position: absolute;
  86. top: 54px;
  87. left: 5%;
  88. box-shadow: 0 0 10rpx #bcb9ca;
  89. padding: 30rpx 20rpx 50rpx;
  90. border-radius: 20rpx;
  91. box-sizing: border-box;
  92. .sim_info_title {
  93. width: 100%;
  94. display: flex;
  95. image {
  96. width: 24rpx;
  97. height: 32rpx;
  98. margin: 6rpx 20rpx 0 0;
  99. }
  100. p {
  101. font-weight: 700;
  102. }
  103. }
  104. .sim_info_text {
  105. width: 100%;
  106. padding-left: 44rpx;
  107. p {
  108. height: 30rpx;
  109. margin-top: 20rpx;
  110. font-size: 26rpx;
  111. }
  112. }
  113. }
  114. </style>