liudan 3 months ago
parent 8551738664
commit 1bf7bdecd4
  1. 35
      pages/goods_details/index.vue

@ -62,16 +62,23 @@
<text class="line" v-if="storeInfo.limit_type > 0 && storeInfo.min_qty > 1">|</text>
<text v-if="storeInfo.min_qty > 1">{{ $t(`起购`) }}{{ storeInfo.min_qty + storeInfo.unit_name }}</text>
</view>
<view class="label acea-row row-between-wrapper" style="color: #333333;font-size: 30rpx;">
下架时间{{formatterDate(storeInfo.down_time)}}
</view>
<view class="label acea-row row-between-wrapper" style="padding-bottom: 20rpx">
<view class="delete-line">{{ $t(`划线价`) }} : {{ $t(``) }}{{ storeInfo.ot_price || 0 }}</view>
<!-- <view class="delete-line">{{ $t(`划线价`) }} : {{ $t(``) }}{{ storeInfo.ot_price || 0 }}</view>
<view class="">
{{ $t(`库存`) }} : {{ storeInfo.stock || 0 }}
{{ $t(storeInfo.unit_name) || '' }}
</view>
<view class="">
</view> -->
<view style="color: #333333;font-size: 30rpx;">
{{ $t(`销量`) }} : {{ storeInfo.fsales || 0 }}
{{ $t(storeInfo.unit_name) || '' }}
</view>
<view style="color: #333333;font-size: 30rpx;">
{{ $t(`商品距下架还有`) }} : <text style="color:#E4884E">{{ timestampToDays(storeInfo.down_time) || 0 }}</text>
</view>
</view>
<view v-if="!is_money_level && storeInfo.vip_price && storeInfo.is_vip" class="svip acea-row row-between-wrapper">
<view class="">{{ $t(`开通“超级会员”立省`) }}{{ diff }}{{ $t(``) }}</view>
@ -693,6 +700,28 @@ export default {
this.currentPage = !this.currentPage;
},
methods: {
formatterDate(timestamp){
// Date
var date = new Date(timestamp*1000);
//
var year = date.getFullYear();
var month = ('0' + (date.getMonth() + 1)).slice(-2); // 0
var day = ('0' + date.getDate()).slice(-2);
// var hours = ('0' + date.getHours()).slice(-2);
// var minutes = ('0' + date.getMinutes()).slice(-2);
// var seconds = ('0' + date.getSeconds()).slice(-2);
// YYYY-MM-DD HH:MM:SS
var formattedDate = year + '-' + month + '-' + day;
return formattedDate
},
timestampToDays(timestamp) {
const targetDate = new Date().getTime(); // Unix Epoch (1970-01-01T00:00:00Z)
const startDate = new Date(timestamp*1000);
const diff = startDate - targetDate; // Difference in milliseconds
return Math.ceil(diff / (1000 * 60 * 60 * 24)); // Convert to days
},
//
moreNav() {
this.currentPage = !this.currentPage;

Loading…
Cancel
Save