index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <view class="container">
  3. <view class="banner">
  4. <image :src="fetch.config.home_top" mode="" class="bg"></image>
  5. <view class="intro" v-if="fetch.user.id <= 0">
  6. <view class="greet">您好,{{fetch.user.username}}</view>
  7. <view class="note">{{fetch.config.info}}</view>
  8. </view>
  9. </view>
  10. <view class="content">
  11. <view class="entrance" v-if="fetch.user.id > 0">
  12. <view class="item" @tap="user">
  13. <image :src="fetch.user.avatar" class="icon"></image>
  14. <view class="title">{{fetch.user.username}}</view>
  15. </view>
  16. <view class="item" @tap="jiyi">
  17. <image src="/static/images/index/wm.png" class="icon"></image>
  18. <view class="title">记忆</view>
  19. </view>
  20. </view>
  21. <view class="entrance" v-if="fetch.user.id <= 0">
  22. <view class="item" @tap="login">
  23. <view class="title">登录</view>
  24. </view>
  25. </view>
  26. <view class="info">
  27. <view class="integral_section">
  28. <view class="top">
  29. <text class="title">{{fetch.score.name}}</text>
  30. <text class="value">{{fetch.score.score}}</text>
  31. </view>
  32. <view class="bottom" v-if="fetch.score.info">
  33. {{fetch.score.info}}
  34. <view class="iconfont iconarrow-right"></view>
  35. </view>
  36. </view>
  37. <view class="qrcode_section" @tap="invite">
  38. <image src="/static/images/index/qrcode.png"></image>
  39. <text>身份证明</text>
  40. </view>
  41. </view>
  42. <view class="navigators" style="display: none;">
  43. <view class="left">
  44. <view class="grid flex-column just-content-center">
  45. <view class="d-flex align-items-center">
  46. <image src="/static/images/index/csc.png" class="mark-img"></image>
  47. <view class="font-size-sm text-color-base">小记商城</view>
  48. </view>
  49. <view class="text-color-assist" style="margin-left: 40rpx; font-size: 20rpx;">精美食品饰品,合起来买,更优惠~</view>
  50. </view>
  51. <view class="grid justify-content-end align-items-end">
  52. <image src="/static/images/index/yzclh.png" class="yzclh-img" mode="heightFix"></image>
  53. </view>
  54. </view>
  55. <view class="right">
  56. <view class="tea-activity" @tap="invite">
  57. <image src="/static/images/index/mcsb.png" class="mark-img"></image>
  58. <view>小记互助</view>
  59. <view class="right-img">
  60. <image src="/static/images/index/mcsb_bg.png" mode="widthFix"></image>
  61. </view>
  62. </view>
  63. <view class="member-gifts" @tap="packages">
  64. <image src="/static/images/index/hyjb.png" class="mark-img"></image>
  65. <view>小记联盟</view>
  66. <view class="right-img">
  67. <image src="/static/images/index/hyjb_bg.png" mode="widthFix"></image>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="member-news">
  73. <view class="header">
  74. <view class="title">小记宣传栏</view>
  75. <view class="iconfont iconRightbutton" style="display: none;"></view>
  76. </view>
  77. <view class="list">
  78. <view class="item" v-for="(v, k) in fetch.xuanchuan" :key="k" @click="xuanchuan(v.link)">
  79. <image :src="v.pic"></image>
  80. <view class="title">{{v.name}}</view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. fetch : {
  92. user : {},
  93. config : {
  94. home_top : '',
  95. },
  96. score : {},
  97. },
  98. }
  99. },
  100. onShow() {
  101. this.getData();
  102. },
  103. // 重新加载
  104. onPullDownRefresh: function() {
  105. this.getData();
  106. },
  107. methods: {
  108. getData : function() {
  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. xuanchuan : function(link) {
  115. this.Dever.location(link);
  116. },
  117. login : function() {
  118. this.Dever.location('user/login');
  119. },
  120. jiyi : function() {
  121. this.Dever.alert('敬请期待');
  122. },
  123. user : function() {
  124. },
  125. invite : function() {
  126. this.Dever.alert('敬请期待');
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. /* #ifdef H5 */
  133. page {
  134. height: auto;
  135. min-height: 100%;
  136. }
  137. /* #endif */
  138. uni-page-body {
  139. background-color:#F1F8FA;
  140. }
  141. .banner {
  142. position: relative;
  143. width: 100%;
  144. height: 600rpx;
  145. .bg {
  146. width: 100%;
  147. height: 600rpx;
  148. }
  149. .intro {
  150. position: absolute;
  151. top: calc(50rpx + var(--status-bar-height));
  152. left: 40rpx;
  153. color: #FFFFFF;
  154. display: flex;
  155. flex-direction: column;
  156. .greet {
  157. font-size: $font-size-lg;
  158. margin-bottom: 10rpx;
  159. }
  160. .note {
  161. font-size: $font-size-sm;
  162. }
  163. }
  164. }
  165. .content {
  166. padding: 0 30rpx;
  167. }
  168. .entrance {
  169. position: relative;
  170. margin-top: -80rpx;
  171. margin-bottom: 30rpx;
  172. border-radius: 10rpx;
  173. background-color: #ffffff;
  174. box-shadow: $box-shadow;
  175. padding: 30rpx 0;
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. .item {
  180. flex: 1;
  181. display: flex;
  182. flex-direction: column;
  183. justify-content: center;
  184. align-items: center;
  185. position: relative;
  186. &:nth-child(1):after {
  187. content: '';
  188. position: absolute;
  189. width: 1rpx;
  190. background-color: #ddd;
  191. right: 0;
  192. height: 100%;
  193. transform: scaleX(0.5) scaleY(0.8);
  194. }
  195. .icon {
  196. width: 84rpx;
  197. height: 84rpx;
  198. margin: 20rpx;
  199. }
  200. .title {
  201. font-size: 30rpx;
  202. color: $text-color-base;
  203. font-weight: 600;
  204. }
  205. }
  206. }
  207. .info {
  208. position: relative;
  209. margin-bottom: 30rpx;
  210. border-radius: 10rpx;
  211. background-color: #ffffff;
  212. box-shadow: $box-shadow;
  213. padding: 30rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. .integral_section {
  218. flex: 1;
  219. display: flex;
  220. flex-direction: column;
  221. justify-content: center;
  222. .top {
  223. display: flex;
  224. align-items: center;
  225. .title {
  226. color: $text-color-base;
  227. font-size: $font-size-base;
  228. margin-right: 10rpx;
  229. }
  230. .value {
  231. font-size: 44rpx;
  232. font-weight: bold;
  233. }
  234. }
  235. .bottom {
  236. font-size: $font-size-sm;
  237. color: $text-color-assist;
  238. display: flex;
  239. align-items: center;
  240. }
  241. }
  242. .qrcode_section {
  243. color: $color-primary;
  244. display: flex;
  245. flex-direction: column;
  246. align-items: center;
  247. justify-content: center;
  248. font-size: $font-size-sm;
  249. image {
  250. width: 40rpx;
  251. height: 40rpx;
  252. margin-bottom: 10rpx;
  253. }
  254. }
  255. }
  256. .navigators {
  257. width: 100%;
  258. margin-bottom: 20rpx;
  259. border-radius: 10rpx;
  260. background-color: #ffffff;
  261. box-shadow: $box-shadow;
  262. padding: 20rpx;
  263. display: flex;
  264. align-items: stretch;
  265. .left {
  266. width: 340rpx;
  267. margin-right: 20rpx;
  268. display: flex;
  269. padding: 0 20rpx;
  270. flex-direction: column;
  271. font-size: $font-size-sm;
  272. color: $text-color-base;
  273. background-color: #F2F2E6;
  274. .grid {
  275. height: 50%;
  276. display: flex;
  277. }
  278. }
  279. .right {
  280. width: 290rpx;
  281. display: flex;
  282. flex-direction: column;
  283. .tea-activity, .member-gifts {
  284. width: 100%;
  285. display: flex;
  286. padding: 20rpx;
  287. font-size: $font-size-sm;
  288. color: $text-color-base;
  289. align-items: center;
  290. position: relative;
  291. }
  292. .tea-activity {
  293. background-color: #FDF3F2;
  294. margin-bottom: 20rpx;
  295. }
  296. .member-gifts {
  297. background-color: #FCF6D4;
  298. }
  299. .right-img {
  300. flex: 1;
  301. position: relative;
  302. margin-left: 20rpx;
  303. margin-right: -20rpx;
  304. margin-bottom: -20rpx;
  305. display: flex;
  306. align-items: flex-end;
  307. image {
  308. width: 100%;
  309. }
  310. }
  311. }
  312. .mark-img {
  313. width: 30rpx;
  314. height: 30rpx;
  315. margin-right: 10rpx;
  316. }
  317. .yzclh-img {
  318. height: 122.96rpx;
  319. width: 214.86rpx;
  320. }
  321. }
  322. .member-news {
  323. width: 100%;
  324. margin-bottom: 30rpx;
  325. .header {
  326. display: flex;
  327. align-items: center;
  328. justify-content: space-between;
  329. padding: 20rpx 0;
  330. .title {
  331. font-size: $font-size-lg;
  332. font-weight: bold;
  333. }
  334. .iconfont {
  335. font-size: 52rpx;
  336. color: $text-color-assist;
  337. }
  338. }
  339. .list {
  340. width: 100%;
  341. display: flex;
  342. flex-direction: column;
  343. .item {
  344. width: 100%;
  345. height: 240rpx;
  346. position: relative;
  347. image {
  348. width: 100%;
  349. height: 100%;
  350. border-radius: 8rpx;
  351. }
  352. .title {
  353. position: relative;
  354. font-size: 32rpx;
  355. font-weight: 500;
  356. width: 100%;
  357. top: -70rpx;
  358. left: 16rpx;
  359. color: #ffffff;
  360. }
  361. }
  362. }
  363. }
  364. </style>