index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <view class="container">
  3. <view class="banner">
  4. <image src="https://img-shop.qmimg.cn/s23107/2020/04/26/3eb7808bf105262604.jpg" mode="" class="bg"></image>
  5. <view class="intro">
  6. <view class="greet">您好,{{ isLogin ? member.nickname : '游客' }}</view>
  7. <view class="note">一杯奶茶,一口软欧包,在奈雪遇见两种美好</view>
  8. </view>
  9. </view>
  10. <view class="content">
  11. <view class="entrance">
  12. <view class="item" @tap="takein">
  13. <image src="/static/images/index/zq.png" class="icon"></image>
  14. <view class="title">记忆</view>
  15. </view>
  16. <view class="item" @tap="takeout">
  17. <image src="/static/images/index/wm.png" class="icon"></image>
  18. <view class="title">事件</view>
  19. </view>
  20. </view>
  21. <view class="info">
  22. <view class="integral_section" @tap="integrals">
  23. <view class="top">
  24. <text class="title">我的余额</text>
  25. <text class="value">411</text>
  26. </view>
  27. <view class="bottom">
  28. 进入商城兑换合小券及小记周边好礼
  29. <view class="iconfont iconarrow-right"></view>
  30. </view>
  31. </view>
  32. <view class="qrcode_section" @tap="memberCode">
  33. <image src="/static/images/index/qrcode.png"></image>
  34. <text>邀请码</text>
  35. </view>
  36. </view>
  37. <view class="navigators" style="display: none;">
  38. <view class="left">
  39. <view class="grid flex-column just-content-center">
  40. <view class="d-flex align-items-center">
  41. <image src="/static/images/index/csc.png" class="mark-img"></image>
  42. <view class="font-size-sm text-color-base">小记商城</view>
  43. </view>
  44. <view class="text-color-assist" style="margin-left: 40rpx; font-size: 20rpx;">精美食品饰品,合起来买,更优惠~</view>
  45. </view>
  46. <view class="grid justify-content-end align-items-end">
  47. <image src="/static/images/index/yzclh.png" class="yzclh-img" mode="heightFix"></image>
  48. </view>
  49. </view>
  50. <view class="right">
  51. <view class="tea-activity" @tap="invite">
  52. <image src="/static/images/index/mcsb.png" class="mark-img"></image>
  53. <view>小记互助</view>
  54. <view class="right-img">
  55. <image src="/static/images/index/mcsb_bg.png" mode="widthFix"></image>
  56. </view>
  57. </view>
  58. <view class="member-gifts" @tap="packages">
  59. <image src="/static/images/index/hyjb.png" class="mark-img"></image>
  60. <view>小记联盟</view>
  61. <view class="right-img">
  62. <image src="/static/images/index/hyjb_bg.png" mode="widthFix"></image>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="member-news">
  68. <view class="header">
  69. <view class="title">小记宣传栏</view>
  70. <view class="iconfont iconRightbutton"></view>
  71. </view>
  72. <view class="list">
  73. <view class="item">
  74. <image src="https://img-shop.qmimg.cn/s23107/2020/04/27/0039bf41c9ebd50a2c.jpg"></image>
  75. <view class="title">"梅"你不行 | 霸气杨梅清爽回归</view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {mapState, mapGetters} from 'vuex'
  84. export default {
  85. data() {
  86. return {
  87. fetch : {
  88. user : {},
  89. },
  90. }
  91. },
  92. computed: {
  93. ...mapState(['member']),
  94. },
  95. onShow() {
  96. //this.Dever.checkLogin();
  97. this.getData(1);
  98. },
  99. // 重新加载
  100. onPullDownRefresh: function() {
  101. this.getData(1);
  102. },
  103. //下拉加载
  104. onReachBottom() {
  105. this.getData(2);
  106. },
  107. methods: {
  108. getData : function(page) {
  109. this.Dever.get(this, 'app/collection/?l=api.home', {id:-1});
  110. },
  111. view : function(id) {
  112. this.Dever.location('dream/index?id=' + id);
  113. },
  114. takein() {
  115. this.$store.commit('SET_ORDER_TYPE', 'takein')
  116. uni.switchTab({
  117. url: '/pages/menu/menu'
  118. })
  119. },
  120. takeout() {
  121. if(!this.isLogin) {
  122. uni.navigateTo({url: '/pages/login/login'})
  123. return
  124. }
  125. uni.navigateTo({
  126. url: "/pages/address/address?is_choose=true"
  127. })
  128. },
  129. integrals() {
  130. if(!this.isLogin) {
  131. uni.navigateTo({url: '/pages/login/login'})
  132. return
  133. }
  134. uni.navigateTo({
  135. url: '/pages/integrals/integrals'
  136. })
  137. },
  138. packages() {
  139. uni.navigateTo({
  140. url: '/pages/packages/index'
  141. })
  142. },
  143. memberCode() {
  144. if(!this.isLogin) {
  145. uni.navigateTo({url: '/pages/login/login'})
  146. return
  147. }
  148. uni.navigateTo({
  149. url: '/pages/mine/member-code'
  150. })
  151. },
  152. invite() {
  153. uni.navigateTo({
  154. url: '/pages/activities/invite'
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. /* #ifdef H5 */
  162. page {
  163. height: auto;
  164. min-height: 100%;
  165. }
  166. /* #endif */
  167. uni-page-body {
  168. background-color:#F1F8FA;
  169. }
  170. .banner {
  171. position: relative;
  172. width: 100%;
  173. height: 600rpx;
  174. .bg {
  175. width: 100%;
  176. height: 600rpx;
  177. }
  178. .intro {
  179. position: absolute;
  180. top: calc(50rpx + var(--status-bar-height));
  181. left: 40rpx;
  182. color: #FFFFFF;
  183. display: flex;
  184. flex-direction: column;
  185. .greet {
  186. font-size: $font-size-lg;
  187. margin-bottom: 10rpx;
  188. }
  189. .note {
  190. font-size: $font-size-sm;
  191. }
  192. }
  193. }
  194. .content {
  195. padding: 0 30rpx;
  196. }
  197. .entrance {
  198. position: relative;
  199. margin-top: -80rpx;
  200. margin-bottom: 30rpx;
  201. border-radius: 10rpx;
  202. background-color: #ffffff;
  203. box-shadow: $box-shadow;
  204. padding: 30rpx 0;
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. .item {
  209. flex: 1;
  210. display: flex;
  211. flex-direction: column;
  212. justify-content: center;
  213. align-items: center;
  214. position: relative;
  215. &:nth-child(1):after {
  216. content: '';
  217. position: absolute;
  218. width: 1rpx;
  219. background-color: #ddd;
  220. right: 0;
  221. height: 100%;
  222. transform: scaleX(0.5) scaleY(0.8);
  223. }
  224. .icon {
  225. width: 84rpx;
  226. height: 84rpx;
  227. margin: 20rpx;
  228. }
  229. .title {
  230. font-size: 30rpx;
  231. color: $text-color-base;
  232. font-weight: 600;
  233. }
  234. }
  235. }
  236. .info {
  237. position: relative;
  238. margin-bottom: 30rpx;
  239. border-radius: 10rpx;
  240. background-color: #ffffff;
  241. box-shadow: $box-shadow;
  242. padding: 30rpx;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. .integral_section {
  247. flex: 1;
  248. display: flex;
  249. flex-direction: column;
  250. justify-content: center;
  251. .top {
  252. display: flex;
  253. align-items: center;
  254. .title {
  255. color: $text-color-base;
  256. font-size: $font-size-base;
  257. margin-right: 10rpx;
  258. }
  259. .value {
  260. font-size: 44rpx;
  261. font-weight: bold;
  262. }
  263. }
  264. .bottom {
  265. font-size: $font-size-sm;
  266. color: $text-color-assist;
  267. display: flex;
  268. align-items: center;
  269. }
  270. }
  271. .qrcode_section {
  272. color: $color-primary;
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. justify-content: center;
  277. font-size: $font-size-sm;
  278. image {
  279. width: 40rpx;
  280. height: 40rpx;
  281. margin-bottom: 10rpx;
  282. }
  283. }
  284. }
  285. .navigators {
  286. width: 100%;
  287. margin-bottom: 20rpx;
  288. border-radius: 10rpx;
  289. background-color: #ffffff;
  290. box-shadow: $box-shadow;
  291. padding: 20rpx;
  292. display: flex;
  293. align-items: stretch;
  294. .left {
  295. width: 340rpx;
  296. margin-right: 20rpx;
  297. display: flex;
  298. padding: 0 20rpx;
  299. flex-direction: column;
  300. font-size: $font-size-sm;
  301. color: $text-color-base;
  302. background-color: #F2F2E6;
  303. .grid {
  304. height: 50%;
  305. display: flex;
  306. }
  307. }
  308. .right {
  309. width: 290rpx;
  310. display: flex;
  311. flex-direction: column;
  312. .tea-activity, .member-gifts {
  313. width: 100%;
  314. display: flex;
  315. padding: 20rpx;
  316. font-size: $font-size-sm;
  317. color: $text-color-base;
  318. align-items: center;
  319. position: relative;
  320. }
  321. .tea-activity {
  322. background-color: #FDF3F2;
  323. margin-bottom: 20rpx;
  324. }
  325. .member-gifts {
  326. background-color: #FCF6D4;
  327. }
  328. .right-img {
  329. flex: 1;
  330. position: relative;
  331. margin-left: 20rpx;
  332. margin-right: -20rpx;
  333. margin-bottom: -20rpx;
  334. display: flex;
  335. align-items: flex-end;
  336. image {
  337. width: 100%;
  338. }
  339. }
  340. }
  341. .mark-img {
  342. width: 30rpx;
  343. height: 30rpx;
  344. margin-right: 10rpx;
  345. }
  346. .yzclh-img {
  347. height: 122.96rpx;
  348. width: 214.86rpx;
  349. }
  350. }
  351. .member-news {
  352. width: 100%;
  353. margin-bottom: 30rpx;
  354. .header {
  355. display: flex;
  356. align-items: center;
  357. justify-content: space-between;
  358. padding: 20rpx 0;
  359. .title {
  360. font-size: $font-size-lg;
  361. font-weight: bold;
  362. }
  363. .iconfont {
  364. font-size: 52rpx;
  365. color: $text-color-assist;
  366. }
  367. }
  368. .list {
  369. width: 100%;
  370. display: flex;
  371. flex-direction: column;
  372. .item {
  373. width: 100%;
  374. height: 240rpx;
  375. position: relative;
  376. image {
  377. width: 100%;
  378. height: 100%;
  379. border-radius: 8rpx;
  380. }
  381. .title {
  382. position: relative;
  383. font-size: 32rpx;
  384. font-weight: 500;
  385. width: 100%;
  386. top: -70rpx;
  387. left: 16rpx;
  388. color: #ffffff;
  389. }
  390. }
  391. }
  392. }
  393. </style>