template2.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <script>
  2. export default {
  3. inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone'],
  4. props: {
  5. userInfo: {
  6. type: Object,
  7. default: () => {}
  8. },
  9. property: {
  10. type: Array,
  11. default: () => []
  12. },
  13. // perShowType 0 手机号 1 ID
  14. perShowType: {
  15. type: Number,
  16. default: 0
  17. }
  18. }
  19. };
  20. </script>
  21. <template>
  22. <view class="">
  23. <view class="acea-row row-middle user-wrapper">
  24. <!-- 头像 -->
  25. <image class="avatar" :src="userInfo.avatar" @click="goEdit"></image>
  26. <view class="name-wrap">
  27. <view class="name">{{ userInfo.nickname }}</view>
  28. <view class="bind-phone" v-if="!userInfo.phone" @tap="bindPhone">绑定手机号</view>
  29. <view class="phone" v-else>{{ perShowType ? 'ID:' + userInfo.uid : userInfo.phone }}</view>
  30. </view>
  31. <text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
  32. <text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
  33. <view class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
  34. <uni-badge v-if="userInfo.service_num" absolute="rightTop" :custom-style="{background: 'var(--view-theme)',top:'-56rpx'}" :text="userInfo.service_num"></uni-badge>
  35. </view>
  36. </view>
  37. <view class="acea-row row-between promotion-wrapper">
  38. <view class="acea-row row-middle" v-for="(item, index) in property" @click="goMenuPage(item.url)" :key="index">
  39. <text>{{ item.label }}</text>
  40. <text class="value num-fa-semi">{{ item.value }}</text>
  41. </view>
  42. </view>
  43. <!-- 会员 -->
  44. <view class="member-wrapper" v-if="userInfo.vip" @click="intoPage(userInfo.level_status == 1 ? '/pages/users/user_vip/index' : '/pages/annex/vip_grade_active/index')">
  45. <view class="card">
  46. <view class="acea-row row-middle top">
  47. <view class="name-wrap">
  48. <view class="name">
  49. <text class="iconfont icon-ic_crown fs-31"></text>
  50. {{ userInfo.vip_name }}
  51. </view>
  52. <view class="acea-row row-middle">
  53. 商城购物可享
  54. <text class="number num-fa-semi">{{ userInfo.vip_discount }}</text>
  55. </view>
  56. </view>
  57. <view class="icon-wrap">
  58. <view class="icon">
  59. <text class="iconfont icon-a-ic_discount1 fs-20"></text>
  60. </view>
  61. <view>购物折扣</view>
  62. </view>
  63. <view class="icon-wrap">
  64. <view class="icon">
  65. <text class="iconfont icon-ic_badge fs-20"></text>
  66. </view>
  67. <view>专属徽章</view>
  68. </view>
  69. <text class="iconfont icon-ic_rightarrow fs-24 ml-20"></text>
  70. </view>
  71. <view class="acea-row row-middle row-between bottom">
  72. <view class="acea-row">
  73. <view class="icon-list">
  74. <image class="img" src="@/static/images/vip-icon-row.png" mode=""></image>
  75. </view>
  76. <view class="text">掌握更多快速升级技巧</view>
  77. </view>
  78. <view class="button">去获取</view>
  79. </view>
  80. </view>
  81. <!-- 公告模块 -->
  82. <!-- <view class="acea-row row-middle grow">
  83. <view class="iconfont icon-ic_horn1 fs-28"></view>
  84. <view class="text">查看会员成长值,获得更优惠购物折扣~</view>
  85. <view class="iconfont icon-ic_rightarrow fs-24"></view>
  86. </view> -->
  87. </view>
  88. </view>
  89. </template>
  90. <style lang="scss" scoped>
  91. .user-wrapper {
  92. padding: 40rpx 40rpx 40rpx 32rpx;
  93. .avatar {
  94. width: 136rpx;
  95. height: 136rpx;
  96. border-radius: 50%;
  97. }
  98. .name-wrap {
  99. flex: 1;
  100. padding: 0 24rpx;
  101. color: #333333;
  102. }
  103. .bind-phone {
  104. margin-top: 12rpx;
  105. background: #fff;
  106. border-radius: 30px;
  107. width: max-content;
  108. text-align: center;
  109. font-size: 20rpx;
  110. font-weight: 400;
  111. color: #333333;
  112. line-height: 28rpx;
  113. padding: 6rpx 16rpx;
  114. }
  115. .name {
  116. font-weight: 500;
  117. font-size: 32rpx;
  118. line-height: 44rpx;
  119. }
  120. .phone {
  121. margin-top: 10rpx;
  122. font-size: 24rpx;
  123. line-height: 34rpx;
  124. }
  125. .tips::before {
  126. content: '';
  127. position: absolute;
  128. bottom: -6rpx;
  129. left: calc(50% - 6rpx);
  130. width: 0;
  131. height: 0;
  132. border-left: 6rpx solid transparent;
  133. border-right: 6rpx solid transparent;
  134. border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
  135. }
  136. .tips {
  137. position: absolute;
  138. bottom: 100%;
  139. left: 50%;
  140. height: 28rpx;
  141. padding: 0 14rpx;
  142. border-radius: 14rpx;
  143. margin-bottom: 4rpx;
  144. background-color: #ffd89c;
  145. transform: translateX(-50%);
  146. white-space: nowrap;
  147. font-size: 16rpx;
  148. line-height: 28rpx;
  149. color: #9e5e1a;
  150. }
  151. .number {
  152. position: absolute;
  153. top: -8rpx;
  154. right: 0;
  155. min-width: 10rpx;
  156. height: 24rpx;
  157. padding: 0 6rpx;
  158. border: 2rpx solid var(--view-theme);
  159. border-radius: 12rpx;
  160. background-color: #ffffff;
  161. transform: translateX(50%);
  162. font-weight: 500;
  163. font-size: 18rpx;
  164. line-height: 24rpx;
  165. color: var(--view-theme);
  166. }
  167. .iconfont {
  168. position: relative;
  169. align-self: flex-start;
  170. margin-top: 22rpx;
  171. }
  172. }
  173. .promotion-wrapper {
  174. padding: 0 48rpx;
  175. font-size: 26rpx;
  176. line-height: 36rpx;
  177. color: #999999;
  178. .value {
  179. margin-left: 8rpx;
  180. font-family: SemiBold;
  181. font-size: 28rpx;
  182. color: #333333;
  183. }
  184. }
  185. .member-wrapper {
  186. margin: 28rpx 20rpx 20rpx;
  187. color: #7e4b06;
  188. .card {
  189. position: relative;
  190. border-radius: 32rpx;
  191. // margin-bottom: -28rpx; // 公告模块
  192. background: linear-gradient(-270deg, #f4dfaf 0%, #d0a15b 100%);
  193. .top {
  194. padding: 25rpx 35rpx;
  195. }
  196. .name-wrap {
  197. flex: 1;
  198. font-size: 19rpx;
  199. line-height: 26rpx;
  200. }
  201. .name {
  202. margin-bottom: 4rpx;
  203. font-weight: 700;
  204. font-size: 34rpx;
  205. line-height: 48rpx;
  206. .iconfont {
  207. margin-right: 12rpx;
  208. font-size: 36rpx;
  209. }
  210. }
  211. .icon-wrap {
  212. font-size: 18rpx;
  213. line-height: 26rpx;
  214. + .icon-wrap {
  215. margin-left: 32rpx;
  216. }
  217. }
  218. .icon {
  219. width: 40rpx;
  220. height: 40rpx;
  221. border-radius: 50%;
  222. margin: 0 auto 6rpx;
  223. background-color: #eccd8b;
  224. text-align: center;
  225. line-height: 40rpx;
  226. .iconfont {
  227. font-size: 24rpx;
  228. }
  229. }
  230. .bottom {
  231. position: relative;
  232. padding: 17rpx 35rpx;
  233. font-size: 24rpx;
  234. .icon-list {
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. margin-right: 22rpx;
  239. .img {
  240. width: 86rpx;
  241. height: 32rpx;
  242. }
  243. }
  244. &::before {
  245. content: '';
  246. position: absolute;
  247. top: 0;
  248. right: 35rpx;
  249. left: 35rpx;
  250. height: 1rpx;
  251. background-color: rgba(0, 0, 0, 0.08);
  252. }
  253. }
  254. .text {
  255. }
  256. .button {
  257. height: 48rpx;
  258. padding: 0 24rpx;
  259. border-radius: 24rpx;
  260. background-color: #eccd8b;
  261. font-weight: 500;
  262. line-height: 48rpx;
  263. }
  264. }
  265. .grow {
  266. padding: 50rpx 40rpx 20rpx;
  267. border-radius: 32rpx;
  268. background: linear-gradient(180deg, #faeed9 0%, #ffffff 100%);
  269. .text {
  270. flex: 1;
  271. padding-left: 16rpx;
  272. }
  273. }
  274. }
  275. </style>