Commit 321ed2ed authored by 潘永坪's avatar 潘永坪

Merge branch 'album' of http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel into album

parents 1029986d d1428287
...@@ -6,19 +6,19 @@ ...@@ -6,19 +6,19 @@
<view class="body"> <view class="body">
<view class="scroll-view" > <view class="scroll-view" >
<view class="item" @click="jumpToScanFaceClick"> <view class="item" @click="jumpToScanFaceClick">
<image class="img" src="../../static/img/coupon/coupon.jpg"></image> <image class="img" src="../../static/img/album/myAlbum.png"></image>
<text class="title">我的相片</text> <text class="title">我的相片</text>
</view> </view>
<view class="item"> <view class="item">
<image class="img" src="../../static/img/coupon/coupon.jpg"></image> <image class="img" src="../../static/img/album/DIY.png"></image>
<text class="title">影像DIY</text> <text class="title">影像DIY</text>
</view> </view>
<view class="item" @click="jumpToCustomClick"> <view class="item" @click="jumpToCustomClick">
<image class="img" src="../../static/img/coupon/coupon.jpg"></image> <image class="img" src="../../static/img/album/custom.png"></image>
<text class="title">旅拍定制</text> <text class="title">旅拍定制</text>
</view> </view>
<view class="item"> <view class="item">
<image class="img" src="../../static/img/coupon/coupon.jpg"></image> <image class="img" src="../../static/img/album/myVlog.png"></image>
<text class="title">我的Vlog</text> <text class="title">我的Vlog</text>
</view> </view>
</view> </view>
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<u-waterfall v-model="list" ref="uWaterfall"> <u-waterfall v-model="list" ref="uWaterfall">
<template v-slot:left="{leftList}"> <template v-slot:left="{leftList}">
<view class="left demo-water" v-for="(item, index) in leftList" :key="index" @click="jumpToClick(item.title)"> <view class="left demo-water" v-for="(item, index) in leftList" :key="index" @click="jumpToClick(item.title)">
<u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load> <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="info-box" :style="{'background-color': item.color}">
<view class="item-title">{{item.title}}</view> <view class="item-title">{{item.title}}</view>
<view class="slogan">一句宣传语</view> <view class="slogan">一句宣传语</view>
...@@ -44,10 +45,11 @@ ...@@ -44,10 +45,11 @@
</template> </template>
<template v-slot:right="{rightList}"> <template v-slot:right="{rightList}">
<view class="demo-water" v-for="(item, index) in rightList" :key="index" @click="jumpToClick(item.title)"> <view class="demo-water" v-for="(item, index) in rightList" :key="index" @click="jumpToClick(item.title)">
<u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load> <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="info-box" :style="{'background-color': item.color}">
<view class="item-title">{{item.title}}</view> <view class="item-title">{{item.title}}</view>
<view class="slogan">一句宣传语</view> <view class="slogan">快来定制吧</view>
<view class="bottom"> <view class="bottom">
<view class="img-btn"> <view class="img-btn">
点击定制 点击定制
...@@ -61,85 +63,95 @@ ...@@ -61,85 +63,95 @@
</u-waterfall> </u-waterfall>
</view> </view>
</view> </view>
<u-mask :show="showtip" >
<view class="mask">
<view class="img-box">
<image src="../../static/img/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> </view>
</template> </template>
<script> <script>
import UWaterfall from '@/uview-ui/components/u-waterfall/u-waterfall.vue' 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 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 { export default {
components: { components: {
UWaterfall, UWaterfall,
ULazyLoad ULazyLoad,
UMask
}, },
data() { data() {
return { return {
showtip: false,//领取提示
statusBarHeight: 0, statusBarHeight: 0,
capsule: 0, capsule: 0,
navHeight: 0, navHeight: 0,
tabList: [
{id: 1, url: '../../static/img/coupon/coupon.jpg'},
],
activeList: [],
flowList: [],
list: [ list: [
{ {
title: '精彩瞬间', title: '精彩瞬间',
count: '10W+', count: '10W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg', image: '../../static/img/album/wonderfulMoment.png',
color: '#037EFF' color: '#037EFF'
}, },
{ {
title: '网红旅拍', title: '网红旅拍',
count: '8W+', count: '8W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', image: '../../static/img/album/travalphoto.png',
color: '#826847' color: '#826847'
}, },
{ {
title: '抱枕DIY', title: '抱枕DIY',
count: '4W+', count: '4W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg', image: '../../static/img/album/pillow.png',
color: '#1175B4' color: '#1175B4'
}, },
{ {
title: '影像公仔', title: '明信片',
count: '10W+', count: '4W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', image: '../../static/img/album/postcard.png',
color: '#3478DC' color: '#3478DC'
}, },
{ {
title: '8D魔方', title: '旅游台历定制',
count: '10W+', count: '4W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', image: '../../static/img/album/deskCalender.png',
color: '#1A9B45' color: '#1A9B45'
}, },
{
title: 'T桖DIY',
count: '10W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg',
color: '#D48D46'
},
{
title: '旅行台历',
count: '10W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg',
color: '#037EFF'
},
{ {
title: '定制相册', title: '定制相册',
count: '10W+', count: '4W+',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', image: '../../static/img/album/customPic.png',
color: '#037EFF' color: '#D48D46'
}, }
] ]
} }
}, },
methods: { methods: {
jumpToScanFaceClick() {//---跳转扫脸页面 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({ uni.navigateTo({
url: './getPortrait' url: './getPortrait'
}) })
}else if(res.data.isScanFace === 1) {//已扫脸
this.jumpToCustomClick()
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}, },
jumpToCustomClick() {//---跳转旅拍定制页面 jumpToCustomClick() {//---跳转旅拍定制页面
uni.navigateTo({ uni.navigateTo({
...@@ -148,9 +160,7 @@ export default { ...@@ -148,9 +160,7 @@ export default {
}, },
jumpToClick(title) { jumpToClick(title) {
if(title === '精彩瞬间') { if(title === '精彩瞬间') {
uni.navigateTo({ this.jumpToScanFaceClick()
url: './getPortrait'
})
} }
if(title === '网红旅拍') { if(title === '网红旅拍') {
uni.navigateTo({ uni.navigateTo({
...@@ -165,7 +175,7 @@ export default { ...@@ -165,7 +175,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
console.log(option) if(option.tip === 'true') this.showtip = true
this.recordDeviceInfo() this.recordDeviceInfo()
} }
} }
...@@ -187,6 +197,11 @@ export default { ...@@ -187,6 +197,11 @@ export default {
z-index: -1; z-index: -1;
background: linear-gradient(to top, #f7f7f7, #f7f7f7 80%, transparent 100%); background: linear-gradient(to top, #f7f7f7, #f7f7f7 80%, transparent 100%);
} }
/deep/.u-mask {
display: flex;
justify-content: center;
align-items: center;
}
} }
.nav-bar { .nav-bar {
font-size: 36rpx; font-size: 36rpx;
...@@ -195,9 +210,12 @@ export default { ...@@ -195,9 +210,12 @@ export default {
} }
.scroll-view { .scroll-view {
display: flex; display: flex;
width: calc(100% + 24rpx); width: calc(100% + 48rpx);
position: relative;
top: 0;
left: -24rpx;
overflow-x: auto; overflow-x: auto;
padding-top: 46rpx; padding: 46rpx 0 0 24rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
...@@ -212,19 +230,11 @@ export default { ...@@ -212,19 +230,11 @@ export default {
width: 200rpx; width: 200rpx;
height: 136rpx; height: 136rpx;
border-radius: 16rpx; border-radius: 16rpx;
padding: 10rpx 12rpx 8rpx 12rpx; // padding: 10rpx 12rpx 8rpx 12rpx;
margin-bottom: 16rpx; margin-bottom: 16rpx;
background: #F2ECDF;
box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.12); box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.12);
overflow: hidden; overflow: hidden;
} }
.item:nth-child(2) .img {
background: #fff;
}
.item:nth-child(3) .img,
.item:nth-child(4) .img{
background: #d9d9d9;
}
.title { .title {
font-size: 28rpx; font-size: 28rpx;
font-weight: 700; font-weight: 700;
...@@ -247,7 +257,10 @@ export default { ...@@ -247,7 +257,10 @@ export default {
} }
} }
.demo-water { .demo-water {
// margin-bottom: 16rpx; image {
border-radius: 16rpx 16rpx 0 0;
width: 100%;
}
/deep/.u-wrap, /deep/.u-wrap,
/deep/.u-lazy-item { /deep/.u-lazy-item {
broder-radius: 16rpx 16rpx 0 0 !important; broder-radius: 16rpx 16rpx 0 0 !important;
...@@ -295,4 +308,33 @@ export default { ...@@ -295,4 +308,33 @@ export default {
} }
} }
} }
.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> </style>
\ No newline at end of file
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
imgArr: [],//图片 imgArr: [],//图片
value: true, value: true,
location: {},//位置信息 location: {},//位置信息
selected: '' option: {},//路由传参
} }
}, },
methods: { methods: {
...@@ -88,9 +88,12 @@ export default { ...@@ -88,9 +88,12 @@ export default {
this.$request('scenic/newMerchant/findAllMerchant').then(res => {//创建任务 this.$request('scenic/newMerchant/findAllMerchant').then(res => {//创建任务
if (res.code === '00') { if (res.code === '00') {
if(!res.data.length) return if(!res.data.length) return
const index = res.data.findIndex(item => item.id === nearbyId)
this.companyArr = res.data const id = this.option.merchantId || nearbyId
let index = res.data.findIndex(item => item.id === id)
this.index = index === -1 ? 0 : index this.index = index === -1 ? 0 : index
this.companyArr = res.data
this.getPic(this.companyArr[this.index].id) this.getPic(this.companyArr[this.index].id)
}else{ }else{
uni.showToast({ uni.showToast({
...@@ -138,22 +141,29 @@ export default { ...@@ -138,22 +141,29 @@ export default {
}) })
} }
}, },
onLoad() { onLoad(option) {
uni.getLocation({ this.option = option
this.recordDeviceInfo()
uni.getLocation({//获取定位
type: 'wgs84', type: 'wgs84',
success: res => { success: res => {
this.location = res this.location = res
uni.setStorageSync('location', JSON.stringify(res)) uni.setStorageSync('location', JSON.stringify(res))
if(this.option.merchantId) {//扫码进入则直接加载景区列表,默认显示传入的景区
this.getCompany()
}else {//否则获取并显示距离最近的景点
this.getNearByCompany() this.getNearByCompany()
}
}, },
fail() { fail() {
this.getCompany()
uni.showToast({ uni.showToast({
title: '获取经纬度失败', title: '获取经纬度失败',
icon: 'none' icon: 'none'
}) })
} }
}) })
this.recordDeviceInfo()
} }
} }
</script> </script>
......
...@@ -55,6 +55,8 @@ export default { ...@@ -55,6 +55,8 @@ export default {
base64: '', //照片base64 base64: '', //照片base64
maskShow: false,//弹窗显示 maskShow: false,//弹窗显示
maskCount: 3,//弹窗倒计时 maskCount: 3,//弹窗倒计时
queryData: {},//查询参数
defaultBrightness: 0.5,//屏幕亮度
} }
}, },
methods: { methods: {
...@@ -68,7 +70,7 @@ export default { ...@@ -68,7 +70,7 @@ export default {
scope: 'scope.camera', scope: 'scope.camera',
success: (res) => { success: (res) => {
console.log('已打开摄像头权限') console.log('已打开摄像头权限')
this.takePhoto() this.getQueryField()
}, },
fail: (res) => { fail: (res) => {
uni.showModal({ uni.showModal({
...@@ -80,7 +82,7 @@ export default { ...@@ -80,7 +82,7 @@ export default {
uni.openSetting({ uni.openSetting({
success: (res) => { success: (res) => {
console.log(res) console.log(res)
this.takePhoto() this.getQueryField()
}, },
fail: (err) => { fail: (err) => {
console.log(err) console.log(err)
...@@ -125,32 +127,49 @@ export default { ...@@ -125,32 +127,49 @@ export default {
} }
}) })
}, },
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() { //人脸查询 query() { //人脸查询
uni.showLoading({ uni.showLoading({
title: '人脸识别中' title: '人脸识别中'
}) })
let data = { let data = {
openid: uni.getStorageSync('openid'), //openid openid: uni.getStorageSync('openid'), //openid
bucketName: 'a124Jj6IYiSzCjVV', //
dbName: uni.getStorageSync('openid'), //
uri: this.base64, //人脸图片base64编码 uri: this.base64, //人脸图片base64编码
...this.queryData
} }
this.$request('wechatUser/aliFace/faceSearch',data).then(res => {//创建任务 this.$request('wechatUser/aliFace/faceSearch',data).then(res => {//创建任务
uni.hideLoading()
if (res.code === '00') { if (res.code === '00') {
if(res.data.length) {
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
uni.navigateTo({ uni.navigateTo({
url: './myPhotoAlbum/myPhotoAlbum' url: './myPhotoAlbum/myPhotoAlbum'
}) })
uni.showModal({ }else {
title: '提示', this.handleNotFound()
content: '视频合成中,请在1~2分钟后在我的VLOG视频集中查看',
showCancel:false,
success() {
// uni.navigateTo({
// url:'../vlogIndex/vlogIndex'
// })
} }
})
}else{ }else{
this.handleNotFound()
}
})
},
handleNotFound() {//---处理没有找到照片或返回错误的逻辑
this.maskShow = true this.maskShow = true
var loop = setInterval(() => { var loop = setInterval(() => {
this.maskCount -= 1 this.maskCount -= 1
...@@ -161,20 +180,11 @@ export default { ...@@ -161,20 +180,11 @@ export default {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
} }
},1000) },1000)
// uni.showModal({
// title: '提示',
// content: '请先在打卡点录制素材',
// showCancel:false,
// success() {
// // uni.navigateTo({
// // url:'../vlogIndex/vlogIndex'
// // })
// }
// })
}
})
}, },
takePhoto() { //扫脸 takePhoto() { //扫脸
this.src = '' this.src = ''
...@@ -194,7 +204,7 @@ export default { ...@@ -194,7 +204,7 @@ export default {
filePath: res.tempImagePath, //选择图片返回的相对路径 filePath: res.tempImagePath, //选择图片返回的相对路径
encoding: 'base64', //编码格式 encoding: 'base64', //编码格式
success: res => { //成功的回调 success: res => { //成功的回调
this.base64 = 'data:image/jpeg;base64,' + res.data this.base64 = res.data
this.query() this.query()
} }
}) })
...@@ -203,9 +213,6 @@ export default { ...@@ -203,9 +213,6 @@ export default {
} }
}, 1000) }, 1000)
}, },
initdone(){//相机初始化完成自动开始拍照
this.takePhoto()
},
error(e) { //相机报错 error(e) { //相机报错
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
...@@ -216,11 +223,16 @@ export default { ...@@ -216,11 +223,16 @@ export default {
}, },
onLoad() { onLoad() {
this.recordDeviceInfo() this.recordDeviceInfo()
uni.getScreenBrightness({//获取屏幕亮度
success(res) {
this.defaultBrightness = res.value
},
fail() {
this.defaultBrightness = 0.5//如果获取失败设置亮度为中间值
}
})
uni.setScreenBrightness({ uni.setScreenBrightness({
value: 1, //屏幕亮度值,范围 0~1,0 最暗,1 最亮 value: 1, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
success: function() {
console.log('ScreenBrightness success')
}
}) })
this.openCamera() this.openCamera()
} }
......
static/img/album/face-screen.png

522 Bytes | W: | H:

static/img/album/face-screen.png

1.01 KB | W: | H:

static/img/album/face-screen.png
static/img/album/face-screen.png
static/img/album/face-screen.png
static/img/album/face-screen.png
  • 2-up
  • Swipe
  • Onion skin
static/img/album/no-shelter.png

1.6 KB | W: | H:

static/img/album/no-shelter.png

3.63 KB | W: | H:

static/img/album/no-shelter.png
static/img/album/no-shelter.png
static/img/album/no-shelter.png
static/img/album/no-shelter.png
  • 2-up
  • Swipe
  • Onion skin
static/img/album/will-lit.png

893 Bytes | W: | H:

static/img/album/will-lit.png

1.84 KB | W: | H:

static/img/album/will-lit.png
static/img/album/will-lit.png
static/img/album/will-lit.png
static/img/album/will-lit.png
  • 2-up
  • Swipe
  • Onion skin
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