share.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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="/static/wechat/jweixin-1.0.0.js"></script>
  12. <script src="/static/js/jquery.js"></script>
  13. <script src="/static/jssha/sha.js"></script>
  14. <script src="/static/wechat/wx_share_config.js"></script>
  15. <script>
  16. var share_info = {
  17. title:"水猫工匠app",
  18. desc:"水猫工匠app",
  19. link:window.location.href,
  20. imgUrl:'https://'+window.location.host+'__TMPL__/public/assets/images/favicon.png'
  21. };
  22. </script>
  23. <script src="/static/wechat/wx_share.js"></script>
  24. <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  25. <script src="https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
  26. <style>
  27. .main_div{
  28. }
  29. #app{
  30. margin-top: 0em;
  31. }
  32. .isrealauth{
  33. font-size: 8px;
  34. }
  35. .error-height{
  36. height: 200px;
  37. line-height: 200px;
  38. }
  39. .p-username{
  40. display: flex;
  41. align-items: center;
  42. }
  43. #baiduqrcode canvas{
  44. margin:0 auto;
  45. width: 100%;
  46. }
  47. .qrcodelist .item{
  48. padding: 1em;
  49. }
  50. </style>
  51. </head>
  52. <body>
  53. <div class="container-fluid" id="app" v-cloak>
  54. <div class="row">
  55. <div class="col-xs-12 col-md-4 col-md-offset-4 main_div">
  56. <div v-if="!error&&info" class="col-xs-12">
  57. <div class="col-xs-12" v-if="type=='invent'">
  58. <div class="row">
  59. <div class="col-xs-12">
  60. <div class="page-header lead">
  61. <strong>招工|</strong>{{info.disstr}}
  62. </div>
  63. </div>
  64. <div class="col-me-6 col-xs-12" v-if="info.coninfo">
  65. <p class="text-left p-username">
  66. {{ getusername }}&nbsp;
  67. <span v-if="info.coninfo.is_realauth" class="label label-danger isrealauth">已实名</span>
  68. </p>
  69. </div>
  70. <div class="col-me-6 col-xs-12" v-if="info.coninfo">
  71. <p class="">{{ info.coninfo.gender }}|{{ info.coninfo.wage }}</p>
  72. </div>
  73. <div class="col-xs-12">
  74. <p class="lead">{{info.info}}</p>
  75. </div>
  76. <div class="col-xs-12">
  77. <p>
  78. <strong>地址:</strong>
  79. <div>{{info.city}}{{info.disc}}{{info.town}}</div>
  80. <div>{{info.address}}</div>
  81. </p>
  82. </div>
  83. <div class="col-xs-12">
  84. <p> <strong>工种:</strong>{{info.worktype}}</p>
  85. </div>
  86. <div class="col-xs-12">
  87. <p><strong>日工资:</strong>{{getdaysalary}}</p>
  88. </div>
  89. <div class="col-xs-12">
  90. <p class="text-right">{{info.createdate}}</p>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="col-xs-12" v-if="type=='jobhunting'">
  95. <div class="row">
  96. <div class="col-xs-12">
  97. <div class="page-header lead">
  98. <strong>找活|</strong>{{info.disstr}}
  99. </div>
  100. </div>
  101. <div class="col-xs-6" v-if="info.coninfo">
  102. <p class="text-left p-username">
  103. {{ getusername }}&nbsp;&nbsp;
  104. <span v-if="info.coninfo.is_realauth" class="label label-danger isrealauth">已实名</span>
  105. </p>
  106. </div>
  107. <div class="col-xs-6" v-if="info.coninfo">
  108. <p class="text-right">{{ info.coninfo.gender }}|{{ info.coninfo.wage }}</p>
  109. </div>
  110. <div class="col-xs-12">
  111. <p class="lead">{{info.info}}</p>
  112. </div>
  113. <div class="col-xs-12">
  114. <p class="text-left"> <strong>工种:</strong>{{info.worktype}}</p>
  115. </div>
  116. <div class="col-xs-12">
  117. <p class="text-left"><strong>日工资:</strong>{{getdaysalary}}</p>
  118. </div>
  119. <div class="col-xs-12">
  120. <p class="text-right"><small>{{info.createdate}}</small></p>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="col-xs-12">
  125. <button @click="downloadapp" class="btn btn-primary btn-lg btn-block" role="button">
  126. 下载
  127. </button>
  128. </div>
  129. <div class="col-xs-12 qrcodelist">
  130. <div class="col-md-offset-3 col-md-6 col-xs-12 item">
  131. <div id="baiduqrcode"></div>
  132. <p class="text-center">百度手机助手下载地址</p>
  133. </div>
  134. </div>
  135. </div>
  136. <div v-else class="col-xs-12">
  137. <p class="lead text-center error-height">{{ errormsg }}</p>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <script>
  143. var app = new Vue({
  144. el:'#app',
  145. data:{
  146. error:false,
  147. errormsg:"加载中",
  148. type:false,
  149. infoid:false,
  150. url:'https://app.tjzhxx.cn:10443/index.php',
  151. inventapi:'/index/invent/queryinfobyidforapp',
  152. jobhuntingapi:'/index/jobhunting/queryinfobyidforapp',
  153. info:false
  154. },
  155. computed: {
  156. getusername: function () {
  157. if(this.info){
  158. const wname = this.info.coninfo.wname;
  159. var firststr = wname.substr(0,1);
  160. switch(this.type){
  161. case 'invent':
  162. firststr+="XX";
  163. break;
  164. case 'jobhunting':
  165. firststr+="XX";
  166. break;
  167. }
  168. return firststr;
  169. }else{
  170. return "";
  171. }
  172. },
  173. getdaysalary:function(){
  174. if(this.info){
  175. if(this.info.daysalary>0){
  176. return this.info.daysalary;
  177. }else{
  178. return "面议";
  179. }
  180. }else{
  181. return "";
  182. }
  183. }
  184. },
  185. methods:{
  186. getQueryVariable(variable)
  187. {
  188. var query = window.location.search.substring(1);
  189. var vars = query.split("&");
  190. for (var i=0;i<vars.length;i++) {
  191. var pair = vars[i].split("=");
  192. if(pair[0] == variable){return pair[1];}
  193. }
  194. return(false);
  195. },
  196. getinfo(){
  197. this.type= this.getQueryVariable('type');
  198. this.infoid= this.getQueryVariable('infoid');
  199. var url_use = false;
  200. switch(this.type){
  201. case 'invent':
  202. url_use = this.url+this.inventapi;
  203. break;
  204. case 'jobhunting':
  205. url_use = this.url+this.jobhuntingapi;
  206. break;
  207. }
  208. if(url_use){
  209. var data = {
  210. 'id':this.infoid
  211. }
  212. $.post(url_use,data,function(res){
  213. res =JSON.parse(res);
  214. if(200===res.code){
  215. app.info = res.data
  216. }else{
  217. app.info=false
  218. app.error=true
  219. app.errormsg = res.msg;
  220. }
  221. });
  222. }
  223. },
  224. getqrcode(){
  225. var baiduUrl='https://mobile.baidu.com/item?docid=30633471&f0=search_suggestContent%400_appBaseNormal%400';
  226. $('#baiduqrcode').qrcode(baiduUrl);
  227. },
  228. downloadapp(){
  229. let downurl="http://www.tjzhonghui.cn:20443/file/apk/app-watercat.apk";
  230. if(!this.error){
  231. var ua = navigator.userAgent.toLowerCase();
  232. var isAndroid = ua.indexOf('android') > -1 || ua.indexOf('linux') > -1;
  233. //仅处理android
  234. if(isAndroid){
  235. window.location="launchapp://com.tjzhxx.craftsmen";//打开某手机上的某个app应用
  236. setTimeout(function(){
  237. window.location=downurl;
  238. return
  239. },500);
  240. }
  241. }
  242. }
  243. },
  244. mounted(){
  245. var browser = {
  246. versions: function () {
  247. var u = navigator.userAgent, app = navigator.appVersion;
  248. return { //移动终端浏览器版本信息
  249. trident: u.indexOf('Trident') > -1, //IE内核
  250. presto: u.indexOf('Presto') > -1, //opera内核
  251. webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
  252. gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
  253. mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
  254. ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
  255. android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
  256. iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
  257. iPad: u.indexOf('iPad') > -1, //是否iPad
  258. webApp: u.indexOf('Safari') == -1, //是否ios web应该程序,没有头部与底部
  259. androidbrowser:u.indexOf('Browser') > -1, //android移动端浏览器
  260. iosbrowser:u.indexOf("Safari") > -1 && u.indexOf("Chrome") == -1
  261. };
  262. }(),
  263. language: (navigator.browserLanguage || navigator.language).toLowerCase()
  264. }
  265. if (browser.versions.mobile) {
  266. var ua = navigator.userAgent.toLowerCase();
  267. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  268. this.error="true"
  269. this.errormsg="请使用浏览器打开"
  270. }
  271. if (ua.match(/WeiBo/i) == "weibo") {
  272. this.error="true"
  273. this.errormsg="请使用浏览器打开"
  274. }
  275. if (ua.match(/QQ/i) == "qq") {
  276. this.error="true"
  277. this.errormsg="请使用浏览器打开"
  278. }
  279. }
  280. this.getinfo();
  281. },
  282. updated: function () {
  283. this.$nextTick(function () {
  284. this.getqrcode()
  285. })
  286. }
  287. })
  288. </script>
  289. </body>
  290. </html>