123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- var app = getApp();
- var utils = require("../../../utils/http");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- aid: '',
- title: '志远装饰数字化平台',
- customerFlag: false,
- articleObj: {},
- imgUrl: app.globalData.imgUrl,
- type: 1,
- nowflag: false,
- footflag: true,
- sharepersonMsg: app.globalData.sharepersonobj,
- employeeflag: false, //false是用户,true是员工
- priceflag: false,
- personMsg:app.globalData.personMsg
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var that = this;
- wx.showLoading({
- title: '加载中...',
- })
- that.setData({
- aid: options.aid,
- personMsg:app.globalData.personMsg,
- sharepersonMsg: app.globalData.sharepersonobj,
- employeeflag: (!!app.globalData.personMsg.binded && app.globalData.personMsg.binded.state == '在职') ? true : false
- })
- that.artileMsg();
- },
- priceshowtap() {
- this.setData({
- priceflag: true
- })
- },
- closepricetap() {
- this.setData({
- priceflag: false
- })
- },
- artileMsg: function () {
- var that = this;
- utils.$post({
- url: app.globalData.webUrl + 'client/article/info',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- article_id: that.data.aid
- },
- success: function (res) {
- if (res.data.code == '0') {
- that.setData({
- articleObj: res.data.data,
- title: res.data.data.title
- })
- wx.setNavigationBarTitle({
- title: res.data.data.title
- })
- var article = res.data.data.content;
- }
- setTimeout(function () {
- wx.hideLoading();
- }, 1000)
- }
- })
- },
- pricetap: function () {
- wx.navigateTo({
- url: '/customer/pages/figureprice/figureprice',
- })
- },
- designTap: function () {
- wx.navigateTo({
- url: '/customer/pages/findesign/findesign',
- })
- },
- phonrtap: function () {
- wx.makePhoneCall({
- phoneNumber: app.globalData.sharepersonobj.phone //仅为示例,并非真实的电话号码
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.setData({
- personMsg:app.globalData.personMsg,
- sharepersonMsg: app.globalData.sharepersonobj,
- employeeflag: (!!app.globalData.personMsg.binded && app.globalData.personMsg.binded.state == '在职') ? true : false
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- // onShareAppMessage: function () {
- // console.log(this.data.share_user_id)
- // return {
- // title: '我是'+app.globalData.sharename+",这是我的个人微网。",
- // imageUrl:"../../../img/weiw.png",
- // path: '/pages/index/index?share_user_id='+this.data.share_user_id+"&sharename="+app.globalData.sharename
- // }
- // }
- })
|