|
|
@@ -1,9 +1,12 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<view class="section">
|
|
|
+ <view class="sim_info_loding" v-if="loding">
|
|
|
+ <image src="../../../static/images/cb/6286299.gif" mode="" class="img"></image>
|
|
|
+ </view>
|
|
|
<view class="tit">
|
|
|
- <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim1.png" ></image>
|
|
|
- sim卡流量
|
|
|
+ <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim1.png"></image>
|
|
|
+ 数据sim卡流量{{"("+sim.simnew+")"}}
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>ICCID:</text>
|
|
|
@@ -11,7 +14,7 @@
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>状态:</text>
|
|
|
- <text>{{sim.account_status|simStatus}}</text>
|
|
|
+ <text>{{sim.account_status}}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>套餐:</text>
|
|
|
@@ -27,14 +30,18 @@
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>到期时间:</text>
|
|
|
- <text>{{sim.expiry_date|timeFormat}}</text>
|
|
|
+ <text v-if="sim.simnew=='新'">{{sim.expiry_date|timeFormat}}</text>
|
|
|
+ <text v-else>{{sim.expiry_date|timeFormat}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<template v-if="showHksimFlag">
|
|
|
<view class="section">
|
|
|
+ <view class="sim_info_loding" v-if="loding2">
|
|
|
+ <image src="../../../static/images/cb/6286299.gif" mode="" class="img"></image>
|
|
|
+ </view>
|
|
|
<view class="tit">
|
|
|
- <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim2.png" ></image>
|
|
|
- 海康sim卡流量
|
|
|
+ <image mode="widthFix" src="http://static.yfpyx.com/bigdata_app/image/cb/sim2.png"></image>
|
|
|
+ 图片sim卡流量{{"("+hksim.simnew+")"}}
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>ICCID:</text>
|
|
|
@@ -42,7 +49,7 @@
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>状态:</text>
|
|
|
- <text>{{hksim.account_status|simStatus}}</text>
|
|
|
+ <text>{{hksim.account_status}}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>套餐:</text>
|
|
|
@@ -58,19 +65,19 @@
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>到期时间:</text>
|
|
|
- <text>{{hksim.expiry_date|timeFormat}}</text>
|
|
|
+ <text v-if="hksim.simnew=='新'">{{hksim.expiry_date}}</text>
|
|
|
+ <text v-else>{{hksim.expiry_date|timeFormat}}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text>更换ICCID:</text>
|
|
|
- <u-input v-model="hksiminp" type="text" :custom-style="sty" />
|
|
|
+ <u-input v-model="hksiminp" type="text" :custom-style="sty" />
|
|
|
</view>
|
|
|
<view class="submit-box">
|
|
|
- <u-button @click="submit" type="warning">确定</u-button>
|
|
|
+ <u-button @click="submit" type="warning">确定</u-button>
|
|
|
</view>
|
|
|
<u-toast ref="toast" />
|
|
|
</view>
|
|
|
</template>
|
|
|
-
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -79,13 +86,14 @@
|
|
|
data() {
|
|
|
return {
|
|
|
sim: {
|
|
|
- iccid: "",
|
|
|
- account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
|
|
|
- data_plan: 0, //套餐大小
|
|
|
- data_usage: 0, //当月用量
|
|
|
- data_balance: 0, //剩余流量
|
|
|
- expiry_date: 0, //到期日期
|
|
|
- },
|
|
|
+ iccid: "",
|
|
|
+ account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
|
|
|
+ data_plan: 0, //套餐大小
|
|
|
+ data_usage: 0, //当月用量
|
|
|
+ data_balance: 0, //剩余流量
|
|
|
+ expiry_date: 0, //到期日期,
|
|
|
+ simnew:""
|
|
|
+ },
|
|
|
showHksimFlag: true, //是否显示hksim卡标识
|
|
|
hksim: {
|
|
|
iccid: "",
|
|
|
@@ -94,132 +102,222 @@
|
|
|
data_usage: 0, //当月用量
|
|
|
data_balance: 0, //剩余流量
|
|
|
expiry_date: 0, //到期日期
|
|
|
- },
|
|
|
- hksiminp:'',//更换ICCID
|
|
|
- d_id:'',
|
|
|
- sty:{
|
|
|
- 'background':'#F7F8FA'
|
|
|
- }
|
|
|
+ simnew:""
|
|
|
+ },
|
|
|
+ hksiminp: '', //更换ICCID
|
|
|
+ d_id: '',
|
|
|
+ sty: {
|
|
|
+ 'background': '#F7F8FA'
|
|
|
+ },
|
|
|
+ loding:false,
|
|
|
+ loding2:false
|
|
|
}
|
|
|
},
|
|
|
- onLoad(option){
|
|
|
- this.d_id=option.d_id
|
|
|
+ onLoad(option) {
|
|
|
+ if (Number(option.device_type) == 4) {
|
|
|
+ this.showHksimFlag = false
|
|
|
+ }
|
|
|
+ this.d_id = option.d_id
|
|
|
this.lookSIMCode('sim')
|
|
|
this.lookSIMCode('hksim')
|
|
|
+ this.loding = true
|
|
|
+ this.loding2 = true
|
|
|
},
|
|
|
- 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
|
|
|
+ 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 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, //到期日期
|
|
|
+ let obj = res2.data.data
|
|
|
+ if (res2.code == 1) { //企鹏 新
|
|
|
+ var state = ""
|
|
|
+ switch (obj.deviceStatus) {
|
|
|
+ case "ACTIVATION_READY_NAME":
|
|
|
+ state = "可测试"
|
|
|
+ break;
|
|
|
+ case "TEST_READY_NAME":
|
|
|
+ state = "库存"
|
|
|
+ break;
|
|
|
+ case "INVENTORY_NAME":
|
|
|
+ state = "可激活"
|
|
|
+ break;
|
|
|
+ case "ACTIVATION_READY_NAME":
|
|
|
+ state = "已激活"
|
|
|
+ break;
|
|
|
+ case "ACTIVATED_NAME":
|
|
|
+ state = "已停卡"
|
|
|
+ break;
|
|
|
+ case "DEACTIVATED_NAME":
|
|
|
+ state = "已销卡"
|
|
|
+ break;
|
|
|
+ case "RETIRED_NAME":
|
|
|
+ state = "已清除"
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
- }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, //到期日期
|
|
|
+ console.log(obj)
|
|
|
+ if (flag == 'sim') {
|
|
|
+ this.sim = {
|
|
|
+ iccid: res[0].iccid,
|
|
|
+ account_status: state,
|
|
|
+ data_plan: obj.totalDataVolume, //套餐大小
|
|
|
+ data_usage: obj.usedDataVolume, //当月用量
|
|
|
+ data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
|
|
|
+ expiry_date: obj.ratePlanExpirationDate, //到期日期,
|
|
|
+ simnew:"新"
|
|
|
+ }
|
|
|
+ this.loding = false
|
|
|
+ } else if (flag == 'hksim') {
|
|
|
+ this.hksim = {
|
|
|
+ iccid: res[0].iccid,
|
|
|
+ account_status: state,
|
|
|
+ data_plan: obj.totalDataVolume, //套餐大小
|
|
|
+ data_usage: obj.usedDataVolume, //当月用量
|
|
|
+ data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
|
|
|
+ expiry_date: obj.ratePlanExpirationDate, //到期日期
|
|
|
+ simnew:"新"
|
|
|
+ }
|
|
|
+ this.loding2 = false
|
|
|
+ }
|
|
|
+ } else if (res2.code == 2) { //合宙 旧
|
|
|
+ var state = ""
|
|
|
+ switch (obj.account_status) {
|
|
|
+ case 0:
|
|
|
+ state = "未知"
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ state = "测试期"
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ state = "沉默期"
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ state = "使用中"
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ state = "停机"
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ state = "停机保号"
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ state = "预销号"
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ state = "销号"
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.simnew = "旧"
|
|
|
+ if (flag == 'sim') {
|
|
|
+ this.sim = {
|
|
|
+ iccid: res[0].iccid,
|
|
|
+ account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
|
|
|
+ data_plan: obj.data_plan, //套餐大小
|
|
|
+ data_usage: obj.data_usage, //当月用量
|
|
|
+ data_balance: obj.data_balance, //剩余流量
|
|
|
+ expiry_date: obj.expiry_date, //到期日期
|
|
|
+ simnew:"旧"
|
|
|
+ }
|
|
|
+ this.loding = false
|
|
|
+ } else if (flag == 'hksim') {
|
|
|
+ this.hksim = {
|
|
|
+ iccid: res[0].iccid,
|
|
|
+ account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
|
|
|
+ data_plan: obj.data_plan, //套餐大小
|
|
|
+ data_usage: obj.data_usage, //当月用量
|
|
|
+ data_balance: obj.data_balance, //剩余流量
|
|
|
+ expiry_date: obj.expiry_date, //到期日期
|
|
|
+ simnew:"旧"
|
|
|
+ }
|
|
|
+ this.loding2 = false
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- async submit(){
|
|
|
- let res=await this.$myRequest({
|
|
|
- url:'/api/api_gateway?method=forecast.send_control.device_sim',
|
|
|
- data:{
|
|
|
+ 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",
|
|
|
+ iccid: this.hksiminp,
|
|
|
+ type: "change",
|
|
|
}
|
|
|
})
|
|
|
this.$refs.toast.show({
|
|
|
title: '修改成功!',
|
|
|
type: 'success',
|
|
|
- callback:function(){
|
|
|
+ callback: function() {
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- page{
|
|
|
- padding:30rpx;
|
|
|
+ page {
|
|
|
+ padding: 30rpx;
|
|
|
box-sizing: border-box;
|
|
|
- .section{
|
|
|
- padding:30rpx;
|
|
|
- box-shadow: 0px 0px 5px 3px rgba(136,136,136,.1);
|
|
|
- margin-bottom:20rpx;
|
|
|
+
|
|
|
+ .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;
|
|
|
+ position: relative;
|
|
|
+ .sim_info_loding{
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ background-color: rgba(0,0,0,0.3);
|
|
|
+ border-radius: 20rpx;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+ .img{
|
|
|
+ width: 400rpx;
|
|
|
+ height: 350rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .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;
|
|
|
-
|
|
|
+
|
|
|
+ .tit {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 22rpx;
|
|
|
+ margin-right: 10rpx;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
- .submit-box{
|
|
|
- margin-top:20rpx;
|
|
|
+
|
|
|
+ .submit-box {
|
|
|
+ margin-top: 20rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
</style>
|