index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="my" :style="{background:'url('+ bannerImage +')'}">
  3. <view><nav-bar title="none" icon="none" background="transparent" border-color="transparent" ></nav-bar></view>
  4. <view class="content">
  5. <view class="news flex jcsb">
  6. <view class="info flex">
  7. <view style="width:128rpx;height:128rpx"><image class="img" :src="avatar" @tap="chooseImage"></image></view>
  8. <view class="info-text flex-column jcsa">
  9. <view class="info-top flex aic">
  10. <view class="name">王安安</view>
  11. <view class="level flex aic">
  12. <re-image imgSrc="/retail/main/ic_chuji.png" width="54" height="60"></re-image>
  13. <view class="level-text">初级</view>
  14. </view>
  15. </view>
  16. <view class="phone">13630639549</view>
  17. </view>
  18. </view>
  19. <view class="right" @click="logOut"><re-image imgSrc="/retail/my/ic_more.png" width="24" height="24" class="more"></re-image></view>
  20. </view>
  21. <view class="menu">
  22. <view class="menu-item item-one">
  23. <view class="item-left flex aic jcsb" @click="toAccount">
  24. <view class="flex aic">
  25. <re-image imgSrc="/retail/my/ic_jilu.png" width="48" height="48"></re-image>
  26. <text>账户充值记录</text>
  27. </view>
  28. <re-image imgSrc="/retail/my/ic_more.png" width="24" height="24"></re-image>
  29. </view>
  30. </view>
  31. <view class="menu-item">
  32. <view class="item-left flex aic jcsb">
  33. <view class="flex aic">
  34. <re-image imgSrc="/retail/my/ic_kefu.png" width="48" height="48"></re-image>
  35. <text>联系客服</text>
  36. </view>
  37. <re-image imgSrc="/retail/my/ic_more.png" width="24" height="24"></re-image>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <u-popup :show="show" @close="close" @open="open">
  43. <view class="safe-area-inset-bottom">
  44. <view class="login-out">退出登录</view>
  45. </view>
  46. </u-popup>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. toRpx
  52. } from '@/utils/calculate.js'
  53. import defaultConfig from '@/config/default.js'
  54. export default {
  55. components: {},
  56. computed: {
  57. statusBarHeight() {
  58. return this.$store.state.info.systemInfo?.statusBarHeight
  59. },
  60. },
  61. data() {
  62. return {
  63. show:false,
  64. bannerImage: defaultConfig.ossImgUrl + '/retail/my/img_myBgc.png',
  65. avatar: '../../static/image/img_touxiang.png',
  66. navBarHeight: uni.getStorageSync('navBarHeight')
  67. }
  68. },
  69. onLoad() {
  70. },
  71. methods: {
  72. toAccount(){
  73. uni.navigateTo({
  74. url: '/pages/accountRecharge/index'
  75. })
  76. },
  77. chooseImage() {
  78. var that = this;
  79. uni.chooseImage({
  80. count: 1, // 默认9
  81. sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  82. sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  83. success: function (res) {
  84. // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
  85. that.avatar = res.tempFilePaths[0];
  86. }
  87. });
  88. },
  89. logOut(){
  90. this.show = true
  91. },
  92. open() {
  93. // console.log('open');
  94. },
  95. close() {
  96. this.show = false
  97. // console.log('close');
  98. }
  99. },
  100. mounted() {
  101. },
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .my {
  106. background-repeat: no-repeat !important;
  107. background-size: contain !important;
  108. // background-position: top;
  109. width: 100%;
  110. position: absolute;
  111. top: 0;
  112. bottom: 0;
  113. .content{
  114. padding: 0 32rpx;
  115. .news {
  116. .info {
  117. .img{
  118. flex-shrink: 0;
  119. width: 128rpx;
  120. height: 128rpx;
  121. border-radius: 8rpx;
  122. }
  123. .info-text {
  124. margin: 8rpx 0 20rpx 36rpx;
  125. .info-top {
  126. .name {
  127. font-weight: 500;
  128. font-size: 32rpx;
  129. color: #363531;
  130. }
  131. .level {
  132. margin-left: 12rpx;
  133. .level-text {
  134. width: 105.9rpx;
  135. height: 47rpx;
  136. padding: 0 16rpx 0 26rpx;
  137. background: linear-gradient(130deg, #FFB873 0%, #FEC287 0%, #E69349 100%);
  138. border-radius: 0rpx 18rpx 18rpx 0rpx;
  139. font-weight: 500;
  140. font-size: 24rpx;
  141. color: #FFFFFF;
  142. line-height: 47rpx;
  143. margin-left: -16rpx;
  144. // text-align: left;
  145. }
  146. }
  147. }
  148. }
  149. .phone {
  150. font-weight: 400;
  151. font-size: 28rpx;
  152. color: #363531;
  153. }
  154. }
  155. .right{
  156. flex: 1;
  157. display: flex;
  158. justify-content: flex-end;
  159. .more{
  160. margin-top: 26rpx;
  161. }
  162. }
  163. .news-total {
  164. margin-top: 44rpx;
  165. .item-num {
  166. font-weight: bold;
  167. font-size: 40rpx;
  168. color: #363531;
  169. }
  170. .orange {
  171. color: #FF6400;
  172. }
  173. .item-text {
  174. font-weight: 400;
  175. font-size: 28rpx;
  176. color: #9598A6;
  177. }
  178. }
  179. }
  180. .menu{
  181. margin-top: 32rpx;
  182. background: #fff;
  183. border-radius: 16rpx;
  184. .menu-item{
  185. padding: 32rpx 28rpx 32rpx 24rpx;
  186. .item-left{
  187. text{
  188. margin-left: 20rpx;
  189. }
  190. }
  191. }
  192. .item-one{
  193. border-bottom: 2rpx solid #F0F2F4;
  194. }
  195. }
  196. }
  197. .login-out{
  198. text-align: center;
  199. margin: 40rpx 0;
  200. }
  201. }
  202. </style>