index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <view class="memberCenter">
  3. <zs-header title="会员中心" :background="background"></zs-header>
  4. <view class="top-box target">
  5. <view class="user-info">
  6. <image class="image" :src="userInfo.imgPath || defaultImg" lazy-load mode=""></image>
  7. <view class="info">
  8. <view class="user-name">{{userInfo.nickname ||'用户'}}</view>
  9. <view class="tel">{{userInfo.phoneNum ||'您当前未开通会员'}}</view>
  10. </view>
  11. </view>
  12. <swiper @change="changeSwiper" :current="current" class="swiper" previous-margin="70rpx"
  13. next-margin="40rpx">
  14. <swiper-item class="swiper-item" v-for="(item,index) in list" :key="item">
  15. <view class="content" :class="[current == index?'active':'']">
  16. <view :style="{background:item.color}" v-if="userInfo.setMealId == index" class="tag">
  17. 当前等级
  18. </view>
  19. <image class="icon" :src="item.url" mode=""></image>
  20. <view class="price" :style="{color:item.color}">
  21. {{`开通会员${item.price}/月`}}
  22. </view>
  23. <view class="notice" :style="{color:item.color}">
  24. 开通会员预计节省 <text class="num">¥99元</text>
  25. </view>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. <view class="title-box">
  31. <view class="title">
  32. 餐饮
  33. </view>
  34. <view class="desc">
  35. 享受多达24种餐饮权益
  36. </view>
  37. </view>
  38. <u-grid :border="false" col="3">
  39. <u-grid-item v-for="(item,listIndex) in list1" :key="listIndex">
  40. <image class="icon" :src="item.icon" mode=""></image>
  41. <text class="title">{{item.title}}</text>
  42. <text class="desc">{{item.desc}}</text>
  43. </u-grid-item>
  44. </u-grid>
  45. <view class="title-box">
  46. <view class="title">
  47. 娱乐
  48. </view>
  49. <view class="desc">
  50. 享受多达24种娱乐权益
  51. </view>
  52. </view>
  53. <u-grid :border="false" col="3">
  54. <u-grid-item v-for="(item,listIndex) in list1" :key="listIndex">
  55. <image class="icon" :src="item.icon" mode=""></image>
  56. <text class="title">{{item.title}}</text>
  57. <text class="desc">{{item.desc}}</text>
  58. </u-grid-item>
  59. </u-grid>
  60. <view class="fixed-box">
  61. <view class="left-box">
  62. <image class="icon" src="../../static/phone.png" mode=""></image>
  63. <view class="info">
  64. <view class="tel">
  65. 10086
  66. </view>
  67. <view class="desc">
  68. 套餐咨询
  69. </view>
  70. </view>
  71. </view>
  72. <view class="btn">
  73. 立即开通
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. current: 0,
  83. background: false,
  84. defaultImg: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fci.xiaohongshu.com%2Fc34b7b74-ba38-0456-982a-43c0f97522fe%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fci.xiaohongshu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1693532127&t=a2e186c12aecaab7723611cb52a6778f',
  85. userInfo: {
  86. imgPath: "",
  87. isAuth: 1,
  88. lastLogin: "",
  89. nickname: "",
  90. openId: "",
  91. phoneNum: "",
  92. score: 0,
  93. setMealId: 0,
  94. sex: 1,
  95. userId: "",
  96. },
  97. list: [
  98. {
  99. url: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/VXjgNzREXaLm34375320879043fd01ef78548b828ff5.png/1.png',
  100. price: 10,
  101. color: '#8B97BC'
  102. },
  103. {
  104. url: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/lDVkXHSqADn3e2d4da72a4807077a435dcf58d1e3d9d.png/1.png',
  105. price: 10,
  106. color: '#3E5C91'
  107. },
  108. {
  109. url: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/DPFfUdNJ8gON5dded7da8e6b8447b2d3d6baaf07dc6d.png/1.png',
  110. price: 20,
  111. color: '#FF532A'
  112. },
  113. {
  114. url: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/fbBsRJWDEGuB567f38e56cd936f4420701c00e7df8c4.png/1.png',
  115. price: 30,
  116. color: '#5488FF'
  117. }
  118. ],
  119. list1:[
  120. {
  121. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/QrH1JQHzmpa33b795d99f971897d53e94cea47ba18df.png/1.png",
  122. title:"7-Eleven",
  123. desc:"免费领取大额券",
  124. },
  125. {
  126. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/zWIsNbwQcmQge4240fa235d866f75bbc322e1ef7756f.png/1.png",
  127. title:"麦当劳",
  128. desc:"免费领取5.5折优惠券",
  129. },
  130. {
  131. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/MjZqLNBMHNtEfe0a7f6ac7120012b62b33138bab2e10.png/1.png",
  132. title:"星巴克",
  133. desc:"免费领取5.5折优惠券",
  134. },
  135. {
  136. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/VZhjgXDiHKQgd2766fddc816dad7c6b9ac8021026b75.png/1.png",
  137. title:"瑞幸咖啡",
  138. desc:"免费领取5.5折优惠券",
  139. },
  140. {
  141. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/QyMgjyjtcgW24aa6472ddcd269575c14f9eae02bd884.png/1.png",
  142. title:"海底捞",
  143. desc:"一元秒杀无限购",
  144. },
  145. {
  146. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/7sZ1eKfRy10d2a01d9d6f15945535f8319a3a4fe28ea.png/1.png",
  147. title:"KFC",
  148. desc:"免费领取5.5折优惠券",
  149. },
  150. {
  151. icon:"http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/niFQ6Pcda58Sa6a4ace3d302fdd2eae6b3e4beef70a1.png/1.png",
  152. title:"汉堡王",
  153. desc:"免费领取5.5折优惠券",
  154. }
  155. ]
  156. }
  157. },
  158. methods: {
  159. changeSwiper(val) {
  160. this.current = val.target.current
  161. }
  162. },
  163. onPageScroll(e) {
  164. if (e.scrollTop >= 50) {
  165. this.background = true
  166. } else {
  167. this.background = false
  168. }
  169. },
  170. created() {
  171. if(uni.getStorageSync('userInfo')) {
  172. this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
  173. }
  174. this.current = this.userInfo.setMealId
  175. }
  176. }
  177. </script>
  178. <style lang="scss">
  179. .memberCenter {
  180. min-height: 100vh;
  181. background: #FFF;
  182. padding-bottom: 180rpx;
  183. .swiper {
  184. width: 750rpx !important;
  185. height: 272rpx !important;
  186. position: relative;
  187. left: -30rpx;
  188. top: 20rpx;
  189. }
  190. .swiper-item {
  191. width: 600rpx !important;
  192. height: 272rpx !important;
  193. position: relative;
  194. .active {
  195. transform: scale(1) !important;
  196. }
  197. .content {
  198. transform: scale(.9);
  199. transition: transform .3s;
  200. transform-origin: center center;
  201. .icon {
  202. width: 600rpx;
  203. height: 272rpx;
  204. border-radius: 16rpx;
  205. }
  206. .tag {
  207. width: 104rpx;
  208. height: 34rpx;
  209. line-height: 34rpx;
  210. text-align: center;
  211. font-size: 22rpx;
  212. color: #fff;
  213. border-radius: 16rpx 0rpx 16rpx 0rpx;
  214. position: absolute;
  215. top: 0%;
  216. left: 0;
  217. z-index: 2;
  218. }
  219. .price {
  220. font-size: 24rpx;
  221. position: absolute;
  222. left: 40rpx;
  223. top: 140rpx;
  224. }
  225. .notice {
  226. font-size: 24rpx;
  227. position: absolute;
  228. left: 40rpx;
  229. bottom: 40rpx;
  230. .num {
  231. font-weight: bold;
  232. font-size: 36rpx;
  233. }
  234. }
  235. }
  236. }
  237. .top-box {
  238. width: 750rpx;
  239. height: 600rpx;
  240. padding: 150rpx 30rpx 0;
  241. box-sizing: border-box;
  242. background: linear-gradient(180deg, #C0F3FE 0%, #F8F3FF 47%, #C3DEFF 80%, #FFFFFF 100%);
  243. position: relative;
  244. .user-info {
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. padding: 15rpx 0;
  249. color: #222222;
  250. .image {
  251. width: 108rpx;
  252. height: 108rpx;
  253. background: #f1f1f1;
  254. border-radius: 50%;
  255. }
  256. .info {
  257. flex: 1;
  258. margin-left: 30rpx;
  259. .user-name {
  260. font-size: 32rpx;
  261. font-weight: bold;
  262. color: #222222;
  263. }
  264. .tel {
  265. font-size: 24rpx;
  266. margin-top: 10rpx;
  267. color: #AAAAAA;
  268. }
  269. }
  270. }
  271. }
  272. .title-box {
  273. display: flex;
  274. align-items: center;
  275. margin: 30rpx 30rpx 0;
  276. .title {
  277. color: #222222;
  278. font-weight: bold;
  279. font-size: 32rpx;
  280. }
  281. .desc {
  282. margin-left: 10rpx;
  283. font-size: 22rpx;
  284. color: #AAAAAA;
  285. }
  286. }
  287. .u-grid{
  288. .u-grid-item{
  289. padding-top:30rpx ;
  290. }
  291. .icon{
  292. width: 80rpx;
  293. height: 80rpx;
  294. border-radius: 50%;
  295. }
  296. .title{
  297. font-size: 28rpx;
  298. color: #222222;
  299. margin-top: 10rpx;
  300. }
  301. .desc{
  302. color: #AAAAAA;
  303. font-size: 20rpx;
  304. }
  305. }
  306. .fixed-box {
  307. position: fixed;
  308. bottom: 0%;
  309. left: 0%;
  310. width: 100%;
  311. background: #fff;
  312. display: flex;
  313. justify-content: space-between;
  314. align-items: center;
  315. padding: 15rpx 20rpx 40rpx;
  316. box-sizing: border-box;
  317. .left-box {
  318. display: flex;
  319. align-items: center;
  320. .icon {
  321. width: 80rpx;
  322. height: 80rpx;
  323. }
  324. .info {
  325. margin-left: 20rpx;
  326. .tel {
  327. color: #222222;
  328. font-weight: bold;
  329. font-size: 32rpx;
  330. }
  331. .desc {
  332. font-size: 22rpx;
  333. color: #999999;
  334. }
  335. }
  336. }
  337. .btn {
  338. width: 340rpx;
  339. height: 80rpx;
  340. line-height: 80rpx;
  341. text-align: center;
  342. background: #FF4C3A;
  343. color: #fff;
  344. font-size: 28rpx;
  345. font-weight: bold;
  346. border-radius: 40rpx 40rpx 40rpx 40rpx;
  347. }
  348. }
  349. }
  350. </style>