【优化】(分包加载):解决常用页面首次打开小程序可能要加载分包的问题,特将常用页面移动到主包

This commit is contained in:
15093570141
2024-10-16 23:21:42 +08:00
parent 4bc52e8092
commit 71676cae8c
70 changed files with 273 additions and 305 deletions

View File

@@ -102,9 +102,9 @@
) { ) {
data.params.posterUrl = share.data; data.params.posterUrl = share.data;
data.params.shareType = props.shareType; data.params.shareType = props.shareType;
handleRouteNavigateTo(`/pages/subpackage/share/sharePoster/sharePoster` + queryParams(data.params)); handleRouteNavigateTo(`/pages/share/sharePoster/sharePoster` + queryParams(data.params));
} else { } else {
handleRouteNavigateTo(`/pages/subpackage/share/qrCode/qrCode?poster=${encodeURIComponent(share.data)}`) handleRouteNavigateTo(`/pages/share/qrCode/qrCode?poster=${encodeURIComponent(share.data)}`)
} }
} else { } else {
uni.hideLoading(); uni.hideLoading();

View File

@@ -1,11 +1,11 @@
/** 配置 */ /** 配置 */
export * from './config'; export * from './config';
/** 页 */ /** 页面通讯 */
export * from './home'; export * from './page-comm';
/** 广告位 */ /** 广告位 */
export * from './advertPosition'; export * from './advert-position';
/** 本地缓存 */ /** 本地缓存 */
export * from './storage'; export * from './storage';

View File

@@ -30,7 +30,7 @@ export const handleAdvertiseDetail = (type : number | string, val : string) => {
// #endif // #endif
} }
} else if (type == NavLinkEnum.shop) { /** 商品类型的链接 */ } else if (type == NavLinkEnum.shop) { /** 商品类型的链接 */
handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${val}`); handleRouteNavigateTo(`/pages/goods/detail?id=${val}`);
} else if (type == NavLinkEnum.article) { /** 文章类型的链接 */ } else if (type == NavLinkEnum.article) { /** 文章类型的链接 */
handleRouteNavigateTo(`/pages/subpackage/article/detail/detail?id=${val}&idType=1`); handleRouteNavigateTo(`/pages/subpackage/article/detail/detail?id=${val}&idType=1`);
} else if (type == NavLinkEnum.articleCategory) { /** 文章列表类型的链接 */ } else if (type == NavLinkEnum.articleCategory) { /** 文章列表类型的链接 */
@@ -38,7 +38,7 @@ export const handleAdvertiseDetail = (type : number | string, val : string) => {
} else if (type == NavLinkEnum.intelligentForms) { /** 自定义表单类型的链接 */ } else if (type == NavLinkEnum.intelligentForms) { /** 自定义表单类型的链接 */
handleRouteNavigateTo(`/pages/subpackage/form/detail/detail?id=${val}`); handleRouteNavigateTo(`/pages/subpackage/form/detail/detail?id=${val}`);
} else if (type == NavLinkEnum.shopCategory) { /** 商品分类类型的链接 */ } else if (type == NavLinkEnum.shopCategory) { /** 商品分类类型的链接 */
handleRouteNavigateTo(`/pages/subpackage/category/category?id=${val}`); handleRouteNavigateTo(`/pages/category/category?id=${val}`);
} else if (type == NavLinkEnum.wxMiNiProgram) { /** 小程序类型的链接 */ } else if (type == NavLinkEnum.wxMiNiProgram) { /** 小程序类型的链接 */
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: val, appId: val,

View File

@@ -21,26 +21,20 @@
"condition": "", "condition": "",
"subPackages": [ "subPackages": [
"pages-config/subpackage-order.json",
"pages-config/subpackage-member.json", "pages-config/subpackage-member.json",
"pages-config/subpackage-category.json",
"pages-config/subpackage-form.json", "pages-config/subpackage-form.json",
"pages-config/subpackage-search.json",
"pages-config/subpackage-article.json", "pages-config/subpackage-article.json",
"pages-config/subpackage-notice.json", "pages-config/subpackage-notice.json",
"pages-config/subpackage-serviceGoods.json", "pages-config/subpackage-serviceGoods.json",
"pages-config/subpackage-activity.json", "pages-config/subpackage-activity.json",
"pages-config/subpackage-coupon.json", "pages-config/subpackage-coupon.json",
"pages-config/subpackage-storeMap.json", "pages-config/subpackage-storeMap.json",
"pages-config/subpackage-share.json",
"pages-config/subpackage-login.json",
"pages-config/subpackage-goods.json",
"pages-config/subpackage-distribution.json", "pages-config/subpackage-distribution.json",
"pages-config/subpackage-agency.json", "pages-config/subpackage-agency.json",
"pages-config/subpackage-merchant.json" "pages-config/subpackage-merchant.json"
], ],
"preloadRule": "", "preloadRule": "pages-config/preloadRule.json",
"workers": "", "workers": "",

View File

@@ -30,6 +30,101 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/category/category",
"style": {
"navigationBarTitleText": "商品列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/goods/detail",
"style": {
"navigationBarTitleText": "商品详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/goods/comment",
"style": {
"navigationBarTitleText": "商品评价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/order/submit/submit",
"style": {
"navigationBarTitleText": "订单提交",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/order/pay/pay",
"style": {
"navigationBarTitleText": "订单支付",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/order/result/result",
"style": {
"navigationBarTitleText": "支付结果",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/order/storeList/storeList",
"style": {
"navigationBarTitleText": "门店列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/share/sharePoster/sharePoster",
"style": {
"navigationBarTitleText": "海报分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/share/qrCode/qrCode",
"style": {
"navigationBarTitleText": "二维码分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/share/jump/jump",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
} }
] ]
}]
} }

View File

@@ -0,0 +1,8 @@
{
"preloadRule": {
"pages/member/member": {
"network": "all",
"packages": ["pages/subpackage/member"]
}
}
}

View File

@@ -1,13 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/category",
"pages": [{
"path": "category",
"style": {
"navigationBarTitleText": "商品列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -1,20 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/goods",
"pages": [{
"path": "detail",
"style": {
"navigationBarTitleText": "商品详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "comment",
"style": {
"navigationBarTitleText": "评价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -1,13 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/login",
"pages": [{
"path": "login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -1,38 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/order",
"pages": [{
"path": "submit/submit",
"style": {
"navigationBarTitleText": "订单提交",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pay/pay",
"style": {
"navigationBarTitleText": "订单支付",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "result/result",
"style": {
"navigationBarTitleText": "支付结果",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "storeList/storeList",
"style": {
"navigationBarTitleText": "门店列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
]
}]
}

View File

@@ -1,13 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/search",
"pages": [{
"path": "search",
"style": {
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -1,27 +0,0 @@
{
"subPackages": [{
"root": "pages/subpackage/share",
"pages": [{
"path": "sharePoster/sharePoster",
"style": {
"navigationBarTitleText": "海报分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "qrCode/qrCode",
"style": {
"navigationBarTitleText": "二维码分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "jump/jump",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}]
}

View File

@@ -72,12 +72,41 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/category/category",
"style": {
"navigationBarTitleText": "商品列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
], },
"subPackages": [{ {
"root": "pages/subpackage/order", "path": "pages/goods/detail",
"pages": [{ "style": {
"path": "submit/submit", "navigationBarTitleText": "商品详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/goods/comment",
"style": {
"navigationBarTitleText": "商品评价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/order/submit/submit",
"style": { "style": {
"navigationBarTitleText": "订单提交", "navigationBarTitleText": "订单提交",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
@@ -85,7 +114,7 @@
} }
}, },
{ {
"path": "pay/pay", "path": "pages/order/pay/pay",
"style": { "style": {
"navigationBarTitleText": "订单支付", "navigationBarTitleText": "订单支付",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
@@ -93,7 +122,7 @@
} }
}, },
{ {
"path": "result/result", "path": "pages/order/result/result",
"style": { "style": {
"navigationBarTitleText": "支付结果", "navigationBarTitleText": "支付结果",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
@@ -101,15 +130,45 @@
} }
}, },
{ {
"path": "storeList/storeList", "path": "pages/order/storeList/storeList",
"style": { "style": {
"navigationBarTitleText": "门店列表", "navigationBarTitleText": "门店列表",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/search/search",
"style": {
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/share/sharePoster/sharePoster",
"style": {
"navigationBarTitleText": "海报分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
]
}, { }, {
"path": "pages/share/qrCode/qrCode",
"style": {
"navigationBarTitleText": "二维码分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "pages/share/jump/jump",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
],
"subPackages": [{
"root": "pages/subpackage/member", "root": "pages/subpackage/member",
"pages": [{ "pages": [{
"path": "collection/collection", "path": "collection/collection",
@@ -344,16 +403,6 @@
} }
} }
] ]
},{
"root": "pages/subpackage/category",
"pages": [{
"path": "category",
"style": {
"navigationBarTitleText": "商品列表",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
},{ },{
"root": "pages/subpackage/form", "root": "pages/subpackage/form",
"pages": [{ "pages": [{
@@ -373,16 +422,6 @@
} }
} }
] ]
}, {
"root": "pages/subpackage/search",
"pages": [{
"path": "search",
"style": {
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
}, { }, {
"root": "pages/subpackage/article", "root": "pages/subpackage/article",
"pages": [{ "pages": [{
@@ -551,57 +590,6 @@
} }
} }
// #endif // #endif
},{
"root": "pages/subpackage/share",
"pages": [{
"path": "sharePoster/sharePoster",
"style": {
"navigationBarTitleText": "海报分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "qrCode/qrCode",
"style": {
"navigationBarTitleText": "二维码分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "jump/jump",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
},{
"root": "pages/subpackage/login",
"pages": [{
"path": "login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
},{
"root": "pages/subpackage/goods",
"pages": [{
"path": "detail",
"style": {
"navigationBarTitleText": "商品详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "comment",
"style": {
"navigationBarTitleText": "评价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
},{ },{
"root": "pages/subpackage/distribution", "root": "pages/subpackage/distribution",
"pages": [{ "pages": [{
@@ -797,4 +785,10 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}] }]
}]} }],
"preloadRule": {
"pages/member/member": {
"network": "all",
"packages": ["pages/subpackage/member"]
}
}}

View File

@@ -35,11 +35,11 @@
</view> </view>
<view class="msg-box"> <view class="msg-box">
<view class="name" <view class="name"
@click="handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${item?.products?.goodsId}`)"> @click="handleRouteNavigateTo(`/pages/goods/detail?id=${item?.products?.goodsId}`)">
{{ item?.products?.name }} {{ item?.products?.name }}
</view> </view>
<view class="desc" <view class="desc"
@click="handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${item?.products?.goodsId}`)"> @click="handleRouteNavigateTo(`/pages/goods/detail?id=${item?.products?.goodsId}`)">
{{ item?.products?.spesDesc }} {{ item?.products?.spesDesc }}
</view> </view>
<view class="price-box"> <view class="price-box">
@@ -320,7 +320,7 @@
} }
}) })
if (ids.length > 0) { if (ids.length > 0) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${ids.join(',')}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${ids.join(',')}`)
} else { } else {
handleShowToast('请选择要下单的商品'); handleShowToast('请选择要下单的商品');
} }

View File

@@ -397,7 +397,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }

View File

@@ -302,7 +302,7 @@
cartType: PaymentTypeEnum.common, cartType: PaymentTypeEnum.common,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {
@@ -380,7 +380,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }

View File

@@ -224,7 +224,7 @@
cartType: PaymentTypeEnum.common, cartType: PaymentTypeEnum.common,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {
@@ -284,7 +284,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }
</script> </script>

View File

@@ -18,7 +18,7 @@
}); });
const handleGoCategory = (id : number) => { const handleGoCategory = (id : number) => {
handleRouteNavigateTo(`/pages/subpackage/category/category?catId=${id}`) handleRouteNavigateTo(`/pages/category/category?catId=${id}`)
} }
</script> </script>

View File

@@ -63,7 +63,7 @@
} }
const handleGoCategory = (id : number) => { const handleGoCategory = (id : number) => {
handleRouteNavigateTo(`/pages/subpackage/category/category?catId=${id}`) handleRouteNavigateTo(`/pages/category/category?catId=${id}`)
} }
</script> </script>

View File

@@ -18,7 +18,7 @@
}); });
const handleGoCategory = (id : number) => { const handleGoCategory = (id : number) => {
handleRouteNavigateTo(`/pages/subpackage/category/category?catId=${id}`) handleRouteNavigateTo(`/pages/category/category?catId=${id}`)
} }
</script> </script>

View File

@@ -80,7 +80,7 @@
/** 搜索 */ /** 搜索 */
const handleSearch = () => { const handleSearch = () => {
handleRouteNavigateTo(`/pages/subpackage/category/category?key=${state.keyWord}`); handleRouteNavigateTo(`/pages/category/category?key=${state.keyWord}`);
} }
</script> </script>

View File

@@ -98,7 +98,7 @@
} }
const hanldeClickGoods = (data : any) => { const hanldeClickGoods = (data : any) => {
handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${data?.id}`) handleRouteNavigateTo(`/pages/goods/detail?id=${data?.id}`)
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -129,7 +129,7 @@
} }
const hanldeClickGoods = (data : any) => { const hanldeClickGoods = (data : any) => {
handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${data?.id}`) handleRouteNavigateTo(`/pages/goods/detail?id=${data?.id}`)
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -19,7 +19,7 @@
let inputVal = ref(''); let inputVal = ref('');
const handleSearch = () => { const handleSearch = () => {
handleRouteNavigateTo(`/pages/subpackage/category/category?key=${inputVal.value}`); handleRouteNavigateTo(`/pages/category/category?key=${inputVal.value}`);
} }
const hanldeCircle = () => { const hanldeCircle = () => {

View File

@@ -42,7 +42,7 @@
}); });
const hanldeClickViewMore = () => { const hanldeClickViewMore = () => {
handleRouteNavigateTo(`/pages/subpackage/goods/comment?id=${props.id}`); handleRouteNavigateTo(`/pages/goods/comment?id=${props.id}`);
} }
</script> </script>

View File

@@ -76,7 +76,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }
</script> </script>

View File

@@ -151,7 +151,7 @@
uni.hideLoading(); uni.hideLoading();
handleShowToast('支付成功', 'success', () => { handleShowToast('支付成功', 'success', () => {
setTimeout(() => { setTimeout(() => {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?id=${pay.data.paymentId}`) handleRouteRedirectTo(`/pages/order/result/result?id=${pay.data.paymentId}`)
}, 1000) }, 1000)
}) })
} else if (state.payCode === PayMethodCodeEnum.offline) { } else if (state.payCode === PayMethodCodeEnum.offline) {
@@ -202,7 +202,7 @@
if (e.errMsg === 'requestPayment:ok') { if (e.errMsg === 'requestPayment:ok') {
handleShowToast('支付成功', 'success', () => { handleShowToast('支付成功', 'success', () => {
setTimeout(() => { setTimeout(() => {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?id=${res.data.paymentId}`) handleRouteRedirectTo(`/pages/order/result/result?id=${res.data.paymentId}`)
}, 1000) }, 1000)
}) })
} }
@@ -211,7 +211,7 @@
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
handleShowToast('支付成功', 'success', () => { handleShowToast('支付成功', 'success', () => {
setTimeout(() => { setTimeout(() => {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?id=${res.data.paymentId}`) handleRouteRedirectTo(`/pages/order/result/result?id=${res.data.paymentId}`)
}, 1000) }, 1000)
}) })
// #endif // #endif
@@ -237,7 +237,7 @@
if (e.errMsg === 'requestPayment:ok') { if (e.errMsg === 'requestPayment:ok') {
handleShowToast('支付成功', 'success', () => { handleShowToast('支付成功', 'success', () => {
setTimeout(() => { setTimeout(() => {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?id=${res.data.paymentId}`) handleRouteRedirectTo(`/pages/order/result/result?id=${res.data.paymentId}`)
}, 1000) }, 1000)
}) })
} }
@@ -246,7 +246,7 @@
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
handleShowToast('支付成功', 'success', () => { handleShowToast('支付成功', 'success', () => {
setTimeout(() => { setTimeout(() => {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?id=${res.data.paymentId}`) handleRouteRedirectTo(`/pages/order/result/result?id=${res.data.paymentId}`)
}, 1000) }, 1000)
}) })
// #endif // #endif

View File

@@ -188,7 +188,7 @@
cartType: PaymentTypeEnum.common, cartType: PaymentTypeEnum.common,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {

View File

@@ -87,7 +87,7 @@
/** 搜索 */ /** 搜索 */
const handleSearch = () => { const handleSearch = () => {
handleRouteNavigateTo('/pages/subpackage/search/search') handleRouteNavigateTo('/pages/search/search')
} }
</script> </script>

View File

@@ -12,7 +12,7 @@
:src="handleStaticResources(userInfoStore.userInfo?.avatarImage || '/static/images/common/empty.png')"> :src="handleStaticResources(userInfoStore.userInfo?.avatarImage || '/static/images/common/empty.png')">
</image> </image>
</view> </view>
<template v-if="Object.keys(userInfoStore.userInfo).length > 0"> <template v-if="userInfoStore.userInfo && Object.keys(userInfoStore.userInfo).length > 0">
<view class="info-box"> <view class="info-box">
<view class="name">{{ userInfoStore.userInfo?.nickName }}</view> <view class="name">{{ userInfoStore.userInfo?.nickName }}</view>
<view class="price">我的余额{{ userInfoStore.userInfo?.balance || 0 }}</view> <view class="price">我的余额{{ userInfoStore.userInfo?.balance || 0 }}</view>
@@ -236,7 +236,7 @@
// #endif // #endif
// #ifndef MP-WEIXIN || MP-ALIPAY // #ifndef MP-WEIXIN || MP-ALIPAY
handleRouteNavigateTo(`/pages/subpackage/login/login?backUrl=${'/pages/member/member'}`) handleRouteNavigateTo(`/pages/login/login?backUrl=${'/pages/member/member'}`)
// #endif // #endif
} }

View File

@@ -200,7 +200,7 @@ export const useNavHook = () => {
img: "/static/images/member/icon-search.png", img: "/static/images/member/icon-search.png",
name: MemberPageNameEnum.search, name: MemberPageNameEnum.search,
isShow: true, isShow: true,
url: "/pages/subpackage/search/search" url: "/pages/search/search"
}, { }, {
title: '系统设置', title: '系统设置',
img: "/static/images/member/icon-setting.png", img: "/static/images/member/icon-setting.png",

View File

@@ -42,7 +42,7 @@
<view class="store-pickup-box" v-if="state.tabSelectType === OrderDistributionEnum.selfDelivery"> <view class="store-pickup-box" v-if="state.tabSelectType === OrderDistributionEnum.selfDelivery">
<view class="pickup-box"> <view class="pickup-box">
<view class="store-box" v-if="Object.keys(state.store).length > 0" <view class="store-box" v-if="Object.keys(state.store).length > 0"
@click="handleRouteNavigateTo(`/pages/subpackage/order/storeList/storeList`)"> @click="handleRouteNavigateTo(`/pages/order/storeList/storeList`)">
<view class="store-address-box"> <view class="store-address-box">
<view class="store-address"> <view class="store-address">
<text class="name">{{ state.store?.storeName }}</text> <text class="name">{{ state.store?.storeName }}</text>
@@ -621,9 +621,9 @@
uni.removeStorage({ key: userInvoice }); uni.removeStorage({ key: userInvoice });
// 0,0 // 0,0
if (createOrder.data.payStatus == OrderPayStatusEnum.yes) { if (createOrder.data.payStatus == OrderPayStatusEnum.yes) {
handleRouteRedirectTo(`/pages/subpackage/order/result/result?orderId=${createOrder.data.orderId}`); handleRouteRedirectTo(`/pages/order/result/result?orderId=${createOrder.data.orderId}`);
} else { } else {
handleRouteRedirectTo(`/pages/subpackage/order/pay/pay?orderId=${createOrder.data.orderId}&orderType=${state.orderType}`); handleRouteRedirectTo(`/pages/order/pay/pay?orderId=${createOrder.data.orderId}&orderType=${state.orderType}`);
} }
// //
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN

View File

@@ -18,7 +18,7 @@
</view> </view>
<view class="tag-box"> <view class="tag-box">
<view class="tag" v-for="item, index in state.historyList" :key="index" <view class="tag" v-for="item, index in state.historyList" :key="index"
@click="handleRouteNavigateTo(`/pages/subpackage/category/category?key=${item}`)">{{ item }} @click="handleRouteNavigateTo(`/pages/category/category?key=${item}`)">{{ item }}
</view> </view>
</view> </view>
</view> </view>
@@ -27,7 +27,7 @@
<view class="title">推荐搜索</view> <view class="title">推荐搜索</view>
<view class="tag-box"> <view class="tag-box">
<view class="tag" v-for="item, index in recommendList" :key="index" <view class="tag" v-for="item, index in recommendList" :key="index"
@click="handleRouteNavigateTo(`/pages/subpackage/category/category?key=${item}`)">{{ item }} @click="handleRouteNavigateTo(`/pages/category/category?key=${item}`)">{{ item }}
</view> </view>
</view> </view>
</view> </view>
@@ -74,7 +74,7 @@
state.historyList.push(state.value); state.historyList.push(state.value);
uni.setStorageSync(historySearch, state.historyList); uni.setStorageSync(historySearch, state.historyList);
} }
handleRouteNavigateTo(`/pages/subpackage/category/category?key=${state.value}`); handleRouteNavigateTo(`/pages/category/category?key=${state.value}`);
state.value = ''; state.value = '';
} }
</script> </script>

View File

@@ -32,7 +32,7 @@
/** 商品详情页*/ /** 商品详情页*/
case ShareEnum.goods: case ShareEnum.goods:
if (shareData.data?.params?.goodsId) { if (shareData.data?.params?.goodsId) {
handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${shareData.data?.params?.goodsId}`) handleRouteNavigateTo(`/pages/goods/detail?id=${shareData.data?.params?.goodsId}`)
} else { } else {
handleRouteSwitchTab(); handleRouteSwitchTab();
} }

View File

@@ -186,7 +186,7 @@
objectId: state.id, objectId: state.id,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.group}&objectId=${state.id}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.group}&objectId=${state.id}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {

View File

@@ -236,7 +236,7 @@
cartType: PaymentTypeEnum.common, cartType: PaymentTypeEnum.common,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {
@@ -255,7 +255,7 @@
teamId: state.teamId teamId: state.teamId
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.pinTuan}&objectId=${state.id}${state.teamId != 0 ? `&teamId=${state.teamId}` : ''}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.pinTuan}&objectId=${state.id}${state.teamId != 0 ? `&teamId=${state.teamId}` : ''}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {

View File

@@ -184,7 +184,7 @@
objectId: state.id, objectId: state.id,
}); });
if (addCart.status) { if (addCart.status) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.seckill}&objectId=${state.id}`) handleRouteNavigateTo(`/pages/order/submit/submit?cartIds=${addCart.data}&orderType=${PaymentTypeEnum.seckill}&objectId=${state.id}`)
/** 关闭sku弹框 */ /** 关闭sku弹框 */
handleChangePopup(false); handleChangePopup(false);
} else { } else {

View File

@@ -216,7 +216,7 @@
} }
}); });
if (ids.length > 0) { if (ids.length > 0) {
handleRouteNavigateTo(`/pages/subpackage/order/submit/submit?orderType=${PaymentTypeEnum.solitaire}&objectId=${state.id}&cartIds=${ids.join(',')}`) handleRouteNavigateTo(`/pages/order/submit/submit?orderType=${PaymentTypeEnum.solitaire}&objectId=${state.id}&cartIds=${ids.join(',')}`)
} else { } else {
handleShowToast('请先选择商品'); handleShowToast('请先选择商品');
} }

View File

@@ -189,7 +189,7 @@
if (share.status) { if (share.status) {
data.params.posterUrl = share.data; data.params.posterUrl = share.data;
data.params.shareType = ShareEnum.agent; data.params.shareType = ShareEnum.agent;
handleRouteNavigateTo(`/pages/subpackage/share/sharePoster/sharePoster` + queryParams(data.params)); handleRouteNavigateTo(`/pages/share/sharePoster/sharePoster` + queryParams(data.params));
} else { } else {
handleShowToast(share.msg); handleShowToast(share.msg);
} }

View File

@@ -155,7 +155,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }
@@ -174,7 +174,7 @@
/** 搜索 */ /** 搜索 */
const handleSearch = () => { const handleSearch = () => {
handleRouteNavigateTo(`/pages/subpackage/search/search`); handleRouteNavigateTo(`/pages/search/search`);
} }
/** 生成海报 */ /** 生成海报 */
@@ -195,7 +195,7 @@
if (share.status) { if (share.status) {
data.params.posterUrl = share.data; data.params.posterUrl = share.data;
data.params.shareType = ShareEnum.agent; data.params.shareType = ShareEnum.agent;
handleRouteNavigateTo(`/pages/subpackage/share/sharePoster/sharePoster` + queryParams(data.params)); handleRouteNavigateTo(`/pages/share/sharePoster/sharePoster` + queryParams(data.params));
} else { } else {
handleShowToast(share.msg); handleShowToast(share.msg);
} }

View File

@@ -190,7 +190,7 @@
if (share.status) { if (share.status) {
data.params.posterUrl = share.data; data.params.posterUrl = share.data;
data.params.shareType = ShareEnum.inv; data.params.shareType = ShareEnum.inv;
handleRouteNavigateTo(`/pages/subpackage/share/sharePoster/sharePoster` + queryParams(data.params)); handleRouteNavigateTo(`/pages/share/sharePoster/sharePoster` + queryParams(data.params));
} else { } else {
handleShowToast(share.msg); handleShowToast(share.msg);
} }

View File

@@ -155,7 +155,7 @@
const hanldeClickGoods = (item : GoodsType) => { const hanldeClickGoods = (item : GoodsType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.id}` url: `/pages/goods/detail?id=${item.id}`
}) })
} }
@@ -174,7 +174,7 @@
/** 搜索 */ /** 搜索 */
const handleSearch = () => { const handleSearch = () => {
handleRouteNavigateTo(`/pages/subpackage/search/search`); handleRouteNavigateTo(`/pages/search/search`);
} }
/** 生成海报 */ /** 生成海报 */
@@ -195,7 +195,7 @@
if (share.status) { if (share.status) {
data.params.posterUrl = share.data; data.params.posterUrl = share.data;
data.params.shareType = ShareEnum.inv; data.params.shareType = ShareEnum.inv;
handleRouteNavigateTo(`/pages/subpackage/share/sharePoster/sharePoster` + queryParams(data.params)); handleRouteNavigateTo(`/pages/share/sharePoster/sharePoster` + queryParams(data.params));
} else { } else {
handleShowToast(share.msg); handleShowToast(share.msg);
} }

View File

@@ -425,7 +425,7 @@
handleShowToast(form.msg, 'success', () => { handleShowToast(form.msg, 'success', () => {
setTimeout(() => { setTimeout(() => {
if (state.formInfo.type == 1 || state.formInfo.type == 2) { if (state.formInfo.type == 1 || state.formInfo.type == 2) {
handleRouteRedirectTo(`/pages/subpackage/order/pay/pay?formId=${form.data.formSubmitId}&orderType=${state.paymentType}&recharge=${form.data.money}`); handleRouteRedirectTo(`/pages/order/pay/pay?formId=${form.data.formSubmitId}&orderType=${state.paymentType}&recharge=${form.data.money}`);
} else { } else {
handleRouteSwitchTab(); handleRouteSwitchTab();
} }

View File

@@ -94,7 +94,7 @@
handleShowToast('请选择充值金额'); handleShowToast('请选择充值金额');
return; return;
} }
handleRouteNavigateTo(`/pages/subpackage/order/pay/pay?recharge=${state.rechargeId}&orderType=${PaymentTypeEnum.recharge}`); handleRouteNavigateTo(`/pages/order/pay/pay?recharge=${state.rechargeId}&orderType=${PaymentTypeEnum.recharge}`);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -3,7 +3,7 @@
<view class="m-25"> <view class="m-25">
<view v-if="state.list.length > 0"> <view v-if="state.list.length > 0">
<view class="item-box" v-for="item, index in state.list" :key="index" <view class="item-box" v-for="item, index in state.list" :key="index"
@click="handleRouteNavigateTo(`/pages/subpackage/goods/detail?id=${item.goodsId}`)"> @click="handleRouteNavigateTo(`/pages/goods/detail?id=${item.goodsId}`)">
<coreshop-goods-card type="horizontal" :nameOverflow="2" imgHeight="140rpx" imgWidth="140rpx" <coreshop-goods-card type="horizontal" :nameOverflow="2" imgHeight="140rpx" imgWidth="140rpx"
:goodsData="hanldeCombinationGoodsData(item)"> :goodsData="hanldeCombinationGoodsData(item)">
<template #goodPrice> <template #goodPrice>

View File

@@ -28,7 +28,8 @@
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<text class="btn-tit" v-if="state.tabId == 'noUsed'">立即使用</text> <text class="btn-tit" @click="handleRouteSwitchTab(RouteSwitchTabEnum.home)"
v-if="state.tabId == 'noUsed'">立即使用</text>
<text class="btn-tit gary" v-if="state.tabId == 'yesUsed'">已使用</text> <text class="btn-tit gary" v-if="state.tabId == 'yesUsed'">已使用</text>
<text class="btn-tit gary" v-if="state.tabId == 'invalid'">已失效</text> <text class="btn-tit gary" v-if="state.tabId == 'invalid'">已失效</text>
</view> </view>
@@ -53,8 +54,8 @@
import { onReachBottom } from '@dcloudio/uni-app'; import { onReachBottom } from '@dcloudio/uni-app';
import type { Response } from '@/core/models'; import type { Response } from '@/core/models';
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js'; import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
import { handleStaticResources } from '@/core/utils'; import { handleStaticResources, handleRouteSwitchTab } from '@/core/utils';
import { EmptyEnum } from '@/core/enum'; import { EmptyEnum ,RouteSwitchTabEnum} from '@/core/enum';
interface TabType { interface TabType {
id : string; id : string;

View File

@@ -91,7 +91,7 @@
const handleClickGoods = (item : GoodsFootprintType) => { const handleClickGoods = (item : GoodsFootprintType) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/subpackage/goods/detail?id=${item.goodsId}` url: `/pages/goods/detail?id=${item.goodsId}`
}) })
} }

View File

@@ -106,7 +106,7 @@
} }
const share = await queryShare(data); const share = await queryShare(data);
if (share.status) { if (share.status) {
handleRouteNavigateTo(`/pages/subpackage/share/qrCode/qrCode?poster=${encodeURIComponent(share.data)}`) handleRouteNavigateTo(`/pages/share/qrCode/qrCode?poster=${encodeURIComponent(share.data)}`)
} else { } else {
handleShowToast(share.msg); handleShowToast(share.msg);
} }

View File

@@ -313,7 +313,7 @@
<view class="m-r-20" v-if="state.orderDetail?.status == OrderStatusEnum.pending && <view class="m-r-20" v-if="state.orderDetail?.status == OrderStatusEnum.pending &&
state.orderDetail?.payStatus == OrderPayStatusEnum.no"> state.orderDetail?.payStatus == OrderPayStatusEnum.no">
<uv-button type="primary" size="small" text="立即支付" <uv-button type="primary" size="small" text="立即支付"
@click="handleRouteNavigateTo(`/pages/subpackage/order/pay/pay?orderId=${state.orderId}&orderType=${state.orderDetail?.orderType}`)"></uv-button> @click="handleRouteNavigateTo(`/pages/order/pay/pay?orderId=${state.orderId}&orderType=${state.orderDetail?.orderType}`)"></uv-button>
</view> </view>
<view class="m-r-20" v-if="state.orderDetail?.status == OrderStatusEnum.pending && <view class="m-r-20" v-if="state.orderDetail?.status == OrderStatusEnum.pending &&
state.orderDetail?.payStatus >= OrderPayStatusEnum.yes && state.orderDetail?.payStatus >= OrderPayStatusEnum.yes &&

View File

@@ -58,7 +58,7 @@
查看详情 查看详情
</view> </view>
<view class="btn pay" <view class="btn pay"
@click="handleRouteNavigateTo(`/pages/subpackage/order/pay/pay?orderId=${item.orderId}&orderType=${item.orderType}`)" @click="handleRouteNavigateTo(`/pages/order/pay/pay?orderId=${item.orderId}&orderType=${item.orderType}`)"
v-if="item.status === OrderStatusEnum.pending && item.payStatus === OrderPayStatusEnum.no"> v-if="item.status === OrderStatusEnum.pending && item.payStatus === OrderPayStatusEnum.no">
立即支付</view> 立即支付</view>
<view class="btn receipt" @click="handleConfirmReceiptGoods(item)" <view class="btn receipt" @click="handleConfirmReceiptGoods(item)"

View File

@@ -81,7 +81,7 @@
content: "确认切换登录账号吗?", content: "确认切换登录账号吗?",
confirmFn: () => { confirmFn: () => {
uni.removeStorage({ key: UserToken }); uni.removeStorage({ key: UserToken });
handleRouteNavigateTo('/pages/subpackage/login/login'); handleRouteNavigateTo('/pages/login/login');
} }
}) })
} }

View File

@@ -154,7 +154,7 @@
_useLoginStore.checkLogin(async () => { _useLoginStore.checkLogin(async () => {
const serviceOrder : Response<any> = await queryAddServiceOrder({ id: state.id }); const serviceOrder : Response<any> = await queryAddServiceOrder({ id: state.id });
if (serviceOrder.status) { if (serviceOrder.status) {
handleRouteNavigateTo(`/pages/subpackage/order/pay/pay?orderId=${serviceOrder.data}&orderType=${PaymentTypeEnum.serviceOrder}&serviceId=${state.id}`); handleRouteNavigateTo(`/pages/order/pay/pay?orderId=${serviceOrder.data}&orderType=${PaymentTypeEnum.serviceOrder}&serviceId=${state.id}`);
} else { } else {
handleShowToast(serviceOrder.msg) handleShowToast(serviceOrder.msg)
} }