privilege.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="pages">
  3. <u-navbar
  4. title="会员权益"
  5. :placeholder="true"
  6. :autoBack="false"
  7. @leftClick="leftClick"
  8. bgColor="transparent"
  9. leftIconColor="#fff"
  10. :titleStyle="{color:'#fff'}"
  11. :safeAreaInsetTop="true"
  12. >
  13. </u-navbar>
  14. <view class="page-bg">
  15. <img style="height: 100vh;" class="img" :src="staticUrl+'/img/privilege-bg.png'" alt="">
  16. </view>
  17. <view class="content page-wrap">
  18. <u--image :showLoading="true" :src="staticUrl+'/img/privilege-title.png'" width="356rpx" height="53rpx"></u--image>
  19. <view class="sub-title"> </view>
  20. <view class="privilege-block" v-for="item in memberLevel" :key="item.id">
  21. <view class="mini-title u-flex u-row-center">
  22. <view class="left">
  23. <u--image :showLoading="true" :src="staticUrl+'/img/privilege-title-left.png'" width="47rpx" height="20rpx"></u--image>
  24. </view>
  25. <view class="text">{{item.name}}</view>
  26. <view class="right">
  27. <u--image :showLoading="true" :src="staticUrl+'/img/privilege-title-right.png'" width="47rpx" height="20rpx"></u--image>
  28. </view>
  29. </view>
  30. <view class="privilege-wrap u-flex u-row-between u-flex-wrap">
  31. <view class="privilege-item" @click="levelClick(item,level)" v-for="(level,index) in item.list" :key="index">
  32. <!-- <u--image :showLoading="true" shape="circle" :src="level.logo" width="122rpx" height="122rpx"></u--image> -->
  33. <img class="logo" :src="level.logo" alt="">
  34. <view class="remark">{{level.name}}</view>
  35. </view>
  36. <view class="empty" v-if="item.list<1">
  37. 敬请期待
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <u-popup :show="levelShow" @close="levelShow=false" mode='center' @open="levelOpen" :customStyle="{'border-radius': '8rpx'}">
  43. <view class="level-content">
  44. <view class="header">
  45. <img class="bg" :src="staticUrl+'/img/privilege-pop-bg.png'" alt="" srcset="">
  46. <view class="name">{{levelContent.levelName}}</view>
  47. </view>
  48. <view class="content">
  49. {{levelContent.name}}:{{levelContent.remark}}
  50. </view>
  51. <view class="bottom u-flex u-row-center">
  52. <view class="btn cancel" @click="levelShow=false">取消</view>
  53. </view>
  54. </view>
  55. </u-popup>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. staticUrl:this.$commonConfig.staticUrl,
  63. memberLevel:[],
  64. levelShow:false,
  65. levelContent:{levelName:''}
  66. }
  67. },
  68. onShow() {
  69. },
  70. onLoad() {
  71. uni.setNavigationBarColor({
  72. frontColor: '#ffffff',
  73. backgroundColor: 'transparent',
  74. animation: {
  75. duration: 400,
  76. timingFunc: 'easeIn'
  77. }
  78. });
  79. this.getMemberLevel();
  80. },
  81. methods: {
  82. leftClick(e){
  83. let pages = getCurrentPages();
  84. if(pages.length==1){
  85. uni.$u.route('/pages/index/index')
  86. }else{
  87. uni.navigateBack()
  88. };
  89. },
  90. getMemberLevel(){
  91. this.$u.api.memberLevel({pageNum:1,pageSize:100}).then(res=>{
  92. this.memberLevel = res.data.rows;
  93. console.log('memberLevel',res.data);
  94. }).catch(err=>{
  95. console.log('memberLevel',err);
  96. })
  97. },
  98. levelOpen(){
  99. this.levelShow = true;
  100. },
  101. levelClick(item,level){
  102. // console.log('levelClick',item);
  103. this.levelContent = level;
  104. this.levelContent.levelName = item.name;
  105. this.levelOpen();
  106. }
  107. }
  108. }
  109. </script>
  110. <style>
  111. page{
  112. background-color: #18161F;
  113. }
  114. </style>
  115. <style lang="scss" scoped>
  116. .sub-title{
  117. margin-top: 16rpx;
  118. margin-bottom: 30rpx;
  119. font-size: 30rpx;
  120. font-weight: 400;
  121. color: rgba(255,255,255,0.5);
  122. line-height: 42rpx;
  123. }
  124. .privilege-block{
  125. padding: 40rpx 40rpx 0;
  126. background: rgba(255,255,255,0.04);
  127. border-radius: 8rpx;
  128. border: 2rpx solid;
  129. border-image: linear-gradient(91deg, rgba(255, 236, 223, 0.3), rgba(255, 160, 104, 0.5), rgba(255, 212, 188, 0.3)) 2 2;
  130. overflow: hidden;
  131. margin-bottom: 30rpx;
  132. .mini-title{
  133. margin-bottom: 29rpx;
  134. .text{
  135. margin: 0 20rpx;
  136. font-size: 32rpx;
  137. font-weight: 500;
  138. color: #FFFFFF;
  139. line-height: 45rpx;
  140. background: linear-gradient(270deg, #D6986B 0%, #FFEFDC 100%);
  141. -webkit-background-clip: text;
  142. -webkit-text-fill-color: transparent;
  143. }
  144. }
  145. .privilege-wrap{
  146. .empty{
  147. width: 100%;
  148. text-align: center;
  149. padding: 40rpx 0;
  150. font-size: 40rpx;
  151. color: #ababab;
  152. }
  153. }
  154. .privilege-item{
  155. text-align: center;
  156. width: 25%;
  157. margin-bottom: 40rpx;
  158. .logo{
  159. width: 120rpx;
  160. height: 120rpx;
  161. border-radius: 50%;
  162. }
  163. .remark{
  164. margin-top: 16rpx;
  165. font-size: 26rpx;
  166. font-weight: 400;
  167. color: #D6986B;
  168. background-color: #D6986B;
  169. line-height: 37rpx;
  170. -webkit-background-clip: text;
  171. -webkit-text-fill-color: transparent;
  172. }
  173. }
  174. }
  175. .level-content{
  176. width: 80vw;
  177. background-color: #fff;
  178. border-radius: 8rpx;
  179. overflow: hidden;
  180. .header{
  181. height: 100rpx;
  182. .name{
  183. line-height: 100rpx;
  184. font-size: 34rpx;
  185. font-family: PingFangSC-Medium, PingFang SC;
  186. font-weight: 500;
  187. color: #CB8D5F;
  188. background-color: #CB8D5F;
  189. -webkit-background-clip: text;
  190. -webkit-text-fill-color: transparent;
  191. position: relative;
  192. text-align: center;
  193. }
  194. .bg{
  195. width: 100%;
  196. height: 100rpx;
  197. position: absolute;
  198. left: 0;
  199. right: 0;
  200. bottom: 0;
  201. top: 0;
  202. }
  203. }
  204. .content{
  205. text-align: center;
  206. padding: 30rpx 20rpx 60rpx;
  207. font-size: 30rpx;
  208. font-weight: 400;
  209. color: #333333;
  210. line-height: 42rpx;
  211. }
  212. .bottom{
  213. .btn{
  214. background: #F5F5F5;
  215. border-radius: 34rpx;
  216. text-align: center;
  217. margin-bottom: 30rpx;
  218. font-size: 30rpx;
  219. font-weight: 400;
  220. color: #333333;
  221. line-height: 42rpx;
  222. padding: 13rpx 136rpx;
  223. }
  224. }
  225. }
  226. </style>