| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <template>
- <view>
- <view class="section">
- <view class="tit">
- <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim1.png" ></image>
- sim卡流量
- </view>
- <view class="item">
- <text>ICCID:</text>
- <text>{{sim.iccid}}</text>
- </view>
- <view class="item">
- <text>状态:</text>
- <text>{{sim.account_status|simStatus}}</text>
- </view>
- <view class="item">
- <text>套餐:</text>
- <text>{{sim.data_plan}}MB</text>
- </view>
- <view class="item">
- <text>已用流量:</text>
- <text>{{sim.data_usage}}MB</text>
- </view>
- <view class="item">
- <text>剩余流量:</text>
- <text>{{sim.data_balance}}MB</text>
- </view>
- <view class="item">
- <text>到期时间:</text>
- <text>{{sim.expiry_date|timeFormat}}</text>
- </view>
- </view>
- <template v-if="showHksimFlag">
- <view class="section">
- <view class="tit">
- <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim2.png" ></image>
- 海康sim卡流量
- </view>
- <view class="item">
- <text>ICCID:</text>
- <text>{{hksim.iccid}}</text>
- </view>
- <view class="item">
- <text>状态:</text>
- <text>{{hksim.account_status|simStatus}}</text>
- </view>
- <view class="item">
- <text>套餐:</text>
- <text>{{hksim.data_plan}}MB</text>
- </view>
- <view class="item">
- <text>已用流量:</text>
- <text>{{hksim.data_usage}}MB</text>
- </view>
- <view class="item">
- <text>剩余流量:</text>
- <text>{{hksim.data_balance}}MB</text>
- </view>
- <view class="item">
- <text>到期时间:</text>
- <text>{{hksim.expiry_date|timeFormat}}</text>
- </view>
- <view class="item">
- <text>更换ICCID:</text>
- <u-input v-model="hksiminp" type="text" :custom-style="sty" />
- </view>
- <view class="submit-box">
- <u-button @click="submit" type="warning">确定</u-button>
- </view>
- <u-toast ref="toast" />
- </view>
- </template>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- sim: {
- iccid: "",
- account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
- data_plan: 0, //套餐大小
- data_usage: 0, //当月用量
- data_balance: 0, //剩余流量
- expiry_date: 0, //到期日期
- },
- showHksimFlag: true, //是否显示hksim卡标识
- hksim: {
- iccid: "",
- account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
- data_plan: 0, //套餐大小
- data_usage: 0, //当月用量
- data_balance: 0, //剩余流量
- expiry_date: 0, //到期日期
- },
- hksiminp:'',//更换ICCID
- d_id:'',
- sty:{
- 'background':'#F7F8FA'
- }
- }
- },
- onLoad(option){
- this.d_id=option.d_id
- this.lookSIMCode('sim')
- this.lookSIMCode('hksim')
- },
- filters: {
- simStatus(val) {
- switch (val) {
- case 0:
- return "未知";
- case 1:
- return "测试期";
- case 2:
- return "沉默期";
- case 3:
- return "使用中";
- case 4:
- return "停机";
- case 5:
- return "停机保号";
- case 6:
- return "预销号";
- case 7:
- return "销号";
- }
- },
- },
- methods: {
- async lookSIMCode(flag){
- let res=await this.$myRequest({
- url:'/api/api_gateway?method=forecast.send_control.device_sim',
- data:{
- d_id:this.d_id,
- type:flag
- }
- })
- let res2=await this.$myRequest({
- url:'/api/api_gateway?method=forecast.send_control.sim_query',
- data:{
- iccid:res[0].iccid,
- }
- })
- let obj=eval('('+res2.data+')').data
- if(flag=='sim'){
- this.sim={
- iccid: res[0].iccid,
- account_status: obj.account_status, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
- data_plan: obj.data_plan, //套餐大小
- data_usage: obj.data_usage, //当月用量
- data_balance:obj.data_balance, //剩余流量
- expiry_date:obj.expiry_date, //到期日期
- }
-
- }else if(flag=='hksim'){
- this.hksim={
- iccid: res[0].iccid,
- account_status: obj.account_status, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
- data_plan: obj.data_plan, //套餐大小
- data_usage: obj.data_usage, //当月用量
- data_balance:obj.data_balance, //剩余流量
- expiry_date: obj.expiry_date, //到期日期
- }
- }
- },
- async submit(){
- let res=await this.$myRequest({
- url:'/api/api_gateway?method=forecast.send_control.device_sim',
- data:{
- d_id: this.d_id,
- iccid: this.hksiminp,
- type: "change",
- }
- })
- this.$refs.toast.show({
- title: '修改成功!',
- type: 'success',
- callback:function(){
- uni.navigateBack({
- delta: 1
- });
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- padding:30rpx;
- box-sizing: border-box;
- .section{
- padding:30rpx;
- box-shadow: 0px 0px 5px 3px rgba(136,136,136,.1);
- margin-bottom:20rpx;
- box-sizing: border-box;
- .item{
- line-height:56rpx;
- font-size:26rpx;
- text:nth-child(1){
- margin-right:10rpx;
- }
- display:flex;
- }
- .tit{
- margin-bottom:20rpx;
- font-size:28rpx;
- image{
- width:22rpx;
- margin-right:10rpx;
-
- }
- }
- .submit-box{
- margin-top:20rpx;
- }
- }
- }
-
- </style>
|