Commit 176f6ca8 authored by qipeng's avatar qipeng

选择相册下单

parent e5b75d17
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
</swiper> </swiper>
<view class="photo-acquire"> <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-title">获取相片</view>
<view class="box-text">获取拍摄相片</view> <view class="box-text">获取拍摄相片</view>
<image class="box-img" src="./../static/album/icon02.png"></image> <image class="box-img" src="./../static/album/icon02.png"></image>
...@@ -131,6 +132,44 @@ export default { ...@@ -131,6 +132,44 @@ export default {
} }
}, },
methods: { 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(){ chooseImg(){
uni.chooseImage({ uni.chooseImage({
count: 6, //默认9 count: 6, //默认9
...@@ -329,11 +368,12 @@ export default { ...@@ -329,11 +368,12 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
this.$commonjs.getCompanyId(options) //this.$commonjs.getCompanyId(options)
this.openid = uni.getStorageSync('openid') this.openid = uni.getStorageSync('openid')
this.userId = uni.getStorageSync('userId') this.userId = uni.getStorageSync('userId')
this.recordDeviceInfo() this.recordDeviceInfo()
this.options = options this.options = options
this.options.companyId = this.$commonjs.getKey(options,'companyId')||''
if (this.options.template === 'true') { // 从模板选择页进入 if (this.options.template === 'true') { // 从模板选择页进入
this.show = true this.show = true
this.couponTip = true this.couponTip = true
...@@ -343,7 +383,6 @@ export default { ...@@ -343,7 +383,6 @@ export default {
this.show = true this.show = true
this.couponIsUse() this.couponIsUse()
} }
if (uni.getStorageSync('location')) return if (uni.getStorageSync('location')) return
uni.getLocation({ //获取定位 uni.getLocation({ //获取定位
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,15 +8,14 @@ ...@@ -8,15 +8,14 @@
<!--切换账号--> <!--切换账号-->
<view class="account-title">点击切换账号</view> <view class="account-title">点击切换账号</view>
<!--账号列表--> <!--账号列表-->
<view class="account-list"> <template v-for="(item,index) in phoneList">
<view class="list-num">153****6923</view> <view class="account-list" :key="index" @click="toMyphotoAlbum(item.mobile)">
<view class="list-new">当前使用</view> <view class="list-num">{{item.mobile}}</view>
</view> <!-- <view class="list-new">当前使用</view> -->
<view class="account-list">
<view class="list-num">152****7987</view>
</view> </view>
</template>
<!--添加账号--> <!--添加账号-->
<view class="account-add"> <view class="account-add" @click="toLogin">
<view class="add-icon"> <view class="add-icon">
<u-icon name="plus"></u-icon> <u-icon name="plus"></u-icon>
</view> </view>
...@@ -29,16 +28,51 @@ ...@@ -29,16 +28,51 @@
export default { export default {
data() { data() {
return { return {
phoneList:[],
statusBarHeight: 0,//状态栏高度 statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据 capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度 navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度 albumBoxTop:0,//顶部高度
companyId:'',
} }
}, },
onLoad(option) { onLoad(option) {
this.companyId = this.$commonjs.getKey(option,'companyId')||''
this.openid = uni.getStorageSync('openid')
this.recordDeviceInfo() this.recordDeviceInfo()
this.loginWork()
}, },
methods: { 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() { //---记录设备信息 recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度 this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据 this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据
...@@ -61,6 +95,7 @@ export default { ...@@ -61,6 +95,7 @@ export default {
height: 100vh; height: 100vh;
background-color: #fff; background-color: #fff;
padding-bottom: 464rpx; padding-bottom: 464rpx;
overflow: auto;
} }
.nav-bar { .nav-bar {
width: 100%; width: 100%;
...@@ -121,7 +156,7 @@ export default { ...@@ -121,7 +156,7 @@ export default {
box-shadow: 0rpx 4rpx 20rpx 0rpx #EDEDED; box-shadow: 0rpx 4rpx 20rpx 0rpx #EDEDED;
border-radius: 16rpx; border-radius: 16rpx;
border: 2rpx solid #F5F5F5; border: 2rpx solid #F5F5F5;
padding: 30rpx 40rpx 0 40rpx; padding: 30rpx 40rpx 30rpx 40rpx;
margin: 0 auto; margin: 0 auto;
.add-icon{ .add-icon{
width: 92rpx; width: 92rpx;
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
</view> </view>
<view class="login-list"> <view class="login-list">
<image class="list-img" src="../static/album/longin02.png"></image> <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>
<view class="login-list login-listAct"> <view class="login-list login-listAct">
<image class="list-img" src="../static/album/longin01.png"></image> <image class="list-img" src="../static/album/longin01.png"></image>
<input class="uni-input list-input" placeholder="请输入验证码" /> <input class="uni-input list-input" v-model="verifyCode" placeholder="请输入验证码" />
<view class="list-verification">获取验证码</view> <view class="list-verification" @click="verifyCodeSend">获取验证码</view>
</view> </view>
<view class="login-btn"> <view class="login-btn" @click="userLogin">
登陆 登陆
</view> </view>
</view> </view>
...@@ -28,16 +28,67 @@ ...@@ -28,16 +28,67 @@
export default { export default {
data() { data() {
return { return {
phone:'',//手机号
verifyCode:'',//验证码
statusBarHeight: 0,//状态栏高度 statusBarHeight: 0,//状态栏高度
capsule: 0,// 胶囊大小、位置数据 capsule: 0,// 胶囊大小、位置数据
navHeight: 0,// 导航栏高度 navHeight: 0,// 导航栏高度
albumBoxTop:0,//顶部高度 albumBoxTop:0,//顶部高度
companyId:'',
} }
}, },
onLoad(option) { onLoad(option) {
this.companyId = this.$commonjs.getKey(option,'companyId')||''
this.recordDeviceInfo() this.recordDeviceInfo()
}, },
methods: { 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() { //---记录设备信息 recordDeviceInfo() { //---记录设备信息
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度 this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 状态栏高度
this.capsule = uni.getMenuButtonBoundingClientRect() // 胶囊大小、位置数据 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