Commit 4a5a743a authored by Damon's avatar Damon

相机组件传参修改

parent 1a086996
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
currentItem: null, // 选择的某一项 currentItem: null, // 选择的某一项
setting: null, //自定义设置 setting: null, //自定义设置
waterSetting: null, // 水印设置 waterSetting: null, // 水印设置
allImages: [],
tempPath: { tempPath: {
origin: '', // 缓存拍照图片 origin: '', // 缓存拍照图片
mixWater: '' // 缓存水印拍照图片 mixWater: '' // 缓存水印拍照图片
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
keys: [], keys: [],
token: '', token: '',
product: '', product: '',
allImages: []
} }
}, },
created(e) { created(e) {
...@@ -37,10 +38,10 @@ ...@@ -37,10 +38,10 @@
console.log(getApp().globalData.photo.currentItem) console.log(getApp().globalData.photo.currentItem)
const product = app.globalData.photo.product const product = app.globalData.photo.product
this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}` this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}`
// if(app.globalData.photo.currentItem) { if(app.globalData.photo.currentItem) {
// // 获取规格Id // 获取规格Id
// this.standardId = app.globalData.photo.currentItem._id this.standardId = app.globalData.photo.currentItem._id
// } }
getApp().trackPage('照片预览页') getApp().trackPage('照片预览页')
const globalTempPath = getApp().globalData.photo.tempPath const globalTempPath = getApp().globalData.photo.tempPath
...@@ -50,7 +51,6 @@ ...@@ -50,7 +51,6 @@
// if(e.standardId) { // if(e.standardId) {
// this.standardId = e.standardId // this.standardId = e.standardId
// } // }
console.log(this.files)
this.token = getApp().globalData.token this.token = getApp().globalData.token
}, },
methods: { methods: {
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
}) })
} }
} }
photo.allImages.unshift(photo.tempPath.mixWater)
if(photo.currentItem){ if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater) photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
} }
...@@ -139,7 +140,6 @@ ...@@ -139,7 +140,6 @@
}, },
submitFile() { submitFile() {
let self = this let self = this
if(self.keys.length) { if(self.keys.length) {
for (let s of self.keys) { for (let s of self.keys) {
self.$u.api.saveImage({ self.$u.api.saveImage({
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
getApp().trackPage('水印设置页') getApp().trackPage('水印设置页')
const globalData = getApp().globalData const globalData = getApp().globalData
this.icon_close_new = globalData.icon_close_new this.icon_close_new = globalData.icon_close_new
this.systemId = globalData.photo.product.systemId this.systemId = globalData.photo.currentItem.systemId
this.getItemList() this.getItemList()
}, },
methods: { methods: {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</view> </view>
</view> </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" /> <photo-setting v-if="showType === 3" @changeType="changeType" />
</view> </view>
</template> </template>
...@@ -57,16 +57,20 @@ ...@@ -57,16 +57,20 @@
import setting from '@/components/photo/setting.vue' import setting from '@/components/photo/setting.vue'
export default { export default {
props: { props: {
currentItem: { // 拍照要求,示意图,system_id, standardId currentItem: { // 对应的规范item
type: Object, type: Object,
default () { default () {
return { 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', '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: [] // 要点
} }
} }
} }
...@@ -118,7 +122,7 @@ ...@@ -118,7 +122,7 @@
this.getMarkPath() this.getMarkPath()
this.initData() this.initData()
//this.currentItem = photo.currentItem photo.currentItem = this.currentItem
}, },
computed: { computed: {
titleTxt() { titleTxt() {
...@@ -179,6 +183,11 @@ ...@@ -179,6 +183,11 @@
uni.showTabBar() uni.showTabBar()
this.$emit('close') this.$emit('close')
}, },
finish() {
uni.showTabBar()
const photo = getApp().globalData.photo
this.$emit('close', photo.allImages)
},
changeType(type) { changeType(type) {
this.showType = 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