index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <view class="container" style="background-color: #F8F8F8;">
  3. <ourLoading isFullScreen :active="pageLoading" :text="pageLoadingText" />
  4. <image class="w-100" :src="fetch.config.home_top" mode="widthFix"></image>
  5. <view class="content">
  6. <!-- member card begin -->
  7. <view class="member-card">
  8. <view class="entrance" v-if="fetch.user.id <= 0">
  9. <view class="item" @tap="login">
  10. <view class="title">快速登录</view>
  11. </view>
  12. </view>
  13. <view class="info" v-if="fetch.user.id > 0" style="margin-top: -28rpx;">
  14. <image @tap="user" :src="fetch.user.avatar" class="avatar"></image>
  15. <view class="title" style="margin-left: 26rpx;margin-top: -40rpx;">
  16. <view class="wenyue-font" @tap="user">{{fetch.user.username}}</view>
  17. <view class="tips" @tap="user">
  18. <view v-if="fetch.user.title">{{fetch.user.title}}</view>
  19. <view v-if="!fetch.user.title">无头衔</view>
  20. </view>
  21. </view>
  22. <view class="badage" style="left:180rpx;bottom: 32rpx;word-break: break-all;overflow: auto;">
  23. <view v-if="fetch.user.info">{{fetch.user.info}}</view>
  24. <view v-if="!fetch.user.info">暂无签名</view>
  25. </view>
  26. </view>
  27. <view class="row">
  28. <view class="grid" v-for="(v, k) in fetch.row" :key="k">
  29. <view class="value">{{v.value}}</view>
  30. <view class="title">{{v.name}}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- member card end -->
  35. <!-- 星球播报 begin -->
  36. <view class="xinqiubobao member-news" style="display: none;">
  37. <view class="title">小记播报</view>
  38. <view class="list">
  39. <swiper class="item" autoplay :interval="3000" indicator-dots>
  40. <swiper-item v-for="(v, k) in fetch.xuanchuan" :key="k" @click="xuanchuan(v.link)">
  41. <view class="item">
  42. <image :src="v.pic"></image>
  43. <view class="title">{{v.name}}</view>
  44. </view>
  45. </swiper-item>
  46. </swiper>
  47. </view>
  48. </view>
  49. <!-- 星球播报 end -->
  50. <!-- 任务中心 begin -->
  51. <view class="task-center" @tap="taskCenter" style="display: none;">
  52. <view class="intro">
  53. <view class="title">任务中心</view>
  54. <view class="subtitle">MISSION CENTER</view>
  55. </view>
  56. <view class="image-wrapper">
  57. <image src="/static/images/my/b3d3a98e3c7f450aaa32fbec6aecdfaf.png"></image>
  58. </view>
  59. </view>
  60. <!-- 任务中心 end -->
  61. </view>
  62. <!-- 开通礼包 begin -->
  63. <view class="open-gift" style="display: none;">
  64. <view class="header">
  65. <view class="title">我的道具</view>
  66. <view class="subtitle" @tap="openGift">规则</view>
  67. </view>
  68. <view class="row">
  69. <view class="grid">
  70. <image src="/static/images/my/member_benefits/me_rights_icon_free.png"></image>
  71. <view class="title">
  72. <view>置顶</view>
  73. <view class="number">x0</view>
  74. </view>
  75. </view>
  76. <view class="grid">
  77. <image src="/static/images/my/member_benefits/me_rights_icon_1jia1.png"></image>
  78. <view class="title">
  79. <view>买一赠一券</view>
  80. <view class="number">x1</view>
  81. </view>
  82. </view>
  83. <view class="grid">
  84. <image src="/static/images/my/member_benefits/me_rights_icon_2jia1.png"></image>
  85. <view class="title">
  86. <view>买二赠一券</view>
  87. <view class="number">x2</view>
  88. </view>
  89. </view>
  90. <view class="grid">
  91. <image src="/static/images/my/member_benefits/me_rights_icon_qingshi.png"></image>
  92. <view class="title">
  93. <view>喜茶轻食券</view>
  94. <view class="number">x2</view>
  95. </view>
  96. </view>
  97. <view class="grid">
  98. <image src="/static/images/my/member_benefits/me_rights_icon_youxian_new.png"></image>
  99. <view class="title">
  100. <view>优先券</view>
  101. <view class="number">x2</view>
  102. </view>
  103. </view>
  104. <view class="grid">
  105. <image src="/static/images/my/member_benefits/me_rights_icon_waimai_new.png"></image>
  106. <view class="title">
  107. <view>免运费券</view>
  108. <view class="number">x2</view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- 开通礼包 end -->
  114. <list-cell hover arrow @click="invite">
  115. <view class="list-cell-wrapper">
  116. <view view="title">我的身份</view>
  117. <view class="subtitle">不同的身份,不同的人生</view>
  118. </view>
  119. </list-cell>
  120. <list-cell hover arrow @click="invite">
  121. <view class="list-cell-wrapper">
  122. <view view="title">购物中心</view>
  123. <view class="subtitle">走过路过不要错过</view>
  124. </view>
  125. </list-cell>
  126. <list-cell hover arrow @click="invite">
  127. <view class="list-cell-wrapper">
  128. <view view="title">订单列表</view>
  129. </view>
  130. </list-cell>
  131. <list-cell hover arrow @click="invite">
  132. <view class="list-cell-wrapper">
  133. <view view="title">联系客服</view>
  134. </view>
  135. </list-cell>
  136. <list-cell hover arrow @click="invite">
  137. <view class="list-cell-wrapper">
  138. <view view="title">消息中心</view>
  139. </view>
  140. </list-cell>
  141. <dever-share ref="share" :data="fetch.share" v-if="fetch.share"></dever-share>
  142. </view>
  143. </template>
  144. <script>
  145. import deverShare from '@/lib/dever/components/share.vue';
  146. import listCell from '@/lib/list-cell/list-cell.vue'
  147. export default {
  148. components: {
  149. listCell,deverShare
  150. },
  151. data() {
  152. return {
  153. boardcast: [],
  154. fetch : {
  155. user : {},
  156. config : {
  157. home_top : '',
  158. },
  159. score : {},
  160. xuanchuan : [],
  161. share : false,
  162. },
  163. }
  164. },
  165. onShow() {
  166. this.getData();
  167. },
  168. // 重新加载
  169. onPullDownRefresh: function() {
  170. this.getData();
  171. },
  172. methods: {
  173. getData : function() {
  174. this.Dever.get(this, 'app/collection/?l=api.home', {id:-1});
  175. },
  176. view : function(id) {
  177. this.Dever.location('dream/index?id=' + id);
  178. },
  179. xuanchuan : function(link) {
  180. this.Dever.location(link);
  181. },
  182. login : function() {
  183. this.Dever.location('user/login');
  184. },
  185. jiyi : function() {
  186. this.Dever.alert('敬请期待');
  187. },
  188. user : function() {
  189. this.Dever.location('user/index');
  190. },
  191. invite : function() {
  192. this.Dever.alert('敬请期待');
  193. },
  194. openGift : function() {
  195. this.Dever.alert('敬请期待');
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. /* #ifdef H5 */
  202. page {
  203. height: auto;
  204. min-height: 100%;
  205. }
  206. /* #endif */
  207. .entrance {
  208. position: relative;
  209. margin-top: -80rpx;
  210. margin-bottom: 30rpx;
  211. border-radius: 10rpx;
  212. background-color: #ffffff;
  213. box-shadow: $box-shadow;
  214. padding: 30rpx 0;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. .item {
  219. flex: 1;
  220. display: flex;
  221. flex-direction: column;
  222. justify-content: center;
  223. align-items: center;
  224. position: relative;
  225. &:nth-child(1):after {
  226. content: '';
  227. position: absolute;
  228. width: 1rpx;
  229. background-color: #ddd;
  230. right: 0;
  231. height: 100%;
  232. transform: scaleX(0.5) scaleY(0.8);
  233. }
  234. .icon {
  235. width: 84rpx;
  236. height: 84rpx;
  237. margin: 20rpx;
  238. }
  239. .title {
  240. font-size: 30rpx;
  241. color: $text-color-base;
  242. font-weight: 600;
  243. }
  244. }
  245. }
  246. .content {
  247. /*padding: 0 30rpx;*/
  248. }
  249. .welcome {
  250. position: relative;
  251. margin-top: -136rpx;
  252. display: flex;
  253. flex-direction: column;
  254. font-size: $font-size-lg;
  255. color: $text-color-warning;
  256. }
  257. .member-card {
  258. background-color: $bg-color-white;
  259. padding: 20rpx;
  260. display: flex;
  261. flex-direction: column;
  262. border-radius: $border-radius-base;
  263. margin-bottom: 40rpx;
  264. .info {
  265. position: relative;
  266. margin-top: -50rpx;
  267. display: flex;
  268. align-items: center;
  269. position: relative;
  270. padding: 20rpx 0;
  271. border-bottom: 1rpx solid rgba($color: $border-color, $alpha: 0.3);
  272. .title {
  273. flex: 1;
  274. font-size: 40rpx;
  275. color: $text-color-base;
  276. display: flex;
  277. align-items: center;
  278. .tips {
  279. margin-left: 10rpx;
  280. font-size: $font-size-sm;
  281. color: $text-color-assist;
  282. background-color: #e9e9e9;
  283. padding: 10rpx 30rpx;
  284. border-radius: 50rem !important;
  285. display: flex;
  286. align-items: center;
  287. image {
  288. width: 20rpx;
  289. height: 20rpx;
  290. }
  291. }
  292. }
  293. .badage {
  294. font-family: 'neutra';
  295. position: absolute;
  296. bottom: 20rpx;
  297. left: 0;
  298. border: 2rpx solid $text-color-base;
  299. padding: 2rpx 20rpx;
  300. border-radius: $border-radius-lg;
  301. font-size: $font-size-base;
  302. }
  303. }
  304. .row {
  305. margin-top: $spacing-row-base;
  306. width: 100%;
  307. display: flex;
  308. align-items: center;
  309. .grid {
  310. flex: 1;
  311. flex-shrink: 0;
  312. display: flex;
  313. flex-direction: column;
  314. align-items: center;
  315. image {
  316. width: 100rpx;
  317. height: 100rpx;
  318. }
  319. .value {
  320. font-family: 'neutra';
  321. margin-bottom: $spacing-col-sm;
  322. font-size: $font-size-lg;
  323. }
  324. .title {
  325. font-size: $font-size-sm;
  326. color: $text-color-grey;
  327. }
  328. }
  329. }
  330. }
  331. .xinqiubobao {
  332. width: 100%;
  333. position: relative;
  334. .title {
  335. margin: 10rpx 0;
  336. font-size: $font-size-lg;
  337. font-weight: 500;
  338. }
  339. .swiper {
  340. height: 200rpx;
  341. margin-bottom: 10rpx;
  342. .swiper-item {
  343. .swiper-item-wrapper {
  344. display: flex;
  345. background-color: $bg-color-white;
  346. padding: 40rpx 60rpx;
  347. border-radius: $border-radius-base;
  348. align-items: center;
  349. margin-right: 40rpx;
  350. image {
  351. width: 100rpx;
  352. height: 100rpx;
  353. border-radius: 100%;
  354. margin-right: 20rpx;
  355. }
  356. .desc {
  357. display: flex;
  358. flex-direction: column;
  359. .title {
  360. font-size: $font-size-medium;
  361. font-weight: 500;
  362. margin-bottom: 10rpx;
  363. }
  364. .desc {
  365. font-size: $font-size-sm;
  366. color: $text-color-grey;
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }
  373. .task-center {
  374. margin: 40rpx 0;
  375. background-color: $bg-color-white;
  376. padding: 10rpx 0;
  377. display: flex;
  378. align-items: center;
  379. border-radius: $border-radius-lg;
  380. .intro {
  381. flex: 1;
  382. display: flex;
  383. flex-direction: column;
  384. justify-content: center;
  385. align-items: center;
  386. .title {
  387. font-size: $font-size-lg;
  388. color: $text-color-base;
  389. }
  390. .subtitle {
  391. font-family: 'neutra';
  392. font-size: $font-size-sm;
  393. }
  394. }
  395. .image-wrapper {
  396. flex: 1;
  397. display: flex;
  398. justify-content: center;
  399. align-items: center;
  400. image {
  401. width: 200rpx;
  402. height: 200rpx;
  403. }
  404. }
  405. }
  406. .open-gift {
  407. width: 100%;
  408. background-color: $bg-color-white;
  409. padding: 30rpx 40rpx;
  410. margin-bottom: 20rpx;
  411. .header {
  412. display: flex;
  413. justify-content: space-between;
  414. align-items: center;
  415. margin-bottom: 20rpx;
  416. .title {
  417. font-size: $font-size-lg;
  418. font-weight: 500;
  419. }
  420. .subtitle {
  421. font-size: $font-size-base;
  422. color: $text-color-grey;
  423. }
  424. }
  425. .row {
  426. display: flex;
  427. flex-wrap: wrap;
  428. .grid {
  429. width: 33.3333%;
  430. display: flex;
  431. flex-direction: column;
  432. align-items: center;
  433. padding: 20rpx;
  434. image {
  435. width: 70rpx;
  436. height: 70rpx;
  437. margin-bottom: $spacing-row-base;
  438. }
  439. .title {
  440. font-size: $font-size-base;
  441. color: $text-color-base;
  442. display: flex;
  443. align-items: baseline;
  444. .number {
  445. margin-left: 5rpx;
  446. font-family: 'neutra';
  447. color: $color-warning;
  448. }
  449. }
  450. }
  451. }
  452. }
  453. .list-cell-wrapper {
  454. width: 100%;
  455. display: flex;
  456. justify-content: space-between;
  457. align-items: center;
  458. .title {
  459. font-size: $font-size-lg;
  460. }
  461. .subtitle {
  462. font-size: $font-size-sm;
  463. color: $text-color-assist;
  464. }
  465. }
  466. .member-news {
  467. width: 100%;
  468. margin-bottom: 30rpx;
  469. .header {
  470. display: flex;
  471. align-items: center;
  472. justify-content: space-between;
  473. padding: 20rpx 0;
  474. .title {
  475. font-size: $font-size-lg;
  476. font-weight: bold;
  477. }
  478. .iconfont {
  479. font-size: 52rpx;
  480. color: $text-color-assist;
  481. }
  482. }
  483. .list {
  484. width: 100%;
  485. display: flex;
  486. flex-direction: column;
  487. .item {
  488. width: 100%;
  489. height: 380rpx;
  490. position: relative;
  491. image {
  492. width: 100%;
  493. height: 100%;
  494. border-radius: 8rpx;
  495. }
  496. .title {
  497. position: relative;
  498. font-size: 32rpx;
  499. font-weight: 500;
  500. width: 100%;
  501. top: -70rpx;
  502. left: 16rpx;
  503. color: #ffffff;
  504. }
  505. }
  506. }
  507. }
  508. </style>