Procházet zdrojové kódy

Merge branch 'master' of http://116.63.33.55/git/zfjyjgfwpt

ljh před 3 roky
rodič
revize
dda8d6f799

+ 4 - 4
src/main/java/com/jd/zfjyjgfwpt/controller/FrontController.java

@@ -278,20 +278,20 @@ public class FrontController extends BaseController {
      * @param FYHYM 房源核验码
      */
     @GetMapping("houseSourceVerify")
-    public void houseSourceVerify(String FYHYM, String captcha) {
+    public void houseSourceVerify(String callback, String FYHYM, String captcha) {
         if (Blank.isEmpty(FYHYM, captcha)) {
-            sendJson(false, "房源核验码或验证码不能为空!", null);
+            sendJsonp(callback, false, "房源核验码或验证码不能为空!", null);
             return;
         }
 
         String saveCaptcha = Convert.toStr(redisTemplate.opsForValue().get(getRequest().getRequestedSessionId() + "-captcha"), "");
         if ("".equals(saveCaptcha) || !captcha.equals(saveCaptcha)) {
-            sendJson(false, "输入的验证码有误!", null);
+            sendJsonp(callback, false, "输入的验证码有误!", null);
             return;
         }
 
         final ApiResponse<?> apiResponse = service.houseSourceVerify(FYHYM);
-        sendJson(apiResponse.isSuccess(), apiResponse.getMsg(), apiResponse.getData());
+        sendJsonp(callback, apiResponse.isSuccess(), apiResponse.getMsg(), apiResponse.getData());
     }
 
     /**

+ 30 - 3
src/main/resources/static/main/complaint.html

@@ -90,12 +90,12 @@
 				</el-select>
 			</el-form-item>
 			<el-form-item label="手机号码:">
-				<el-input v-model="input2" type="number" placeholder="请输入手机号"></el-input>
+				<el-input class="getInputValue" v-model="input2" type="number" name="tel" placeholder="请输入手机号"></el-input>
 			</el-form-item>
 			<el-form-item label="验证码:">
 				<el-input v-model="input3" placeholder="请输入验证码" style="width: 183px;"></el-input>
-				<button id="getcode" class="but_code" @click="getBtn" v-text="text" v-if="isShow"></button>
-				<span class="gettingcode" style="cursor: default;" v-text="text" v-if="!isShow"></span>
+				<button id="codeGet" class="but_get_code" @click="getBtn" v-text="text" v-if="isShow"></button>
+				<span class="getting_code" style="cursor: default;" v-text="text" v-if="!isShow"></span>
 			</el-form-item>
 			<el-form-item label="投诉内容:">
 				<el-input
@@ -183,9 +183,36 @@
 				this.input1 = inputval
 			},
 			getBtn() {
+				var $tel = $('.getInputValue input[name="tel"]');
+				if (!$tel.val()) {
+				    layer.msg('请先输入手机号!');
+				    return;
+				}
+				
+				var phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+				if (!phoneReg.test($tel.val())) {
+				    layer.msg('请输入正确的手机号!');
+				    return;
+				}
+				
 				this.isShow = false;
 				this.text = this.nums + '秒后可重新获取';
 				clock = setInterval(this.doLoop, 1000); //一秒执行一次
+				
+				// console.log("发送短信")
+				$.ajax({
+				    type: 'GET',
+				    url: PATH + '/front/sendMessage',
+				    data: {
+				        phone: $tel.val()
+				    },
+				    success: function (json) {
+				        layer.msg(json.msg);
+				    },
+				    error: function (err) {
+				        layer.msg('网络错误!');
+				    }
+				})
 			},
 			doLoop() {
 				this.nums--;

+ 2 - 2
src/main/resources/static/main/css/complaint.css

@@ -77,7 +77,7 @@ main {
 	width: 450px;
 }
 
-.but_code {
+.but_get_code {
 	width: 130px;
 	margin-left: 10px;
 	margin-top: 0;
@@ -99,7 +99,7 @@ main {
 	line-height: 40px;
 }
 
-.gettingcode {
+.getting_code {
 	display: inline-block;
 	width: 130px;
 	margin-left: 10px;