index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="component-wrapper" :style="wrapper_style">
  3. <template v-if="list && list.length > 0">
  4. <img v-if="img.is_minApp==1" @click="$until.u_gopage('U_simplegraph',{value:img,choose_style:datas.choose_style})"
  5. v-for="(img, index) in list" :src="img.image || emptyImage" :key="index" :style="img_style">
  6. <!-- #ifdef MP-WEIXIN -->
  7. <img v-else @click="$until.u_gopage('U_simplegraph',{value:img,choose_style:datas.choose_style})" :src="img.image || emptyImage" :style="img_style">
  8. <!-- #endif -->
  9. <!-- #ifdef H5 -->
  10. <wx-open-launch-weapp v-else :username="img.gh_id" :path="img.minApp_link">
  11. <img @click="$until.u_gopage('U_simplegraph',{value:img,choose_style:datas.choose_style})" :src="img.image || emptyImage" :style="img_style">
  12. </wx-open-launch-weapp>
  13. <!-- #endif -->
  14. </template>
  15. <template v-else>
  16. <img :src="emptyImage" :style="img_style">
  17. </template>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: ['styles', 'datas'],
  23. data() {
  24. let siteinfo = getApp().globalData.siteinfo;
  25. let data = {
  26. settingFile: siteinfo,
  27. emptyImage: siteinfo.root_img + '/static/app/image.png',
  28. }
  29. return data;
  30. },
  31. computed: {
  32. /** 样式 */
  33. wrapper_style() {
  34. if (this.datas.list) {
  35. const {
  36. padding_top,
  37. padding_bottom,
  38. padding_left,
  39. padding_right,
  40. } = this.datas;
  41. return `
  42. padding-top: ${padding_top}px;
  43. padding-bottom: ${padding_bottom}px;
  44. padding-left: ${padding_left}px;
  45. padding-right: ${padding_right}px;
  46. `;
  47. }
  48. },
  49. img_style() {
  50. const {
  51. picture_border,
  52. } = this.datas;
  53. return `
  54. width: 100%;
  55. border-radius: ${picture_border}px;
  56. `;
  57. },
  58. /** 标题 */
  59. list() {
  60. return this.datas.list;
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .component-wrapper {
  67. width: 750rpx;
  68. }
  69. </style>