diff --git a/pages/article/allNewInfo/index.js b/pages/article/allNewInfo/index.js index fda6852..2e35ffa 100644 --- a/pages/article/allNewInfo/index.js +++ b/pages/article/allNewInfo/index.js @@ -1,6 +1,9 @@ const util = require('../../../utils/util') +const math = require('../../../utils/math') //导入模块 const app = getApp() -import { getPaperMillOfInformationList } from "../../api/ztb" +import { + getPaperMillOfInformationList +} from "../../api/ztb" Page({ @@ -13,12 +16,12 @@ Page({ orderList: [], tableSgin: null, loading: false, - pximg:'/assets/info/px-mr.png', - querFrom:{ + pximg: '/assets/info/px-mr.png', + querFrom: { queryWay: 1, - priceSort:0 + priceSort: 0 }, - factoryList:[] + factoryList: [] }, /** @@ -30,58 +33,80 @@ Page({ CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80), height: app.globalData.fragmentHeight - 80 }) - this.getPaperMillOfInformationListFct({ queryWay: 1 }) + this.getPaperMillOfInformationListFct({ + queryWay: 1 + }) }, toPage: function (e) { if (e.currentTarget.id == 'toqb') { util.navigateTo('/pages/article/index/index') } - if(e.currentTarget.id == 'toAttentionPaperFctory'){ + if (e.currentTarget.id == 'toAttentionPaperFctory') { util.navigateTo('/pages/article/attentionPaperFactory/index') } - if(e.currentTarget.id == 'toFactoryDetails'){ - util.navigateTo('/pages/agent/factory/index?id='+e.currentTarget.dataset.factoryid) + if (e.currentTarget.id == 'toFactoryDetails') { + util.navigateTo('/pages/agent/factory/index?id=' + e.currentTarget.dataset.factoryid) } - if(e.currentTarget.id == 'toDmai'){ - util.navigateTo('/pages/agent/edit/index?id='+e.currentTarget.dataset.fcid+'&categoryId='+e.currentTarget.dataset.paperid) + if (e.currentTarget.id == 'toDmai') { + util.navigateTo('/pages/agent/edit/index?id=' + e.currentTarget.dataset.fcid + '&categoryId=' + e.currentTarget.dataset.paperid) } }, changeTable: function (e) { var a = e.currentTarget.id if (e.currentTarget.id === this.data.tableSgin) { - this.setData({ tableSgin: null }) + this.setData({ + tableSgin: null + }) } else { - this.setData({ tableSgin: e.currentTarget.id }) + this.setData({ + tableSgin: e.currentTarget.id + }) } }, getPaperMillOfInformationListFct(model) { - this.setData({ loading: true }) - wx.showLoading({ title: '加载中' }) + this.setData({ + loading: true + }) + wx.showLoading({ + title: '加载中' + }) getPaperMillOfInformationList(model).then(res => { - this.setData({ orderList: res.data, loading: false }) + this.setData({ + orderList: res.data, + loading: false + }) wx.hideLoading() }).catch((e) => { wx.hideLoading() }) }, - changeSort:function(){ - if(this.data.pximg=='/assets/info/px-mr.png'){ - this.setData({ pximg:'/assets/info/px-sx.png' }) - this.data.querFrom.priceSort=1 + changeSort: function () { + if (this.data.pximg == '/assets/info/px-mr.png') { + this.setData({ + pximg: '/assets/info/px-sx.png' + }) + this.data.querFrom.priceSort = 1 this.getPaperMillOfInformationListFct(this.data.querFrom) return } - if(this.data.pximg=='/assets/info/px-sx.png'){ - this.setData({ pximg:'/assets/info/px-jx.png' }) - this.data.querFrom.priceSort=0 + if (this.data.pximg == '/assets/info/px-sx.png') { + this.setData({ + pximg: '/assets/info/px-jx.png' + }) + this.data.querFrom.priceSort = 0 this.getPaperMillOfInformationListFct(this.data.querFrom) return } - if(this.data.pximg=='/assets/info/px-jx.png'){ - this.setData({ pximg:'/assets/info/px-mr.png' }) - this.data.querFrom.priceSort=0 + if (this.data.pximg == '/assets/info/px-jx.png') { + this.setData({ + pximg: '/assets/info/px-mr.png' + }) + this.data.querFrom.priceSort = 0 this.getPaperMillOfInformationListFct(this.data.querFrom) return } }, + mathTimesRtrun: function (text) { + return math.times(text, 1000) + } }) \ No newline at end of file diff --git a/pages/article/allNewInfo/index.wxml b/pages/article/allNewInfo/index.wxml index 6f620da..efda831 100644 --- a/pages/article/allNewInfo/index.wxml +++ b/pages/article/allNewInfo/index.wxml @@ -57,8 +57,8 @@ {{cell.categoryName|| '---'}} - {{cell.unitPrice*1000|| 0}} - {{cell.floatPrice*1000|| 0}} + {{formate.formatePrice(cell.unitPrice)}} + {{formate.formatePrice(cell.floatPrice)}} {{cell.curDeductionPoint|| 0}} 代卖 diff --git a/pages/article/newInfo/index.js b/pages/article/newInfo/index.js index b21ab18..d02b176 100644 --- a/pages/article/newInfo/index.js +++ b/pages/article/newInfo/index.js @@ -1,5 +1,6 @@ // pages/stock/index.js const util = require('../../../utils/util') +const math = require('../../../utils/math') //导入模块 const app = getApp() import { getPaperMillOfInformationList, @@ -123,6 +124,10 @@ Component({ }, toMill(e){ util.navigateTo('/pages/agent/factory/index?id=' + e.currentTarget.id) + }, + + mathTimesRtrun:function(text){ + return math.times(text, 1000) } } diff --git a/pages/article/newInfo/index.wxml b/pages/article/newInfo/index.wxml index c5d7b61..6796c5c 100644 --- a/pages/article/newInfo/index.wxml +++ b/pages/article/newInfo/index.wxml @@ -83,8 +83,8 @@ {{cell.categoryName|| '---'}} - {{cell.unitPrice*1000|| 0}} - {{cell.floatPrice*1000|| 0}} + {{formate.formatePrice(cell.unitPrice)}} + {{formate.formatePrice(cell.floatPrice)}} {{formate.formateDescripe(cell.curDeductionPoint)}} 代卖