index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="privacy">
  3. <!-- 头部功能组件 -->
  4. <cu-loadding :show="show" />
  5. <!-- header -->
  6. <cu-custom bgColor="bg-gradual-blue" isBack><view slot="content">隐私声明</view></cu-custom>
  7. <!-- section -->
  8. <view class="padding">
  9. <rich-text :nodes="describe"></rich-text>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. describe:"",
  18. show:true,//加载
  19. };
  20. },
  21. onLoad() {
  22. this.requestData();
  23. },
  24. methods: {
  25. // 请求富文本
  26. async requestData(){
  27. try{
  28. var res=await this.$global.request({method:"get",url:"/customer/statement/"});
  29. this.describe=this.$global.richTextChange(res.data.privacy_statement);
  30. }catch(err){
  31. this.showErr(err)
  32. }finally{
  33. this.show=false;
  34. }
  35. },
  36. // 报错
  37. showErr(content) {
  38. content = JSON.stringify(content) === '{}' ? '未知错误' : content;
  39. uni.showModal({
  40. content,
  41. showCancel: false,
  42. success: res => console.log(res)
  43. });
  44. },
  45. }
  46. };
  47. </script>
  48. <style lang="scss" scoped></style>