index.vue 12 KB

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