Commit 176f6ca8 authored by qipeng's avatar qipeng

选择相册下单

parent e5b75d17
......@@ -20,7 +20,8 @@
</swiper>
<view class="photo-acquire">
<view class="acquire-box acquire-boxBlue" @click="jumpToScanFaceClick">
<!-- @click="jumpToScanFaceClick"-->
<view class="acquire-box acquire-boxBlue" @click="loginWork()">
<view class="box-title">获取相片</view>
<view class="box-text">获取拍摄相片</view>
<image class="box-img" src="./../static/album/icon02.png"></image>
......@@ -131,6 +132,44 @@ export default {
}
},
methods: {
loginWork(){//是否需要登陆 先通过openid检测下该openid是否有绑定手机号
var data = {
openid : this.openid
}
this.$request('scenic/albumUser/albumUserCheck', data).then(res => {
if (res.code === '00') {
if(res.data.length!=0){//判断账户是否为空
if(res.data.length>1){
var companyId = this.options.companyId
uni.navigateTo({
url: '/pages/album/photoAccount/photoAccount?companyId='+companyId
})
}else{
var phone = res.data[0].mobile
var companyId = this.options.companyId
uni.navigateTo({
url: '/pages/album/myPhotoAlbum/myPhotoAlbum?phone='+phone+'&companyId='+companyId
})
}
}else{
var companyId = this.options.companyId
uni.navigateTo({
url: '/pages/album/photoLogin/photoLogin?companyId='+companyId
})
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
chooseImg(){
uni.chooseImage({
count: 6, //默认9
......@@ -329,11 +368,12 @@ export default {
}
},
onLoad(options) {
this.$commonjs.getCompanyId(options)
//this.$commonjs.getCompanyId(options)
this.openid = uni.getStorageSync('openid')
this.userId = uni.getStorageSync('userId')
this.recordDeviceInfo()
this.options = options
this.options.companyId = this.$commonjs.getKey(options,'companyId')||''
if (this.options.template === 'true') { // 从模板选择页进入
this.show = true
this.couponTip = true
......@@ -343,7 +383,6 @@ export default {
this.show = true
this.couponIsUse()
}
if (uni.getStorageSync('location')) return
uni.getLocation({ //获取定位
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,15 +8,14 @@
<!--切换账号-->
<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>
<template v-for="(item,index) in phoneList">
<view class="account-list" :key="index" @click="toMyphotoAlbum(item.mobile)">
<view class="list-num">{{item.mobile}}</view>
<!-- <view class="list-new">当前使用</view> -->
</view>
</template>
<!--添加账号-->
<view class="account-add">
<view class="account-add" @click="toLogin">
<view class="add-icon">
<u-icon name="plus"></u-icon>
</view>
......@@ -29,16 +28,51 @@
export default {
data() {
return {
phoneList:[],
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
companyId:'',
}
},
onLoad(option) {
this.companyId = this.$commonjs.getKey(option,'companyId')||''
this.openid = uni.getStorageSync('openid')
this.recordDeviceInfo()
this.loginWork()
},
methods: {
loginWork(){//是否需要登陆 先通过openid检测下该openid是否有绑定手机号
var data = {
openid : this.openid
}
this.$request('scenic/albumUser/albumUserCheck', data).then(res => {
if (res.code === '00') {
this.phoneList = res.data
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
toLogin(){//跳转登录
uni.navigateTo({
url: '/pages/album/photoLogin/photoLogin?companyId='+this.companyId
})
},
toMyphotoAlbum(phone){//跳转相片
uni.navigateTo({
url: '/pages/album/myPhotoAlbum/myPhotoAlbum?phone='+phone+'&companyId='+this.companyId
})
},
recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
......@@ -61,6 +95,7 @@ export default {
height: 100vh;
background-color: #fff;
padding-bottom: 464rpx;
overflow: auto;
}
.nav-bar {
width: 100%;
......@@ -121,7 +156,7 @@ export default {
box-shadow: 0rpx 4rpx 20rpx 0rpx #EDEDED;
border-radius: 16rpx;
border: 2rpx solid #F5F5F5;
padding: 30rpx 40rpx 0 40rpx;
padding: 30rpx 40rpx 30rpx 40rpx;
margin: 0 auto;
.add-icon{
width: 92rpx;
......
......@@ -11,14 +11,14 @@
</view>
<view class="login-list">
<image class="list-img" src="../static/album/longin02.png"></image>
<input class="uni-input list-input" placeholder="请输入摄影时预留手机号" />
<input class="uni-input list-input" v-model="phone" 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>
<input class="uni-input list-input" v-model="verifyCode" placeholder="请输入验证码" />
<view class="list-verification" @click="verifyCodeSend">获取验证码</view>
</view>
<view class="login-btn">
<view class="login-btn" @click="userLogin">
登陆
</view>
</view>
......@@ -28,16 +28,67 @@
export default {
data() {
return {
phone:'',//手机号
verifyCode:'',//验证码
statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度
companyId:'',
}
},
onLoad(option) {
this.companyId = this.$commonjs.getKey(option,'companyId')||''
this.recordDeviceInfo()
},
methods: {
verifyCodeSend(){//发送验证码
var data = {
phone : this.phone
}
this.$request('scenic/albumUser/albumVerifyCodeSend', data).then(res => {
if (res.code === '00') {
uni.showToast({
title: '发送成功',
})
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
userLogin(){//登陆
var data = {
phone : this.phone,
verifyCode : this.verifyCode,
openid : uni.getStorageSync('openid')
}
this.$request('scenic/albumUser/albumUserLogin', data).then(res => {
if (res.code === '00') {
var phone = this.phone
uni.navigateTo({
url: '/pages/album/myPhotoAlbum/myPhotoAlbum?phone='+phone+'&companyId='+this.companyId
})
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
})
},
recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
......
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