index.vue 6.8 KB

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