Commit ffeaaa84 authored by 潘永坪's avatar 潘永坪

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

parents bef558c2 8089ce05
...@@ -552,6 +552,33 @@ ...@@ -552,6 +552,33 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "scanCodePrinting/scanCodePrinting",
"style" :
{
"navigationBarTitleText" : "选择产品",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "photoLogin/photoLogin",
"style" :
{
"navigationBarTitleText" : "获取相片",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "photoAccount/photoAccount",
"style" :
{
"navigationBarTitleText" : "切换账号",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
} }
] ]
} }
......
...@@ -10,39 +10,24 @@ ...@@ -10,39 +10,24 @@
<u-icon name="arrow-left" color="#333" @click="blowUpMaks=false"></u-icon> <u-icon name="arrow-left" color="#333" @click="blowUpMaks=false"></u-icon>
{{blowUpNumNew}}/{{pictureFrameList.length}} {{blowUpNumNew}}/{{pictureFrameList.length}}
</view> </view>
<!--单张 宫格切换-->
<view class="myPhoto-title">
<view class="title-click" :class="titleclick==1?'title-clickAct':''" @click="clickActFun(1)">
单照片
<view class="click-line"></view>
</view>
<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="title-click" :class="titleclick==4?'title-clickAct':''" @click="clickActFun(4)">
六宫格
<view class="click-line"></view>
</view>
</view>
<!--相框/项目切换--> <!--相框/项目切换-->
<view class="myPhoto-search" v-if="pictureFrameList.length!=0"> <view class="myPhoto-search" v-if="pictureFrameList.length!=0">
<view class="search-left"> <view class="search-left">
<view class="left-frame" :class="frameNum==1?'left-frameAct':''" @click="frameFun(1)">金属框</view> <!-- <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==2?'left-frameAct':''" @click="frameFun(2)">木框</view>
<view class="left-frame" :class="frameNum==3?'left-frameAct':''" @click="frameFun(3)">无框</view> <view class="left-frame" :class="frameNum==3?'left-frameAct':''" @click="frameFun(3)">无框</view> -->
</view>
<view class="search-right">
<view class="right-addressClick" @click="show = true"> <view class="right-addressClick" @click="show = true">
{{showAddress}} {{showAddress}}
<view class="address-triangle"></view> <view class="address-triangle"></view>
<u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker> <u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker>
</view> </view>
</view> </view>
<view class="search-right">
<view class="right-addressClick" @click="show = true">
153****3456
<view class="address-triangle"></view>
</view>
</view>
</view> </view>
<!--相片列表--> <!--相片列表-->
<view class="myPhoto-list" v-if="checkTypeFun==true" :class="bottomShow==true?'myPhoto-listAct':''"> <view class="myPhoto-list" v-if="checkTypeFun==true" :class="bottomShow==true?'myPhoto-listAct':''">
...@@ -70,7 +55,7 @@ ...@@ -70,7 +55,7 @@
<view class="myPhoto-mask" v-if="blowUpMaks==true" :style="{'top': albumBoxTop + 'px' }"> <view class="myPhoto-mask" v-if="blowUpMaks==true" :style="{'top': albumBoxTop + 'px' }">
<swiper class="swiper" circular @change="projectNumFun" :current="currentNum"> <swiper class="swiper" circular @change="projectNumFun" :current="currentNum">
<swiper-item v-for="(item,index) in pictureFrameList" :key="index"> <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> <image :src="item.image" @click="stopPhoto(index)" :style="{'width': item.width+'rpx', 'height': item.height+'rpx'}"></image>
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)" v-if="checkTypeFun==true"> <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 value="val" :checked="item.checkType" class="pictureFrame-check" :class="item.checkType==true?'pictureFrame-checkAct':''"></checkbox>
</checkbox-group> </checkbox-group>
...@@ -78,37 +63,68 @@ ...@@ -78,37 +63,68 @@
</swiper> </swiper>
</view> </view>
<!--获取照片--> <!--获取照片-->
<image v-if="pictureFrameListNum==0" class="myPhoto-getPhotos" src="../static/album/icon08.png"></image> <!-- <image v-if="pictureFrameListNum==0" class="myPhoto-getPhotos" src="../static/album/icon08.png"></image> -->
<!--脚部选择相片、加入购物车、直接购买--> <!--脚部选择相片、加入购物车、直接购买 v-if="pictureFrameListNum>0"-->
<view class="myPhoto-bottom" v-if="pictureFrameListNum>0"> <view class="myPhoto-bottom">
<view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view> <view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view>
<view class="bottom-feature"> <view class="bottom-feature">
<!--加入相册列表--> <!--加入相册列表-->
<view class="feature-list"> <!-- <view class="feature-list">
<template v-for="(item,index) in pictureFrameList"> <template v-for="(item,index) in pictureFrameList">
<view class="feature-case" v-if="item.pickerChoose==true" :key="index"> <view class="feature-case" v-if="item.pickerChoose==true" :key="index">
<image class="feature-img" :src="item.image"></image> <image class="feature-img" :src="item.image"></image>
<image class="feature-close" src="../static/album/icon05.png" @click="stopPhoto(index)"></image> <image class="feature-close" src="../static/album/icon05.png" @click="stopPhoto(index)"></image>
</view> </view>
</template> </template>
</view> -->
<!--单张 宫格切换-->
<view class="myPhoto-title">
<view class="title-click" :class="titleclick==1?'title-clickAct':''" @click="clickActFun(1)">
单照片
<view class="click-line"></view>
</view>
<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="title-click" :class="titleclick==4?'title-clickAct':''" @click="clickActFun(4)">
六宫格
<view class="click-line"></view>
</view>
</view>
<!--宫格照片数量不够-创建失败-->
<view class="feature-warn">
<view class="warn-title">生成失败</view>
<view class="warn-text">至少需要5张照片才能拼图 <text>上传照片</text></view>
</view> </view>
<!--选中的张数、加入购物车、立即购买、开始拼图 titleclick等于1显示购物车和立即购买 等于其他 显示开始拼图 进入拼图界面--> <!--选中的张数、加入购物车、立即购买、开始拼图 titleclick等于1显示购物车和立即购买 等于其他 显示开始拼图 进入拼图界面-->
<view class="feature-message"> <view class="feature-message">
<view class="message-selectNum" v-if="titleclick==1"> <!-- <view class="message-selectNum" v-if="titleclick==1">
已选中 已选中
<text class="selectNum-color">{{pictureFrameListNum}}张</text> <text class="selectNum-color">{{pictureFrameListNum}}张</text>
</view> </view>
<view class="message-selectNum" v-else> <view class="message-selectNum" v-else>
<text class="selectNum-color">最多选择{{maxChooseImg}}张</text> <text class="selectNum-color">最多选择{{maxChooseImg}}张</text>
</view> -->
<view class="message-inPhoto">
<image class="inPhoto-img" src="../static/album/icon13.png"></image>
<view class="inPhoto-text">购物车</view>
<view class="inPhoto-num">2</view>
</view> </view>
<view class="message-trading" v-if="titleclick==1"> <!-- v-if="titleclick==1" -->
<view class="message-trading">
<view class="trading-btn trading-left"> <view class="trading-btn trading-left">
<image src="../static/album/icon06.png"></image> <!-- <image src="../static/album/icon06.png"></image> -->
<view class="trading-num">2</view> <!-- <view class="trading-num">2</view> -->
加入购物车
</view> </view>
<view class="trading-btn trading-right">购买</view> <view class="trading-btn trading-right">立即购买</view>
</view> </view>
<view class="message-jigsaw" v-else>开始拼图</view> <!-- <view class="message-jigsaw" v-else>开始拼图</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -167,26 +183,36 @@ export default { ...@@ -167,26 +183,36 @@ export default {
image:'https://img1.baidu.com/it/u=1360904074,3378535006&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1427', image:'https://img1.baidu.com/it/u=1360904074,3378535006&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1427',
checkType:false, checkType:false,
pickerChoose:false, pickerChoose:false,
width:607,
height:879,
}, },
{ {
image:'https://i1.hdslb.com/bfs/archive/34961798a6c8fa26348499483fc16e48831af85d.jpg', image:'https://i1.hdslb.com/bfs/archive/34961798a6c8fa26348499483fc16e48831af85d.jpg',
checkType:false, checkType:false,
pickerChoose:false, pickerChoose:false,
width:607,
height:879,
}, },
{ {
image:'https://img1.baidu.com/it/u=2652134479,594912468&fm=253&fmt=auto&app=138&f=JPEG?w=878&h=493', image:'https://img1.baidu.com/it/u=2652134479,594912468&fm=253&fmt=auto&app=138&f=JPEG?w=878&h=493',
checkType:false, checkType:false,
pickerChoose:false, pickerChoose:false,
width:607,
height:879,
}, },
{ {
image:'https://img0.baidu.com/it/u=2602636891,3687528369&fm=253&fmt=auto&app=120&f=JPEG?w=1087&h=612', image:'https://img0.baidu.com/it/u=2602636891,3687528369&fm=253&fmt=auto&app=120&f=JPEG?w=1087&h=612',
checkType:false, checkType:false,
pickerChoose:false, pickerChoose:false,
width:607,
height:879,
}, },
{ {
image:'https://img2.baidu.com/it/u=635571518,763366960&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1131', image:'https://img2.baidu.com/it/u=635571518,763366960&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1131',
checkType:false, checkType:false,
pickerChoose:false, pickerChoose:false,
width:607,
height:879,
}, },
], ],
checkTypeFun:true,//刷新选项 checkTypeFun:true,//刷新选项
...@@ -319,6 +345,7 @@ export default { ...@@ -319,6 +345,7 @@ export default {
flex-direction:column; flex-direction:column;
height: 100vh; height: 100vh;
background-color: #fff; background-color: #fff;
padding-bottom: 464rpx;
} }
.albumBoxAct{ .albumBoxAct{
background-color: #F5F7FA; background-color: #F5F7FA;
...@@ -344,7 +371,7 @@ export default { ...@@ -344,7 +371,7 @@ export default {
.myPhoto-title{ .myPhoto-title{
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
padding: 32rpx 60rpx 0 60rpx; padding: 32rpx 40rpx 0 40rpx;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -383,6 +410,7 @@ export default { ...@@ -383,6 +410,7 @@ export default {
background: #F5F7FA; background: #F5F7FA;
.search-left{ .search-left{
display: flex; display: flex;
}
.left-frame{ .left-frame{
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
...@@ -402,9 +430,9 @@ export default { ...@@ -402,9 +430,9 @@ export default {
border-radius: 8rpx; border-radius: 8rpx;
border: 2rpx solid #DAE0EB; border: 2rpx solid #DAE0EB;
} }
}
.search-right{ .search-right{
display: flex; display: flex;
}
.right-addressClick{ .right-addressClick{
display: flex; display: flex;
font-weight: 600; font-weight: 600;
...@@ -418,8 +446,8 @@ export default { ...@@ -418,8 +446,8 @@ export default {
margin: auto; margin: auto;
margin-left: 12rpx; margin-left: 12rpx;
border: 10rpx solid transparent; border: 10rpx solid transparent;
border-top: 10rpx solid #D8D8D8; border-top: 10rpx solid #333333;
} margin-top: 25rpx;
} }
} }
} }
...@@ -531,8 +559,8 @@ export default { ...@@ -531,8 +559,8 @@ export default {
left: 0; left: 0;
z-index: 10; z-index: 10;
.swiper{ .swiper{
width: 680rpx; width: 607rpx;
height: 956rpx;//510rpx height: 879rpx;//510rpx
margin: 0 auto; margin: 0 auto;
background: #F5F7FA; background: #F5F7FA;
margin-top: 80rpx; margin-top: 80rpx;
...@@ -545,8 +573,8 @@ export default { ...@@ -545,8 +573,8 @@ export default {
height: 32rpx; height: 32rpx;
background: transparent; background: transparent;
position: absolute; position: absolute;
right: 56rpx; right: 22rpx;
bottom: 60rpx; bottom: 22rpx;
z-index: 11; z-index: 11;
/deep/ .wx-checkbox-input{ /deep/ .wx-checkbox-input{
width: 32rpx; width: 32rpx;
...@@ -570,7 +598,7 @@ export default { ...@@ -570,7 +598,7 @@ export default {
} }
.myPhoto-bottom{ .myPhoto-bottom{
width: 100%; width: 100%;
height: 314rpx; height: 464rpx;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
...@@ -578,22 +606,21 @@ export default { ...@@ -578,22 +606,21 @@ export default {
.bottom-tips{ .bottom-tips{
width: 726rpx; width: 726rpx;
height: 64rpx; height: 64rpx;
background: #FFF6E8; background: #FFEFC9;
border-radius: 8rpx 8rpx 0rpx 0rpx; border-radius: 8rpx 8rpx 0rpx 0rpx;
border: 2rpx solid #FE6600;
box-sizing: border-box; box-sizing: border-box;
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #FE6600; color: #9A5500;
text-align: center; padding: 0 26rpx;
line-height: 60rpx; line-height: 64rpx;
margin: 0 auto; margin: 0 auto;
} }
.bottom-feature{ .bottom-feature{
width: 100%; width: 100%;
height: 250rpx; height: 400rpx;
background-color: #fff; background-color: #fff;
padding: 20rpx 24rpx 0 24rpx; padding: 0rpx 0rpx 0 0rpx;
.feature-list{ .feature-list{
display: flex; display: flex;
width: 100%; width: 100%;
...@@ -620,8 +647,9 @@ export default { ...@@ -620,8 +647,9 @@ export default {
.feature-message{ .feature-message{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 64rpx; border-top: 2rpx solid #F5F5F5;
margin-top: 6rpx; padding: 0 40rpx 0 40rpx;
height: 120rpx;
.message-selectNum{ .message-selectNum{
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
...@@ -635,44 +663,51 @@ export default { ...@@ -635,44 +663,51 @@ export default {
.message-trading{ .message-trading{
display: flex; display: flex;
position: relative; position: relative;
margin-top: 20rpx;
.trading-btn{ .trading-btn{
width: 160rpx; width: 220rpx;
height: 64rpx; height: 80rpx;
position: relative; position: relative;
} }
.trading-left{ .trading-left{
background: #FF9F43; background: #FFB143;
border-radius: 200rpx 0rpx 0rpx 200rpx; border-radius: 40rpx 0rpx 0rpx 40rpx;
image{
width: 40rpx;
height: 40rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.trading-num{
width: 42rpx;
height: 44rpx;
border-radius: 50%;
background: #FFFFFF;
line-height: 44rpx;
text-align: center; text-align: center;
font-weight: bold; line-height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
color: #FE6600; font-weight: 600;
position: absolute; text-align: center;
right: 12rpx; color: #FFFFFF;
top: -22rpx; // image{
} // width: 40rpx;
// height: 40rpx;
// margin: auto;
// position: absolute;
// top: 0;
// right: 0;
// bottom: 0;
// 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;
// }
.trading-right{ .trading-right{
background: #FE6600; background: #FE6600;
border-radius: 0rpx 200rpx 200rpx 0rpx; border-radius: 0rpx 200rpx 200rpx 0rpx;
text-align: center; text-align: center;
line-height: 64rpx; line-height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
...@@ -690,6 +725,60 @@ export default { ...@@ -690,6 +725,60 @@ export default {
line-height: 64rpx; line-height: 64rpx;
text-align: center; text-align: center;
} }
.message-inPhoto{
width: 60rpx;
margin-top: 24rpx;
position: relative;
.inPhoto-img{
display: block;
width: 44rpx;
height: 44rpx;
margin: 0 auto 4rpx auto;
}
.inPhoto-text{
font-weight: 400;
font-size: 20rpx;
color: #666666;
text-align: center;
line-height: 20rpx;
}
.inPhoto-num{
width: 24rpx;
height: 24rpx;
background: #FFFFFF;
border-radius: 12rpx;
border: 2rpx solid #FE6600;
font-size: 18rpx;
color: #FE6600;
line-height: 20rpx;
text-align: center;
position: absolute;
right: -2rpx;
top: -4rpx;
}
}
}
.feature-warn{
width: 750rpx;
height: 180rpx;
padding-top: 42rpx;
.warn-title{
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 48rpx;
text-align: center;
}
.warn-text{
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 48rpx;
text-align: center;
text{
color: #165DFF;
}
}
} }
} }
} }
......
<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>
&nbsp;
</view>
<!--切换账号-->
<view class="account-title">点击切换账号</view>
<!--账号列表-->
<view class="account-list">
<view class="list-num">153****6923</view>
<view class="list-new">当前使用</view>
</view>
<view class="account-list">
<view class="list-num">152****7987</view>
</view>
<!--添加账号-->
<view class="account-add">
<view class="add-icon">
<u-icon name="plus"></u-icon>
</view>
<view class="add-text">添加账号</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
}
},
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
})
},
}
}
</script>
<style scoped lang="scss">
.albumBox{
display: flex;
flex-direction:column;
height: 100vh;
background-color: #fff;
padding-bottom: 464rpx;
}
.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;
}
}
.account-title{
font-weight: 400;
font-size: 48rpx;
color: #000000;
line-height: 66rpx;
text-align: center;
margin-top: 178rpx;
margin-bottom: 152rpx;
}
.account-list{
display: flex;
justify-content: space-between;
width: 670rpx;
height: 154rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx #EDEDED;
border-radius: 16rpx;
border: 2rpx solid #F5F5F5;
padding: 0 40rpx 0 40rpx;
margin: 0 auto 40rpx auto;
.list-num{
font-weight: 600;
font-size: 32rpx;
color: #333333;
line-height: 154rpx;
}
.list-new{
font-weight: 400;
font-size: 28rpx;
color: #00B42B;
line-height: 154rpx;
}
}
.account-add{
display: flex;
width: 670rpx;
height: 154rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 20rpx 0rpx #EDEDED;
border-radius: 16rpx;
border: 2rpx solid #F5F5F5;
padding: 30rpx 40rpx 0 40rpx;
margin: 0 auto;
.add-icon{
width: 92rpx;
height: 92rpx;
border-radius: 16rpx;
border: 2rpx solid #BDC3CE;
position: relative;
/deep/ .u-icon__icon{
font-weight: bold !important;
font-size: 42rpx !important;
line-height: 92rpx !important;
margin: 0 auto;
color: #BDC3CE !important;
}
}
.add-text{
font-weight: 600;
font-size: 32rpx;
color: #999999;
line-height: 92rpx;
margin-left: 40rpx;
}
}
</style>
<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" data-type="view" id="jigsawPicture" ref="jigsawPicture">
<template v-for="(item,index) in pictureJigsawPosition">
<view class="picture-position" @scroll="onScroll($event,index)" :key="index" :style="{'width': item.width + 'rpx' ,'height': item.height + 'rpx' ,'top': item.top + 'rpx' ,'left': item.left + 'rpx' ,'border-radius': item.radius + 'rpx' ,}">
<image class="queryInfo"
data-type="image" :data-src="item.url" :data-widthonce="item.width" :data-heightonce="item.height" :src="item.url"
:data-tailorx="item.left" :data-tailory="item.top" :data-id="item.id"
:class="item.id"
@touchstart="handleTouchStart($event,index)" @touchmove="handleTouchMove($event,index)" @touchend="handleTouchEnd($event,index)"></image>
</view>
</template>
<image class="picture-backgrounImg queryInfo"
data-type="image" data-src="../static/album/backgroundImgTo.png" data-widthonce="750" data-heightonce="1100"
data-tailorx="0" data-tailory="0"
src="../static/album/backgroundImgTo.png"></image>
</view>
<button @click="toCanvas" style="top:150rpx;position: absolute;">按钮</button>
<!--画图板-->
<view class="jigsaw-canvasMask" :class="canvasMaskType==true?'jigsaw-canvasMaskAct':''" :style="{'top': albumBoxTop + 'px'}">
<canvas class="jigsaw-canvas" type="2d" id="myCanvas"></canvas>
</view>
<!--脚部模板-->
<view class="jigsaw-template">
<view class="template-list template-listAct">
<image class="list-img" src="../static/album/DIY.png"></image>
</view>
<view class="template-list">
<image class="list-img" src="../static/album/DIY.png"></image>
</view>
<view class="template-list">
<image class="list-img" src="../static/album/DIY.png"></image>
</view>
</view>
<!--脚部购物车-->
<view class="jigsaw-btoom">
<view class="bottom-pictureFrame">
<view class="pictureFrame pictureFrameAct">金属框</view>
<view class="pictureFrame">木框</view>
<view class="pictureFrame">无框</view>
</view>
<view class="message-trading">
<view class="trading-btn trading-left">
<image src="../static/album/icon06.png"></image>
<view class="trading-num">2</view>
</view>
<view class="trading-btn trading-right">购买</view>
</view>
</view>
<!--脚部模板开关-->
<view class="jigsaw-switch" :class="switchType!=true?'jigsaw-switchAct':''">
<image v-if="switchType==true" class="jigsaw-switchImg" src="../static/album/icon09.png"></image>
<image v-else class="jigsaw-switchImg" src="../static/album/icon10.png"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
screenWidth:0,//屏幕宽度
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
pictureJigsawPosition:[//图片框位置
{
id:'img1',
url:'http://lx.pangdly.com/img/sodao.1cdf287.jpg',
width:'299',
height:'384',
top:'184',
left:'74',
radius:'0',
},
{
id:'img2',
url:'http://lx.pangdly.com/img/liangjiang.097258e.jpg',
width:'299',
height:'384',
top:'184',
left:'387',
radius:'0',
},
{
id:'img3',
url:'http://lx.pangdly.com/img/huiguan.c00da69.jpg',
width:'299',
height:'384',
top:'640',
left:'74',
radius:'0',
},
],
transpositionStartMes:{},
transpositionStartIndex:0,
textCanvas: null, // 初始化 canvas 值
canvasMaskNum:0, //渲染次数
canvasMaskType:false,
switchType:true,//模板开关按钮
}
},
onLoad(option) {
this.recordDeviceInfo()//记录设备信息
//获取当前view的宽度
const query = uni.createSelectorQuery().in(this)
query.select('.jigsaw-picture').boundingClientRect(res => {
this.screenWidth = res.width
}).exec()
},
methods: {
onScroll(event) {// event.detail 包含了滚动位置信息
console.log('滚动位置:', event.detail)
},
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
})
},
//基础换位逻辑
//1.获取当前位置。确定开始位置的图片值
//2.获取终点位置
//3.循环终点位置。确实终点位置是否再开始位置,若不在,则将开始位置和终点位置图片互换
handleTouchMove(event,index) {
},
handleTouchStart(event,index) {//changedTouches[0] pageX横向 pageY属相 //rect (top, right, bottom, left)
this.transpositionStartMes = event.changedTouches[0]
this.transpositionStartIndex = index
},
handleTouchEnd(event,index) {//点击图片是否切换
//距离头部高度
var navHeight = this.pxToRpx(this.albumBoxTop)
//获取终点位置
var endEvent = event.changedTouches[0]
//参数重组 将参数从当前参数转换为 750rpx的数值
var newScale = parseInt(endEvent.pageX/this.screenWidth*750)//换算 满宽在哪
var newRemain = parseInt((endEvent.pageY-navHeight)/this.screenWidth*750)//换算 满宽在哪 pageY-navHeight 当前手指位置-导航栏高度 为现在手指再DIV内的高度
endEvent.pageX = newScale
endEvent.pageY = newRemain
//循环是否在某个元素框里面
var newInIndex = null
this.pictureJigsawPosition.forEach((item,index)=>{
var overWidth = parseInt(item.width)+parseInt(item.left)
var overHeight = parseInt(item.height)+parseInt(item.top)
if(endEvent.pageX>=item.left&&endEvent.pageX<=overWidth&&endEvent.pageY>=item.top&&endEvent.pageY<=overHeight){
newInIndex = index
}
})
//确定进入其他元素框内时 图片对换
if(this.transpositionStartIndex!==newInIndex&&newInIndex!==null){
var indexOne = JSON.parse(JSON.stringify(this.pictureJigsawPosition[this.transpositionStartIndex].url))
var indexNew = JSON.parse(JSON.stringify(this.pictureJigsawPosition[newInIndex].url))
this.pictureJigsawPosition[this.transpositionStartIndex].url = JSON.parse(JSON.stringify(indexNew))
this.pictureJigsawPosition[newInIndex].url = JSON.parse(JSON.stringify(indexOne))
}
},
// px转rpx 将头部导航栏PX转换为RPX
pxToRpx(px) {
//计算比例
let scale = uni.upx2px(100)/100
return px/scale
},
toCanvas(){
let that = this
this.canvasMaskType = true
let promiseArray = []
// 1.先查询要绘制的image相关属性数据
// 这里我将需要查询的所有image的类名都设置为queryInfo
uni.createSelectorQuery().selectAll('.queryInfo').boundingClientRect().exec((res)=>{
promiseArray = JSON.parse(JSON.stringify(res[0]))
var imgList = JSON.parse(JSON.stringify(res[0]))//用于图片自裁剪
var promiseArrayNum= promiseArray[promiseArray.length-1].top
for(let i=0;i<promiseArray.length;i++){
let type = 'image'
let src= promiseArray[i].dataset.src
let posX = parseInt(promiseArray[i].dataset.tailorx/750*this.screenWidth) //如果向左位移则需要用框的
let posY = parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth)//parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth)
let tailorx = parseInt(promiseArray[i].dataset.tailorx/750*this.screenWidth)-promiseArray[i].left
if(tailorx<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0
tailorx = 0
}
let tailory = parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth)-(promiseArray[i].top-promiseArrayNum)
if(tailory<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0
tailory = 0
}
let width = promiseArray[i].width
let height = promiseArray[i].height
let swidth = parseInt(promiseArray[i].dataset.widthonce/750*this.screenWidth)///750*this.screenWidth
let sheight = parseInt(promiseArray[i].dataset.heightonce/750*this.screenWidth)///750*this.screenWidth
promiseArray[i]={
type:'image',
src: src,
width:width,
height: height,
swidth,
sheight,
posX:posX,
posY:posY,
tailorx:tailorx,
tailory:tailory,
}
}
console.log('获取到信息:', promiseArray)
this.drowImg(promiseArray)
})
},
drowImg(promiseArray){ //绘制图片
let that = this
// uni-app 中,不管是小程序,app,h5 在获取元素实例时,都是统一的方法,只要获取元素的宽高
uni.createSelectorQuery().select('#myCanvas').fields({ node: true, size: true })
.exec((res) => {
// 微信小程序绘制
let textCanvas = that.textCanvas = res[0].node // 获取元素实例
let textCtx = textCanvas.getContext('2d') // 创建二维绘图
// 获取设备设备像素比
const dpr = uni.getSystemInfoSync().pixelRatio
textCanvas.width = res[0].width * dpr // 设置canvas像素宽
textCanvas.height = res[0].height * dpr // 设置canvas像素高
textCtx.clearRect(0, 0, res[0].width, res[0].height) // 设置画布大小
textCtx.scale(dpr, dpr)
// 这里开始绘制canvas内容,绘制的过程当中,不知道是小程序的问题,还是什么问题在绘制有背景图片的内容时,
// 文字内容必须要延迟绘制,也就是要定时器延迟一定时间才能绘制,要不然就会将文字覆盖在图片下方。
// 图片的绘制
for(let i = 0; i < promiseArray.length; i++){
const tx = textCanvas.createImage()
tx.src = promiseArray[i].src // 线上地址或者本地地址都可以
tx.width = promiseArray[i].width
tx.height = promiseArray[i].height
tx.onload = () => {
// 图片 裁剪 :X Y 宽度 高度
//promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth, promiseArray[i].sheight-1,
if(i==promiseArray.length-1){
textCtx.drawImage(tx, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight)
}else{
textCtx.drawImage(tx,promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth, promiseArray[i].sheight*1.72, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight)
}
}
}
})
},
}
}
</script>
<style scoped lang="scss">
.albumBox{
// display: flex;
// flex-direction:column;
height: 100VH;
background: #F5F7FA;
overflow: auto;
}
.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;
image{
display: block;
height: 100%;
}
}
.picture-positionBox{
width: 750rpx;
height: 1100rpx;
position: absolute;
top: 0;
left: 0;
}
}
.jigsaw-canvas{
display: block;
width: 750rpx;
height: 1100rpx;
}
.jigsaw-canvasMask{
display: block;
width: 750rpx;
padding-top: 86rpx;
position: absolute;
left: 0;
z-index: -10;
}
.jigsaw-canvasMaskAct{
z-index: 100;
}
.jigsaw-template{
display: flex;
width: 100%;
height: 180rpx;
padding: 20rpx;
background-color: #fff;
overflow: auto;
position: fixed;
bottom: 100rpx;
left: 0;
z-index: 110;
.template-list{
width: 108rpx;
height: 160rpx;
border-radius: 9rpx;
border: 3rpx solid #EDEDED;
box-sizing: border-box;
margin-right: 20rpx;
position: relative;
.list-img{
display: block;
width: 92rpx;
height: 138rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.template-listAct{
border: 3rpx solid #FE6600;
}
}
.jigsaw-btoom{
display: flex;
justify-content: space-between;
width: 100%;
height: 100rpx;
padding: 18rpx 32rpx 0 20rpx;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
z-index: 110;
.bottom-pictureFrame{
display: flex;
width: 324rpx;
padding-top: 6rpx;
overflow: auto;
.pictureFrame{
width: 108rpx;
height: 48rpx;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 48rpx;
text-align: center;
}
.pictureFrameAct{
background: #F7F8FA;
border-radius: 24rpx;
color: #333333;
font-weight: 600;
}
}
.message-trading{
display: flex;
position: relative;
.trading-btn{
width: 160rpx;
height: 64rpx;
position: relative;
}
.trading-left{
background: #FF9F43;
border-radius: 200rpx 0rpx 0rpx 200rpx;
image{
width: 40rpx;
height: 40rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
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;
}
.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;
}
}
}
.jigsaw-switch{
width: 52rpx;
height: 52rpx;
position: fixed;
bottom: 220rpx;
right: 32rpx;
z-index: 110;
image{
display: block;
width: 52rpx;
height: 52rpx;
}
}
.jigsaw-switchAct{
bottom: 144rpx;
}
</style>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
我的相片 我的相片
</view> </view>
<!--图片拼图--> <!--图片拼图-->
<view class="jigsaw-picture" data-type="view" id="jigsawPicture" ref="jigsawPicture"> <view class="jigsaw-picture" data-type="view" id="jigsawPicture" ref="jigsawPicture" v-if="textCanvasType==true">
<template v-for="(item,index) in pictureJigsawPosition"> <template v-for="(item,index) in pictureJigsawPosition">
<view class="picture-position" @scroll="onScroll($event,index)" :key="index" :style="{'width': item.width + 'rpx' ,'height': item.height + 'rpx' ,'top': item.top + 'rpx' ,'left': item.left + 'rpx' ,'border-radius': item.radius + 'rpx' ,}"> <view class="picture-position" @scroll="onScroll($event,index)" :key="index" :style="{'width': item.width + 'rpx' ,'height': item.height + 'rpx' ,'top': item.top + 'rpx' ,'left': item.left + 'rpx' ,'border-radius': item.radius + 'rpx' ,}">
...@@ -22,44 +22,84 @@ ...@@ -22,44 +22,84 @@
data-tailorx="0" data-tailory="0" data-tailorx="0" data-tailory="0"
src="../static/album/backgroundImgTo.png"></image> src="../static/album/backgroundImgTo.png"></image>
</view> </view>
<button @click="toCanvas">按钮</button> <button @click="toCanvas" style="top:0rpx;position: absolute;">按钮</button>
<!--画图板--> <!--画图板-->
<view class="jigsaw-canvasMask" :class="canvasMaskType==true?'jigsaw-canvasMaskAct':''" :style="{'top': albumBoxTop + 'px'}"> <view class="jigsaw-canvasMask" :class="canvasMaskType==true?'jigsaw-canvasMaskAct':''" :style="{'top': albumBoxTop + 'px'}">
<canvas class="jigsaw-canvas" type="2d" id="myCanvas"></canvas> <canvas class="jigsaw-canvas" type="2d" id="myCanvas"></canvas>
</view> </view>
<!--脚部模板-->
<view class="jigsaw-template"> <!--脚部选择相片、加入购物车、直接购买 v-if="pictureFrameListNum>0"-->
<view class="template-list template-listAct"> <view class="myPhoto-bottom" v-if="bottomCheckType==true">
<image class="list-img" src="../static/album/DIY.png"></image> <view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view>
<view class="bottom-feature">
<!--单张 宫格切换-->
<view class="myPhoto-title">
<view class="title-click" :class="titleclick==1?'title-clickAct':''" @click="clickActFun(1)">
单照片
<view class="click-line"></view>
</view>
<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>
<view class="template-list"> <view class="title-click" :class="titleclick==4?'title-clickAct':''" @click="clickActFun(4)">
<image class="list-img" src="../static/album/DIY.png"></image> 六宫格
<view class="click-line"></view>
</view> </view>
<view class="template-list">
<image class="list-img" src="../static/album/DIY.png"></image>
</view> </view>
<!--宫格照片数量不够-创建失败-->
<view class="feature-warn">
<view class="warn-pattern">
<image class="pattern-img" src="../static/album/DIY.png"></image>
</view> </view>
<!--脚部购物车--> <view class="warn-pattern warn-patternAct">
<view class="jigsaw-btoom"> <image class="pattern-img" src="../static/album/DIY.png"></image>
<view class="bottom-pictureFrame">
<view class="pictureFrame pictureFrameAct">金属框</view>
<view class="pictureFrame">木框</view>
<view class="pictureFrame">无框</view>
</view> </view>
</view>
<!--选中的张数、加入购物车、立即购买、开始拼图 titleclick等于1显示购物车和立即购买 等于其他 显示开始拼图 进入拼图界面-->
<view class="feature-message">
<view class="message-inPhoto">
<image class="inPhoto-img" src="../static/album/icon13.png"></image>
<view class="inPhoto-text">购物车</view>
<view class="inPhoto-num">2</view>
</view>
<!-- v-if="titleclick==1" -->
<view class="message-trading"> <view class="message-trading">
<view class="trading-btn trading-left"> <view class="trading-btn trading-left">
<image src="../static/album/icon06.png"></image> 加入购物车
<view class="trading-num">2</view> </view>
<view class="trading-btn trading-right">立即购买</view>
</view>
</view>
</view>
</view>
<view class="myPhoto-bottom myPhoto-bottomAct" v-else>
<view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view>
<view class="bottom-checkCase">
<view class="checkCase-title">
编辑图片
<image src="../static/album/photoCheck01.png"></image>
</view>
<view class="checkCase-btn">
<view class="btn-list">
<image src="../static/album/photoCheck02.png"></image>
<view>替换</view>
</view>
<view class="btn-list">
<image src="../static/album/photoCheck03.png"></image>
<view>旋转90°</view>
</view>
<view class="btn-list">
<image src="../static/album/photoCheck04.png"></image>
<view>水平翻转</view>
</view> </view>
<view class="trading-btn trading-right">购买</view>
</view> </view>
</view> </view>
<!--脚部模板开关-->
<view class="jigsaw-switch" :class="switchType!=true?'jigsaw-switchAct':''">
<image v-if="switchType==true" class="jigsaw-switchImg" src="../static/album/icon09.png"></image>
<image v-else class="jigsaw-switchImg" src="../static/album/icon10.png"></image>
</view> </view>
</view> </view>
</template> </template>
...@@ -73,32 +113,34 @@ export default { ...@@ -73,32 +113,34 @@ export default {
navHeight: 0,// 导航栏高度 navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度 albumBoxTop:0,//顶部高度
titleclick:1,//1单照片 2二宫格 3三宫格 4六宫格
pictureJigsawPosition:[//图片框位置 pictureJigsawPosition:[//图片框位置
{ {
id:'img1', id:'img1',
url:'http://lx.pangdly.com/img/sodao.1cdf287.jpg', url:'http://lx.pangdly.com/img/sodao.1cdf287.jpg',
width:'299', width:'243',
height:'384', height:'320',
top:'184', top:'151',
left:'74', left:'61',
radius:'0', radius:'0',
}, },
{ {
id:'img2', id:'img2',
url:'http://lx.pangdly.com/img/liangjiang.097258e.jpg', url:'http://lx.pangdly.com/img/liangjiang.097258e.jpg',
width:'299', width:'243',
height:'384', height:'320',
top:'184', top:'151',
left:'387', left:'312',
radius:'0', radius:'0',
}, },
{ {
id:'img3', id:'img3',
url:'http://lx.pangdly.com/img/huiguan.c00da69.jpg', url:'http://lx.pangdly.com/img/huiguan.c00da69.jpg',
width:'299', width:'346',
height:'384', height:'266',
top:'640', top:'530',
left:'74', left:'61',
radius:'0', radius:'0',
}, },
], ],
...@@ -110,7 +152,8 @@ export default { ...@@ -110,7 +152,8 @@ export default {
canvasMaskNum:0, //渲染次数 canvasMaskNum:0, //渲染次数
canvasMaskType:false, canvasMaskType:false,
switchType:true,//模板开关按钮 textCanvasType:true,//临时控制画布显隐
bottomCheckType:false,//控制脚部按钮切换
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -123,6 +166,9 @@ export default { ...@@ -123,6 +166,9 @@ export default {
}, },
methods: { methods: {
clickActFun(num){//宫格选择
this.titleclick = num
},
onScroll(event) {// event.detail 包含了滚动位置信息 onScroll(event) {// event.detail 包含了滚动位置信息
console.log('滚动位置:', event.detail) console.log('滚动位置:', event.detail)
}, },
...@@ -188,26 +234,47 @@ export default { ...@@ -188,26 +234,47 @@ export default {
// 这里我将需要查询的所有image的类名都设置为queryInfo // 这里我将需要查询的所有image的类名都设置为queryInfo
uni.createSelectorQuery().selectAll('.queryInfo').boundingClientRect().exec((res)=>{ uni.createSelectorQuery().selectAll('.queryInfo').boundingClientRect().exec((res)=>{
promiseArray = JSON.parse(JSON.stringify(res[0])) promiseArray = JSON.parse(JSON.stringify(res[0]))
var imgList = JSON.parse(JSON.stringify(res[0]))//用于图片自裁剪
var promiseArrayNum= promiseArray[promiseArray.length-1].top var promiseArrayNum= promiseArray[promiseArray.length-1].top
console.log('获取到信息头部:', res[0])
for(let i=0;i<promiseArray.length;i++){ console.log(this.screenWidth)
for(let i=0;i<=promiseArray.length-1;i++){
if(i==promiseArray.length-1){//处理背景图
let type = 'image'
let src= promiseArray[i].dataset.src
let posX = parseInt(promiseArray[i].dataset.tailorx/750*this.screenWidth) //图片所在画板的X轴数据
let posY = parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth) //图片所在画板的Y轴数据
let width = promiseArray[i].width//图片原始的宽度
let height = promiseArray[i].height//图片原始的高度
let swidth = promiseArray[i].width//要使用的图像的宽度
let sheight = promiseArray[i].height//要使用的图像的高度
promiseArray[i]={
type:'image',
src: src,
width:width,
height: height,
swidth,
sheight,
posX:posX,
posY:posY,
}
}else{//处理置入的图片
let type = 'image' let type = 'image'
let src= promiseArray[i].dataset.src let src= promiseArray[i].dataset.src
let posX = parseInt(promiseArray[i].dataset.tailorx/750*this.screenWidth) //如果向左位移则需要用框的 let posX = parseInt(promiseArray[i].dataset.tailorx/606*this.screenWidth) //图片所在画板的X轴数据
let posY = parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth)//parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth) let posY = parseInt(promiseArray[i].dataset.tailory/606*this.screenWidth) //图片所在画板的Y轴数据
let tailorx = parseInt(promiseArray[i].dataset.tailorx/750*this.screenWidth)-promiseArray[i].left //截图的初始X和Y轴
let tailorx = parseInt(promiseArray[i].dataset.tailorx/606*this.screenWidth)-promiseArray[i].left
if(tailorx<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0 if(tailorx<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0
tailorx = 0 tailorx = 0
} }
let tailory = parseInt(promiseArray[i].dataset.tailory/750*this.screenWidth)-(promiseArray[i].top-promiseArrayNum) let tailory = parseInt(promiseArray[i].dataset.tailory/606*this.screenWidth)-(promiseArray[i].top-promiseArrayNum)
if(tailory<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0 if(tailory<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0
tailory = 0 tailory = 0
} }
let width = promiseArray[i].width let width = promiseArray[i].width//图片原始的宽度
let height = promiseArray[i].height let height = promiseArray[i].height//图片原始的高度
let swidth = parseInt(promiseArray[i].dataset.widthonce/750*this.screenWidth)///750*this.screenWidth let swidth = parseInt(promiseArray[i].dataset.widthonce/606*this.screenWidth)//要使用的图像的宽度
let sheight = parseInt(promiseArray[i].dataset.heightonce/750*this.screenWidth)///750*this.screenWidth let sheight = parseInt(promiseArray[i].dataset.heightonce/606*this.screenWidth)//要使用的图像的高度
promiseArray[i]={ promiseArray[i]={
type:'image', type:'image',
src: src, src: src,
...@@ -221,6 +288,8 @@ export default { ...@@ -221,6 +288,8 @@ export default {
tailory:tailory, tailory:tailory,
} }
} }
}
console.log('获取到信息:', promiseArray) console.log('获取到信息:', promiseArray)
this.drowImg(promiseArray) this.drowImg(promiseArray)
}) })
...@@ -245,22 +314,24 @@ export default { ...@@ -245,22 +314,24 @@ export default {
// 这里开始绘制canvas内容,绘制的过程当中,不知道是小程序的问题,还是什么问题在绘制有背景图片的内容时, // 这里开始绘制canvas内容,绘制的过程当中,不知道是小程序的问题,还是什么问题在绘制有背景图片的内容时,
// 文字内容必须要延迟绘制,也就是要定时器延迟一定时间才能绘制,要不然就会将文字覆盖在图片下方。 // 文字内容必须要延迟绘制,也就是要定时器延迟一定时间才能绘制,要不然就会将文字覆盖在图片下方。
// 图片的绘制 // 图片的绘制
for(let i = 0; i < promiseArray.length; i++){ for(let i = 0; i <= promiseArray.length-1; i++){
const tx = textCanvas.createImage() const tx = textCanvas.createImage()
tx.src = promiseArray[i].src // 线上地址或者本地地址都可以 tx.src = promiseArray[i].src // 线上地址或者本地地址都可以
tx.width = promiseArray[i].width tx.width = promiseArray[i].width
tx.height = promiseArray[i].height tx.height = promiseArray[i].height
tx.onload = () => { tx.onload = () => {
// 图片 裁剪 :X Y 宽度 高度 // 图片 裁剪 :X Y 宽度 高度
//promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth, promiseArray[i].sheight-1, if(i==promiseArray.length-1){//背景
if(i==promiseArray.length-1){ console.log('123456')
textCtx.drawImage(tx, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight) textCtx.drawImage(tx, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight)
}else{ }else{//插入的图片
textCtx.drawImage(tx,promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth, promiseArray[i].sheight*1.72, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight) //promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth, promiseArray[i].sheight*1.72,
textCtx.drawImage(tx,promiseArray[i].tailorx,promiseArray[i].tailory,promiseArray[i].swidth*1.03, promiseArray[i].sheight*1.4, promiseArray[i].posX, promiseArray[i].posY,promiseArray[i].swidth, promiseArray[i].sheight)
} }
} }
} }
this.textCanvasType=false
}) })
}, },
} }
...@@ -294,13 +365,13 @@ export default { ...@@ -294,13 +365,13 @@ export default {
} }
} }
.jigsaw-picture{ .jigsaw-picture{
width: 750rpx; width: 606rpx;
height: 1100rpx; height: 910rpx;
margin-top: 86rpx; margin: 38rpx auto 0 auto;
position: relative; position: relative;
.picture-backgrounImg{ .picture-backgrounImg{
width: 750rpx; width: 606rpx;
height: 1100rpx; height: 910rpx;
} }
.picture-position{ .picture-position{
border:solid 1px #333333; border:solid 1px #333333;
...@@ -308,7 +379,6 @@ export default { ...@@ -308,7 +379,6 @@ export default {
position: absolute; position: absolute;
image{ image{
display: block; display: block;
height: 100%;
} }
} }
.picture-positionBox{ .picture-positionBox{
...@@ -321,151 +391,224 @@ export default { ...@@ -321,151 +391,224 @@ export default {
} }
.jigsaw-canvas{ .jigsaw-canvas{
display: block; display: block;
width: 750rpx; width: 606rpx;
height: 1100rpx; height: 910rpx;
} }
.jigsaw-canvasMask{ .jigsaw-canvasMask{
display: block; display: block;
width: 750rpx; width: 606rpx;
padding-top: 86rpx; padding-top: 38rpx;
margin: auto;
position: absolute; position: absolute;
left: 0; left: 0;
right: 0;
z-index: -10; z-index: -10;
} }
.jigsaw-canvasMaskAct{ .jigsaw-canvasMaskAct{
z-index: 100; z-index: 100;
} }
.jigsaw-template{ .myPhoto-title{
display: flex;
width: 100%; width: 100%;
height: 180rpx; height: 100rpx;
padding: 20rpx; padding: 32rpx 40rpx 0 40rpx;
background-color: #fff; background-color: #fff;
overflow: auto; display: flex;
position: fixed; justify-content: space-between;
bottom: 100rpx; .title-click{
left: 0; height: 68rpx;
z-index: 110; font-weight: 600;
.template-list{ font-size: 28rpx;
width: 108rpx; color: #999999;
height: 160rpx; line-height: 28rpx;
border-radius: 9rpx;
border: 3rpx solid #EDEDED;
box-sizing: border-box;
margin-right: 20rpx;
position: relative; position: relative;
.list-img{ .click-line{
display: block; display: none;
width: 92rpx; width: 100%;
height: 138rpx; height: 6rpx;
margin: auto; background: #000000;
border-radius: 4rpx;
position: absolute; position: absolute;
top: 0; bottom: 18rpx;
right: 0;
bottom: 0;
left: 0; left: 0;
} }
} }
.template-listAct{ .title-clickAct{
border: 3rpx solid #FE6600; font-size: 30rpx;
color: #333333;
.click-line{
display: block;
} }
} }
.jigsaw-btoom{ }
display: flex; .myPhoto-bottom{
justify-content: space-between;
width: 100%; width: 100%;
height: 100rpx; height: 464rpx;
padding: 18rpx 32rpx 0 20rpx;
background-color: #fff;
position: fixed; position: fixed;
bottom: 0;
left: 0; left: 0;
z-index: 110; bottom: 0;
.bottom-pictureFrame{ z-index: 30;
display: flex; .bottom-tips{
width: 324rpx; width: 726rpx;
padding-top: 6rpx; height: 64rpx;
overflow: auto; background: #FFEFC9;
.pictureFrame{ border-radius: 8rpx 8rpx 0rpx 0rpx;
width: 108rpx; box-sizing: border-box;
height: 48rpx;
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #9A5500;
line-height: 48rpx; padding: 0 26rpx;
text-align: center; line-height: 64rpx;
} margin: 0 auto;
.pictureFrameAct{
background: #F7F8FA;
border-radius: 24rpx;
color: #333333;
font-weight: 600;
}
} }
.bottom-feature{
width: 100%;
height: 400rpx;
background-color: #fff;
padding: 0rpx 0rpx 0 0rpx;
.feature-message{
display: flex;
justify-content: space-between;
border-top: 2rpx solid #F5F5F5;
padding: 0 40rpx 0 40rpx;
height: 120rpx;
.message-trading{ .message-trading{
display: flex; display: flex;
position: relative; position: relative;
margin-top: 20rpx;
.trading-btn{ .trading-btn{
width: 160rpx; width: 220rpx;
height: 64rpx; height: 80rpx;
position: relative; position: relative;
} }
.trading-left{ .trading-left{
background: #FF9F43; background: #FFB143;
border-radius: 200rpx 0rpx 0rpx 200rpx; border-radius: 40rpx 0rpx 0rpx 40rpx;
image{
width: 40rpx;
height: 40rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.trading-num{
width: 42rpx;
height: 44rpx;
border-radius: 50%;
background: #FFFFFF;
line-height: 44rpx;
text-align: center; text-align: center;
font-weight: bold; line-height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
color: #FE6600; font-weight: 600;
position: absolute; text-align: center;
right: 12rpx; color: #FFFFFF;
top: -22rpx;
} }
.trading-right{ .trading-right{
background: #FE6600; background: #FE6600;
border-radius: 0rpx 200rpx 200rpx 0rpx; border-radius: 0rpx 200rpx 200rpx 0rpx;
text-align: center; text-align: center;
line-height: 64rpx; line-height: 80rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
color: #FFFFFF; color: #FFFFFF;
} }
} }
.message-inPhoto{
width: 60rpx;
margin-top: 24rpx;
position: relative;
.inPhoto-img{
display: block;
width: 44rpx;
height: 44rpx;
margin: 0 auto 4rpx auto;
} }
.jigsaw-switch{ .inPhoto-text{
width: 52rpx; font-weight: 400;
height: 52rpx; font-size: 20rpx;
position: fixed; color: #666666;
bottom: 220rpx; text-align: center;
right: 32rpx; line-height: 20rpx;
z-index: 110; }
.inPhoto-num{
width: 24rpx;
height: 24rpx;
background: #FFFFFF;
border-radius: 12rpx;
border: 2rpx solid #FE6600;
font-size: 18rpx;
color: #FE6600;
line-height: 20rpx;
text-align: center;
position: absolute;
right: -2rpx;
top: -4rpx;
}
}
}
.feature-warn{
display: flex;
width: 750rpx;
height: 180rpx;
padding: 0 40rpx 20rpx 40rpx;
overflow-x: scroll;
white-space: nowrap;
.warn-pattern{
flex: 0 0 auto;
width: 108rpx;
height: 160rpx;
background: #FFFFFF;
border-radius: 9rpx;
border: 3rpx solid #EDEDED;
position: relative;
.pattern-img{
display: block;
width: 91rpx;
height: 133rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.warn-patternAct{
border: 3rpx solid #FE6600;
}
}
}
}
.myPhoto-bottomAct{
height: 384rpx;
.bottom-checkCase{
height: 320rpx;
background-color: #fff;
.checkCase-title{
padding-top: 40rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: center;
position: relative;
image{
display: block;
width: 40rpx;
height: 40rpx;
position: absolute;
top: 40rpx;
right: 24rpx;
}
}
.checkCase-btn{
padding: 70rpx 120rpx 0 120rpx;
display: flex;
justify-content: space-between;
.btn-list{
image{ image{
display: block; display: block;
width: 52rpx; width: 60rpx;
height: 52rpx; height: 60rpx;
margin: 0 auto 16rpx auto;
}
view{
font-weight: 600;
font-size: 24rpx;
color: #333333;
line-height: 34rpx;
}
}
} }
} }
.jigsaw-switchAct{
bottom: 144rpx;
} }
</style> </style>
<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>
&nbsp;
</view>
<view class="login-title">
<view class="title-cn">获取相片</view>
<view class="title-en">Get Photos</view>
</view>
<view class="login-list">
<image class="list-img" src="../static/album/longin02.png"></image>
<input class="uni-input list-input" placeholder="请输入摄影时预留手机号" />
</view>
<view class="login-list login-listAct">
<image class="list-img" src="../static/album/longin01.png"></image>
<input class="uni-input list-input" placeholder="请输入验证码" />
<view class="list-verification">获取验证码</view>
</view>
<view class="login-btn">
登陆
</view>
</view>
</template>
<script>
export default {
data() {
return {
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
}
},
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
})
},
}
}
</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{
color: #333333;
margin: auto;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
}
}
.login-title{
margin-top: 80rpx;
padding: 0 56rpx 0 56rpx;
margin-bottom: 104rpx;
.title-cn{
font-weight: 600;
font-size: 40rpx;
color: #333333;
line-height: 56rpx;
margin-bottom: 16rpx;
}
.title-en{
font-size: 28rpx;
color: #999999;
line-height: 32rpx;
}
}
.login-list{
display: flex;
width: 636rpx;
height: 98rpx;
background: #F9F9F9;
border-radius: 50rpx;
margin: 0 auto 40rpx auto;
padding: 0 40rpx 0 52rpx;
.list-img{
display: block;
width: 44rpx;
height: 44rpx;
margin-top: 28rpx;
margin-right: 24rpx;
}
.list-input{
flex: 1;
height: 98rpx;
font-weight: 400;
font-size: 28rpx;
color: #BDC3CE;
}
.list-verification{
font-weight: 400;
font-size: 28rpx;
color: #FE6600;
line-height: 98rpx;
}
}
.login-listAct{
margin-bottom: 0;
}
.login-btn{
width: 638rpx;
height: 98rpx;
background: linear-gradient( 90deg, #FFA000 0%, #FE6600 100%);
margin: 0 auto;
border-radius: 50rpx;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
line-height: 98rpx;
text-align: center;
margin-top: 80rpx;
}
</style>
<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 v-if="photoList.length==0" class="scanCode-noPhoto">
<image src="../static/album/icon12.png"></image>
<view>暂无下载相片</view>
</view>
<!--横线-->
<view class="casnCode-Line"></view>
<!--当图片列表-->
<view class="casnCode-photoCase">
<template v-for="(item,index) in photoList">
<!--:class="item.checkType==true?'photoCase-listAct':''" 点击后红线 暂时放弃-->
<view class="photoCase-list" :key="index" @longtap="longTapDel(index)" @click="photoDelHide(index)">
<!-- <view class="list-title">已下载</view> -->
<checkbox-group @click.stop.native="()=>{}" @change="stopPhoto(index)" v-if="photoListShow==true">
<checkbox :checked="item.checkType" class="pictureFrame-check" :class="item.checkType==true?'pictureFrame-checkAct':''" />
</checkbox-group>
<image class="list-img" :src="item.url"></image>
<view class="list-delCase" @click.stop.native="longTapDelHide(index)" v-if="item.delType==true">
<view class="list-del" @click.stop.native="()=>{}">
<u-icon name="trash-fill"></u-icon>
</view>
</view>
<!-- <view class="list-bttom">点击图片编辑</view> -->
</view>
</template>
<view class="photoCase-add">
<view class="add-label">
<u-icon name="plus-circle-fill"></u-icon>
<view class="label-text">添加照片</view>
</view>
</view>
</view>
<!--脚部按钮显示-->
<view class="scanCode-btn">
<view class="btn-style" v-if="photoListType!=true">
本地上传
</view>
<view class="btn-style" v-else @click="compometsBuyFun()">
下一步
</view>
</view>
<!--脚部提示文字-->
<view class="scanCode-tips">
禁止上传反动、色情、暴力等非法及涉密图片,如有违反, 所有责任由用户自行承担.
</view>
<!--购买-->
<compometsBuy v-if="compometsBuyType==true"></compometsBuy>
</view>
</template>
<script>
import compometsBuy from './../albumComponets/compometsBuy/compometsBuy.vue'
export default {
components: {
compometsBuy
},
data() {
return {
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
photoList:[
{
url:'https://i1.hdslb.com/bfs/archive/f2fb0e1e4da68f67efa9fc831200bd31699976f7.jpg',
checkType:false,
delType:false,
},
{
url:'https://media.9game.cn/gamebase/ieu-gdc-pre-process/images/20240716/2/2/f808b789231e61009385f81a96ec400e.jpg',
checkType:false,
delType:false,
},
],//相片列表
photoListType:false,//当有相片选择为true
photoListShow:true,//选择后显隐刷新页面
compometsBuyType:false,//点击下一步 限时购买按钮
}
},
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
})
},
stopPhoto(index){//相片选择
this.photoListShow = false
if(this.photoList[index].checkType==true){
this.photoList[index].checkType=false
}else{
this.photoList[index].checkType=true
}
this.photoListType = false
this.photoList.forEach((item,index)=>{//是否被选中的图片 有则底部按钮显示未下一步
if(item.checkType==true){
this.photoListType = true
}
})
this.photoListShow = true
},
longTapDel(index){//长按删除相片按钮出现
this.photoList[index].delType=true
},
longTapDelHide(index){//点击删除按钮隐藏
this.photoList[index].delType=false
},
photoDelHide(index){//点击若无删除 则触发多选
if(this.photoList[index].delType==true){
return
}else{
this.stopPhoto(index)
}
},
compometsBuyFun(){//点击下一步显示购买页面
this.compometsBuyType = true
},
}
}
</script>
<style scoped lang="scss">
.albumBox{
display: flex;
flex-direction:column;
height: 100vh;
background-color: #fff;
padding-bottom: 230rpx;
overflow: auto;
}
.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;
}
}
.scanCode-noPhoto{
width: 400rpx;
height: 400rpx;
margin: auto;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
image{
display: block;
width: 400rpx;
height: 400rpx;
}
view{
width: 100%;
font-weight: 400;
font-size: 28rpx;
color: #666666;
line-height: 40rpx;
text-align: center;
position: absolute;
left: 0;
bottom: 16rpx;
}
}
.scanCode-btn{
width: 100%;
height: 120rpx;
box-sizing: border-box;
border-top: solid 2rpx #EDEDED;
padding-top: 18rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: 10;
.btn-style{
width: 670rpx;
height: 80rpx;
margin: 0 auto;
background: linear-gradient( 119deg, #FFA000 0%, #FE6600 100%);
border-radius: 40rpx;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
}
}
.casnCode-Line{
width: 750rpx;
height: 20rpx;
}
.casnCode-photoCase{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
width: 100%;
padding: 24rpx;
.photoCase-list{
width: 340rpx;
height: 470rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 8rpx 0rpx #ECF0FB;
border-radius: 8rpx;
border: 4rpx solid #E6E6E6;
box-sizing: border-box;
padding: 2rpx;
margin-bottom: 24rpx;
position: relative;
.list-img{
width: 100%;
height: 100%;
}
.list-title{
width: 100rpx;
height: 52rpx;
background: #333333;
border-radius: 8rpx 0rpx 8rpx 0rpx;
opacity: 0.5;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
line-height: 52rpx;
text-align: center;
position: absolute;
top: 6rpx;
left: 6rpx;
}
.list-bttom{
width: 328rpx;
height: 52rpx;
margin: auto;
background: #333333;
border-radius: 0rpx 0rpx 8rpx 8rpx;
opacity: 0.5;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
line-height: 52rpx;
text-align: center;
position: absolute;
bottom: 4rpx;
left: 6rpx;
}
.pictureFrame-check{
width: 32rpx;
height: 32rpx;
background: transparent;
position: absolute;
top: -1rpx;
right: 7rpx;
z-index: 11;
/deep/ .wx-checkbox-input{
width: 32rpx;
height: 32rpx;
background: rgba(255,255,255,1);//transparent;
border: 2rpx solid #C7C7C7;
}
/deep/ .wx-checkbox-input.wx-checkbox-input-checked {
background: #FE6600; // 选中的颜色
}
/deep/ .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff; // 选中后的图标默认是对号,这里吧对号变成透明颜色,就看不出来了
}
}
.pictureFrame-checkAct{
/deep/ .wx-checkbox-input{
border: solid 1px #FE6600;
}
}
.list-del{
width: 150rpx;
height: 150rpx;
border-radius: 100rpx;
background: #333333;
opacity: 0.5;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
/deep/ .u-icon--right{
height: 150rpx;
}
/deep/ .u-icon__icon{
color: #FFFFFF !important;
font-size: 90rpx !important;
margin: 0 auto;
}
}
.list-delCase{
width: 340rpx;
height: 470rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
.photoCase-listAct{
border: 4rpx dashed #F53F3F;
}
.photoCase-add{
width: 340rpx;
height: 470rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 8rpx 0rpx #ECF0FB;
border-radius: 8rpx;
border: 2rpx solid #F5F5F5;
position: relative;
margin-bottom: 24rpx;
.add-label{
width: 100%;
height: 162rpx;
margin: auto;
position: absolute;
top: 0;
bottom: 0;
.label-text{
margin-top: 34rpx;
font-weight: 400;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: center;
}
/deep/ .u-icon--right{
height: 90rpx;
}
/deep/ .u-icon__icon{
color: #165DFF !important;
font-size: 90rpx !important;
margin: 0 auto;
}
}
}
}
.scanCode-tips{
width: 686rpx;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 34rpx;
margin: auto;
position: fixed;
left: 0;
right: 0;
bottom: 160rpx;
}
</style>
<template> <template>
<view class="productBigBox"> <view class="productBigBox">
<view class="product-SearchBox"> <!--头部点击选择类型-->
<!--头部切换--> <view class="order-search">
<view class="product-orderState"> <view class="search-list" :class="orderStatus===''?'search-listAct':''" @click="screenChange('')">
<view class="orderState-click" :class="orderStatus===''?'orderState-clickAct':''" @click="screenChange('')">
全部 全部
<view class="click-line"> <view class="list-line"></view>
<text></text>
</view> </view>
</view> <view class="search-list" :class="orderStatus==='0'?'search-listAct':''" @click="screenChange('0')">
<view class="orderState-click" :class="orderStatus==='0'?'orderState-clickAct':''" @click="screenChange('0')">
待付款 待付款
<view class="click-line"> <view class="list-line"></view>
<text></text>
</view>
</view> </view>
<view class="orderState-click" :class="orderStatus=='2'?'orderState-clickAct':''" @click="screenChange('2')"> <view class="search-list" :class="orderStatus==='2'?'search-listAct':''" @click="screenChange('2')">
待使用 待使用
<view class="click-line"> <view class="list-line"></view>
<text></text>
</view>
</view> </view>
<view class="orderState-click" :class="orderStatus=='3'?'orderState-clickAct':''" @click="screenChange('3')"> <!--暂无包邮-->
<view class="search-list" :class="orderStatus==='3'?'search-listAct':''" @click="screenChange('3')" style="display: none;">
待收货 待收货
<view class="click-line"> <view class="list-line"></view>
<text></text>
</view> </view>
</view> <view class="search-list" :class="orderStatus==='5'?'search-listAct':''" @click="screenChange('5')">
<view class="orderState-click" :class="orderStatus=='5'?'orderState-clickAct':''" @click="screenChange('5')">
待评价 待评价
<view class="click-line"> <view class="list-line"></view>
<text></text>
</view>
</view>
</view>
<!--查询-->
<view class="product-searchBt">
<view class="searchBt-left" @click="orderShow=true">
<text>{{orderName}}</text>
<u-icon v-if="orderShow==false" name="arrow-down" color="#333333" size="20"></u-icon>
<u-icon v-else name="arrow-up" color="#333333" size="20"></u-icon>
<u-picker mode="selector" :show="orderShow" :default-selector="[orderType]" :columns="option" keyName="cateName" @confirm="industrysTypeConfirm($event)" @cancel="cancel"></u-picker>
</view>
<text @click="showQueryPhone()">手机查询</text>
</view> </view>
</view> </view>
<!--手机查询遮罩--> <!--头部搜索 手机号-->
<u-popup mode="bottom" :show="phoneQuery"> <view class="order-phoneSearch">
<view class="content"> <view class="phoneSearch-type" @click="show = true">
<view class="content-title"> <u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker>
订单查询 <view class="type-boxOn">
<u-icon name="close" color="#333333" size="28" @click="phoneQuery=false"></u-icon> {{showAddress}}
<view class="address-triangle"></view>
</view> </view>
<view class="content-list">
<text class="list-name">手机号码</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristPhone" />
</view> </view>
<view class="content-list"> <u-search placeholder="搜索手机号" v-model="phoneNum" shape="round" :showAction="false" :clearabled="true"></u-search>
<text class="list-name">姓名</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristName" />
</view> </view>
<view class="confrim-btn"> <!--身体列表-->
<u-button @click="queryPhoneOrder()">查询</u-button> <template v-if="lists.length>0"><!--判断是否有数-->
</view>
</view>
</u-popup>
<!--列表-->
<view class="product-goods" v-if="lists.length>0">
<template v-for="(item,index) in lists"> <template v-for="(item,index) in lists">
<view class="product-block" :key="index" v-if="item.showList" @click="orderJump(item.id,item.orderType)"> <view class="order-list" :key="index" v-if="item.showList" @click="orderJump(item.id,item.orderType)">
<view class="block-title"> <view class="list-title">
<view class="title-left"> <view class="title-left">
<view class="left-imgBox" v-if="item.orderType==1"> <image v-if="item.orderType==1" src="../../static/orderList/iconjingqumenpiao.png"></image>
<image class="left-img" src="../../static/orderList/iconjingqumenpiao.png"></image> <image v-else-if="item.orderType==2" src="../../static/orderList/iconjiudian.png"></image>
</view> <image v-else-if="item.orderType==3" src="../../static/orderList/iconcanyin.png"></image>
<view class="left-imgBox" v-else-if="item.orderType==2"> <image v-else-if="item.orderType==4" src="../../static/orderList/iconliwu1.png"></image>
<image class="left-img" src="../../static/orderList/iconjiudian.png"></image> <image v-else-if="item.orderType==5" src="../../static/orderList/iconchuzuche.png"></image>
</view> <image v-else-if="item.orderType==10" src="../../static/orderList/iconzuhe.png"></image>
<view class="left-imgBox" v-else-if="item.orderType==3"> <image v-else src="../../static/orderList/iconqita.png"></image>
<image class="left-img" src="../../static/orderList/iconcanyin.png"></image> <view>门票</view>
</view> </view>
<view class="left-imgBox" v-else-if="item.orderType==4"> <view class="title-right" v-if="item.orderType!=10&&item.orderType!=0">
<image class="left-img" src="../../static/orderList/iconliwu1.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==5">
<image class="left-img" src="../../static/orderList/iconchuzuche.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==10">
<image class="left-img" src="../../static/orderList/iconzuhe.png"></image>
</view>
<view class="left-imgBox" v-else>
<image class="left-img" src="../../static/orderList/iconqita.png"></image>
</view>
<text class="left-Name">{{item.merchantName}}({{item.productName}})</text>
</view>
<view class="title-right" v-if="item.orderType!=0">
<template v-if="item.orderType==1&&item.subOrderType!=4"> <template v-if="item.orderType==1&&item.subOrderType!=4">
{{item.orderStatus|orderStatus1}} {{item.orderStatus|orderStatus1}}
</template> </template>
<template v-else-if="item.orderType==10&&item.subOrderType!=4">
{{item.orderStatus|orderStatus1}}
</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4"> <template v-else-if="item.orderType==2&&item.subOrderType!=4">
{{item.orderStatus|orderStatus2}} {{item.orderStatus|orderStatus2}}
</template> </template>
...@@ -118,11 +68,9 @@ ...@@ -118,11 +68,9 @@
</template> </template>
</view> </view>
</view> </view>
<view class="block-main"> <view class="list-name">{{item.merchantName}}({{item.productName}})</view>
<view class="mian-InfoWrap"> <view class="list-time">
<view class="InfoWrap-mb30">订单时间:{{item.playDate.substr(0,10)}}</view> {{item.playDate.substr(0,10)}} 有效·
<view>
购买数量:
<template v-if="item.orderType==1&&item.subOrderType!=4">{{item.orderNum}}</template> <template v-if="item.orderType==1&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">{{item.orderNum}}</template> <template v-else-if="item.orderType==2&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">{{item.orderNum}}</template> <template v-else-if="item.orderType==3&&item.subOrderType!=4">{{item.orderNum}}</template>
...@@ -130,48 +78,22 @@ ...@@ -130,48 +78,22 @@
<template v-else-if="item.orderType==10&&item.subOrderType!=4">{{item.orderNum}}</template> <template v-else-if="item.orderType==10&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else>{{item.orderNum}}</template> <template v-else>{{item.orderNum}}</template>
</view> </view>
<view class="allPice"> <view class="list-tips">凭「胖丁动态二维码」直接验证使用</view>
<text>¥</text>{{item.totalMoney}} <view class="list-money">¥{{item.totalMoney}}</view>
</view> <view class="list-btn">
</view> <view class="btn-style">下载照片</view>
<view class="main-right"> <view class="btn-style">导航取片</view>
<u-icon name="arrow-right" color="#333333" size="28"></u-icon>
</view>
</view>
<view class="block-Btn">
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==9||item.orderStatus==10">删除</view>
<view class="block-button" @click.stop="operation(item,index)" v-if="item.orderStatus==0">取消订单</view>
<template v-if="item.orderType==4"><!--特产-->
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">查看详情</view>
<view class="block-button" v-if="item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10">查看物流</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<template v-else>
<template v-if="item.subOrderType!=4">
<view class="block-button" v-if="item.orderStatus==1||item.orderStatus==2||item.orderStatus==4||item.orderStatus==5||item.orderStatus==10" @click.stop="orderJump(item.id,item.orderType)">{{item.orderStatus==2?'去使用':'查看详情'}}</view>
</template>
<view class="block-button" v-if="item.orderStatus==2&&item.isRefund!=0&&item.isRefund!=3||item.orderStatus==7&&item.isRefund!=0&&item.isRefund!=3" @click.stop="refundJump(item.id)">退款/售后</view>
<!-- <view class="block-button" v-if="item.orderStatus==5">评价</view> -->
</template>
<view class="block-button block-buttonOrange" v-if="item.orderStatus==0">去支付</view>
</view> </view>
</view> </view>
</template> </template>
<view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view> <view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view>
</view> </template>
<view class="product-goods" v-else> <view class="order-No" v-else>暂无订单信息</view>
<view class="order-No">暂无订单信息</view>
</view>
<!-- <u-toast ref="uToast" /> -->
<u-modal :show="configShow" show-cancel-button="true" :content="configTitle" @confirm="operationEnter()" @cancel="operationClose()"></u-modal>
</view> </view>
</template> </template>
<script> <script>
// import uPicker from '@/uview-ui/components/u-picker/u-picker.vue'
// import uPopup from '@/uview-ui/components/u-popup/u-popup.vue'
// import uToast from '@/uview-ui/components/u-toast/u-toast.vue'
// import uModal from '@/uview-ui/components/u-modal/u-modal.vue'
export default { export default {
filters:{ filters:{
orderType(i){//订单类型 orderType(i){//订单类型
...@@ -401,137 +323,89 @@ export default { ...@@ -401,137 +323,89 @@ export default {
} }
}, },
components: { components: {
// uPicker,
// uPopup,
// uToast,
// uModal
}, },
data() { data() {
return { return {
queryLoad:false,//查询加载图标显示隐藏 //顶部参数
phoneQuery:false,//手机查询显示隐藏 orderStatus:'',//头部类型选择
touristPhone:'',//旅客电话 //手机搜索
touristName:'',//旅客姓名 show: false,//遮罩显隐---项目
orderStatus:'',//订单状态 columns: [//遮罩列表---项目
nodataShow:false,//没有数据时展示 [
{label: '类型',id: ''},
{label: '全部',id: 0},
{label: '景区',id: 1},
{label: '酒店',id: 2},
{label: '餐饮',id: 3},
{label: '特产',id: 4},
// {label: '运营车',id: 5},
// {label: '组合订单',id: 10},
]
],
showAddress:'类型',//显示内容---项目
phoneNum:'',//搜索手机号
//主数据分区
lists:[],//数据 lists:[],//数据
orderType:0,//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单 //分页
orderName:'全部',//筛选 //1景区,2酒店,3餐饮,4特产,5运营车,10组合订单
orderShow:false,
option: [[
{ cateName: '全部', id: 0 },
{ cateName: '景区', id: 1 },
{ cateName: '酒店', id: 2 },
{ cateName: '餐饮', id: 3 },
{ cateName: '特产', id: 4 },
// { cateName: '运营车', id: 5 },
// { cateName: '组合订单', id: 10 },
]],
isTrue:true,//截留 防止重复加载 isTrue:true,//截留 防止重复加载
pageIndex:1,//当前页 pageIndex:1,//当前页
pageTotal:0,//总条数 pageTotal:0,//总条数
configShow:false,//删除订单确认框 //定时请求
configTitle:'',//弹窗title timerOutClear:null,
operationItem:null,//操作项的数据 删除和取消订单 //其他
operationIndex:null,//操作下标
callbackurl:'',//回调页面
ifNotice:'',//是否通知
openId:'',
ifyukuaiCode:'',//渝快付 ifyukuaiCode:'',//渝快付
dataLengthType:false,//上拉加载无更多数据时显示 dataLengthType:false,//上拉加载无更多数据时显示
timerOutClear:null,
} }
}, },
onLoad(option) { onLoad(option) {
this.openId = uni.getStorageSync('openid') this.openId = uni.getStorageSync('openid')
//this.openId = 'oroHZ5FaUQ_SOOC_uQQP92fJpBRE'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE this.openId = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE
this.orderStatus = option.orderStatus||'' this.orderStatus = option.orderStatus||''
this.ifyukuaiCode = option.ifyukuaiCode||'' this.ifyukuaiCode = option.ifyukuaiCode||''
this.getData(1) this.getData()
}, },
onShow(){ onShow(){
this.pageIndex = 1 this.pageIndex = 1
this.getData(1) this.lists = [] //主要数据存储
this.getData()
}, },
methods: { onReachBottom(){//上拉加载
screenChange(i){//顶部导航切换 this.pageIndex++
this.orderStatus = i this.getData()
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
}, },
industrysTypeConfirm(e) {//单列----分类 点击确定 onUnload() {
console.log('confirm', e) if(this.timerOutClear) {
this.orderType = e.value[0].id clearTimeout(this.timerOutClear)
this.orderName = e.value[0].cateName this.timerOutClear = null
this.pageIndex = 1 }
this.pageTotal = 0 //隐藏加载框
this.isTrue = true uni.hideLoading()
this.lists = []
this.getData(1)
this.cancel()
}, },
cancel() {//单列 点击取消 methods: {
this.orderShow = false screenChange(i){//顶部导航切换
this.orderStatus = i //当前选择的数字
this.pageIndex = 1 //页码
this.pageTotal = 0 //总数
this.isTrue = true //是否同意请求
this.lists = [] //主要数据存储
this.getData()
}, },
showQueryPhone(){//展示手机查询弹窗 addressFun(e){//项目选择
this.touristPhone='' this.showAddress = e.value[0].label
this.touristName='' this.show=false
this.phoneQuery=true
}, },
queryPhoneOrder(){//通过手机号查看订单 getData(){//数据加载
if(!(/^1[34578]\d{9}$/.test(this.touristPhone))){
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
if(this.touristName==''){
uni.showToast({
title: '姓名不可为空',
icon: 'none'
})
return
}
let data={
openid:this.openId,//用户Id
touristPhone:this.touristPhone,//旅客电话
touristName:this.touristName,//旅客姓名
}
this.queryLoad=true
this.$request('order/pdOrder/findOrderInfoByPhone',data).then((res)=>{
this.queryLoad=false
if(res.code=='00'){
this.phoneQuery=false
// uni.navigateTo({
// url: '/pages/my/order/productList/productList'
// })
this.pageIndex = 1
this.getData(1)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getData(flag){//获取订单列表
this.nodataShow = false
//显示加载框 //显示加载框
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}) })
if(this.isTrue){ if(this.isTrue){
this.isTrue = false this.isTrue = false
var data = {}
if(this.orderStatus=='2'){//点击的待使用 if(this.orderStatus=='2'){//点击的待使用
var orderStatusList=[2,4,5] var orderStatusList=[2,4,5]
var data={ data={
pageIndex:this.pageIndex, pageIndex:this.pageIndex,
pageSize:20, pageSize:20,
orderType:this.orderType==0?'':this.orderType, orderType:this.orderType==0?'':this.orderType,
...@@ -539,7 +413,7 @@ export default { ...@@ -539,7 +413,7 @@ export default {
userId:this.openId userId:this.openId
} }
}else{ }else{
var data={ data={
pageIndex:this.pageIndex, pageIndex:this.pageIndex,
pageSize:20, pageSize:20,
orderType:this.orderType==0?'':this.orderType, orderType:this.orderType==0?'':this.orderType,
...@@ -549,17 +423,13 @@ export default { ...@@ -549,17 +423,13 @@ export default {
} }
this.$request('order/userOrder/findOrderList',data) this.$request('order/userOrder/findOrderList',data)
.then((res)=>{ .then((res)=>{
var ret = res if(res.code=='00'){
if(ret.code=='00'){ if(res.data.list.length>0){
if(flag==1){//第一次加载
this.lists = []
}
if(ret.data.list.length>0){
this.dataLengthType = true this.dataLengthType = true
}else{ }else{
this.dataLengthType = false this.dataLengthType = false
} }
ret.data.list.forEach((item)=>{ res.data.list.forEach((item)=>{
if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示 if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示
if(item.pid){ if(item.pid){
...@@ -567,19 +437,15 @@ export default { ...@@ -567,19 +437,15 @@ export default {
this.lists.push(item) this.lists.push(item)
} }
}else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单 }else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单
//item.orderType!=10&& if(item.orderType!=10&&item.orderType!=4){
if(item.orderType!=4&&item.productCode!=''){
this.lists.push(item) this.lists.push(item)
} }
}else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单 }else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单
//item.orderType!=10&& if(item.orderType!=10&&item.orderType==4){
if(item.orderType==4&&item.productCode!=''){
this.lists.push(item) this.lists.push(item)
} }
}else if(this.orderStatus=='5'){//待评价不能显示组合订单 }else if(this.orderStatus=='5'){//待评价不能显示组合订单
// if(item.orderType!=10){ if(item.orderType!=10){
// }
if(item.productCode!=''){
this.lists.push(item) this.lists.push(item)
} }
}else{ }else{
...@@ -589,28 +455,24 @@ export default { ...@@ -589,28 +455,24 @@ export default {
} }
}) })
this.isTrue = true this.isTrue = true
this.pageIndex++ this.pageTotal = res.data.pageTotal
this.pageTotal = ret.data.pageTotal
if(this.lists.length==0){
this.nodataShow = true
}
// 主订单显示待支付子订单显示除了待支付 // 主订单显示待支付子订单显示除了待支付
this.lists.forEach((item)=>{ this.lists.forEach((item)=>{
if(item.subOrderType!=9){ if(item.subOrderType!=9){
//item.orderType==10&& if(item.orderType==10&&item.orderStatus==0){
if(item.orderStatus==0){
item.showList=true item.showList=true
} }
//item.orderType!=10&& if(item.orderType!=10&&item.orderStatus!=0){
if(item.orderStatus!=0){
item.showList=true item.showList=true
} }
} }
}) })
//隐藏加载框 //隐藏加载框
uni.hideLoading() uni.hideLoading()
}else{ }else{
//隐藏加载框
uni.hideLoading()
uni.showToast({ uni.showToast({
title: '暂无订单信息', title: '暂无订单信息',
icon: 'none' icon: 'none'
...@@ -619,91 +481,18 @@ export default { ...@@ -619,91 +481,18 @@ export default {
}) })
.catch((err)=>{ .catch((err)=>{
this.timerOutClear = setTimeout(()=>{ this.timerOutClear = setTimeout(()=>{
this.getData(2) this.getData()
},1000) },1000)
}) })
} }
},
operation(item,index){//操作 删除和取消订单
this.operationItem = item
this.operationIndex = index
if(item.orderStatus==0){
this.configTitle = '确认取消订单'
}else{
this.configTitle = '确认删除订单'
}
this.configShow = true
},
operationEnter(){//操作 删除和取消订单 确定
if(this.operationItem.orderStatus==0){//取消订单
this.$request('order/userOrder/cancelOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单取消成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists[this.operationIndex].orderStatus = 9
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}else{//删除订单
this.$request('order/userOrder/deleteOrder',{
id:this.operationItem.id,
userId:this.openId
})
.then((res)=>{
var ret = res
if(ret.code=='00'){
uni.showToast({
title: '订单删除成功',
icon: 'none'
})
//this.$store.commit('showLoading')
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists.splice(this.operationIndex,1)
// this.lists = []
// this.getData(1)
this.configShow = false
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
},
operationClose(){//操作 删除和取消订单 取消
this.configShow =false
}, },
orderJump(orderId,orderType){//-------------------订单详情跳转 orderJump(orderId,orderType){//-------------------订单详情跳转
if(orderType==11||orderType==12){ if(orderType==11||orderType==12){
uni.navigateTo({ uni.navigateTo({
url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId
}) })
}else if(orderType==10){
uni.navigateTo({
url: '/pages/my/order/jointElectronicTicket/jointElectronicTicket?orderId='+orderId
})
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId
...@@ -717,293 +506,210 @@ export default { ...@@ -717,293 +506,210 @@ export default {
}) })
}, },
}, },
onReachBottom(){//上拉加载
this.pageIndex++
this.getData(2)
},
onUnload() {
if(this.timerOutClear) {
clearTimeout(this.timerOutClear)
this.timerOutClear = null
}
//隐藏加载框 uni.hideLoading()
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page{ .productBigBox{
background-color: #f5f5f5; background: #F7F8FA;
} padding-top: 206rpx;
.productBigBox{
background-color: #f5f5f5;
min-height: 100vh; min-height: 100vh;
}
.product-SearchBox{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 20;
}
.product-title{
display: flex;
justify-content: center;
width: 100%;
height: 80rpx;
background-color: #fff;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
text-align: center;
u-icon{
height: 80rpx;
position: absolute;
left: 24rpx;
top: 0;
bottom: 0;
} }
} .order-search{
.product-orderState{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
padding: 0 24rpx; height: 100rpx;
background-color: #fff; background-color: #fff;
.orderState-click{ padding: 0 40rpx 0 40rpx;
display: flex; position: fixed;
justify-content: center; top: 0;
width: 100rpx; left: 0;
height: 80rpx; .search-list{
align-items: center; font-weight: 600;
color: #999999;
font-size: 28rpx; font-size: 28rpx;
color: #999999;
line-height: 100rpx;
position: relative; position: relative;
.click-line{ .list-line{
display: none; display: none;
width: 55%; width: 100%;
height: 4rpx; height: 6rpx;
background-image: linear-gradient(to right, #9FCFFF , #DAE6F6); background: #000000;
margin: auto; border-radius: 4rpx;
position: absolute; position: absolute;
bottom: 12rpx;
left: 0; left: 0;
right: 0; bottom: 16rpx;
}
} }
.orderState-clickAct{
color: #191919;
font-size: 32rpx;
font-weight: bold;
.click-line{
display: inline-block;
} }
.search-listAct{
font-size: 30rpx;
color: #333333;
.list-line{
display: block;
} }
}
.product-searchBt{
width: 100%;
height: 80rpx;
box-shadow: 0 0 0;
display: flex;
background-color:#fff;
justify-content: space-between;
padding: 0 30rpx;
line-height: 80rpx;
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.08);
.searchBt-left{
display: flex;
width: 100rpx;
justify-content: center;
text:nth-child(1){
margin-right: 5rpx;
} }
} }
} .order-phoneSearch{
.content-title{
display: flex; display: flex;
justify-content: center; justify-content: space-between;
height: 80rpx; width: 100%;
line-height: 80rpx; height: 104rpx;
background: #F7F8FA;
padding: 20rpx 20rpx 0 20rpx;
position: fixed;
top: 100rpx;
left: 0;
.phoneSearch-type{
width: 200rpx;
height: 64rpx;
background: #FFFFFF;
border-radius: 32rpx;
line-height: 64rpx;
position: relative; position: relative;
font-size: 32rpx; .type-boxOn{
font-weight: bold; display: flex;
/deep/ .u-icon{ justify-content: space-between;
color: #c8c9cc; padding: 0 38rpx 0 38rpx;
width: 200rpx;
height: 64rpx;
font-weight: 600;
font-size: 24rpx;
color: #333333;
position: absolute; position: absolute;
right: 16rpx;
top: 0; top: 0;
left: 0;
}
.address-triangle{
width: 0px;
height: 0px;
margin: auto;
border: 10rpx solid transparent;
border-top: 10rpx solid #D8D8D8;
position: absolute;
top: 8rpx;
right: 38rpx;
bottom: 0; bottom: 0;
} }
}
.content-list{
display: flex;
padding: 0 24rpx 0 24rpx;
margin-top: 20rpx;
.list-name{
display: inline-block;
text-align: justify;
text-align-last: justify;
width: 110rpx;
font-size: 26rpx;
line-height: 40px;
flex-shrink: 0;
}
.list-name2{
line-height: 40px;
}
.uni-input{
height: 40px;
border-bottom: 1px solid #d1d1d1;
flex: 1;
} }
} /deep/ .u-search__content{
.confrim-btn{ height: 64rpx !important;
margin: 64rpx 24rpx 40rpx 24rpx; background: #FFFFFF !important;
/deep/ .u-reset-button{ border-radius: 32rpx !important;
height: 80rpx; padding: 0 32rpx !important;
line-height: 80rpx;
border-radius: 15rpx;
color: #FFFFFF;
text-align: center;
background: linear-gradient(134deg, #ED400C 0%, #FB862C 100%);
font-size: 28rpx;
border-radius: 8rpx;
border: none;
} }
} /deep/ .u-search{
.product-goods{ width: 490rpx !important;
padding: 30rpx; height: 64rpx !important;
padding-top: 200rpx; flex:none !important;
overflow: auto; align-items:flex-start;
position: relative; }
.product-block{ /deep/ .u-search__content__input{
border-radius: 5px; background: #FFFFFF !important;
margin-bottom: 20rpx; font-size: 24rpx !important;
background: #fff; }
box-shadow: 0px 3px 0px rgba(0, 0, 0, 0.02); /deep/ .u-icon__icon{
.block-title{ font-size: 40rpx !important;
padding: 30rpx 24rpx 25rpx 24rpx; color: #333333 !important;
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.08); }
}
.order-list{
width: 710rpx;
background-color: #fff;
border-radius: 12rpx;
margin: 0 auto 20rpx auto;
padding: 42rpx 40rpx 40rpx 40rpx;
overflow: hidden;
.list-title{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 30rpx;
color: #333;
.title-left{ .title-left{
flex: 1;
display: flex;
align-items: center;
.left-imgBox{
width: 32rpx;
height: 32rpx;
display: flex; display: flex;
margin-right: 16rpx; image{
border-radius: 3px; width: 40rpx;
flex-shrink: 0; height: 40rpx;
background-color: #FEB221; background: #14C9C8;
} border-radius: 50%;
.left-img{ }
display: inline-block; view{
width: 32rpx; font-weight: 600;
height: 32rpx;
}
.left-Name{
font-size: 0.32rem;
color: #191919;
font-weight: bold;
flex: 1;
font-size: 28rpx; font-size: 28rpx;
line-height: 36rpx; color: #333333;
line-height: 40rpx;
margin-left: 12rpx;
} }
} }
.title-right{ .title-right{
width: 160rpx; font-weight: 600;
display: flex; font-size: 28rpx;
justify-content: flex-end; color: #00B42B;
align-items: center; line-height: 40rpx;
font-size: 24rpx;
color: #ED400C;
} }
} }
.block-main{ .list-name{
display: flex; padding-left: 52rpx;
height: 174rpx; margin-top: 12rpx;
border-bottom: none; font-weight: 600;
font-size: 28rpx;
color: #333333; color: #333333;
position: relative; line-height: 28rpx;
padding: 36rpx 24rpx 24rpx 24rpx; }
.mian-InfoWrap{ .list-time,
.list-tips{
padding-left: 52rpx;
margin-top: 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #999999;
line-height: 28rpx;
}
.list-money{
margin-top: 20rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 28rpx;
text-align: right;
}
.list-btn{
display: flex; display: flex;
flex: 1; justify-content: flex-end;
font-size: 30rpx; margin-top: 40rpx;
overflow: auto;
.btn-style{
width: 170rpx;
height: 64rpx;
border-radius: 32rpx;
border: 2rpx solid #EDEDED;
margin-left: 20rpx;
font-weight: 600;
font-size: 28rpx;
color: #666666; color: #666666;
flex-wrap: wrap;
word-break: break-all;
margin-right: 20rpx;
flex-direction: column;
justify-content: center;
height: 100%;
.InfoWrap-mb30{
margin-bottom: 30rpx;
}
.allPice{
position: absolute;
left: 24rpx;
bottom: -80rpx;
color: #ED400C;
font-size: 40rpx;
font-weight: bold;
display: flex;
text{
font-size: 24rpx;
font-weight: normal;
margin-right: 4rpx;
line-height: 60rpx; line-height: 60rpx;
text-align: center;
} }
} }
} }
.main-right{ .order-listCancel{//订单取消的时候
height: 100%; .list-title{
display: flex; .title-left{
align-items: center; image{
color: #6b6b6b; background: #999999;
} }
view{
color: #999999;
} }
.block-Btn{
display: flex;
justify-content: flex-end;
height: 100rpx;
align-items: center;
padding: 0 20rpx;
.block-button{
width: 152rpx;
height: 64rpx;
line-height: 64rpx;
color: #333333;
padding: 0;
text-align: center;
display: inline-block;
box-sizing: content-box;
font-size: 28rpx;
border: 1px solid #cccccc;
border-radius: 8rpx;
align-items: center;
margin-right: 15rpx;
} }
.block-button:nth-last-child(1){ .title-right{
margin-right: 0; color: #999999;
} }
.block-buttonOrange{
color: #f9690e;
border: 1px solid #f9690e;
} }
.list-name{
color: #999999;
} }
.list-money{
color: #999999;
} }
.goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
} }
.order-No{ .order-No{
height: 40rpx; height: 40rpx;
...@@ -1012,11 +718,17 @@ page{ ...@@ -1012,11 +718,17 @@ page{
line-height: 40rpx; line-height: 40rpx;
text-align: center; text-align: center;
margin: auto; margin: auto;
position: absolute; position: fixed;
top: 400; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
} }
} .goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
</style> </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