Commit b1d40187 authored by 高宇's avatar 高宇

拍摄小票,优化上传方法

parent 6f85e6ad
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
export default{ export default{
data(){ data(){
return{ return{
token: '',
tenantId: '', tenantId: '',
shopId: '', shopId: '',
userId: '', userId: '',
...@@ -94,6 +95,7 @@ ...@@ -94,6 +95,7 @@
success:function(Lres){ success:function(Lres){
console.log('会员信息',Lres.data) console.log('会员信息',Lres.data)
that.userId =Lres.data.vuex_user.id that.userId =Lres.data.vuex_user.id
that.token = Lres.data.vuex_token
} }
}) })
...@@ -120,17 +122,33 @@ ...@@ -120,17 +122,33 @@
count: 1, count: 1,
sourceType: ['camera'], sourceType: ['camera'],
success: function(res){ success: function(res){
console.log("aaaa",res)
tempFilePaths = res.tempFilePaths[0] tempFilePaths = res.tempFilePaths[0]
that.img = tempFilePaths uni.uploadFile({
that.$u.post('/user/receipt/mobile/insert',{ url: 'https://qf.91isoft.com/cshop/file/upload',
tenantId:that.tenantId, filePath: tempFilePaths,
shopId: that.shopId, name: 'file',
img:that.img, header: {
userId: that.userId Authorization: that.token
}).then(res => { },
console.log('res',res) success: (uploadFileRes) => {
}) let obj = JSON.parse(uploadFileRes.data)
console.log('tempFilePaths',tempFilePaths) console.log('obj',obj)
that.img = obj.data.realFileName
that.$u.post('/user/receipt/mobile/insert',{
tenantId:that.tenantId,
shopId: that.shopId,
img:that.img,
userId: that.userId
}).then(res => {
console.log('res',res)
})
console.log('tempFilePaths',tempFilePaths)
},
fail: (fail)=> {
console.log('fail',fail);
}
})
} }
}) })
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
checkPark(item) { checkPark(item) {
console.log('item',item) console.log('item',item)
uni.navigateTo({ uni.navigateTo({
url:'/homePage/parkingService/index?name=' + item.name url:'/homePage/parkingService/index?name=' + item.name + '&id'+item.id
}) })
}, },
getList(){ getList(){
......
...@@ -60,8 +60,10 @@ ...@@ -60,8 +60,10 @@
export default { export default {
data() { data() {
return { return {
parkingId: '',
tenantId: '',
img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg', img: 'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg',
test: '上海复地活力城停车场', test: '',
cardImg: 'http://192.144.239.97:20043/file/static/my/zanwushuju.png', cardImg: 'http://192.144.239.97:20043/file/static/my/zanwushuju.png',
icon: 'http://192.144.239.97:20043/file/static/my/wode_icon_youhuiquan%402x.png', icon: 'http://192.144.239.97:20043/file/static/my/wode_icon_youhuiquan%402x.png',
show: false, show: false,
...@@ -82,7 +84,37 @@ ...@@ -82,7 +84,37 @@
], ],
}; };
}, },
onLoad(option){
console.log('option',option)
if(option.name) {
this.test = option.name
}
if(option.id) {
this.parkingId = option.id
}
},
onShow() {
console.log('test',this.test)
if(this.test === '') {
console.log(111)
this.getParking()
}
},
methods: { methods: {
getParking(){
const that = this
uni.getStorage({
key:'business',
success:function(res){
console.log('商圈数据',res.data)
that.tenantId = res.data.id
that.$u.get('/parking/mobile/list?tenantId='+that.tenantId).then(res => {
that.test = res[0].name
that.parkingId = res[0].id
})
}
})
},
openInfoModal() { openInfoModal() {
this.show = true; // 显示信息框 this.show = true; // 显示信息框
}, },
...@@ -91,7 +123,7 @@ ...@@ -91,7 +123,7 @@
}, },
goChoose(){ goChoose(){
uni.navigateTo({ uni.navigateTo({
url:'/homePage/parkingService/choose/index' url:'/homePage/parkingService/choose/index?name=' + this.test
}) })
}, },
goPlateManagement(){ goPlateManagement(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment