提交 31d9135c authored 作者: 刘旭's avatar 刘旭

添加导入页面

上级 09457205
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, { }, {
"path": "pages/productLine/importProductLine",
"style": {
"navigationBarTitleText": "导入产品线"
}
}, {
"path": "pages/cart/index", "path": "pages/cart/index",
"style": { "style": {
"navigationBarTitleText": "购物车", "navigationBarTitleText": "购物车",
......
差异被折叠。
...@@ -431,7 +431,7 @@ let onClick = (e: any) => { ...@@ -431,7 +431,7 @@ let onClick = (e: any) => {
} }
}; };
// 商品加入购物车等右侧事件 // 商品加入购物车等右侧事件
let buttonClick = (e: any) => { let buttonClick = (e: any) => {
switch (e.index) { switch (e.index) {
case 0: case 0:
...@@ -603,46 +603,46 @@ let initDetails = (id: number) => { ...@@ -603,46 +603,46 @@ let initDetails = (id: number) => {
let reset = () => (model.value.show = true); let reset = () => (model.value.show = true);
// 导入产品线 // 导入产品线
let uploadLine = () => { let uploadLine = () => {
// reload() // 重置产品线 uni.navigateTo({ url: './importProductLine' })
uni.chooseFile({ // uni.chooseFile({
count: 0, // count: 0,
success(res: any) { // success(res: any) {
flag.value = false; // flag.value = false;
uni.showLoading({ // uni.showLoading({
title: '加载中' // title: '加载中'
}) // })
uni.uploadFile({ // uni.uploadFile({
url: baseUrl + '/wx/productLine/upload', // url: baseUrl + '/wx/productLine/upload',
filePath: res.tempFilePaths[0], // filePath: res.tempFilePaths[0],
name: 'file', // name: 'file',
header: { Authorization: uni.getStorageSync('token') }, // header: { Authorization: uni.getStorageSync('token') },
success(uploadFileRes: any) { // success(uploadFileRes: any) {
uni.hideLoading() // uni.hideLoading()
// setTimeout(() => { // // setTimeout(() => {
let res = JSON.parse(uploadFileRes.data) // let res = JSON.parse(uploadFileRes.data)
if (res.code === 200) { // if (res.code === 200) {
console.log(res); // console.log(res);
// 判断是否为导入产品线 // // 判断是否为导入产品线
isUpload.value = res.data.isUpload // isUpload.value = res.data.isUpload
// 清空标题 // // 清空标题
store.title = ''; // store.title = '';
setTitleRef.value.title = store.title; // setTitleRef.value.title = store.title;
lineId.value = null // lineId.value = null
// console.log(res.data.isUpload); // // console.log(res.data.isUpload);
handleEditProductLineData(res.data) // handleEditProductLineData(res.data)
} // }
// }, 2000); // // }, 2000);
}, // },
fail() { // fail() {
uni.hideLoading() // uni.hideLoading()
uni.showToast({ // uni.showToast({
title: '导入失败', // title: '导入失败',
icon: 'none' // icon: 'none'
}) // })
} // }
}) // })
} // }
}) // })
} }
//确认重置 //确认重置
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论