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