Commit 924a9d2a authored by qipeng's avatar qipeng

已购买 相册页面

parent 0bb0f389
......@@ -371,6 +371,15 @@
"enablePullDownRefresh": false
}
}
,{
"path" : "purchasedPhotoAlbum/purchasedPhotoAlbum",
"style" :
{
"navigationBarTitleText": "我的影集",
"enablePullDownRefresh": false
}
}
]
}
......
......@@ -30,7 +30,7 @@
<!--主体循环-->
<view class="album-subject">
<view class="subject-List" v-for="(item,index) in previewData" :key="index" @click="projectCheckPhoto(index)" >
<image class="list-image" :src="item.faceSourceUrl" ></image>
<image class="list-image" :src="item.faceSourceUrl||item.faceAiUrl" ></image>
<u-checkbox v-model="item.checkType" v-if="checkTypeFun==true" @click.stop.native="()=>{}" @change="stopPhoto(index)" shape="circle" class="list-uCheck"></u-checkbox>
<view class="list-mask">预览</view>
</view>
......@@ -55,7 +55,7 @@
<view class="detail-total">合计:¥{{sellingPrices}}</view>
<view class="detail-favorable">优惠减:¥{{favorablePrice}}</view>
</view>
<view class="bootom-btn">去下载</view>
<view class="bootom-btn" @click="upLoad()">去下载</view>
</view>
<!--预览-->
<view class="album-maskPreview" v-if="maskPreviewType==true" @click="maskPreviewType=false">
......@@ -65,13 +65,13 @@
<image class="img-center" :src="previewData[previewNum].faceSourceUrl"></image>
</template>
<template v-else>
<image class="img-left" v-if="previewNum==0" :src="previewData[previewData.length-1].faceSourceUrl"></image>
<image class="img-left" v-else :src="previewData[previewNum-1].faceSourceUrl"></image>
<image class="img-left" :style="{left:touchLeft0 +'rpx'}" v-if="previewNum==0" :src="previewData[previewData.length-1].faceSourceUrl||previewData[previewData.length-1].faceAiUrl"></image>
<image class="img-left" :style="{left:touchLeft0 +'rpx'}" v-else :src="previewData[previewNum-1].faceSourceUrl||previewData[previewNum-1].faceAiUrl"></image>
<image class="img-center" :style="{right:touchRight +'rpx',left:touchLeft +'rpx'}" :src="previewData[previewNum].faceSourceUrl"></image>
<image class="img-center" :style="{right:touchRight +'rpx',left:touchLeft +'rpx'}" :src="previewData[previewNum].faceSourceUrl||previewData[previewNum].faceAiUrl"></image>
<image class="img-right" v-if="previewNum==previewData.length-1" :src="previewData[0].faceSourceUrl"></image>
<image class="img-right" v-else :src="previewData[previewNum+1].faceSourceUrl"></image>
<image class="img-right" :style="{right:touchRight2 +'rpx'}" v-if="previewNum==previewData.length-1" :src="previewData[0].faceSourceUrl||previewData[0].faceAiUrl"></image>
<image class="img-right" :style="{right:touchRight2 +'rpx'}" v-else :src="previewData[previewNum+1].faceSourceUrl||previewData[previewNum+1].faceAiUrl"></image>
</template>
</view>
<view class="maskPreview-check" v-if="checkTypeFun==true">
......@@ -143,8 +143,10 @@ export default {
},
transition: '',
touch: {},
touchLeft0: -466,
touchLeft: 0,
touchRight: 0,
touchRight2: -466,
touchType: 0, //向左0++ 向右1--
//左右滑动 监听结束
originalPrice:0,//原价单价
......@@ -157,7 +159,6 @@ export default {
},
onLoad(option) {
this.openid = uni.getStorageSync('openid') //获取openid
console.log(option)
this.faceIds = JSON.parse(option.faceIds)
this.location = JSON.parse(uni.getStorageSync('location'))
this.merchantId = 'z0015605022691a5945bbe463141668c'//uni.getStorageSync('merchantId')
......@@ -300,8 +301,12 @@ export default {
console.log('执行查看跳转事件')
// this.touch = {};
//动画结束后回到原位 切换图片
this.touchRight = 0
this.touchLeft0 = -466
this.touchLeft = 0
this.touchRight = 0
this.touchRight2 = -466
//判断当前应该显示哪张照片
if (this.touchType == 1) {
if (this.previewNum == 0) {
......@@ -320,8 +325,14 @@ export default {
console.log('滑动距离不够,不执行跳转')
// this.touch = {};
//动画结束后回到原位
this.touchRight = 0
this.touchLeft0 = -466
this.touchRight0 = 0
this.touchLeft = 0
this.touchRight = 0
this.touchLeft2 = 0
this.touchRight2 = -466
}
},
move(event) { //@touchmove触摸移动
......@@ -332,15 +343,22 @@ export default {
console.log('左滑动')
//方向RPX值
this.touchRight = this.startData.clientX - touch.clientX
this.touchLeft0 = this.touchLeft0 + this.startData.clientX - touch.clientX
this.touchRight2 = this.touchRight2 + this.startData.clientX - touch.clientX
this.touchType = 0
}
if (touch.clientX > this.startData.clientX) { //向右移动
console.log('右滑动')
//方向RPX值
this.touchLeft = touch.clientX - this.startData.clientX
this.touchLeft0 = this.touchLeft0 + this.startData.clientX - touch.clientX
this.touchRight2 = this.touchRight2 + this.startData.clientX - touch.clientX
this.touchType = 1
}
},
upLoad(){//下单
},
}
}
</script>
......
<template>
<view class="albumBox">
<!--头部-->
<view class="album-address">
<view class="address-left">
<view class="left-picker" @click="orderShow=true">
<i>{{cityName}}</i>
<image src="../static/album/myPhoto01.png"></image>
</view>
<u-picker mode="selector" v-model="orderShow" :default-selector="[orderType]" :range="option" range-key="areaName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
</view>
</view>
<!--主体循环-->
<view class="album-subject">
<view class="subject-List" v-for="(item,index) in previewData" :key="index" @click="projectCheckPhoto(index)" >
<image class="list-image" :src="item.faceSourceUrl" ></image>
<u-checkbox v-model="item.checkType" v-if="checkTypeFun==true" @click.stop.native="()=>{}" @change="stopPhoto(index)" shape="circle" class="list-uCheck"></u-checkbox>
<view class="list-mask">预览</view>
</view>
</view>
<!--脚部-->
<view class="album-bottom">
<view class="bottom-left" v-if="maskDetail==false">
<!--全选按钮-->
<view class="album-checkAll">
<u-checkbox v-model="checkProjectAll" @change="checkProjectAllFun()">全选</u-checkbox>
<view class="checkAll-tips">未下载影像保留15天</view>
</view>
</view>
<view class="bootom-btn" @click="upLoad()">去下载</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'
export default {
components: {
uPicker,
uCheckboxGroup,
uCheckbox,
uToast
},
data() {
return {
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'
// },
],
previewNum: 0, //当前是第几张图片
checkTypeFun:true,//刷新选项
//左右滑动监听开始
startData: {
clientX: '',
clientY: '',
},
transition: '',
touch: {},
touchLeft: 0,
touchRight: 0,
touchType: 0, //向左0++ 向右1--
//左右滑动 监听结束
originalPrice:0,//原价单价
originalPrices:0,//原价
sellingPrice:0,//售价单价
sellingPrices:0,//售价
favorablePrice:0,//优惠
priceNum:0,//选购了多少照片
}
},
onLoad(option) {
this.openid = uni.getStorageSync('openid') //获取openid
this.location = JSON.parse(uni.getStorageSync('location'))
this.merchantId = 'z0015605022691a5945bbe463141668c'//uni.getStorageSync('merchantId')
this.obtainProvince()//获取省市区
this.inquireMerchant()//查询所有商户
this.getPhotos()//照片列表
},
methods: {
obtainProvince(){//获取省列表
this.$request('scenic/search/loadAreaByCity',{
areaLevel:1,
inChina:0
}).then((res)=>{
if(res.code=='00'){
this.option = res.data
}else{
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
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{
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
getPhotos(){//照片
var data = {
openid:this.openid,
merchantId:this.merchantId,//商户ID
}
this.$request('wechatUser/pdFace/getAlbumList',data).then((res)=>{
if(res.code=='00'){
this.previewData = res.data
this.previewData.forEach((item,index)=>{
item['checkType'] = false
this.originalPrice = item.originalPrice//原价.
this.sellingPrice = item.sellingPrice//售价
})
}else{
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
industrysTypeConfirm(e) { //单列----分类 点击确定 城市
this.cityName = this.option[e].areaName
this.areaId = this.option[e].areaId
this.inquireMerchant()
},
cancel() { //单列 点击取消
this.orderShow = false
},
projectCheckPhoto(index){//点击预览
this.previewNum = index
this.maskPreviewType = true
},
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
},
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
})
}
},
upLoad(){//下单
},
}
}
</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);
overflow-x: auto;
.left-picker {
display: flex;
font-size: 32rpx;
color: #333333;
line-height: 76rpx;
margin-right: 24rpx;
image {
width: 26rpx;
height: 26rpx;
margin-top: 25rpx;
margin-left: 8rpx;
}
}
}
}
.album-address::-webkit-scrollbar {
display: none;
}
.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-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;
}
}
}
.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;
.album-checkAll {
width: 100%;
height: 98rpx;
padding: 32rpx 24rpx 0 24rpx;
overflow: hidden;
/deep/ .u-checkbox {
line-height: 34rpx !important;
}
/deep/ .u-checkbox__label {
font-size: 24rpx !important;
}
.checkAll-tips {
font-size: 24rpx;
color: #999999;
line-height: 46rpx;
margin-left: 24rpx;
}
}
}
.bootom-btn {
width: 240rpx;
height: 98rpx;
background-color: #3688FF;
font-size: 32rpx;
color: #fff;
font-weight: bold;
text-align: center;
line-height: 98rpx;
}
}
</style>
\ No newline at end of file
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