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.
60 lines
1.8 KiB
60 lines
1.8 KiB
// pages/message/index.js
|
|
const util = require('../../../utils/util')
|
|
const app = getApp()
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
multipleSlots: true
|
|
},
|
|
properties: {
|
|
item: { type: Object, value: null }
|
|
},
|
|
data: {
|
|
cateIndex: 0
|
|
},
|
|
methods: {
|
|
lookItem: function (e) {
|
|
wx.navigateTo({ url: `/pages/agent/factory-detail/index?id=${this.data.item.paperMillId}`})
|
|
},
|
|
unflodItem: function(){
|
|
this.setData({ ['item.fold']: !this.data.item.fold })
|
|
},
|
|
checkTag: function(e){
|
|
var cateIndex = -1
|
|
if(util.isEmpty(this.data.cateIndex)){
|
|
cateIndex = e.currentTarget.dataset.ck
|
|
} else if(this.data.cateIndex != e.currentTarget.dataset.ck){
|
|
cateIndex = e.currentTarget.dataset.ck
|
|
}
|
|
if(cateIndex >= 0){
|
|
this.setData({ cateIndex })
|
|
}
|
|
},
|
|
saleGood: function(e){
|
|
if (!app.userInfo) {
|
|
wx.navigateTo({ url: '/pages/login/index' })
|
|
return
|
|
}
|
|
if (!app.userInfo.type || app.userInfo.type.indexOf('ADMIN') < 0) {
|
|
util.showToast('您不是工厂管理员,无法预约代卖,请联系工厂管理员')
|
|
return
|
|
}
|
|
if(!this.data.item.isOperations){
|
|
util.showToast(this.data.item.manageNotifyMessage)
|
|
return
|
|
}
|
|
if(util.isEmpty(this.data.cateIndex)){
|
|
util.showToast('请选择一个纸品')
|
|
return
|
|
}
|
|
if(util.isEmpty(this.data.item.paperCategoryList[this.data.cateIndex].unitPrice)){
|
|
util.showToast('该纸品暂无报价,无法卖货')
|
|
return
|
|
}
|
|
var categoryId = this.data.item.paperCategoryList[this.data.cateIndex].categoryId
|
|
wx.navigateTo({ url: '/pages/agent/appointment/index?id=' + this.data.item.paperMillId + '&categoryId=' + categoryId })
|
|
}
|
|
}
|
|
|
|
})
|