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 @@
"navigationBarTitleText": "",
"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 @@
<u-icon name="arrow-left" color="#333" @click="blowUpMaks=false"></u-icon>
{{blowUpNumNew}}/{{pictureFrameList.length}}
</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="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==3?'left-frameAct':''" @click="frameFun(3)">无框</view>
</view>
<view class="search-right">
<view class="left-frame" :class="frameNum==3?'left-frameAct':''" @click="frameFun(3)">无框</view> -->
<view class="right-addressClick" @click="show = true">
{{showAddress}}
<view class="address-triangle"></view>
<u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker>
</view>
</view>
<view class="search-right">
<view class="right-addressClick" @click="show = true">
153****3456
<view class="address-triangle"></view>
</view>
</view>
</view>
<!--相片列表-->
<view class="myPhoto-list" v-if="checkTypeFun==true" :class="bottomShow==true?'myPhoto-listAct':''">
......@@ -70,7 +55,7 @@
<view class="myPhoto-mask" v-if="blowUpMaks==true" :style="{'top': albumBoxTop + 'px' }">
<swiper class="swiper" circular @change="projectNumFun" :current="currentNum">
<swiper-item v-for="(item,index) in pictureFrameList" :key="index">
<image :src="item.image" @click="stopPhoto(index)" :style="{'width': item.width, 'height': item.height}"></image>
<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 value="val" :checked="item.checkType" class="pictureFrame-check" :class="item.checkType==true?'pictureFrame-checkAct':''"></checkbox>
</checkbox-group>
......@@ -78,37 +63,68 @@
</swiper>
</view>
<!--获取照片-->
<image v-if="pictureFrameListNum==0" class="myPhoto-getPhotos" src="../static/album/icon08.png"></image>
<!--脚部选择相片、加入购物车、直接购买-->
<view class="myPhoto-bottom" v-if="pictureFrameListNum>0">
<!-- <image v-if="pictureFrameListNum==0" class="myPhoto-getPhotos" src="../static/album/icon08.png"></image> -->
<!--脚部选择相片、加入购物车、直接购买 v-if="pictureFrameListNum>0"-->
<view class="myPhoto-bottom">
<view class="bottom-tips">相片保留10天, 请尽快下载, 下载保存</view>
<view class="bottom-feature">
<!--加入相册列表-->
<view class="feature-list">
<!-- <view class="feature-list">
<template v-for="(item,index) in pictureFrameList">
<view class="feature-case" v-if="item.pickerChoose==true" :key="index">
<image class="feature-img" :src="item.image"></image>
<image class="feature-close" src="../static/album/icon05.png" @click="stopPhoto(index)"></image>
</view>
</template>
</view> -->
<!--单张 宫格切换-->
<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>
<!--选中的张数、加入购物车、立即购买、开始拼图 titleclick等于1显示购物车和立即购买 等于其他 显示开始拼图 进入拼图界面-->
<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>
</view>
<view class="message-selectNum" v-else>
<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 class="message-trading" v-if="titleclick==1">
<!-- v-if="titleclick==1" -->
<view class="message-trading">
<view class="trading-btn trading-left">
<image src="../static/album/icon06.png"></image>
<view class="trading-num">2</view>
<!-- <image src="../static/album/icon06.png"></image> -->
<!-- <view class="trading-num">2</view> -->
加入购物车
</view>
<view class="trading-btn trading-right">购买</view>
<view class="trading-btn trading-right">立即购买</view>
</view>
<view class="message-jigsaw" v-else>开始拼图</view>
<!-- <view class="message-jigsaw" v-else>开始拼图</view> -->
</view>
</view>
</view>
......@@ -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',
checkType:false,
pickerChoose:false,
width:607,
height:879,
},
{
image:'https://i1.hdslb.com/bfs/archive/34961798a6c8fa26348499483fc16e48831af85d.jpg',
checkType: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',
checkType: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',
checkType: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',
checkType:false,
pickerChoose:false,
width:607,
height:879,
},
],
checkTypeFun:true,//刷新选项
......@@ -319,6 +345,7 @@ export default {
flex-direction:column;
height: 100vh;
background-color: #fff;
padding-bottom: 464rpx;
}
.albumBoxAct{
background-color: #F5F7FA;
......@@ -344,7 +371,7 @@ export default {
.myPhoto-title{
width: 100%;
height: 100rpx;
padding: 32rpx 60rpx 0 60rpx;
padding: 32rpx 40rpx 0 40rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
......@@ -383,43 +410,44 @@ export default {
background: #F5F7FA;
.search-left{
display: flex;
.left-frame{
font-size: 24rpx;
color: #666666;
line-height: 64rpx;
padding: 0 20rpx 0 20rpx;
}
.left-frameAct{
width: 160rpx;
height: 64rpx;
padding:0;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 60rpx;
text-align: center;
background: #E6E9F4;
border-radius: 8rpx;
border: 2rpx solid #DAE0EB;
}
}
.left-frame{
font-size: 24rpx;
color: #666666;
line-height: 64rpx;
padding: 0 20rpx 0 20rpx;
}
.left-frameAct{
width: 160rpx;
height: 64rpx;
padding:0;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 60rpx;
text-align: center;
background: #E6E9F4;
border-radius: 8rpx;
border: 2rpx solid #DAE0EB;
}
.search-right{
display: flex;
.right-addressClick{
display: flex;
font-weight: 600;
font-size: 24rpx;
color: #333333;
line-height: 64rpx;
position: relative;
.address-triangle{
width: 0px;
height: 0px;
margin: auto;
margin-left: 12rpx;
border: 10rpx solid transparent;
border-top: 10rpx solid #D8D8D8;
}
}
.right-addressClick{
display: flex;
font-weight: 600;
font-size: 24rpx;
color: #333333;
line-height: 64rpx;
position: relative;
.address-triangle{
width: 0px;
height: 0px;
margin: auto;
margin-left: 12rpx;
border: 10rpx solid transparent;
border-top: 10rpx solid #333333;
margin-top: 25rpx;
}
}
}
......@@ -531,8 +559,8 @@ export default {
left: 0;
z-index: 10;
.swiper{
width: 680rpx;
height: 956rpx;//510rpx
width: 607rpx;
height: 879rpx;//510rpx
margin: 0 auto;
background: #F5F7FA;
margin-top: 80rpx;
......@@ -545,8 +573,8 @@ export default {
height: 32rpx;
background: transparent;
position: absolute;
right: 56rpx;
bottom: 60rpx;
right: 22rpx;
bottom: 22rpx;
z-index: 11;
/deep/ .wx-checkbox-input{
width: 32rpx;
......@@ -570,7 +598,7 @@ export default {
}
.myPhoto-bottom{
width: 100%;
height: 314rpx;
height: 464rpx;
position: fixed;
left: 0;
bottom: 0;
......@@ -578,22 +606,21 @@ export default {
.bottom-tips{
width: 726rpx;
height: 64rpx;
background: #FFF6E8;
background: #FFEFC9;
border-radius: 8rpx 8rpx 0rpx 0rpx;
border: 2rpx solid #FE6600;
box-sizing: border-box;
font-weight: 400;
font-size: 24rpx;
color: #FE6600;
text-align: center;
line-height: 60rpx;
color: #9A5500;
padding: 0 26rpx;
line-height: 64rpx;
margin: 0 auto;
}
.bottom-feature{
width: 100%;
height: 250rpx;
height: 400rpx;
background-color: #fff;
padding: 20rpx 24rpx 0 24rpx;
padding: 0rpx 0rpx 0 0rpx;
.feature-list{
display: flex;
width: 100%;
......@@ -620,8 +647,9 @@ export default {
.feature-message{
display: flex;
justify-content: space-between;
height: 64rpx;
margin-top: 6rpx;
border-top: 2rpx solid #F5F5F5;
padding: 0 40rpx 0 40rpx;
height: 120rpx;
.message-selectNum{
font-weight: 400;
font-size: 24rpx;
......@@ -635,44 +663,51 @@ export default {
.message-trading{
display: flex;
position: relative;
margin-top: 20rpx;
.trading-btn{
width: 160rpx;
height: 64rpx;
width: 220rpx;
height: 80rpx;
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;
background: #FFB143;
border-radius: 40rpx 0rpx 0rpx 40rpx;
text-align: center;
font-weight: bold;
line-height: 80rpx;
font-size: 28rpx;
color: #FE6600;
position: absolute;
right: 12rpx;
top: -22rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF;
// 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;
line-height: 80rpx;
font-size: 28rpx;
font-weight: 600;
text-align: center;
......@@ -690,6 +725,60 @@ export default {
line-height: 64rpx;
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 @@
我的相片
</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">
<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 @@
data-tailorx="0" data-tailory="0"
src="../static/album/backgroundImgTo.png"></image>
</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'}">
<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>
<!--脚部选择相片、加入购物车、直接购买 v-if="pictureFrameListNum>0"-->
<view class="myPhoto-bottom" v-if="bottomCheckType==true">
<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 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-pattern">
<image class="pattern-img" src="../static/album/DIY.png"></image>
</view>
<view class="warn-pattern warn-patternAct">
<image class="pattern-img" src="../static/album/DIY.png"></image>
</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="trading-btn trading-left">
加入购物车
</view>
<view class="trading-btn trading-right">立即购买</view>
</view>
</view>
</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 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 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>
......@@ -73,32 +113,34 @@ export default {
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
titleclick:1,//1单照片 2二宫格 3三宫格 4六宫格
pictureJigsawPosition:[//图片框位置
{
id:'img1',
url:'http://lx.pangdly.com/img/sodao.1cdf287.jpg',
width:'299',
height:'384',
top:'184',
left:'74',
width:'243',
height:'320',
top:'151',
left:'61',
radius:'0',
},
{
id:'img2',
url:'http://lx.pangdly.com/img/liangjiang.097258e.jpg',
width:'299',
height:'384',
top:'184',
left:'387',
width:'243',
height:'320',
top:'151',
left:'312',
radius:'0',
},
{
id:'img3',
url:'http://lx.pangdly.com/img/huiguan.c00da69.jpg',
width:'299',
height:'384',
top:'640',
left:'74',
width:'346',
height:'266',
top:'530',
left:'61',
radius:'0',
},
],
......@@ -110,7 +152,8 @@ export default {
canvasMaskNum:0, //渲染次数
canvasMaskType:false,
switchType:true,//模板开关按钮
textCanvasType:true,//临时控制画布显隐
bottomCheckType:false,//控制脚部按钮切换
}
},
onLoad(option) {
......@@ -123,6 +166,9 @@ export default {
},
methods: {
clickActFun(num){//宫格选择
this.titleclick = num
},
onScroll(event) {// event.detail 包含了滚动位置信息
console.log('滚动位置:', event.detail)
},
......@@ -188,38 +234,61 @@ export default {
// 这里我将需要查询的所有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('获取到信息头部:', res[0])
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 src= promiseArray[i].dataset.src
let posX = parseInt(promiseArray[i].dataset.tailorx/606*this.screenWidth) //图片所在画板的X轴数据
let posY = parseInt(promiseArray[i].dataset.tailory/606*this.screenWidth) //图片所在画板的Y轴数据
//截图的初始X和Y轴
let tailorx = parseInt(promiseArray[i].dataset.tailorx/606*this.screenWidth)-promiseArray[i].left
if(tailorx<0){//因为用的parseInt 是直接舍去,当出现负数的时候 则算为0
tailorx = 0
}
let tailory = parseInt(promiseArray[i].dataset.tailory/606*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/606*this.screenWidth)//要使用的图像的宽度
let sheight = parseInt(promiseArray[i].dataset.heightonce/606*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)
......@@ -245,22 +314,24 @@ export default {
// 这里开始绘制canvas内容,绘制的过程当中,不知道是小程序的问题,还是什么问题在绘制有背景图片的内容时,
// 文字内容必须要延迟绘制,也就是要定时器延迟一定时间才能绘制,要不然就会将文字覆盖在图片下方。
// 图片的绘制
for(let i = 0; i < promiseArray.length; i++){
for(let i = 0; i <= promiseArray.length-1; 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){
// 图片 裁剪 :X Y 宽度 高度
if(i==promiseArray.length-1){//背景
console.log('123456')
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)
}else{//插入的图片
//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 {
}
}
.jigsaw-picture{
width: 750rpx;
height: 1100rpx;
margin-top: 86rpx;
width: 606rpx;
height: 910rpx;
margin: 38rpx auto 0 auto;
position: relative;
.picture-backgrounImg{
width: 750rpx;
height: 1100rpx;
width: 606rpx;
height: 910rpx;
}
.picture-position{
border:solid 1px #333333;
......@@ -308,7 +379,6 @@ export default {
position: absolute;
image{
display: block;
height: 100%;
}
}
.picture-positionBox{
......@@ -321,151 +391,224 @@ export default {
}
.jigsaw-canvas{
display: block;
width: 750rpx;
height: 1100rpx;
width: 606rpx;
height: 910rpx;
}
.jigsaw-canvasMask{
display: block;
width: 750rpx;
padding-top: 86rpx;
width: 606rpx;
padding-top: 38rpx;
margin: auto;
position: absolute;
left: 0;
right: 0;
z-index: -10;
}
.jigsaw-canvasMaskAct{
z-index: 100;
}
.jigsaw-template{
display: flex;
.myPhoto-title{
width: 100%;
height: 180rpx;
padding: 20rpx;
height: 100rpx;
padding: 32rpx 40rpx 0 40rpx;
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;
display: flex;
justify-content: space-between;
.title-click{
height: 68rpx;
font-weight: 600;
font-size: 28rpx;
color: #999999;
line-height: 28rpx;
position: relative;
.list-img{
display: block;
width: 92rpx;
height: 138rpx;
margin: auto;
.click-line{
display: none;
width: 100%;
height: 6rpx;
background: #000000;
border-radius: 4rpx;
position: absolute;
top: 0;
right: 0;
bottom: 0;
bottom: 18rpx;
left: 0;
}
}
.template-listAct{
border: 3rpx solid #FE6600;
.title-clickAct{
font-size: 30rpx;
color: #333333;
.click-line{
display: block;
}
}
}
.jigsaw-btoom{
display: flex;
justify-content: space-between;
.myPhoto-bottom{
width: 100%;
height: 100rpx;
padding: 18rpx 32rpx 0 20rpx;
background-color: #fff;
height: 464rpx;
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;
bottom: 0;
z-index: 30;
.bottom-tips{
width: 726rpx;
height: 64rpx;
background: #FFEFC9;
border-radius: 8rpx 8rpx 0rpx 0rpx;
box-sizing: border-box;
font-weight: 400;
font-size: 24rpx;
color: #9A5500;
padding: 0 26rpx;
line-height: 64rpx;
margin: 0 auto;
}
.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{
display: flex;
position: relative;
margin-top: 20rpx;
.trading-btn{
width: 220rpx;
height: 80rpx;
position: relative;
}
.trading-left{
background: #FFB143;
border-radius: 40rpx 0rpx 0rpx 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 28rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF;
}
.trading-right{
background: #FE6600;
border-radius: 0rpx 200rpx 200rpx 0rpx;
text-align: center;
line-height: 80rpx;
font-size: 28rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF;
}
}
.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;
}
}
}
.pictureFrameAct{
background: #F7F8FA;
border-radius: 24rpx;
color: #333333;
font-weight: 600;
.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;
}
}
}
.message-trading{
display: flex;
position: relative;
.trading-btn{
width: 160rpx;
height: 64rpx;
}
.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;
}
.trading-left{
background: #FF9F43;
border-radius: 200rpx 0rpx 0rpx 200rpx;
image{
display: block;
width: 40rpx;
height: 40rpx;
margin: auto;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
top: 40rpx;
right: 24rpx;
}
}
.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;
.checkCase-btn{
padding: 70rpx 120rpx 0 120rpx;
display: flex;
justify-content: space-between;
.btn-list{
image{
display: block;
width: 60rpx;
height: 60rpx;
margin: 0 auto 16rpx auto;
}
view{
font-weight: 600;
font-size: 24rpx;
color: #333333;
line-height: 34rpx;
}
}
}
}
}
.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>
<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>
<view class="productBigBox">
<view class="product-SearchBox">
<!--头部切换-->
<view class="product-orderState">
<view class="orderState-click" :class="orderStatus===''?'orderState-clickAct':''" @click="screenChange('')">
全部
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus==='0'?'orderState-clickAct':''" @click="screenChange('0')">
待付款
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='2'?'orderState-clickAct':''" @click="screenChange('2')">
待使用
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='3'?'orderState-clickAct':''" @click="screenChange('3')">
待收货
<view class="click-line">
<text></text>
</view>
</view>
<view class="orderState-click" :class="orderStatus=='5'?'orderState-clickAct':''" @click="screenChange('5')">
待评价
<view class="click-line">
<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>
<!--手机查询遮罩-->
<u-popup mode="bottom" :show="phoneQuery">
<view class="content">
<view class="content-title">
订单查询
<u-icon name="close" color="#333333" size="28" @click="phoneQuery=false"></u-icon>
</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 class="content-list">
<text class="list-name">姓名</text>
<text class="list-name2"></text>
<input class="uni-input" v-model.trim="touristName" />
</view>
<view class="confrim-btn">
<u-button @click="queryPhoneOrder()">查询</u-button>
</view>
</view>
</u-popup>
<!--列表-->
<view class="product-goods" v-if="lists.length>0">
<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="block-title">
<view class="title-left">
<view class="left-imgBox" v-if="item.orderType==1">
<image class="left-img" src="../../static/orderList/iconjingqumenpiao.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==2">
<image class="left-img" src="../../static/orderList/iconjiudian.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==3">
<image class="left-img" src="../../static/orderList/iconcanyin.png"></image>
</view>
<view class="left-imgBox" v-else-if="item.orderType==4">
<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">
{{item.orderStatus|orderStatus1}}
</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">
{{item.orderStatus|orderStatus2}}
</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">
{{item.orderStatus|orderStatus3}}
</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">
{{item.orderStatus|orderStatus4}}
</template>
<template v-else>
{{item.orderStatus|orderStatus5}}
</template>
</view>
</view>
<view class="block-main">
<view class="mian-InfoWrap">
<view class="InfoWrap-mb30">订单时间:{{item.playDate.substr(0,10)}}</view>
<view>
购买数量:
<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==3&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==4&&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>
</view>
<view class="allPice">
<text>¥</text>{{item.totalMoney}}
</view>
</view>
<view class="main-right">
<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>
</template>
<view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view>
</view>
<view class="product-goods" v-else>
<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>
</template>
<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 {
filters:{
orderType(i){//订单类型
switch(i){
case 0:
return '其他'
break
case 1:
return '景区'
break
case 2:
return '酒店'
break
case 3:
return '餐饮'
break
case 4:
return '特产'
case 5:
return '运营车'
case 10:
return '组合订单'
}
},
orderStatus1(i){//景区订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '出票中'
break
case 2:
return '出票成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '核销完成'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
case 12:
return '退票审核中 '
break
}
},
orderStatus2(i){//酒店订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus3(i){//餐饮订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus4(i){//特产状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '待发货'
break
case 2:
return '待收货'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '已收货'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus5(i){
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '支付成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
}
},
components: {
// uPicker,
// uPopup,
// uToast,
// uModal
},
data() {
return {
queryLoad:false,//查询加载图标显示隐藏
phoneQuery:false,//手机查询显示隐藏
touristPhone:'',//旅客电话
touristName:'',//旅客姓名
orderStatus:'',//订单状态
nodataShow:false,//没有数据时展示
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,//截留 防止重复加载
pageIndex:1,//当前页
pageTotal:0,//总条数
configShow:false,//删除订单确认框
configTitle:'',//弹窗title
operationItem:null,//操作项的数据 删除和取消订单
operationIndex:null,//操作下标
callbackurl:'',//回调页面
ifNotice:'',//是否通知
openId:'',
ifyukuaiCode:'',//渝快付
dataLengthType:false,//上拉加载无更多数据时显示
timerOutClear:null,
}
},
onLoad(option) {
this.openId = uni.getStorageSync('openid')
//this.openId = 'oroHZ5FaUQ_SOOC_uQQP92fJpBRE'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE
this.orderStatus = option.orderStatus||''
this.ifyukuaiCode = option.ifyukuaiCode||''
this.getData(1)
},
onShow(){
this.pageIndex = 1
this.getData(1)
},
methods: {
screenChange(i){//顶部导航切换
this.orderStatus = i
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
},
industrysTypeConfirm(e) {//单列----分类 点击确定
console.log('confirm', e)
this.orderType = e.value[0].id
this.orderName = e.value[0].cateName
this.pageIndex = 1
this.pageTotal = 0
this.isTrue = true
this.lists = []
this.getData(1)
this.cancel()
},
cancel() {//单列 点击取消
this.orderShow = false
},
showQueryPhone(){//展示手机查询弹窗
this.touristPhone=''
this.touristName=''
this.phoneQuery=true
},
queryPhoneOrder(){//通过手机号查看订单
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({
title: '加载中'
})
if(this.isTrue){
this.isTrue = false
if(this.orderStatus=='2'){//点击的待使用
var orderStatusList=[2,4,5]
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatusList :orderStatusList,
userId:this.openId
}
}else{
var data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatus:this.orderStatus=='3'?2:parseFloat(this.orderStatus),
userId:this.openId
}
}
this.$request('order/userOrder/findOrderList',data)
.then((res)=>{
var ret = res
if(ret.code=='00'){
if(flag==1){//第一次加载
this.lists = []
}
if(ret.data.list.length>0){
this.dataLengthType = true
}else{
this.dataLengthType = false
}
ret.data.list.forEach((item)=>{
if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示
if(item.pid){
}else{
this.lists.push(item)
}
}else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单
//item.orderType!=10&&
if(item.orderType!=4&&item.productCode!=''){
this.lists.push(item)
}
}else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单
//item.orderType!=10&&
if(item.orderType==4&&item.productCode!=''){
this.lists.push(item)
}
}else if(this.orderStatus=='5'){//待评价不能显示组合订单
// if(item.orderType!=10){
// }
if(item.productCode!=''){
this.lists.push(item)
}
}else{
if(item.isDelete!=1){//( 0 未删除 1 已删除)
this.lists.push(item)
}
}
})
this.isTrue = true
this.pageIndex++
this.pageTotal = ret.data.pageTotal
if(this.lists.length==0){
this.nodataShow = true
}
// 主订单显示待支付子订单显示除了待支付
this.lists.forEach((item)=>{
if(item.subOrderType!=9){
//item.orderType==10&&
if(item.orderStatus==0){
item.showList=true
}
//item.orderType!=10&&
if(item.orderStatus!=0){
item.showList=true
}
}
})
//隐藏加载框
uni.hideLoading()
}else{
uni.showToast({
title: '暂无订单信息',
icon: 'none'
})
}
})
.catch((err)=>{
this.timerOutClear = setTimeout(()=>{
this.getData(2)
},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){//-------------------订单详情跳转
if(orderType==11||orderType==12){
uni.navigateTo({
url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId
})
}else if(orderType==10){
uni.navigateTo({
url: '/pages/my/order/jointElectronicTicket/jointElectronicTicket?orderId='+orderId
})
}else{
uni.navigateTo({
url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId
})
}
},
refundJump(id){//-------------------退款
uni.navigateTo({
url: '/pages/my/order/afterSale/applyAfterSale/applyAfterSale?orderId='+id+'&ifyukuaiCode='+this.ifyukuaiCode
})
},
},
onReachBottom(){//上拉加载
this.pageIndex++
this.getData(2)
},
onUnload() {
if(this.timerOutClear) {
clearTimeout(this.timerOutClear)
this.timerOutClear = null
}
//隐藏加载框 uni.hideLoading()
},
}
</script>
<style scoped lang="scss">
page{
background-color: #f5f5f5;
}
.productBigBox{
background-color: #f5f5f5;
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;
}
}
.product-orderState{
display: flex;
justify-content: space-between;
width: 100%;
padding: 0 24rpx;
background-color: #fff;
.orderState-click{
display: flex;
justify-content: center;
width: 100rpx;
height: 80rpx;
align-items: center;
color: #999999;
font-size: 28rpx;
position: relative;
.click-line{
display: none;
width: 55%;
height: 4rpx;
background-image: linear-gradient(to right, #9FCFFF , #DAE6F6);
margin: auto;
position: absolute;
bottom: 12rpx;
left: 0;
right: 0;
}
}
.orderState-clickAct{
color: #191919;
font-size: 32rpx;
font-weight: bold;
.click-line{
display: inline-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;
}
}
}
.content-title{
display: flex;
justify-content: center;
height: 80rpx;
line-height: 80rpx;
position: relative;
font-size: 32rpx;
font-weight: bold;
/deep/ .u-icon{
color: #c8c9cc;
position: absolute;
right: 16rpx;
top: 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;
}
}
.confrim-btn{
margin: 64rpx 24rpx 40rpx 24rpx;
/deep/ .u-reset-button{
height: 80rpx;
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;
}
}
.product-goods{
padding: 30rpx;
padding-top: 200rpx;
overflow: auto;
position: relative;
.product-block{
border-radius: 5px;
margin-bottom: 20rpx;
background: #fff;
box-shadow: 0px 3px 0px rgba(0, 0, 0, 0.02);
.block-title{
padding: 30rpx 24rpx 25rpx 24rpx;
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.08);
display: flex;
justify-content: space-between;
font-size: 30rpx;
color: #333;
.title-left{
flex: 1;
display: flex;
align-items: center;
.left-imgBox{
width: 32rpx;
height: 32rpx;
display: flex;
margin-right: 16rpx;
border-radius: 3px;
flex-shrink: 0;
background-color: #FEB221;
}
.left-img{
display: inline-block;
width: 32rpx;
height: 32rpx;
}
.left-Name{
font-size: 0.32rem;
color: #191919;
font-weight: bold;
flex: 1;
font-size: 28rpx;
line-height: 36rpx;
}
}
.title-right{
width: 160rpx;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 24rpx;
color: #ED400C;
}
}
.block-main{
display: flex;
height: 174rpx;
border-bottom: none;
color: #333333;
position: relative;
padding: 36rpx 24rpx 24rpx 24rpx;
.mian-InfoWrap{
display: flex;
flex: 1;
font-size: 30rpx;
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;
}
}
}
.main-right{
height: 100%;
display: flex;
align-items: center;
color: #6b6b6b;
}
}
.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){
margin-right: 0;
}
.block-buttonOrange{
color: #f9690e;
border: 1px solid #f9690e;
}
}
}
.goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
.order-No{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
margin: auto;
position: absolute;
top: 400;
right: 0;
bottom: 0;
left: 0;
}
}
<template>
<view class="productBigBox">
<!--头部点击选择类型-->
<view class="order-search">
<view class="search-list" :class="orderStatus===''?'search-listAct':''" @click="screenChange('')">
全部
<view class="list-line"></view>
</view>
<view class="search-list" :class="orderStatus==='0'?'search-listAct':''" @click="screenChange('0')">
待付款
<view class="list-line"></view>
</view>
<view class="search-list" :class="orderStatus==='2'?'search-listAct':''" @click="screenChange('2')">
待使用
<view class="list-line"></view>
</view>
<!--暂无包邮-->
<view class="search-list" :class="orderStatus==='3'?'search-listAct':''" @click="screenChange('3')" style="display: none;">
待收货
<view class="list-line"></view>
</view>
<view class="search-list" :class="orderStatus==='5'?'search-listAct':''" @click="screenChange('5')">
待评价
<view class="list-line"></view>
</view>
</view>
<!--头部搜索 手机号-->
<view class="order-phoneSearch">
<view class="phoneSearch-type" @click="show = true">
<u-picker :show="show" :columns="columns" visibleItemCount="6" itemHeight="80" keyName="label" @confirm="addressFun" @cancel="show=false" ></u-picker>
<view class="type-boxOn">
{{showAddress}}
<view class="address-triangle"></view>
</view>
</view>
<u-search placeholder="搜索手机号" v-model="phoneNum" shape="round" :showAction="false" :clearabled="true"></u-search>
</view>
<!--身体列表-->
<template v-if="lists.length>0"><!--判断是否有数-->
<template v-for="(item,index) in lists">
<view class="order-list" :key="index" v-if="item.showList" @click="orderJump(item.id,item.orderType)">
<view class="list-title">
<view class="title-left">
<image v-if="item.orderType==1" src="../../static/orderList/iconjingqumenpiao.png"></image>
<image v-else-if="item.orderType==2" src="../../static/orderList/iconjiudian.png"></image>
<image v-else-if="item.orderType==3" src="../../static/orderList/iconcanyin.png"></image>
<image v-else-if="item.orderType==4" src="../../static/orderList/iconliwu1.png"></image>
<image v-else-if="item.orderType==5" src="../../static/orderList/iconchuzuche.png"></image>
<image v-else-if="item.orderType==10" src="../../static/orderList/iconzuhe.png"></image>
<image v-else src="../../static/orderList/iconqita.png"></image>
<view>门票</view>
</view>
<view class="title-right" v-if="item.orderType!=10&&item.orderType!=0">
<template v-if="item.orderType==1&&item.subOrderType!=4">
{{item.orderStatus|orderStatus1}}
</template>
<template v-else-if="item.orderType==2&&item.subOrderType!=4">
{{item.orderStatus|orderStatus2}}
</template>
<template v-else-if="item.orderType==3&&item.subOrderType!=4">
{{item.orderStatus|orderStatus3}}
</template>
<template v-else-if="item.orderType==4&&item.subOrderType!=4">
{{item.orderStatus|orderStatus4}}
</template>
<template v-else>
{{item.orderStatus|orderStatus5}}
</template>
</view>
</view>
<view class="list-name">{{item.merchantName}}({{item.productName}})</view>
<view class="list-time">
{{item.playDate.substr(0,10)}} 有效·
<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==3&&item.subOrderType!=4">{{item.orderNum}}</template>
<template v-else-if="item.orderType==4&&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>
</view>
<view class="list-tips">凭「胖丁动态二维码」直接验证使用</view>
<view class="list-money">¥{{item.totalMoney}}</view>
<view class="list-btn">
<view class="btn-style">下载照片</view>
<view class="btn-style">导航取片</view>
</view>
</view>
</template>
<view class="goods-NoMore" v-if="dataLengthType==true">暂无更多数据</view>
</template>
<view class="order-No" v-else>暂无订单信息</view>
</view>
</template>
<script>
export default {
filters:{
orderType(i){//订单类型
switch(i){
case 0:
return '其他'
break
case 1:
return '景区'
break
case 2:
return '酒店'
break
case 3:
return '餐饮'
break
case 4:
return '特产'
case 5:
return '运营车'
case 10:
return '组合订单'
}
},
orderStatus1(i){//景区订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '出票中'
break
case 2:
return '出票成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '核销完成'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
case 12:
return '退票审核中 '
break
}
},
orderStatus2(i){//酒店订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus3(i){//餐饮订单状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '预定成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus4(i){//特产状态
switch(i){
case 0:
return '待支付'
break
case 1:
return '待发货'
break
case 2:
return '待收货'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '已收货'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
},
orderStatus5(i){
switch(i){
case 0:
return '待支付'
break
case 1:
return '确认中'
break
case 2:
return '支付成功'
break
case 3:
return '预定失败'
break
case 4:
return '核销中'
break
case 5:
return '待评价'
break
case 6:
return '退款中'
break
case 7:
return '部分退货/退款'
break
case 8:
return '全部退款退货 '
break
case 9:
return '取消 '
break
case 10:
return '已完成 '
break
case 11:
return '已过期 '
break
}
}
},
components: {
},
data() {
return {
//顶部参数
orderStatus:'',//头部类型选择
//手机搜索
show: false,//遮罩显隐---项目
columns: [//遮罩列表---项目
[
{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:[],//数据
//分页
isTrue:true,//截留 防止重复加载
pageIndex:1,//当前页
pageTotal:0,//总条数
//定时请求
timerOutClear:null,
//其他
ifyukuaiCode:'',//渝快付
dataLengthType:false,//上拉加载无更多数据时显示
}
},
onLoad(option) {
this.openId = uni.getStorageSync('openid')
this.openId = 'oh2UV1lyYABHMZ1rMlgjhVHyyYDQ'//oh2UV1lyYABHMZ1rMlgjhVHyyYDQ oroHZ5FaUQ_SOOC_uQQP92fJpBRE
this.orderStatus = option.orderStatus||''
this.ifyukuaiCode = option.ifyukuaiCode||''
this.getData()
},
onShow(){
this.pageIndex = 1
this.lists = [] //主要数据存储
this.getData()
},
onReachBottom(){//上拉加载
this.pageIndex++
this.getData()
},
onUnload() {
if(this.timerOutClear) {
clearTimeout(this.timerOutClear)
this.timerOutClear = null
}
//隐藏加载框
uni.hideLoading()
},
methods: {
screenChange(i){//顶部导航切换
this.orderStatus = i //当前选择的数字
this.pageIndex = 1 //页码
this.pageTotal = 0 //总数
this.isTrue = true //是否同意请求
this.lists = [] //主要数据存储
this.getData()
},
addressFun(e){//项目选择
this.showAddress = e.value[0].label
this.show=false
},
getData(){//数据加载
//显示加载框
uni.showLoading({
title: '加载中'
})
if(this.isTrue){
this.isTrue = false
var data = {}
if(this.orderStatus=='2'){//点击的待使用
var orderStatusList=[2,4,5]
data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatusList :orderStatusList,
userId:this.openId
}
}else{
data={
pageIndex:this.pageIndex,
pageSize:20,
orderType:this.orderType==0?'':this.orderType,
orderStatus:this.orderStatus=='3'?2:parseFloat(this.orderStatus),
userId:this.openId
}
}
this.$request('order/userOrder/findOrderList',data)
.then((res)=>{
if(res.code=='00'){
if(res.data.list.length>0){
this.dataLengthType = true
}else{
this.dataLengthType = false
}
res.data.list.forEach((item)=>{
if(this.orderStatus=='0'){////待付款的订单 pid 不能空的不显示
if(item.pid){
}else{
this.lists.push(item)
}
}else if(this.orderStatus=='2'){//待评价和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType!=4){
this.lists.push(item)
}
}else if(this.orderStatus=='3'){//待收货和待使用不能显示组合订单
if(item.orderType!=10&&item.orderType==4){
this.lists.push(item)
}
}else if(this.orderStatus=='5'){//待评价不能显示组合订单
if(item.orderType!=10){
this.lists.push(item)
}
}else{
if(item.isDelete!=1){//( 0 未删除 1 已删除)
this.lists.push(item)
}
}
})
this.isTrue = true
this.pageTotal = res.data.pageTotal
// 主订单显示待支付子订单显示除了待支付
this.lists.forEach((item)=>{
if(item.subOrderType!=9){
if(item.orderType==10&&item.orderStatus==0){
item.showList=true
}
if(item.orderType!=10&&item.orderStatus!=0){
item.showList=true
}
}
})
//隐藏加载框
uni.hideLoading()
}else{
//隐藏加载框
uni.hideLoading()
uni.showToast({
title: '暂无订单信息',
icon: 'none'
})
}
})
.catch((err)=>{
this.timerOutClear = setTimeout(()=>{
this.getData()
},1000)
})
}
},
orderJump(orderId,orderType){//-------------------订单详情跳转
if(orderType==11||orderType==12){
uni.navigateTo({
url: '/pages/album/albumOrderdetail/albumOrderdetail?orderId='+orderId
})
}else{
uni.navigateTo({
url: '/pages/my/order/electronicTicket/electronicTicket?orderId='+orderId
})
}
},
refundJump(id){//-------------------退款
uni.navigateTo({
url: '/pages/my/order/afterSale/applyAfterSale/applyAfterSale?orderId='+id+'&ifyukuaiCode='+this.ifyukuaiCode
})
},
},
}
</script>
<style scoped lang="scss">
.productBigBox{
background: #F7F8FA;
padding-top: 206rpx;
min-height: 100vh;
}
.order-search{
display: flex;
justify-content: space-between;
width: 100%;
height: 100rpx;
background-color: #fff;
padding: 0 40rpx 0 40rpx;
position: fixed;
top: 0;
left: 0;
.search-list{
font-weight: 600;
font-size: 28rpx;
color: #999999;
line-height: 100rpx;
position: relative;
.list-line{
display: none;
width: 100%;
height: 6rpx;
background: #000000;
border-radius: 4rpx;
position: absolute;
left: 0;
bottom: 16rpx;
}
}
.search-listAct{
font-size: 30rpx;
color: #333333;
.list-line{
display: block;
}
}
}
.order-phoneSearch{
display: flex;
justify-content: space-between;
width: 100%;
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;
.type-boxOn{
display: flex;
justify-content: space-between;
padding: 0 38rpx 0 38rpx;
width: 200rpx;
height: 64rpx;
font-weight: 600;
font-size: 24rpx;
color: #333333;
position: absolute;
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;
}
}
/deep/ .u-search__content{
height: 64rpx !important;
background: #FFFFFF !important;
border-radius: 32rpx !important;
padding: 0 32rpx !important;
}
/deep/ .u-search{
width: 490rpx !important;
height: 64rpx !important;
flex:none !important;
align-items:flex-start;
}
/deep/ .u-search__content__input{
background: #FFFFFF !important;
font-size: 24rpx !important;
}
/deep/ .u-icon__icon{
font-size: 40rpx !important;
color: #333333 !important;
}
}
.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;
justify-content: space-between;
.title-left{
display: flex;
image{
width: 40rpx;
height: 40rpx;
background: #14C9C8;
border-radius: 50%;
}
view{
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
margin-left: 12rpx;
}
}
.title-right{
font-weight: 600;
font-size: 28rpx;
color: #00B42B;
line-height: 40rpx;
}
}
.list-name{
padding-left: 52rpx;
margin-top: 12rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 28rpx;
}
.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;
justify-content: flex-end;
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;
line-height: 60rpx;
text-align: center;
}
}
}
.order-listCancel{//订单取消的时候
.list-title{
.title-left{
image{
background: #999999;
}
view{
color: #999999;
}
}
.title-right{
color: #999999;
}
}
.list-name{
color: #999999;
}
.list-money{
color: #999999;
}
}
.order-No{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
margin: auto;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.goods-NoMore{
height: 40rpx;
color: #666666;
font-size: 30rpx;
line-height: 40rpx;
text-align: center;
}
</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