Browse Source

详情页优化

master
wanghongjun 2 years ago
parent
commit
59fd4a76e1
  1. 35
      pages/goods/detail.vue

35
pages/goods/detail.vue

@ -105,7 +105,7 @@
</view> </view>
<view class="gdic"> <view class="gdic">
<text class="gdic-tit">标的数量</text> <text class="gdic-tit">标的数量</text>
<text class="gdic-txt">{{goods.goods_ownership_str}}</text> <text class="gdic-txt">{{new_total}}</text>
</view> </view>
<view class="gdic"> <view class="gdic">
<text class="gdic-tit">店铺详情</text> <text class="gdic-tit">店铺详情</text>
@ -113,7 +113,7 @@
</view> </view>
<view class="gdic"> <view class="gdic">
<text class="gdic-tit">渠道机构</text> <text class="gdic-tit">渠道机构</text>
<text class="gdic-txt">{{goods.copyrightOwner}}</text> <text class="gdic-txt">{{goods.source[0].source_data.copyrightOwner}}</text>
</view> </view>
</view> </view>
<!-- 资源信息 --> <!-- 资源信息 -->
@ -134,6 +134,18 @@
<text class="gdic-tit">资源编码</text> <text class="gdic-tit">资源编码</text>
<text class="gdic-txt">{{item.sourceIdentify}}</text> <text class="gdic-txt">{{item.sourceIdentify}}</text>
</view> </view>
<view class="gdic">
<text class="gdic-tit">大小</text>
<text class="gdic-txt">{{item.source_data.metadataFileSize}}</text>
</view>
<view class="gdic">
<text class="gdic-tit">格式</text>
<text class="gdic-txt">{{item.source_data.metadataFileFormat}}</text>
</view>
<view class="gdic">
<text class="gdic-tit">时间</text>
<text class="gdic-txt">{{item.source_data.releaseTime}}</text>
</view>
</view> </view>
</view> </view>
@ -228,7 +240,8 @@
talprice_show: false, // talprice_show: false, //
purchase_show: false, // purchase_show: false, //
shopyear_num: '', // shopyear_num: '', //
shopcart_str: '加入购物车' shopcart_str: '加入购物车',
new_total: 0, //
} }
}, },
@ -266,6 +279,7 @@
let sodata ={goods_islicode:app.gislicode} let sodata ={goods_islicode:app.gislicode}
GoodsApi.soglist(sodata).then(res=>{ GoodsApi.soglist(sodata).then(res=>{
app.goods = res.data.data[0] app.goods = res.data.data[0]
app.new_total = res.data.total
let imgitem = {"imgurl":app.goods.goods_images} let imgitem = {"imgurl":app.goods.goods_images}
app.gdimgs.push(imgitem) app.gdimgs.push(imgitem)
// //
@ -293,10 +307,25 @@
if (app.goods.goods_entrust == '1') { if (app.goods.goods_entrust == '1') {
app.shopyear_show = false app.shopyear_show = false
} }
app.goods.source.forEach(item => {
item.source_data = JSON.parse(item.source_data)
item.source_data.metadataFileSize = app.FileSize(item.source_data.metadataFileSize)
item.source_data.releaseTime = item.source_data.releaseTime.split(" ")[0]
})
console.log(app.goods.source)
resolve(res) resolve(res)
}).catch(reject); }).catch(reject);
}) })
}, },
FileSize(data) {
if (data === 0) {
return "0 B";
}
var k = 1024;
var sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
i = Math.floor(Math.log(data) / Math.log(k));
return (data / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
},
// //
goteshop(){ goteshop(){

Loading…
Cancel
Save