BigimageView.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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:'https://backend.cityexpress168.com.vn/prod-api',
  19. }
  20. },
  21. onLoad(option) {
  22. this.mysrc = option.mysrc;
  23. },
  24. methods: {
  25. compleurl(url){
  26. //console.log('------compleurl',url)
  27. if(!url){
  28. return '';
  29. }
  30. if(url.length<8){
  31. return '';
  32. }
  33. uni.showLoading({
  34. title:'Loading...',
  35. mask:false
  36. })
  37. var http= url.substring(0,8);
  38. if(http==='https://'){
  39. return url;
  40. }
  41. else if(http==='/static/'){
  42. return url;
  43. }
  44. else{
  45. return (this.baseUrl+url);
  46. }
  47. },
  48. complet(e){
  49. console.log(e);
  50. uni.hideLoading();
  51. },
  52. },
  53. }
  54. </script>
  55. <style scoped>
  56. /* 自定义样式 */
  57. .container {
  58. /* ... */
  59. }
  60. .zoomablev{
  61. width: 100vw;
  62. height: 100vh;
  63. }
  64. .map-show-wrap {
  65. width: 100%;
  66. height: 100%;
  67. }
  68. </style>