share.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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="/static/js/vue@2.js"></script>
  25. <script src="/static/js/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. #wechat_open_div canvas{
  51. margin:0 auto;
  52. width: 100%;
  53. }
  54. .more{
  55. margin-top: 1em;
  56. }
  57. [v-cloak]{
  58. display: none;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <div class="container-fluid" id="app" v-cloak>
  64. <div class="row">
  65. <div class="col-xs-12 col-md-4 col-md-offset-4 main_div">
  66. <div v-if="!error&&info&&isshow" class="col-xs-12">
  67. <div class="col-xs-12" v-if="type=='invent'">
  68. <div class="row">
  69. <div class="col-xs-12">
  70. <div class="page-header lead">
  71. <strong>招工|</strong>{{info.disstr}}
  72. </div>
  73. </div>
  74. <div class="col-me-6 col-xs-12" v-if="info.coninfo">
  75. <p class="text-left p-username">
  76. {{ getusername }}&nbsp;
  77. <span v-if="info.coninfo.is_realauth" class="label label-danger isrealauth">已实名</span>
  78. </p>
  79. </div>
  80. <div class="col-me-6 col-xs-12" v-if="info.coninfo">
  81. <p class="">{{ info.coninfo.gender }}|{{ info.coninfo.wage }}</p>
  82. </div>
  83. <div class="col-xs-12">
  84. <p class="lead">{{info.info}}</p>
  85. </div>
  86. <div class="col-xs-12">
  87. <p>
  88. <strong>地址:</strong>
  89. <div>{{info.city}}{{info.disc}}{{info.town}}</div>
  90. <div>{{info.address}}</div>
  91. </p>
  92. </div>
  93. <div class="col-xs-12">
  94. <p> <strong>工种:</strong>{{info.worktype}}</p>
  95. </div>
  96. <div class="col-xs-12">
  97. <p><strong>日工资:</strong>{{getdaysalary}}</p>
  98. </div>
  99. <div class="col-xs-12">
  100. <p class="text-right">{{info.createdate}}</p>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="col-xs-12" v-if="type=='jobhunting'">
  105. <div class="row">
  106. <div class="col-xs-12">
  107. <div class="page-header lead">
  108. <strong>找活|</strong>{{info.disstr}}
  109. </div>
  110. </div>
  111. <div class="col-xs-6" v-if="info.coninfo">
  112. <p class="text-left p-username">
  113. {{ getusername }}&nbsp;&nbsp;
  114. <span v-if="info.coninfo.is_realauth" class="label label-danger isrealauth">已实名</span>
  115. </p>
  116. </div>
  117. <div class="col-xs-6" v-if="info.coninfo">
  118. <p class="text-right">{{ info.coninfo.gender }}|{{ info.coninfo.wage }}</p>
  119. </div>
  120. <div class="col-xs-12">
  121. <p class="lead">{{info.info}}</p>
  122. </div>
  123. <div class="col-xs-12">
  124. <p class="text-left"> <strong>工种:</strong>{{info.worktype}}</p>
  125. </div>
  126. <div class="col-xs-12">
  127. <p class="text-left"><strong>日工资:</strong>{{getdaysalary}}</p>
  128. </div>
  129. <div class="col-xs-12">
  130. <p class="text-right"><small>{{info.createdate}}</small></p>
  131. </div>
  132. </div>
  133. </div>
  134. <div v-if="!iswechat">
  135. <div class="col-xs-12">
  136. <button @click="downloadapp" class="btn btn-primary btn-lg btn-block" role="button">
  137. 下载
  138. </button>
  139. </div>
  140. <div class="col-xs-12 qrcodelist">
  141. <div class="col-md-offset-3 col-md-6 col-xs-12 item">
  142. <div id="baiduqrcode"></div>
  143. <p class="text-center">应用宝下载地址</p>
  144. </div>
  145. </div>
  146. </div>
  147. <div v-else class="col-xs-12 more">
  148. <h1 class="text-center"><a href="https://wxaurl.cn/eZOxVkewett">查看电话</a></h1>
  149. </div>
  150. </div>
  151. <div v-if="!info" class="col-xs-12">
  152. <p class="lead text-center error-height">页面加载中</p>
  153. </div>
  154. <div v-if="error" class="col-xs-12">
  155. <p class="lead text-center error-height">{{ errormsg }}</p>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. <script>
  161. var app = new Vue({
  162. el:'#app',
  163. data:{
  164. iswechat:false,
  165. isshow:false,
  166. error:false,
  167. errormsg:"加载中",
  168. type:false,
  169. infoid:false,
  170. url:'https://app.tjzhxx.cn:10443/index.php',
  171. inventapi:'/index/invent/queryinfobyidforapp',
  172. jobhuntingapi:'/index/jobhunting/queryinfobyidforapp',
  173. info:false
  174. },
  175. computed: {
  176. getusername: function () {
  177. if(this.info){
  178. const wname = this.info.coninfo.wname;
  179. var firststr = wname.substr(0,1);
  180. switch(this.type){
  181. case 'invent':
  182. firststr+="XX";
  183. break;
  184. case 'jobhunting':
  185. firststr+="XX";
  186. break;
  187. }
  188. return firststr;
  189. }else{
  190. return "";
  191. }
  192. },
  193. getdaysalary:function(){
  194. if(this.info){
  195. if(this.info.daysalary>0){
  196. return this.info.daysalary;
  197. }else{
  198. return "面议";
  199. }
  200. }else{
  201. return "";
  202. }
  203. }
  204. },
  205. methods:{
  206. getQueryVariable(variable)
  207. {
  208. var query = window.location.search.substring(1);
  209. var vars = query.split("&");
  210. for (var i=0;i<vars.length;i++) {
  211. var pair = vars[i].split("=");
  212. if(pair[0] == variable){return pair[1];}
  213. }
  214. return(false);
  215. },
  216. getinfo(){
  217. this.type= this.getQueryVariable('type');
  218. this.infoid= this.getQueryVariable('infoid');
  219. var url_use = false;
  220. switch(this.type){
  221. case 'invent':
  222. url_use = this.url+this.inventapi;
  223. break;
  224. case 'jobhunting':
  225. url_use = this.url+this.jobhuntingapi;
  226. break;
  227. }
  228. if(url_use){
  229. var data = {
  230. 'id':this.infoid
  231. }
  232. $.post(url_use,data,function(res){
  233. res =JSON.parse(res);
  234. if(200===res.code){
  235. app.info = res.data
  236. }else{
  237. app.info=false
  238. app.error=true
  239. app.errormsg = res.msg;
  240. }
  241. });
  242. }
  243. },
  244. getqrcode(){
  245. if(this.isshow){
  246. var baiduUrl='https://a.app.qq.com/o/simple.jsp?pkgname=com.tjzhxx.craftsmen';
  247. $('#baiduqrcode').qrcode(baiduUrl);
  248. }else if(this.iswechat){
  249. /*var url = 'https://wxaurl.cn/eZOxVkewett';
  250. $('#wechat_open_div').qrcode(url);*/
  251. }
  252. },
  253. downloadapp(){
  254. let downurl="http://www.tjzhonghui.cn:20443/file/apk/app-watercat.apk";
  255. if(!this.error){
  256. var ua = navigator.userAgent.toLowerCase();
  257. var isAndroid = ua.indexOf('android') > -1 || ua.indexOf('linux') > -1;
  258. //仅处理android
  259. if(isAndroid){
  260. window.location="launchapp://com.tjzhxx.craftsmen";//打开某手机上的某个app应用
  261. setTimeout(function(){
  262. window.location=downurl;
  263. return
  264. },500);
  265. }
  266. }
  267. }
  268. },
  269. mounted(){
  270. var browser = {
  271. versions: function () {
  272. var u = navigator.userAgent, app = navigator.appVersion;
  273. return { //移动终端浏览器版本信息
  274. trident: u.indexOf('Trident') > -1, //IE内核
  275. presto: u.indexOf('Presto') > -1, //opera内核
  276. webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
  277. gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
  278. mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
  279. ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
  280. android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
  281. iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
  282. iPad: u.indexOf('iPad') > -1, //是否iPad
  283. webApp: u.indexOf('Safari') == -1, //是否ios web应该程序,没有头部与底部
  284. androidbrowser:u.indexOf('Browser') > -1, //android移动端浏览器
  285. iosbrowser:u.indexOf("Safari") > -1 && u.indexOf("Chrome") == -1
  286. };
  287. }(),
  288. language: (navigator.browserLanguage || navigator.language).toLowerCase()
  289. }
  290. if(!this.isshow){
  291. if (browser.versions.mobile) {
  292. var ua = navigator.userAgent.toLowerCase();
  293. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  294. this.error=false
  295. this.iswechat =true
  296. this.isshow=true
  297. }else if (ua.match(/WeiBo/i) == "weibo") {
  298. this.error=true
  299. this.errormsg="请使用浏览器打开"
  300. }else if (ua.match(/QQ/i) == "qq") {
  301. this.error=true
  302. this.errormsg="请使用浏览器打开"
  303. }else{
  304. this.isshow=true
  305. }
  306. }else{
  307. this.isshow=true
  308. }
  309. }
  310. this.getinfo();
  311. },
  312. updated: function () {
  313. this.$nextTick(function () {
  314. this.getqrcode()
  315. })
  316. }
  317. })
  318. </script>
  319. </body>
  320. </html>