old_index.vue 8.7 KB

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