FirstIndex.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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/index/FirstList', {categoryId:13});">
  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/index/FirstList', {categoryId:14});">
  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,type:'activityCard'});">
  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. console.log('hkletcgo')
  88. const tabbar = ref({
  89. "theme": "red",
  90. "style": {
  91. "bgType": "color",
  92. "bgColor": "#323b4e",
  93. "color": "#e6e6e5",
  94. "activeColor": "#1fa380"
  95. },
  96. "items": [{
  97. "text": t('common.home'),
  98. "url": "/pages/index/FirstIndex",
  99. "iconUrl": sheep.$url.static('/static/firstIndex/index.svg'),
  100. "activeIconUrl": sheep.$url.static('/static/firstIndex/index-active.svg')
  101. },
  102. {
  103. "text": t('common.activities'),
  104. "url": "/pages/index/FirstActivity",
  105. "iconUrl": sheep.$url.static('/static/firstIndex/activity.svg'),
  106. "activeIconUrl": sheep.$url.static('/static/firstIndex/activity-active.svg')
  107. },
  108. // {
  109. // "text": t('common.merchant'),
  110. // "url": "/pages/index/FirstMerchant",
  111. // "iconUrl": sheep.$url.static('/static/firstIndex/merchant.svg'),
  112. // "activeIconUrl": sheep.$url.static('/static/firstIndex/merchant-active.svg')
  113. // },
  114. {
  115. "text": t('common.videos'),
  116. "url": "/pages/index/FirstVideo",
  117. "iconUrl": sheep.$url.static('/static/firstIndex/video.svg'),
  118. "activeIconUrl": sheep.$url.static('/static/firstIndex/video-active.svg')
  119. },
  120. {
  121. "text": t('common.mall'),
  122. "url": "/pages/index/index",
  123. "iconUrl": sheep.$url.static('/static/firstIndex/shop.svg'),
  124. "activeIconUrl": sheep.$url.static('/static/firstIndex/shop-active.svg')
  125. }
  126. ]
  127. });
  128. const lunbo = ref({
  129. "type": "default",
  130. "indicator": "dot",
  131. "autoplay": false,
  132. "interval": 3,
  133. "items": [],
  134. "style": {
  135. "bgType": "color",
  136. "bgColor": "#fff",
  137. "marginBottom": 8
  138. }
  139. })
  140. const gonggao = ref({
  141. text: '',
  142. title: ''
  143. })
  144. const state = ref({
  145. ptjj: {
  146. title: '',
  147. },
  148. cyjs: {
  149. title: '',
  150. },
  151. xwdt: {
  152. title: '',
  153. image: ''
  154. }
  155. })
  156. onLoad(async () => {
  157. const {
  158. code,
  159. data
  160. } = await ArticleApi.getHomeList();
  161. console.log(data)
  162. // 更新lunbo.items
  163. lunbo.value.items = data.slideshowArticleList.map(article => ({
  164. type: 'img',
  165. imgUrl: article.picUrl,
  166. url: '/pages/public/richtext',
  167. urlParams: {
  168. title: article.title
  169. },
  170. videoUrl: '',
  171. title: article.title
  172. }));
  173. gonggao.value.text = data.announcement.content;
  174. gonggao.value.title = data.announcement.title;
  175. state.value.ptjj.title = data.ptBriefIntroduction.title;
  176. state.value.cyjs.title = data.industryIntroduction.title;
  177. state.value.xwdt.title = data.dynamicNews.title;
  178. state.value.xwdt.image = data.dynamicNews.picUrl;
  179. });
  180. </script>
  181. <style>
  182. .page-body {
  183. width: 100%;
  184. position: relative;
  185. z-index: 1;
  186. flex: 1;
  187. .header {
  188. width: 90%;
  189. margin: 0 auto;
  190. padding: 20rpx 0;
  191. display: flex;
  192. align-items: center;
  193. justify-content: space-between;
  194. .logo {
  195. display: flex;
  196. align-items: center;
  197. color: #fff;
  198. image {
  199. width: 220rpx;
  200. height: 100rpx;
  201. }
  202. }
  203. }
  204. .lunbo {
  205. margin-bottom: 40rpx;
  206. }
  207. .gonggao,
  208. .nav,
  209. .news {
  210. width: 85%;
  211. margin: 0 auto;
  212. color: #fff;
  213. margin-bottom: 40rpx;
  214. }
  215. .gonggao {
  216. /* height: 120rpx; */
  217. overflow: hidden;
  218. .gonggao-item {
  219. width: 100%;
  220. display: flex;
  221. align-items: center;
  222. margin-bottom: 15rpx;
  223. white-space: nowrap;
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. }
  227. .gonggao-item:last-child {
  228. margin-bottom: 0;
  229. }
  230. .gonggao-item::before {
  231. content: "";
  232. display: block;
  233. width: 10rpx;
  234. height: 10rpx;
  235. background: #fff;
  236. border-radius: 50%;
  237. margin-right: 10rpx;
  238. }
  239. }
  240. .nav {
  241. display: grid;
  242. grid-template-columns: repeat(2, 1fr);
  243. grid-gap: 40rpx 80rpx;
  244. .card {
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. padding: 15px;
  249. border-radius: 10px;
  250. background-color: #333b4e;
  251. flex-direction: column;
  252. image {
  253. width: 80rpx;
  254. height: 80rpx;
  255. margin-bottom: 10rpx;
  256. }
  257. }
  258. }
  259. .news {
  260. height: 300rpx;
  261. position: relative;
  262. border: 1px solid rgba(0, 0, 0, 0.5);
  263. .news-bottom {
  264. position: absolute;
  265. bottom: 0;
  266. left: 0;
  267. width: 100%;
  268. height: 50rpx;
  269. background: rgba(0, 0, 0, 0.5);
  270. padding: 10rpx;
  271. box-sizing: border-box;
  272. display: flex;
  273. align-items: center;
  274. justify-content: space-between;
  275. text {
  276. white-space: nowrap;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. }
  280. ;
  281. image {
  282. width: 20rpx;
  283. height: 20rpx;
  284. }
  285. }
  286. }
  287. }
  288. </style>