help.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view>
  3. <!--mine/help/help.wxml-->
  4. <view class="tit">常见问题</view>
  5. <view class="list">
  6. <block v-for="(item, index) in pageList" :key="index">
  7. <navigator :url="'/mine/page/page?id=' + item.id + '&title=' + item.title" hover-class="none" class="li">{{item.title}}<image src="/static/pages/images/more.png" class="rico"></image></navigator>
  8. </block>
  9. </view>
  10. <!-- <button class="zixun" open-type="contact">咨询客服</button> -->
  11. <view class="ddflex zixun-btn">
  12. <view class="fflex gfqw" v-if="config.WECOM_CODE" @click="isShowCodePop = true">添加官方企微</view>
  13. <view class="fflex">
  14. <contact-button class-name="zixun" button-text="咨询客服"></contact-button>
  15. </view>
  16. </view>
  17. <view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="()=>{}">
  18. </view>
  19. <view :class="'code-pop ' +(config.greyTheme==1?'grayTheme':'')" v-if="isShowCodePop">
  20. <view class="code-content">
  21. <image :src="config.WECOM_CODE"
  22. show-menu-by-longpress="true"></image>
  23. <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别微信二维码</view>
  24. </view>
  25. <view class="code-btn" @click="isShowCodePop = false">
  26. 取消
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. // mine/help/help.js
  33. const app = getApp();
  34. const req = require("../../utils/request.js");
  35. export default {
  36. data() {
  37. return {
  38. form: {
  39. page: 1,
  40. limit: 15
  41. },
  42. pageList: [],
  43. isLoad: true,
  44. config:{},
  45. isShowCodePop:false
  46. };
  47. },
  48. components: {},
  49. props: {},
  50. onLoad: async function(options) {
  51. this.getData();
  52. // console.log(options);
  53. if (options.scene) {
  54. this.scene = options.scene;
  55. }
  56. this.getAbout()
  57. // await this.loadCodeParams();
  58. },
  59. onReachBottom() {
  60. this.form.page++;
  61. this.getData();
  62. },
  63. methods: {
  64. loadCodeParams() {
  65. let _ts = this;
  66. return new Promise((resolve, reject) => {
  67. if (!_ts.scene) {
  68. resolve();
  69. return false;
  70. }
  71. req.getRequest('/api/code/params', {
  72. scene: _ts.scene
  73. }, data => {
  74. req.setStorage('pidCode', data.userId);
  75. resolve();
  76. });
  77. });
  78. },
  79. getAbout() {
  80. var _this = this;
  81. req.getRequest('/api/other/config', {}, function(res) {
  82. _this.config = res;
  83. });
  84. },
  85. getData() {
  86. // req.getRequest('/api/help/center', {}, data => {
  87. // if (data) {
  88. // this.setData({
  89. // pageList: data
  90. // });
  91. // }
  92. // });
  93. if (!this.isLoad) return false;
  94. this.isLoad = false;
  95. let form = this.form;
  96. form.code = 'help';
  97. req.getRequest('/api/content/list',form,res => {
  98. if (res && res.length >= 10) this.isLoad = true;
  99. if (this.form.page > 1) res = this.pageList.concat(res);
  100. this.pageList = res;
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style>
  107. @import "./help.css";
  108. </style>