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