Himage.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="container">
  3. <!-- <img style="width:100%;height:100%" ref="img"
  4. :src="imageData"
  5. alt="" /> -->
  6. <uni-section title="自定义图片大小" type="line">
  7. <view class="example-body ">
  8. <uni-file-picker readonly :modelValue="imageList" :imageStyles="imageStyles" file-mediatype="image">
  9. </uni-file-picker>
  10. </view>
  11. </uni-section>
  12. <uni-file-picker :readonly="true" limit="4" :modelValue="imageList"></uni-file-picker>
  13. </view>
  14. </template>
  15. <script setup>
  16. import { defineProps,defineEmits,watch,ref, computed, onMounted } from 'vue';
  17. import http from '@/utils/request'
  18. import {uploadImageModelValue} from './OssService.js'
  19. onMounted(()=>{
  20. download("0245b5f852e94d68858be242a1d60c48,17c46c50f0f048ee848f0de61775feed,8305cfc469bd4e2bbcd299d44f68c642,0c3ce0ebf0294a42a53fb2ecb0dbe860,62f4bab183554a358ace6dcda78de923")
  21. })
  22. const imageData = ref("")
  23. const imageList = ref([])
  24. const imageStyles = ref({
  25. width: 64,
  26. height: 64,
  27. border: {
  28. radius: '50%'
  29. }
  30. })
  31. const download = (id)=> {
  32. // console.log(uploadImageModelValue(["b34e4e223b3245f497ae0031195fa3ed","b34e4e223b3245f497ae0031195fa3ed","b34e4e223b3245f497ae0031195fa3ed"]));
  33. imageList.value = uploadImageModelValue(id)
  34. console.log(imageList.value);
  35. }
  36. const doDownload = (id, url)=> {
  37. return http.oss(url,{id:id})
  38. }
  39. </script>
  40. <style>
  41. .example-body {
  42. padding: 10px;
  43. padding-top: 0;
  44. }
  45. </style>