index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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">
  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. }
  88. },
  89. computed: {
  90. ...mapState(['member']),
  91. //...mapGetters(['isLogin'])
  92. },
  93. methods: {
  94. takein() {
  95. this.$store.commit('SET_ORDER_TYPE', 'takein')
  96. uni.switchTab({
  97. url: '/pages/menu/menu'
  98. })
  99. },
  100. takeout() {
  101. if(!this.isLogin) {
  102. uni.navigateTo({url: '/pages/login/login'})
  103. return
  104. }
  105. uni.navigateTo({
  106. url: "/pages/address/address?is_choose=true"
  107. })
  108. },
  109. integrals() {
  110. if(!this.isLogin) {
  111. uni.navigateTo({url: '/pages/login/login'})
  112. return
  113. }
  114. uni.navigateTo({
  115. url: '/pages/integrals/integrals'
  116. })
  117. },
  118. packages() {
  119. uni.navigateTo({
  120. url: '/pages/packages/index'
  121. })
  122. },
  123. memberCode() {
  124. if(!this.isLogin) {
  125. uni.navigateTo({url: '/pages/login/login'})
  126. return
  127. }
  128. uni.navigateTo({
  129. url: '/pages/mine/member-code'
  130. })
  131. },
  132. invite() {
  133. uni.navigateTo({
  134. url: '/pages/activities/invite'
  135. })
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. /* #ifdef H5 */
  142. page {
  143. height: auto;
  144. min-height: 100%;
  145. }
  146. /* #endif */
  147. uni-page-body {
  148. background-color:#F1F8FA;
  149. }
  150. .banner {
  151. position: relative;
  152. width: 100%;
  153. height: 600rpx;
  154. .bg {
  155. width: 100%;
  156. height: 600rpx;
  157. }
  158. .intro {
  159. position: absolute;
  160. top: calc(50rpx + var(--status-bar-height));
  161. left: 40rpx;
  162. color: #FFFFFF;
  163. display: flex;
  164. flex-direction: column;
  165. .greet {
  166. font-size: $font-size-lg;
  167. margin-bottom: 10rpx;
  168. }
  169. .note {
  170. font-size: $font-size-sm;
  171. }
  172. }
  173. }
  174. .content {
  175. padding: 0 30rpx;
  176. }
  177. .entrance {
  178. position: relative;
  179. margin-top: -80rpx;
  180. margin-bottom: 30rpx;
  181. border-radius: 10rpx;
  182. background-color: #ffffff;
  183. box-shadow: $box-shadow;
  184. padding: 30rpx 0;
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. .item {
  189. flex: 1;
  190. display: flex;
  191. flex-direction: column;
  192. justify-content: center;
  193. align-items: center;
  194. position: relative;
  195. &:nth-child(1):after {
  196. content: '';
  197. position: absolute;
  198. width: 1rpx;
  199. background-color: #ddd;
  200. right: 0;
  201. height: 100%;
  202. transform: scaleX(0.5) scaleY(0.8);
  203. }
  204. .icon {
  205. width: 84rpx;
  206. height: 84rpx;
  207. margin: 20rpx;
  208. }
  209. .title {
  210. font-size: 30rpx;
  211. color: $text-color-base;
  212. font-weight: 600;
  213. }
  214. }
  215. }
  216. .info {
  217. position: relative;
  218. margin-bottom: 30rpx;
  219. border-radius: 10rpx;
  220. background-color: #ffffff;
  221. box-shadow: $box-shadow;
  222. padding: 30rpx;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. .integral_section {
  227. flex: 1;
  228. display: flex;
  229. flex-direction: column;
  230. justify-content: center;
  231. .top {
  232. display: flex;
  233. align-items: center;
  234. .title {
  235. color: $text-color-base;
  236. font-size: $font-size-base;
  237. margin-right: 10rpx;
  238. }
  239. .value {
  240. font-size: 44rpx;
  241. font-weight: bold;
  242. }
  243. }
  244. .bottom {
  245. font-size: $font-size-sm;
  246. color: $text-color-assist;
  247. display: flex;
  248. align-items: center;
  249. }
  250. }
  251. .qrcode_section {
  252. color: $color-primary;
  253. display: flex;
  254. flex-direction: column;
  255. align-items: center;
  256. justify-content: center;
  257. font-size: $font-size-sm;
  258. image {
  259. width: 40rpx;
  260. height: 40rpx;
  261. margin-bottom: 10rpx;
  262. }
  263. }
  264. }
  265. .navigators {
  266. width: 100%;
  267. margin-bottom: 20rpx;
  268. border-radius: 10rpx;
  269. background-color: #ffffff;
  270. box-shadow: $box-shadow;
  271. padding: 20rpx;
  272. display: flex;
  273. align-items: stretch;
  274. .left {
  275. width: 340rpx;
  276. margin-right: 20rpx;
  277. display: flex;
  278. padding: 0 20rpx;
  279. flex-direction: column;
  280. font-size: $font-size-sm;
  281. color: $text-color-base;
  282. background-color: #F2F2E6;
  283. .grid {
  284. height: 50%;
  285. display: flex;
  286. }
  287. }
  288. .right {
  289. width: 290rpx;
  290. display: flex;
  291. flex-direction: column;
  292. .tea-activity, .member-gifts {
  293. width: 100%;
  294. display: flex;
  295. padding: 20rpx;
  296. font-size: $font-size-sm;
  297. color: $text-color-base;
  298. align-items: center;
  299. position: relative;
  300. }
  301. .tea-activity {
  302. background-color: #FDF3F2;
  303. margin-bottom: 20rpx;
  304. }
  305. .member-gifts {
  306. background-color: #FCF6D4;
  307. }
  308. .right-img {
  309. flex: 1;
  310. position: relative;
  311. margin-left: 20rpx;
  312. margin-right: -20rpx;
  313. margin-bottom: -20rpx;
  314. display: flex;
  315. align-items: flex-end;
  316. image {
  317. width: 100%;
  318. }
  319. }
  320. }
  321. .mark-img {
  322. width: 30rpx;
  323. height: 30rpx;
  324. margin-right: 10rpx;
  325. }
  326. .yzclh-img {
  327. height: 122.96rpx;
  328. width: 214.86rpx;
  329. }
  330. }
  331. .member-news {
  332. width: 100%;
  333. margin-bottom: 30rpx;
  334. .header {
  335. display: flex;
  336. align-items: center;
  337. justify-content: space-between;
  338. padding: 20rpx 0;
  339. .title {
  340. font-size: $font-size-lg;
  341. font-weight: bold;
  342. }
  343. .iconfont {
  344. font-size: 52rpx;
  345. color: $text-color-assist;
  346. }
  347. }
  348. .list {
  349. width: 100%;
  350. display: flex;
  351. flex-direction: column;
  352. .item {
  353. width: 100%;
  354. height: 240rpx;
  355. position: relative;
  356. image {
  357. width: 100%;
  358. height: 100%;
  359. border-radius: 8rpx;
  360. }
  361. .title {
  362. position: relative;
  363. font-size: 32rpx;
  364. font-weight: 500;
  365. width: 100%;
  366. top: -70rpx;
  367. left: 16rpx;
  368. color: #ffffff;
  369. }
  370. }
  371. }
  372. }
  373. </style>