const util = require("../../../utils/util"); Component({ options:{addGlobalClass: true}, properties: { show:{ type: Boolean, observer: function (newVal) { this.setData({ show: newVal }); } }, datas:{ type: Object, observer: function (newVal) { this.setData({ datas: newVal }); } }, shareInfo:{ type: Object, observer: function (newVal) { console.log(newVal) this.setData({ shareInfo: newVal }); } }, list:{ type: Array, observer: function (newVal) { this.setData({ list: newVal }); this.getSkuName() } }, remainTime:{ type: Object, observer:function(val){ this.setData({ updateTime: val }); } }, }, data: { show:false, datas:{}, list:[], shareInfo:{}, skuInfo:{ sessionName:'', mealsName:'' }, updateTime:{} }, methods: { // 关闭弹窗 closeTip(e){ console.log(e) this.close(e.detail) }, close(e){ // this.setData({show:false}) this.triggerEvent("close", false); }, // 立即报名/一键参团/新开拼团 signup(){ if (!util.isEmpty(this.data.shareInfo.groupid)) { this.triggerEvent("newGroup", (this.data.datas.status ==2 || this.data.datas.status ==4)?1:0); } else { this.triggerEvent("signup", false); } }, // 获取对应场次/套餐名称 getSkuName(){ // let session=this.recursion(this.data.list,this.data.shareInfo.sid,0); let list = this.data.list,sid=this.data.shareInfo.sid,pid=this.data.shareInfo.pid; for (let i = 0; i < list.length; i++) { if (list[i].sid==sid) { this.setData({'skuInfo.sessionName':list[i].name}) for (let index = 0; index < list[i].meals.length; index++) { if (list[i].meals[index].pid==pid) { this.setData({'skuInfo.mealsName':list[i].meals[index].policyName}) return false; } } } } }, } })