...
|
...
|
@@ -145,67 +145,54 @@ |
|
|
pos: 'fixed'
|
|
|
},
|
|
|
created: function () {
|
|
|
apiready = function () {
|
|
|
app.id = api.pageParam.id;
|
|
|
app.cid = api.pageParam.cid;
|
|
|
app.applyInfo();
|
|
|
app.getUserIndexInfo();
|
|
|
api.addEventListener({
|
|
|
name: 'meal'
|
|
|
}, function (ret, err) {
|
|
|
app.meal = ret.value.meal + ',' + ret.value.num + app.unit;
|
|
|
app.total = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
app.attribute_id = ret.value.attribute_id;
|
|
|
app.num = ret.value.num;
|
|
|
// alert(JSON.stringify(ret.value));
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'room'
|
|
|
}, function (ret, err) {
|
|
|
app.room = ret.value.name_left + ',' + ret.value.name_right + ',' + ret.value.num + app.unit;
|
|
|
// alert(JSON.stringify(ret.value));
|
|
|
app.num = ret.value.num;
|
|
|
app.attribute_id = ret.value.attribute_id;
|
|
|
app.total = parseFloat(ret.value.price) * (ret.value.num)
|
|
|
});
|
|
|
var client_h = window.innerHeight;
|
|
|
window.addEventListener('resize', function () {
|
|
|
if (window.innerHeight < client_h) {
|
|
|
app.pos = 'relative'
|
|
|
} else {
|
|
|
app.pos = 'fixed'
|
|
|
}
|
|
|
}, false);
|
|
|
}
|
|
|
this.id = localStorage.getItem('id');
|
|
|
this.cid = localStorage.getItem('cid');
|
|
|
this.applyInfo();
|
|
|
this.getUserIndexInfo();
|
|
|
// api.addEventListener({
|
|
|
// name: 'meal'
|
|
|
// }, function (ret, err) {
|
|
|
// app.meal = ret.value.meal + ',' + ret.value.num + app.unit;
|
|
|
// app.total = parseFloat(ret.value.price) * (ret.value.num);
|
|
|
// app.attribute_id = ret.value.attribute_id;
|
|
|
// app.num = ret.value.num;
|
|
|
// // alert(JSON.stringify(ret.value));
|
|
|
// });
|
|
|
// api.addEventListener({
|
|
|
// name: 'room'
|
|
|
// }, function (ret, err) {
|
|
|
// app.room = ret.value.name_left + ',' + ret.value.name_right + ',' + ret.value.num + app.unit;
|
|
|
// // alert(JSON.stringify(ret.value));
|
|
|
// app.num = ret.value.num;
|
|
|
// app.attribute_id = ret.value.attribute_id;
|
|
|
// app.total = parseFloat(ret.value.price) * (ret.value.num)
|
|
|
// });
|
|
|
var client_h = window.innerHeight;
|
|
|
window.addEventListener('resize', function () {
|
|
|
if (window.innerHeight < client_h) {
|
|
|
app.pos = 'relative'
|
|
|
} else {
|
|
|
app.pos = 'fixed'
|
|
|
}
|
|
|
}, false);
|
|
|
},
|
|
|
methods: {
|
|
|
// 选择套餐
|
|
|
set_meal: function () {
|
|
|
api.openFrame({
|
|
|
bgColor: 'rgba(0,0,0,0.05)',
|
|
|
var app = this;
|
|
|
openWin({
|
|
|
name: 'choose_meal_f',
|
|
|
url: './choose_meal_f.html',
|
|
|
bounces: false,
|
|
|
animation: {
|
|
|
type: "push",
|
|
|
subType: "from_bottom",
|
|
|
duration: 300
|
|
|
},
|
|
|
rect: {
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
w: 'auto',
|
|
|
h: 'auto'
|
|
|
},
|
|
|
pageParam: {
|
|
|
id: app.id,
|
|
|
attribute: app.attribute,
|
|
|
unit: app.unit
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
// 选择入住等级
|
|
|
set_rank: function () {
|
|
|
var app = this;
|
|
|
if (app.date_info) {
|
|
|
api.confirm({
|
|
|
title: '选择套餐',
|
...
|
...
|
@@ -246,6 +233,7 @@ |
|
|
},
|
|
|
// 选择日期
|
|
|
dateSelect: function () {
|
|
|
var app = this;
|
|
|
if (app.room) {
|
|
|
api.confirm({
|
|
|
title: '选择套餐',
|
...
|
...
|
@@ -321,6 +309,7 @@ |
|
|
},
|
|
|
// 预约时间
|
|
|
openDate: function () {
|
|
|
var app = this;
|
|
|
if (app.date_info == '') {
|
|
|
toastMsg('入住时间')
|
|
|
} else if (app.name == '') {
|
...
|
...
|
@@ -349,6 +338,7 @@ |
|
|
},
|
|
|
// 获取订单详情
|
|
|
applyInfo: function () {
|
|
|
var app = this;
|
|
|
var post = {
|
|
|
gid: app.id
|
|
|
};
|
...
|
...
|
@@ -373,6 +363,7 @@ |
|
|
},
|
|
|
// 下单
|
|
|
openOrder: function () {
|
|
|
var app = this;
|
|
|
if (app.room == '' && app.meal == '') {
|
|
|
toastMsg('请选择套餐')
|
|
|
}
|
...
|
...
|
@@ -407,6 +398,7 @@ |
|
|
},
|
|
|
// 客服
|
|
|
openSever: function () {
|
|
|
var app = this;
|
|
|
app.img_active = false;
|
|
|
app.getRongYunToken();
|
|
|
|
...
|
...
|
@@ -455,6 +447,7 @@ |
|
|
},
|
|
|
// 获取客服token
|
|
|
getRongYunToken: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -471,6 +464,7 @@ |
|
|
},
|
|
|
// 获取个人信息
|
|
|
getUserIndexInfo: function () {
|
|
|
var app = this;
|
|
|
var header = {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
'XX-Token': getToken()
|
...
|
...
|
@@ -484,6 +478,7 @@ |
|
|
})
|
|
|
},
|
|
|
input_focus: function () {
|
|
|
var app = this;
|
|
|
setTimeout(function () {
|
|
|
document.body.scrollTop = document.body.scrollHeight;
|
|
|
}, 300);
|
...
|
...
|
|