FirstIndex.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <!-- 商城新首页,即宣传页 -->
  2. <template>
  3. <view class="page-body" style="background: #111521;">
  4. <view class="header">
  5. <view class="logo">
  6. <image class="" src="@/static/firstIndex/clcg.png" mode="aspectFit"></image>
  7. </view>
  8. <view class="language">
  9. </view>
  10. </view>
  11. <!-- 轮播 -->
  12. <s-image-banner :data="lunbo" :styles="styles" class="lunbo" height="300" />
  13. <!-- @click="sheep.$router.go('/pages/public/richtext', {title:gonggao.title});" -->
  14. <view class="gonggao">
  15. <view class="gonggao-item">
  16. 使命:共建平台,共创价值,共享利益。
  17. </view>
  18. <view class="gonggao-item">
  19. 愿景:引领共享电商,三方共赢,推动创新。
  20. </view>
  21. <view class="gonggao-item">
  22. 价值观:产品为王、诚信透明、共创共享共赢。
  23. </view>
  24. </view>
  25. <view class="nav">
  26. <view class="card" @click="sheep.$router.go('/pages/public/richtext', {title:state.ptjj.title});">
  27. <image src="@/static/firstIndex/pt.svg" mode="aspectFit" />
  28. {{ t('common.platform_intro') }}
  29. </view>
  30. <view class="card" @click="sheep.$router.go('/pages/public/richtext', {title:state.cyjs.title});">
  31. <image src="@/static/firstIndex/product.svg" mode="aspectFit" />
  32. {{ t('common.industry_intro') }}
  33. </view>
  34. <view class="card" @click="sheep.$router.go('/pages/index/FirstList', {categoryId:11});">
  35. <image src="@/static/firstIndex/news.svg" mode="aspectFit" />
  36. {{ t('common.latest_news') }}
  37. </view>
  38. <view class="card" @click="sheep.$router.go('/pages/index/index')">
  39. <image src="@/static/firstIndex/shop.svg" mode="aspectFit" />
  40. {{ t('common.shared_mall') }}
  41. </view>
  42. </view>
  43. <view class="news" :style="{ backgroundImage: `url(${state.xwdt.image})` }" style="background-size: cover;"
  44. @click="sheep.$router.go('/pages/public/richtext', {title:state.xwdt.title});">
  45. <view class="news-bottom">
  46. <text>{{state.xwdt.title}}</text>
  47. <view @click="sheep.$router.go('/pages/index/FirstList', {categoryId:6});">
  48. <image src="@/static/firstIndex/youjiantou.png" mode="aspectFit" />
  49. </view>
  50. </view>
  51. </view>
  52. <s-tabbar path="/pages/index/FirstIndex" :tabbar="tabbar" />
  53. </view>
  54. </template>
  55. <script setup>
  56. import {
  57. computed,
  58. ref
  59. } from 'vue';
  60. import {
  61. onLoad,
  62. onPageScroll,
  63. onPullDownRefresh
  64. } from '@dcloudio/uni-app';
  65. import sheep from '@/sheep';
  66. import $share from '@/sheep/platform/share';
  67. import {
  68. isAndroid,
  69. getAndroidJiGuangId
  70. } from '@/sheep/hooks/useApp'
  71. import {
  72. showWalletModal,
  73. colseWalletModal
  74. } from '@/sheep/hooks/useModal';
  75. import ArticleApi from '@/sheep/api/promotion/article';
  76. import Richtext from '@/pages/public/richtext.vue'
  77. import {
  78. t
  79. } from '@/locale'
  80. // 隐藏原生tabBar
  81. uni.hideTabBar();
  82. const appInfo = computed(() => sheep.$store('app').info);
  83. const {
  84. safeArea
  85. } = sheep.$platform.device;
  86. const pageHeight = computed(() => safeArea.height - 45);
  87. const tabbar = ref({
  88. "theme": "red",
  89. "style": {
  90. "bgType": "color",
  91. "bgColor": "#323b4e",
  92. "color": "#e6e6e5",
  93. "activeColor": "#1fa380"
  94. },
  95. "items": [{
  96. "text": t('common.home'),
  97. "url": "/pages/index/FirstIndex",
  98. "iconUrl": sheep.$url.static('/static/firstIndex/index.svg'),
  99. "activeIconUrl": sheep.$url.static('/static/firstIndex/index-active.svg')
  100. },
  101. {
  102. "text": t('common.activities'),
  103. "url": "/pages/index/FirstActivity",
  104. "iconUrl": sheep.$url.static('/static/firstIndex/activity.svg'),
  105. "activeIconUrl": sheep.$url.static('/static/firstIndex/activity-active.svg')
  106. },
  107. {
  108. "text": t('common.videos'),
  109. "url": "/pages/index/FirstVideo",
  110. "iconUrl": sheep.$url.static('/static/firstIndex/video.svg'),
  111. "activeIconUrl": sheep.$url.static('/static/firstIndex/video-active.svg')
  112. },
  113. {
  114. "text": t('common.mall'),
  115. "url": "/pages/index/index",
  116. "iconUrl": sheep.$url.static('/static/firstIndex/shop.svg'),
  117. "activeIconUrl": sheep.$url.static('/static/firstIndex/shop-active.svg')
  118. }
  119. ]
  120. });
  121. const lunbo = ref({
  122. "type": "default",
  123. "indicator": "dot",
  124. "autoplay": false,
  125. "interval": 3,
  126. "items": [],
  127. "style": {
  128. "bgType": "color",
  129. "bgColor": "#fff",
  130. "marginBottom": 8
  131. }
  132. })
  133. const gonggao = ref({
  134. text: '',
  135. title: ''
  136. })
  137. const state = ref({
  138. ptjj: {
  139. title: '',
  140. },
  141. cyjs: {
  142. title: '',
  143. },
  144. xwdt: {
  145. title: '',
  146. image: ''
  147. }
  148. })
  149. onLoad(async () => {
  150. const {
  151. code,
  152. data
  153. } = await ArticleApi.getHomeList();
  154. console.log(data)
  155. // 更新lunbo.items
  156. lunbo.value.items = data.slideshowArticleList.map(article => ({
  157. type: 'img',
  158. imgUrl: article.picUrl,
  159. url: '/pages/public/richtext',
  160. urlParams: {
  161. title: article.title
  162. },
  163. videoUrl: '',
  164. title: article.title
  165. }));
  166. gonggao.value.text = data.announcement.content;
  167. gonggao.value.title = data.announcement.title;
  168. state.value.ptjj.title = data.ptBriefIntroduction.title;
  169. state.value.cyjs.title = data.industryIntroduction.title;
  170. state.value.xwdt.title = data.dynamicNews.title;
  171. state.value.xwdt.image = data.dynamicNews.picUrl;
  172. });
  173. </script>
  174. <style>
  175. .page-body {
  176. width: 100%;
  177. position: relative;
  178. z-index: 1;
  179. flex: 1;
  180. .header {
  181. width: 90%;
  182. margin: 0 auto;
  183. padding: 20rpx 0;
  184. display: flex;
  185. align-items: center;
  186. justify-content: space-between;
  187. .logo {
  188. display: flex;
  189. align-items: center;
  190. color: #fff;
  191. image {
  192. width: 220rpx;
  193. height: 100rpx;
  194. }
  195. }
  196. }
  197. .lunbo {
  198. margin-bottom: 40rpx;
  199. }
  200. .gonggao,
  201. .nav,
  202. .news {
  203. width: 85%;
  204. margin: 0 auto;
  205. color: #fff;
  206. margin-bottom: 40rpx;
  207. }
  208. .gonggao {
  209. /* height: 120rpx; */
  210. overflow: hidden;
  211. .gonggao-item {
  212. width: 100%;
  213. display: flex;
  214. align-items: center;
  215. margin-bottom: 15rpx;
  216. white-space: nowrap;
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. }
  220. .gonggao-item:last-child {
  221. margin-bottom: 0;
  222. }
  223. .gonggao-item::before {
  224. content: "";
  225. display: block;
  226. width: 10rpx;
  227. height: 10rpx;
  228. background: #fff;
  229. border-radius: 50%;
  230. margin-right: 10rpx;
  231. }
  232. }
  233. .nav {
  234. display: grid;
  235. grid-template-columns: repeat(2, 1fr);
  236. grid-gap: 40rpx 80rpx;
  237. .card {
  238. display: flex;
  239. align-items: center;
  240. justify-content: center;
  241. padding: 15px;
  242. border-radius: 10px;
  243. background-color: #333b4e;
  244. flex-direction: column;
  245. image {
  246. width: 80rpx;
  247. height: 80rpx;
  248. margin-bottom: 10rpx;
  249. }
  250. }
  251. }
  252. .news {
  253. height: 300rpx;
  254. position: relative;
  255. border: 1px solid rgba(0, 0, 0, 0.5);
  256. .news-bottom {
  257. position: absolute;
  258. bottom: 0;
  259. left: 0;
  260. width: 100%;
  261. height: 50rpx;
  262. background: rgba(0, 0, 0, 0.5);
  263. padding: 10rpx;
  264. box-sizing: border-box;
  265. display: flex;
  266. align-items: center;
  267. justify-content: space-between;
  268. text {
  269. white-space: nowrap;
  270. overflow: hidden;
  271. text-overflow: ellipsis;
  272. }
  273. ;
  274. image {
  275. width: 20rpx;
  276. height: 20rpx;
  277. }
  278. }
  279. }
  280. }
  281. </style>