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

Merge branch 'album' into develop

# Conflicts:
#	pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
parents 9c486bd3 6da98198
......@@ -196,9 +196,11 @@
}
}
],
//分包加载配置,此配置为小程序的分包加载机制。
"subPackages": [{
"subPackages": [
{
"root": "pages/vlog", //子包的根目录
"pages": [
{
......@@ -321,7 +323,58 @@
}
}
]
}],
},
{
"root":"pages/album",
"pages": [
{
"path" : "albumIndex",
"style" :
{
"navigationBarTitleText": "相册首页",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "chooseFavorite",
"style" :
{
"navigationBarTitleText": "景区喜好",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "getPortrait",
"style" :
{
"navigationBarTitleText": "获取人像",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "myPhotoAlbum/myPhotoAlbum",
"style" :
{
"navigationBarTitleText": "我的相册",
"enablePullDownRefresh": false
}
}
,{
"path" : "albumOrderdetail/albumOrderdetail",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}
],
"globalStyle" : {
"navigationBarTextStyle" : "white",
"navigationBarTitleText" : "",
......
<template>
<view class="big-box" :style="{'padding-top': statusBarHeight + 'px'}">
<view class="nav-bar" :style="{'top': statusBarHeight + 'px', 'height': navHeight + 'px','line-height': navHeight + 'px'}">
摄影/旅拍
</view>
<view class="body">
<view class="scroll-view" >
<view class="item" @click="jumpToScanFaceClick">
<image class="img" src="./static/album/myAlbum.png"></image>
<text class="title">我的相片</text>
</view>
<view class="item">
<image class="img" src="./static/album/DIY.png"></image>
<text class="title">影像DIY</text>
</view>
<view class="item" @click="jumpToScanFaceClick">
<image class="img" src="./static/album/custom.png"></image>
<text class="title">旅拍定制</text>
</view>
<view class="item" @click="jumptoVlog">
<image class="img" src="./static/album/myVlog.png"></image>
<text class="title">我的Vlog</text>
</view>
</view>
<view class="private-custom">
<view class="title">私人定制</view>
<u-waterfall v-model="list" ref="uWaterfall">
<template v-slot:left="{leftList}">
<view class="left demo-water" v-for="(item, index) in leftList" :key="index" @click="jumpToClick(item.title)">
<image :src="item.image" mode="aspectFill"></image>
<!-- <u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load> -->
<view class="info-box" :style="{'background-color': item.color}">
<view class="item-title">{{item.title}}</view>
<view class="slogan">一句宣传语</view>
<view class="bottom">
<view class="img-btn">
点击定制
<u-icon name="arrow-right"></u-icon>
</view>
<text class="count">{{item.count}}</text>
</view>
</view>
</view>
</template>
<template v-slot:right="{rightList}">
<view class="demo-water" v-for="(item, index) in rightList" :key="index" @click="jumpToClick(item.title)">
<image :src="item.image" mode="aspectFill"></image>
<!-- <u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load> -->
<view class="info-box" :style="{'background-color': item.color}">
<view class="item-title">{{item.title}}</view>
<view class="slogan">快来定制吧</view>
<view class="bottom">
<view class="img-btn">
点击定制
<u-icon name="arrow-right"></u-icon>
</view>
<text class="count">{{item.count}}</text>
</view>
</view>
</view>
</template>
</u-waterfall>
</view>
</view>
<u-mask :show="showtip" >
<view class="mask">
<view class="img-box">
<image src="./static/album/postcardTip.png" mode="aspectFit"></image>
<u-icon class="close" name="close-circle" @click="showtip = false"></u-icon>
</view>
<u-button type="primary" shape="circle" @click="showtip = false">知道了</u-button>
</view>
</u-mask>
</view>
</template>
<script>
import UWaterfall from '@/uview-ui/components/u-waterfall/u-waterfall.vue'
import ULazyLoad from '@/uview-ui/components/u-lazy-load/u-lazy-load.vue'
import UMask from '@/uview-ui/components/u-mask/u-mask.vue'
export default {
components: {
UWaterfall,
ULazyLoad,
UMask
},
data() {
return {
showtip: false,//领取提示
statusBarHeight: 0,
capsule: 0,
navHeight: 0,
list: [
{
title: '精彩瞬间',
count: '10W+',
image: './static/album/wonderfulMoment.png',
color: '#037EFF'
},
{
title: '网红旅拍',
count: '8W+',
image: './static/album/travalphoto.png',
color: '#826847'
},
{
title: '抱枕DIY',
count: '4W+',
image: './static/album/pillow.png',
color: '#1175B4'
},
{
title: '明信片',
count: '4W+',
image: './static/album/postcard.png',
color: '#3478DC'
},
{
title: '旅游台历定制',
count: '4W+',
image: './static/album/deskCalender.png',
color: '#1A9B45'
},
{
title: '定制相册',
count: '4W+',
image: './static/album/customPic.png',
color: '#D48D46'
}
]
}
},
methods: {
jumpToScanFaceClick() {//---跳转扫脸页面
const openid = uni.getStorageSync('openid')
this.$request('wechatUser/pdFace/checkScanFace',{openid}).then(res => {//创建任务
if (res.code === '00') {
if(res.data.isScanFace === 0) {//未扫脸
uni.navigateTo({
url: './getPortrait'
})
}else if(res.data.isScanFace === 1) {//已扫脸
uni.navigateTo({
url: `./myPhotoAlbum/myPhotoAlbum?faceIds=${JSON.stringify(res.data.faceIds)}`
})
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
jumptoVlog() {//---跳转到vlog页面
console.log('fdsa')
uni.redirectTo({
url: '/pages/vlog/vlogIndex/vlogIndex'
})
},
jumpToClick(title) {
if(title === '精彩瞬间' || title === '网红旅拍') {
this.jumpToScanFaceClick()
}
},
recordDeviceInfo() {//---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.navHeight = (this.capsule.top - this.statusBarHeight) * 2 + this.capsule.height // 导航栏高度
}
},
onLoad(option) {
if(option.tip === 'true') this.showtip = true
this.recordDeviceInfo()
}
}
</script>
<style lang="scss" scoped>
.big-box {
position: relative;
padding: 0 24rpx;
background: linear-gradient(to right bottom, #c778f350, #66ddad50, #68d6de50);
z-index: 0;
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
bottom: 0;
left: 0;
z-index: -1;
background: linear-gradient(to top, #f7f7f7, #f7f7f7 80%, transparent 100%);
}
/deep/.u-mask {
display: flex;
justify-content: center;
align-items: center;
}
}
.nav-bar {
font-size: 36rpx;
font-weight: 700;
z-index: 9;
}
.scroll-view {
display: flex;
width: calc(100% + 48rpx);
position: relative;
top: 0;
left: -24rpx;
overflow-x: auto;
padding: 46rpx 0 0 24rpx;
margin-bottom: 48rpx;
&::-webkit-scrollbar {
display: none;
}
.item {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 24rpx;
}
.img {
width: 200rpx;
height: 136rpx;
border-radius: 16rpx;
margin-bottom: 16rpx;
box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.12);
overflow: hidden;
}
.title {
font-size: 28rpx;
font-weight: 700;
}
}
.private-custom {
.title {
position: relative;
margin-bottom: 24rpx;
font-size: 32rpx;
font-weight: 700;
&::after {
content: '';
width: 128rpx;
height: 44rpx;
position: absolute;
left: -8rpx;
bottom: -24rpx;
background: url('@/pages/album/static/album/private-custom.png') no-repeat;
}
}
.demo-water {
image {
border-radius: 16rpx 16rpx 0 0;
height: 458rpx;
width: 100%;
}
/deep/.u-wrap,
/deep/.u-lazy-item {
broder-radius: 16rpx 16rpx 0 0 !important;
}
}
.left.demo-water {
margin-right: 14rpx;
image {
height: 400rpx;
}
}
.info-box {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 170rpx;
position: relative;
top: -16rpx;
padding: 16rpx;
box-sizing: border-box;
border-radius: 0 0 16rpx 16rpx;
color: #fff;
.item-title {
font-size: 28rpx;
font-weight: 700;
}
.slogan {
font-size: 24rpx;
}
.img-btn {
display: flex;
justify-content: center;
align-items: center;
width: 160rpx;
height: 40rpx;
border-radius: 20rpx;
background-color: #E1E1D9;
color: #333;
font-size: 22rpx;
}
.bottom {
display: flex;
justify-content: space-between;
.count {
font-size: 28rpx;
color: #ececec;
}
}
}
}
.mask {
.img-box {
position: relative;
margin-bottom: 32rpx;
.close {
position: absolute;
top: -54rpx;
right: 24rpx;
color: #fff;
&::after {
position: absolute;
content: '';
top: 24rpx;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 32rpx;
border-left: 1px dashed #fff;
}
}
}
image {
width: 504rpx;
height: 720rpx;
}
/deep/.u-btn {
width: 304rpx;
}
}
</style>
\ No newline at end of file
<template>
<view class="order-wrap">
<view class="top">
订单信息
</view>
<view class="middle">
<view>
<text class="grey">
订单编号
</text>
<text style="flex: 1;">
z0016784191206689a18e27162f293ef
</text>
<image @click="copyText(orderInfo.id)" src="@/static/img/my/icon01.png" class="copy-image">
</image>
</view>
<view>
<text class="grey">
产品名称
</text>
长江索道-我的相片
</view>
<view>
<text class="grey">
订单金额
</text>
¥10
</view>
<view>
<text class="grey">
订单数量
</text>
1
</view>
<view>
<text class="grey">
订单时间
</text>
2023-07-07 10:49:49
</view>
<view>
<text class="grey">
支付单号
</text>
2023070722001181651456467459
</view>
<view>
<text class="grey">
支付时间
</text>
2023-07-07 10:50:11
</view>
<view>
<text class="grey">
咨询电话
</text>
023-68567748
</view>
</view>
<view class="bottom">
<view class="bottom-rule">
<text class="grey">退改规则</text>
<text>不可退</text>
</view>
<view class="bottom-btn">
<text class="button-empty">我的影集</text>
<text class="button">下载</text>
<text class="button" @click="showPop=true">打印</text>
</view>
</view>
<!-- 打印弹窗 -->
<u-popup v-model="showPop" mode="bottom" border-radius="14" closeable height="70%">
<view class="pop-head">
<text style="font-size: 32rpx;font-weight: bold;">
打印
</text>
<text>
(现场自取)
</text>
</view>
<view class="pop-middle">
<view>
<text class="middle-tip">
取片电话:
</text>
<input />
</view>
<view>
<text class="middle-tip">
取片地址:
</text>
<text>
重庆市渝中区新华路151号长江索道南站观景台旁
</text>
</view>
<view>
<text class="middle-tip">
运营时间:
</text>
<text>
09:00-22:00
</text>
</view>
<view>
<text class="middle-tip">
咨询电话:
</text>
<text>
023-68567748
</text>
</view>
<view>
<text class="middle-tip">
温馨提示:
</text>
<text style="color: #999999;">
每个订单仅限免费打印一次取片时请向现场工作人员出示订单号或支付单号
</text>
</view>
</view>
<view class="pop-bottom">
<text class="pop-btn">
提交
</text>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
showPop:false,//弹窗显示隐藏
}
},
methods: {
//---复制内容
copyText(value){
uni.setClipboardData({
data:value,
success:function(){
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped lang="scss">
.order-wrap{
background: #FFFFFF;
box-shadow: 0px 0px 12rpx 2rpx rgba(0,0,0,0.08);
border-radius: 16rpx;
margin: 24rpx;
}
.top{
height: 92rpx;
line-height: 92rpx;
border-bottom: 1px solid #ececec;
padding: 0 24rpx;
font-size: 32rpx;
color: #191919;
font-weight: bold;
}
.middle{
padding: 0 24rpx 48rpx 24rpx;
border-bottom: 1px solid #ececec;
>view{
display: flex;
margin-top: 32rpx;
}
}
.copy-image{
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.grey{
color: #999999;
flex-shrink: 0;
margin-right: 20rpx;
}
.bottom{
padding: 48rpx 24rpx;
}
.bottom-rule{
display: flex;
justify-content: space-between;
}
.bottom-btn{
display: flex;
justify-content: space-between;
margin-top: 48rpx;
}
.button{
width: 144rpx;
height: 64rpx;
background: $blue;
border-radius:8rpx;
display: inline-block;
color:#ffffff;
text-align: center;
line-height: 64rpx;
}
.button-empty{
width: 144rpx;
height: 64rpx;
border-radius:8rpx;
display: inline-block;
border: 1px solid #999999;
text-align: center;
line-height: 64rpx;
}
// 打印弹窗
.pop-head{
text-align: center;
margin-top: 20rpx;
}
.pop-middle{
padding:0 48rpx 32rpx 48rpx;
view{
display: flex;
margin-top: 32rpx;
}
}
.middle-tip{
font-weight: bold;
flex-shrink: 0;
}
.pop-bottom{
margin-top: 60rpx;
text-align: center;
}
.pop-btn{
display: inline-block;
width: 212rpx;
height: 80rpx;
background:$blue;
border-radius: 44rpx;
text-align: center;
line-height: 80rpx;
color: #ffffff;
font-size: 32rpx;
}
</style>
<template>
<view class="big-box" :style="{'padding-top': statusBarHeight + 'px'}">
<view class="nav-bar" :style="{'height': navHeight + 'px'}">
<picker mode="selector" @change="companyChage" :value="index" :range="companyArr" range-key="name">
<view class="company">{{companyArr[index] ? companyArr[index].name : '请选择公司'}}</view>
</picker>
<u-icon name="arrow-down"></u-icon>
</view>
<view class="outer-container">
<view class="inner-container">
<view class="icon">
<image class="favorite" src="./static/album/favorite.png"></image>
<image class="start" src="./static/album/star.png"></image>
</view>
<view class="img-box">
<view class="item" @click="imageChange(item)" v-for="(item, index) in imgArr" :key="item.id">
<image class="img" :src="item.url" mode="aspectFill"></image>
<u-checkbox class="checkbox" v-model="item.value" shape="circle"></u-checkbox>
</view>
</view>
<button class="btn" @click="saveClick">提交</button>
</view>
</view>
</view>
</template>
<script>
import UCheckbox from '@/uview-ui/components/u-checkbox/u-checkbox.vue'
export default {
components: {
UCheckbox,
},
data() {
return {
statusBarHeight: 0,
capsule: 0,
navHeight: 0,
index: 0,// 选中的公司索引-默认选中第一个
companyArr: [],// 公司枚举
imgArr: [],//图片
value: true,
location: {},//位置信息
option: {},//路由传参
}
},
methods: {
saveClick() {//---提交
const selectedPic = this.imgArr.filter(item => item.value)
const data = {
id: selectedPic[0].id,// 图片id
merchantId: selectedPic[0].merchantId
}
uni.setStorageSync('merchantId', data.merchantId)
this.$request('scenic/V2merchant/submitChoose', data).then(res => {//创建任务
if (res.code === '00') {
uni.showToast({
title: '提交成功',
icon: 'success'
})
uni.navigateTo({
url: './albumIndex?tip=true'
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
companyChage(e) {//---公司变化
this.index = Number(e.detail.value)
const merchantId = this.companyArr[this.index].id
this.getPic(merchantId)
},
imageChange(item) {//---图片选择
this.imgArr.forEach(item => item.value = false)
item.value = true
},
recordDeviceInfo() {//---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.navHeight = (this.capsule.top - this.statusBarHeight) * 2 + this.capsule.height // 导航栏高度
},
getCompany(nearbyId) {//---获取景区列表
this.$request('scenic/newMerchant/findAllMerchant').then(res => {//创建任务
if (res.code === '00') {
if(!res.data.length) return
const id = this.option.merchantId || nearbyId
let index = res.data.findIndex(item => item.id === id)
this.index = index === -1 ? 0 : index
this.companyArr = res.data
this.getPic(this.companyArr[this.index].id)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getPic(merchantId) {//---获取景区图片
this.$request('scenic/V2merchant/getImgList',{ merchantId }).then(res => {//创建任务
if (res.code === '00') {
res.data.forEach(item => item.value = false)
this.imgArr = res.data
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
getNearByCompany() {//---获取最近的景区
const data = {
merchantType: 1,
userlatitude: this.location.latitude,//纬度
userlongitude: this.location.longitude//经度
}
this.$request('scenic/newMerchant/findAllMerchant', data).then(res => {//创建任务
if (res.code === '00') {
if(!res.data.length) {
this.getCompany()
return uni.showToast({
title: '获取最近景点失败',
icon: 'none'
})
}
this.getCompany(res.data[0].id)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
},
onLoad(option) {
this.option = option
this.recordDeviceInfo()
uni.getLocation({//获取定位
type: 'wgs84',
success: res => {
this.location = res
uni.setStorageSync('location', JSON.stringify(res))
if(this.option.merchantId) {//扫码进入则直接加载景区列表,默认显示传入的景区
this.getCompany()
}else {//否则获取并显示距离最近的景点
this.getNearByCompany()
}
},
fail() {
this.getCompany()
uni.showToast({
title: '获取经纬度失败',
icon: 'none'
})
}
})
}
}
</script>
<style lang="scss" scoped>
.big-box {
display: flex;
flex-direction: column;
height: 100%;
background-color: #3688FF;
color: #fff;
}
.nav-bar {
display: flex;
align-items: center;
picker {
max-width: 50%;
}
.company {
margin: 0 12rpx 0 24rpx;
font-size: 36rpx;
font-weight: 700;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.outer-container {
flex: 1;
margin: 16rpx 16rpx 24rpx 16rpx;
border-radius: 96rpx;
background: url('@/pages/album/static/album/dash-bg.png');
background-size: 100% 100%;
padding: 16rpx;
overflow: hidden;
.inner-container {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background-color: #3041D7;
border-radius: 96rpx;
}
.img-box {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
overflow-y: auto;
flex: 1;
margin: 42rpx 20rpx;
padding: 24rpx 16rpx;
background-color: #fff;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.16);
border-radius: 16rpx;
.item {
width: 49%;
height: 236rpx;
border-radius: 16rpx;
margin-bottom: 16rpx;
position: relative;
overflow: hidden;
&:nth-child(2n-1) {
margin-right: 2%;
}
.img {
width: 100%;
heigit: 100%;
}
.checkbox {
display: flex;
position: absolute;
right: 12rpx;
top: 12rpx;
width: 36rpx;
height: 36rpx;
}
.u-checkbox__label {
margin: 0;
}
/deep/.u-checkbox__icon-wrap {
border: 1px solid #fff;
}
/deep/.u-checkbox__icon-wrap--checked {
border: 1px solid #2979ff;
}
}
}
.icon {
display: flex;
justify-content: center;
align-items: center;
margin-top: 78rpx;
.favorite {
width: 318rpx;
height: 94rpx;
}
.start {
width: 180rpx;
height: 118rpx
}
}
.btn {
display: flex;
justify-content: center;
align-items: center;
width: 440rpx;
height: 80rpx;
margin-bottom: 24rpx;
background: linear-gradient(90deg, #3688FF 0%, #539FFF 100%);
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-size: 32rpx;
}
}
</style>
\ No newline at end of file
<template>
<view class="big-box" :style="{'padding-top': statusBarHeight + 'px'}">
<view class="nav-bar" :style="{'height': navHeight + 'px'}"></view>
<text class="title">扫脸获取您的照片</text>
<view class="scan">
<camera class="circle" device-position="front" flash="off" @error="error"></camera>
<view class="surface" v-if="show">
<view class="camera-tip">请正对镜头</view>
<text>{{text}}</text>
</view>
<image class="photo" v-show="src" :src="src"></image>
</view>
<view class="icon-box">
<view class="item">
<image src="./static/album/will-lit.png"></image>
<text>保持光线充足</text>
</view>
<view class="item">
<image src="./static/album/face-screen.png"></image>
<text>请面对屏幕</text>
</view>
<view class="item">
<image src="./static/album/no-shelter.png"></image>
<text>不得遮挡面部</text>
</view>
</view>
<text class="tip">获取照片需先在拍摄点摄影</text>
<u-mask :show="maskShow" @click="maskShow = false">
<view class="mask">
<text class="countdown">{{maskCount}}s</text>
<view class="tip">
<view>未找到您的照片</view>
<view class="small">请在拍摄点拍摄后重试</view>
</view>
<u-button type="info" size="mini" shape="circle" @click="maskShow = false">返回</u-button>
</view>
</u-mask>
</view>
</template>
<script>
import UMask from '@/uview-ui/components/u-mask/u-mask.vue'
export default {
components: {
UMask
},
data() {
return {
statusBarHeight: 0,
capsule: 0,
navHeight: 0,
src: '', //照片
text: 3, //倒计时
show: false, //摄像头倒计时文本
base64: '', //照片base64
maskShow: false,//弹窗显示
maskCount: 3,//弹窗倒计时
queryData: {},//查询参数
defaultBrightness: 0.5,//屏幕亮度
}
},
methods: {
recordDeviceInfo() {//---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
this.navHeight = (this.capsule.top - this.statusBarHeight) * 2 + this.capsule.height // 导航栏高度
},
openCamera() { //---用户首次进入打开权限
uni.authorize({ //摄像头
scope: 'scope.camera',
success: (res) => {
console.log('已打开摄像头权限')
this.getQueryField()
},
fail: (res) => {
uni.showModal({
content: '检测到您没打开摄像头权限,是否去设置打开?',
confirmText: '确认',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (res) => {
console.log(res)
this.getQueryField()
},
fail: (err) => {
console.log(err)
}
})
} else {
uni.navigateBack({
delta: 1
})
}
}
})
}
})
uni.authorize({
scope: 'scope.writePhotosAlbum',
success: (res) => {
console.log('已打开保存到相册权限')
},
fail: (res) => {
uni.showModal({
content: '检测到您没打开相册权限,是否去设置打开?',
confirmText: '确认',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (res) => {
console.log('已打开保存到相册权限')
},
fail: (err) => {
console.log('保存到相册权限打开失败' + err)
}
})
} else {
uni.navigateBack({
delta: 1
})
}
}
})
}
})
},
getQueryField() {//---获取查询参数
const merchantId = uni.getStorageSync('merchantId')
this.$request('scenic/albumConfig/getAlbumConfig',{merchantId}).then(res => {//创建任务
if (res.code === '00') {
this.queryData = res.data
this.takePhoto()
}else{
uni.showToast({
title: '查询参数获取失败',
icon: 'none'
})
}
})
},
query() { //人脸查询
uni.showLoading({
title: '人脸识别中'
})
let data = {
openid: uni.getStorageSync('openid'), //openid
uri: this.base64, //人脸图片base64编码
...this.queryData
}
this.$request('wechatUser/aliFace/faceSearch',data).then(res => {//创建任务
uni.hideLoading()
if (res.code === '00') {
if(res.data.faceIds && res.data.faceIds.length) {
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
uni.navigateTo({
url: `./myPhotoAlbum/myPhotoAlbum?faceIds=${JSON.stringify(res.data.faceIds)}`
})
}else {
this.handleNotFound()
}
}else{
this.handleNotFound()
}
})
},
handleNotFound() {//---处理没有找到照片或返回错误的逻辑
this.maskShow = true
var loop = setInterval(() => {
this.maskCount -= 1
if(this.maskCount <= -1) {
this.maskShow = false
this.src = ''
clearInterval(loop)
uni.navigateBack({
delta: 1
})
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
}
},1000)
},
takePhoto() { //扫脸
this.src = ''
this.text = 3
this.show = true
var test = setInterval(() => {
this.text = this.text - 1
if (this.text === 0) {
clearInterval(test)
this.show = false
const ctx = uni.createCameraContext()
ctx.takePhoto({
quality: 'high',
success: (res) => {
this.src = res.tempImagePath
uni.getFileSystemManager().readFile({ //图片转base64
filePath: res.tempImagePath, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success: res => { //成功的回调
this.base64 = res.data
this.query()
}
})
}
})
}
}, 1000)
},
error(e) { //相机报错
uni.showModal({
title: '提示',
content: e.detail,
showCancel: false
})
},
},
onLoad() {
this.recordDeviceInfo()
uni.getScreenBrightness({//获取屏幕亮度
success(res) {
this.defaultBrightness = res.value
},
fail() {
this.defaultBrightness = 0.5//如果获取失败设置亮度为中间值
}
})
uni.setScreenBrightness({
value: 0.8, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
this.openCamera()
}
}
</script>
<style lang="scss" scope>
.big-box {
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
background-color: #fff;
.title {
font-size: 32rpx;
margin: 30rpx 0 62rpx 0;
}
.scan {
position: relative;
width: 468rpx;
height: 468rpx;
margin-bottom: 20%;
z-index: 1;
.circle,
.surface,
.photo {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
border-radius: 50%;
}
.circle {
border: 1px dashed #999;
box-sizing: border-box;
background-color: #fff;
// z-index: 100;
}
.surface {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
font-size: 48rpx;
z-index: 200;
.camera-tip {
margin-bottom: 48rpx;
}
}
.photo {
z-index: 200;
}
&::before,
&::after {
position: absolute;
left: -12rpx;
top: 0;
content: '';
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #ECF5FF;
z-index: -1;
}
&::after {
left: 12rpx;
background-color: #CEE5FF;
}
}
.icon-box {
display: flex;
justify-content: space-evenly;
align-self: stretch;
margin-bottom: 20%;
.item {
display: flex;
flex-direction: column;
align-items: center;
text {
font-size: 24rpx;
font-weight: 700;
color: #191919;
}
}
image {
width: 88rpx;
height: 88rpx;
margin-bottom: 20rpx;
}
}
.tip {
font-size: 32rpx;
font-weight: 700;
color: #3688FF;
}
/deep/.u-mask {
display: flex;
justify-content: center;
align-items: center;
}
}
.mask {
display: flex;
flex-direction: column;
align-items: center;
width: 70%;
padding: 16rpx;
border-radius: 16rpx;
background-color: #fff;
.countdown {
align-self: flex-end;
}
.tip {
font-size: 36rpx;
color: #3688FF;
margin: 32rpx 0 24rpx 0;
text-align: center;
.small {
font-size: 28rpx;
color: #333;
}
}
}
</style>
\ No newline at end of file
This diff is collapsed.
<template>
</template>
<script>
</script>
<style>
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<!-- 4.如果企业微信码停用,走公众号流程 -->
<!-- 5.暂时没用,用的公众号 -->
<view class="bigBox">
<image src="../../../static/img/common/getTicketBg.jpg" class="bigImg"></image>
<!-- <image src="../../../static/img/common/getTicketBg.jpg" class="bigImg"></image> -->
<view class="title">获取电子门票</view>
<!-- 企业微信流程 -->
<view v-if="showCompany">
......
static/img/coupon/coupon.jpg

160 KB | W: | H:

static/img/coupon/coupon.jpg

115 KB | W: | H:

static/img/coupon/coupon.jpg
static/img/coupon/coupon.jpg
static/img/coupon/coupon.jpg
static/img/coupon/coupon.jpg
  • 2-up
  • Swipe
  • Onion skin
## 1.3.5(2022-01-24)
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.4(2022-01-24)
- 优化 size 支持其他单位
## 1.3.3(2022-01-17)
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
## 1.3.2(2021-12-01)
- 优化 示例可复制图标名称
## 1.3.1(2021-11-23)
- 优化 兼容旧组件 type 值
## 1.3.0(2021-11-19)
- 新增 更多图标
- 优化 自定义图标使用方式
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
## 1.1.7(2021-11-08)
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.5(2021-05-12)
- 新增 组件示例地址
## 1.1.4(2021-02-05)
- 调整为uni_modules目录规范
This diff is collapsed.
<template>
<!-- #ifdef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
<!-- #endif -->
</template>
<script>
import icons from './icons.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('"+iconUrl+"')"
});
// #endif
/**
* Icons 图标
* @description 用于展示 icons 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: 'UniIcons',
emits:['click'],
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
customPrefix:{
type: String,
default: ''
}
},
data() {
return {
icons: icons.glyphs
}
},
computed:{
unicode(){
let code = this.icons.find(v=>v.font_class === this.type)
if(code){
return unescape(`%u${code.unicode}`)
}
return ''
},
iconSize(){
return getVal(this.size)
}
},
methods: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf') format('truetype');
}
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>
.uniui-color:before {
content: "\e6cf";
}
.uniui-wallet:before {
content: "\e6b1";
}
.uniui-settings-filled:before {
content: "\e6ce";
}
.uniui-auth-filled:before {
content: "\e6cc";
}
.uniui-shop-filled:before {
content: "\e6cd";
}
.uniui-staff-filled:before {
content: "\e6cb";
}
.uniui-vip-filled:before {
content: "\e6c6";
}
.uniui-plus-filled:before {
content: "\e6c7";
}
.uniui-folder-add-filled:before {
content: "\e6c8";
}
.uniui-color-filled:before {
content: "\e6c9";
}
.uniui-tune-filled:before {
content: "\e6ca";
}
.uniui-calendar-filled:before {
content: "\e6c0";
}
.uniui-notification-filled:before {
content: "\e6c1";
}
.uniui-wallet-filled:before {
content: "\e6c2";
}
.uniui-medal-filled:before {
content: "\e6c3";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
.uniui-refreshempty:before {
content: "\e6bf";
}
.uniui-location-filled:before {
content: "\e6af";
}
.uniui-person-filled:before {
content: "\e69d";
}
.uniui-personadd-filled:before {
content: "\e698";
}
.uniui-back:before {
content: "\e6b9";
}
.uniui-forward:before {
content: "\e6ba";
}
.uniui-arrow-right:before {
content: "\e6bb";
}
.uniui-arrowthinright:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrowthinleft:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrowthinup:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthindown:before {
content: "\e6be";
}
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-arrowdown:before {
content: "\e6b8";
}
.uniui-right:before {
content: "\e6b5";
}
.uniui-arrowright:before {
content: "\e6b5";
}
.uniui-top:before {
content: "\e6b6";
}
.uniui-arrowup:before {
content: "\e6b6";
}
.uniui-left:before {
content: "\e6b7";
}
.uniui-arrowleft:before {
content: "\e6b7";
}
.uniui-eye:before {
content: "\e651";
}
.uniui-eye-filled:before {
content: "\e66a";
}
.uniui-eye-slash:before {
content: "\e6b3";
}
.uniui-eye-slash-filled:before {
content: "\e6b4";
}
.uniui-info-filled:before {
content: "\e649";
}
.uniui-reload:before {
content: "\e6b2";
}
.uniui-micoff-filled:before {
content: "\e6b0";
}
.uniui-map-pin-ellipse:before {
content: "\e6ac";
}
.uniui-map-pin:before {
content: "\e6ad";
}
.uniui-location:before {
content: "\e6ae";
}
.uniui-starhalf:before {
content: "\e683";
}
.uniui-star:before {
content: "\e688";
}
.uniui-star-filled:before {
content: "\e68f";
}
.uniui-calendar:before {
content: "\e6a0";
}
.uniui-fire:before {
content: "\e6a1";
}
.uniui-medal:before {
content: "\e6a2";
}
.uniui-font:before {
content: "\e6a3";
}
.uniui-gift:before {
content: "\e6a4";
}
.uniui-link:before {
content: "\e6a5";
}
.uniui-notification:before {
content: "\e6a6";
}
.uniui-staff:before {
content: "\e6a7";
}
.uniui-vip:before {
content: "\e6a8";
}
.uniui-folder-add:before {
content: "\e6a9";
}
.uniui-tune:before {
content: "\e6aa";
}
.uniui-auth:before {
content: "\e6ab";
}
.uniui-person:before {
content: "\e699";
}
.uniui-email-filled:before {
content: "\e69a";
}
.uniui-phone-filled:before {
content: "\e69b";
}
.uniui-phone:before {
content: "\e69c";
}
.uniui-email:before {
content: "\e69e";
}
.uniui-personadd:before {
content: "\e69f";
}
.uniui-chatboxes-filled:before {
content: "\e692";
}
.uniui-contact:before {
content: "\e693";
}
.uniui-chatbubble-filled:before {
content: "\e694";
}
.uniui-contact-filled:before {
content: "\e695";
}
.uniui-chatboxes:before {
content: "\e696";
}
.uniui-chatbubble:before {
content: "\e697";
}
.uniui-upload-filled:before {
content: "\e68e";
}
.uniui-upload:before {
content: "\e690";
}
.uniui-weixin:before {
content: "\e691";
}
.uniui-compose:before {
content: "\e67f";
}
.uniui-qq:before {
content: "\e680";
}
.uniui-download-filled:before {
content: "\e681";
}
.uniui-pyq:before {
content: "\e682";
}
.uniui-sound:before {
content: "\e684";
}
.uniui-trash-filled:before {
content: "\e685";
}
.uniui-sound-filled:before {
content: "\e686";
}
.uniui-trash:before {
content: "\e687";
}
.uniui-videocam-filled:before {
content: "\e689";
}
.uniui-spinner-cycle:before {
content: "\e68a";
}
.uniui-weibo:before {
content: "\e68b";
}
.uniui-videocam:before {
content: "\e68c";
}
.uniui-download:before {
content: "\e68d";
}
.uniui-help:before {
content: "\e679";
}
.uniui-navigate-filled:before {
content: "\e67a";
}
.uniui-plusempty:before {
content: "\e67b";
}
.uniui-smallcircle:before {
content: "\e67c";
}
.uniui-minus-filled:before {
content: "\e67d";
}
.uniui-micoff:before {
content: "\e67e";
}
.uniui-closeempty:before {
content: "\e66c";
}
.uniui-clear:before {
content: "\e66d";
}
.uniui-navigate:before {
content: "\e66e";
}
.uniui-minus:before {
content: "\e66f";
}
.uniui-image:before {
content: "\e670";
}
.uniui-mic:before {
content: "\e671";
}
.uniui-paperplane:before {
content: "\e672";
}
.uniui-close:before {
content: "\e673";
}
.uniui-help-filled:before {
content: "\e674";
}
.uniui-paperplane-filled:before {
content: "\e675";
}
.uniui-plus:before {
content: "\e676";
}
.uniui-mic-filled:before {
content: "\e677";
}
.uniui-image-filled:before {
content: "\e678";
}
.uniui-locked-filled:before {
content: "\e668";
}
.uniui-info:before {
content: "\e669";
}
.uniui-locked:before {
content: "\e66b";
}
.uniui-camera-filled:before {
content: "\e658";
}
.uniui-chat-filled:before {
content: "\e659";
}
.uniui-camera:before {
content: "\e65a";
}
.uniui-circle:before {
content: "\e65b";
}
.uniui-checkmarkempty:before {
content: "\e65c";
}
.uniui-chat:before {
content: "\e65d";
}
.uniui-circle-filled:before {
content: "\e65e";
}
.uniui-flag:before {
content: "\e65f";
}
.uniui-flag-filled:before {
content: "\e660";
}
.uniui-gear-filled:before {
content: "\e661";
}
.uniui-home:before {
content: "\e662";
}
.uniui-home-filled:before {
content: "\e663";
}
.uniui-gear:before {
content: "\e664";
}
.uniui-smallcircle-filled:before {
content: "\e665";
}
.uniui-map-filled:before {
content: "\e666";
}
.uniui-map:before {
content: "\e667";
}
.uniui-refresh-filled:before {
content: "\e656";
}
.uniui-refresh:before {
content: "\e657";
}
.uniui-cloud-upload:before {
content: "\e645";
}
.uniui-cloud-download-filled:before {
content: "\e646";
}
.uniui-cloud-download:before {
content: "\e647";
}
.uniui-cloud-upload-filled:before {
content: "\e648";
}
.uniui-redo:before {
content: "\e64a";
}
.uniui-images-filled:before {
content: "\e64b";
}
.uniui-undo-filled:before {
content: "\e64c";
}
.uniui-more:before {
content: "\e64d";
}
.uniui-more-filled:before {
content: "\e64e";
}
.uniui-undo:before {
content: "\e64f";
}
.uniui-images:before {
content: "\e650";
}
.uniui-paperclip:before {
content: "\e652";
}
.uniui-settings:before {
content: "\e653";
}
.uniui-search:before {
content: "\e654";
}
.uniui-redo-filled:before {
content: "\e655";
}
.uniui-list:before {
content: "\e644";
}
.uniui-mail-open-filled:before {
content: "\e63a";
}
.uniui-hand-down-filled:before {
content: "\e63c";
}
.uniui-hand-down:before {
content: "\e63d";
}
.uniui-hand-up-filled:before {
content: "\e63e";
}
.uniui-hand-up:before {
content: "\e63f";
}
.uniui-heart-filled:before {
content: "\e641";
}
.uniui-mail-open:before {
content: "\e643";
}
.uniui-heart:before {
content: "\e639";
}
.uniui-loop:before {
content: "\e633";
}
.uniui-pulldown:before {
content: "\e632";
}
.uniui-scan:before {
content: "\e62a";
}
.uniui-bars:before {
content: "\e627";
}
.uniui-cart-filled:before {
content: "\e629";
}
.uniui-checkbox:before {
content: "\e62b";
}
.uniui-checkbox-filled:before {
content: "\e62c";
}
.uniui-shop:before {
content: "\e62f";
}
.uniui-headphones:before {
content: "\e630";
}
.uniui-cart:before {
content: "\e631";
}
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "1.3.5",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
"uniui",
"icon",
"图标"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
## Icons 图标
> **组件名:uni-icons**
> 代码块: `uIcons`
用于展示 icons 图标 。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
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