Activity.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view v-if="is_data" :class="['qn-page-' + theme]"><PageDesign :temData="temData" :pageBack="true" :isBackIndex="true"></PageDesign></view>
  3. </template>
  4. <script>
  5. import PageDesign from '@/components/PageDesign/PageDesign.vue';
  6. export default {
  7. components: {
  8. PageDesign
  9. },
  10. data() {
  11. return {
  12. temData: [],
  13. is_data: false,
  14. page_id: 18
  15. };
  16. },
  17. watch:{
  18. '$store.state.locationObj'(val){
  19. if(JSON.stringify(val)==='{}'){
  20. this.getAuthorizeInfo();
  21. return
  22. }
  23. this.getDetailById();
  24. }
  25. },
  26. onLoad(options) {
  27. if(JSON.stringify(this.$store.state.locationObj)==='{}'){
  28. this.getAuthorizeInfo();
  29. return
  30. }
  31. this.page_id = parseInt(options.id);
  32. this.getDetailById();
  33. },
  34. // 下拉刷新
  35. onPullDownRefresh() {
  36. this.getDetailById();
  37. },
  38. methods: {
  39. //首页
  40. getDetailById() {
  41. this.$u.api.getDetailById(this.page_id).then(({data})=>{
  42. uni.stopPullDownRefresh();
  43. this.is_data = true;
  44. this.temData = data;
  45. });
  46. }
  47. },
  48. onShareAppMessage(options) {
  49. return {
  50. title: this.$store.state.baseSet.shop,
  51. path: '/pages/index/index?businessmanId=' + (this.$store.state.userStatus.id||''),
  52. success: res => {
  53. console.log(res);
  54. }
  55. };
  56. }
  57. };
  58. </script>
  59. <style></style>