template5.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <script>
  2. import { HTTP_REQUEST_URL } from '@/config/app';
  3. // #ifdef MP || APP-PLUS
  4. import topBar from '../topBar.vue';
  5. // #endif
  6. export default {
  7. components: {
  8. // #ifdef MP || APP-PLUS
  9. topBar
  10. // #endif
  11. },
  12. props: {
  13. userInfo: {
  14. type: Object,
  15. default: () => {}
  16. },
  17. commission: {
  18. type: Object,
  19. default: () => {}
  20. },
  21. // perShowType 0 手机号 1 ID
  22. perShowType: {
  23. type: Number,
  24. default: 0
  25. },
  26. isScrolling: {
  27. type: Boolean,
  28. default: false
  29. },
  30. property: {
  31. type: Array,
  32. default: () => []
  33. }
  34. },
  35. inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone'],
  36. computed: {
  37. headerBg() {
  38. return `url(${HTTP_REQUEST_URL}/statics/images/users/template4_bg.png)`;
  39. }
  40. }
  41. };
  42. </script>
  43. <template>
  44. <view class="warp" :style="{ backgroundImage: headerBg }">
  45. <!-- #ifdef MP || APP-PLUS -->
  46. <topBar :styleType="5" :isScrolling="isScrolling"></topBar>
  47. <!-- #endif -->
  48. <view class="acea-row row-middle user">
  49. <image class="avatar" :src="userInfo.avatar" @click="goEdit"></image>
  50. <view class="name-wrap">
  51. <view class="name">{{ userInfo.nickname }}</view>
  52. <view class="phone" v-if="userInfo.phone">{{ perShowType ? 'ID:' + userInfo.uid : userInfo.phone }}</view>
  53. <view class="bind-phone" v-else @tap="bindPhone">绑定手机号</view>
  54. </view>
  55. <view class="acea-row row-middle">
  56. <text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
  57. <text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
  58. <view class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
  59. <uni-badge v-if="userInfo.service_num" absolute="rightTop" :custom-style="{background: 'var(--view-theme)',top:'-56rpx'}" :text="userInfo.service_num"></uni-badge>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="acea-row row-middle order justify-between">
  64. <view class="item" v-for="(item, index) in property" @click="goMenuPage(item.url)" :key="index">
  65. {{ item.label }}
  66. <text class="value num-fa-semi">{{ item.value }}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <style scoped lang="scss">
  72. .warp {
  73. background-position: bottom;
  74. background-size: 100% 100%;
  75. }
  76. .user {
  77. padding: 60rpx 42rpx 56rpx 30rpx;
  78. background-position: bottom;
  79. background-size: 100%;
  80. .avatar {
  81. width: 112rpx;
  82. height: 112rpx;
  83. border-radius: 50%;
  84. }
  85. .name-wrap {
  86. flex: 1;
  87. padding: 0 32rpx;
  88. color: #333333;
  89. }
  90. .name {
  91. font-weight: 500;
  92. font-size: 32rpx;
  93. line-height: 44rpx;
  94. }
  95. .phone {
  96. margin-top: 10rpx;
  97. font-size: 24rpx;
  98. line-height: 34rpx;
  99. }
  100. .bind-phone {
  101. margin-top: 12rpx;
  102. background: #fff;
  103. border-radius: 30px;
  104. width: max-content;
  105. text-align: center;
  106. font-size: 20rpx;
  107. font-weight: 400;
  108. color: #333333;
  109. line-height: 28rpx;
  110. padding: 6rpx 16rpx;
  111. }
  112. .iconfont {
  113. position: relative;
  114. }
  115. .tips {
  116. position: absolute;
  117. bottom: 100%;
  118. left: 50%;
  119. height: 28rpx;
  120. padding: 0 14rpx;
  121. border-radius: 14rpx;
  122. margin-bottom: 4rpx;
  123. background-color: #ffd89c;
  124. transform: translateX(-50%);
  125. white-space: nowrap;
  126. font-size: 16rpx;
  127. line-height: 28rpx;
  128. color: #9e5e1a;
  129. }
  130. .tips::before {
  131. content: '';
  132. position: absolute;
  133. bottom: -6rpx;
  134. left: calc(50% - 6rpx);
  135. width: 0;
  136. height: 0;
  137. border-left: 6rpx solid transparent;
  138. border-right: 6rpx solid transparent;
  139. border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
  140. }
  141. .number {
  142. position: absolute;
  143. top: -8rpx;
  144. right: 0;
  145. min-width: 10rpx;
  146. height: 24rpx;
  147. padding: 0 6rpx;
  148. border: 2rpx solid var(--view-theme);
  149. border-radius: 12rpx;
  150. background-color: #ffffff;
  151. transform: translateX(50%);
  152. font-weight: 500;
  153. font-size: 18rpx;
  154. line-height: 24rpx;
  155. color: var(--view-theme);
  156. }
  157. }
  158. .order {
  159. padding: 0 32rpx 32rpx 32rpx;
  160. font-size: 26rpx;
  161. line-height: 36rpx;
  162. color: #999999;
  163. .item + .item {
  164. margin-left: 40rpx;
  165. }
  166. .value {
  167. margin-left: 8rpx;
  168. font-size: 28rpx;
  169. line-height: 32rpx;
  170. color: #333333;
  171. }
  172. }
  173. </style>