From 85f9fb348fba93c48d21f9a7bab1c598004fc71d Mon Sep 17 00:00:00 2001 From: lin fan Date: Fri, 18 Oct 2024 16:14:19 +0800 Subject: [PATCH] 1 --- home/controllers/h5/market/sytopic/Enter.php | 105 +++ .../controllers/h5/market/sytopic/Welcome.php | 2 +- home/views/h5/market/sytopic/index2.php | 721 ++++++++++++++++++ 3 files changed, 827 insertions(+), 1 deletion(-) create mode 100644 home/controllers/h5/market/sytopic/Enter.php create mode 100644 home/views/h5/market/sytopic/index2.php diff --git a/home/controllers/h5/market/sytopic/Enter.php b/home/controllers/h5/market/sytopic/Enter.php new file mode 100644 index 00000000..c02e4e36 --- /dev/null +++ b/home/controllers/h5/market/sytopic/Enter.php @@ -0,0 +1,105 @@ +load->model('market/Market_sytopic_module_option_model', 'module_option_model'); + $this->load->model('market/Market_sytopic_enroll_model', 'sytopic_enroll_model'); + $this->load->model('market/market_sylive_organization_model', 'organization_model'); + $this->load->library('qiniu'); + + $this->skey = $this->input->get_post('skey'); + $param = $this->myencryption->base64url_decode($this->skey); + $this->a_id = intval($param[self::SIGN_TOP_KEY]);//活动id + if (!$this->a_id) { + throw new Hd_exception("参数错误", 400); + } + $this->data['skey'] = $this->skey; + } + + public function index() + { + $row = $this->topic_model->get(['id' => $this->a_id]); + if (!$row) { + throw new Hd_exception('参数错误', 400); + } + + $jsonData = json_decode($row['jsondata'], true); + $info = [ + 'id' => $row['id'], + 'title' => $row['title'], + 'banner' => $jsonData['banner'] ? build_qiniu_image_url($jsonData['banner']) : '', + 'bgColor' => $jsonData['bg_color'] ?: '', + 'buttonType' => $jsonData['button_type'] ? (int)$jsonData['button_type'] : '', + 'bottom_img' => $jsonData['bottom_img'] ? build_qiniu_image_url($jsonData['bottom_img']) : '', + ]; + $moduleLists = $this->module_option_model->getTopicModelOptionsList($this->a_id); + $this->data['modules'] = array_values($moduleLists); + $this->data['logoList'] = $this->module_option_model->getTypeEnrollBannerList($this->a_id); + + $this->data['info'] = $info; + $this->data['_title'] = $row['title']; + $this->show_view('h5/market/sytopic/index2'); + } + + //报名 + public function enroll() + { + $redis = &load_cache(); + $optionId = intval($this->input->post('optionId')); + $topicId = intval($this->input->post('topicId')); + if (!$topicId) { + $this->show_json('', 400, '参数错误'); + } + $info = $this->input->post('info'); + $name = $info['name']; + $mobile = $info['phone']; + $code = $info['code']; + if (!$name) { + $name = '客户'; + //$this->show_json('', 400, '请输入姓名'); + } + $key = self::ENROLL_SIGN_KEY . $mobile; + if (!$code || $code != $redis->get($key)) { + $this->show_json('', 400, '请输入正确的验证码'); + } + $result = $this->sytopic_enroll_model->enroll($topicId, $optionId, 0, $name, $mobile); + if (!$result['code']) { + $this->show_json('', 400, $result['msg']); + } + $this->show_json('', 200, '提交成功'); + } + + //获取报名验证码 + public function get_code() + { + $mobile = $this->input->post('mobile'); + if (!mobile_valid($mobile)) { + $this->show_json('', 400, '请输入正确的手机号码'); + } + $redis = &load_cache(); + $key = self::ENROLL_SIGN_KEY . $mobile; + $code = $redis->get($key); + if ($code) { + $this->show_json('', 200, '验证码已发送'); + } + if (!$code) { + $this->load->helper('string'); + $code = random_string('numeric', 4); + $redis->save($key, $code, 60 * 5); + } + $content = "【之家车卖场】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人!"; + b2m_send_sms($mobile, $content); + $this->show_json('', 200, '验证码已发送'); + } + + +} diff --git a/home/controllers/h5/market/sytopic/Welcome.php b/home/controllers/h5/market/sytopic/Welcome.php index 13a5aafe..9e930a02 100644 --- a/home/controllers/h5/market/sytopic/Welcome.php +++ b/home/controllers/h5/market/sytopic/Welcome.php @@ -117,7 +117,7 @@ class Welcome extends Wx $code = random_string('numeric', 4); $redis->save($key, $code, 60 * 5); } - $content = "【好店云】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人,!"; + $content = "【好店云】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人!"; b2m_send_sms($mobile, $content); $this->show_json('', 200, '验证码已发送'); } diff --git a/home/views/h5/market/sytopic/index2.php b/home/views/h5/market/sytopic/index2.php new file mode 100644 index 00000000..74afc852 --- /dev/null +++ b/home/views/h5/market/sytopic/index2.php @@ -0,0 +1,721 @@ + + + +
+
+ +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+

+ {{info.biz.biz_name}} + 官方 +

+
+ +
+
+
+
+

{{info.biz.address}}

+ +
+
+
+ +
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + + +
+ +
+ +
+
+
+ + + +
+
+

{{popCarInfo.mTitle ? popCarInfo.mTitle : info.title}}

+
+
+ +
+
+

{{popCarInfo.title}}

+

{{popCarInfo.subTitle}} +

+
+
+ +
+ +
+
+ + + +
+
+ +
+
+
+
+ + + +
+
+

{{popCarInfo.mTitle ? popCarInfo.mTitle : info.title}}

+
+
+ +
+
+

{{popCarInfo.title}}

+

{{popCarInfo.subTitle}} +

+
+
+ +
+ +
+
+ + + +
+
+ +
+
+
+
+ + + + +
+
+
+ +

{{info.channelName}}

+
+
+ 车管家 +

{{info.biz.biz_name}}

+
+
+
+

{{info.title}}

+ + +
+ +
+
+ + + +
+
+ +
+
+
+ +
+ +
+ + + \ No newline at end of file