// pages/message/detail/index.js import Scene from '../../index/scene' import { getFactoryPriceDetail, userPushFollowMill } from "../../../api/ztb" import { getPreferList} from "../../../api/moment" const event = require('../../../utils/event') const util = require('../../../utils/util') const storage = require('../../../utils/storage') const app = getApp() Scene({ /** * 页面的初始数据 */ data: { fragmentHeight: app.globalData.fragmentHeight - 90, height: app.globalData.fragmentHeight - 90, stickyTop: app.globalData.CustomBar, scrollTop: 0, toView: null, id: null, tabList: ['报价信息', '讨论', '收货标准', '注意事项'], tabIndex: 0, factoryDetail: null, cateIndex: 0, cateId: '', daytimes: '', momentList: [], requesting: false, finished: false, form: { pageNum: 1 }, hasFollowed: false }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if (options.id) { this.data.id = options.id this.data.form.millPaperId = options.id getFactoryPriceDetail(options.id).then(result => { if (result.data.paperCategoryList && result.data.paperCategoryList.length) { this.data.cateId = result.data.paperCategoryList[this.data.cateIndex].categoryId } this.setData({ factoryDetail: result.data, hasFollowed: result.data.hasFollowed }) wx.hideLoading() }).catch(err => { wx.hideLoading() util.showToast(err) }) } this.setData({ safeBottom: app.globalData.safeBottom, fragmentHeight: app.globalData.fragmentHeight - 90, height: app.globalData.fragmentHeight, stickyTop: app.globalData.CustomBar, daytimes: util.formatDate(new Date(), 'Y-M-D') // tabIndex: options.tabIndex ? parseInt(options.tabIndex) : 0 }) } })