user.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <view>
  3. <view v-if="storage">
  4. <view class="bg-user-gradual-green"
  5. style=" background-image: url(https://kxmalls.oss-cn-hangzhou.aliyuncs.com/bg/bg.png);">
  6. <view :style="'height:'+statusBarHeight+'px;'" style="width: 750rpx;display: flex; position: relative;"></view>
  7. <view class="flex align-center justify-center"
  8. style="height: 88rpx;font-size: 36rpx;"
  9. >
  10. 个人中心
  11. </view>
  12. <view class="padding-top-lg flex justify-between align-end padding-lr" style="padding-top: 30rpx;">
  13. <view class="">
  14. <view @click="toLogin" style="margin-top: 16rpx;font-size: 40rpx;height: 56rpx;">
  15. HI,{{ hasLogin ? (userInfo.nickname || '未设置昵称') : '请注册/登录' }}
  16. <!-- 添加VIP标识 -->
  17. <view v-if="hasLogin && userInfo.level > 0"
  18. style="display: inline-flex; align-items: center; margin-left: 10rpx;">
  19. <text v-if="hasLogin && userInfo.level > 0"
  20. :style="{color: getVipColor(userInfo.level)}"
  21. style="font-size: 24rpx;margin-left: 10rpx;">
  22. {{ getVipName(userInfo.level) }}
  23. </text>
  24. </view>
  25. </view>
  26. </view>
  27. <view @click="navTo('/pages/user/profile')" style="position: relative;padding-right: 8rpx;">
  28. <image :src="hasLogin && userInfo.avatar ? userInfo.avatar :'../../static/user/touxiang-@2x.png'"
  29. class="round" mode="aspectFill"
  30. style="width: 144rpx;height: 144rpx;"></image>
  31. <view v-if="hasLogin" class="flex align-center justify-center"
  32. style="position: absolute;bottom: 0rpx;left: 29rpx; background-color: #8AD62A;border-radius: 200rpx;width: 86rpx;height: 38rpx;color: #FFFFFF;font-size: 22rpx;"
  33. >编辑
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="margin-lr bg-white shadow"
  39. style="border-radius: 16rpx 16rpx 16rpx 16rpx;width: 690rpx;height: 140rpx;margin-top: -146rpx;margin-bottom: 20rpx">
  40. <view class="flex justify-around align-center padding-top-sm">
  41. <view class="flex align-center justify-center flex-direction" style="width: 108rpx;">
  42. {{ hasLogin ? (nowMoney || 0) : '-' }}
  43. <view @click="navTo('/pages/user/money')" style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">余额
  44. </view>
  45. </view>
  46. <view @click="navTo('/pages/user/coupons?type=user')" class="flex align-center justify-center flex-direction"
  47. style="width: 108rpx;">
  48. {{ hasLogin ? (couponListSize || 0) : '-' }}
  49. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">优惠券</view>
  50. </view>
  51. <view @click="navTo('/pages/user/integral')" class="flex align-center justify-center flex-direction"
  52. style="width: 108rpx;">
  53. {{ hasLogin ? (integral || 0) : '-' }}
  54. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">积分</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="margin-lr bg-white shadow"
  59. style="border-radius: 16rpx 16rpx 16rpx 16rpx;width: 690rpx;height: 140rpx;">
  60. <view class="flex justify-around align-center padding-top-sm">
  61. <view @click="navTo('/pages/order/list?state=0')" class="flex align-center justify-center flex-direction"
  62. style="width: 108rpx;">
  63. <image src="../../static/user/all_order.png" mode="aspectFit" style="width: 46rpx;height: 50rpx;"></image>
  64. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">全部订单</view>
  65. </view>
  66. <view @click="navTo('/pages/order/list?state=1')" class="flex align-center justify-center flex-direction"
  67. style="width: 108rpx;">
  68. <image src="../../static/user/waitpay.png" mode="aspectFit" style="width: 46rpx;height: 50rpx;"></image>
  69. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">待付款</view>
  70. </view>
  71. <view @click="navTo('/pages/order/list?state=2')" class="flex align-center justify-center flex-direction"
  72. style="width: 108rpx;">
  73. <image src="../../static/user/daishouhuo@3x.png" mode="aspectFit"
  74. style="width: 46rpx;height: 50rpx;"></image>
  75. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">待收货</view>
  76. </view>
  77. <view @click="navTo('/pages/order/list?state=3')" class="flex align-center justify-center flex-direction"
  78. style="width: 108rpx;">
  79. <image src="../../static/user/shouhou@3x.png" mode="aspectFit" style="width: 46rpx;height: 50rpx;"></image>
  80. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">待评价</view>
  81. </view>
  82. <view @click="navTo('/pages/refund/index?state=0')" class="flex align-center justify-center flex-direction"
  83. style="width: 108rpx;">
  84. <image src="../../static/user/shouhou@3x.png" mode="aspectFit" style="width: 46rpx;height: 50rpx;"></image>
  85. <view style="padding-top: 20rpx;font-size: 24rpx;color: #272B54;">售后</view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="padding-lr padding-tb-sm">
  90. <image src="https://nontax.oss-cn-beijing.aliyuncs.com/kxmall/G2usUI.png" mode="aspectFit"
  91. style="width: 690rpx;height: 184rpx;"></image>
  92. </view>
  93. <view class="margin-lr margin-bottom-sm shadow bg-white" style="border-radius: 10rpx;">
  94. <view @click="navTo('/pages/address/list')" class="flex align-center padding">
  95. <image src="../../static/user/location@3x.png" mode="aspectFit"
  96. style="width: 32rpx;height: 36rpx;"></image>
  97. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">地址管理</view>
  98. </view>
  99. <view @click="navTo('/pages/user/userVip')" class="flex align-center padding">
  100. <image src="../../static/user/vip.png" mode="aspectFit"
  101. style="width: 32rpx;height: 36rpx;"></image>
  102. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">会员中心</view>
  103. </view>
  104. <view @click="navTo('/pages/user/coupons?type=user')" class="flex align-center padding">
  105. <image src="../../static/user/notice@3x.png" mode="aspectFit"
  106. style="width: 32rpx;height: 36rpx;"></image>
  107. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">我的优惠券</view>
  108. </view>
  109. <button open-type="contact" class="flex align-center padding contact-btn">
  110. <image src="../../static/user/secretary@3x.png" mode="aspectFit"
  111. style="width: 32rpx;height: 36rpx;"></image>
  112. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">在线客服</view>
  113. </button>
  114. </view>
  115. <view class="margin-lr margin-bottom-sm shadow bg-white" style="border-radius: 10rpx;">
  116. <view @click="navTo('/pages/product/favorite')" class="flex align-center padding">
  117. <image src="../../static/user/collect@3x.png" mode="aspectFit"
  118. style="width: 32rpx;height: 36rpx;"></image>
  119. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">我的收藏</view>
  120. </view>
  121. <view @click="navTo('/pages/product/footprint')" class="flex align-center padding">
  122. <image src="../../static/user/zuji.png" mode="aspectFit"
  123. style="width: 32rpx;height: 36rpx;"></image>
  124. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">我的足迹</view>
  125. </view>
  126. <!-- <view @click="navTo('/pages/user/promotion')" class="flex align-center padding">-->
  127. <!-- <image src="../../static/user/promoter.png" mode="aspectFit"-->
  128. <!-- style="width: 32rpx;height: 36rpx;"></image>-->
  129. <!-- <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">我的推广</view>-->
  130. <!-- </view>-->
  131. <!-- <view @click="navTo('/pages/user/about')" class="flex align-center padding">-->
  132. <!-- <image src="../../static/user/tip_round@3x.png" mode="aspectFit"-->
  133. <!-- style="width: 32rpx;height: 36rpx;"></image>-->
  134. <!-- <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">关于</view>-->
  135. <!-- </view>-->
  136. <view @click="navTo('/pages/set/set')" class="flex align-center padding">
  137. <image src="../../static/user/setting@3x.png" mode="aspectFit"
  138. style="width: 32rpx;height: 36rpx;"></image>
  139. <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">设置</view>
  140. </view>
  141. <!-- <view @click="navTo('/pages/notice/notice')" class="flex align-center padding">-->
  142. <!-- <image src="../../static/user/notice@3x.png" mode="aspectFit"-->
  143. <!-- style="width: 32rpx;height: 36rpx;"></image>-->
  144. <!-- <view class="padding-left-sm lem-text-black" style="font-size: 28rpx;">通知</view>-->
  145. <!-- </view>-->
  146. </view>
  147. </view>
  148. <view v-else style="padding-top: 180rpx;padding-bottom: 180rpx;">
  149. <missing :buttonName="'换个地址试试吧~'" :handlerName="'buttonClick'"
  150. @buttonClick="chooseLocation"
  151. :imgUrl="'http://qiniuoss.nauzone.cn/%E7%BB%84%204%20%E6%8B%B7%E8%B4%9D@3x.png'"
  152. :desc="'当前地区不在配送范围哦'"></missing>
  153. </view>
  154. <!-- 猜您喜欢 -->
  155. <!-- <view style="padding: 20rpx 12rpx 20rpx 30rpx;background-color: #f1f1f1;">-->
  156. <!-- <view class="flex justify-between align-center" style="padding: 20rpx 0;">-->
  157. <!-- <view style="font-size: 32rpx;font-weight: bold;color: #333;">猜您喜欢</view>-->
  158. <!-- <view @click="refreshRecommend" style="font-size: 24rpx;color: #999;margin-right: 10px;">换一批</view>-->
  159. <!-- </view>-->
  160. <!-- -->
  161. <!-- <view v-if="recommendList.length > 0 && storage" class="flex flex-wrap">-->
  162. <!-- <view v-for="(item,index) in recommendList" :key="index"-->
  163. <!-- class="margin-bottom-sm bg-white flex align-center justify-center flex-direction"-->
  164. <!-- style="width: 335rpx;height: 520rpx;padding: 10rpx;margin-right: 18rpx;border-radius: 8rpx;"-->
  165. <!-- @click="navToDetailPage(item.id)">-->
  166. <!-- <image style="width: 280rpx;height: 280rpx;margin: 10rpx;" :src="JSON.parse(item.image)[0].url"-->
  167. <!-- mode="aspectFit"></image>-->
  168. <!-- <view style="padding-top: 28rpx;">-->
  169. <!-- <view class="text-cut"-->
  170. <!-- style="width: 294rpx;height: 40rpx;font-size: 28rpx;font-weight: Medium; color: #2D4454;">-->
  171. <!-- {{ item.storeName }}-->
  172. <!-- </view>-->
  173. <!-- <view class="text-cut margin-tb-xs" style="width: 294rpx;height: 40rpx;font-size: 28rpx;color: #999999;">-->
  174. <!-- {{ item.storeInfo }}-->
  175. <!-- </view>-->
  176. <!-- <view style="padding-top: 6rpx;" class="flex align-center justify-between">-->
  177. <!-- <view style="width: 114rpx;height: 42rpx;line-height: 42rpx;font-size: 24rpx;color:#F62929;">-->
  178. <!-- ¥{{ item.kxStockVo.price }}-->
  179. <!-- </view>-->
  180. <!-- <view style="color: #B0B0B0;font-size: 24rpx;">{{ item.unitName }}/份</view>-->
  181. <!-- <image @click.stop="addCart(item)" style="width: 48rpx;height: 48rpx;"-->
  182. <!-- src="../../static/index/cart.png" mode="aspectFit" class="round"></image>-->
  183. <!-- </view>-->
  184. <!-- </view>-->
  185. <!-- </view>-->
  186. <!-- </view>-->
  187. <!-- -->
  188. <!-- <view v-else class="flex align-center justify-center" style="height: 200rpx;color: #999;">-->
  189. <!-- 暂无推荐商品-->
  190. <!-- </view>-->
  191. <!-- </view>-->
  192. </view>
  193. </template>
  194. <script>
  195. import listCell from '@/components/mix-list-cell';
  196. import missing from "@/components/missing.vue"
  197. import {
  198. mapState
  199. } from 'vuex';
  200. let startY = 0, moveY = 0, pageAtTop = true;
  201. export default {
  202. components: {
  203. listCell, missing
  204. },
  205. data() {
  206. return {
  207. recommendList: [], // 推荐商品列表
  208. currentPage: 1, // 当前页码
  209. pageSize: 4, // 每页显示数量
  210. nowMoney: 0,
  211. integral: 0,
  212. couponListSize: 0,
  213. coverTransform: 'translateY(0px)',
  214. coverTransition: '0s',
  215. moving: false,
  216. footprintList: [],
  217. isVip: false,
  218. statusBarHeight: 88,
  219. storage: true,
  220. banner: {
  221. imgUrl: ''
  222. }
  223. }
  224. },
  225. onShow() {
  226. this.isVip = this.$api.isVip()
  227. //this.loadFootprint()
  228. this.$store.state.storageId ? this.storage = true : this.storage = false
  229. //如果用户已登录,获取购物车数量
  230. if (this.$store.state.userInfo.accessToken) {
  231. this.$api.request('get', 'cart/app/countCart', {
  232. storageId: this.$store.state.storageId
  233. }).then(res => {
  234. if (res.data > 0) {
  235. uni.setTabBarBadge({
  236. index: 2,
  237. text: res.data + ''
  238. })
  239. }
  240. this.$store.commit('addCart', res.data)
  241. this.$api.request('get', 'coupon/app/getUserCoupons').then(res => {
  242. this.couponListSize = res.data.length
  243. })
  244. this.$api.request('get', 'user/app/getUser').then(res => {
  245. this.nowMoney = res.data.nowMoney
  246. this.integral = res.data.integral
  247. })
  248. }).catch(err => {
  249. // this.$api.msg('请求失败,请稍后再试')
  250. })
  251. } else {
  252. // 用户未登录时,清空数据
  253. this.nowMoney = 0
  254. this.integral = 0
  255. this.couponListSize = 0
  256. }
  257. // 获取推荐商品
  258. if (this.$store.state.storageId) {
  259. this.getRecommendList()
  260. }
  261. },
  262. onLoad() {
  263. try {
  264. const res = uni.getSystemInfoSync();
  265. console.log(res.statusBarHeight);
  266. this.statusBarHeight = res.statusBarHeight
  267. } catch (e) {
  268. // error
  269. }
  270. this.$api.request('get', 'carousel/app/getCarouselActive', {
  271. adType: 8
  272. }).then(res => {
  273. this.banner = res.data[0]
  274. })
  275. },
  276. // #ifndef MP
  277. onNavigationBarButtonTap(e) {
  278. const index = e.index;
  279. if (index === 0) {
  280. this.navTo('/pages/set/set');
  281. } else if (index === 1) {
  282. // #ifdef APP-PLUS
  283. const pages = getCurrentPages();
  284. const page = pages[pages.length - 1];
  285. const currentWebview = page.$getAppWebview();
  286. currentWebview.hideTitleNViewButtonRedDot({
  287. index
  288. });
  289. // #endif
  290. uni.navigateTo({
  291. url: '/pages/notice/notice'
  292. })
  293. }
  294. },
  295. // #endif
  296. computed: {
  297. ...mapState(['hasLogin', 'userInfo'])
  298. },
  299. methods: {
  300. // async loadFootprint() {
  301. // const that = this
  302. // that.$api.request('get', 'getAllFootprint').then(res => {
  303. // that.footprintList = res.data
  304. // })
  305. // },
  306. // 获取VIP等级名称
  307. getVipName(level) {
  308. const levels = {
  309. 0: '非会员',
  310. 1: '普通会员',
  311. 2: '青铜会员',
  312. 3: '白银会员',
  313. 4: '黄金会员',
  314. 5: '铂金会员',
  315. 6: '钻石会员'
  316. };
  317. return levels[level] || '未知等级';
  318. },
  319. // 获取VIP等级对应颜色
  320. getVipColor(level) {
  321. const colors = {
  322. 0: '#999',
  323. 1: '#2a2fd6', // 普通会员绿色
  324. 2: '#CD7F32', // 青铜色
  325. 3: '#C0C0C0', // 银色
  326. 4: '#FFD700', // 金色
  327. 5: '#E5E4E2', // 铂金色
  328. 6: '#B9F2FF' // 钻石蓝
  329. };
  330. return colors[level] || '#2a2fd6';
  331. },
  332. //详情页
  333. navToDetailPage(id) {
  334. uni.navigateTo({
  335. url: `/pages/product/detail?id=${id}`
  336. })
  337. },
  338. addCart(item) {
  339. const that = this
  340. that.$api.request('get', 'cart/app/addCartItem', {
  341. productId: item.id,
  342. num: 1
  343. }).then(res => {
  344. that.$api.msg('添加购物车成功')
  345. var cartNum = this.$store.state.cartNum + 1
  346. that.$store.commit('addCart', cartNum)
  347. uni.setTabBarBadge({
  348. index: 2,
  349. text: cartNum + ''
  350. })
  351. })
  352. },
  353. // 刷新推荐
  354. refreshRecommend() {
  355. this.currentPage++
  356. this.getRecommendList()
  357. },
  358. // 获取推荐商品
  359. getRecommendList() {
  360. this.$api.request('get', 'product/app/recommend', {
  361. page: this.currentPage,
  362. size: this.pageSize,
  363. storageId: this.$store.state.storageId
  364. }).then(res => {
  365. this.recommendList = res.rows || []
  366. }).catch(err => {
  367. console.log('获取推荐商品失败', err)
  368. })
  369. },
  370. deleteFootprint(item) {
  371. const that = this
  372. uni.showModal({
  373. title: '删除?',
  374. content: '您确定要删除此足迹吗?',
  375. success: (e) => {
  376. if (e.confirm) {
  377. that.$api.request('get', '/deleteFootprint', {
  378. footprintId: item.id
  379. }).then(res => {
  380. that.loadFootprint()
  381. })
  382. }
  383. }
  384. })
  385. },
  386. toLogin() {
  387. if (!this.hasLogin) {
  388. uni.navigateTo({
  389. url: '/pages/public/login'
  390. })
  391. }
  392. },
  393. logout() {
  394. const that = this
  395. uni.showModal({
  396. title: '询问',
  397. content: '您确定要退出吗?',
  398. cancelText: '取消',
  399. confirmText: '确定',
  400. success: (e) => {
  401. if (e.confirm) {
  402. // 清空用户数据
  403. that.nowMoney = 0
  404. that.integral = 0
  405. that.couponListSize = 0
  406. // 退出登录
  407. that.$store.commit('logout')
  408. that.$api.logout()
  409. // 清除本地存储
  410. uni.removeStorageSync("addresses")
  411. uni.removeStorageSync("userInfo")
  412. }
  413. }
  414. })
  415. },
  416. /**
  417. * 统一跳转接口,拦截未登录路由
  418. * navigator标签现在默认没有转场动画,所以用view
  419. */
  420. navTo(url) {
  421. if (!this.hasLogin) {
  422. url = '/pages/public/login';
  423. }
  424. uni.navigateTo({
  425. url
  426. })
  427. },
  428. /**
  429. * 会员卡下拉和回弹
  430. * 1.关闭bounce避免ios端下拉冲突
  431. * 2.由于touchmove事件的缺陷(以前做小程序就遇到,比如20跳到40,h5反而好很多),下拉的时候会有掉帧的感觉
  432. * transition设置0.1秒延迟,让css来过渡这段空窗期
  433. * 3.回弹效果可修改曲线值来调整效果,推荐一个好用的bezier生成工具 http://cubic-bezier.com/
  434. */
  435. coverTouchstart(e) {
  436. if (pageAtTop === false) {
  437. return;
  438. }
  439. this.coverTransition = 'transform .1s linear';
  440. startY = e.touches[0].clientY;
  441. },
  442. coverTouchmove(e) {
  443. moveY = e.touches[0].clientY;
  444. let moveDistance = moveY - startY;
  445. if (moveDistance < 0) {
  446. this.moving = false;
  447. return;
  448. }
  449. this.moving = true;
  450. if (moveDistance >= 80 && moveDistance < 100) {
  451. moveDistance = 80;
  452. }
  453. if (moveDistance > 0 && moveDistance <= 80) {
  454. this.coverTransform = `translateY(${moveDistance}px)`;
  455. }
  456. },
  457. coverTouchend() {
  458. if (this.moving === false) {
  459. return;
  460. }
  461. this.moving = false;
  462. this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
  463. this.coverTransform = 'translateY(0px)';
  464. },
  465. //配送外区域选择区域
  466. chooseLocation() {
  467. uni.chooseLocation({
  468. success: (res1) => {
  469. console.log(res1)
  470. this.district = res1.name
  471. uni.showLoading({
  472. title: "加载中..."
  473. })
  474. this.$api.request('get', 'storage/position/getRecentlyStorage', {
  475. lng: res1.longitude,
  476. lat: res1.latitude
  477. }, failres => {
  478. uni.hideLoading()
  479. this.logining = false
  480. this.$api.msg(failres.msg)
  481. this.storage ? this.storage = false : this.storage = true
  482. }).then(res => {
  483. uni.hideLoading()
  484. console.log(res)
  485. this.$store.commit('setStorage', res.data.id)
  486. this.newTop = []
  487. this.cheapRecommend = []
  488. this.salesTop = []
  489. this.loadData(res.data.id)
  490. if (!res.data.id) {
  491. this.storage = false
  492. } else {
  493. this.storage ? this.storage = false : this.storage = true
  494. // this.loadRecommand('refresh')
  495. }
  496. })
  497. }
  498. });
  499. }
  500. }
  501. }
  502. </script>
  503. <style lang='scss'>
  504. page {
  505. background-color: #f1f1f1;;
  506. }
  507. .contact-btn {
  508. border: none;
  509. background-color: #FFFFFF;
  510. }
  511. .contact-btn::after {
  512. border: none;
  513. }
  514. .bg-user-gradual-green {
  515. background-repeat: no-repeat;
  516. background-size: 100%;
  517. color: #fff;
  518. height: 260*2rpx;
  519. width: 750rpx;
  520. }
  521. .shadow {
  522. box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1);
  523. }
  524. %flex-center {
  525. display: flex;
  526. flex-direction: column;
  527. justify-content: center;
  528. align-items: center;
  529. }
  530. %section {
  531. display: flex;
  532. justify-content: space-around;
  533. align-content: center;
  534. background: #fff;
  535. border-radius: 10upx;
  536. }
  537. .user-section {
  538. height: 520upx;
  539. padding: 100upx 30upx 0;
  540. position: relative;
  541. .bg {
  542. position: absolute;
  543. left: 0;
  544. top: 0;
  545. width: 100%;
  546. height: 100%;
  547. filter: blur(1px);
  548. opacity: .7;
  549. }
  550. }
  551. .user-info-box {
  552. height: 180upx;
  553. display: flex;
  554. align-items: center;
  555. position: relative;
  556. z-index: 1;
  557. .portrait {
  558. width: 130upx;
  559. height: 130upx;
  560. border: 5upx solid #fff;
  561. border-radius: 50%;
  562. }
  563. .username {
  564. font-size: $font-lg + 6upx;
  565. color: $font-color-dark;
  566. margin-left: 20upx;
  567. }
  568. }
  569. .vip-card-box {
  570. display: flex;
  571. flex-direction: column;
  572. color: #f7d680;
  573. height: 240upx;
  574. background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
  575. border-radius: 16upx 16upx 0 0;
  576. overflow: hidden;
  577. position: relative;
  578. padding: 20upx 24upx;
  579. .card-bg {
  580. position: absolute;
  581. top: 20upx;
  582. right: 0;
  583. width: 380upx;
  584. height: 260upx;
  585. }
  586. .b-btn {
  587. position: absolute;
  588. right: 20upx;
  589. top: 16upx;
  590. width: 132upx;
  591. height: 40upx;
  592. text-align: center;
  593. line-height: 40upx;
  594. font-size: 22upx;
  595. color: #36343c;
  596. border-radius: 20px;
  597. background: linear-gradient(left, #f9e6af, #ffd465);
  598. z-index: 1;
  599. }
  600. .tit {
  601. font-size: $font-base+2upx;
  602. color: #f7d680;
  603. margin-bottom: 28upx;
  604. .yticon {
  605. color: #f6e5a3;
  606. margin-right: 16upx;
  607. }
  608. }
  609. .e-b {
  610. font-size: $font-sm;
  611. color: #d8cba9;
  612. margin-top: 10upx;
  613. }
  614. }
  615. .cover-container {
  616. background: $page-color-base;
  617. margin-top: -150upx;
  618. padding: 0 30upx;
  619. position: relative;
  620. background: #f5f5f5;
  621. padding-bottom: 20upx;
  622. .arc {
  623. position: absolute;
  624. left: 0;
  625. top: -34upx;
  626. width: 100%;
  627. height: 36upx;
  628. }
  629. }
  630. .tj-sction {
  631. @extend %section;
  632. .tj-item {
  633. @extend %flex-center;
  634. flex-direction: column;
  635. height: 140upx;
  636. font-size: $font-sm;
  637. color: #75787d;
  638. }
  639. .num {
  640. font-size: $font-lg;
  641. color: $font-color-dark;
  642. margin-bottom: 8upx;
  643. }
  644. }
  645. .order-section {
  646. @extend %section;
  647. padding: 28upx 0;
  648. margin-top: 20upx;
  649. .order-item {
  650. @extend %flex-center;
  651. width: 120upx;
  652. height: 120upx;
  653. border-radius: 10upx;
  654. font-size: $font-sm;
  655. color: $base-color;
  656. }
  657. .yticon {
  658. font-size: 48upx;
  659. margin-bottom: 18upx;
  660. color: $base-color;
  661. }
  662. .icon-shouhoutuikuan {
  663. font-size: 44upx;
  664. }
  665. }
  666. .history-section {
  667. padding: 30upx 0 0;
  668. margin-top: 20upx;
  669. background: #fff;
  670. border-radius: 10upx;
  671. .sec-header {
  672. display: flex;
  673. align-items: center;
  674. font-size: $font-base;
  675. color: $font-color-dark;
  676. line-height: 40upx;
  677. margin-left: 30upx;
  678. .yticon {
  679. font-size: 44upx;
  680. color: #5eba8f;
  681. margin-right: 16upx;
  682. line-height: 40upx;
  683. }
  684. }
  685. .h-list {
  686. white-space: nowrap;
  687. padding: 30upx 30upx 0;
  688. image {
  689. display: inline-block;
  690. width: 160upx;
  691. height: 160upx;
  692. margin-right: 20upx;
  693. border-radius: 10upx;
  694. }
  695. }
  696. }
  697. </style>