Commit b1d40187 authored by 高宇's avatar 高宇

拍摄小票,优化上传方法

parent 6f85e6ad
......@@ -49,6 +49,7 @@
export default{
data(){
return{
token: '',
tenantId: '',
shopId: '',
userId: '',
......@@ -94,6 +95,7 @@
success:function(Lres){
console.log('会员信息',Lres.data)
that.userId =Lres.data.vuex_user.id
that.token = Lres.data.vuex_token
}
})
......@@ -120,17 +122,33 @@
count: 1,
sourceType: ['camera'],
success: function(res){
console.log("aaaa",res)
tempFilePaths = res.tempFilePaths[0]
that.img = tempFilePaths
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)
uni.uploadFile({
url: 'https://qf.91isoft.com/cshop/file/upload',
filePath: tempFilePaths,
name: 'file',
header: {
Authorization: that.token
},
success: (uploadFileRes) => {
let obj = JSON.parse(uploadFileRes.data)
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 @@
checkPark(item) {
console.log('item',item)
uni.navigateTo({
url:'/homePage/parkingService/index?name=' + item.name
url:'/homePage/parkingService/index?name=' + item.name + '&id'+item.id
})
},
getList(){
......
......@@ -60,8 +60,10 @@
export default {
data() {
return {
parkingId: '',
tenantId: '',
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',
icon: 'http://192.144.239.97:20043/file/static/my/wode_icon_youhuiquan%402x.png',
show: false,
......@@ -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: {
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() {
this.show = true; // 显示信息框
},
......@@ -91,7 +123,7 @@
},
goChoose(){
uni.navigateTo({
url:'/homePage/parkingService/choose/index'
url:'/homePage/parkingService/choose/index?name=' + this.test
})
},
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