index.vue 8.5 KB

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