cert.vue 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="my-content">
  3. <view class="item" v-for="item in certs">
  4. <image @click="showImg(item)" :src="item"></image>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. certs:[
  13. ]
  14. }
  15. },
  16. onLoad(val) {
  17. var config=JSON.parse(uni.getStorageSync('config'));
  18. this.certs=config.certs.split(",");
  19. console.log(this.certs)
  20. },
  21. methods: {
  22. showImg(item) {
  23. //预览图片
  24. var urls=[];
  25. urls.push(item)
  26. console.log(urls)
  27. console.log(item)
  28. uni.previewImage({
  29. urls: urls,
  30. current: 0
  31. });
  32. },
  33. }
  34. }
  35. </script>
  36. <style scoped lang="scss">
  37. page{
  38. height: 100%;
  39. }
  40. .my-content{
  41. width: 100%;
  42. display: flex;
  43. flex-direction: column;
  44. justify-content: center;
  45. align-items: center;
  46. .item{
  47. display: flex;
  48. flex-direction: row;
  49. justify-content: center;
  50. align-items: center;
  51. margin: 30rpx;
  52. width: 100%;
  53. image{
  54. }
  55. }
  56. }
  57. </style>