followAccount.vue 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="outter-wrapper">
  3. <u--image width="750rpx" height="100vh" mode="aspectFit" :src="currentImgUrl"></u--image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. currentImgUrl: '',
  11. pageOptions: {name: 'gzh'}
  12. }
  13. },
  14. onLoad(options) {
  15. this.pageOptions = options
  16. let title = options.name == 'gzh' ? '关注公众号' : '加入社群'
  17. uni.setNavigationBarTitle({
  18. title: title
  19. })
  20. this.getData()
  21. },
  22. methods: {
  23. getData() {
  24. uni.showLoading()
  25. this.$api.getData({name: this.pageOptions.name}).then(res => {
  26. uni.hideLoading()
  27. if (res.data&&res.data.length) {
  28. this.currentImgUrl = res.data[0].img
  29. }
  30. }).catch(() => {
  31. uni.hideLoading()
  32. })
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .outter-wrapper {
  39. background-color: #000;
  40. height: 100vh;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. }
  45. </style>