sim.vue 2.2 KB

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