index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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">
  70. <view>
  71. <image :src="item.url || '/static/me/ud4.png'" class="avatar"></image>
  72. </view>
  73. <view class="flex-col">
  74. <text class="name">{{item.userName}}({{item.relation}})</text>
  75. <text class="vipNo">{{item.userNo}}</text>
  76. </view>
  77. </view>
  78. <!-- <view class="flex-row justify-between">-->
  79. <!-- <view class="flex-col priceView ">-->
  80. <!-- <text class="priceTitle">每月上限</text>-->
  81. <!-- <view>-->
  82. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  83. <!-- <text class="price">{{item.amountCap}}</text>-->
  84. <!-- </view>-->
  85. <!-- </view>-->
  86. <!-- <view class="flex-col priceView borderRight2">-->
  87. <!-- <text class="priceTitle">可用额度</text>-->
  88. <!-- <view>-->
  89. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  90. <!-- <text class="price">{{item.totalBalance || 0}}</text>-->
  91. <!-- </view>-->
  92. <!-- </view>-->
  93. <!-- <view class="flex-col priceView borderRight2">-->
  94. <!-- <text class="priceTitle">已用额度</text>-->
  95. <!-- <view>-->
  96. <!-- &lt;!&ndash;<text class="priceSymbol">¥</text>&ndash;&gt;-->
  97. <!-- <text class="price">{{item.amount || 0}}</text>-->
  98. <!-- </view>-->
  99. <!-- </view>-->
  100. <!-- </view>-->
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="bottom">
  106. <view class="flex-row justify-center agreementView">
  107. <u-icon name="/static/me/o1.png" size="20" v-if="choose" @click="changeChoose"></u-icon>
  108. <u-icon name="/static/me/o.png" size="20" v-else @click="changeChoose"></u-icon>
  109. <text class="read">我已阅读并同意</text>
  110. <text class="agreement" @click="gotoAgreement(12,'亲情卡使用说明')">使用说明</text>
  111. </view>
  112. <view class="zsBtn" @click="jumpToGive">赠送亲情卡</view>
  113. </view>
  114. </view>
  115. </template>
  116. <script>
  117. export default {
  118. name: "index",
  119. data() {
  120. return {
  121. choose: false,
  122. giveList: [],
  123. gotList: []
  124. }
  125. },
  126. onShow() {
  127. this.getGiveList()
  128. this.getGotList()
  129. },
  130. onPullDownRefresh() {
  131. this.getGiveList()
  132. this.getGotList()
  133. uni.stopPullDownRefresh()
  134. },
  135. methods: {
  136. changeChoose() {
  137. this.choose = !this.choose
  138. },
  139. // 去协议页面
  140. gotoAgreement(type, name) {
  141. console.log(type,name)
  142. uni.navigateTo({
  143. url: '/myPages/TermsOfService/index?name=' + name + '&type=' + type,
  144. })
  145. },
  146. jumpToGive() {
  147. if (!this.choose) {
  148. uni.showToast({
  149. icon: 'none',
  150. duration: 3000,
  151. title: '请勾选使用说明'
  152. });
  153. } else {
  154. uni.navigateTo({
  155. url: '/myPages/familyCard/giveFamilyCard/giveFamilyCard'
  156. })
  157. }
  158. },
  159. jumpToDetail(item,number) {
  160. uni.navigateTo({
  161. url: '/myPages/familyCard/unbindFamilyCard/unbindFamilyCard?data=' + JSON.stringify(item) + '&type=' + number
  162. })
  163. },
  164. getImgUrlByOssId(list, number) {
  165. if (list) {
  166. for (let i=0;i<list.length;i++){
  167. let data = null
  168. if (number == 1) {
  169. data = list[i].userPhoto
  170. } else {
  171. data = list[i].presentUserPhoto
  172. }
  173. if (data) {
  174. this.$api.getImage(data).then(res => {
  175. list[i].url = res.data.data[0].url.replace(/^http:/, "https:")
  176. this.$set(list,i,list[i])
  177. });
  178. }
  179. }
  180. }
  181. },
  182. //获取我赠送的亲情卡列表
  183. getGiveList() {
  184. this.$api.getMyPresentList().then((res) => {
  185. this.giveList = res.data.data
  186. this.getImgUrlByOssId(this.giveList, 1)
  187. })
  188. },
  189. //查询我收到的情亲卡列表
  190. getGotList() {
  191. this.$api.getMyReceiveList().then((res) => {
  192. this.gotList = res.data.data
  193. this.getImgUrlByOssId(this.gotList, 2)
  194. })
  195. }
  196. }
  197. }
  198. </script>
  199. <style scoped lang="scss">
  200. @import "../familyCard/index.scss";
  201. </style>