BigimageView.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view style="width: 100%;height: 100%;">
  3. <customNav :shownav="true" title="" titledetl=""></customNav>
  4. <movable-area class="zoomablev" :scale-area="true">
  5. <movable-view class="map-show-wrap" scale='true' direction='all' out-of-bounds='true' scale-max='2'>
  6. <view style="width:100vw;height: 100vh;">
  7. <image style="width:100%;height: 100%;" :src="compleurl(mysrc)" mode="aspectFit" @load="complet"></image>
  8. </view>
  9. </movable-view>
  10. </movable-area>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. mysrc: '',
  18. baseUrl:'',
  19. }
  20. },
  21. onLoad(option) {
  22. this.baseUrl = imageBaseUrl;
  23. this.mysrc = option.mysrc;
  24. },
  25. methods: {
  26. compleurl(url){
  27. //console.log('------compleurl',url)
  28. if(!url){
  29. return '';
  30. }
  31. if(url.length<8){
  32. return '';
  33. }
  34. uni.showLoading({
  35. title:'Loading...',
  36. mask:false
  37. })
  38. var http= url.substring(0,8);
  39. if(http==='https://'){
  40. return url;
  41. }
  42. else if(http==='/static/'){
  43. return url;
  44. }
  45. else{
  46. return (this.baseUrl+url);
  47. }
  48. },
  49. complet(e){
  50. console.log(e);
  51. uni.hideLoading();
  52. },
  53. },
  54. }
  55. </script>
  56. <style scoped>
  57. /* 自定义样式 */
  58. .container {
  59. /* ... */
  60. }
  61. .zoomablev{
  62. width: 100vw;
  63. height: 100vh;
  64. }
  65. .map-show-wrap {
  66. width: 100%;
  67. height: 100%;
  68. }
  69. </style>