Commit 78b5a4be authored by 潘永坪's avatar 潘永坪

Merge branch 'album' of http://192.168.0.204/panyongping/uni-pdtravel into album

# Conflicts:
#	pages.json
parents 51bb81c9 f46fcb81
......@@ -452,19 +452,20 @@
"navigationStyle": "custom"
}
},
// {
// "path": "getPortrait",
// "style": {
// "navigationBarTitleText": "",
// "enablePullDownRefresh": false,
// "navigationStyle": "custom"
// }
// },
{
"path": "getPortrait",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "myPhotoAlbum/myPhotoAlbum",
"style": {
"navigationBarTitleText": "我的相册",
"enablePullDownRefresh": false
"navigationBarTitleText": "我的相片",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
......@@ -501,10 +502,11 @@
},
{
"path" : "albumOrder/albumOrder",
"style" :
{
"navigationBarTitleText" : ""
"path" : "photoJigsaw/photoJigsaw",
"style": {
"navigationBarTitleText": "我的相片",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
]
......
......@@ -23,10 +23,13 @@
<view class="acquire-box acquire-boxBlue" @click="jumpToScanFaceClick">
<view class="box-title">获取相片</view>
<view class="box-text">获取拍摄相片</view>
<image class="box-img" src="./../static/album/icon02.png"></image>
</view>
<view class="acquire-box acquire-boxGreen">
<view class="box-title">相片DIY</view>
<view class="box-text">编辑手机相片</view>
<button class="acquire-input" @click="chooseImg"></button>
<image class="box-img" src="./../static/album/icon03.png"></image>
</view>
</view>
......@@ -86,37 +89,37 @@ export default {
list: [{
title: '精彩瞬间',
count: '10W+',
image: './static/album/wonderfulMoment.png',
image: './../static/album/wonderfulMoment.png',
color: '#037EFF'
},
{
title: '网红旅拍',
count: '8W+',
image: './static/album/travalphoto.png',
image: './../static/album/travalphoto.png',
color: '#826847'
},
{
title: '抱枕DIY',
count: '4W+',
image: './static/album/pillow.png',
image: './../static/album/pillow.png',
color: '#1175B4'
},
{
title: '明信片',
count: '4W+',
image: './static/album/postcard.png',
image: './../static/album/postcard.png',
color: '#3478DC'
},
{
title: '旅游台历定制',
count: '4W+',
image: './static/album/deskCalender.png',
image: './../static/album/deskCalender.png',
color: '#1A9B45'
},
{
title: '定制相册',
count: '4W+',
image: './static/album/customPic.png',
image: './../static/album/customPic.png',
color: '#D48D46'
}
],
......@@ -128,6 +131,16 @@ export default {
}
},
methods: {
chooseImg(){
uni.chooseImage({
count: 6, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths))
}
})
},
returnClick() {
uni.navigateBack({
delta: 1
......@@ -471,6 +484,27 @@ export default {
color: #A5D3FF;
line-height: 28rpx;
text-align: center;
position: relative;
z-index: 8;
}
.acquire-input{
width: 334rpx;
height: 240rpx;
opacity: 0;
position: absolute;
top: 0;
left: 0;
z-index: 19;
}
.box-img{
width: 168rpx;
height: 144rpx;
margin: auto;
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 3;
}
}
.acquire-boxBlue{
......
<template>
<view class="albumBox">
<!--头部-->
<view class="album-address">
<view class="address-left">
<view class="left-name">照片来源</view>
<view class="left-picker" @click="orderShow=true">
<i>{{cityName}}</i>
<image src="../static/album/myPhoto01.png"></image>
</view>
<u-picker mode="selector" :show="orderShow" :default-selector="[orderType]" :columns="option" keyName="areaName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
<template v-for="(item,index) in merchantList">
<view :key="index" v-if="index<2" class="left-project" :class="[projectCheck==0?'left-projectDe':'']" @click="projectClick(index,item.id)">
{{item.name}}
<i>{{previewData.length}}</i>
</view>
</template>
</view>
<view class="address-right" @click="projectMoreFun()" v-if="merchantList.length>2">
<u-icon name="more-dot-fill"></u-icon>
</view>
</view>
<!--头部更多-->
<view class="album-addressMore" v-if="projectMoreType==true">
<view class="addressMore-name" v-for="(item,index) in merchantList" :key="index" >{{item.name}}({{previewData.length}})</view>
</view>
<!--全选按钮-->
<view class="album-checkAll">
<!-- <u-checkbox v-model="checkProjectAll" @change="checkProjectAllFun()">全选</u-checkbox> -->
<view class="checkAll-all" @click="checkProjectAllFun()">
<checkbox value="val" :checked="checkProjectAll" style="transform:scale(0.7)" :class="checkProjectAll==true?'checkAll-allAct':''" />全选
</view>
<view class="checkAll-tips">未下载影像保留15天</view>
</view>
<!--主体循环-->
<view class="album-subject">
<view class="subject-List" v-for="(item,index) in previewData" :key="index" >
<image class="list-image" :src="item.faceSourceUrl||item.faceAiUrl" @click="stopPhoto(index)"></image>
<!-- <u-checkbox v-model="item.checkType" v-if="checkTypeFun==true" shape="circle" class="list-uCheck" @click.stop.native="()=>{}" @change="stopPhoto(index)"></u-checkbox> -->
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)">
<checkbox value="val" :checked="item.checkType" style="transform:scale(0.7)" class="list-uCheck" :class="item.checkType==true?'list-uCheckAct':''" />
</checkbox-group>
<view class="list-mask" @click.stop.native="()=>{}" @click="projectCheckPhoto(index)" >预览</view>
</view>
<view class="subject-noMore" v-if="previewDataType==true">暂无更多数据</view>
</view>
<!--脚部-->
<view class="album-bottom">
<view class="bottom-left" v-if="maskDetail==false">
<view class="left-oldMoney">¥{{originalPrices}}</view>
<view class="left-newMoney">¥{{sellingPrices}}</view>
<view class="left-detail" @click="maskDetail=true">
<text>明细</text>
<u-icon name="arrow-up"></u-icon>
</view>
<view class="left-num" v-if="priceNum>0">{{priceNum}}</view>
<view class="left-mask" v-if="priceNum>0">
多够更省
<view class="mask-transparent"></view>
</view>
</view>
<view class="bottom-Detail" v-if="maskDetail==true">
<view class="detail-total">合计:¥{{sellingPrices}}</view>
<view class="detail-favorable">优惠减:¥{{favorablePrice}}</view>
</view>
<view class="bottom-right">
<view class="bootom-btn" @click="toGetPortrait()">更多相片</view>
<view class="bootom-btn" @click="upLoad()">去下载</view>
</view>
</view>
<!--预览-->
<view class="album-maskPreview" v-if="maskPreviewType==true" @click="maskPreviewType=false">
<view class="maskPreview-Num">{{previewNum+1}}/{{previewData.length}}</view>
<u-swiper1 class="maskPreview-swiper" height="794" :list="previewData" :effect3d="true" :autoplay="false" :mode="none" :current ="previewNum" @change="projectNumFun" ></u-swiper1>
<view class="maskPreview-check" v-if="checkTypeFun==true">
<!-- <u-checkbox v-model="previewData[previewNum].checkType" shape="circle" class="maskPreview-Check"></u-checkbox> -->
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(previewNum)">
<checkbox value="val" :checked="previewData[previewNum].checkType" style="transform:scale(0.7)" class="maskPreview-CheckBox" :class="previewData[previewNum].checkType==true?'maskPreview-CheckBoxAct':''" />
</checkbox-group>
</view>
</view>
<!--明细-->
<view class="album-maskDetail" v-if="maskDetail==true">
<view class="maskDetail-content">
<view class="content-title">
明细
<u-icon class="title-close" name="close-circle" @click="maskDetail=false"></u-icon>
</view>
<view class="content-label">我的相片</view>
<view class="content-money">
<view class="money-name">相片</view>
<view class="money-text">{{priceNum}}*{{sellingPrice}}={{sellingPrices}}</view>
</view>
<view class="content-favorable">
<view class="favorable-name">优惠</view>
<view class="favorable-text">-¥{{favorablePrice}}</view>
</view>
</view>
</view>
<!-- <u-toast ref="uToast" /> -->
</view>
</template>
<script>
// import uPicker from '@/uview-ui/components/u-picker/u-picker.vue'
// import uCheckboxGroup from '@/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'
// import uCheckbox from '@/uview-ui/components/u-checkbox/u-checkbox'
// import uToast from '@/uview-ui/components/u-toast/u-toast.vue'
// import Uswiper from '@/uview-ui/components/u-toast/u-toast.vue'
export default {
components: {
// uPicker,
// uCheckboxGroup,
// uCheckbox,
// uToast,
// Uswiper
},
data() {
return {
companyId:'',//公司ID
background: ['color1', 'color2', 'color3'],
indicatorDots: false,
autoplay: false,
interval: 2000,
duration: 500,
faceIds: [], //查询照片ID
openid:'',
orderShow: false, //头部城市选择
option: [],//城市
cityName: '重庆',
areaId:'100500000',//城市ID
merchantId:'',//商户ID
location: {},//位置信息
projectCheck: 0, //当前选择的产品
merchantList:[],//头部列表
projectMoreType: false, //是否显示更多产品
checkProjectAll: false, //所有产品全选
maskDetail: false,
maskPreviewType:false,//遮罩预览
previewData: [ //图片预览
// {
// type: false,
// src: '../static/album/customPic.png'
// },
],
previewDataType:false,
previewNum: 0, //当前是第几张图片
checkTypeFun:true,//刷新选项
//左右滑动监听开始
startData: {
clientX: '',
clientY: '',
},
transition: '',
touch: {},
touchLeft0: -466,
touchLeft: 0,
touchRight: 0,
touchRight2: -466,
touchType: 0, //向左0++ 向右1--
//左右滑动 监听结束
originalPrice:0,//原价单价
originalPrices:0,//原价
sellingPrice:0,//售价单价
sellingPrices:0,//售价
favorablePrice:0,//优惠
priceNum:0,//选购了多少照片
merchantMessage:[],//景区基础参数
masterSlaveCouponList:[],//优惠券
}
},
onLoad(option) {
this.companyId = this.$commonjs.getCompanyId(option)||''
//this.companyId = '6da527f930be4aa1904fe17fcb41874f'
this.openid = uni.getStorageSync('openid') //获取openid
//this.openid = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ' //获取openid oroHZ5B455jLw_BqDmVpr7W13NLY
this.faceIds = JSON.parse(option.faceIds)
var locationData = {
latitude:'29.563936',
longitude:'106.589294',
}
if(uni.getStorageSync('location')!=''){
this.location = JSON.parse(uni.getStorageSync('location'))
}else{
this.location = locationData
}
this.merchantId = option.merchantId||'z0015605022691a5945bbe463141668c'// 'z0015605022691a5945bbe463141668c'
this.obtainProvince()//获取省市区
this.inquireMerchant()//查询所有商户
this.getPhotos()//照片列表
},
methods: {
mearchLoadList(){//调用参数
var merchantIds = []
merchantIds.push(this.merchantId)
this.$request('scenic/merchantExtendProject/loadList',{
merchantIds:merchantIds
}).then((res)=>{
if(res.code=='00'){
this.merchantMessage = res.data
this.checkMonkey()
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
obtainProvince(){//获取省列表
this.$request('scenic/search/loadAreaByCity',{
areaLevel:1,
inChina:0
}).then((res)=>{
if(res.code=='00'){
var opTionList = []
opTionList.push(res.data)
this.option = opTionList
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
inquireMerchant(){//查询所有商户
var data = {
id:this.merchantId,//商户ID
province:this.areaId,//省市ID
areaCode:this.areaId,//省市ID
userlatitude:this.location.latitude,//纬度
userlongitude:this.location.longitude,//经度
merchantType:1,//
}
this.$request('scenic/newMerchant/findAllMerchant',data).then((res)=>{
if(res.code=='00'){
this.merchantList = res.data
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getPhotos(){//照片
//显示加载框
uni.showLoading({
title: '加载中'
})
var data = {
faceIds:this.faceIds,//照片ID
openid:this.openid,
merchantId:this.merchantId,//商户ID
isOrder:0,//0未购 1已购
}
this.$request('wechatUser/pdFace/list',data).then((res)=>{
if(res.code=='00'){
this.previewData = res.data
if(this.previewData){
this.previewDataType = true
}else{
this.previewDataType = false
}
this.previewData.forEach((item,index)=>{
item['checkType'] = false
if(item.sellingPrice!=null){
this.originalPrice = item.originalPrice//原价.
this.sellingPrice = item.sellingPrice//售价
}
item['image']=item.faceSourceUrl||item.faceAiUrl
item['title']=''
})
this.mearchLoadList()
//隐藏加载框
uni.hideLoading()
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
industrysTypeConfirm(e) { //单列----分类 点击确定 城市
this.cityName = e.value[0].areaName
this.areaId = e.value[0].areaId
this.inquireMerchant()
this.cancel()
},
cancel() { //单列 点击取消
this.orderShow = false
},
projectClick(num,id) { //商户选择
this.projectCheck = num
this.merchantId = id
this.inquireMerchant()
},
projectCheckPhoto(index){//点击预览
this.previewNum = index
this.maskPreviewType = true
},
projectNumFun(e){//当前滑动到第几张
console.log(e)
this.previewNum = e
},
stopPhoto(index){//刷新显示
if(this.checkProjectAll==true){
this.checkProjectAll=false
}
if(this.previewData[index].checkType==false){
this.previewData[index].checkType = true
}else{
this.previewData[index].checkType = false
}
this.checkTypeFun = false
this.checkTypeFun = true
this.checkMonkey()
},
checkProjectAllFun(){//是否全选
if(this.checkProjectAll==true){
this.checkProjectAll = false
this.previewData.forEach((item,index)=>{
item.checkType = false
})
}else{
this.checkProjectAll = true
this.previewData.forEach((item,index)=>{
item.checkType = true
})
}
this.checkMonkey()
},
checkMonkey(){//明细价格计算
this.originalPrices = 0//原价
this.sellingPrices = 0//售价
this.priceNum = 0
this.previewData.forEach((item,index)=>{
if(item.checkType==true){
this.originalPrices += item.originalPrice//原价
this.sellingPrices += item.sellingPrice//售价
this.priceNum++
}
})
//金额是否达到优惠券资格
var data = {
openid:this.openid,//用户ID
money:this.sellingPrices,//当前选购金额
singleMoney:this.sellingPrices,//当前选购金额
merchantId:this.merchantMessage[0].merchantId,
tickets:1,
productId:this.merchantMessage[0].merchantExtendProjectId,
orderSource:11,//指定为相册优惠券
merchantType:11,//指定为相册
}
this.$request('wechatUser/myPage/usableCouponList',data).then((res)=>{
if(res.code=='00'){
if(res.data.masterSlaveCouponList!=undefined){
if(res.data.masterSlaveCouponList.length>0){
res.data.masterSlaveCouponList.forEach(item=>{
item['couponPrice']=item.savedMoney
})
this.masterSlaveCouponList = res.data.masterSlaveCouponList
this.favorablePrice = this.masterSlaveCouponList[0].savedMoney
this.sellingPrices = parseFloat((this.sellingPrices-this.masterSlaveCouponList[0].savedMoney).toFixed(2))
}
}
if(this.sellingPrices<0){
this.sellingPrices=0
}
if(this.originalPrices<0){
this.originalPrices=0
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
projectMoreFun() { //更多产品显示
if (this.projectMoreType == false) {
this.projectMoreType = true
} else {
this.projectMoreType = false
}
},
toGetPortrait(){//跳转面部识别
uni.navigateTo({
url: '/pages/album/getPortrait?merchantId='+this.merchantId
})
},
upLoad(){//下单
var data = {
companyId:this.companyId,//公司ID
orderMoney:this.sellingPrices,//订单总价
userId:this.openid,
orderProductVo:{},//下单信息
orderType:11,//相册TYPE值
orderProductList:[],//景区下单信息
}
// var orderProductVo = {
// buyNum:this.priceNum,//购买数量
// orderImgList:[],//订单图片
// orderType:1,//订单类型(0其他,1景区,2酒店,3餐饮,4特产,5运营车,10组合订单)
// postage:0,//邮费
// couponList:[],//产品券信息 游客使用券信息后传
// unitPrice:this.sellingPrice,//产品单价
// }
var orderProductListData = {
buyNum:this.priceNum,//购买数量
merchantId:this.merchantMessage[0].merchantId,
orderType:11,//11相册
productId:this.merchantMessage[0].merchantExtendProjectId,
productName:this.merchantMessage[0].merchantExtendProjectName,
extendContent:'',
unitPrice:this.sellingPrice,//产品单价
orderImgList:[],////订单图片
couponList:[],//券信息
}
if(this.masterSlaveCouponList.length>0){
this.masterSlaveCouponList[0]['isMerchant']=1
this.masterSlaveCouponList[0]['myCouponId']=this.masterSlaveCouponList[0].id
orderProductListData.couponList.push(this.masterSlaveCouponList[0])
}
this.previewData.forEach((item,index)=>{
if(item.checkType==true){
var imgList = {
imgUrl:item.faceSourceUrl||item.faceAiUrl,
imgType:0,
}
orderProductListData.orderImgList.push(imgList)
}
})
if(orderProductListData.orderImgList.length==0){
uni.showToast({
title: '请选择相片',
icon: 'none'
})
return false
}
var extendContentData={
openid:this.openid,
projectAddress:this.merchantMessage[0].projectAddress,
projectPhone:this.merchantMessage[0].projectPhone,
}
orderProductListData.extendContent = JSON.stringify(extendContentData)
data.orderProductList.push(orderProductListData)
//data.orderProductVo = orderProductVo
this.$request('orderc/photo/photoCreateOrder',data).then((res)=>{
if(res.code=='00'){
uni.navigateTo({
// url: `./myPhotoAlbum/myPhotoAlbum?faceIds=${JSON.stringify(res.data.faceIds)}`
url:'../../payment/orderPayment/orderPayment?orderId='+res.data.id+'&albumOrderdetail=1'
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped lang="scss">
page {
background-color: #F7F7F7;
}
.albumBox {
// 76=16 - 44 - 16 98 =34 - 32 - 32
display: flex;
flex-direction: column;
height: 100%;
background-color: #F7F7F7;
padding-bottom: 98rpx;
padding-top: 174rpx;
overflow: auto;
}
.album-address {
display: flex;
justify-content: space-between;
width: 100%;
height: 76rpx;
padding: 0 24rpx 0 24rpx;
background-color: #FFFFFF;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 20;
.address-left {
display: flex;
flex: 1;
box-shadow: inset -16px 0px 8px 0px rgba(255, 255, 255, 0.2);
position: relative;
overflow-x: auto;
.left-name {
flex-shrink: 0;
font-size: 32rpx;
color: #999999;
line-height: 76rpx;
margin-right: 48rpx
}
.left-picker {
flex-shrink:0;
display: flex;
font-size: 32rpx;
color: #333333;
line-height: 76rpx;
margin-right: 24rpx;
image {
width: 26rpx;
height: 26rpx;
margin-top: 25rpx;
margin-left: 8rpx;
}
}
/deep/ .u-popup{
position: absolute;
left: 0;
top: 0;
}
.left-project {
font-size: 32rpx;
color: #333333;
line-height: 76rpx;
margin-right: 48rpx;
position: relative;
i {
display: block;
width: 24rpx;
height: 24rpx;
font-size: 16rpx;
color: #FFFFFF;
line-height: 24rpx;
text-align: center;
background-color: #EE520E;
border-radius: 50%;
position: absolute;
top: 12rpx;
right: -24rpx;
}
}
.left-projectDe {
color: #3688FF;
font-weight: bold;
}
}
.address-right {
display: flex;
}
}
.album-address::-webkit-scrollbar {
display: none;
}
.album-addressMore {
width: 232rpx;
padding: 24rpx 24rpx 0 24rpx;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
position: fixed;
top: 76rpx;
right: 0;
z-index: 20;
.addressMore-name {
font-size: 32rpx;
color: #333333;
line-height: 44rpx;
margin-bottom: 24rpx;
}
}
.album-checkAll {
display: flex;
width: 100%;
height: 98rpx;
padding: 32rpx 24rpx 20rpx 24rpx;
overflow: hidden;
position: fixed;
top: 76rpx;
left: 0;
z-index: 20;
.checkAll-all{
font-size: 24rpx;
line-height: 46rpx;
}
.checkAll-allAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
}
}
.checkAll-tips {
font-size: 24rpx;
color: #999999;
line-height: 46rpx;
margin-left: 24rpx;
}
}
.album-subject {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
flex: 1;
padding: 0 24rpx 0 24rpx;
overflow: auto;
.subject-List {
width: 344rpx;
height: 460rpx;
margin-bottom: 24rpx;
border-radius: 16rpx;
overflow: hidden;
position: relative;
.list-image {
display: block;
width: 344rpx;
height: 460rpx;
}
.list-image::after {
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(../static/album/backgroundImg.png);
background-size: cover;
}
.list-mask {
width: 344rpx;
height: 64rpx;
background-color: rgba(0, 0, 0, 0.2);
font-size: 28rpx;
color: #fff;
line-height: 64rpx;
text-align: center;
position: absolute;
left: 0;
bottom: 0;
}
.list-uCheck {
position: absolute;
right: 0;
top: 24rpx;
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
border-radius: 100rpx;
}
}
.list-uCheckAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
}
}
/deep/ .u-checkbox__icon-wrap{
color: #fff !important;
border: 1px solid #fff;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
}
/deep/ .u-checkbox__icon-wrap--checked{
background-color: #2979ff !important;
border-color: #2979ff !important;
}
}
.subject-noMore{
width: 100%;
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
}
.album-bottom {
display: flex;
justify-content: space-between;
width: 100%;
height: 98rpx;
padding: 0 0 0 24rpx;
box-shadow: 0rpx -2rpx 8rpx 2rpx rgba(0, 0, 0, 0.08);
position: fixed;
bottom: 0;
left: 0;
z-index: 25;
.bottom-left {
flex: 1;
display: flex;
line-height: 98rpx;
.left-oldMoney {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
line-height: 110rpx;
margin-right: 8rpx;
}
.left-newMoney {
font-size: 40rpx;
color: #EE520E;
font-weight: bold;
margin-right: 38rpx;
}
.left-detail {
display: flex;
color: #333333;
margin-right: 20rpx;
text {
font-size: 28rpx;
line-height: 98rpx;
margin-right: 10rpx;
}
}
.left-num {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background-color: #EE520E;
text-align: center;
line-height: 32rpx;
font-size: 20rpx;
font-weight: bold;
color: #fff;
margin-top: 34rpx;
}
.left-mask {
width: 128rpx;
height: 48rpx;
font-size: 24rpx;
color: #FFFFFF;
line-height: 48rpx;
text-align: center;
background-color: #EE520E;
border-radius: 28rpx;
opacity: 0.5;
position: absolute;
left: 230rpx;
top: -24rpx;
z-index: 23;
.mask-transparent {
width: 0px;
height: 0px;
border: 10rpx solid transparent;
/*以下四个样式对应四种三角形,任选其一即可实现*/
border-top-color: #EE520E;
/* border-left-color:lightseagreen; */
/* border-right-color:lightseagreen; */
// border-bottom-color:lightseagreen;
position: absolute;
right: 15rpx;
bottom: -17rpx;
}
}
}
.bottom-right{
display: flex;
}
.bottom-Detail {
flex: 1;
display: flex;
flex-direction: column;
.detail-total {
font-size: 28rpx;
line-height: 40rpx;
color: 191919;
margin-bottom: 4rpx;
margin-top: 16rpx;
}
.detail-favorable {
font-size: 16rpx;
color: #FF4308;
line-height: 22rpx;
}
}
.bootom-btn {
width: 144rpx;
height: 72rpx;
background-color: #3688FF;
background: linear-gradient(90deg, #ED400C 0%, #FB862C 100%);
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 72rpx;
border-radius: 8rpx;
margin-top: 13rpx;
margin-right: 24rpx;
}
}
.album-maskDetail {
position: fixed;
top: 0;
right: 0;
bottom: 98rpx;
left: 0;
z-index: 24;
background-color: rgba(0, 0, 0, .9);
.maskDetail-content {
width: 100%;
padding: 32rpx;
background-color: #fff;
border-radius: 16rpx 16rpx 0 0;
position: fixed;
left: 0;
bottom: 98rpx;
.content-title {
width: 100%;
font-size: 36rpx;
color: #333333;
line-height: 50rpx;
margin-bottom: 38rpx;
text-align: center;
font-weight: bold;
position: relative;
.title-close {
position: absolute;
top: 8rpx;
right: 0;
}
}
.content-label {
font-size: 36rpx;
color: #191919;
font-weight: bold;
line-height: 50rpx;
margin-bottom: 32rpx;
}
.content-money {
display: flex;
justify-content: space-between;
margin-bottom: 8rpx;
.money-name {
font-size: 32rpx;
color: #191919;
line-height: 44rpx;
}
.money-text {
font-size: 32rpx;
color: #333333;
line-height: 44rpx;
font-weight: bold;
}
}
.content-favorable {
display: flex;
justify-content: space-between;
.favorable-name {
font-size: 28rpx;
color: #FC771D;
line-height: 40rpx;
}
.favorable-text {
font-size: 28rpx;
color: #FC771D;
line-height: 40rpx;
}
}
}
}
.album-maskPreview {
position: fixed;
top: 0;
right: 0;
bottom: 98rpx;
left: 0;
z-index: 22;
background-color: rgba(0, 0, 0, .9);
.maskPreview-Num {
font-size: 28rpx;
color: #FFFFFF;
line-height: 40rpx;
position: fixed;
top: 72rpx;
right: 32rpx;
}
.maskPreview-img {
display: flex;
width: 100%;
height: 794rpx;
position: fixed;
top: 152rpx;
left: 0;
.img-left {
width: 520rpx;
height: 692rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
position: absolute;
left: -466rpx;
top: 0;
bottom: 0;
z-index: 29;
}
.img-right {
width: 520rpx;
height: 692rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
position: absolute;
right: -466rpx;
top: 0;
bottom: 0;
z-index: 29;
}
.img-center {
width: 596rpx;
height: 794rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
position: absolute;
right: 0;
top: 0;
bottom: 0;
left: 0;
z-index: 30;
}
}
.maskPreview-swiper{
width: 100%;
position: fixed;
top: 152rpx;
left: 0;
}
/deep/ .u-swiper{
width: 100%;
position: fixed;
top: 152rpx;
left: 0;
}
/deep/ swiper{
background-color: rgba(0, 0, 0, 0) !important;
}
.maskPreview-check {
width: 48rpx;
height: 48rpx;
margin: auto;
position: fixed;
top: 998rpx;
left: 0;
right: 0;
.maskPreview-CheckBox{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
border-radius: 100rpx;
}
}
.maskPreview-CheckBoxAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
}
}
// /deep/ .u-checkbox__icon-wrap {
// width: 50rpx !important;
// height: 50rpx !important;
// color: #fff !important;
// border: solid 2px #fff;
// }
}
/deep/ .u-swiper-image::after {
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(../static/album/backgroundImg.png);
background-size: cover;
}
}
</style>
\ No newline at end of file
<template>
<view class="albumBox">
<!--头部-->
<view class="album-address">
<view class="address-left">
<view class="left-name">照片来源</view>
<view class="left-picker" @click="orderShow=true">
<i>{{cityName}}</i>
<image src="../static/album/myPhoto01.png"></image>
<view class="albumBox" :style="{'padding-top': albumBoxTop + 'px' }" :class="blowUpMaks==true?'albumBoxAct':''">
<!--头部 我的相片-->
<view class="nav-bar" :style="{'display': 'flex','top': statusBarHeight + 'px', 'height': navHeight + 'px','line-height': navHeight + 'px'}" v-if="blowUpMaks==false">
<u-icon name="arrow-left" color="#333" @click="returnClick"></u-icon>
我的相片
</view>
<u-picker mode="selector" :show="orderShow" :default-selector="[orderType]" :columns="option" keyName="areaName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
<template v-for="(item,index) in merchantList">
<view :key="index" v-if="index<2" class="left-project" :class="[projectCheck==0?'left-projectDe':'']" @click="projectClick(index,item.id)">
{{item.name}}
<i>{{previewData.length}}</i>
<!--头部 当前第几张 遮罩代替我的相片显示-->
<view class="nav-bar" :style="{'display': 'flex','top': statusBarHeight + 'px', 'height': navHeight + 'px','line-height': navHeight + 'px'}" v-if="blowUpMaks==true">
<u-icon name="arrow-left" color="#333" @click="blowUpMaks=false"></u-icon>
{{blowUpNumNew}}/{{pictureFrameList.length}}
</view>
</template>
<!--单张 宫格切换-->
<view class="myPhoto-title">
<view class="title-click" :class="titleclick==1?'title-clickAct':''" @click="clickActFun(1)">
单照片
<view class="click-line"></view>
</view>
<view class="address-right" @click="projectMoreFun()" v-if="merchantList.length>2">
<u-icon name="more-dot-fill"></u-icon>
<view class="title-click" :class="titleclick==2?'title-clickAct':''" @click="clickActFun(2)">
二宫格
<view class="click-line"></view>
</view>
<view class="title-click" :class="titleclick==3?'title-clickAct':''" @click="clickActFun(3)">
三宫格
<view class="click-line"></view>
</view>
<!--头部更多-->
<view class="album-addressMore" v-if="projectMoreType==true">
<view class="addressMore-name" v-for="(item,index) in merchantList" :key="index" >{{item.name}}({{previewData.length}})</view>
<view class="title-click" :class="titleclick==4?'title-clickAct':''" @click="clickActFun(4)">
六宫格
<view class="click-line"></view>
</view>
<!--全选按钮-->
<view class="album-checkAll">
<!-- <u-checkbox v-model="checkProjectAll" @change="checkProjectAllFun()">全选</u-checkbox> -->
<view class="checkAll-all" @click="checkProjectAllFun()">
<checkbox value="val" :checked="checkProjectAll" style="transform:scale(0.7)" :class="checkProjectAll==true?'checkAll-allAct':''" />全选
</view>
<view class="checkAll-tips">未下载影像保留15天</view>
<!--相框/项目切换-->
<view class="myPhoto-search" v-if="pictureFrameList.length!=0">
<view class="search-left">
<view class="left-frame" :class="frameNum==1?'left-frameAct':''" @click="frameFun(1)">金属框</view>
<view class="left-frame" :class="frameNum==2?'left-frameAct':''" @click="frameFun(2)">木框</view>
<view class="left-frame" :class="frameNum==3?'left-frameAct':''" @click="frameFun(3)">无框</view>
</view>
<!--主体循环-->
<view class="album-subject">
<view class="subject-List" v-for="(item,index) in previewData" :key="index" >
<image class="list-image" :src="item.faceSourceUrl||item.faceAiUrl" @click="stopPhoto(index)"></image>
<!-- <u-checkbox v-model="item.checkType" v-if="checkTypeFun==true" shape="circle" class="list-uCheck" @click.stop.native="()=>{}" @change="stopPhoto(index)"></u-checkbox> -->
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)">
<checkbox value="val" :checked="item.checkType" style="transform:scale(0.7)" class="list-uCheck" :class="item.checkType==true?'list-uCheckAct':''" />
</checkbox-group>
<view class="list-mask" @click.stop.native="()=>{}" @click="projectCheckPhoto(index)" >预览</view>
<view class="search-right">
<view class="right-addressClick" @click="show = true">
{{showAddress}}
<view class="address-triangle"></view>
<u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker>
</view>
<view class="subject-noMore" v-if="previewDataType==true">暂无更多数据</view>
</view>
<!--脚部-->
<view class="album-bottom">
<view class="bottom-left" v-if="maskDetail==false">
<view class="left-oldMoney">¥{{originalPrices}}</view>
<view class="left-newMoney">¥{{sellingPrices}}</view>
<view class="left-detail" @click="maskDetail=true">
<text>明细</text>
<u-icon name="arrow-up"></u-icon>
</view>
<view class="left-num" v-if="priceNum>0">{{priceNum}}</view>
<view class="left-mask" v-if="priceNum>0">
多够更省
<view class="mask-transparent"></view>
</view>
<!--相片列表-->
<view class="myPhoto-list" v-if="checkTypeFun==true" :class="bottomShow==true?'myPhoto-listAct':''">
<template v-if="titleclick==1||titleclick!=1&&pictureFrameList.length!=0">
<view class="list-pictureFrame" v-for="(item,index) in pictureFrameList" :key="index">
<image class="pictureFrame-img" :src="item.image"></image>
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)" >
<checkbox :value="item.image" :checked="item.checkType" class="pictureFrame-check" :class="item.checkType==true?'pictureFrame-checkAct':''"></checkbox>
</checkbox-group>
<view class="pictureFrame-boxTop" @click.stop="stopPhoto(index)"></view>
<view class="pictureFrame-boxBottom" @click="blowUpFun(index)"></view>
<image class="pictureFrame-blowUp" @click="blowUpFun(index)" src="../static/album/icon04.png"></image>
</view>
<view class="bottom-Detail" v-if="maskDetail==true">
<view class="detail-total">合计:¥{{sellingPrices}}</view>
<view class="detail-favorable">优惠减:¥{{favorablePrice}}</view>
</template>
<template v-else>
<view class="list-noFigure">
<image class="noFigure-img" src="../static/album/icon07.png"></image>
<view class="noFigure-text">
三宫格须先下载照片, 才能设置<text @click="clickActFun(1)">去下载</text>
</view>
<view class="bottom-right">
<view class="bootom-btn" @click="toGetPortrait()">更多相片</view>
<view class="bootom-btn" @click="upLoad()">去下载</view>
</view>
</template>
</view>
<!--预览-->
<view class="album-maskPreview" v-if="maskPreviewType==true" @click="maskPreviewType=false">
<view class="maskPreview-Num">{{previewNum+1}}/{{previewData.length}}</view>
<u-swiper1 class="maskPreview-swiper" height="794" :list="previewData" :effect3d="true" :autoplay="false" :mode="none" :current ="previewNum" @change="projectNumFun" ></u-swiper1>
<view class="maskPreview-check" v-if="checkTypeFun==true">
<!-- <u-checkbox v-model="previewData[previewNum].checkType" shape="circle" class="maskPreview-Check"></u-checkbox> -->
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(previewNum)">
<checkbox value="val" :checked="previewData[previewNum].checkType" style="transform:scale(0.7)" class="maskPreview-CheckBox" :class="previewData[previewNum].checkType==true?'maskPreview-CheckBoxAct':''" />
<!--点击放大后相片遮罩-->
<view class="myPhoto-mask" v-if="blowUpMaks==true" :style="{'top': albumBoxTop + 'px' }">
<swiper class="swiper" circular @change="projectNumFun" :current="currentNum">
<swiper-item v-for="(item,index) in pictureFrameList" :key="index">
<image :src="item.image" @click="stopPhoto(index)" :style="{'width': item.width, 'height': item.height}"></image>
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)" v-if="checkTypeFun==true">
<checkbox value="val" :checked="item.checkType" class="pictureFrame-check" :class="item.checkType==true?'pictureFrame-checkAct':''"></checkbox>
</checkbox-group>
</swiper-item>
</swiper>
</view>
<!--获取照片-->
<image v-if="pictureFrameListNum==0" class="myPhoto-getPhotos" src="../static/album/icon08.png"></image>
<!--脚部选择相片、加入购物车、直接购买-->
<view class="myPhoto-bottom" v-if="pictureFrameListNum>0">
<view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view>
<view class="bottom-feature">
<!--加入相册列表-->
<view class="feature-list">
<template v-for="(item,index) in pictureFrameList">
<view class="feature-case" v-if="item.pickerChoose==true" :key="index">
<image class="feature-img" :src="item.image"></image>
<image class="feature-close" src="../static/album/icon05.png" @click="stopPhoto(index)"></image>
</view>
</template>
</view>
<!--选中的张数、加入购物车、立即购买、开始拼图 titleclick等于1显示购物车和立即购买 等于其他 显示开始拼图 进入拼图界面-->
<view class="feature-message">
<view class="message-selectNum" v-if="titleclick==1">
已选中
<text class="selectNum-color">{{pictureFrameListNum}}张</text>
</view>
<view class="message-selectNum" v-else>
<text class="selectNum-color">最多选择{{maxChooseImg}}张</text>
</view>
<!--明细-->
<view class="album-maskDetail" v-if="maskDetail==true">
<view class="maskDetail-content">
<view class="content-title">
明细
<u-icon class="title-close" name="close-circle" @click="maskDetail=false"></u-icon>
<view class="message-trading" v-if="titleclick==1">
<view class="trading-btn trading-left">
<image src="../static/album/icon06.png"></image>
<view class="trading-num">2</view>
</view>
<view class="content-label">我的相片</view>
<view class="content-money">
<view class="money-name">相片</view>
<view class="money-text">{{priceNum}}*{{sellingPrice}}={{sellingPrices}}</view>
<view class="trading-btn trading-right">购买</view>
</view>
<view class="content-favorable">
<view class="favorable-name">优惠</view>
<view class="favorable-text">-¥{{favorablePrice}}</view>
<view class="message-jigsaw" v-else>开始拼图</view>
</view>
</view>
</view>
<!-- <u-toast ref="uToast" /> -->
</view>
</template>
<script>
// import uPicker from '@/uview-ui/components/u-picker/u-picker.vue'
// import uCheckboxGroup from '@/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'
// import uCheckbox from '@/uview-ui/components/u-checkbox/u-checkbox'
// import uToast from '@/uview-ui/components/u-toast/u-toast.vue'
// import Uswiper from '@/uview-ui/components/u-toast/u-toast.vue'
export default {
components: {
// uPicker,
// uCheckboxGroup,
// uCheckbox,
// uToast,
// Uswiper
},
data() {
return {
companyId:'',//公司ID
background: ['color1', 'color2', 'color3'],
indicatorDots: false,
autoplay: false,
interval: 2000,
duration: 500,
faceIds: [], //查询照片ID
openid:'',
orderShow: false, //头部城市选择
option: [],//城市
cityName: '重庆',
areaId:'100500000',//城市ID
merchantId:'',//商户ID
location: {},//位置信息
projectCheck: 0, //当前选择的产品
merchantList:[],//头部列表
projectMoreType: false, //是否显示更多产品
checkProjectAll: false, //所有产品全选
maskDetail: false,
maskPreviewType:false,//遮罩预览
previewData: [ //图片预览
// {
// type: false,
// src: '../static/album/customPic.png'
// },
titleclick:1,//1单照片 2二宫格 3三宫格 4六宫格
frameNum:1,//相框选择参数
show: false,//遮罩显隐---项目
columns: [//遮罩列表---项目
[{
label: '雪月夜1',
// 其他属性值
id: 2021
// ...
}, {
label: '冷夜雨2',
id: 804
}, {
label: '冷夜雨3',
id: 804
}, {
label: '冷夜雨4',
id: 804
}, {
label: '冷夜雨5',
id: 804
}, {
label: '冷夜雨6',
id: 804
}, {
label: '冷夜雨7',
id: 804
}, {
label: '冷夜雨8',
id: 804
}]
],
previewDataType:false,
previewNum: 0, //当前是第几张图片
checkTypeFun:true,//刷新选项
//左右滑动监听开始
startData: {
clientX: '',
clientY: '',
showAddress:'重庆',//显示内容---项目
pictureFrameList:[
{
image:'https://img1.baidu.com/it/u=1360904074,3378535006&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1427',
checkType:false,
pickerChoose:false,
},
{
image:'https://i1.hdslb.com/bfs/archive/34961798a6c8fa26348499483fc16e48831af85d.jpg',
checkType:false,
pickerChoose:false,
},
{
image:'https://img1.baidu.com/it/u=2652134479,594912468&fm=253&fmt=auto&app=138&f=JPEG?w=878&h=493',
checkType:false,
pickerChoose:false,
},
{
image:'https://img0.baidu.com/it/u=2602636891,3687528369&fm=253&fmt=auto&app=120&f=JPEG?w=1087&h=612',
checkType:false,
pickerChoose:false,
},
{
image:'https://img2.baidu.com/it/u=635571518,763366960&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1131',
checkType:false,
pickerChoose:false,
},
transition: '',
touch: {},
touchLeft0: -466,
touchLeft: 0,
touchRight: 0,
touchRight2: -466,
touchType: 0, //向左0++ 向右1--
//左右滑动 监听结束
originalPrice:0,//原价单价
originalPrices:0,//原价
sellingPrice:0,//售价单价
sellingPrices:0,//售价
favorablePrice:0,//优惠
priceNum:0,//选购了多少照片
merchantMessage:[],//景区基础参数
masterSlaveCouponList:[],//优惠券
],
checkTypeFun:true,//刷新选项
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
blowUpMaks:false,//放大显示的遮罩
blowUpNumNew:0,//当前的位置
currentNum:0,//当前所在滑块的 index
bottomShow:false,//脚部的显隐
pictureFrameListNum:0,//当前选择了多少张
maxChooseImg:0,//最多选择多少张
}
},
onLoad(option) {
this.companyId = this.$commonjs.getCompanyId(option)||''
//this.companyId = '6da527f930be4aa1904fe17fcb41874f'
this.openid = uni.getStorageSync('openid') //获取openid
//this.openid = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ' //获取openid oroHZ5B455jLw_BqDmVpr7W13NLY
this.faceIds = JSON.parse(option.faceIds)
var locationData = {
latitude:'29.563936',
longitude:'106.589294',
}
if(uni.getStorageSync('location')!=''){
this.location = JSON.parse(uni.getStorageSync('location'))
this.pictureFrameList.forEach(item=>{//判断每一张图片的宽高,根据宽高设置图片大小
//await
let imageInfoObj = uni.getImageInfo({
src: item.image,
success: function (imageInfo) {
if(imageInfo.height>imageInfo.width){
item['width'] = '680rpx'
item['height'] = '956rpx'
}else{
this.location = locationData
item['width'] = '680rpx'
item['height'] = '510rpx'
}
this.merchantId = option.merchantId||'z0015605022691a5945bbe463141668c'// 'z0015605022691a5945bbe463141668c'
this.obtainProvince()//获取省市区
this.inquireMerchant()//查询所有商户
this.getPhotos()//照片列表
},
methods: {
mearchLoadList(){//调用参数
var merchantIds = []
merchantIds.push(this.merchantId)
this.$request('scenic/merchantExtendProject/loadList',{
merchantIds:merchantIds
}).then((res)=>{
if(res.code=='00'){
this.merchantMessage = res.data
this.checkMonkey()
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
fail: function (error) {
console.error(error)
// 获取图片信息失败后的操作
}
})
},
obtainProvince(){//获取省列表
this.$request('scenic/search/loadAreaByCity',{
areaLevel:1,
inChina:0
}).then((res)=>{
if(res.code=='00'){
var opTionList = []
opTionList.push(res.data)
this.option = opTionList
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
this.recordDeviceInfo()
},
inquireMerchant(){//查询所有商户
var data = {
id:this.merchantId,//商户ID
province:this.areaId,//省市ID
areaCode:this.areaId,//省市ID
userlatitude:this.location.latitude,//纬度
userlongitude:this.location.longitude,//经度
merchantType:1,//
}
this.$request('scenic/newMerchant/findAllMerchant',data).then((res)=>{
if(res.code=='00'){
this.merchantList = res.data
}else{
uni.showToast({
title: res.message,
icon: 'none'
methods: {
clickActFun(num){//宫格选择
this.checkTypeFun = false
this.titleclick = num
this.pictureFrameList.forEach(item=>{
item.checkType = false
item.pickerChoose = false
})
this.pictureFrameListNum = 0
if(this.titleclick==2){
this.maxChooseImg = 2
}else if(this.titleclick==3){
this.maxChooseImg = 3
}else if(this.titleclick==4){
this.maxChooseImg = 6
}
})
this.checkTypeFun = true
},
getPhotos(){//照片
//显示加载框
uni.showLoading({
title: '加载中'
})
var data = {
faceIds:this.faceIds,//照片ID
openid:this.openid,
merchantId:this.merchantId,//商户ID
isOrder:0,//0未购 1已购
}
this.$request('wechatUser/pdFace/list',data).then((res)=>{
if(res.code=='00'){
this.previewData = res.data
if(this.previewData){
this.previewDataType = true
}else{
this.previewDataType = false
}
this.previewData.forEach((item,index)=>{
item['checkType'] = false
if(item.sellingPrice!=null){
this.originalPrice = item.originalPrice//原价.
this.sellingPrice = item.sellingPrice//售价
}
item['image']=item.faceSourceUrl||item.faceAiUrl
item['title']=''
frameFun(num){//相框选择
this.frameNum = num
},
addressFun(e){//项目选择
this.showAddress = e.value[0].label
this.show=false
},
stopPhoto(index){//相片选择
this.checkTypeFun = false
if(this.titleclick==1||this.titleclick!=1&&this.pictureFrameListNum<this.maxChooseImg||this.titleclick!=1&&this.pictureFrameListNum==this.maxChooseImg&&this.pictureFrameList[index].checkType == true){//+this.maxChooseImg+
this.stopPhotoNumFun(index)
}else if(this.titleclick!=1&&this.pictureFrameListNum>=this.maxChooseImg){
this.pictureFrameList[index].checkType = true
this.$nextTick(function() {
this.pictureFrameList[index].checkType = false
})
this.mearchLoadList()
//隐藏加载框
uni.hideLoading()
}else{
uni.showToast({
title: res.message,
icon: 'none'
title: '最多选择'+this.maxChooseImg+'张',
icon:'error',
duration: 2000
})
}
})
},
industrysTypeConfirm(e) { //单列----分类 点击确定 城市
this.cityName = e.value[0].areaName
this.areaId = e.value[0].areaId
this.inquireMerchant()
this.cancel()
},
cancel() { //单列 点击取消
this.orderShow = false
},
projectClick(num,id) { //商户选择
this.projectCheck = num
this.merchantId = id
this.inquireMerchant()
},
projectCheckPhoto(index){//点击预览
this.previewNum = index
this.maskPreviewType = true
},
projectNumFun(e){//当前滑动到第几张
console.log(e)
this.previewNum = e
},
stopPhoto(index){//刷新显示
if(this.checkProjectAll==true){
this.checkProjectAll=false
}
if(this.previewData[index].checkType==false){
this.previewData[index].checkType = true
}else{
this.previewData[index].checkType = false
if(this.pictureFrameListNum>0){
this.bottomShow = true
}
this.checkTypeFun = false
this.checkTypeFun = true
this.checkMonkey()
},
checkProjectAllFun(){//是否全选
if(this.checkProjectAll==true){
this.checkProjectAll = false
this.previewData.forEach((item,index)=>{
item.checkType = false
})
stopPhotoNumFun(index){//相片选择开关
if(this.pictureFrameList[index].checkType==false){
this.pictureFrameList[index].checkType = true
this.pictureFrameList[index].pickerChoose = true
}else{
this.checkProjectAll = true
this.previewData.forEach((item,index)=>{
item.checkType = true
})
this.pictureFrameList[index].checkType = false
this.pictureFrameList[index].pickerChoose = false
}
this.checkMonkey()
},
checkMonkey(){//明细价格计算
this.originalPrices = 0//原价
this.sellingPrices = 0//售价
this.priceNum = 0
this.previewData.forEach((item,index)=>{
this.pictureFrameListNum = 0
this.pictureFrameList.forEach(item=>{//判断 是否有照片被选择
if(item.checkType==true){
this.originalPrices += item.originalPrice//原价
this.sellingPrices += item.sellingPrice//售价
this.priceNum++
}
})
//金额是否达到优惠券资格
var data = {
openid:this.openid,//用户ID
money:this.sellingPrices,//当前选购金额
singleMoney:this.sellingPrices,//当前选购金额
merchantId:this.merchantMessage[0].merchantId,
tickets:1,
productId:this.merchantMessage[0].merchantExtendProjectId,
orderSource:11,//指定为相册优惠券
merchantType:11,//指定为相册
}
this.$request('wechatUser/myPage/usableCouponList',data).then((res)=>{
if(res.code=='00'){
if(res.data.masterSlaveCouponList!=undefined){
if(res.data.masterSlaveCouponList.length>0){
res.data.masterSlaveCouponList.forEach(item=>{
item['couponPrice']=item.savedMoney
})
this.masterSlaveCouponList = res.data.masterSlaveCouponList
this.favorablePrice = this.masterSlaveCouponList[0].savedMoney
this.sellingPrices = parseFloat((this.sellingPrices-this.masterSlaveCouponList[0].savedMoney).toFixed(2))
}
}
if(this.sellingPrices<0){
this.sellingPrices=0
}
if(this.originalPrices<0){
this.originalPrices=0
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
this.pictureFrameListNum +=1
}
})
},
projectMoreFun() { //更多产品显示
if (this.projectMoreType == false) {
this.projectMoreType = true
} else {
this.projectMoreType = false
}
blowUpFun(index){//相片放大 遮罩显隐
this.blowUpMaks = true
this.blowUpNumNew = index+1
this.currentNum = index
},
toGetPortrait(){//跳转面部识别
uni.navigateTo({
url: '/pages/album/getPortrait?merchantId='+this.merchantId
})
projectNumFun(e){//当前滑动到第几张
this.blowUpNumNew = e.target.current+1
},
upLoad(){//下单
var data = {
companyId:this.companyId,//公司ID
orderMoney:this.sellingPrices,//订单总价
userId:this.openid,
orderProductVo:{},//下单信息
orderType:11,//相册TYPE值
orderProductList:[],//景区下单信息
}
// var orderProductVo = {
// buyNum:this.priceNum,//购买数量
// orderImgList:[],//订单图片
// orderType:1,//订单类型(0其他,1景区,2酒店,3餐饮,4特产,5运营车,10组合订单)
// postage:0,//邮费
// couponList:[],//产品券信息 游客使用券信息后传
// unitPrice:this.sellingPrice,//产品单价
// }
var orderProductListData = {
buyNum:this.priceNum,//购买数量
merchantId:this.merchantMessage[0].merchantId,
orderType:11,//11相册
productId:this.merchantMessage[0].merchantExtendProjectId,
productName:this.merchantMessage[0].merchantExtendProjectName,
extendContent:'',
unitPrice:this.sellingPrice,//产品单价
orderImgList:[],////订单图片
couponList:[],//券信息
}
if(this.masterSlaveCouponList.length>0){
this.masterSlaveCouponList[0]['isMerchant']=1
this.masterSlaveCouponList[0]['myCouponId']=this.masterSlaveCouponList[0].id
orderProductListData.couponList.push(this.masterSlaveCouponList[0])
}
this.previewData.forEach((item,index)=>{
if(item.checkType==true){
var imgList = {
imgUrl:item.faceSourceUrl||item.faceAiUrl,
imgType:0,
}
orderProductListData.orderImgList.push(imgList)
}
})
if(orderProductListData.orderImgList.length==0){
uni.showToast({
title: '请选择相片',
icon: 'none'
})
return false
}
var extendContentData={
openid:this.openid,
projectAddress:this.merchantMessage[0].projectAddress,
projectPhone:this.merchantMessage[0].projectPhone,
}
orderProductListData.extendContent = JSON.stringify(extendContentData)
data.orderProductList.push(orderProductListData)
//data.orderProductVo = orderProductVo
this.$request('orderc/photo/photoCreateOrder',data).then((res)=>{
if(res.code=='00'){
uni.navigateTo({
// url: `./myPhotoAlbum/myPhotoAlbum?faceIds=${JSON.stringify(res.data.faceIds)}`
url:'../../payment/orderPayment/orderPayment?orderId='+res.data.id+'&albumOrderdetail=1'
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.navHeight = (this.capsule.top - this.statusBarHeight) * 2 + this.capsule.height // 导航栏高度
this.albumBoxTop = this.statusBarHeight+this.navHeight
},
returnClick() {//头部 点击返回
uni.navigateBack({
delta: 1
})
},
}
......@@ -478,563 +308,390 @@ export default {
</script>
<style scoped lang="scss">
page {
background-color: #F7F7F7;
}
.albumBox {
// 76=16 - 44 - 16 98 =34 - 32 - 32
.albumBox{
display: flex;
flex-direction: column;
height: 100%;
background-color: #F7F7F7;
padding-bottom: 98rpx;
padding-top: 174rpx;
overflow: auto;
flex-direction:column;
height: 100vh;
background-color: #fff;
}
.album-address {
display: flex;
justify-content: space-between;
.albumBoxAct{
background-color: #F5F7FA;
}
.nav-bar {
width: 100%;
height: 76rpx;
justify-content:center;
font-size: 36rpx;
font-weight: 700;
padding: 0 24rpx 0 24rpx;
background-color: #FFFFFF;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
overflow: hidden;
position: fixed;
top: 0;
left: 0;
z-index: 20;
.address-left {
display: flex;
flex: 1;
box-shadow: inset -16px 0px 8px 0px rgba(255, 255, 255, 0.2);
position: relative;
overflow-x: auto;
.left-name {
flex-shrink: 0;
font-size: 32rpx;
color: #999999;
line-height: 76rpx;
margin-right: 48rpx
}
.left-picker {
flex-shrink:0;
display: flex;
font-size: 32rpx;
color: #333333;
line-height: 76rpx;
margin-right: 24rpx;
image {
width: 26rpx;
height: 26rpx;
margin-top: 25rpx;
margin-left: 8rpx;
z-index: 10;
/deep/ .u-icon{
margin: auto;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
}
}
/deep/ .u-popup{
.myPhoto-title{
width: 100%;
height: 100rpx;
padding: 32rpx 60rpx 0 60rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
.title-click{
height: 68rpx;
font-weight: 600;
font-size: 28rpx;
color: #999999;
line-height: 28rpx;
position: relative;
.click-line{
display: none;
width: 100%;
height: 6rpx;
background: #000000;
border-radius: 4rpx;
position: absolute;
bottom: 18rpx;
left: 0;
top: 0;
}
.left-project {
font-size: 32rpx;
}
.title-clickAct{
font-size: 30rpx;
color: #333333;
line-height: 76rpx;
margin-right: 48rpx;
position: relative;
i {
.click-line{
display: block;
width: 24rpx;
height: 24rpx;
font-size: 16rpx;
color: #FFFFFF;
line-height: 24rpx;
text-align: center;
background-color: #EE520E;
border-radius: 50%;
position: absolute;
top: 12rpx;
right: -24rpx;
}
}
.left-projectDe {
color: #3688FF;
font-weight: bold;
}
}
.address-right {
.myPhoto-search{
display: flex;
}
}
.album-address::-webkit-scrollbar {
display: none;
justify-content: space-between;
width: 100%;
height: 102rpx;
padding: 20rpx 24rpx 0 24rpx;
background: #F5F7FA;
.search-left{
display: flex;
.left-frame{
font-size: 24rpx;
color: #666666;
line-height: 64rpx;
padding: 0 20rpx 0 20rpx;
}
.album-addressMore {
width: 232rpx;
padding: 24rpx 24rpx 0 24rpx;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
position: fixed;
top: 76rpx;
right: 0;
z-index: 20;
.addressMore-name {
font-size: 32rpx;
.left-frameAct{
width: 160rpx;
height: 64rpx;
padding:0;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 44rpx;
margin-bottom: 24rpx;
line-height: 60rpx;
text-align: center;
background: #E6E9F4;
border-radius: 8rpx;
border: 2rpx solid #DAE0EB;
}
}
.album-checkAll {
.search-right{
display: flex;
width: 100%;
height: 98rpx;
padding: 32rpx 24rpx 20rpx 24rpx;
overflow: hidden;
position: fixed;
top: 76rpx;
left: 0;
z-index: 20;
.checkAll-all{
.right-addressClick{
display: flex;
font-weight: 600;
font-size: 24rpx;
line-height: 46rpx;
}
.checkAll-allAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
color: #333333;
line-height: 64rpx;
position: relative;
.address-triangle{
width: 0px;
height: 0px;
margin: auto;
margin-left: 12rpx;
border: 10rpx solid transparent;
border-top: 10rpx solid #D8D8D8;
}
}
.checkAll-tips {
font-size: 24rpx;
color: #999999;
line-height: 46rpx;
margin-left: 24rpx;
}
}
.album-subject {
.myPhoto-list{
flex: 1;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
flex: 1;
padding: 0 24rpx 0 24rpx;
align-content:flex-start;
background-color: #F5F7FA;
overflow: auto;
.subject-List {
width: 344rpx;
height: 460rpx;
margin-bottom: 24rpx;
border-radius: 16rpx;
overflow: hidden;
position: relative;
.list-image {
display: block;
width: 344rpx;
height: 460rpx;
.list-pictureFrame{
height: 248rpx;
margin-bottom: 4rpx;
position: relative;
.pictureFrame-img{
width: 248rpx;
height: 248rpx;
}
.list-image::after {
content: "";
display: block;
.pictureFrame-check{
width: 32rpx;
height: 32rpx;
background: transparent;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(../static/album/backgroundImg.png);
background-size: cover;
top: 24rpx;
left: 192rpx;
z-index: 9;
/deep/ .wx-checkbox-input{
width: 32rpx;
height: 32rpx;
background: rgba(255,255,255,0.5);//transparent;
border: 2rpx solid #C7C7C7;
}
.list-mask {
width: 344rpx;
height: 64rpx;
background-color: rgba(0, 0, 0, 0.2);
font-size: 28rpx;
color: #fff;
line-height: 64rpx;
text-align: center;
position: absolute;
left: 0;
bottom: 0;
/deep/ .wx-checkbox-input.wx-checkbox-input-checked {
background: #FE6600; // 选中的颜色
}
.list-uCheck {
position: absolute;
right: 0;
top: 24rpx;
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
border-radius: 100rpx;
/deep/ .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff; // 选中后的图标默认是对号,这里吧对号变成透明颜色,就看不出来了
}
}
.pictureFrame-checkAct{
/deep/ .wx-checkbox-input{
border: solid 1px #FE6600;
}
}
.list-uCheckAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
.pictureFrame-blowUp{
width: 32rpx;
height: 32rpx;
position: absolute;
bottom: 24rpx;
left: 192rpx;
z-index: 9;
}
.pictureFrame-boxTop,
.pictureFrame-boxBottom{
width: 248rpx;
height: 124rpx;
position: absolute;
left: 0;
z-index: 5;
}
.pictureFrame-boxTop{
top: 0;
}
/deep/ .u-checkbox__icon-wrap{
color: #fff !important;
border: 1px solid #fff;
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
.pictureFrame-boxBottom{
bottom: 0;
}
/deep/ .u-checkbox__icon-wrap--checked{
background-color: #2979ff !important;
border-color: #2979ff !important;
}
.list-pictureFrame:nth-last-child(1){
flex: 1;
}
.subject-noMore{
.list-noFigure{
width: 100%;
height: 40rpx;
height: 456rpx;
margin: auto;
position: absolute;
top: 0;
bottom: 0;
left: 0;
.noFigure-img{
display: block;
width: 400rpx;
height: 400rpx;
margin: 0 auto;
}
.noFigure-text{
margin-top: 20rpx;
font-weight: 400;
font-size: 26rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
line-height: 36rpx;
text-align: center;
text{
color: #165DFF;
margin-left: 10rpx;
}
}
.album-bottom {
display: flex;
justify-content: space-between;
}
}
.myPhoto-listAct{
padding-bottom: 320rpx;
}
.myPhoto-mask{
width: 100%;
height: 98rpx;
padding: 0 0 0 24rpx;
box-shadow: 0rpx -2rpx 8rpx 2rpx rgba(0, 0, 0, 0.08);
height: 100%;
background: #F5F7FA;
position: fixed;
bottom: 0;
left: 0;
z-index: 25;
.bottom-left {
flex: 1;
z-index: 10;
.swiper{
width: 680rpx;
height: 956rpx;//510rpx
margin: 0 auto;
background: #F5F7FA;
margin-top: 80rpx;
/deep/ swiper-item{
display: flex;
line-height: 98rpx;
.left-oldMoney {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
line-height: 110rpx;
margin-right: 8rpx;
}
.left-newMoney {
font-size: 40rpx;
color: #EE520E;
font-weight: bold;
margin-right: 38rpx;
}
.left-detail {
display: flex;
color: #333333;
margin-right: 20rpx;
text {
font-size: 28rpx;
line-height: 98rpx;
margin-right: 10rpx;
align-items:center;
}
}
.left-num {
.pictureFrame-check{
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background-color: #EE520E;
text-align: center;
line-height: 32rpx;
font-size: 20rpx;
font-weight: bold;
color: #fff;
margin-top: 34rpx;
}
.left-mask {
width: 128rpx;
height: 48rpx;
font-size: 24rpx;
color: #FFFFFF;
line-height: 48rpx;
text-align: center;
background-color: #EE520E;
border-radius: 28rpx;
opacity: 0.5;
background: transparent;
position: absolute;
left: 230rpx;
top: -24rpx;
z-index: 23;
.mask-transparent {
width: 0px;
height: 0px;
border: 10rpx solid transparent;
/*以下四个样式对应四种三角形,任选其一即可实现*/
border-top-color: #EE520E;
/* border-left-color:lightseagreen; */
/* border-right-color:lightseagreen; */
// border-bottom-color:lightseagreen;
position: absolute;
right: 15rpx;
bottom: -17rpx;
}
right: 56rpx;
bottom: 60rpx;
z-index: 11;
/deep/ .wx-checkbox-input{
width: 32rpx;
height: 32rpx;
background: rgba(255,255,255,0.5);//transparent;
border: 2rpx solid #C7C7C7;
}
/deep/ .wx-checkbox-input.wx-checkbox-input-checked {
background: #FE6600; // 选中的颜色
}
.bottom-right{
display: flex;
/deep/ .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff; // 选中后的图标默认是对号,这里吧对号变成透明颜色,就看不出来了
}
.bottom-Detail {
flex: 1;
display: flex;
flex-direction: column;
.detail-total {
font-size: 28rpx;
line-height: 40rpx;
color: 191919;
margin-bottom: 4rpx;
margin-top: 16rpx;
}
.detail-favorable {
font-size: 16rpx;
color: #FF4308;
line-height: 22rpx;
.pictureFrame-checkAct{
/deep/ .wx-checkbox-input{
border: solid 1px #FE6600;
}
}
.bootom-btn {
width: 144rpx;
height: 72rpx;
background-color: #3688FF;
background: linear-gradient(90deg, #ED400C 0%, #FB862C 100%);
font-size: 28rpx;
color: #fff;
text-align: center;
line-height: 72rpx;
border-radius: 8rpx;
margin-top: 13rpx;
margin-right: 24rpx;
}
}
.album-maskDetail {
.myPhoto-bottom{
width: 100%;
height: 314rpx;
position: fixed;
top: 0;
right: 0;
bottom: 98rpx;
left: 0;
z-index: 24;
background-color: rgba(0, 0, 0, .9);
.maskDetail-content {
bottom: 0;
z-index: 30;
.bottom-tips{
width: 726rpx;
height: 64rpx;
background: #FFF6E8;
border-radius: 8rpx 8rpx 0rpx 0rpx;
border: 2rpx solid #FE6600;
box-sizing: border-box;
font-weight: 400;
font-size: 24rpx;
color: #FE6600;
text-align: center;
line-height: 60rpx;
margin: 0 auto;
}
.bottom-feature{
width: 100%;
padding: 32rpx;
height: 250rpx;
background-color: #fff;
border-radius: 16rpx 16rpx 0 0;
position: fixed;
left: 0;
bottom: 98rpx;
.content-title {
padding: 20rpx 24rpx 0 24rpx;
.feature-list{
display: flex;
width: 100%;
font-size: 36rpx;
color: #333333;
line-height: 50rpx;
margin-bottom: 38rpx;
text-align: center;
font-weight: bold;
overflow: auto;
}
.feature-case{
width: 142rpx;
height: 142rpx;
padding: 10rpx 10rpx 0 0;
margin-right: 15rpx;
position: relative;
.title-close {
.feature-img{
width: 132rpx;
height: 132rpx;
}
.feature-close{
width: 32rpx;
height: 32rpx;
position: absolute;
top: 8rpx;
top: 0;
right: 0;
}
}
.content-label {
font-size: 36rpx;
color: #191919;
font-weight: bold;
line-height: 50rpx;
margin-bottom: 32rpx;
}
.content-money {
.feature-message{
display: flex;
justify-content: space-between;
margin-bottom: 8rpx;
.money-name {
font-size: 32rpx;
color: #191919;
line-height: 44rpx;
}
.money-text {
font-size: 32rpx;
height: 64rpx;
margin-top: 6rpx;
.message-selectNum{
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 64rpx;
.selectNum-color{
color: #333333;
line-height: 44rpx;
font-weight: bold;
}
}
.content-favorable {
display: flex;
justify-content: space-between;
.favorable-name {
font-size: 28rpx;
color: #FC771D;
line-height: 40rpx;
}
.favorable-text {
font-size: 28rpx;
color: #FC771D;
line-height: 40rpx;
margin-left: 10rpx;
}
}
}
}
.album-maskPreview {
position: fixed;
top: 0;
right: 0;
bottom: 98rpx;
left: 0;
z-index: 22;
background-color: rgba(0, 0, 0, .9);
.maskPreview-Num {
font-size: 28rpx;
color: #FFFFFF;
line-height: 40rpx;
position: fixed;
top: 72rpx;
right: 32rpx;
}
.maskPreview-img {
.message-trading{
display: flex;
width: 100%;
height: 794rpx;
position: fixed;
top: 152rpx;
left: 0;
.img-left {
width: 520rpx;
height: 692rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
position: absolute;
left: -466rpx;
top: 0;
bottom: 0;
z-index: 29;
position: relative;
.trading-btn{
width: 160rpx;
height: 64rpx;
position: relative;
}
.img-right {
width: 520rpx;
height: 692rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
.trading-left{
background: #FF9F43;
border-radius: 200rpx 0rpx 0rpx 200rpx;
image{
width: 40rpx;
height: 40rpx;
margin: auto;
position: absolute;
right: -466rpx;
top: 0;
bottom: 0;
z-index: 29;
}
.img-center {
width: 596rpx;
height: 794rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
position: absolute;
right: 0;
top: 0;
bottom: 0;
left: 0;
z-index: 30;
}
}
.maskPreview-swiper{
width: 100%;
position: fixed;
top: 152rpx;
left: 0;
}
/deep/ .u-swiper{
width: 100%;
position: fixed;
top: 152rpx;
left: 0;
.trading-num{
width: 42rpx;
height: 44rpx;
border-radius: 50%;
background: #FFFFFF;
line-height: 44rpx;
text-align: center;
font-weight: bold;
font-size: 28rpx;
color: #FE6600;
position: absolute;
right: 12rpx;
top: -22rpx;
}
/deep/ swiper{
background-color: rgba(0, 0, 0, 0) !important;
.trading-right{
background: #FE6600;
border-radius: 0rpx 200rpx 200rpx 0rpx;
text-align: center;
line-height: 64rpx;
font-size: 28rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF;
}
.maskPreview-check {
width: 48rpx;
height: 48rpx;
margin: auto;
position: fixed;
top: 998rpx;
left: 0;
right: 0;
.maskPreview-CheckBox{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
border-radius: 100rpx;
}
.message-jigsaw{
width: 160rpx;
height: 64rpx;
background: #FE6600;
border-radius: 32rpx;
font-weight: bold;
font-size: 28rpx;
color: #FFFFFF;
line-height: 64rpx;
text-align: center;
}
.maskPreview-CheckBoxAct{
/deep/ .wx-checkbox-input,
/deep/ .uni-checkbox-input{
background-color: #3688FF !important;
border-color: #3688FF !important;
color: #ffffff !important;
}
}
// /deep/ .u-checkbox__icon-wrap {
// width: 50rpx !important;
// height: 50rpx !important;
// color: #fff !important;
// border: solid 2px #fff;
// }
}
/deep/ .u-swiper-image::after {
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(../static/album/backgroundImg.png);
background-size: cover;
}
.myPhoto-getPhotos{
width: 174rpx;
height: 174rpx;
position: fixed;
right: 32rpx;
bottom: 58rpx;
}
</style>
\ No newline at end of file
<template>
<view class="albumBox" :style="{'padding-top': albumBoxTop + 'px' }">
<!--头部 我的相片-->
<view class="nav-bar" :style="{'display': 'flex','top': statusBarHeight + 'px', 'height': navHeight + 'px','line-height': navHeight + 'px'}">
<u-icon name="arrow-left" color="#333" @click="returnClick"></u-icon>
我的相片
</view>
<!--图片拼图-->
<view class="jigsaw-picture">
<image class="picture-backgrounImg" src="https://i2.hdslb.com/bfs/archive/bd7dfae552d4ff42e113a5b5a931d4ab2c225388.jpg"></image>
<template v-for="(item,index) in pictureJigsawPosition">
<view class="picture-position" :key="index" @drop="dropFun(event)" @dragover="allowDrag(event)" :style="{'width': item.width + 'rpx' ,'height': item.height + 'rpx' ,'top': item.top + 'rpx' ,'left': item.left + 'rpx' ,'border-radius': item.radius + 'rpx' ,}">
<image :src="item.url" draggable="true" @dragstart="dragFun(event)"></image>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
pictureJigsawPosition:[//图片框位置
{
url:'https://img2.baidu.com/it/u=1213138858,1241586936&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1153',
width:'300',
height:'500',
top:'200',
left:'24',
radius:'50'
},
{
url:'https://i0.hdslb.com/bfs/archive/4d063c42bb8d738f7be5e5a575a6dd19106c1c7d.jpg',
width:'400',
height:'200',
top:'200',
left:'340',
radius:'8'
},
{
url:'https://img2.baidu.com/it/u=1268701741,4039580892&fm=253&fmt=auto&app=120&f=JPEG?w=889&h=500',
width:'400',
height:'200',
top:'460',
left:'340',
radius:'16'
},
],
}
},
onLoad(option) {
this.recordDeviceInfo()//记录设备信息
},
methods: {
recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.navHeight = (this.capsule.top - this.statusBarHeight) * 2 + this.capsule.height // 导航栏高度
this.albumBoxTop = this.statusBarHeight+this.navHeight
},
returnClick() {//头部 点击返回
uni.navigateBack({
delta: 1
})
},
//图片拖动
allowDrag(ev){
console.log('123')
ev.preventDefault()
},
dragFun(ev){
console.log('456')
ev.dataTransfer.setData('Text',ev.target.id)
},
dropFun(ev){
console.log('789')
ev.preventDefault()
var data = ev.dataTransfer.getData('Text')
ev.target.appendChild(document.getElementById(data))
},
}
}
</script>
<style scoped lang="scss">
.albumBox{
display: flex;
flex-direction:column;
height: 100vh;
background-color: #fff;
}
.nav-bar {
width: 100%;
justify-content:center;
font-size: 36rpx;
font-weight: 700;
padding: 0 24rpx 0 24rpx;
position: fixed;
top: 0;
left: 0;
z-index: 10;
/deep/ .u-icon{
margin: auto;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
}
}
.jigsaw-picture{
width: 750rpx;
height: 1100rpx;
margin-top: 86rpx;
position: relative;
.picture-backgrounImg{
width: 750rpx;
height: 1100rpx;
}
.picture-position{
border:solid 1px #333333;
overflow: auto;
position: absolute;
}
}
</style>
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