|
@@ -1,39 +1,61 @@
|
|
<template>
|
|
<template>
|
|
<div class="introtow-layout">
|
|
<div class="introtow-layout">
|
|
- <div class="it-header it-txt">
|
|
|
|
- <p>ID:{{detail.snCode||detail.childName}}</p>
|
|
|
|
- <div class="capacity">
|
|
|
|
- <div class="c-line">
|
|
|
|
- <div class="active" :style="{width:getBar(detail.usedSpace,detail.totalSpace),background:getColor(detail.usedSpace,detail.totalSpace)}"></div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="it-header it-txt tc">
|
|
|
|
+ <div>
|
|
|
|
+ <p>{{ langAccount.sn}}{{detail.snCode||(detail.childName&&detail.childName.replace('4DKKPRO_',''))||'--'}}</p>
|
|
|
|
+ <div class="capacity">
|
|
<div class="c-dec">
|
|
<div class="c-dec">
|
|
- <span>{{detail.usedSpaceStr}} / {{detail.totalSpaceStr}} </span>
|
|
|
|
|
|
+ <span>{{langAccount.used}}{{detail.totalSpaceStr?(detail.usedSpaceStr+' / '+detail.totalSpaceStr):'--'}} </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="c-line">
|
|
|
|
+ <div class="active" :style="{width:getBar(detail.usedSpace,detail.totalSpace),background:getColor(detail.usedSpace,detail.totalSpace)}"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="c-detail">
|
|
|
|
+ <span
|
|
|
|
+ >{{ langAccount.space
|
|
|
|
+ }}{{ detail.spaceStr || "--" }} {{
|
|
|
|
+ langAccount.expire
|
|
|
|
+ }}{{ detail.spaceEndStr || "--" }}</span
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="btn" v-if="detail.spaceId" @click="toPay">{{langAccount.btntype }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="point-list it-txt">
|
|
<div class="point-list it-txt">
|
|
<div class="tab-list">
|
|
<div class="tab-list">
|
|
- <div :class="{'tabactive':cType==='mouth'}" @click="cType='mouth'">
|
|
|
|
|
|
+ <div :class="{'tabactive':cType==='month'}" @click="cType='month'">
|
|
<p>{{langPurchase.introduce.mounthly}}</p>
|
|
<p>{{langPurchase.introduce.mounthly}}</p>
|
|
<span>{{langPurchase.introduce.youhui}}</span>
|
|
<span>{{langPurchase.introduce.youhui}}</span>
|
|
</div>
|
|
</div>
|
|
<span class="v-line"></span>
|
|
<span class="v-line"></span>
|
|
|
|
+
|
|
|
|
+ <div :class="{'tabactive':cType==='_3mon'}" @click="cType='_3mon'">
|
|
|
|
+ <p>{{langPurchase.introduce._3month}}</p>
|
|
|
|
+ <span>{{langPurchase.introduce.youhui}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="v-line"></span>
|
|
|
|
+ <div :class="{'tabactive':cType==='half'}" @click="cType='half'">
|
|
|
|
+ <p>{{langPurchase.introduce.half}}</p>
|
|
|
|
+ <span>{{langPurchase.introduce.youhui}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="v-line"></span>
|
|
<div :class="{'tabactive':cType==='year'}" @click="cType='year'">
|
|
<div :class="{'tabactive':cType==='year'}" @click="cType='year'">
|
|
<p>{{langPurchase.introduce.year}}</p>
|
|
<p>{{langPurchase.introduce.year}}</p>
|
|
<span>{{langPurchase.introduce.zhe}}</span>
|
|
<span>{{langPurchase.introduce.zhe}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-scroll">
|
|
<div class="card-scroll">
|
|
- <div @click="toPay(item)" class="card-item" v-for="(item,i) in type" :key="i">
|
|
|
|
|
|
+ <div @click="fixBtn(item)" class="card-item" v-for="(item,i) in type" :key="i">
|
|
<div class="top-card">
|
|
<div class="top-card">
|
|
<img :src="language==='en'?`${$cdn}images/card-bg1-en.png`:`${$cdn}images/card-bg1.png`" alt="">
|
|
<img :src="language==='en'?`${$cdn}images/card-bg1-en.png`:`${$cdn}images/card-bg1.png`" alt="">
|
|
<div>
|
|
<div>
|
|
- <p>{{item.unit}}</p>
|
|
|
|
|
|
+ <p>{{item.unit}}{{langPurchase.introduce.taocan}}</p>
|
|
<p>{{langPurchase.introduce.buy}}</p>
|
|
<p>{{langPurchase.introduce.buy}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p>{{langPurchase.introduce.ctype[item.unit]}}</p>
|
|
<p>{{langPurchase.introduce.ctype[item.unit]}}</p>
|
|
- <p>{{country[detail.country]}}<span>{{item.price}}/</span>{{cType==='year'?langPurchase.introduce.nyear:langPurchase.introduce.nmounth}}
|
|
|
|
|
|
+ <p>{{country[detail.country]}}<span>{{detail.country===1?item.dollarPrice:item.price}}/</span>{{langPurchase.introduce.fixpre[cType]}}
|
|
<!-- <i>¥{{item.dollarPrice}}</i> -->
|
|
<!-- <i>¥{{item.dollarPrice}}</i> -->
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
@@ -47,11 +69,10 @@
|
|
</div>
|
|
</div>
|
|
<div class="hover-mask" @touchmove.prevent @click="payactive=!payactive" :class="{'hover-active':payactive}">
|
|
<div class="hover-mask" @touchmove.prevent @click="payactive=!payactive" :class="{'hover-active':payactive}">
|
|
<div class="h-con" @click.stop>
|
|
<div class="h-con" @click.stop>
|
|
- <p class="h-title">{{langPurchase.introduce.ipackage}}</p>
|
|
|
|
- <div class="point-card">
|
|
|
|
|
|
+ <p class="h-title">{{langPurchase.introduce['ipackage'+chargetype]}}</p>
|
|
|
|
+ <div class="point-card">
|
|
<div class="p-left">
|
|
<div class="p-left">
|
|
<p>{{langPurchase.introduce.ctype[item.unit]}}</p>
|
|
<p>{{langPurchase.introduce.ctype[item.unit]}}</p>
|
|
- <span class="p-tag">{{langPurchase.introduce.expiry}}: {{deadLine}}</span>
|
|
|
|
<p>{{langPurchase.introduce.keep}}</p>
|
|
<p>{{langPurchase.introduce.keep}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="p-right">
|
|
<div class="p-right">
|
|
@@ -64,11 +85,34 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <template v-if="chargetype==='renew'">
|
|
|
|
+ <div class="line"></div>
|
|
|
|
+ <ul class="renew">
|
|
|
|
+ <li :class="{'tag-active':tctype===item.typeid}" @click="tcClick(item)" v-for="(item,i) in tcdata" :key="i">
|
|
|
|
+ <i class="iconfont" :class="item.icon"></i>
|
|
|
|
+ <span>{{language==='en'?item.en : item.name}}</span>
|
|
|
|
+ <span class="s-right"> {{detail.country===1?`USD: ${item.dollarPrice}`:`¥:${item.price}`}}</span>
|
|
|
|
+ <img :src="`${$cdn}images/tag-icon.png`" />
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="line"></div>
|
|
|
|
+ <div class="dec-con">
|
|
|
|
+ <p>
|
|
|
|
+ <span class="p-tag">{{langPurchase.introduce.expiry}}: {{deadlineTime}}
|
|
|
|
+ <span v-if="chargetype!=='renew'&&delay>0">{{language==='en'?` (Package expiration: ${delay} days)`:`(延期:${delay}天)`}}</span>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="chargetype!=='renew'&&delay>0" class="p-tag">
|
|
|
|
+ {{language==='en'?`Current package has not expired yet. After detailed calculations, the days left from the current package are added as ${delay} days to the upgraded package.`
|
|
|
|
+ :`因原套餐未到期,经综合计算,新套餐延期${delay}天`}}
|
|
|
|
+ </span>
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
<div class="point-pay">
|
|
<div class="point-pay">
|
|
<div class="pp-left">
|
|
<div class="pp-left">
|
|
<span>{{langPurchase.introduce.amount}}</span><i>{{country[detail.country]}}</i>{{detail.country?item.dollarPrice:item.price}}
|
|
<span>{{langPurchase.introduce.amount}}</span><i>{{country[detail.country]}}</i>{{detail.country?item.dollarPrice:item.price}}
|
|
</div>
|
|
</div>
|
|
- <div class="btn" @click="pay">{{langPurchase.introduce.toPay}}</div>
|
|
|
|
|
|
+ <div class="btn" @click="goPay">{{langPurchase.introduce.toPay}}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -77,7 +121,14 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {mapState} from 'vuex'
|
|
import {mapState} from 'vuex'
|
|
-
|
|
|
|
|
|
+import { formatDate } from '@/util'
|
|
|
|
+const ONEDAY = 86400000
|
|
|
|
+let qixianType = {
|
|
|
|
+ month: 1,
|
|
|
|
+ year: 2,
|
|
|
|
+ _3mon: 3,
|
|
|
|
+ half: 4
|
|
|
|
+}
|
|
export default {
|
|
export default {
|
|
|
|
|
|
computed: {
|
|
computed: {
|
|
@@ -85,8 +136,12 @@ export default {
|
|
token: state => state.user.token,
|
|
token: state => state.user.token,
|
|
language: state => state.language.current,
|
|
language: state => state.language.current,
|
|
langToast: state => state.language.home.toast,
|
|
langToast: state => state.language.home.toast,
|
|
|
|
+ langAccount: state => state.language.home.manage.account,
|
|
langPurchase: state => state.language.home.purchase
|
|
langPurchase: state => state.language.home.purchase
|
|
- })
|
|
|
|
|
|
+ }),
|
|
|
|
+ deadlineTime () {
|
|
|
|
+ return formatDate(this.delay * ONEDAY + this.deadLine)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
let country = {
|
|
let country = {
|
|
@@ -108,24 +163,52 @@ export default {
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
|
|
- let ctype = {
|
|
|
|
- '10GB': '可存放约10个场景',
|
|
|
|
- '50GB': '可存放约50个场景',
|
|
|
|
- '50G': '可存放约50个场景',
|
|
|
|
- '200GB': '可存放约200个场景',
|
|
|
|
- '1TB': '可存放约1000个场景'
|
|
|
|
- }
|
|
|
|
|
|
+ let tcdata = [
|
|
|
|
+ {
|
|
|
|
+ name: '1个月',
|
|
|
|
+ en: '1 mon.',
|
|
|
|
+ icon: 'icon-mouth',
|
|
|
|
+ price: '2600',
|
|
|
|
+ typeid: 'month'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '3个月',
|
|
|
|
+ en: '3 mon.',
|
|
|
|
+ icon: 'icon-3mouth',
|
|
|
|
+ price: '26000',
|
|
|
|
+ typeid: '_3mon'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '6个月',
|
|
|
|
+ en: '6 mon.',
|
|
|
|
+ icon: 'icon-halfyear',
|
|
|
|
+ price: '26000',
|
|
|
|
+ typeid: 'half'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '1年',
|
|
|
|
+ en: '1 year',
|
|
|
|
+ icon: 'icon-year',
|
|
|
|
+ price: '26000',
|
|
|
|
+ typeid: 'year'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+
|
|
return {
|
|
return {
|
|
country,
|
|
country,
|
|
- ctype,
|
|
|
|
|
|
+ tctype: 'month',
|
|
payactive: false,
|
|
payactive: false,
|
|
|
|
+ chargetype: 'renew',
|
|
detail: '',
|
|
detail: '',
|
|
|
|
+ tcdata,
|
|
type,
|
|
type,
|
|
|
|
+ delay: 0,
|
|
currentId: '',
|
|
currentId: '',
|
|
orderSn: '',
|
|
orderSn: '',
|
|
item: '',
|
|
item: '',
|
|
- cType: 'mouth',
|
|
|
|
- deadLine: ''
|
|
|
|
|
|
+ cType: 'month',
|
|
|
|
+ deadLine: '',
|
|
|
|
+ paramsNext: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
@@ -146,21 +229,87 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- toPay (item) {
|
|
|
|
|
|
+ fixBtn (item) {
|
|
|
|
+ let totalSpace = this.detail.totalSpace
|
|
|
|
+ if (item.unitSize > totalSpace) {
|
|
|
|
+ this.itemHandle(item)
|
|
|
|
+ } else if (item.unitSize === totalSpace) {
|
|
|
|
+ this.toPay()
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.show('warn', this.langToast[48], '', this.langToast[49])
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ itemHandle (item) {
|
|
|
|
+ this.chargetype = 'recharge'
|
|
this.payactive = !this.payactive
|
|
this.payactive = !this.payactive
|
|
this.item = item
|
|
this.item = item
|
|
|
|
+ this.pay()
|
|
|
|
+ },
|
|
|
|
+ tcClick (item) {
|
|
|
|
+ this.item = item
|
|
|
|
+ this.tctype = item.typeid
|
|
|
|
+ this.deadLine = item.deadLine
|
|
|
|
+ },
|
|
|
|
+ async toPay () {
|
|
|
|
+ let sub = ''
|
|
|
|
+ this.type.forEach(item => {
|
|
|
|
+ if (this.detail.totalSpace === item.unitSize) {
|
|
|
|
+ sub = item
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.chargetype = 'renew'
|
|
|
|
+ this.tctype = this.cType
|
|
|
|
+ this.payactive = !this.payactive
|
|
|
|
+ this.item = sub
|
|
|
|
+
|
|
|
|
+ let m = await this.getPrice(1)
|
|
|
|
+ let y = await this.getPrice(2)
|
|
|
|
+ let _3m = await this.getPrice(3)
|
|
|
|
+ let half = await this.getPrice(4)
|
|
|
|
+
|
|
|
|
+ this.tcdata[0] = Object.assign(this.tcdata[0], m['ret'])
|
|
|
|
+ this.tcdata[1] = Object.assign(this.tcdata[1], _3m['ret'])
|
|
|
|
+ this.tcdata[2] = Object.assign(this.tcdata[2], half['ret'])
|
|
|
|
+ this.tcdata[3] = Object.assign(this.tcdata[3], y['ret'])
|
|
|
|
+
|
|
|
|
+ this.tcdata[0]['deadLine'] = m['deadLine']
|
|
|
|
+ this.tcdata[1]['deadLine'] = _3m['deadLine']
|
|
|
|
+ this.tcdata[2]['deadLine'] = half['deadLine']
|
|
|
|
+ this.tcdata[3]['deadLine'] = y['deadLine']
|
|
|
|
+
|
|
|
|
+ let ret = 'month'
|
|
|
|
+
|
|
|
|
+ switch (this.cType) {
|
|
|
|
+ case 'month':
|
|
|
|
+ ret = m['deadLine']
|
|
|
|
+ break
|
|
|
|
+ case 'year':
|
|
|
|
+ ret = y['deadLine']
|
|
|
|
+ break
|
|
|
|
+ case '_3mon':
|
|
|
|
+ ret = _3m['deadLine']
|
|
|
|
+ break
|
|
|
|
+ case 'half':
|
|
|
|
+ ret = half['deadLine']
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ ret = m['deadLine']
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ this.deadLine = ret
|
|
|
|
+ this.pay()
|
|
},
|
|
},
|
|
async pay () {
|
|
async pay () {
|
|
let {unit, skuSn} = this.item
|
|
let {unit, skuSn} = this.item
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
cameraId: this.detail.id,
|
|
cameraId: this.detail.id,
|
|
- payType: 0,
|
|
|
|
|
|
+ payType: this.detail.country ? 2 : 1,
|
|
unit: unit.substr(1),
|
|
unit: unit.substr(1),
|
|
unitSize: 1,
|
|
unitSize: 1,
|
|
years: 1,
|
|
years: 1,
|
|
skuSn,
|
|
skuSn,
|
|
- abroad: this.language === 'en' ? 1 : 0
|
|
|
|
|
|
+ abroad: this.detail.country
|
|
}
|
|
}
|
|
|
|
|
|
let res = await this.$http
|
|
let res = await this.$http
|
|
@@ -174,31 +323,50 @@ export default {
|
|
if (data.code !== 0) {
|
|
if (data.code !== 0) {
|
|
return this.$toast.show('error', this.langToast['1'])
|
|
return this.$toast.show('error', this.langToast['1'])
|
|
}
|
|
}
|
|
- let {id, orderSn, amount} = data.data
|
|
|
|
|
|
+ let {id, orderSn, amount, delay} = data.data
|
|
|
|
+
|
|
|
|
+ this.delay = delay
|
|
|
|
|
|
this.currentId = id
|
|
this.currentId = id
|
|
this.orderSn = orderSn
|
|
this.orderSn = orderSn
|
|
- this.goPay({id, orderSn, amount})
|
|
|
|
|
|
+ this.paramsNext = {
|
|
|
|
+ id,
|
|
|
|
+ orderSn,
|
|
|
|
+ amount,
|
|
|
|
+ spaceId: this.chargetype === 'recharge' ? null : this.detail.spaceId
|
|
|
|
+ }
|
|
|
|
+ console.log(this.chargetype === 'recharge' ? null : this.detail.spaceId)
|
|
|
|
+ // if (this.chargetype === 'recharge') {
|
|
|
|
+ // this.goPay({id, orderSn, amount})
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
|
|
|
|
- goPay (item) {
|
|
|
|
|
|
+ goPay () {
|
|
|
|
+ let item = this.paramsNext
|
|
this.$store.commit('ORDERINFO', {
|
|
this.$store.commit('ORDERINFO', {
|
|
orderSn: item.orderSn,
|
|
orderSn: item.orderSn,
|
|
price: item.amount || 0,
|
|
price: item.amount || 0,
|
|
- orderType: 2
|
|
|
|
|
|
+ orderType: 2,
|
|
|
|
+ spaceId: item.spaceId || null,
|
|
|
|
+ country: this.detail.country
|
|
})
|
|
})
|
|
|
|
+ let query = {
|
|
|
|
+ country: this.detail.country
|
|
|
|
+ }
|
|
|
|
+ item.spaceId && (query['spaceId'] = item.spaceId || null)
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: 'payselect',
|
|
name: 'payselect',
|
|
params: {
|
|
params: {
|
|
orderId: item.id || 1,
|
|
orderId: item.id || 1,
|
|
orderType: 2
|
|
orderType: 2
|
|
},
|
|
},
|
|
- query: {
|
|
|
|
- country: this.detail.country
|
|
|
|
- }
|
|
|
|
|
|
+ query
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getBar (a, b) {
|
|
getBar (a, b) {
|
|
|
|
+ if (a === 0) {
|
|
|
|
+ return 0
|
|
|
|
+ }
|
|
let temp = (a / b) * 100
|
|
let temp = (a / b) * 100
|
|
if (temp < 1) {
|
|
if (temp < 1) {
|
|
return '1%'
|
|
return '1%'
|
|
@@ -220,11 +388,11 @@ export default {
|
|
}
|
|
}
|
|
return color
|
|
return color
|
|
},
|
|
},
|
|
- async getPrice () {
|
|
|
|
|
|
+ async getPrice (cType = '') {
|
|
let {id} = this.$route.params
|
|
let {id} = this.$route.params
|
|
let params = {
|
|
let params = {
|
|
childName: id || '',
|
|
childName: id || '',
|
|
- dateType: this.cType === 'year' ? 2 : 1
|
|
|
|
|
|
+ dateType: cType || qixianType[this.cType]
|
|
}
|
|
}
|
|
|
|
|
|
let res = await this.$http
|
|
let res = await this.$http
|
|
@@ -237,8 +405,19 @@ export default {
|
|
if (data.code !== 0) {
|
|
if (data.code !== 0) {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- this.type = data.data.skuList
|
|
|
|
|
|
+ if (!cType) {
|
|
|
|
+ this.type = data.data.skuList || []
|
|
|
|
+ }
|
|
|
|
+ let tempList = data.data.skuList || []
|
|
|
|
+
|
|
this.deadLine = data.data.deadLine
|
|
this.deadLine = data.data.deadLine
|
|
|
|
+ let ret = ''
|
|
|
|
+ tempList.forEach(item => {
|
|
|
|
+ if (item.unit === this.item.unit) {
|
|
|
|
+ ret = item
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return {ret, deadLine: data.data.deadLine}
|
|
},
|
|
},
|
|
async getDetail () {
|
|
async getDetail () {
|
|
let {id} = this.$route.params
|
|
let {id} = this.$route.params
|