cert.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. import {getConfigByKey} from '@/api/common'
  10. export default {
  11. data() {
  12. return {
  13. certs:[]
  14. }
  15. },
  16. onLoad(val) {
  17. this.getConfigByKey();
  18. },
  19. methods: {
  20. getConfigByKey(){
  21. var that=this;
  22. var data={key:"his.certs"}
  23. getConfigByKey(data).then(
  24. res => {
  25. if(res.code==200){
  26. this.certs=JSON.parse(res.data).certs.split(',');
  27. }
  28. },
  29. rej => {}
  30. );
  31. },
  32. showImg(item) {
  33. //预览图片
  34. var urls=[];
  35. urls.push(item)
  36. uni.previewImage({
  37. urls: urls,
  38. current: 0
  39. });
  40. },
  41. }
  42. }
  43. </script>
  44. <style scoped lang="scss">
  45. page{
  46. height: 100%;
  47. }
  48. .my-content{
  49. width: 100%;
  50. display: flex;
  51. flex-direction: column;
  52. justify-content: center;
  53. align-items: center;
  54. .item{
  55. display: flex;
  56. flex-direction: row;
  57. justify-content: center;
  58. align-items: center;
  59. margin: 30rpx;
  60. width: 100%;
  61. image{
  62. }
  63. }
  64. }
  65. </style>