index.vue 8.4 KB

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