index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="page" :style="{'height':windowHeight}">
  3. <view class="flex-col" v-if="equityList.length === 0">
  4. <view class="flex-row justify-center">
  5. <image class="empty" src="/static/imageIcon/empty.png" mode="widthFix"></image>
  6. </view>
  7. <view class="emptyText flex-row justify-center">
  8. <text>暂无内容</text>
  9. </view>
  10. </view>
  11. <scroll-view v-else scroll-y :style="{'height':windowHeight}">
  12. <view class="row-list flex-row justify-start" v-for="(item,index) in equityList" :key="index">
  13. <view class="h-text flex-col justify-center ">
  14. <view class="money">
  15. <text>¥{{item.faceValue}}</text>
  16. </view>
  17. <!-- <view class="desc">-->
  18. <!-- <text>{{item.title}}</text>-->
  19. <!-- </view>-->
  20. </view>
  21. <view class="h-center-content flex-col justify-around">
  22. <view class="h-value">
  23. <text>{{item.title}}</text>
  24. </view>
  25. <view class="title">
  26. 适用项目:{{item.serviceProjectName || ''}}
  27. </view>
  28. <view class="title">
  29. 绑定对象:{{item.serviceObjectName}}
  30. </view>
  31. <view class="title">
  32. 结束期限:{{item.effectiveEndTime.substring(0,10)}}
  33. </view>
  34. </view>
  35. <view class="h-right-content flex-col justify-center">
  36. <image class="h-right-content-img" :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFill" @click="magnify(item.facePhotoUrl)"></image>
  37. </view>
  38. </view>
  39. </scroll-view>
  40. <uni-popup ref="popup">
  41. <view class="magnifyUrlView">
  42. <image :src="magnifyUrl" mode="widthFix"></image>
  43. </view>
  44. </uni-popup>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. magnifyUrl:'',
  52. windowHeight:'',
  53. userInfo:{},
  54. equityList:[],
  55. };
  56. },
  57. onLoad(option) {
  58. let sysInfo = uni.getSystemInfoSync()
  59. this.windowHeight =sysInfo.windowHeight - 3 +'px'//除标题栏栏外的屏幕可用高度
  60. this.userInfo = uni.getStorageSync('userInfo')
  61. this.myEquityCardList()
  62. },
  63. methods: {
  64. magnify(url){
  65. if (!url){
  66. return
  67. }
  68. this.magnifyUrl = url
  69. this.$refs.popup.open()
  70. },
  71. myEquityCardList(){
  72. this.$api.myEquityCardList().then(res=>{
  73. console.log(res)
  74. this.equityList = res.data.data
  75. this.getImgUrlByBannerOssId(this.equityList)
  76. })
  77. },
  78. // 获取图片
  79. getImgUrlByBannerOssId(items){
  80. for(let i = 0; i <items.length; i++) {
  81. if (items[i].facePhoto){
  82. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  83. console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
  84. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  85. this.$set(this.equityList,i,items[i])
  86. })
  87. }
  88. }
  89. },
  90. },
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. @import '/common/css/common.css';
  95. @import './index.rpx.scss';
  96. </style>