diff --git a/pages/guide/feedback.vue b/pages/guide/feedback.vue index a2b9f89..ceb12f8 100644 --- a/pages/guide/feedback.vue +++ b/pages/guide/feedback.vue @@ -52,14 +52,15 @@ this.util.toast("请填写正确的手机号!"); return false; } - } - if (this.util.isNull(that.form.content)) { - this.util.toast("请填写内容!"); - return false; + } + if (this.util.isNull(that.form.content)) { + this.util.toast("请填写内容!"); + return false; } this.util.request({ api: '/api/mobile/other/tip-store', data: this.form, + method: "POST", utilSuccess: function(res) { console.log(res) uni.showToast({ diff --git a/pages/guide/index.vue b/pages/guide/index.vue index a6890da..9c4c298 100644 --- a/pages/guide/index.vue +++ b/pages/guide/index.vue @@ -42,7 +42,14 @@ } }, onLoad() { - this.loadActivity(); + var that = this; + wx.getLocation({ + success(res) { + that.latitude = res.latitude; + that.longitude = res.longitude; + that.loadActivity() + } + }) }, methods: { tolist(type) { @@ -63,6 +70,10 @@ var that = this; this.util.request({ api: '/api/mobile/activity/index', + data: { + latitude: that.latitude, + longitude: that.longitude + }, utilSuccess: function(res) { for (var m of res.data) { m.img = m.cover_upload.url; diff --git a/pages/success/success.vue b/pages/success/success.vue index 606275b..036e1ec 100644 --- a/pages/success/success.vue +++ b/pages/success/success.vue @@ -17,8 +17,9 @@ tips: "参观预约" } }, - onLoad(options) { - if (options.from && options.id) { + onLoad(options) { + let that = this; + if (options.from) { var url = ""; if (options.from == "visit") { this.tips = "参观预约"; @@ -36,7 +37,9 @@ if (url == "") { - this.goHome(); + setTimeout(function() { + that.goHome(); + }, 5000) } else { setTimeout(function() { uni.navigateTo({ diff --git a/pages/visit/book.vue b/pages/visit/book.vue index f4a6352..cbf99d6 100644 --- a/pages/visit/book.vue +++ b/pages/visit/book.vue @@ -78,8 +78,9 @@ - 每单限购5张,同一身份证当天限购1张 - 8人以上可团体预约,一个团体最多50人 + 每单限购{{maxCount}}张,同一身份证当天限购1张 + {{minCount}}人以上可团体预约,一个团体最多{{maxCount}}人 @@ -279,6 +280,8 @@ user: {}, minCount: 1, maxCount: 1, + config: {}, + info: {}, cardList: [{ idx: 1, name: '身份证' @@ -296,6 +299,8 @@ this.$refs.formUser.setRules(this.rules); }, onLoad(options) { + this.loadConfig(); + this.loadInfo(); if (options.currentDate) { this.bcurrentDate = JSON.parse(options.currentDate); this.currentDate = this.bcurrentDate; @@ -311,16 +316,53 @@ title: (options.from == 'user' ? "个人预约" : "团队预约") }) - this.form.total = this.minCount = (type == 'user' ? 1 : 8); - this.maxCount = (type == 'user' ? 5 : 50); + this.form.total = this.minCount; //= (type == 'user' ? 1 : 8); + //this.maxCount = (type == 'user' ? 5 : 50); var that = this; that.util.getUserInfo(function(r) { that.user = r; that.form.mobile = r.mobile; }, true); + }, methods: { + loadConfig() { + + + var that = this; + this.util.request({ + api: '/api/mobile/visit/visit-defualt-config', + utilSuccess: function(res) { + that.config = res; + if (that.type == "user") { + that.maxCount = res.person_max_count; + that.minCount = 1; + } else { + that.maxCount = res.team_max_count; + that.minCount = res.team_min_count; + } + }, + utilFail: function(res) { + + } + }) + }, + loadInfo() { + var that = this; + this.util.request({ + api: '/api/mobile/visit/introduce', + utilSuccess: function(res) { + console.log(res); + that.info = res; + that.notice[0].content = (that.type == 'user' ? res.person_notice : res.team_notice) + }, + utilFail: function(res) { + + } + }) + + }, closeInfo() { this.showInfo = false; }, @@ -331,6 +373,15 @@ submitOrder() { this.form.date = this.currentDate.date; this.form.rule_id = this.currentTime.id; + + if (this.form.details_list.length != this.form.total) { + uni.showToast({ + icon: "none", + title: "请正确添加观众数量" + }) + return false; + } + if (this.util.isNull(this.form.leader)) { if (this.type == "user") { uni.showToast({ @@ -390,14 +441,6 @@ }) return false; } - if (this.form.details_list.length != this.form.total) { - uni.showToast({ - icon: "none", - title: "请正确添加观众数量" - }) - return false; - } - var that = this; this.util.request({ api: '/api/mobile/visit/order',