index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="container">
  3. <view class="h-content">
  4. <view class="" v-html="termOfService.aboutContent"></view>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. // import {getTermOfServiceByType} from '/src/api/me/me.js';
  10. export default {
  11. data() {
  12. return {
  13. reqParm: {
  14. auth: true,
  15. type: 1
  16. },
  17. termOfService: {
  18. aboutContent: "<p>会员协议会员协议会员协议会员协议会员协议会员协议</p>",
  19. aboutType: "1",
  20. createBy: "admin",
  21. createTime: "2023-07-30 08:53:17",
  22. id: "1685574269874098178",
  23. status: "0",
  24. updateBy: "admin",
  25. updateTime: "2023-07-30 21:04:51"
  26. }
  27. };
  28. },
  29. mounted() {
  30. },
  31. onLoad(option) {
  32. // 判断Openid是否为空
  33. if(!!option.data){
  34. this.reqParm.type = option.data;
  35. }
  36. this.getTermOfServiceByType();
  37. },
  38. methods: {
  39. // 获取服务条款信息
  40. getTermOfServiceByType(){
  41. // 获取数据
  42. this.$api.getTermOfServiceByType(this.reqParm).then((res)=>{
  43. if(res.aboutContent){
  44. this.termOfService.aboutContent = res.aboutContent
  45. }else{
  46. this.termOfService.aboutContent = "暂无信息!!!"
  47. }
  48. }).catch(() =>{
  49. uni.showToast({
  50. title: "操作失败"
  51. })
  52. });
  53. },
  54. }
  55. };
  56. </script>
  57. <style lang="scss">
  58. .container{
  59. padding: 12px;
  60. }
  61. </style>