photoView.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!--
  2. * @Title:
  3. * @Description: 照片预览
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  14. <text style="color: white;font-size: 1rem;">{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <uni-group>
  18. <view class="view-flex-block-center">
  19. <image mode="widthFix" style="margin-top: 0px;" :src="photoPath">
  20. </image>
  21. </view>
  22. </uni-group>
  23. </view>
  24. </template>
  25. <script>
  26. import http from '@/http/api.js';
  27. import {
  28. oss,
  29. devUrl,
  30. prodUrl
  31. } from '@/common/setting';
  32. export default {
  33. components: {},
  34. data() {
  35. return {
  36. title: '照片预览',
  37. desc: '',
  38. show: false,
  39. photoPath: '',
  40. baseURL: '',
  41. }
  42. },
  43. computed: {
  44. },
  45. onLoad(options) {
  46. this.photoPath = oss + options.url;
  47. console.log(this.photoPath)
  48. },
  49. onReady() {
  50. console.log("onReady++++++++++++++")
  51. },
  52. onShow() {
  53. },
  54. methods: {
  55. toBack() {
  56. uni.navigateBack({
  57. delta: 1
  58. })
  59. },
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .container {
  65. padding: 0 0 100rpx;
  66. }
  67. </style>