// pages/component/service/index.js const app = getApp() Component({ /** * 组件的属性列表 */ properties: { }, /** * 组件的初始数据 */ data: { imgUrl: app.globalData.urlStatic,//图片路径 maskState: false,//遮罩显示状态 placing: false, buyState: false, nowPage: '0', yuyueShow: false, }, attached:function(){ this.setData({ nowPage:app.globalData.nowPage, buyState: app.globalData.getBuyState?app.globalData.getBuyState.success:false }) }, /** * 组件的方法列表 */ methods: { maskShow:function(e){//打开遮罩 this.setData({ maskState: true, }) }, closeService: function (e) {//关闭遮罩 this.setData({ maskState: false, }) }, newCarConsultation:function(e){//新车咨询 console.log("小程序跳转"); wx.navigateToMiniProgram({ appId:'wx1d585c8c2fffe589', path:"/pages/take/takeHome/takeHome", envVersion:"trial", success(res) { // 打开成功 }, complete(res){ console.log(res); } }) }, placingControl: function () { if (app.globalData.getBuyState){ if (app.globalData.getBuyState.success != this.data.buyState) { this.setData({ buyState: app.globalData.getBuyState.success }) } } this.setData({ placing: !this.data.placing }) }, openYuyue: function () {//预约 this.setData({ yuyueShow: !this.data.yuyueShow }) } } })