index.vue 6.5 KB

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