aboutus.vue 956 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="content">
  3. <u-parse :content="content"></u-parse>
  4. </view>
  5. </template>
  6. <script>
  7. export default{
  8. data(){
  9. return{
  10. content:''
  11. }
  12. },
  13. onLoad() {
  14. this.init()
  15. },
  16. onShow() {
  17. this.initvist()
  18. },
  19. methods:{
  20. initvist(){
  21. let curPage = getCurrentPages();
  22. let route = curPage[curPage.length - 1].route; //获取当前页面的路由
  23. let code=uni.getStorageSync("code")
  24. let obj={
  25. page:route,
  26. code:code
  27. }
  28. if(code){
  29. uni.$u.http.post('/api/visit/add',obj,{
  30. custom: {
  31. auth: true
  32. }
  33. }).then((res) => {
  34. }).catch((err) => {
  35. })
  36. }
  37. },
  38. init(){
  39. let data=uni.getStorageSync("data")
  40. this.content=data[4].value
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="less">
  46. page{
  47. background-color: #FFFFFF;
  48. }
  49. .content{
  50. background-color: #fff;
  51. padding: 20rpx;
  52. margin:0 20rpx;
  53. height: 100%vh;
  54. .title{
  55. text-align: center;
  56. }
  57. }
  58. </style>