sell.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. mui.ready(function () {
  2. share = {
  3. "title": "高价卖车",
  4. "link": "http://www.3water.cn/buying/mobile/car/sell.jsp",
  5. "imgUrl": "http://www.3water.cn/buying/static/mobile/image/car/shou.jpg",
  6. "desc": "交给我们快捷、省心、安全"
  7. };
  8. $('.mui-bar-tab').on('tap', 'a', function(e) {
  9. location.href=$(this).attr("href");
  10. });
  11. $('#save-btn').on('tap', function(e) {
  12. if(!$('#user_name').val()||!$('#mobile').val()||!$('#address').val()||!$('#remark').val()){
  13. layer.open({content:'请将信息填写完整',time:3});
  14. return;
  15. }
  16. if(!mobile.checkMobile($('#mobile').val())){
  17. layer.open({content:'请输入正确手机号码',time:3});
  18. return;
  19. }
  20. var carInfo ={};
  21. carInfo.user_name = $('#user_name').val();
  22. carInfo.address = $('#address').val();
  23. carInfo.remark = $('#remark').val();
  24. carInfo.mobile = $('#mobile').val();
  25. mobile.ajaxPost(base+'/carInfo/save',carInfo,function(json){
  26. if(json.success){
  27. layer.open({content:'资料已提交,我们会尽快联系您',time:2});
  28. setTimeout(function () {
  29. location.reload();
  30. },2000);
  31. }else{
  32. layer.open({content:json.msg,time:3});
  33. }
  34. });
  35. });
  36. });