diff --git a/package.json b/package.json index d543de2..a9f8a60 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@dcloudio/uni-quickapp-webview": "3.0.0-3090420231025001", "@dcloudio/uni-ui": "^1.5.6", "cross-env": "^7.0.3", + "dayjs": "^1.11.13", "esbuild": "0.17.19", "lodash": "^4.17.21", "pinia": "2.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index abeec1e..250fe9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ importers: cross-env: specifier: ^7.0.3 version: 7.0.3 + dayjs: + specifier: ^1.11.13 + version: 1.11.13 esbuild: specifier: 0.17.19 version: 0.17.19 @@ -1816,6 +1819,9 @@ packages: resolution: {integrity: sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==} engines: {node: '>=10'} + dayjs@1.11.13: + resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} + debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -5811,6 +5817,8 @@ snapshots: whatwg-mimetype: 2.3.0 whatwg-url: 8.7.0 + dayjs@1.11.13: {} + debug@2.6.9: dependencies: ms: 2.0.0 diff --git a/src/api/index.js b/src/api/index.js index e9d4d18..5f954f7 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -12,4 +12,25 @@ export const menuCategoryApi = () => { **/ export const homeBannberApi = () => { return request.get('/web/pic') +} + +/** + * @function 获取热门产品 +**/ +export const hotProductApi = () => { + return request.get('/web/hotProduct') +} + +/** + * @function 获取普通产品前10 +**/ +export const ordinaryProductApi = () => { + return request.get('/web/product') +} + +/** + * @function 热门新闻 +**/ +export const hotNewsApi = () => { + return request.get('/web/hotNews') } \ No newline at end of file diff --git a/src/assets/css/common.scss b/src/assets/css/common.scss index 48189de..37bac82 100644 --- a/src/assets/css/common.scss +++ b/src/assets/css/common.scss @@ -8,9 +8,25 @@ button { } .pages { min-height: 100vh; + background: linear-gradient(to top, #e4ecff 40%,#fff 60%); font-size: 26rpx; } .tabbar-pages { + /* #ifdef H5 */ min-height: calc(100vh - 50px); + /* #endif */ + /* #ifdef APP */ + min-height: 100vh; + /* #endif */ + background: linear-gradient(to top, #e4ecff 40%,#fff 60%); font-size: 26rpx; } +.text-ellipsis { + text-overflow: -o-ellipsis-lastline; + overflow: hidden; //溢出内容隐藏 + text-overflow: ellipsis; //文本溢出部分用省略号表示 + display: -webkit-box; //特别显示模式 + -webkit-line-clamp: 2; //行数 + line-clamp: 2; + -webkit-box-orient: vertical; //盒子中内容竖直排列 +} \ No newline at end of file diff --git a/src/assets/images/bg/company-profile-panel.png b/src/assets/images/bg/company-profile-panel.png new file mode 100644 index 0000000..fa561f2 Binary files /dev/null and b/src/assets/images/bg/company-profile-panel.png differ diff --git a/src/assets/images/bg/contact-panel.png b/src/assets/images/bg/contact-panel.png new file mode 100644 index 0000000..56c55a6 Binary files /dev/null and b/src/assets/images/bg/contact-panel.png differ diff --git a/src/assets/images/bg/news-panel.png b/src/assets/images/bg/news-panel.png new file mode 100644 index 0000000..5c8d5b2 Binary files /dev/null and b/src/assets/images/bg/news-panel.png differ diff --git a/src/assets/images/bg/products-panel.png b/src/assets/images/bg/products-panel.png new file mode 100644 index 0000000..bb54e8e Binary files /dev/null and b/src/assets/images/bg/products-panel.png differ diff --git a/src/assets/images/icon/arrow.png b/src/assets/images/icon/arrow.png new file mode 100644 index 0000000..6855544 Binary files /dev/null and b/src/assets/images/icon/arrow.png differ diff --git a/src/assets/images/icon/goto.png b/src/assets/images/icon/goto.png new file mode 100644 index 0000000..957f86c Binary files /dev/null and b/src/assets/images/icon/goto.png differ diff --git a/src/assets/images/icon/search.png b/src/assets/images/icon/search.png new file mode 100644 index 0000000..e6149fe Binary files /dev/null and b/src/assets/images/icon/search.png differ diff --git a/src/assets/images/icon/view-more.png b/src/assets/images/icon/view-more.png new file mode 100644 index 0000000..b52bd0f Binary files /dev/null and b/src/assets/images/icon/view-more.png differ diff --git a/src/locale/en.json b/src/locale/en.json index 10dcae4..f414ebe 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -11,6 +11,7 @@ "loadingWeight": "Loading weight (kg)", "approachingAngle/Departure": "Approaching angle/Departure angle (º)", "products": "PRODUCTS", + "productslowercase": "products", "companyProducts": "COMPANY PRODUCTS", "brand": "Brand", "driveWheel": "Drive Wheel", @@ -38,7 +39,12 @@ "Contact": "Contact", "Online": "Online", "Whats": "Whats", - "TOP": "TOP" + "TOP": "TOP", + "All": "All", + "Go": "Go", + "Center": "Center", + "Quick": "Quick", + "viewmore": "view more" }, "menu": { "Home": "Home", @@ -51,7 +57,7 @@ }, "news": { "news": "News", - "newsCenter": "NEWS CENTER", + "newsCenter": "press center", "allNews": "ALL NEWS", "relatedNews": "Related News", "relatedProducts": "Related Products" @@ -70,7 +76,7 @@ "inquiry": "Inquiry" }, "index": { - "companyProfile": "COMPANY PROFILE", + "companyProfile": "Company Profile", "corporateName": "SINOTRUCK HOWO SALES CO.,LTD.", "companyProfileContent": "SINOTRUCK HOWO SALES CO.,LTD.is located in Jinan city, Shandong Province, P.R. China. It is the cradle and leading production base of the heavy-duty truck industry in China. It is famous for developing and manufacturing SINOTRUK HOWO tractor trucks, dump trucks, fuel tanker trucks and concrete mixer truck, water spraying trucks etc.", "highQuality": "HIGH QUALITY", @@ -82,7 +88,9 @@ "pressCenter": "PRESS CENTER", "realTimeNewsReadingOnline": "Real-time news reading online", "joinOurNewsletter": "JOIN OUR NEWSLETTER", - "signUpOurNewsletter": "Sign up our newsletter and get more events & promotions!" + "signUpOurNewsletter": "Sign up our newsletter and get more events & promotions!", + "contact": "contact", + "PopularProduct": "Popular Product" }, "aboutUs": { "AboutUs": "About Us", diff --git a/src/locale/zh.json b/src/locale/zh.json index 62f0a87..0b5762d 100644 --- a/src/locale/zh.json +++ b/src/locale/zh.json @@ -11,6 +11,7 @@ "loadingWeight": "装载重量(kg)", "approachingAngle/Departure": "接近角/离开角(º)", "products": "产品", + "productslowercase": "产品", "companyProducts": "公司产品", "brand": "品牌", "driveWheel": "驱动轮", @@ -38,7 +39,12 @@ "Contact": "联系我们", "Online": "在线", "Whats": "Whatsapp", - "TOP": "顶部" + "TOP": "顶部", + "All": "全部", + "Go": "前往", + "Center": "中心", + "Quick": "快速", + "viewmore": "查看更多" }, "menu": { "Home": "首页", @@ -62,7 +68,9 @@ "pressCenter": "新闻中心", "realTimeNewsReadingOnline": "实时新闻在线阅读", "joinOurNewsletter": "加入我们的实时通讯", - "signUpOurNewsletter": "注册我们的实时通讯,获取更多活动和促销!" + "signUpOurNewsletter": "注册我们的实时通讯,获取更多活动和促销!", + "contact": "联系", + "PopularProduct": "流行产品" }, "news": { "news": "新闻", diff --git a/src/pages.json b/src/pages.json index 451eaf0..6ca1f2c 100644 --- a/src/pages.json +++ b/src/pages.json @@ -10,7 +10,8 @@ { "path": "pages/index/index", "style": { - "navigationBarTitleText": "China Trailer, Truck, Trailer Parts, Truck Parts Manufacturers and Factory - Price - SINOTRUCK" + "navigationBarTitleText": "China Trailer, Truck, Trailer Parts, Truck Parts Manufacturers and Factory - Price - SINOTRUCK", + "enablePullDownRefresh": true } }, { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 69756a3..666d3eb 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -11,28 +11,201 @@ + + + + + + + + + + + + {{$t('common.All')}} + {{$t('common.productslowercase')}} + + + {{$t('common.Go')}} + + + + + + {{$t('index.companyProfile')}} + + + + + {{$t('news.news')}} + {{$t('common.Center')}} + + + {{$t('common.Quick')}} + {{$t('index.contact')}} + + + + + + + + {{$t('index.PopularProduct')}} + + {{$t('common.viewmore')}} + + + + + + + + {{item.title}} + + + + + + + + {{$t('menu.Products')}} + + {{$t('common.viewmore')}} + + + + + + + + {{item.title}} + + + + + + + + {{$t('news.newsCenter')}} + + {{$t('common.viewmore')}} + + + + + + + + + {{item.title}} + + + {{item.description}} + + + + + + +