user-service-search.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>搜索-服务中心-创业帮</title>
  6. <meta name="keywords" content="搜索-服务中心-创业帮">
  7. <meta name="description" content="搜索-服务中心-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="搜索-服务中心-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body>
  18. <div id="app">
  19. <div class="service-list" v-cloak>
  20. <van-search v-model="pageinfo.SearchKey" placeholder="请输入您的问题" :clearable="false" show-action @search="onSearch" @cancel="onCancel"></van-search>
  21. <van-cell-group>
  22. <van-cell :title="item.Title" :key="item.Id" is-link v-for="item in commonq" :border="false" @click="articledetail(item.Id)"></van-cell>
  23. </van-cell-group>
  24. </div>
  25. </div>
  26. <script src="./static/js/klm-vv.min.js"></script>
  27. <script src="./static/js/appfunc.min.js"></script>
  28. <script src="./static/js/klm-axios-config.js"></script>
  29. <script src="./static/js/publicfn.js"></script>
  30. <script>
  31. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  32. // 可以通过下面的方式手动注册
  33. Vue.use(vant.Lazyload);
  34. // 在 #app 标签下渲染一个按钮组件
  35. let app = new Vue({
  36. el: '#app',
  37. data() {
  38. return {
  39. active: 0,
  40. isShow: false,
  41. pageinfo:{
  42. PageSize:1000,
  43. PageNum:1,
  44. SearchKey: '',
  45. },
  46. commonq:[
  47. ],
  48. };
  49. },
  50. methods: {
  51. async onSearch() {
  52. const res = await getRequest('api/v1/servicecenter/search?t='+Math.random(6),JSON.stringify(this.pageinfo));
  53. if(res.status !== '1') return tips('搜索失败,请重试!');
  54. if(res.data.length === 0) return tips('暂无搜索结果');
  55. this.commonq = res.data;
  56. },
  57. //- 退回上一页
  58. onCancel() {
  59. PublicLib.GoBack({Level:1});
  60. },
  61. //- 跳转文章详情,存入Id
  62. articledetail(id){
  63. PublicLib.Goto({Url:'user-service-detail'});
  64. PublicLib.putCookieInfo('articleId', id);
  65. }
  66. }
  67. });
  68. </script>
  69. </body>
  70. </html>