123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <template>
- <view class="my-container">
- <cu-custom isBack="true" bgColor="#fff">
- <view slot="content" style="color: #FFFFFF">4G卡详情</view>
- </cu-custom>
- <view class="my-container" v-if="iotLinkFrom">
- <view class="cu-bar my-bg solid-bottom margin-top">
- <view class="action">
- <text class="cuIcon-title text-orange "></text> 卡片详情
- </view>
- <view class="action">
- <button class="cu-btn bg-green shadow" data-target="gridModal" @click="goPackagePage">购买套餐</button>
- </view>
- </view>
- <view class="cu-list menu card-menu margin-top myCard">
- <view class="cu-item">
- <view class="content">
- <text class="text-xl">{{ dtype }}IMEI</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ imei }}</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="text-xl">iccid</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ iotLinkFrom.iccid }}</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text>运营商</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ formatterType(iotLinkFrom.operators) }}</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text>卡状态</text>
- </view>
- <view class="action">
- <text class="cu-tag round bg-olive light">{{ iotLinkFrom.status }}</text>
- </view>
- </view>
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>激活时间</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.activeTime }}</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>生效时间</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.effectiveTime }}</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="cu-item">
- <view class="content">
- <text>过期时间</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ iotLinkFrom.expiredTime }}</text>
- </view>
- </view>
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>总流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.totalFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>已使用流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.usedFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>剩余流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.leftFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view v-if="iotLinkFrom.totalVoice">-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>总语音量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.totalVoice }}分钟</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>使用语音量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.usedVoice }}分钟</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text>剩余语音量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ iotLinkFrom.residualVoice }}分钟</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- </view>
- <view class="cu-bar my-bg margin-top">
- <view class="action">
- <text class="cuIcon-title text-orange "></text> 本卡套餐
- </view>
- </view>
- <view v-for="(item, index) in tableData" :key="index" class="cu-list menu margin-top">
- <view class="cu-item">
- <view class="content">
- <text class="">套餐名称</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ item.packageName }}</text>
- </view>
- </view>
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text class="">套餐总流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ item.totalFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text class="">已使用流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ item.usedFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="cu-item">-->
- <!-- <view class="content">-->
- <!-- <text class="">剩余流量</text>-->
- <!-- </view>-->
- <!-- <view class="action">-->
- <!-- <text class="text-lg">{{ item.leftFlow }}MB</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <view class="cu-item">
- <view class="content">
- <text class="">购买日期</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ formatterDate(item.payTime / 1000) }}</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="">过期时间</text>
- </view>
- <view class="action">
- <text class="text-lg">{{ formatterDate(item.expireTime / 1000) }}</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="">使用状态</text>
- </view>
- <view class="action">
- <text class="cu-tag round bg-green light">{{ formatterStatus(item.status) }}</text>
- </view>
- </view>
- </view>
- </view>
- <view v-else>
- <view class="uni-padding-wrap" style="margin-top: 150upx">
- <text class="word-btn-white text-white">暂无记录</text>
- <br/>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as Foundation from '@/ui-utils/Foundation'
- import * as API_IOT_LINK from './index.js'
- export default {
- name: 'index',
- data() {
- return {
- iotLinkFrom: null,
- tableData: [],
- imei: '',
- dtype: null
- }
- },
- onLoad(option) {
- const { imei, dtype } = option
- console.log('option==', option)
- this.imei = imei
- this.dtype = dtype
- this.API_getDetails(imei)
- },
- methods: {
- API_getDetails(imei) {
- const _this = this
- API_IOT_LINK.getDetailsByImei(imei).then(res => {
- if (res.success) {
- _this.iotLinkFrom = res.data
- if (res.data) {
- _this.tableData = JSON.parse(res.data.packageList)
- }
- } else {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 5000
- })
- }
- })
- },
- formatterType(value) {
- switch (value) {
- case 1:
- return '电信'
- case 2:
- return '移动'
- case 3:
- return '联通'
- case 4:
- return '聚合卡'
- default:
- return '未知'
- }
- },
- formatterDate(time) {
- return Foundation.unixToDate(time)
- },
- formatterStatus(value) {
- switch (value) {
- case 0:
- return '未生效'
- case 1:
- return '生效中'
- case 2:
- return '已失效'
- case 3:
- return '已过期'
- case 4:
- return '已退款'
- default:
- return '其他'
- }
- },
- goPackagePage() {
- uni.navigateTo({
- url: '/pages/log/iot/iot-package/index?operators=' + this.iotLinkFrom.operators + '&iccid=' + this.iotLinkFrom.iccid + '&dtype=' + this.dtype
- })
- }
- }
- }
- </script>
- <style scoped>
- .my-container {
- width: 100%;
- height: 100%;
- position: relative;
- background: linear-gradient(90deg, rgba(5, 96, 232, 1) 0%, rgba(100, 158, 245, 1) 100%);
- color: white;
- }
- .cu-item {
- background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #2cc9e5 100%);
- }
- .my-bg {
- background: linear-gradient(90deg, rgba(86, 17, 247, 0.5) 0%, #2cc9e5 100%);
- }
- .cu-list.menu>.cu-item.arrow:before {
- color: white;
- }
- </style>
|