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.
97 lines
3.0 KiB
97 lines
3.0 KiB
// pages/message/detail/index.js
|
|
import Scene from '../../index/scene'
|
|
import Dialog from '../../../components/dialog/dialog'
|
|
import { getPaperMillOfInformationList } from "../../../api/ztb"
|
|
const util = require('../../../utils/util')
|
|
const math = require('../../../utils/math') //导入模块
|
|
const app = getApp()
|
|
|
|
Scene({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
height: app.globalData.fragmentHeight - 80,
|
|
safeBottom: app.globalData.safeBottom,
|
|
orderList: [],
|
|
tableSgin: null,
|
|
loading: false,
|
|
pximg: '/assets/info/px-mr.png',
|
|
querFrom: {
|
|
queryWay: 1,
|
|
priceSort: 0
|
|
},
|
|
factoryList: []
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
this.setData({ height: app.globalData.fragmentHeight - 80 })
|
|
this.getPaperMillOfInformationListFct({ queryWay: 1 })
|
|
},
|
|
toPage: function (e) {
|
|
if (e.currentTarget.id == 'toFactoryDetails') {
|
|
wx.navigateTo({url: `/pages/agent/factory-detail/index?id=${e.currentTarget.dataset.factoryid}` })
|
|
}
|
|
if (e.currentTarget.id == 'toDmai') {
|
|
if (!app.userInfo) {
|
|
wx.navigateTo({url: '/pages/login/index' })
|
|
return
|
|
}
|
|
if (!app.userInfo.type || app.userInfo.type.indexOf('ADMIN') < 0) {
|
|
Dialog.alert({ title: '温馨提示', message: '您不是工厂管理员,无法预约代卖,请联系工厂管理员' }).then(() => {
|
|
})
|
|
return
|
|
}
|
|
if(!e.currentTarget.dataset.operations){
|
|
util.showToast(e.currentTarget.dataset.msg)
|
|
return
|
|
}
|
|
wx.navigateTo({url: `/pages/agent/appointment/index?id=${e.currentTarget.dataset.fcid}&categoryId=${e.currentTarget.dataset.paperid}`})
|
|
}
|
|
},
|
|
changeTable: function (e) {
|
|
if (e.currentTarget.id === this.data.tableSgin) {
|
|
this.setData({ tableSgin: null })
|
|
} else {
|
|
this.setData({ tableSgin: e.currentTarget.id })
|
|
}
|
|
},
|
|
getPaperMillOfInformationListFct(model) {
|
|
this.setData({ loading: true })
|
|
wx.showLoading({ title: '加载中' })
|
|
getPaperMillOfInformationList(model).then(res => {
|
|
this.setData({ orderList: res.data, loading: false })
|
|
wx.hideLoading()
|
|
}).catch((e) => {
|
|
wx.hideLoading()
|
|
})
|
|
},
|
|
changeSort: function () {
|
|
if(this.data.loading){
|
|
return
|
|
}
|
|
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
|
|
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
|
|
this.getPaperMillOfInformationListFct(this.data.querFrom)
|
|
return
|
|
}
|
|
},
|
|
mathTimesRtrun: function (text) {
|
|
return math.times(text, 1000)
|
|
}
|
|
})
|