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