|
|
@ -2,64 +2,77 @@ |
|
|
|
<view class="main"> |
|
|
|
<!-- nav --> |
|
|
|
<view class="nav-head"> |
|
|
|
<view class="navItem" @click="pageState = 'product'" :class="{ select: pageState === 'product' }"> |
|
|
|
<view class="navItem" @click="pageState = 'product',getInfo('product')" |
|
|
|
:class="{ select: pageState === 'product' }"> |
|
|
|
{{ i18n.Product }} |
|
|
|
</view> |
|
|
|
<view class="navItem" @click="pageState = 'pending'" :class="{ select: pageState === 'pending' }"> |
|
|
|
<view class="navItem" @click="pageState = 'pending',getInfo('pending')" |
|
|
|
:class="{ select: pageState === 'pending' }"> |
|
|
|
{{ i18n.Pending }} |
|
|
|
</view> |
|
|
|
<view class="navItem" @click="pageState = 'complete'" :class="{ select: pageState === 'complete' }"> |
|
|
|
<view class="navItem" @click="pageState = 'complete',getInfo('complete')" |
|
|
|
:class="{ select: pageState === 'complete' }"> |
|
|
|
{{ i18n.Complete }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- Product 产品列表 --> |
|
|
|
<view class="cardList"> |
|
|
|
<view class="card" v-for="(item, index) in 10" :key="index" @click="gotoDetails(index)"> |
|
|
|
<view class="card" v-for="(item, index) in info" :key="index" @click="gotoDetails(item,index)" |
|
|
|
v-if="pageState === 'product'"> |
|
|
|
<!-- 卡片条件渲染 --> |
|
|
|
<!-- product --> |
|
|
|
<card-header v-if="pageState === 'product'" :iconName="'../../static/maskets/bye.png'" |
|
|
|
:title="'BTC(Bitcoin)'" :rightName="i18n.Subscribe" :hasBtn="true" :btnColor="'#00E8A2'"> |
|
|
|
<card-header v-if="pageState === 'product'" :iconName="baseURL+'/coins/'+item.coinCode+'.png'" |
|
|
|
:title="item.fullName" |
|
|
|
:rightName="item.status=='open'?'Subscribe':item.status=='close'?'Ended':'Coming soon'" |
|
|
|
:hasBtn="true" :btnColor="item.status=='open'?'#00E8A2':item.status=='close'?'#A1A0A8':'#F2FE8D'"> |
|
|
|
</card-header> |
|
|
|
<view class="dataBody" v-if="pageState === 'product'"> |
|
|
|
<key-value-row :keyName="i18n.STLTotalCirculation" :value="'23989'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.PrivateSalePrice" :value="'284145.61'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.ICOTime" :value="'2022/08/06-2022/08/31'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.STLTotalCirculation" :value="item.issueAmount"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.PrivateSalePrice" :value="item.initalPrice+item.coinCode"> |
|
|
|
</key-value-row> |
|
|
|
<key-value-row :keyName="i18n.ICOTime" :value="item.timestr"></key-value-row> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="card" v-for="(item, index) in userInfoObj" :key="index" v-if="pageState === 'pending'"> |
|
|
|
<!-- pending --> |
|
|
|
<card-header v-if="pageState === 'pending'" :iconName="'../../static/maskets/bye.png'" |
|
|
|
:title="'973430980989323445'" :rightName="'Pending'" fontColor="#00E8A2"> |
|
|
|
<card-header v-if="pageState === 'pending'" :iconName="baseURL+'/coins/'+item.coinSymbol+'.png'" |
|
|
|
:title="item.orderNo" :rightName="item.status" :fontColor="item.status=='undone'?'#A1A0A8':item.status=='cancel'?'#F4506A':'#00E8A2'"> |
|
|
|
</card-header> |
|
|
|
<view class="dataBody" v-if="pageState === 'pending'"> |
|
|
|
<key-value-row :keyName="i18n.Price" :value="'284145.61'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Quantity" :value="'1000'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.USDT" :value="'3166.61'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Time" :value="'2022/08/06 14:51'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Price" :value="item.pendingPrice"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Quantity" :value="item.pendingAmount"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.USDT" :value="parseInt(item.usdtPrice,16)"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Time" :value="item.addTimeStr"></key-value-row> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="card" v-for="(item, index) in userInfoObj" :key="index" v-if="pageState === 'complete'"> |
|
|
|
<!-- complete --> |
|
|
|
<card-header v-if="pageState === 'complete'" :iconName="'../../static/maskets/bye.png'" |
|
|
|
:title="'973430980989323445'" :rightName="'complete'" fontColor="#00E8A2"> |
|
|
|
<card-header v-if="pageState === 'complete'" :iconName="baseURL+'/coins/'+item.coinSymbol+'.png'" |
|
|
|
:title="item.orderNo" :rightName="item.status" :fontColor="item.status=='undone'?'#A1A0A8':item.status=='cancel'?'#F4506A':'#00E8A2'"> |
|
|
|
</card-header> |
|
|
|
<view class="dataBody" v-if="pageState === 'complete'"> |
|
|
|
<key-value-row :keyName="i18n.Price" :value="'284145.61'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Quantity" :value="'1000'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.ConfirmAmount" :value="'999'" :leftColor="'#F2FE8D'" |
|
|
|
<key-value-row :keyName="i18n.Price" :value="item.pendingPrice"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Quantity" :value="item.pendingAmount"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.ConfirmAmount" :value="item.tradeAmount" :leftColor="'#F2FE8D'" |
|
|
|
:rightColor="'#F2FE8D'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.USDT" :value="'3166.61'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.CheckTheNumberoOfUSDT" :value="'2000'" :leftColor="'#F2FE8D'" |
|
|
|
<key-value-row :keyName="i18n.USDT" :value="parseInt(item.usdtPrice,16)"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.CheckTheNumberoOfUSDT" :value="item.realAmount" :leftColor="'#F2FE8D'" |
|
|
|
:rightColor="'#F2FE8D'"> |
|
|
|
</key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Time" :value="'2022/08/06 14:51'"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.Time" :value="item.addTimeStr"></key-value-row> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-empty :text="i18n.Dataisempty" mode="data" v-if="info.length==0&&pageState=='product'"></u-empty> |
|
|
|
<u-loadmore :status="loadStatus" :loading-text="loadingText" :loadmore-text="loadmoreText" |
|
|
|
:nomore-text="nomoreText" v-if="info.length&&pageState=='product'" height="80" /> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 申购记录的为空提示 --> |
|
|
|
<u-empty :text="i18n.Dataisempty" mode="data" v-if="userInfoObj.length==0" v-show="pageState=='undone'||pageState=='complete'"></u-empty> |
|
|
|
<u-loadmore :status="loadStatus2" :loading-text="loadingText2" :loadmore-text="loadmoreText2" |
|
|
|
:nomore-text="nomoreText2" v-if="userInfoObj.length" height="80" /> |
|
|
|
|
|
|
|
<!-- tabBar --> |
|
|
|
<tab-bar :selectActive="4"></tab-bar> |
|
|
@ -67,43 +80,143 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import CardHeader from '../../components/cardHeader/cardHeader.vue'; |
|
|
|
import KeyValueRow from '../../components/KeyValueRow/KeyValueRow.vue'; |
|
|
|
export default { |
|
|
|
components: { KeyValueRow, CardHeader }, |
|
|
|
import CardHeader from '../../components/cardHeader/cardHeader.vue'; |
|
|
|
import KeyValueRow from '../../components/KeyValueRow/KeyValueRow.vue'; |
|
|
|
import api from '@/utils/api' |
|
|
|
import constant from '@/utils/constant.js'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
KeyValueRow, |
|
|
|
CardHeader |
|
|
|
}, |
|
|
|
name: 'subscription', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
baseURL: '', |
|
|
|
userInfoObj: [], |
|
|
|
isLoadMore: false, //是否加载中 |
|
|
|
loadStatus: 'loadmore', |
|
|
|
loadingText: this.$t("login").toload, |
|
|
|
loadmoreText: this.$t("login").pullup, |
|
|
|
nomoreText: this.$t("login").Nomore, |
|
|
|
info: [], |
|
|
|
pageState: 'product', // 当前页签状态 |
|
|
|
} |
|
|
|
form: { |
|
|
|
pageNumber: 1, |
|
|
|
pageSize: 20, |
|
|
|
status: '', |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
// 用户申购记录的 |
|
|
|
isLoadMore2: false, //是否加载中 |
|
|
|
loadStatus2: 'loadmore', |
|
|
|
loadingText2: this.$t("login").toload, |
|
|
|
loadmoreText2: this.$t("login").pullup, |
|
|
|
nomoreText2: this.$t("login").Nomore, |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
onShow() { |
|
|
|
|
|
|
|
}, |
|
|
|
onHide() { |
|
|
|
this.baseURL = constant.BASE_URL |
|
|
|
this.getGoods(); |
|
|
|
}, |
|
|
|
onHide() {}, |
|
|
|
computed: { |
|
|
|
i18n() { |
|
|
|
return this.$t('subscription') |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
gotoDetails(index) { |
|
|
|
//看是获取用户申购记录还是申购列表 product 是获取申购列表 其它两个是获取记录 |
|
|
|
getInfo(e) { |
|
|
|
this.info=[]; |
|
|
|
this.userInfoObj=[] |
|
|
|
if (e == 'product') { |
|
|
|
this.getGoods() |
|
|
|
} |
|
|
|
if (e == 'pending') { |
|
|
|
this.form.status = 'undone' |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
if (e == 'complete') { |
|
|
|
this.form.status = 'complete' |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
}, |
|
|
|
//用户申购记录 |
|
|
|
getList() { |
|
|
|
this.isLoadMore2 = true |
|
|
|
api.subscriptionRecord(this.form).then(res => { |
|
|
|
if (res.content.length) { |
|
|
|
if (this.form.pageNumber > 1) { |
|
|
|
this.userInfoObj = this.userInfoObj.concat(res.content) |
|
|
|
for (var i = 0; i < this.userInfoObj.length; i++) { |
|
|
|
if (this.userInfoObj[i].addTime) { |
|
|
|
this.userInfoObj[i].timestr = this.$index.formatyymmddhhmmss(this.userInfoObj[ |
|
|
|
i].addTime) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.userInfoObj = res.content |
|
|
|
for (var i = 0; i < this.userInfoObj.length; i++) { |
|
|
|
if (this.userInfoObj[i].addTime) { |
|
|
|
this.userInfoObj[i].timestr = this.$index.formatyymmddhhmmss(this.userInfoObj[ |
|
|
|
i].addTime) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.userInfoObj.length >= Number(res.totalElements)) { // 判断接口返回数据量小于请求数据量,则表示此为最后一页 |
|
|
|
this.isLoadMore2 = true |
|
|
|
this.loadStatus2 = 'nomore' |
|
|
|
} else { |
|
|
|
this.isLoadMore2 = false |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.isLoadMore2 = true |
|
|
|
this.loadStatus2 = 'nomore' |
|
|
|
this.userInfoObj = [] |
|
|
|
} |
|
|
|
this.$forceUpdate() |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//申购币列表 |
|
|
|
getGoods() { |
|
|
|
api.subscriptionList().then(res => { |
|
|
|
this.info = res; |
|
|
|
this.isLoadMore = true |
|
|
|
this.loadStatus = 'nomore' |
|
|
|
for (var i = 0; i < this.info.length; i++) { |
|
|
|
if (this.info[i].startDate) { |
|
|
|
this.info[i].timestr = this.$index.formatyymmddhhmmss(this.info[ |
|
|
|
i].startDate) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
gotoDetails(i, index) { |
|
|
|
if (this.pageState !== 'product') return |
|
|
|
if (i.status == 'close') { |
|
|
|
uni.$u.toast(this.$t("subscription").Subcompleted) |
|
|
|
return; |
|
|
|
} |
|
|
|
if (i.status == 'unstart') { |
|
|
|
uni.$u.toast(this.$t("subscription").Substarted) |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/subscription/details?id=${index}` |
|
|
|
url: `/pages/subscription/details?id=${i.coinCode}` |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.main { |
|
|
|
/deep/ .cardHeader .button { |
|
|
|
width: 160rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.main { |
|
|
|
padding-bottom: 198rpx; // 避免底部TabBar盖住内容 |
|
|
|
|
|
|
|
.nav-head { |
|
|
@ -160,5 +273,5 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|