BigimageView.vue 1.1 KB

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