uniapp 时间戳转换
parent
ad21968346
commit
d6ea232b81
|
@ -28,14 +28,14 @@
|
||||||
<view class="up" @tap="goEquity">
|
<view class="up" @tap="goEquity">
|
||||||
<image style="width: ;" src="@/static/images/shop/vip_oneStar.png" mode=""></image>
|
<image style="width: ;" src="@/static/images/shop/vip_oneStar.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<text>会员等级1级</text>
|
<text>会员等级{{vipData.findIndex((item) => item == vip.grade) +1}}级</text>
|
||||||
<view class="button" @tap="goEquity">查看权益</view>
|
<view class="button" @tap="goEquity">查看权益</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right" v-else>
|
<view class="right" v-else>
|
||||||
<view class="up" @tap="goEquity">
|
<view class="up" @tap="goEquity">
|
||||||
<image style="width: ;" src="@/static/images/shop/vip_oneStar.png" mode=""></image>
|
<image style="width: ;" src="@/static/images/shop/vip_oneStar.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<text>会员等级0级</text>
|
<text>会员等级{{vipData.findIndex((item) => item == vip.grade) +1}}级</text>
|
||||||
<view class="button" @tap="goEquity">申请会员</view>
|
<view class="button" @tap="goEquity">申请会员</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
bastInfo: '',
|
bastInfo: '',
|
||||||
fastInfo: '',
|
fastInfo: '',
|
||||||
fastList: [],
|
fastList: [],
|
||||||
text: '尊敬的业主:接环卫所通知,近期将对小区进行大扫除,请大家做好准备',
|
text: '暂无公告',
|
||||||
firstInfo: '',
|
firstInfo: '',
|
||||||
salesInfo: '',
|
salesInfo: '',
|
||||||
indicatorDots: false,
|
indicatorDots: false,
|
||||||
|
@ -286,7 +286,7 @@
|
||||||
lineColor: 'red',
|
lineColor: 'red',
|
||||||
lineStyle: {}, // 下划线位置--动态甲酸
|
lineStyle: {}, // 下划线位置--动态甲酸
|
||||||
listActive: 0, // 当前选中项
|
listActive: 0, // 当前选中项
|
||||||
|
vipData:['普通会员','中级会员','高级会员'],
|
||||||
duration: 0.2 // 下划线动画时长
|
duration: 0.2 // 下划线动画时长
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="item-text">
|
<view class="item-text">
|
||||||
<text>充值档次:{{item.grade}}</text>
|
<text>充值档次:{{item.grade}}</text>
|
||||||
<text>日期:{{item.stringCreateTime}}</text>
|
<text>日期:{{$util.timestampToTime(item.stringCreateTime)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-empty v-show="!memberData.length" text="暂无数据" mode="list"></u-empty>
|
<u-empty v-show="!memberData.length" text="暂无数据" mode="list"></u-empty>
|
||||||
|
|
|
@ -15,6 +15,9 @@ import {
|
||||||
setVisit,
|
setVisit,
|
||||||
getUserInfo
|
getUserInfo
|
||||||
} from '@/api/user.js'
|
} from '@/api/user.js'
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
@ -23,11 +26,11 @@ export default {
|
||||||
userInfo: {}
|
userInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: mapGetters(['tenantId']),
|
||||||
mounted(){
|
mounted(){
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
this.userInfo = res.data
|
this.userInfo = res.data
|
||||||
console.log(res.data)
|
getTenant(this.tenantId).then(res => {
|
||||||
getTenant(153).then(res => {
|
|
||||||
this.tenant = res.data
|
this.tenant = res.data
|
||||||
this.text = res.data.notice
|
this.text = res.data.notice
|
||||||
})
|
})
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
<text>{{item.nickname}}</text>
|
<text>{{item.nickname}}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="extra">
|
<text class="extra">
|
||||||
{{ timestampToTime(item.payTime) }}
|
{{ $util.timestampToTime(item.payTime) }}
|
||||||
<view>{{ item.grade }}</view>
|
<view>{{ item.grade }}</view>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
@ -152,20 +152,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
timestampToTime(timestamp) {
|
// timestampToTime(timestamp) {
|
||||||
// 时间戳为10位需*1000,时间戳为13位不需乘1000
|
// // 时间戳为10位需*1000,时间戳为13位不需乘1000
|
||||||
var date = new Date(timestamp);
|
// var date = new Date(timestamp);
|
||||||
var Y = date.getFullYear() + "-";
|
// var Y = date.getFullYear() + "-";
|
||||||
var M =
|
// var M =
|
||||||
(date.getMonth() + 1 < 10
|
// (date.getMonth() + 1 < 10
|
||||||
? "0" + (date.getMonth() + 1)
|
// ? "0" + (date.getMonth() + 1)
|
||||||
: date.getMonth() + 1) + "-";
|
// : date.getMonth() + 1) + "-";
|
||||||
var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
|
// var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
|
||||||
var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
|
// var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
|
||||||
var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
|
// var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
|
||||||
var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
|
// var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
|
||||||
return Y + M + D + h + m + s;
|
// return Y + M + D + h + m + s;
|
||||||
},
|
// },
|
||||||
selectClick(value) {
|
selectClick(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
this.active = value.id
|
this.active = value.id
|
||||||
|
|
|
@ -8,6 +8,20 @@ import {
|
||||||
pathToBase64
|
pathToBase64
|
||||||
} from '@/plugin/image-tools/index.js';
|
} from '@/plugin/image-tools/index.js';
|
||||||
export default {
|
export default {
|
||||||
|
timestampToTime(timestamp) {
|
||||||
|
// 时间戳为10位需*1000,时间戳为13位不需乘1000
|
||||||
|
var date = new Date(timestamp);
|
||||||
|
var Y = date.getFullYear() + "-";
|
||||||
|
var M =
|
||||||
|
(date.getMonth() + 1 < 10
|
||||||
|
? "0" + (date.getMonth() + 1)
|
||||||
|
: date.getMonth() + 1) + "-";
|
||||||
|
var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
|
||||||
|
var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
|
||||||
|
var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
|
||||||
|
var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
|
||||||
|
return Y + M + D + h + m + s;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* opt object | string
|
* opt object | string
|
||||||
* to_url object | string
|
* to_url object | string
|
||||||
|
|
Loading…
Reference in New Issue