index_o.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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">
  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>
  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. <dever-share ref="share" :data="fetch.share" v-if="fetch.share"></dever-share>
  141. </view>
  142. </template>
  143. <script>
  144. import deverShare from '@/lib/dever/components/share.vue';
  145. import listCell from '@/lib/list-cell/list-cell.vue'
  146. export default {
  147. components: {
  148. listCell,deverShare
  149. },
  150. data() {
  151. return {
  152. boardcast: [],
  153. fetch : {
  154. user : {},
  155. config : {
  156. home_top : '',
  157. },
  158. score : {},
  159. xuanchuan : [],
  160. share : false,
  161. },
  162. }
  163. },
  164. onShow() {
  165. this.getData();
  166. },
  167. // 重新加载
  168. onPullDownRefresh: function() {
  169. this.getData();
  170. },
  171. methods: {
  172. getData : function() {
  173. this.Dever.get(this, 'app/collection/?l=api.home', {id:-1});
  174. },
  175. view : function(id) {
  176. this.Dever.location('dream/index?id=' + id);
  177. },
  178. xuanchuan : function(link) {
  179. this.Dever.location(link);
  180. },
  181. login : function() {
  182. this.Dever.location('user/login');
  183. },
  184. jiyi : function() {
  185. this.Dever.alert('敬请期待');
  186. },
  187. user : function() {
  188. this.Dever.location('user/index');
  189. },
  190. invite : function() {
  191. this.Dever.alert('敬请期待');
  192. },
  193. openGift : function() {
  194. this.Dever.alert('敬请期待');
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. /* #ifdef H5 */
  201. page {
  202. height: auto;
  203. min-height: 100%;
  204. }
  205. /* #endif */
  206. .entrance {
  207. position: relative;
  208. margin-top: -80rpx;
  209. margin-bottom: 30rpx;
  210. border-radius: 10rpx;
  211. background-color: #ffffff;
  212. box-shadow: $box-shadow;
  213. padding: 30rpx 0;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. .item {
  218. flex: 1;
  219. display: flex;
  220. flex-direction: column;
  221. justify-content: center;
  222. align-items: center;
  223. position: relative;
  224. &:nth-child(1):after {
  225. content: '';
  226. position: absolute;
  227. width: 1rpx;
  228. background-color: #ddd;
  229. right: 0;
  230. height: 100%;
  231. transform: scaleX(0.5) scaleY(0.8);
  232. }
  233. .icon {
  234. width: 84rpx;
  235. height: 84rpx;
  236. margin: 20rpx;
  237. }
  238. .title {
  239. font-size: 30rpx;
  240. color: $text-color-base;
  241. font-weight: 600;
  242. }
  243. }
  244. }
  245. .content {
  246. /*padding: 0 30rpx;*/
  247. }
  248. .welcome {
  249. position: relative;
  250. margin-top: -136rpx;
  251. display: flex;
  252. flex-direction: column;
  253. font-size: $font-size-lg;
  254. color: $text-color-warning;
  255. }
  256. .member-card {
  257. background-color: $bg-color-white;
  258. padding: 20rpx;
  259. display: flex;
  260. flex-direction: column;
  261. border-radius: $border-radius-base;
  262. margin-bottom: 40rpx;
  263. .info {
  264. position: relative;
  265. margin-top: -50rpx;
  266. display: flex;
  267. align-items: center;
  268. position: relative;
  269. padding: 20rpx 0;
  270. border-bottom: 1rpx solid rgba($color: $border-color, $alpha: 0.3);
  271. .title {
  272. flex: 1;
  273. font-size: 40rpx;
  274. color: $text-color-base;
  275. display: flex;
  276. align-items: center;
  277. .tips {
  278. margin-left: 10rpx;
  279. font-size: $font-size-sm;
  280. color: $text-color-assist;
  281. background-color: #e9e9e9;
  282. padding: 10rpx 30rpx;
  283. border-radius: 50rem !important;
  284. display: flex;
  285. align-items: center;
  286. image {
  287. width: 20rpx;
  288. height: 20rpx;
  289. }
  290. }
  291. }
  292. .badage {
  293. font-family: 'neutra';
  294. position: absolute;
  295. bottom: 20rpx;
  296. left: 0;
  297. border: 2rpx solid $text-color-base;
  298. padding: 2rpx 20rpx;
  299. border-radius: $border-radius-lg;
  300. font-size: $font-size-base;
  301. }
  302. }
  303. .row {
  304. margin-top: $spacing-row-base;
  305. width: 100%;
  306. display: flex;
  307. align-items: center;
  308. .grid {
  309. flex: 1;
  310. flex-shrink: 0;
  311. display: flex;
  312. flex-direction: column;
  313. align-items: center;
  314. image {
  315. width: 100rpx;
  316. height: 100rpx;
  317. }
  318. .value {
  319. font-family: 'neutra';
  320. margin-bottom: $spacing-col-sm;
  321. font-size: $font-size-lg;
  322. }
  323. .title {
  324. font-size: $font-size-sm;
  325. color: $text-color-grey;
  326. }
  327. }
  328. }
  329. }
  330. .xinqiubobao {
  331. width: 100%;
  332. position: relative;
  333. .title {
  334. margin: 10rpx 0;
  335. font-size: $font-size-lg;
  336. font-weight: 500;
  337. }
  338. .swiper {
  339. height: 200rpx;
  340. margin-bottom: 10rpx;
  341. .swiper-item {
  342. .swiper-item-wrapper {
  343. display: flex;
  344. background-color: $bg-color-white;
  345. padding: 40rpx 60rpx;
  346. border-radius: $border-radius-base;
  347. align-items: center;
  348. margin-right: 40rpx;
  349. image {
  350. width: 100rpx;
  351. height: 100rpx;
  352. border-radius: 100%;
  353. margin-right: 20rpx;
  354. }
  355. .desc {
  356. display: flex;
  357. flex-direction: column;
  358. .title {
  359. font-size: $font-size-medium;
  360. font-weight: 500;
  361. margin-bottom: 10rpx;
  362. }
  363. .desc {
  364. font-size: $font-size-sm;
  365. color: $text-color-grey;
  366. }
  367. }
  368. }
  369. }
  370. }
  371. }
  372. .task-center {
  373. margin: 40rpx 0;
  374. background-color: $bg-color-white;
  375. padding: 10rpx 0;
  376. display: flex;
  377. align-items: center;
  378. border-radius: $border-radius-lg;
  379. .intro {
  380. flex: 1;
  381. display: flex;
  382. flex-direction: column;
  383. justify-content: center;
  384. align-items: center;
  385. .title {
  386. font-size: $font-size-lg;
  387. color: $text-color-base;
  388. }
  389. .subtitle {
  390. font-family: 'neutra';
  391. font-size: $font-size-sm;
  392. }
  393. }
  394. .image-wrapper {
  395. flex: 1;
  396. display: flex;
  397. justify-content: center;
  398. align-items: center;
  399. image {
  400. width: 200rpx;
  401. height: 200rpx;
  402. }
  403. }
  404. }
  405. .open-gift {
  406. width: 100%;
  407. background-color: $bg-color-white;
  408. padding: 30rpx 40rpx;
  409. margin-bottom: 20rpx;
  410. .header {
  411. display: flex;
  412. justify-content: space-between;
  413. align-items: center;
  414. margin-bottom: 20rpx;
  415. .title {
  416. font-size: $font-size-lg;
  417. font-weight: 500;
  418. }
  419. .subtitle {
  420. font-size: $font-size-base;
  421. color: $text-color-grey;
  422. }
  423. }
  424. .row {
  425. display: flex;
  426. flex-wrap: wrap;
  427. .grid {
  428. width: 33.3333%;
  429. display: flex;
  430. flex-direction: column;
  431. align-items: center;
  432. padding: 20rpx;
  433. image {
  434. width: 70rpx;
  435. height: 70rpx;
  436. margin-bottom: $spacing-row-base;
  437. }
  438. .title {
  439. font-size: $font-size-base;
  440. color: $text-color-base;
  441. display: flex;
  442. align-items: baseline;
  443. .number {
  444. margin-left: 5rpx;
  445. font-family: 'neutra';
  446. color: $color-warning;
  447. }
  448. }
  449. }
  450. }
  451. }
  452. .list-cell-wrapper {
  453. width: 100%;
  454. display: flex;
  455. justify-content: space-between;
  456. align-items: center;
  457. .title {
  458. font-size: $font-size-lg;
  459. }
  460. .subtitle {
  461. font-size: $font-size-sm;
  462. color: $text-color-assist;
  463. }
  464. }
  465. .member-news {
  466. width: 100%;
  467. margin-bottom: 30rpx;
  468. .header {
  469. display: flex;
  470. align-items: center;
  471. justify-content: space-between;
  472. padding: 20rpx 0;
  473. .title {
  474. font-size: $font-size-lg;
  475. font-weight: bold;
  476. }
  477. .iconfont {
  478. font-size: 52rpx;
  479. color: $text-color-assist;
  480. }
  481. }
  482. .list {
  483. width: 100%;
  484. display: flex;
  485. flex-direction: column;
  486. .item {
  487. width: 100%;
  488. height: 380rpx;
  489. position: relative;
  490. image {
  491. width: 100%;
  492. height: 100%;
  493. border-radius: 8rpx;
  494. }
  495. .title {
  496. position: relative;
  497. font-size: 32rpx;
  498. font-weight: 500;
  499. width: 100%;
  500. top: -70rpx;
  501. left: 16rpx;
  502. color: #ffffff;
  503. }
  504. }
  505. }
  506. }
  507. </style>