branddetails.vue 1006 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="pages">
  3. <u-navbar
  4. title="品牌详情"
  5. :placeholder="true"
  6. :autoBack="false"
  7. @leftClick="leftClick"
  8. :safeAreaInsetTop="true"
  9. >
  10. </u-navbar>
  11. <u-loading-page :loading="loadingPage" bgColor="#f1f1f1"></u-loading-page>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. staticUrl:this.$commonConfig.staticUrl,
  19. id:'',
  20. loadingPage:true,
  21. details:{}
  22. }
  23. },
  24. onShow() {
  25. },
  26. onLoad(page) {
  27. this.id = page.id;
  28. this.getDetails(this.id);
  29. },
  30. methods: {
  31. leftClick(e){
  32. let pages = getCurrentPages();
  33. if(pages.length==1){
  34. uni.$u.route('/pages/index/index')
  35. }else{
  36. uni.navigateBack()
  37. };
  38. },
  39. getDetails(id){
  40. this.$u.api.memberGoodDetails({id:id}).then(res=>{
  41. this.loadingPage = false;
  42. // console.log('res',res.data);
  43. this.details = res.data;
  44. }).catch(err=>{
  45. console.log('getDetails',err.data);
  46. })
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. </style>