share.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>水猫工匠</title>
  8. <link rel="icon" href="__TMPL__/public/assets/images/favicon.png" type="image/png">
  9. <link href="__TMPL__/public/assets/simpleboot3/themes/simpleboot3/bootstrap.min.css" rel="stylesheet">
  10. <link href="__TMPL__/public/assets/simpleboot3/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  11. <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
  12. <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  13. <style>
  14. .main_div{
  15. border:1px solid #fffccc;
  16. }
  17. #app{
  18. margin-top: 1em;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <div class="container-fluid" id="app">
  24. <div class="row">
  25. <div class="col-xs-12 col-md-4 col-md-offset-4 main_div">
  26. <div v-if="!error&&info" class="col-xs-12">
  27. <div class="col-xs-12" v-if="type=='invent'">
  28. <div class="row">
  29. <div class="col-xs-12">
  30. <p class="lead"> <strong>招工|</strong>{{info.info}}</p>
  31. </div>
  32. <div class="col-xs-6">
  33. <p> {{ getusername }}<span v-if="info.coninfo.is_realauth" class="label label-danger">已实名</span></p>
  34. </div>
  35. <div class="col-xs-3">
  36. <p>{{ info.coninfo.gender }}</p>
  37. </div>
  38. <div class="col-xs-3">
  39. <p>{{ info.coninfo.wage }}</p>
  40. </div>
  41. <div class="col-xs-12">
  42. <p>
  43. <strong>地址:</strong>
  44. <div>{{info.city}}{{info.disc}}</div>
  45. <div>{{info.address}}</div>
  46. </p>
  47. </div>
  48. <div class="col-xs-12">
  49. <p> <strong>工种:</strong>{{info.worktype}}</p>
  50. </div>
  51. <div class="col-xs-12">
  52. <p><strong>日工资:</strong>{{getdaysalary}}</p>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="col-xs-12" v-if="type=='jobhunting'">
  57. </div>
  58. </div>
  59. <div v-else class="col-xs-12">
  60. <p>{{ error }}</p>
  61. </div>
  62. <div class="col-xs-12">
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <script>
  68. var app = new Vue({
  69. el:'#app',
  70. data:{
  71. error:false,
  72. type:false,
  73. infoid:false,
  74. url:'https://app.tjzhxx.cn:10443/index.php',
  75. inventapi:'/index/invent/queryinfobyidforapp',
  76. jobhuntingapi:'/index/invent/queryinfobyidforapp',
  77. info:false
  78. },
  79. computed: {
  80. getusername: function () {
  81. if(this.info){
  82. const wname = this.info.coninfo.wname;
  83. var firststr = wname.substr(0,1);
  84. switch(this.type){
  85. case 'invent':
  86. firststr+="老板";
  87. break;
  88. case 'jobhunting':
  89. firststr+="XX";
  90. break;
  91. }
  92. return firststr;
  93. }else{
  94. return "";
  95. }
  96. },
  97. getdaysalary:function(){
  98. if(this.info){
  99. if(this.info.daysalary>0){
  100. return this.info.daysalary;
  101. }else{
  102. return "面议";
  103. }
  104. }else{
  105. return "";
  106. }
  107. }
  108. },
  109. methods:{
  110. getQueryVariable(variable)
  111. {
  112. var query = window.location.search.substring(1);
  113. var vars = query.split("&");
  114. for (var i=0;i<vars.length;i++) {
  115. var pair = vars[i].split("=");
  116. if(pair[0] == variable){return pair[1];}
  117. }
  118. return(false);
  119. },
  120. getinfo(){
  121. var url_use = false;
  122. switch(this.type){
  123. case 'invent':
  124. url_use = this.url+this.inventapi;
  125. break;
  126. case 'jobhunting':
  127. url_use = this.url+this.jobhuntingapi;
  128. break;
  129. }
  130. if(url_use){
  131. var data = {
  132. 'id':this.infoid
  133. }
  134. $.post(url_use,data,function(res){
  135. console.log(res);
  136. if(200===res.code){
  137. app.info = res.data
  138. }else{
  139. app.error = res.msg;
  140. }
  141. });
  142. }else{
  143. }
  144. }
  145. },
  146. mounted(){
  147. this.type= this.getQueryVariable('type');
  148. this.infoid= this.getQueryVariable('infoid');
  149. console.log(this.type,this.infoid);
  150. this.getinfo();
  151. }
  152. })
  153. </script>
  154. </body>
  155. </html>