new Vue({
	el: "#app",
	data: {
		orderid: "",
		thirdorderid: "",
		Warntxt: "",
	},
	mounted: function() {
		var vm = this
		var query = GetRequest();
		vm.orderid = query.orderid;
		vm.thirdorderid = query.thirdorderid;
		jiuzhenAPI.CancellationWarn({token:"e8b01d2e-6dc8-4ba2-8422-462ae7535651"}).then(function(res) {
			vm.Warntxt = res.value.replace("预约须知：","")
		})
	},
	methods: {
		cancelAppointment: function() {
			var vm = this
			var oauthInfo = JSON.parse(sessionStorage.getItem("oauthInfo"));
			//取消总部预约记录
			appointmentAPI.cancelOrder({
				orderId: vm.orderid,
				thirdPartyUserId: oauthInfo.id
			}).then(function(res) {
				if(res.obj.Code == "10000") {
					//取消我们这边的预约记录
					jiuzhenAPI.cancelOrder({
						id: vm.thirdorderid,
						state: 99,
					}).then(function(res) {
						toastr.success("取消成功！")
					})
				} else {
					toastr.error("取消失败！")
				}
				resolve(layerid)
			})
		},
		back: function() {

		},
	}
});