skipone.vue 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="">
  3. <web-view v-if="url1" :src="url1"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. var wv; //计划创建的webview
  8. export default {
  9. data() {
  10. return {
  11. url1: '',
  12. canBack: false,
  13. };
  14. },
  15. methods: {
  16. addViews(data) {
  17. this.$request('/updateUserViews', 'POST', data).then(res => {
  18. console.log(res);
  19. })
  20. }
  21. },
  22. onLoad(e) {
  23. console.log(e);
  24. const data = JSON.parse(decodeURIComponent(e.item));
  25. // return console.log('data',data);
  26. // let data = JSON.parse(item)
  27. if(typeof data === 'object'){
  28. this.addViews({
  29. oid: this.$store.state.user.openid,
  30. cid: data.cid
  31. })
  32. return this.url1 = data.href
  33. }
  34. this.url1=data
  35. }
  36. }
  37. </script>
  38. <style lang="scss">
  39. .custom-back-button {
  40. position: fixed;
  41. top: 20px;
  42. left: 20px;
  43. background-color: #ffffff;
  44. padding: 10px;
  45. border-radius: 5px;
  46. }
  47. </style>