note1.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="page">
  3. <view v-for="(m,index) in note" :key='index' class="line" @tap='href(index)'>
  4. {{m.title}}
  5. <uni-icons type='arrowright' style="display: inline-block;float: right;"></uni-icons>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import uniIcons from '../../components/uni-icons/uni-icons.vue'
  11. import http from '../../library/http.js'
  12. export default {
  13. components: {
  14. uniIcons
  15. },
  16. data() {
  17. return {
  18. note:uni.getStorageSync('note'),
  19. };
  20. },
  21. methods:{
  22. href(index){
  23. uni.navigateTo({
  24. url:'notedetail?index='+index
  25. })
  26. },
  27. getlist(){
  28. http.setWait(false).get('index.php?act=getnote',{}).then(res=>{
  29. var data=res.data;
  30. this.note=data;
  31. // console.log(data);
  32. uni.setStorageSync('note',data);
  33. })
  34. },
  35. },
  36. onLoad() {
  37. this.getlist();
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .page{
  43. background-color: #fafafa;
  44. }
  45. .line{
  46. background-color: #fff;
  47. margin: 10px 0px;
  48. padding: 0px 10px;
  49. font-size: 14px;
  50. height: 40px;
  51. line-height: 40px;
  52. }
  53. </style>