FirstIndex.vue 7.1 KB

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