Commit 5d20b40f authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/dev-photo-v2' into dev-photo-v2

parents 6b1ced5d d12246c4
.DS_Store
node_modules/
dist/
.hbuilderx/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
......
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}
......@@ -100,7 +100,18 @@
settleRecommend:'',
navHeight:0, //导航栏高度
rpxScreenHeight:0,// 照相视框高度
//拍照相关数据
photo:{
product:{
brandId:'', // 品牌id
brandName:'', // 品牌名称
classifyId:'', // 分类id
systemId:'', // 系统id
},
productList:[],
currentItem:null, // 选择的某一项
}
},
onLaunch: function() {
......@@ -134,6 +145,7 @@
// this.globalData.screenHeight = a.screenHeight;
this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90
this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750
this.globalData.screenHeight = a.screenHeight
} catch (a) {}
},
//检查更新
......
<template>
<view class="standard-box" v-if="currentItem">
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" key="swiper1">
<view class="title">
拍照要求
</view>
<view class="txt-box" >
<view class="txt" v-for="(txt,index) in currentItem.main_point" :key="index">
{{index+1}}. {{txt}}
</view>
<view class="txt tips">
注意:{{currentItem.note}}
</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index">
<cover-image @click="previewImage(index)" class="icon" mode="aspectFit" :src="src"></cover-image>
</swiper-item>
</swiper>
<view class="tab-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#999"
ref="uTabs" :list="tabList" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
</view>
</template>
<script>
export default {
name:"photo-standard",
props:{
currentItem:{
type: Object,
default () {
return {
images: [],
}
}
},
},
data() {
return {
tabList: [{
name: '十年'
}, {
name: '青春'
}, {
name: '之约'
}],
swiperList:[{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就222222',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就333333',
},],
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
height:0,
}
},
watch:{
"currentItem.images"(val){
if(val.length>0){
this.changeList(val)
// let swiperList = JSON.parse(JSON.stringify(val))
// let len = tabs.length
// let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len))
// console.log(tabList,'tabList')
}
},
},
created() {
// getApp().trackPage('照片预览页')
// console.log(e, 'e')
// if (e.img) {
// this.images = [e.img]
// }
// console.log(this.images, 'this.images')
},
mounted(){
this.changeList(this.currentItem.images)
this.getSwiperHeight()
},
methods: {
changeList(list){
let swiperList = JSON.parse(JSON.stringify(list))
let len = list.length
let tabList = []
for(let i=0;i<len;i++){
let item = {
name:'示意图' + (i + 1)
}
tabList.push(item)
}
tabList = [{name:'拍照要求'}].concat(tabList)
this.swiperList = swiperList
this.tabList = tabList
},
getSwiperHeight(){
const globalData = getApp().globalData
this.height = globalData.screenHeight*2 - globalData.navHeight - 200
},
previewImage(index){
uni.previewImage({
current:index,
urls:this.swiperList,
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
// swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
// console.log(e.detail,'e.detail-transition')
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) {
// console.log(e.detail,'e.detail-animationfinish')
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
// scroll-view到底部加载更多
onreachBottom() {
}
}
}
</script>
<style lang="scss">
.standard-box{
position: absolute;
left:0;right:0;
/* height: calc(100vh - 240rpx); */
z-index: 100;
bottom:240rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.swiper-box{
width: 690rpx;
min-height: 690rpx;
margin-bottom: 150rpx;
border-radius: 12rpx;
background-color: #fff;
}
.tab-box{
position: absolute;
bottom:0;
left:30rpx;
right:30rpx;
}
.swiper-item{
box-sizing: border-box;
// width:690rpx;
padding:30rpx;
.title{
margin-top:20rpx;
font-weight: bold;
line-height: 50rpx;
color:#333;
font-size: 36rpx;
}
.txt-box{
max-height: 560rpx;
overflow: auto;
}
.txt{
white-space: normal;
padding-top:26rpx;
line-height: 34rpx;
color:#666;
font-size: 28rpx;
&.tips{
padding-bottom:26rpx;
color:#D73400
}
}
}
/* .pic {
display: block;
width: 100%;
height: auto;
}
.scroll-view_H {
white-space: nowrap;
width: 750rpx;
height: 300rpx;
}
.view-content {
display: flex;
} */
</style>
......@@ -67,7 +67,9 @@
"mp-weixin" : {
"appid" : "wxd1d6eede324b0465",
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"es6" : true,
"minified" : true
},
"usingComponents" : true,
"permission" : {
......
......@@ -4,8 +4,21 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "拍照小工具",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
}
},
{
"path": "pages/photo/index",
"style": {
"navigationBarTitleText": "拍照小工具首页"
}
},
{
"path": "pages/index/index",
"style": {
......@@ -117,18 +130,7 @@
"navigationBarTitleText": "工单详情"
}
},
{
"path": "pages/photo/index",
"style": {
"navigationBarTitleText": "拍照小工具首页"
}
},
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "扳手会工单规范"
}
},
{
"path": "pages/photo/take",
"style": {
......@@ -139,7 +141,6 @@
"disableScroll": true
}
},
{
"path": "pages/photo/detail",
"style": {
......@@ -160,7 +161,9 @@
{
"path": "pages/photo/list",
"style": {
"navigationBarTitleText": "规范展示"
"navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
}
},
......@@ -275,8 +278,8 @@
"path": "pages/settle/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "拍照小工具", //模式名称
"path": "pages/photo/take", //启动页面,必选
"name": "拍照-规范", //模式名称
"path": "pages/photo/product", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},{
"name": "基本信息", //模式名称
......
......@@ -100,7 +100,11 @@
}
if(e && e.current_count){
this.current_count = e.current_count
this.done_count = e.current_count
}
if(e && e.current_count){
this.current_count = Math.max(e.current_count - 1, 0)
}
if(e && e.images){
......
<template>
<view class="backView">
<view class="topView">
<view :class="activeTop == ikey ? 'topItemView whiteBackColor' : 'topItemView FAbackColor' " @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList":key="ikey">
<text class="topActiveItemTitle" v-if="activeTop == ikey">{{item.type}}</text>
<text class="topItemTitle" v-if="activeTop != ikey">{{item.type}}</text>
</view>
</view>
<view class="rightView">
<template
v-for="(item,ikey) in rightList"
>
<view :class="['rightItemView',item.clickable ? 'FAbackColor' : '']" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class=" item.images ? 'rightContentView width_50' : 'rightContentView width_100' ">
<text :class=" item.clickable ? 'gray999Color rightTitle u-m-t-30 u-m-l-30' : 'rightTitle u-m-t-30 u-m-l-30' ">{{item.name}} ({{item.image_count}}张)</text>
<text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text>
</view>
<view class="rightImageView" v-if="item.images">
<image class="rightImage" :src="item.images[0]" mode=""></image>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
topList:[],
topTitle:'',
activeTop:0,
leftList:[],
rightList:[],
product:'',
product_code:'',
brand:'',
brand_code:'',
dataList:[],
}
},
onLoad(e) {
getApp().trackPage('照片规范列表页')
if(e && e.product){
this.product = e.product
}
if(e && e.product_code){
this.product_code = e.product_code
}
if(e && e.brand){
this.brand = e.brand
uni.setNavigationBarTitle({
title: this.brand
});
}
if(e && e.brand_code){
this.brand_code = e.brand_code
}
this.topTitle = this.product + '-' + this.brand
this.getListData()
},
onShow() {
console.log('onShow 里的rightList:')
console.log(this.rightList)
},
methods: {
getListData: function (){
console.log('getListData:')
console.log('product_code' + this.product_code)
console.log('brand_code' + this.brand_code)
let that = this
this.$u.cloudApi.getGroupStandard({product_code:this.product_code,brand_code:this.brand_code}).then(res =>{
console.log('获取规范标准数据:')
console.log(res)
if(res.result && res.result.length){
that.handleData(res)
}
})
},
handleData: function (res){
this.dataList = res.result
this.dataList.forEach(item => {
item.list.forEach(subItem => {
subItem.isClicked = false
})
})
console.log('添加 新字段 后的数组:')
console.log(this.dataList)
var item = res.result[0]
this.rightList = item.list
},
//顶部点击
topItemClick: function (ikey,item) {
this.activeTop = ikey
this.rightList = item.list
uni.pageScrollTo({scrollTop: 0, duration: 0});
},
//右侧点击
rightItemClick: function (item,ikey) {
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
this.$set(this.rightList[ikey],'clickable',true)
var current_image = item.images[0]
var current_count = 1
uni.navigateTo({
url:'/pages/photo/detail'
+'?current_image=' + current_image
+'&image_count=' + item.image_count
+'&current_count=' + current_count
+'&images=' + JSON.stringify(item.images)
+'&title=' + item.name,
})
},
}
}
</script>
<style>
.backView{
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.topTitle{
margin-top: 80rpx;
font-size: 32rpx;
}
.centerBackView{
display: flex;
flex-direction: row;
margin-top: 80rpx;
width: 100%;
}
.leftView{
background-color: #FFFFFF;
width: 20%;
display: flex;
flex-direction: column;
}
.leftItemView{
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 80rpx;
border-bottom: 2rpx solid #F3F3F3;
}
.leftItemText{
font-size: 28rpx;
}
.rightView{
background-color: #FFFFFF;
width: 100%;
display: flex;
flex-direction: column;
margin-top: 96rpx;
}
.rightItemView{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
border-bottom: 20rpx solid #F3F3F3;
}
.rightContentView{
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{
width: 480rpx;
}
.width_100{
width: 100%;
}
.rightTitle{
font-size: 32rpx;
color: #4D87EA;
}
.rightContent{
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.rightImageView{
width: 300rpx;
height: 320rpx;
display: flex;
align-items: center;
justify-content: center;
}
.rightImage{
background-color: #F3F3F3;
width: 240rpx;
height: 240rpx;
}
.topView{
background-color: #FAFAFA;
width: 100%;
height: 96rpx;
position: fixed;
display: flex;
flex-direction: row;
}
.topItemView{
width: 210rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
}
.whiteBackColor{
background-color: #FFFFFF;
}
.FAbackColor{
background-color: #FAFAFA;
}
.topItemTitle{
font-size: 32rpx;
color: #999999;
padding-left: 30rpx;
}
.topActiveItemTitle{
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding-left: 30rpx;
}
.greenBackColor{
background-color: #4CD964;
}
.gray999Color{
color: #999999;
}
</style>
<template>
<view class="backView">
<view class="topView">
<view class="topItemView" @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text
:class="['ph-lst-top-index', activeTop == ikey ? 'active-index-text' : 'index-text']">{{ ikey + 1 }}</text>
<text :class="activeTop == ikey ? 'topActiveItemTitle' : 'topItemTitle'">{{item.type}}</text>
</view>
</view>
<view class="rightView">
<view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class="['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}} ({{item.image_count}}张)</text>
<image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image>
<!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> -->
</view>
<view class="rightImageView" v-if="item.images">
<image class="rightImage" v-for="(image, index) in item.images" :src="image" :key="image"
@click="handleClickImage(item, image, index)" mode=""></image>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
topList: [],
activeTop: 0,
leftList: [],
rightList: [],
classifyId: '',
systemId: '',
brand: '',
brandId: '',
dataList: [],
}
},
onLoad(e) {
getApp().trackPage('照片规范列表页')
if (e && e.brandId) {
this.brandId = e.brandId
}
if (e && e.brand) {
this.brand = e.brand
uni.setNavigationBarTitle({
title: this.brand
});
}
if (e && e.systemId) {
this.systemId = e.systemId
}
if (e && e.classifyId) {
this.classifyId = e.classifyId
}
this.getListData()
},
onShow() {
console.log('onShow 里的rightList:')
console.log(this.rightList)
},
methods: {
getListData: function() {
let that = this
this.$u.cloudApi.getGroupStandardV2({
'token': getApp().globalData.token,
'classify_id': this.classifyId,
'system_id': this.systemId,
'brand_id': this.brandId
}).then(res => {
console.log('获取规范标准数据:')
console.log(res)
if (res.result && res.result.length) {
that.handleData(res)
}
})
},
handleData: function(res) {
const globalData = getApp().globalData
globalData.photo.productList = res.result
this.dataList = res.result
var item = res.result[0]
this.rightList = item.list
},
//顶部点击
topItemClick: function(ikey, item) {
this.activeTop = ikey
this.rightList = item.list
uni.pageScrollTo({
scrollTop: 0,
duration: 0
});
},
// 点击图片
handleClickImage(item, image, index) {
// uni.navigateTo({
// url: '/pages/photo/detail' +
// '?current_image=' + image +
// '&image_count=' + item.images.length +
// '&current_count=' + (index + 1) +
// '&images=' + JSON.stringify(item.images) +
// '&title=' + item.name,
// })
uni.previewImage({
urls: item.images,
current:index
})
},
//右侧点击
rightItemClick: function(item, ikey) {
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
// this.$set(this.rightList[ikey],'clickable',true)
// var current_image = item.images[0]
// var current_count = 1
// uni.navigateTo({
// url:'/pages/photo/standard'
// // +'?current_image=' + current_image
// // +'&image_count=' + item.image_count
// // +'&current_count=' + current_count
// // +'&images=' + JSON.stringify(item.images)
// // +'&title=' + item.name,
// })
console.log(item,'item')
const photo = getApp().globalData.photo
photo.currentItem = item
uni.navigateTo({
url:'/pages/photo/take'
})
},
}
}
</script>
<style>
.backView {
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.centerBackView {
display: flex;
flex-direction: row;
margin-top: 80rpx;
width: 100%;
}
.ph-lst-top-index {
font-size: 26rpx;
font-weight: bold;
color: #FFFFFF;
border-radius: 8rpx;
background-color: #999999;
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
text-align: center;
}
.active-index-text {
background-color: #2272FF;
}
.index-text {
background-color: #999999;
}
.rightView {
background-color: #F4F5F7;
width: 100%;
display: flex;
flex-direction: column;
padding-top: 100rpx;
padding-bottom: 50rpx;
}
.right-view-title {
font-size: 36rpx;
font-weight: bold;
height: 104rpx;
line-height: 104rpx;
margin-left: 30rpx;
}
.rightItemView {
/* width: 100%; */
/* display: flex; */
/* flex-direction: row; */
/* justify-content: space-between; */
/* border-bottom: 20rpx solid #F3F3F3; */
margin: 0rpx 30rpx 20rpx 30rpx;
padding: 36rpx 30rpx 18rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
}
.ph-lst-item-index {
font-size: 28rpx;
font-weight: bold;
border-radius: 4rpx;
width: 34rpx;
height: 34rpx;
line-height: 30rpx;
text-align: center;
border-width: 1px;
border-style: solid;
margin-right: 10rpx;
}
.rightContentView {
display: flex;
align-items: center;
width: 100%;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.ph-list-item-arrow {
position: absolute;
width: 56rpx;
height: 56rpx;
right: 30rpx;
}
/* .rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{
width: 480rpx;
}
.width_100{
width: 100%;
} */
.rightTitle {
font-size: 30rpx;
color: #2272FF;
}
.rightContent {
font-size: 30rpx;
color: #333333;
line-height: 40rpx;
}
.rightImageView {
/* width: 300rpx; */
/* height: 320rpx; */
display: flex;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
margin-top: 26rpx;
}
.rightImage {
background-color: #F3F3F3;
width: 116rpx;
height: 116rpx;
margin: 0rpx 12rpx 12rpx 0rpx;
}
.topView {
background-color: #FAFAFA;
width: 100%;
height: 100rpx;
position: fixed;
display: flex;
flex-direction: row;
z-index: 1;
}
.topItemView {
/* width: 210rpx; */
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
-webkit-flex: 1;
flex: 1;
background-color: #FFFFFF;
}
.topItemTitle {
font-size: 36rpx;
color: #999999;
font-weight: bold;
padding-left: 30rpx;
}
.topActiveItemTitle {
font-size: 36rpx;
font-weight: bold;
color: #2272FF;
padding-left: 30rpx;
}
.greenBackColor {
background-color: #4CD964;
}
.gray666Color {
color: #666666;
border-color: #666666;
}
</style>
<template>
<view class="backView">
<text class="topTitle">选择产品</text>
<view class="u-p-b-48">
<view class="itemView u-m-t-48" @click="itemClick(item)" v-for="(item,ikey) in productList":key="ikey">
<text class="itemTitle">{{item.name}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
productList:[],
product_code:'',
product:'',
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getProductList()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success(){},
fail(){}
}
return shareObj
},
methods: {
getProductList: function(){
let that = this
this.$u.cloudApi.getAllProduct().then(res =>{
console.log('获取产品数据:')
console.log(res)
if(res.result && res.result.data){
that.productList = res.result.data
}
})
},
//选择 点击
itemClick: function (item) {
if(item.code){
this.product_code = item.code
}
if(item.name){
this.product = item.name
}
uni.navigateTo({
url:'/pages/photo/brand'
+ '?product_code=' + this.product_code
+ '&product=' + this.product,
})
},
}
}
</script>
<style>
.backView{
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.topTitle{
margin-top: 192rpx;
font-size: 32rpx;
}
.itemView{
background-color: #FFFFFF;
width: 548rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
}
.itemTitle{
font-size: 32rpx;
font-weight:bold;
}
<template>
<view class="backView">
<view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index">
<template v-if="dataItem.data.length > 0">
<view class="topTitle"><text>{{ dataItem.title }}</text></view>
<view class="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item._id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item)" :key="item._id">
<text class="itemTitle">{{item.name}}</text>
</view>
</view>
</template>
</view>
<button class="ph-pr-button" type="primary" @click="handleClick"
:style="selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'">下一步</button>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
systemList: [],
brandList: [],
param: {
classifyId: '',
systemId: '',
brandId: '',
},
brandName: '',
selectedAll: false,
}
},
computed: {
list() {
return [{
title: '请选择类别',
type: 'classifyId',
data: this.classifyList
},
{
title: '请选择系统',
type: 'systemId',
data: this.systemList
},
{
title: '请选择品牌',
type: 'brandId',
data: this.brandList
}
]
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getclassifyList()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success() {},
fail() {}
}
return shareObj
},
methods: {
getclassifyList: function() {
let that = this
this.$u.cloudApi.getClassifyDictionary().then(res => {
console.log('获取产品数据:')
console.log(res)
if (res.result && res.result.data) {
that.classifyList = res.result.data
that.param.classifyId = that.classifyList[0]._id
that.$u.cloudApi.getRelationDictionary({
"classify_id": that.param.classifyId,
"field": "system_id"
}).then(res1 => {
that.systemList = res1.result
})
}
})
},
//选择 点击
itemClick: function(type, item) {
switch (type) {
case 'classifyId':
this.param = {
classifyId: item._id,
systemId: '',
brandId: ''
}
this.selectedAll = false
this.systemList = []
this.brandList = []
this.$u.cloudApi.getRelationDictionary({
"classify_id": this.param.classifyId,
"field": "system_id"
}).then(res => {
this.systemList = res.result
})
break
case 'systemId':
this.param = {
classifyId: this.param.classifyId,
systemId: item._id,
brandId: ''
}
this.selectedAll = false
this.brandList = []
this.$u.cloudApi.getRelationDictionary({
"classify_id": this.param.classifyId,
"system_id": this.param.systemId,
"field": "brand_id"
}).then(res => {
console.log('获取品牌数据:', res)
this.brandList = res.result
})
break
case 'brandId':
this.param.brandId = item._id
this.selectedAll = true
this.brandName = item.name
break
default:
break
}
},
// 点击下一步
handleClick() {
// 点击下一步设置全局拍照品牌品类
const globalData = getApp().globalData
let keys = ['brandId','brandName','classifyId','systemId']
keys.map(key=>{
globalData.photo.product[key] = this[key] || this.param[key]
})
uni.navigateTo({
url: '/pages/photo/list' +
'?brandId=' + this.param.brandId +
'&brand=' + this.brandName +
'&classifyId=' + this.param.systemId +
'&systemId=' + this.param.systemId,
})
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.topTitle {
margin-top: 50rpx;
padding-left: 30rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.ph-pr-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
padding: 22rpx 22rpx;
}
.ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF;
/* width: 548rpx; */
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #666666;
}
.select-item-view {
background-color: #2272FF;
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #FFFFFF;
}
.ph-pr-button {
position: absolute;
bottom: 76rpx;
border-radius: 52rpx;
height: 104rpx;
font-size: 32rpx;
width: 600rpx;
line-height: 104rpx;
}
</style>
<template>
<template>
<view class="camera-container">
<cover-view class="header-box" :style="{'height':navHeight + 'rpx'}">
<cover-view class="inner">
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-switch.png"></cover-image>
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-light.png"></cover-image>
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-setting.png"></cover-image>
<cover-image @click="setCameraInfo('devicePosition')" class="icon" mode="aspectFit" src="/static/photo/icon-switch.png"></cover-image>
<cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit" src="/static/photo/icon-light.png"></cover-image>
<cover-image @click="goPage('/pages/photo/markSetting')" class="icon" mode="aspectFit" src="/static/photo/icon-setting.png"></cover-image>
</cover-view>
</cover-view>
<camera class="camera-box" v-if="cameraChange" device-position="front" flash="on" :style="{'height':cameraHeight + 'rpx'}"
<camera class="camera-box" v-if="cameraChange" :device-position="cameraInfo.devicePosition" :flash="cameraInfo.flash" :style="{'height':cameraHeight + 'rpx'}"
@error="cameraError">
<cover-view class="mark-box">
<cover-view class="txt u-m-l-20 u-m-t-30">经度:{{waterInfo.longitude || '正在获取中...'}}</cover-view>
......@@ -16,14 +16,20 @@
<cover-view class="txt u-m-l-20 u-m-t-10">地址:{{waterInfo.address || '正在获取中...'}}</cover-view>
<cover-view class="txt u-m-l-20 u-m-t-10">时间:{{waterInfo.date || '正在获取中...'}}</cover-view>
</cover-view>
<cover-image class="mark-water liveWatermarkNormal" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
<cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
</camera>
<cover-view class="bottom-box">
<cover-image class="icon" :src="icon_arrow_down" mode="" @click="simpleBack"></cover-image>
<cover-view class="bottom-box" v-show="!standardShow">
<cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="takePhoto"> </cover-image>
<cover-view class="txt">拍照要求</cover-view>
<cover-image class='icon' src='/static/photo/icon-standard.png' @click="standardShow = true"> </cover-image>
</cover-view>
<canvas canvas-id="canvas" id="photoCanvas" class="canvas" :style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<cover-view class="page-mask" v-if="standardShow">
<photo-standard :currentItem="currentItem" />
<cover-view class="btn-close" @click="standardShow = false">
<cover-image class="icon icon-close" mode="aspectFit" src="/static/photo/icon-close.png"></cover-image>
</cover-view>
</cover-view>
<canvas v-show='showImage' canvas-id="canvas" :style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
</view>
</template>
......@@ -33,63 +39,54 @@
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
import standard from '@/components/photo/standard.vue'
export default {
components:{
'photo-standard':standard,
},
data() {
return {
title: '',
ctx: null,
path: "",
image: "",
showImage: false,
canvas: null,
longitude: '正在获取中...',
latitude: '正在获取中...',
address: '正在获取中...',
date: '',
// icon_location: 'https://qn-static.banshouhui.com/take_order/icon/location.png',
// scale: "4_3",
// icon_take: 'https://qn-static.banshouhui.com/take.png',
// icon_switch_white: 'https://qn-static.banshouhui.com/switch_white.png',
// icon_light_on_white: 'https://qn-static.banshouhui.com/light_on_white.png',
// liveWaterMarkImage: '/static/live_mark.png',
// icon_arrow_down: 'https://qn-static.banshouhui.com/arrow_down.png',
// icon_live_mark: 'https://qn-static.banshouhui.com/live_mark.png',
width: '',
height: '',
markPath: '',
canvasWidth: 0,
canvasHeight: 0,
restuleImage: '',
currentItem:{
name:'111',
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'],
},
standardShow:false,
cameraInfo:{
devicePosition:'front',
flash:'off'
},
waterInfo: {
longitude: '', // 经度
latitude: '', // 维度
address: '', //地址
date: '', //日期
markImage:'/static/live_mark.png'
markImage: 'https://qn-static.banshouhui.com/live_mark.png'
},
tempImgs:{
'markImage':'', // 拍照水印
'noMarkPhoto':'', // 无水印照片
'markPhoto':'', // 有水印照片
},
authSetting: {
camera: false, // 相机授权
location: false, // 位置授权
},
navHeight: 0,
cameraWidth:750,
cameraHeight: 1000, // (4 / 3 * 750) 图片比例4:3
ratio:0,
cameraChange: true,
}
},
onLoad(e) {
const photo = getApp().globalData.photo
console.log(photo,'global-photo')
getApp().trackPage('拍照页')
this.ctx = uni.createCameraContext();
this.date = this.getTime()
// this.ctx = uni.createCameraContext();
this.waterInfo.date = this.getTime()
this.getLocation()
this.getMarkPath()
this.getSystemInfo()
uni.setNavigationBarColor({
frontColor: '#FFFFFF',
backgroundColor: '#333333',
})
//this.address = ''
this.currentItem = photo.currentItem
},
compute: {},
watch: {
......@@ -101,6 +98,7 @@
},
onShow() {
this.initData()
// this.standardShow = true
// this.cameraHeight = globalData.rpxScreenHeight
// uni.authorize({
......@@ -112,34 +110,65 @@
// })
},
methods: {
goBack(){
uni.redirectTo({
url:'/pages/photo/brand'
})
},
goPage(url){
url = url || '/pages/photo/index';
console.log(url,'url')
uni.navigateTo({
url:url
})
},
setCameraInfo(type){
// 设置相机前置后置、闪关灯等
const cameraInfo = this.cameraInfo
let val = cameraInfo[type]
switch(type){
case 'devicePosition':
val = val==='back' ? 'front' : 'back'
break;
case 'flash':
val = val==='auto' ? 'on' : 'auto'
break;
defalut:
break;
}
console.log(type,'type',val,'val')
this.cameraInfo[type] = val
},
initData() {
const globalData = getApp().globalData
this.navHeight = globalData.navHeight
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
// this.cameraHeight = globalData.rpxScreenHeight
},
baiduLocation() {
// 百度sdk解析经纬度
let a = this,
t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
a.address = i
},
fail: function(a) {
console.log(a, 'a')
}
};
if (a.latitude && a.longitude) {
let e = a.latitude + "," + a.longitude;
t.location = e;
let waterInfo = this.waterInfo
const t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
waterInfo.address = i
},
fail: function(err) {
console.log(err, 'err')
}
h.regeocoding(t);
};
if (waterInfo.latitude && waterInfo.longitude) {
let e = waterInfo.latitude + "," + waterInfo.longitude;
t.location = e;
}
h.regeocoding(t);
};
t()
},
cameraError: function(e) {
cameraError(e) {
const {
errMsg
} = e.detail
......@@ -152,17 +181,16 @@
//获取位置
getLocation() {
let that = this
const waterInfo = this.waterInfo
uni.getLocation({
type: 'gcj02',
success: function(res) {
console.log(res, 'res')
that.longitude = parseFloat(res.longitude).toFixed(4)
that.latitude = parseFloat(res.latitude).toFixed(3)
console.log(that.longitude, 'that.longitude', that.latitude, 'that.latitude')
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
console.log(waterInfo.longitude, 'that.longitude', waterInfo.latitude, 'that.latitude')
that.baiduLocation()
},
fail(err) {
console.log('err-location', 'err')
that.showSettingModal('location')
// that.showLocationAuthModal('')
}
......@@ -207,293 +235,85 @@
success(res) {
console.log(res, 'res-setting')
const authSetting = res.authSetting
self.cameraChange = true
if (authSetting['scope.userLocation']) {
// 位置授权成功
self.authSetting.location = true
self.getLocation()
}
console.log(self.cameraChange,'this.cameraChange')
if (res.authSetting['scope.camera']) {
this.cameraChange = true
self.authSetting.camera = true
}
if (res.authSetting['scope.writePhotosAlbum']) {
self.authSetting.writePhotosAlbum = true
}
}
})
},
goBack() {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.done_count++;
uni.navigateBack({
//delta: 2
});
},
getSystemInfo() {
// 获取设备信息
try {
const res = uni.getSystemInfoSync();
this.canvasWidth = res.windowWidth * 2
this.canvasHeight = res.windowHeight * 2
} catch (e) {
// error
}
},
//返回 点击
backClick: function() {
uni.navigateBack({
})
},
//定位 再次授权弹窗
showLocationAuthModal: function() {
let that = this
uni.showModal({
content: '拒绝授权将无法定位当前位置,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
that.openLocationSetting()
}
if (res.cancel) {
uni.navigateBack({
})
}
},
fail() {
console.log('')
}
})
},
//定位设置界面
// openLocationSetting() {
// let that = this
// wx.openSetting({
// success(res) {
// console.log(res, 'openSetting.res')
// console.log(res.authSetting, 'openSetting.res.authSetting')
// console.log(res.authSetting['scope.camera'], 'openSetting.res.authSetting.scope.camera')
// console.log(res.authSetting['scope.userLocation'], 'openSetting.res.authSetting.scope.userLocation')
// if( res.authSetting['scope.userLocation'] && res.authSetting['scope.userLocation'] == true){
// console.log('33333location reload page')
// that.getLocation()
// }else{
// that.showLocationAuthModal()
// console.log('444444')
// }
// }
// })
// },
//刷新当前页
reloadPage: function() {
uni.redirectTo({
url: '/pages/photo/try'
});
},
//获取 水印 本地缓存路径
getMarkPath: function() {
let that = this
uni.downloadFile({
url: this.icon_live_mark, //仅为示例,并非真实的资源
url: this.waterInfo.markImage, //仅为示例,并非真实的资源
success: (res) => {
if (res.statusCode === 200) {
that.markPath = res.tempFilePath
this.tempImgs.markImage = res.tempFilePath
}
},
fail() {
// console.log('水印图片 下载失败')
console.log('水印图片 下载失败')
}
})
},
callback(res) {
console.log(res, 'res-callback')
},
//相机设置界面
openCameraSetting() {
let that = this
wx.openSetting({
success(res) {
console.log(res, 'openSetting.res')
console.log(res.authSetting, 'openSetting.res.authSetting')
console.log(res.authSetting['scope.camera'], 'openSetting.res.authSetting.scope.camera')
console.log(res.authSetting['scope.userInfo'], 'openSetting.res.authSetting.scope.userInfo')
if (res.authSetting['scope.camera'] && res.authSetting['scope.camera'] == true) {
that.reloadPage()
} else {
that.showCameraAuthModal()
}
}
})
},
//相机 再次授权弹窗
showCameraAuthModal: function() {
let that = this
uni.showModal({
content: '拒绝授权将无法拍照,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
that.openCameraSetting()
}
if (res.cancel) {
uni.navigateBack({
})
}
},
fail() {
console.log('')
}
})
},
//相机拒绝授权
cameraRefuse: function() {
console.log('相机拒绝授权')
this.showCameraAuthModal()
},
//第一步: 拍照
/* ---------------------- 拍照流程 ---------------------- */
// 第一步:拍照
takePhoto() {
console.log((new Date).getTime(), '开始渲染')
this.ctx.takePhoto({
quality: 'high',
success: (res) => {
console.log(res)
//this.imageChange(res)
this.getImageInfo(res.tempImagePath)
//this.saveToLocal(res.tempImagePath)
}
});
},
//第二步: 获取图片信息
getImageInfo(tempImagePath) {
let that = this
uni.getImageInfo({
src: tempImagePath,
success(res) {
that.width = res.width + 'px';
that.height = res.height + 'px';
that.drawCanvas(tempImagePath, res)
}
wx.createCameraContext().takePhoto({
quality: "high"
}).then(res=>{
this.tempImgs.noMarkPhoto = res.tempImagePath
this.drawCanvas(res.tempImagePath)
})
},
//第三步: 绘制画布
drawCanvas: function(tempImagePath, res) {
// 第二步:绘制画布
drawCanvas: function(tempPath) {
uni.showLoading({
title: '数据处理中...',
icon: 'loading'
})
let canvasWidth = this.canvasWidth
let canvasHeight = this.canvasHeight
const ratio = this.ratio
let canvasWidth = this.cameraWidth * ratio
let canvasHeight = this.cameraHeight* ratio
const waterInfo = this.waterInfo
this.showImage = true
//将原图画到canvas上面
this.canvas = uni.createCanvasContext("canvas", this)
this.canvas.rect(0, 0, canvasWidth, canvasHeight)
this.canvas.drawImage(tempImagePath, 0, 0, canvasWidth, canvasHeight)
let canvas = uni.createCanvasContext("canvas", this)
canvas.rect(0, 0, canvasWidth, canvasHeight)
canvas.drawImage(tempPath, 0, 0, canvasWidth, canvasHeight)
// this.canvas.draw()
//加入 水印文字
this.canvas.setFontSize(28)
this.canvas.setFillStyle('#f2f2f2')
canvas.setFontSize(14)
canvas.setFillStyle('#f2f2f2')
let h = 1
let txtHeight = 36
this.canvas.fillText('经度: ' + this.longitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('维度: ' + this.latitude, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('地址: ' + this.address, 20, canvasHeight - txtHeight * h++);
this.canvas.fillText('时间: ' + this.date, 20, canvasHeight - txtHeight * h++);
let txtHeight = 18
canvas.fillText('经度: ' + waterInfo.longitude, 20, canvasHeight - txtHeight * h++);
canvas.fillText('维度: ' + waterInfo.latitude, 20, canvasHeight - txtHeight * h++);
canvas.fillText('地址: ' + waterInfo.address, 20, canvasHeight - txtHeight * h++);
canvas.fillText('时间: ' + waterInfo.date, 20, canvasHeight - txtHeight * h++);
//加入 水印图片
this.canvas.drawImage(this.markPath, canvasWidth / 2 - 200, canvasHeight / 2 - 50, 400, 100)
this.canvasImage()
// this.canvas.draw()
// uni.showLoading({
// title: '数据处理中...',
// icon: 'loading'
// })
// this.exportCanvasTempFilePath(res.width,res.height)
},
canvasImage() {
let self = this
this.canvas.draw(false,
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas.draw(false,
setTimeout(() => {
console.log((new Date).getTime(), '结束渲染')
uni.canvasToTempFilePath({
// x: 0,
// y: 0,
width: Number(this.canvasWidth),
height: Number(this.canvasHeight),
width: canvasWidth,
height:canvasHeight,
canvasId: 'canvas',
success: (res) => {
self.saveToLocal(res.tempFilePath)
const FileSystemManager = wx.getFileSystemManager()
FileSystemManager.saveFile({
tempFilePath: res.tempFilePath,
success(res) {
console.log(res, 'res-saveFile')
}
})
// this.$emit('canvasImage', res.tempFilePath);
// if (this.showPreview) {
// this.restultImage = res.tempFilePath
// self.showPreviewFn(res.tempFilePath);
// }
this.tempImgs.markPhoto = res.tempFilePath
this.saveToLocal(res.tempFilePath)
},
fail: (res) => {
console.log(res);
......@@ -502,8 +322,23 @@
uni.hideLoading();
}
}, this);
}, 500));
}, 500))
},
// 第三步:保存到本地
saveToLocal(tempImagePath) {
let that = this
uni.saveImageToPhotosAlbum({
filePath: tempImagePath,
success() {
uni.showToast({
icon: 'none',
title: '已将照片保存到本地相册'
})
},
fail() {}
})
},
showPreviewFn(img) {
uni.previewImage({
current: 0,
......@@ -520,15 +355,12 @@
icon: 'none',
title: '已将照片保存到本地相册'
})
let timer = setTimeout(() => {
that.goBack()
}, 1500)
// let timer = setTimeout(() => {
// that.goBack()
// }, 1500)
},
fail() {
// console.log('保存本地相册 失败')
///*
uni.showToast({
icon: 'none',
title: '保存本地相册失败'
......@@ -547,118 +379,13 @@
}
});
//*/
/*
let txt = '保存本地相册失败'
uni.getSetting({
success(res) {
let authSetting = res.authSetting
if (!authSetting['scope.writePhotosAlbum']) {
txt = '请打开相册权限'
}
uni.showToast({
icon: 'none',
title: txt
})
}
})
*/
// wx.openSetting({
// success (res) {
// console.log(res.authSetting,'openSetting')
// // res.authSetting = {
// // "scope.userInfo": true,
// // "scope.userLocation": true
// // }
// }
// })
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success() {
// console.log('userLocation')
// uni.openSetting({
// success(res) {
// console.log(res,'openSetting')
// }
// });
// }
// })
}
})
},
//相册 再次授权弹窗
showAlbumAuthModal: function() {
let that = this
uni.showModal({
content: '拒绝授权照片将无法保存到本地相册,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
that.openAlbumSetting()
}
if (res.cancel) {
uni.navigateBack({
})
}
},
fail() {
console.log('')
}
})
},
//相机设置界面
openAlbumSetting() {
let that = this
wx.openSetting({
success(res) {
console.log(res, 'openSetting.res')
console.log(res.authSetting, 'openSetting.res.authSetting')
console.log(res.authSetting['scope.writePhotosAlbum'], 'openSetting.res.authSetting.scope.writePhotosAlbum')
if (res.authSetting['scope.writePhotosAlbum'] && res.authSetting['scope.writePhotosAlbum'] == true) {
console.log('11111camera reload page')
uni.getStorage({
key: 'photo_tempPath',
success: function(res) {
that.saveToLocal(res.data)
}
})
//that.reloadPage()
} else {
that.showAlbumAuthModal()
console.log('222222')
}
}
})
},
//获取当前时间
getTime: function() {
var date = new Date(),
let date = new Date(),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
......@@ -695,8 +422,8 @@
.icon {
margin: 20rpx;
display: block;
width: 50rpx;
height: 50rpx;
width: 44rpx;
height: 44rpx;
}
}
......@@ -737,7 +464,7 @@
height: 160rpx;
display: flex;
justify-content: space-between;
padding: 20rpx;
padding: 20rpx 78rpx;
align-items: center;
background-color: black;
......@@ -748,106 +475,44 @@
.icon {
display: block;
width: 60rpx;
height: 60rpx;
width: 92rpx;
height: 92rpx;
&.icon-take {
width: 150rpx;
height: 150rpx;
width: 144rpx;
height: 144rpx;
}
}
}
// .blackBackColor {
// background-color: #000000;
// overflow: hidden;
// }
// .bottomView {
// background-color: #333333;
// z-index: 5;
// width: 100%;
// height: 200rpx;
// position: absolute;
// bottom: 0;
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: center;
// }
// .switchIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// }
// .takeIcon {
// background-color: #333333;
// width: 150rpx;
// height: 150rpx;
// }
// .flashIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// margin-left: 100rpx;
// }
// .locationView {
// /* z-index: 5;
// width: 300rpx;
// position: absolute;
// left: 0;
// bottom: 200rpx;
// display: flex;
// flex-direction: column;
// padding-bottom: 20rpx;
// padding-right: 20rpx; */
// bottom: 200rpx;
// padding-bottom: 20rpx;
// padding-right: 20rpx;
// z-index: 4;
// position: absolute;
// font-size: 14px;
// line-height: 18px;
// color: #fff;
// }
// .locationText {
// /* font-size: 24rpx;
// color: #999999;
// width: 260rpx; */
// margin: 2px 0;
// }
// .liveWatermarkNormal {
// z-index: 3;
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
// width: 360rpx;
// height: 90rpx;
// z-index: 6;
// }
// // .backIcon {
// // background-color: #FFFFFF;
// // width: 54rpx;
// // height: 54rpx;
// // border-radius: 27rpx;
// // position: fixed;
// // left: 60rpx;
// // bottom: 50rpx;
// // border: 2rpx solid #aaa;
// // }
.showCanvas {
background-color: #007AFF;
width: 100%;
height: 100%;
.canvas{
position: fixed;
left:-750rpx;
top: 0;
}
// 拍照规范
.page-mask{
position: fixed;
bottom:0;
z-index: 100;
width:750rpx;
height:100vh;
padding:0 30rpx;
box-sizing: border-box;
background-color: rgba(0,0,0,0.8);
.icon{
width: 92rpx;
height: 92rpx;
}
.btn-close{
position: absolute;
bottom:0;
left:0;right:0;
height:200rpx;
z-index:100;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
take-order/static/photo/icon-light.png

1.67 KB | W: | H:

take-order/static/photo/icon-light.png

1.58 KB | W: | H:

take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
  • 2-up
  • Swipe
  • Onion skin
take-order/static/photo/icon-switch.png

1.77 KB | W: | H:

take-order/static/photo/icon-switch.png

1.46 KB | W: | H:

take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
  • 2-up
  • Swipe
  • Onion skin
take-order/static/photo/icon-take.png

8.88 KB | W: | H:

take-order/static/photo/icon-take.png

6.18 KB | W: | H:

take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
  • 2-up
  • Swipe
  • Onion skin
{
"name": "saveImage",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"user-common": {
"version": "file:../common/user-common"
}
}
}
......@@ -5,7 +5,7 @@
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{
height: height + 'rpx'
height: heightString
}">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
......@@ -207,6 +207,9 @@
// 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
elCurrent() {
return Number(this.current);
},
heightString() {
return typeof this.height === 'number' && this.height !== 0 ? (this.height + 'rpx') : this.height
}
},
methods: {
......
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