feat: 首页功能优化,修改分包位置

This commit is contained in:
mayubo@gmail.com 2025-05-12 09:56:42 +08:00
parent 1e4a8b8ed9
commit 8eb0a3a4dc
20 changed files with 151 additions and 92 deletions

View File

View File

@ -0,0 +1,27 @@
<template>
<view class="">
123
</view>
</template>
<script>
import { request } from '../../../utils';
export default {
data() {
return {
}
},
methods: {
},
onLoad() {
}
}
</script>
<style>
@import url("./index.css");
</style>

View File

@ -36,41 +36,6 @@
"nav-footer": "/components/nav/nav"
}
}
},
{
"path" : "packages/health/index/index",
"style" :
{
"navigationBarTitleText" : "智慧康养"
}
},
{
"path" : "packages/health/express/express",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "packages/health/selfTest/selfTest",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "packages/health/reportList/reportList",
"style" :
{
"navigationBarTitleText" : "体检报告"
}
},
{
"path" : "packages/health/reportDesc/reportDesc",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
@ -98,18 +63,17 @@
]
},
{
"root": "packages/publicServer",
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "便民服务",
"usingComponents": {
"nav-footer": "/components/nav/nav"
}
}
"root": "packages/publicServer",
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "便民服务",
"usingComponents": {
"nav-footer": "/components/nav/nav"
}
]
},
}
}]
},
{
"root": "reservation",
@ -217,8 +181,7 @@
},
{
"path": "ownerList/index",
"style": {
}
"style": {}
}
]
},
@ -319,8 +282,7 @@
},
{
"root": "packages/communityService",
"pages": [
{
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "社区服务",
@ -350,6 +312,50 @@
}
}
]
},
{
"root": "packages/health",
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "智慧康养"
}
},
{
"path": "express/express",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "selfTest/selfTest",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "reportList/reportList",
"style": {
"navigationBarTitleText": "体检报告"
}
},
{
"path": "reportDesc/reportDesc",
"style": {
"navigationBarTitleText": ""
}
}
]
},
{
"root": "packages/aroundShop",
"pages": [{
"path": "index/index",
"style": {
"navigationBarTitleText": "周边商家"
}
}
]
}
],

View File

@ -353,6 +353,7 @@
that.city = userlocat;
uni.setStorageSync('userlocat', userlocat);
uni.setStorageSync('Usercity', city);
uni.setStorageSync('city', city);
},
fail(err) {
console.log(err);
@ -365,7 +366,7 @@
getBannerList() {
let that = this
request(apiArr.getBanner, "POST", {
city_id:this.currentProviceCity?.provinceId,
// city_id:this.currentProviceCity?.provinceId, //TODO id PDid
area_id:this.currentProviceCity?.cityId,
}).then(res => {
@ -548,7 +549,7 @@
}
this.currentProviceCity = this.getProvinceCityId(cascaderOptions,uni.getStorageSync('city'))
console.log('currentProviceCitycurrentProviceCity', this.getProvinceCityId(cascaderOptions,uni.getStorageSync('city')));
await this.getButtonList()
@ -651,11 +652,17 @@
this.top = meun.height + meun.top;
},
onShow() {
console.log(this.currentCity, ' this.currentCity')
if (uni.getStorageSync('city')) {
let obj = {
city: uni.getStorageSync('city')
}
this.currentCity = obj
if (this.currentCity && this.currentCity.city !== uni.getStorageSync('city')) {
console.log('缓存中的城市,与 新选择的城市 不一致, 缓存中的城市', this.currentCity);
console.log('新选择的的城市', uni.getStorageSync('city'));
this.init();
}
this.currentCity = obj;
} else {
uni.setStorageSync('city', uni.getStorageSync('Usercity'))
}

View File

@ -186,6 +186,7 @@
});
},
goShopList(event) {
console.log('点全部', event);
let area_id = event.currentTarget.dataset.id;
let name = event.currentTarget.dataset.name;
if (name == '定位中') {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,7 @@
"pages/login/login",
"pages/shopcity/shopcity",
"pages/webview/webview",
"pages/user/index",
"packages/health/index/index",
"packages/health/express/express",
"packages/health/selfTest/selfTest",
"packages/health/reportList/reportList",
"packages/health/reportDesc/reportDesc"
"pages/user/index"
],
"subPackages": [
{
@ -82,6 +77,22 @@
"reservation/index",
"reservationApply/index"
]
},
{
"root": "packages/health",
"pages": [
"index/index",
"express/express",
"selfTest/selfTest",
"reportList/reportList",
"reportDesc/reportDesc"
]
},
{
"root": "packages/aroundShop",
"pages": [
"index/index"
]
}
],
"window": {

View File

@ -105,11 +105,11 @@
/******/
/******/
/******/ // mini-css-extract-plugin CSS loading
/******/ var cssChunks = {"components/nav/nav":1,"components/tabularCard/tabularCard":1,"uni_modules/uview-ui/components/u-grid-item/u-grid-item":1,"uni_modules/uview-ui/components/u-grid/u-grid":1,"uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker":1,"uni_modules/uview-ui/components/u-picker/u-picker":1,"uni_modules/uview-ui/components/u-popup/u-popup":1,"uni_modules/uview-ui/components/u-navbar/u-navbar":1,"uni_modules/uview-ui/components/u-icon/u-icon":1,"uni_modules/uview-ui/components/u-empty/u-empty":1,"components/dropdown/dropdown":1,"uni_modules/uview-ui/components/u-number-box/u-number-box":1,"components/search/search":1,"uni_modules/uview-ui/components/u-notice-bar/u-notice-bar":1,"uni_modules/uview-ui/components/u-textarea/u-textarea":1,"uni_modules/uview-ui/components/u-upload/u-upload":1,"components/areaPopup/areaPopup":1,"uni_modules/uview-ui/components/u-loading-icon/u-loading-icon":1,"uni_modules/uview-ui/components/u-toolbar/u-toolbar":1,"uni_modules/uview-ui/components/u-overlay/u-overlay":1,"uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom":1,"uni_modules/uview-ui/components/u-status-bar/u-status-bar":1,"uni_modules/uview-ui/components/u-transition/u-transition":1,"uni_modules/uview-ui/components/u-column-notice/u-column-notice":1,"uni_modules/uview-ui/components/u-row-notice/u-row-notice":1};
/******/ var cssChunks = {"components/nav/nav":1,"components/tabularCard/tabularCard":1,"uni_modules/uview-ui/components/u-grid-item/u-grid-item":1,"uni_modules/uview-ui/components/u-grid/u-grid":1,"uni_modules/uview-ui/components/u-popup/u-popup":1,"uni_modules/uview-ui/components/u-navbar/u-navbar":1,"uni_modules/uview-ui/components/u-icon/u-icon":1,"uni_modules/uview-ui/components/u-empty/u-empty":1,"components/dropdown/dropdown":1,"uni_modules/uview-ui/components/u-number-box/u-number-box":1,"components/search/search":1,"uni_modules/uview-ui/components/u-notice-bar/u-notice-bar":1,"uni_modules/uview-ui/components/u-picker/u-picker":1,"uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker":1,"uni_modules/uview-ui/components/u-textarea/u-textarea":1,"uni_modules/uview-ui/components/u-upload/u-upload":1,"components/areaPopup/areaPopup":1,"uni_modules/uview-ui/components/u-overlay/u-overlay":1,"uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom":1,"uni_modules/uview-ui/components/u-status-bar/u-status-bar":1,"uni_modules/uview-ui/components/u-transition/u-transition":1,"uni_modules/uview-ui/components/u-column-notice/u-column-notice":1,"uni_modules/uview-ui/components/u-row-notice/u-row-notice":1,"uni_modules/uview-ui/components/u-loading-icon/u-loading-icon":1,"uni_modules/uview-ui/components/u-toolbar/u-toolbar":1};
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
/******/ var href = "" + ({"components/nav/nav":"components/nav/nav","components/tabularCard/tabularCard":"components/tabularCard/tabularCard","uni_modules/uview-ui/components/u-grid-item/u-grid-item":"uni_modules/uview-ui/components/u-grid-item/u-grid-item","uni_modules/uview-ui/components/u-grid/u-grid":"uni_modules/uview-ui/components/u-grid/u-grid","uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker":"uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker","uni_modules/uview-ui/components/u-picker/u-picker":"uni_modules/uview-ui/components/u-picker/u-picker","uni_modules/uview-ui/components/u-popup/u-popup":"uni_modules/uview-ui/components/u-popup/u-popup","uni_modules/uview-ui/components/u-navbar/u-navbar":"uni_modules/uview-ui/components/u-navbar/u-navbar","uni_modules/uview-ui/components/u-icon/u-icon":"uni_modules/uview-ui/components/u-icon/u-icon","uni_modules/uview-ui/components/u-empty/u-empty":"uni_modules/uview-ui/components/u-empty/u-empty","components/dropdown/dropdown":"components/dropdown/dropdown","uni_modules/uview-ui/components/u-number-box/u-number-box":"uni_modules/uview-ui/components/u-number-box/u-number-box","components/search/search":"components/search/search","uni_modules/uview-ui/components/u-notice-bar/u-notice-bar":"uni_modules/uview-ui/components/u-notice-bar/u-notice-bar","uni_modules/uview-ui/components/u--textarea/u--textarea":"uni_modules/uview-ui/components/u--textarea/u--textarea","uni_modules/uview-ui/components/u-textarea/u-textarea":"uni_modules/uview-ui/components/u-textarea/u-textarea","uni_modules/uview-ui/components/u-upload/u-upload":"uni_modules/uview-ui/components/u-upload/u-upload","components/areaPopup/areaPopup":"components/areaPopup/areaPopup","uni_modules/uview-ui/components/u-loading-icon/u-loading-icon":"uni_modules/uview-ui/components/u-loading-icon/u-loading-icon","uni_modules/uview-ui/components/u-toolbar/u-toolbar":"uni_modules/uview-ui/components/u-toolbar/u-toolbar","uni_modules/uview-ui/components/u-overlay/u-overlay":"uni_modules/uview-ui/components/u-overlay/u-overlay","uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom":"uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom","uni_modules/uview-ui/components/u-status-bar/u-status-bar":"uni_modules/uview-ui/components/u-status-bar/u-status-bar","uni_modules/uview-ui/components/u-transition/u-transition":"uni_modules/uview-ui/components/u-transition/u-transition","uni_modules/uview-ui/components/u-column-notice/u-column-notice":"uni_modules/uview-ui/components/u-column-notice/u-column-notice","uni_modules/uview-ui/components/u-row-notice/u-row-notice":"uni_modules/uview-ui/components/u-row-notice/u-row-notice"}[chunkId]||chunkId) + ".wxss";
/******/ var href = "" + ({"components/nav/nav":"components/nav/nav","components/tabularCard/tabularCard":"components/tabularCard/tabularCard","uni_modules/uview-ui/components/u-grid-item/u-grid-item":"uni_modules/uview-ui/components/u-grid-item/u-grid-item","uni_modules/uview-ui/components/u-grid/u-grid":"uni_modules/uview-ui/components/u-grid/u-grid","uni_modules/uview-ui/components/u-popup/u-popup":"uni_modules/uview-ui/components/u-popup/u-popup","uni_modules/uview-ui/components/u-navbar/u-navbar":"uni_modules/uview-ui/components/u-navbar/u-navbar","uni_modules/uview-ui/components/u-icon/u-icon":"uni_modules/uview-ui/components/u-icon/u-icon","uni_modules/uview-ui/components/u-empty/u-empty":"uni_modules/uview-ui/components/u-empty/u-empty","components/dropdown/dropdown":"components/dropdown/dropdown","uni_modules/uview-ui/components/u-number-box/u-number-box":"uni_modules/uview-ui/components/u-number-box/u-number-box","components/search/search":"components/search/search","uni_modules/uview-ui/components/u-notice-bar/u-notice-bar":"uni_modules/uview-ui/components/u-notice-bar/u-notice-bar","uni_modules/uview-ui/components/u-picker/u-picker":"uni_modules/uview-ui/components/u-picker/u-picker","uni_modules/uview-ui/components/u--textarea/u--textarea":"uni_modules/uview-ui/components/u--textarea/u--textarea","uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker":"uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker","uni_modules/uview-ui/components/u-textarea/u-textarea":"uni_modules/uview-ui/components/u-textarea/u-textarea","uni_modules/uview-ui/components/u-upload/u-upload":"uni_modules/uview-ui/components/u-upload/u-upload","components/areaPopup/areaPopup":"components/areaPopup/areaPopup","uni_modules/uview-ui/components/u-overlay/u-overlay":"uni_modules/uview-ui/components/u-overlay/u-overlay","uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom":"uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom","uni_modules/uview-ui/components/u-status-bar/u-status-bar":"uni_modules/uview-ui/components/u-status-bar/u-status-bar","uni_modules/uview-ui/components/u-transition/u-transition":"uni_modules/uview-ui/components/u-transition/u-transition","uni_modules/uview-ui/components/u-column-notice/u-column-notice":"uni_modules/uview-ui/components/u-column-notice/u-column-notice","uni_modules/uview-ui/components/u-row-notice/u-row-notice":"uni_modules/uview-ui/components/u-row-notice/u-row-notice","uni_modules/uview-ui/components/u-loading-icon/u-loading-icon":"uni_modules/uview-ui/components/u-loading-icon/u-loading-icon","uni_modules/uview-ui/components/u-toolbar/u-toolbar":"uni_modules/uview-ui/components/u-toolbar/u-toolbar"}[chunkId]||chunkId) + ".wxss";
/******/ var fullhref = __webpack_require__.p + href;
/******/ var existingLinkTags = document.getElementsByTagName("link");
/******/ for(var i = 0; i < existingLinkTags.length; i++) {

View File

@ -406,6 +406,7 @@ var _default = {
that.city = userlocat;
uni.setStorageSync('userlocat', userlocat);
uni.setStorageSync('Usercity', city);
uni.setStorageSync('city', city);
},
fail: function fail(err) {
console.log(err);
@ -416,12 +417,11 @@ var _default = {
},
getBannerList: function getBannerList() {
var _this$currentProviceC,
_this$currentProviceC2,
_this2 = this;
var that = this;
(0, _index2.request)(_community.apiArr.getBanner, "POST", {
city_id: (_this$currentProviceC = this.currentProviceCity) === null || _this$currentProviceC === void 0 ? void 0 : _this$currentProviceC.provinceId,
area_id: (_this$currentProviceC2 = this.currentProviceCity) === null || _this$currentProviceC2 === void 0 ? void 0 : _this$currentProviceC2.cityId
// city_id:this.currentProviceCity?.provinceId, //TODO 如果传入省id配置的河北保定轮播图就会在 定位到河北别的省份展示出保定的轮播图等PD确定展示逻辑在决定是否传递省id
area_id: (_this$currentProviceC = this.currentProviceCity) === null || _this$currentProviceC === void 0 ? void 0 : _this$currentProviceC.cityId
}).then(function (res) {
if (res.rows.length) {
res.rows.forEach(function (item) {
@ -455,13 +455,13 @@ var _default = {
}
},
getButtonList: function getButtonList() {
var _this$currentProviceC3,
_this$currentProviceC4,
var _this$currentProviceC2,
_this$currentProviceC3,
_this3 = this;
var that = this;
(0, _index2.request)(_community.apiArr.getButton, "POST", {
city_id: (_this$currentProviceC3 = this.currentProviceCity) === null || _this$currentProviceC3 === void 0 ? void 0 : _this$currentProviceC3.provinceId,
area_id: (_this$currentProviceC4 = this.currentProviceCity) === null || _this$currentProviceC4 === void 0 ? void 0 : _this$currentProviceC4.cityId
city_id: (_this$currentProviceC2 = this.currentProviceCity) === null || _this$currentProviceC2 === void 0 ? void 0 : _this$currentProviceC2.provinceId,
area_id: (_this$currentProviceC3 = this.currentProviceCity) === null || _this$currentProviceC3 === void 0 ? void 0 : _this$currentProviceC3.cityId
}).then(function (res) {
if (res.rows.length) {
res.rows.forEach(function (item) {
@ -665,26 +665,27 @@ var _default = {
console.log('读缓存数据处理的省市区', cascaderOptions);
}
_this4.currentProviceCity = _this4.getProvinceCityId(cascaderOptions, uni.getStorageSync('city'));
_context4.next = 24;
console.log('currentProviceCitycurrentProviceCity', _this4.getProvinceCityId(cascaderOptions, uni.getStorageSync('city')));
_context4.next = 25;
return _this4.getButtonList();
case 24:
_context4.next = 26;
case 25:
_context4.next = 27;
return _this4.getBannerList();
case 26:
case 27:
uni.hideLoading();
_context4.next = 33;
_context4.next = 34;
break;
case 29:
_context4.prev = 29;
case 30:
_context4.prev = 30;
_context4.t0 = _context4["catch"](1);
uni.hideLoading();
console.log('获取省市区信息异常', _context4.t0);
case 33:
case 34:
case "end":
return _context4.stop();
}
}
}, _callee4, null, [[1, 29]]);
}, _callee4, null, [[1, 30]]);
}))();
},
getProvinceCityId: function getProvinceCityId(areaList, cityName) {
@ -803,10 +804,16 @@ var _default = {
this.top = meun.height + meun.top;
},
onShow: function onShow() {
console.log(this.currentCity, ' this.currentCity');
if (uni.getStorageSync('city')) {
var obj = {
city: uni.getStorageSync('city')
};
if (this.currentCity && this.currentCity.city !== uni.getStorageSync('city')) {
console.log('缓存中的城市,与 新选择的城市 不一致, 缓存中的城市', this.currentCity);
console.log('新选择的的城市', uni.getStorageSync('city'));
this.init();
}
this.currentCity = obj;
} else {
uni.setStorageSync('city', uni.getStorageSync('Usercity'));