Commit 4a5a743a authored by Damon's avatar Damon

相机组件传参修改

parent 1a086996
......@@ -67,6 +67,7 @@ export default {
currentItem: null, // 选择的某一项
setting: null, //自定义设置
waterSetting: null, // 水印设置
allImages: [],
tempPath: {
origin: '', // 缓存拍照图片
mixWater: '' // 缓存水印拍照图片
......
......@@ -29,7 +29,8 @@
fileMaps: [],
keys: [],
token: '',
product: '',
product: '',
allImages: []
}
},
created(e) {
......@@ -37,10 +38,10 @@
console.log(getApp().globalData.photo.currentItem)
const product = app.globalData.photo.product
this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}`
// if(app.globalData.photo.currentItem) {
// // 获取规格Id
// this.standardId = app.globalData.photo.currentItem._id
// }
if(app.globalData.photo.currentItem) {
// 获取规格Id
this.standardId = app.globalData.photo.currentItem._id
}
getApp().trackPage('照片预览页')
const globalTempPath = getApp().globalData.photo.tempPath
......@@ -50,7 +51,6 @@
// if(e.standardId) {
// this.standardId = e.standardId
// }
console.log(this.files)
this.token = getApp().globalData.token
},
methods: {
......@@ -73,7 +73,8 @@
title: '已将照片原图保存到本地相册'
})
}
}
}
photo.allImages.unshift(photo.tempPath.mixWater)
if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
}
......@@ -137,9 +138,8 @@
self.saveTempToLocal()
self.confirmUpload(true)
},
submitFile() {
submitFile() {
let self = this
if(self.keys.length) {
for (let s of self.keys) {
self.$u.api.saveImage({
......@@ -150,7 +150,7 @@
console.log(res, "云服务保存图片");
if(res.result.code) {
// TODO 参数是否要来回传递
const photo = getApp().globalData.photo
const photo = getApp().globalData.photo
photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
......
......@@ -122,7 +122,7 @@
getApp().trackPage('水印设置页')
const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.product.systemId
this.systemId = globalData.photo.currentItem.systemId
this.getItemList()
},
methods: {
......
......@@ -38,7 +38,7 @@
</view>
</view>
</view>
<photo-preview v-if="showType === 2" @changeType="changeType" @finish="goBack" />
<photo-preview v-if="showType === 2" @changeType="changeType" @finish="finish" />
<photo-setting v-if="showType === 3" @changeType="changeType" />
</view>
</template>
......@@ -57,16 +57,20 @@
import setting from '@/components/photo/setting.vue'
export default {
props: {
currentItem: { // 拍照要求,示意图,system_id, standardId
currentItem: { // 对应的规范item
type: Object,
default () {
return {
images: [
_id: '', // 规格ID
system_id: '', // 系统ID
brand_id: '', // 品牌ID
classify_id: '', // 分类ID
images: [ // 拍照要求示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: []
main_point: [] // 要点
}
}
}
......@@ -109,7 +113,7 @@
shadowInitShow: true, // 第一次进入页面需显示弹窗
}
},
created(e) {
created(e) {
const photo = getApp().globalData.photo
getApp().trackPage('拍照页')
// this.ctx = uni.createCameraContext();
......@@ -118,7 +122,7 @@
this.getMarkPath()
this.initData()
//this.currentItem = photo.currentItem
photo.currentItem = this.currentItem
},
computed: {
titleTxt() {
......@@ -178,6 +182,11 @@
goBack() {
uni.showTabBar()
this.$emit('close')
},
finish() {
uni.showTabBar()
const photo = getApp().globalData.photo
this.$emit('close', photo.allImages)
},
changeType(type) {
this.showType = type
......
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