Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
ba59046966
4 changed files with 8 additions and 8 deletions
  1. 2
      app.js
  2. 6
      pages/formate.wxs
  3. 4
      pages/moment/index.wxs
  4. 4
      pages/moment/moment-item/index.wxml

2
app.js

@ -2,7 +2,7 @@
const tdsdk = require('./libs/tdweapp.js')
App({
//----------------------------------------------globalData--------------------------------------
evn: 1,//0:开发环境,1:测试环境,2:生产环境
evn: 0,//0:开发环境,1:测试环境,2:生产环境
tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'],
agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'],
version: 152,

6
pages/formate.wxs

@ -57,14 +57,14 @@ var numberUtil = {
return ''
},
formatePrice: function (value, kg) {
if (value || value == 0) {
if (value || value !== 0) {
if(kg){
return (parseFloat(value)).toFixed(3)
} else {
return (parseFloat(value) * 1000).toFixed(0)
}
}
return ''
return '- -'
},
formatePrice2: function (value, kg) {
if (value || value == 0) {
@ -74,7 +74,7 @@ var numberUtil = {
return (parseFloat(value) * 1000).toFixed(1) + '元/吨'
}
}
return ''
return '- -'
},
formateDrice: function (value) {
if (value || value == 0) {

4
pages/moment/index.wxs

@ -34,7 +34,7 @@ function colorText(price) {
if(price > 0){
return 'text-red'
}
if(price > 0){
if(price < 0){
return 'text-green'
}
}
@ -46,7 +46,7 @@ function floatImage(price) {
if(price > 0){
return '/assets/image/icon-up.png'
}
if(price > 0){
if(price < 0){
return '/assets/image/icon-down.png'
}
}

4
pages/moment/moment-item/index.wxml

@ -11,8 +11,8 @@
</view>
<view style="width: 40%;">
<view class="flex flex-center">
<text class="text-lg {{moment.colorText(item.typicalFloatingQuotedPrice)}}">{{item.typicalFloatingQuotedPrice || '- -'}}</text>
<image style="height: 20rpx;width: 20rpx;margin-left: 4rpx" src="{{moment.floatImage(item.typicalFloatingQuotedPrice)}}" wx:if="{{item.typicalFloatingQuotedPrice !== 0}}"></image>
<text class="text-lg {{moment.colorText(item.typicalFloatingQuotedPrice)}}">{{formate.formatePrice(item.typicalFloatingQuotedPrice, 0) || '- -'}}</text>
<image style="height: 24rpx;width: 24rpx;margin-left: 4rpx" src="{{moment.floatImage(item.typicalFloatingQuotedPrice)}}" wx:if="{{item.typicalFloatingQuotedPrice !== 0}}"></image>
</view>
<view class="text-gray text-sm" style="margin-top: 4rpx;text-align: center">更新时间:{{moment.formateText(item.latestQuoteTime, 10)}}</view>
</view>

Loading…
Cancel
Save