代码进行分包处理
parent
2a90fe91bc
commit
20744820b7
|
|
@ -124,8 +124,8 @@ export default {
|
|||
// 跳转到添加品牌页面
|
||||
goToAddBrand() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/addBrand/addBrand'
|
||||
})
|
||||
url: '/package_a/addBrand/addBrand'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
"appid" : "wx025fc2befe501fda",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"es6" : false,
|
||||
"es6" : true,
|
||||
"minified" : true,
|
||||
"postcss" : true
|
||||
},
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<input
|
||||
class="item-input"
|
||||
type="text"
|
||||
placeholder="农夫山泉东方树叶乌龙茶500ml"
|
||||
placeholder="名称"
|
||||
v-model="productInfo.name"
|
||||
/>
|
||||
</view>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<input
|
||||
class="item-input barcode-input"
|
||||
type="text"
|
||||
placeholder="6921168558032"
|
||||
placeholder="条码/条码扫码"
|
||||
v-model="productInfo.barcode"
|
||||
/>
|
||||
<view class="scan-btn" @tap="handleScan">
|
||||
|
|
@ -295,12 +295,15 @@ export default {
|
|||
},
|
||||
onLoad(options) {
|
||||
console.log('页面参数:', options,apiUrl);
|
||||
this.url = apiUrl
|
||||
this.url = apiUrl
|
||||
// 从扫码页面传入的条形码
|
||||
if (options && options.fromData) {
|
||||
try {
|
||||
this.productInfo.barcode = options.barcode
|
||||
const fromData = JSON.parse(options.fromData)[0];
|
||||
// 使用 decodeURIComponent 解码乱码数据
|
||||
const decodedData = decodeURIComponent(options.fromData);
|
||||
console.log('解码数据',decodedData);
|
||||
const fromData = JSON.parse(decodedData)[0];
|
||||
this.productInfo.name = fromData.productName || '';
|
||||
this.productInfo.cost = fromData.costPrice || '';
|
||||
this.productInfo.barcode = fromData.productBarCode || '';
|
||||
|
|
@ -842,7 +842,7 @@ export default {
|
|||
goToBrandManagement() {
|
||||
this.showBrandSelector = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages/addBrand/addBrand'
|
||||
url: '/package_a/addBrand/addBrand'
|
||||
});
|
||||
},
|
||||
// 分类选择弹窗方法
|
||||
|
|
@ -873,7 +873,7 @@ export default {
|
|||
goToCategoryManagement() {
|
||||
this.showCategorySelector = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages/category/category'
|
||||
url: '/package_a/category/category'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -145,10 +145,10 @@ export default {
|
|||
uni.navigateBack({ delta: 1 });
|
||||
},
|
||||
goImport() {
|
||||
uni.navigateTo({ url: '/pages/import/import' });
|
||||
uni.navigateTo({ url: '/package_a/import/import' });
|
||||
},
|
||||
goNoCode() {
|
||||
uni.navigateTo({ url: '/pages/NoCode/NoCode' });
|
||||
uni.navigateTo({ url: '/package_a/NoCode/NoCode' });
|
||||
},
|
||||
goRecord() {
|
||||
uni.showToast({ title: '记录功能开发中', icon: 'none' });
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
},
|
||||
methods: {
|
||||
handleText(item) {
|
||||
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
|
||||
this.$tab.navigateTo(`/package_a/common/textview/index?title=${item.title}&content=${item.content}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
},
|
||||
methods: {
|
||||
handleToPwd() {
|
||||
this.$tab.navigateTo('/pages/mine/pwd/index')
|
||||
this.$tab.navigateTo('/package_a/mine/pwd/index')
|
||||
},
|
||||
handleToUpgrade() {
|
||||
this.$modal.showToast('模块建设中~')
|
||||
|
|
@ -358,7 +358,7 @@
|
|||
goToStockDetail(item) {
|
||||
// 跳转到编辑页面,传递商品ID
|
||||
uni.navigateTo({
|
||||
url: `/pages/edit/edit?id=${item.id}`
|
||||
url: `/package_a/edit/edit?id=${item.id}`
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -403,7 +403,7 @@
|
|||
|
||||
addNewGoods() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/translation/translation'
|
||||
url: '/package_a/translation/translation'
|
||||
})
|
||||
|
||||
},
|
||||
|
|
@ -473,21 +473,21 @@
|
|||
batchDeleteGoods() {
|
||||
this.$refs.popup.close();
|
||||
uni.navigateTo({
|
||||
url: '/pages/batchDeleteProduct/batchDeleteProduct'
|
||||
url: '/package_a/batchDeleteProduct/batchDeleteProduct'
|
||||
});
|
||||
},
|
||||
// 分类管理
|
||||
goToCategoryManagement() {
|
||||
this.$refs.popup.close();
|
||||
uni.navigateTo({
|
||||
url: '/pages/category/category'
|
||||
url: '/package_a/category/category'
|
||||
});
|
||||
},
|
||||
// 品牌管理
|
||||
goToBrandManagement() {
|
||||
this.$refs.popup.close();
|
||||
uni.navigateTo({
|
||||
url: '/pages/addBrand/addBrand'
|
||||
url: '/package_a/addBrand/addBrand'
|
||||
});
|
||||
},
|
||||
// 条码规则设置
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
if(res.code == 200){
|
||||
data = res.data;
|
||||
uni.navigateTo({
|
||||
url: `/pages/addProduct/addProduct?barcode=${this.lastResult}&fromData=${JSON.stringify(data)}`
|
||||
url: `/package_a/addProduct/addProduct?barcode=${this.lastResult}&fromData=${encodeURIComponent(JSON.stringify(data))}`
|
||||
})
|
||||
}
|
||||
else{
|
||||
|
|
@ -314,7 +314,7 @@
|
|||
if(res.code == 200){
|
||||
let data = res.data;
|
||||
uni.navigateTo({
|
||||
url: `/pages/addProduct/addProduct?barcode=6901028064835&fromData=${JSON.stringify(data)}`
|
||||
url: `/package_a/addProduct/addProduct?barcode=6901028064835&fromData=${encodeURIComponent(JSON.stringify(data))}`
|
||||
})
|
||||
}
|
||||
else{
|
||||
62
pages.json
62
pages.json
|
|
@ -24,45 +24,37 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}, {"path": "pages/product/product",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/translation/translation",
|
||||
"style": { "navigationBarTitleText": "录入清单" }
|
||||
},
|
||||
{ "path": "pages/addProduct/addProduct", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/batchDeleteProduct/batchDeleteProduct", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/edit/edit", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/addBrand/addBrand", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/BrandSelector/BrandSelector", "style": { "navigationBarTitleText": "选择品牌" } },
|
||||
{ "path": "pages/user/user", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/settings/settings", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/asset/asset", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/enter/enter", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/storeSelect/storeSelect", "style": { "navigationBarTitleText": "选择门店" } },
|
||||
{ "path": "pages/import/import", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/userStores/userStores", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/category/category", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "pages/back/back", "style": { "navigationBarTitleText": "" } }
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/common",
|
||||
"root": "package_a",
|
||||
"pages": [
|
||||
{"path": "webview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览网页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "textview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
}
|
||||
{ "path": "product/product", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "translation/translation", "style": { "navigationBarTitleText": "录入清单" } },
|
||||
{ "path": "addProduct/addProduct", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "batchDeleteProduct/batchDeleteProduct", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "edit/edit", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "addBrand/addBrand", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "BrandSelector/BrandSelector", "style": { "navigationBarTitleText": "选择品牌" } },
|
||||
{ "path": "user/user", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "userStores/userStores", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "settings/settings", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "asset/asset", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "enter/enter", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "storeSelect/storeSelect", "style": { "navigationBarTitleText": "选择门店" } },
|
||||
{ "path": "import/import", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "category/category", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "back/back", "style": { "navigationBarTitleText": "" } },
|
||||
{ "path": "mine/info/index", "style": { "navigationBarTitleText": "个人信息" } },
|
||||
{ "path": "mine/info/edit", "style": { "navigationBarTitleText": "编辑资料" } },
|
||||
{ "path": "mine/setting/index", "style": { "navigationBarTitleText": "应用设置" } },
|
||||
{ "path": "mine/avatar/index", "style": { "navigationBarTitleText": "修改头像" } },
|
||||
{ "path": "mine/help/index", "style": { "navigationBarTitleText": "常见问题" } },
|
||||
{ "path": "mine/about/index", "style": { "navigationBarTitleText": "关于我们" } },
|
||||
{ "path": "mine/pwd/index", "style": { "navigationBarTitleText": "修改密码" } },
|
||||
{ "path": "common/webview/index", "style": { "navigationBarTitleText": "浏览网页" } },
|
||||
{ "path": "common/textview/index", "style": { "navigationBarTitleText": "浏览文本" } }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -343,27 +343,27 @@ export default {
|
|||
},
|
||||
goToUser() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/user'
|
||||
url: '/package_a/user/user'
|
||||
})
|
||||
},
|
||||
goSetting(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/settings/settings'
|
||||
url: '/package_a/settings/settings'
|
||||
})
|
||||
},
|
||||
goToProduct() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/product'
|
||||
url: '/package_a/product/product'
|
||||
})
|
||||
},
|
||||
goToAsset() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/asset/asset'
|
||||
url: '/package_a/asset/asset'
|
||||
})
|
||||
},
|
||||
goToBack(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/back/back'
|
||||
url:'/package_a/back/back'
|
||||
})
|
||||
},
|
||||
// reLaunchToA() {
|
||||
|
|
|
|||
|
|
@ -76,12 +76,12 @@
|
|||
// 隐私协议
|
||||
handlePrivacy() {
|
||||
let site = this.globalConfig.appInfo.agreements[0]
|
||||
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
this.$tab.navigateTo(`/package_a/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
},
|
||||
// 用户协议
|
||||
handleUserAgrement() {
|
||||
let site = this.globalConfig.appInfo.agreements[1]
|
||||
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
this.$tab.navigateTo(`/package_a/common/webview/index?title=${site.title}&url=${site.url}`)
|
||||
},
|
||||
// 获取图形验证码
|
||||
getCode() {
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
|
||||
// 跳转到门店选择页面
|
||||
uni.redirectTo({
|
||||
url: '/pages/storeSelect/storeSelect'
|
||||
url: '/package_a/storeSelect/storeSelect'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,25 +93,25 @@
|
|||
},
|
||||
methods: {
|
||||
handleToInfo() {
|
||||
this.$tab.navigateTo('/pages/mine/info/index')
|
||||
this.$tab.navigateTo('/package_a/mine/info/index')
|
||||
},
|
||||
handleToEditInfo() {
|
||||
this.$tab.navigateTo('/pages/mine/info/edit')
|
||||
this.$tab.navigateTo('/package_a/mine/info/edit')
|
||||
},
|
||||
handleToSetting() {
|
||||
this.$tab.navigateTo('/pages/mine/setting/index')
|
||||
this.$tab.navigateTo('/package_a/mine/setting/index')
|
||||
},
|
||||
handleToLogin() {
|
||||
this.$tab.reLaunch('/pages/login')
|
||||
},
|
||||
handleToAvatar() {
|
||||
this.$tab.navigateTo('/pages/mine/avatar/index')
|
||||
this.$tab.navigateTo('/package_a/mine/avatar/index')
|
||||
},
|
||||
handleHelp() {
|
||||
this.$tab.navigateTo('/pages/mine/help/index')
|
||||
this.$tab.navigateTo('/package_a/mine/help/index')
|
||||
},
|
||||
handleAbout() {
|
||||
this.$tab.navigateTo('/pages/mine/about/index')
|
||||
this.$tab.navigateTo('/package_a/mine/about/index')
|
||||
},
|
||||
handleJiaoLiuQun() {
|
||||
this.$modal.showToast('QQ群:①133713780(满)、②146013835(满)、③189091635')
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const loginPage = "/pages/login"
|
|||
|
||||
// 页面白名单
|
||||
const whiteList = [
|
||||
'/pages/login', '/pages/register', '/pages/common/webview/index'
|
||||
'/pages/login', '/pages/register', '/package_a/common/webview/index'
|
||||
]
|
||||
|
||||
// 检查地址白名单
|
||||
|
|
|
|||
Loading…
Reference in New Issue