index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="page">
  3. <view class="scroll-y">
  4. <view class="title">
  5. <text>我收到的亲情卡</text>
  6. </view>
  7. <view class="loveCardNull" v-if="gotList.length === 0">
  8. <view class="flex-row justify-center">
  9. <image src="/static/me/zhanwu.png" class="nullIcon"></image>
  10. </view>
  11. <view class="flex-row justify-center nullMsg">
  12. <text>暂无收到的亲情卡</text>
  13. </view>
  14. </view>
  15. <view v-else>
  16. <view class="loveCard" v-for="(item,index) in gotList" :key="index" @click="jumpToDetail(item,2)">
  17. <image src="/static/familyCard/shoudaoLove.png" class="imgBack"></image>
  18. <view class="loveCardMsg">
  19. <view class="flex-row">
  20. <view>
  21. <image :src="item.url || '/static/me/ud4.png'" class="avatar"></image>
  22. </view>
  23. <view class="flex-col">
  24. <text class="name">{{ item.presentUserName }}({{ item.relation }})</text>
  25. <text class="vipNo">{{ item.presentUserNo }}</text>
  26. </view>
  27. </view>
  28. <view class="flex-row justify-between">
  29. <!-- <view class="flex-col priceView">-->
  30. <!-- <text class="priceTitle">每月上限</text>-->
  31. <!-- <view>-->
  32. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  33. <!-- <text class="price">{{item.amountCap}}</text>-->
  34. <!-- </view>-->
  35. <!-- </view>-->
  36. <!-- <view class="flex-col priceView borderRight1">-->
  37. <!-- <text class="priceTitle">剩余额度</text>-->
  38. <!-- <view>-->
  39. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  40. <!-- <text class="price">{{item.totalBalance || 0}}</text>-->
  41. <!-- </view>-->
  42. <!-- </view>-->
  43. <!-- <view class="flex-col priceView borderRight1">-->
  44. <!-- <text class="priceTitle">已用额度</text>-->
  45. <!-- <view>-->
  46. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  47. <!-- <text class="price">{{item.amount || '0'}}</text>-->
  48. <!-- </view>-->
  49. <!-- </view>-->
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="title">
  55. <text>亲属列表</text>
  56. </view>
  57. <view class="loveCardNull" v-if="giveList.length === 0">
  58. <view class="flex-row justify-center">
  59. <image src="/static/me/zhanwu.png" class="nullIcon"></image>
  60. </view>
  61. <view class="flex-row justify-center nullMsg">
  62. <text>暂无亲属列表</text>
  63. </view>
  64. </view>
  65. <view v-else>
  66. <view class="loveCard" v-for="(item, index) in giveList" :key="index" @click="jumpToDetail(item,1)">
  67. <image src="/static/familyCard/zengsLove.png" class="imgBack"></image>
  68. <view class="loveCardMsg">
  69. <view class="flex-row justify-between">
  70. <view class="flex-row">
  71. <view>
  72. <image :src="item.url || '/static/me/ud4.png'" class="avatar"></image>
  73. </view>
  74. <view class="flex-col">
  75. <text class="name">{{ item.userName }}({{ item.relation }})</text>
  76. <text class="vipNo">{{ item.userNo }}</text>
  77. </view>
  78. </view>
  79. <view v-if="isShow(item.id)" class="flex-col justify-center" style="margin-right: 20rpx">
  80. <uni-icons size="12" color="red" type="smallcircle-filled"></uni-icons>
  81. </view>
  82. </view>
  83. <!-- <view class="flex-row justify-between">-->
  84. <!-- <view class="flex-col priceView ">-->
  85. <!-- <text class="priceTitle">每月上限</text>-->
  86. <!-- <view>-->
  87. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  88. <!-- <text class="price">{{item.amountCap}}</text>-->
  89. <!-- </view>-->
  90. <!-- </view>-->
  91. <!-- <view class="flex-col priceView borderRight2">-->
  92. <!-- <text class="priceTitle">可用额度</text>-->
  93. <!-- <view>-->
  94. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  95. <!-- <text class="price">{{item.totalBalance || 0}}</text>-->
  96. <!-- </view>-->
  97. <!-- </view>-->
  98. <!-- <view class="flex-col priceView borderRight2">-->
  99. <!-- <text class="priceTitle">已用额度</text>-->
  100. <!-- <view>-->
  101. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  102. <!-- <text class="price">{{item.amount || 0}}</text>-->
  103. <!-- </view>-->
  104. <!-- </view>-->
  105. <!-- </view>-->
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="bottom">
  111. <view class="flex-row justify-center agreementView">
  112. <u-icon name="/static/me/o1.png" size="20" v-if="choose" @click="changeChoose"></u-icon>
  113. <u-icon name="/static/me/o.png" size="20" v-else @click="changeChoose"></u-icon>
  114. <text class="read">我已阅读并同意</text>
  115. <text class="agreement" @click="gotoAgreement(12,'亲情卡使用说明')">使用说明</text>
  116. </view>
  117. <view class="zsBtn" @click="jumpToGive">赠送亲情卡</view>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. export default {
  123. name: "index",
  124. data() {
  125. return {
  126. readRecordList: [],
  127. choose: false,
  128. giveList: [],
  129. gotList: []
  130. }
  131. },
  132. onShow() {
  133. this.getGiveList()
  134. this.getGotList()
  135. this.notReadRecordList()
  136. },
  137. onPullDownRefresh() {
  138. this.getGiveList()
  139. this.getGotList()
  140. uni.stopPullDownRefresh()
  141. },
  142. methods: {
  143. isShow(id){
  144. if (this.readRecordList.includes(id)){
  145. return true
  146. }else {
  147. return false
  148. }
  149. },
  150. notReadRecordList() {
  151. this.$api.notReadRecordList().then(res => {
  152. this.readRecordList = res.data.data
  153. })
  154. },
  155. changeChoose() {
  156. this.choose = !this.choose
  157. },
  158. // 去协议页面
  159. gotoAgreement(type, name) {
  160. console.log(type, name)
  161. uni.navigateTo({
  162. url: '/myPages/TermsOfService/index?name=' + name + '&type=' + type,
  163. })
  164. },
  165. jumpToGive() {
  166. if (!this.choose) {
  167. uni.showToast({
  168. icon: 'none',
  169. duration: 3000,
  170. title: '请勾选使用说明'
  171. });
  172. } else {
  173. uni.navigateTo({
  174. url: '/myPages/familyCard/giveFamilyCard/giveFamilyCard'
  175. })
  176. }
  177. },
  178. jumpToDetail(item, number) {
  179. uni.navigateTo({
  180. url: '/myPages/familyCard/unbindFamilyCard/unbindFamilyCard?data=' + JSON.stringify(item) + '&type=' + number
  181. })
  182. },
  183. getImgUrlByOssId(list, number) {
  184. if (list) {
  185. for (let i = 0; i < list.length; i++) {
  186. let data = null
  187. if (number == 1) {
  188. data = list[i].userPhoto
  189. } else {
  190. data = list[i].presentUserPhoto
  191. }
  192. if (data) {
  193. this.$api.getImage(data).then(res => {
  194. list[i].url = res.data.data[0].url.replace(/^http:/, "https:")
  195. this.$set(list, i, list[i])
  196. });
  197. }
  198. }
  199. }
  200. },
  201. //获取我赠送的亲情卡列表
  202. getGiveList() {
  203. this.$api.getMyPresentList().then((res) => {
  204. this.giveList = res.data.data
  205. this.getImgUrlByOssId(this.giveList, 1)
  206. })
  207. },
  208. //查询我收到的情亲卡列表
  209. getGotList() {
  210. this.$api.getMyReceiveList().then((res) => {
  211. this.gotList = res.data.data
  212. this.getImgUrlByOssId(this.gotList, 2)
  213. })
  214. }
  215. }
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. @import "../familyCard/index.scss";
  220. </style>