Commit d4b00a44 authored by Damon's avatar Damon

照片预览样式修改

parent e596160f
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<script> <script>
import qiniup from '@/components/upload/qiniup'; import qiniup from '@/components/upload/qiniup';
const app = getApp() const app = getApp()
export default { export default {
props: {}, props: {},
mixins: [qiniup], mixins: [qiniup],
data() { data() {
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
files: [], files: [],
keys: [], keys: [],
token: '', token: '',
product: '', product: '',
allImages: [] allImages: []
} }
}, },
created(e) { created(e) {
// 获取照片选项对象 // 获取照片选项对象
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}`
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
if(!photo.tempPath){ if(!photo.tempPath){
return return
} }
let path = '' let path = ''
if(photo.tempPath.origin){ if(photo.tempPath.origin){
// 保存原图到本地 // 保存原图到本地
path = photo.tempPath.origin path = photo.tempPath.origin
let result = await this.saveLocal(path) let result = await this.saveLocal(path)
...@@ -72,10 +72,10 @@ ...@@ -72,10 +72,10 @@
title: '已将照片原图保存到本地相册' title: '已将照片原图保存到本地相册'
}) })
} }
} }
// if(photo.currentItem){ // if(photo.currentItem){
// photo.currentItem.imageList.unshift(photo.tempPath.mixWater) // photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
// } // }
// if(photo.productList && photo.productList[photo.topIndex]){ // if(photo.productList && photo.productList[photo.topIndex]){
// const topArr = photo.productList[photo.topIndex] // const topArr = photo.productList[photo.topIndex]
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
// topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater) // topArr[photo.itemIndex].imageList.push(photo.tempPath.mixWater)
// } // }
// } // }
// photo. // photo.
if(photo.tempPath.mixWater){ if(photo.tempPath.mixWater){
// 保存水印处理图片到本地 // 保存水印处理图片到本地
path = photo.tempPath.mixWater path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path) let result1 = await this.saveLocal(path)
...@@ -117,37 +117,37 @@ ...@@ -117,37 +117,37 @@
}, },
// 重拍图片 // 重拍图片
remakePhoto() { remakePhoto() {
this.$emit('changeType', 1) this.$emit('changeType', 1)
}, },
finishPhoto(){ finishPhoto(){
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
photo.currentItemLength = 10 photo.currentItemLength = 10
this.continuePhoto() this.continuePhoto()
// 完成本项 // 完成本项
//this.$emit('finish') //this.$emit('finish')
}, },
// 确认图片 // 确认图片
continuePhoto() { continuePhoto() {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
let self = this let self = this
uni.showLoading({ uni.showLoading({
title:'图片保存中…' title:'图片保存中…'
}) })
self.saveTempToLocal() self.saveTempToLocal()
self.confirmUpload(true) self.confirmUpload(true)
}, },
submitFile() { submitFile() {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1 if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading() uni.hideLoading()
// 当前项的图片显示 // 当前项的图片显示
// 拍照项张数目增加 等于10张 // 拍照项张数目增加 等于10张
photo.allImages.unshift(this.fileMaps[0]) photo.allImages.unshift(this.fileMaps[0])
if(photo.currentItemLength<10){ if(photo.currentItemLength<10){
this.$emit('changeType', 1) this.$emit('changeType', 1)
}else{ }else{
this.$emit('finish') this.$emit('finish')
} }
}, },
downloadImages() { downloadImages() {
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
} }
.bottomView { .bottomView {
box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05); //box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
background-color: #333333; background-color: #333333;
width: 100%; width: 100%;
padding:70rpx 0; padding:70rpx 0;
......
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