template1.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <script>
  2. export default {
  3. props: {
  4. userInfo: {
  5. type: Object,
  6. default: () => {}
  7. },
  8. property: {
  9. type: Array,
  10. default: () => []
  11. },
  12. // perShowType 0 手机号 1 ID
  13. perShowType: {
  14. type: Number,
  15. default: 0
  16. }
  17. },
  18. inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone'],
  19. methods: {}
  20. };
  21. </script>
  22. <template>
  23. <view class="header">
  24. <!-- 用户信息、设置 -->
  25. <view class="acea-row row-middle user">
  26. <image :src="userInfo.avatar" class="avatar" @click="goEdit"></image>
  27. <view class="name-wrap">
  28. <view class="name display-add" v-if="!userInfo.uid" @click="openAuto">请点击授权</view>
  29. <view class="name" v-if="userInfo.uid">{{ userInfo.nickname }}</view>
  30. <view class="bind-phone" v-if="!userInfo.phone" @tap="bindPhone">绑定手机号</view>
  31. <view class="phone" v-else>{{ perShowType ? 'ID:' + userInfo.uid : userInfo.phone }}</view>
  32. </view>
  33. <view class="acea-row row-middle">
  34. <text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
  35. <text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
  36. <view class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
  37. <uni-badge v-if="userInfo.service_num" absolute="rightTop" :custom-style="{background: '#fff',color:'var(--view-theme)',top:'-56rpx'}" :text="userInfo.service_num"></uni-badge>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 余额、优惠券 -->
  42. <view class="acea-row balance-coupon">
  43. <view class="item" v-for="(item, index) in property" @click="goMenuPage(item.url)" :key="index">
  44. <view class="value num-fa-semi">{{ item.value }}</view>
  45. <view>{{ item.label }}</view>
  46. </view>
  47. </view>
  48. <!-- 会员中心、积分商城 -->
  49. <view class="acea-row member-points">
  50. <view class="acea-row row-middle row-center item" @click="intoPage(userInfo.level_status == 1 ? '/pages/users/user_vip/index' : '/pages/annex/vip_grade_active/index')">
  51. <view>
  52. <view>会员中心</view>
  53. <view class="arrow">
  54. 查看新权益
  55. <text class="iconfont icon-ic_rightarrow"></text>
  56. </view>
  57. </view>
  58. <image src="@/static/images/user-member.png" class="image"></image>
  59. </view>
  60. <view class="acea-row row-middle row-center item" @click="intoPage('/pages/activity/points_mall/index')">
  61. <view>
  62. <view>积分商城</view>
  63. <view class="arrow">
  64. 限量兑神券
  65. <text class="iconfont icon-ic_rightarrow"></text>
  66. </view>
  67. </view>
  68. <image src="@/static/images/user-points.png" class="image"></image>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <style lang="scss" scoped>
  74. .header {
  75. padding: 18rpx 0 0rpx;
  76. border-bottom-right-radius: 50% 40rpx;
  77. border-bottom-left-radius: 50% 40rpx;
  78. margin-bottom: 18rpx;
  79. background-color: var(--view-theme);
  80. .user {
  81. padding: 0 40rpx 0 30rpx;
  82. .iconfont {
  83. position: relative;
  84. color: #ffffff;
  85. font-size: 40rpx;
  86. }
  87. }
  88. .bind-phone {
  89. margin-top: 12rpx;
  90. background: rgba(255, 255, 255, 0.3);
  91. border-radius: 30px;
  92. width: max-content;
  93. text-align: center;
  94. font-size: 20rpx;
  95. font-weight: 400;
  96. color: #ffffff;
  97. line-height: 28rpx;
  98. padding: 6rpx 16rpx;
  99. }
  100. .tips::before {
  101. content: '';
  102. position: absolute;
  103. bottom: -6rpx;
  104. left: calc(50% - 6rpx);
  105. width: 0;
  106. height: 0;
  107. border-left: 6rpx solid transparent;
  108. border-right: 6rpx solid transparent;
  109. border-top: 6rpx solid #ffd89c;
  110. /* 修改颜色以改变三角形颜色 */
  111. }
  112. .avatar {
  113. width: 112rpx;
  114. height: 112rpx;
  115. border-radius: 50%;
  116. }
  117. .name-wrap {
  118. flex: 1;
  119. padding: 0 32rpx;
  120. color: #ffffff;
  121. }
  122. .name {
  123. font-weight: 500;
  124. font-size: 32rpx;
  125. line-height: 44rpx;
  126. }
  127. .phone {
  128. margin-top: 10rpx;
  129. font-size: 24rpx;
  130. line-height: 34rpx;
  131. }
  132. .tips {
  133. position: absolute;
  134. bottom: 100%;
  135. left: 50%;
  136. height: 28rpx;
  137. padding: 0 14rpx;
  138. border-radius: 14rpx;
  139. margin-bottom: 4rpx;
  140. background-color: #ffd89c;
  141. transform: translateX(-50%);
  142. white-space: nowrap;
  143. font-size: 16rpx;
  144. line-height: 28rpx;
  145. color: #9e5e1a;
  146. }
  147. .number {
  148. position: absolute;
  149. top: -8rpx;
  150. right: 0;
  151. min-width: 10rpx;
  152. height: 24rpx;
  153. padding: 0 6rpx;
  154. border: 2rpx solid var(--view-theme);
  155. border-radius: 12rpx;
  156. background-color: #ffffff;
  157. transform: translateX(50%);
  158. font-weight: 500;
  159. font-size: 18rpx;
  160. line-height: 24rpx;
  161. color: var(--view-theme);
  162. }
  163. }
  164. .balance-coupon {
  165. margin-top: 44rpx;
  166. .item {
  167. flex: 1;
  168. text-align: center;
  169. font-weight: 500;
  170. font-size: 22rpx;
  171. line-height: 22rpx;
  172. color: rgba(255, 255, 255, 0.6);
  173. }
  174. .value {
  175. margin-bottom: 12rpx;
  176. font-weight: 400;
  177. font-size: 32rpx;
  178. line-height: 32rpx;
  179. color: rgba(255, 255, 255, 0.85);
  180. }
  181. }
  182. .member-points {
  183. border-radius: 20rpx;
  184. margin: 20rpx;
  185. background-color: #ffffff;
  186. .item {
  187. position: relative;
  188. flex: 1;
  189. height: 134rpx;
  190. padding-left: 40rpx;
  191. font-weight: 500;
  192. font-size: 28rpx;
  193. line-height: 34rpx;
  194. color: #333333;
  195. &::before {
  196. content: '';
  197. position: absolute;
  198. top: 50%;
  199. left: 0;
  200. height: 48rpx;
  201. border-left: 1rpx solid #eeeeee;
  202. transform: translateY(-50%);
  203. }
  204. &:first-child::before {
  205. display: none;
  206. }
  207. .iconfont {
  208. position: relative;
  209. font-size: 20rpx;
  210. }
  211. }
  212. .arrow {
  213. margin-top: 12rpx;
  214. font-weight: 400;
  215. font-size: 22rpx;
  216. line-height: 24rpx;
  217. color: #ff7d00;
  218. }
  219. .image {
  220. width: 88rpx;
  221. height: 88rpx;
  222. margin-left: 40rpx;
  223. }
  224. .iconfont {
  225. margin-left: 2rpx;
  226. font-size: 24rpx;
  227. }
  228. }
  229. </style>