index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="page" :style="{'height':height}">
  3. <view class="backImage">
  4. <image class="backImage" src="/static/me/u655.png"></image>
  5. </view>
  6. <view class="content">
  7. <view class="userInfo flex-row justify-between ">
  8. <view class="flex-row">
  9. <view class="userPhoto" @click="navigateToPage('/myPages/userInfo/index')">
  10. <image class="userPhoto" :src="userInfo.selfPhotoUrl || '/static/me/ud4.png'"></image>
  11. </view>
  12. <view class="userTitle flex-col justify-center" @click="navigateToPage('/myPages/userInfo/index')">
  13. <text class="nickName">HI,亲爱的{{ userInfo.ncikName }}</text>
  14. <text class="xinxTitle">{{userInfo.no}}</text>
  15. </view>
  16. </view>
  17. <view class="qrcodeView flex-col justify-center" @click="navigateToPage('/pages/qrCode/index')">
  18. <image class="qrcode" src="/static/me/u5.png"></image>
  19. <text class="qrcodeTitle">会员码</text>
  20. </view>
  21. </view>
  22. <view class="sudoku flex-col">
  23. <view class="balance-name">
  24. <text>我的资产</text>
  25. </view>
  26. <view class="balance flex-row justify-around">
  27. <view class="balanceItem" @click="navigateToPage('/myPages/recharge/index')">
  28. <view class="icon flex-row justify-center">
  29. <u-icon name="/static/me/u701.png" color="red" size="30"></u-icon>
  30. </view>
  31. <view class="name">
  32. 余额
  33. </view>
  34. <view class="num">
  35. <text>{{ userInfo.balance || 0 }}</text>
  36. </view>
  37. </view>
  38. <view class="balanceItem">
  39. <view class="icon flex-row justify-center">
  40. <u-icon name="/static/me/u680.png" color="red" size="30"></u-icon>
  41. </view>
  42. <view class="name">
  43. 积分
  44. </view>
  45. <view class="num">
  46. <text>{{ userInfo.integral || 0 }}</text>
  47. </view>
  48. </view>
  49. <view class="balanceItem" @click="navigateToPage('/orderPages/myCoupon/index')">
  50. <view class="icon flex-row justify-center">
  51. <u-icon name="/static/me/u687.png" color="red" size="30"></u-icon>
  52. </view>
  53. <view class="name">
  54. 优惠券
  55. </view>
  56. <view class="num">
  57. <text>{{ userInfo.coupon || 0 }}</text>
  58. </view>
  59. </view>
  60. <view class="balanceItem" @click="navigateToPage('/storePages/myRights/index')">
  61. <view class="icon flex-row justify-center">
  62. <u-icon name="/static/me/u694.png" color="red" size="30"></u-icon>
  63. </view>
  64. <view class="name">
  65. 我的权益卡
  66. </view>
  67. <view class="num">
  68. <text>{{ userInfo.equityCardTotal || 0 }}</text>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="group">
  74. <uni-list>
  75. <uni-list-item :clickable="true" :title="item.title" showArrow :thumb="item.thumb" thumb-size="sm"
  76. :rightText="item.rightText" v-for="(item,index) in group1" :key="index" @click="clickListItem(item)"/>
  77. </uni-list>
  78. </view>
  79. <!-- <view class="group">-->
  80. <!-- <uni-list>-->
  81. <!-- <uni-list-item :to="item.to" :title="item.title" showArrow :thumb="item.thumb" thumb-size="sm" v-for="(item,index) in group2" :key="index" />-->
  82. <!-- </uni-list>-->
  83. <!-- </view>-->
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import tabBar from "../../components/tabBar/tabBar";
  89. export default {
  90. components: {
  91. tabBar
  92. },
  93. data() {
  94. return {
  95. group1: [
  96. // {thumb:'/static/me/u1796.png',title:'贡献奖励记录',rightText:'',to:''},
  97. // {thumb:'/static/me/u1803.png',title:'实名认证',rightText:'',to:'/myPages/realNameAuth/index'},
  98. {thumb: '/static/me/u1812.png', title: '服务对象管理', rightText: '', to: '/myPages/ServiceObjectManagement/index'},
  99. {thumb: '/static/me/u3.png', title: '邀请有礼', rightText: '', to: '/myPages/promotionCenter/index'},
  100. {thumb: '/static/me/u1833.png', title: '资产找回', rightText: '', to: '/myPages/systemSwitch/index'},
  101. {thumb: '/static/me/u826.png', title: '储值服务', rightText: '', to: '/myPages/recharge/index'},
  102. {thumb: '/static/me/u701.png', title: '交易记录', rightText: '', to: '/myPages/transactionRecord/index'},
  103. {thumb: '/static/me/u11.png', title: '会员须知', rightText: '', to: '/myPages/aboutOur/index'},
  104. // {thumb: '/static/me/familyCard_icon.png', title: '亲情卡', rightText: '', to: '/myPages/familyCard/index'}
  105. ],
  106. group2: [
  107. // {thumb:'/static/me/u10.png',title:'个人信息',rightText:'',to:'/myPages/userInfo/index'},
  108. // {thumb:'/static/me/u101.png',title:'设置',rightText:'',to:'/myPages/setting/index'}
  109. ],
  110. height: '',
  111. title: 'Hello',
  112. tabIndex: 4,
  113. userInfo: {}
  114. }
  115. },
  116. // 分享到朋友圈
  117. onShareTimeline() {
  118. },
  119. // 分享到用户
  120. onShareAppMessage(OBJECT) {
  121. },
  122. onLoad() {
  123. //
  124. // uni.hideTabBar({
  125. // animation: false
  126. // })
  127. let sysInfo = uni.getSystemInfoSync()
  128. this.height = sysInfo.windowHeight + 'px'
  129. },
  130. onShow() {
  131. // this.userInfo = uni.getStorageSync('userInfo')
  132. // if (this.userInfo.isAttestation){
  133. // this.group1[0].rightText = '已认证'
  134. // }else {
  135. // this.group1[0].rightText = '未实名认证,去认证'
  136. // }
  137. this.getUserInfo()
  138. },
  139. methods: {
  140. clickListItem(e){
  141. console.log(e)
  142. uni.navigateTo({
  143. url:e.to
  144. })
  145. },
  146. getUserInfo() {
  147. this.$api.getUserInfo().then(res => {
  148. console.log('++++++++++++获取用户信息++++++++++++++++++', res)
  149. uni.setStorageSync('userInfo', res.data.data)
  150. this.userInfo = res.data.data
  151. this.getImgUrlByOssId(this.userInfo.selfPhoto)
  152. })
  153. },
  154. getImgUrlByOssId(Id) {
  155. if (Id) {
  156. this.$api.getImage(Id).then(res => {
  157. this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  158. this.$set(this.userInfo)
  159. });
  160. }
  161. },
  162. navigateToPage(url) {
  163. uni.navigateTo({
  164. url: url
  165. })
  166. },
  167. }
  168. }
  169. </script>
  170. <style>
  171. @import '/common/css/common.css';
  172. @import './index.rpx.css';
  173. </style>