纸通宝小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

102 lines
2.5 KiB

// pages/stock/index.js
const util = require('../../../utils/util')
const app = getApp()
import {
getPaperMillOfInformationList
} from "../../api/ztb"
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.safeFragmentHeight - 190,
safeBottom: app.globalData.safeBottom,
orderList: [],
tableSgin: null,
loading:false,
pximg:'/assets/info/px-mr.png'
},
methods: {
onRestart: function () {
this.setData({
StatusBar: app.globalData.StatusBar || 40,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
})
this.getPaperMillOfInformationListFct({
queryWay: 0
})
},
toPage: function (e) {
if (e.currentTarget.id == 'toqb') {
util.navigateTo('/pages/article/index/index')
}
if (e.currentTarget.id == 'toAllFactory') {
util.navigateTo('/pages/article/allNewInfo/index')
}
if(e.currentTarget.id == 'toAttentionFactory'){
util.navigateTo('/pages/home/attentionPaperList/index')
}
if(e.currentTarget.id == 'tofeedback'){
util.navigateTo('/pages/article/feedback/index')
}
},
changeTable: function (e) {
var a = e.currentTarget.id
if (e.currentTarget.id === this.data.tableSgin) {
this.setData({
tableSgin: null
})
} else {
this.setData({
tableSgin: e.currentTarget.id
})
}
},
getPaperMillOfInformationListFct:function(model) {
this.setData({
loading:true
})
getPaperMillOfInformationList(model).then(res => {
this.setData({
orderList: res.data
})
this.setData({
loading:false
})
})
},
changeSort:function(){
if(this.data.pximg=='/assets/info/px-mr.png'){
this.setData({
pximg:'/assets/info/px-sx.png'
})
this.getPaperMillOfInformationListFct({queryWay: 0,priceSort:1})
return
}
if(this.data.pximg=='/assets/info/px-sx.png'){
this.setData({
pximg:'/assets/info/px-jx.png'
})
this.getPaperMillOfInformationListFct({queryWay: 0,priceSort:0})
return
}
if(this.data.pximg=='/assets/info/px-jx.png'){
this.setData({
pximg:'/assets/info/px-mr.png'
})
this.getPaperMillOfInformationListFct({queryWay: 0})
return
}
}
},
})