user-service-search.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/klm-axios-config.js"></script>
  28. <script>
  29. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  30. // 可以通过下面的方式手动注册
  31. Vue.use(vant.Lazyload);
  32. // 在 #app 标签下渲染一个按钮组件
  33. let app = new Vue({
  34. el: '#app',
  35. data() {
  36. return {
  37. active: 0,
  38. isShow: false,
  39. pageinfo:{
  40. PageSize:1000,
  41. PageNum:1,
  42. SearchKey: '',
  43. },
  44. commonq:[
  45. ],
  46. };
  47. },
  48. methods: {
  49. async onSearch() {
  50. const res = await getRequest('/api/v1/servicecenter/search',JSON.stringify(this.pageinfo));
  51. if(res.status !== '1') return tips('搜索失败,请重试!');
  52. if(res.data.length === 0) return tips('暂无搜索结果');
  53. this.commonq = res.data;
  54. },
  55. //- 退回上一页
  56. onCancel() {
  57. PublicLib.GoBack({Level:1});
  58. },
  59. //- 跳转文章详情,存入Id
  60. articledetail(id){
  61. PublicLib.Goto({Url:'user-service-detail'});
  62. PublicLib.putCookieInfo('articleId', id);
  63. }
  64. }
  65. });
  66. </script>
  67. </body>
  68. </html>