index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="page" :style="{'height':windowHeight}">
  3. <view class="flex-col" v-if="!equityList">
  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" v-for="(item,index) in equityList" :key="index">
  13. <view class="flex-row justify-start" @click.stop="showRemark(item)">
  14. <view class="h-text flex-col justify-center ">
  15. <view class="money">
  16. <text>{{item.faceValue}}</text>
  17. </view>
  18. <!-- <view class="desc">-->
  19. <!-- <text>{{item.title}}</text>-->
  20. <!-- </view>-->
  21. </view>
  22. <view class="h-center-content flex-col justify-around ">
  23. <view class="h-value">
  24. <text>{{item.title}}</text>
  25. </view>
  26. <view class="title">
  27. 适用项目:{{item.serviceProjectName || ''}}
  28. </view>
  29. <view class="title">
  30. 适用门店:{{ item.useStoreDesc || '' }}
  31. </view>
  32. <view class="title">
  33. 绑定对象:{{item.serviceObjectName}}
  34. </view>
  35. <view class="title">
  36. 结束期限:{{item.effectiveEndTime.substring(0,10)}}
  37. </view>
  38. </view>
  39. <view class=" flex-col justify-center ">
  40. <image class="h-right-content-img " :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFit" @click="magnify(item.facePhotoUrl)"></image>
  41. </view>
  42. </view>
  43. <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
  44. <view v-if="item.description !=null">
  45. 使用说明:
  46. <text>{{ item.description }}</text>
  47. </view>
  48. <text v-else class="remarkText">该优惠券暂无使用说明</text>
  49. </view>
  50. </view>
  51. </scroll-view>
  52. <uni-popup ref="popup">
  53. <view class="magnifyUrlView">
  54. <image :src="magnifyUrl" mode="widthFix"></image>
  55. </view>
  56. </uni-popup>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. showRemarkId:'',
  64. magnifyUrl:'',
  65. windowHeight:'',
  66. userInfo:{},
  67. equityList:[],
  68. };
  69. },
  70. onLoad(option) {
  71. let sysInfo = uni.getSystemInfoSync()
  72. this.windowHeight =sysInfo.windowHeight - 3 +'px'//除标题栏栏外的屏幕可用高度
  73. this.userInfo = uni.getStorageSync('userInfo')
  74. this.myEquityCardList()
  75. },
  76. methods: {
  77. showRemark(item) {
  78. if (this.showRemarkId == item.id) {
  79. this.showRemarkId = ''
  80. } else {
  81. this.showRemarkId = item.id
  82. }
  83. },
  84. magnify(url){
  85. if (!url){
  86. return
  87. }
  88. this.magnifyUrl = url
  89. this.$refs.popup.open()
  90. },
  91. myEquityCardList(){
  92. this.$api.myEquityCardList().then(res=>{
  93. console.log(res)
  94. this.equityList = res.data.data
  95. if (this.equityList){
  96. this.getImgUrlByBannerOssId(this.equityList)
  97. }
  98. })
  99. },
  100. // 获取图片
  101. getImgUrlByBannerOssId(items){
  102. for(let i = 0; i <items.length; i++) {
  103. if (items[i].facePhoto){
  104. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  105. console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
  106. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  107. this.$set(this.equityList,i,items[i])
  108. })
  109. }
  110. }
  111. },
  112. },
  113. };
  114. </script>
  115. <style lang="scss" scoped>
  116. @import '/common/css/common.css';
  117. @import './index.rpx.scss';
  118. </style>