Commit 60032ee2 authored by youjie's avatar youjie

no message

parent 8f08c668
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<template v-if="guestInfor.code==0&&guestInfor.IsEnd==0"> <template v-if="guestInfor.code==0&&guestInfor.IsEnd==0">
去填写 去填写
</template> </template>
<template v-if="(guestInfor.code==0||guestInfor.code==1)&&guestInfor.IsEnd==1"> <template v-else>
查看 查看
</template> </template>
<button v-if="guestInfor.code==0&&guestInfor.IsEnd==0" <button v-if="guestInfor.code==0&&guestInfor.IsEnd==0"
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
// let scene = "tcid=23430" // let scene = "tcid=25137"
// console.log(encodeURIComponent(scene),'------') // console.log(encodeURIComponent(scene),'------')
let t = decodeURIComponent(option.scene).split('&') let t = decodeURIComponent(option.scene).split('&')
t.forEach(x => { t.forEach(x => {
...@@ -155,7 +155,8 @@ export default { ...@@ -155,7 +155,8 @@ export default {
this.guestInfor.guest.length>0&& this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){ this.guestInfor.guest.length==1){
this.msg.Id = this.guestInfor.guest[0].Id; this.msg.Id = this.guestInfor.guest[0].Id;
this.msg.OrderId = this.guestInfor.guest[0].OrderId; this.msg.OrderId = this.guestInfor.guest[0].OrderId;
this.msg.Phone = this.guestInfor.guest[0].MobilePhone;
} }
uni.hideLoading(); uni.hideLoading();
}}, (error) => { }}, (error) => {
...@@ -178,9 +179,12 @@ export default { ...@@ -178,9 +179,12 @@ export default {
this.guestInfor.guest.length>0&& this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){ this.guestInfor.guest.length==1){
this.msg.Id = this.guestInfor.guest[0].Id; this.msg.Id = this.guestInfor.guest[0].Id;
this.msg.OrderId = this.guestInfor.guest[0].OrderId; this.msg.OrderId = this.guestInfor.guest[0].OrderId;
this.msg.Phone = this.guestInfor.guest[0].MobilePhone;
this.setRegister()
}else if(this.guestInfor.guest&&this.guestInfor.guest.length>1){
this.goUrl()
} }
this.setRegister()
}}, (error) => { }}, (error) => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
...@@ -191,6 +195,7 @@ export default { ...@@ -191,6 +195,7 @@ export default {
}, },
// 手机号授权 // 手机号授权
async getPhoneNumber(e) { async getPhoneNumber(e) {
console.log(e,'-----e')
let that = this let that = this
if(e.detail.errMsg&&e.detail.errMsg=="getPhoneNumber:ok"&&e.detail.code) { if(e.detail.errMsg&&e.detail.errMsg=="getPhoneNumber:ok"&&e.detail.code) {
// 用户点击了允许授权 // 用户点击了允许授权
...@@ -205,8 +210,9 @@ export default { ...@@ -205,8 +210,9 @@ export default {
}, (res) => { }, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
that.msg.Phone = res.data.phoneNumber; that.msg.Phone = res.data.phoneNumber;
if(that.guestInfor.guest.length==0)that.GuestByPhone() if(that.guestInfor.guest&&that.guestInfor.guest.length==0)that.GuestByPhone()
else that.setRegister() else if(that.guestInfor.guest&&that.guestInfor.guest.length==1) that.setRegister()
else if(that.guestInfor.guest&&that.guestInfor.guest.length>1) that.goUrl()
}}, (error) => { }}, (error) => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
...@@ -238,7 +244,14 @@ export default { ...@@ -238,7 +244,14 @@ export default {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showLogin = false; this.showLogin = false;
uni.hideLoading(); uni.hideLoading();
this.goWebUrl() if(this.guestInfor.guest&&
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){
this.goWebUrl()
}else{
this.goUrl()
}
}}, (error) => { }}, (error) => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
...@@ -256,6 +269,13 @@ export default { ...@@ -256,6 +269,13 @@ export default {
}) })
return return
} }
if(this.msg.Id==0||this.msg.OrderId==0){
uni.showToast({
title: '请选择任意人员',
icon: 'none'
})
return
}
let obj = this.obj let obj = this.obj
var that = this; var that = this;
that.showLogin = false; that.showLogin = false;
...@@ -292,15 +312,7 @@ export default { ...@@ -292,15 +312,7 @@ export default {
(res) => { (res) => {
that.showLogin = true; //防止多次点击登录 that.showLogin = true; //防止多次点击登录
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showDialog = false; uni.setStorageSync("mall_UserInfo", res.data);
uni.setStorageSync("mall_UserInfo", res.data);
if (res.couponResultCode == 1) {
if (uni.getStorageSync("ComeFrom")) {
that.ComeFrom = uni.getStorageSync("ComeFrom").ComeFrom;
}
that.showCoupons = true;
that.couponMessage = res.couponMessage;
}
uni.removeStorageSync("pid"); uni.removeStorageSync("pid");
uni.removeStorageSync("SmallShopId"); uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("Up"); uni.removeStorageSync("Up");
...@@ -333,10 +345,7 @@ export default { ...@@ -333,10 +345,7 @@ export default {
Moblie: this.msg.Phone, Moblie: this.msg.Phone,
} }
this.apipost("HePingGuoLvLogin_post", parameters, r =>{ this.apipost("HePingGuoLvLogin_post", parameters, r =>{
if(this.guestInfor.guest&& if(this.guestInfor.code==0&&
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1&&
this.guestInfor.code==0&&
this.guestInfor.IsEnd==0){ this.guestInfor.IsEnd==0){
this.setPhone() this.setPhone()
}else{ }else{
...@@ -355,8 +364,9 @@ export default { ...@@ -355,8 +364,9 @@ export default {
}, },
goUrl() { goUrl() {
let msg = JSON.stringify(this.msg) let msg = JSON.stringify(this.msg)
let obj = JSON.stringify(this.obj)
uni.navigateTo({ uni.navigateTo({
url: `/pages/customerAction/obtainInfor?msg=${encodeURIComponent(msg)}`, url: `/pages/customerAction/obtainInfor?msg=${encodeURIComponent(msg)}&obj=${encodeURIComponent(obj)}`,
}); });
}, },
goWebUrl() { goWebUrl() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="obtainInforBox column"> <view class="obtainInforBox column">
<view class="obtainInforTitle">请选以下任意代表填写意见</view> <view class="obtainInforTitle">请选以下任意代表填写意见</view>
<scroll-view :scroll-y="true" <scroll-view :scroll-y="true"
:enable-back-to-top="true" style="height: 1px;flex: 1;" :enable-back-to-top="true" style="height: 1px;flex: 1;overflow: hidden;"
:enable-flex="true"> :enable-flex="true">
<radio-group @change="radioChange"> <radio-group @change="radioChange">
<label class="obtainInforLab row" v-for="(item, index) in guestInfor.guest" :key="index"> <label class="obtainInforLab row" v-for="(item, index) in guestInfor.guest" :key="index">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</radio-group> </radio-group>
</scroll-view> </scroll-view>
<view class="obtainInforGo" <view class="obtainInforGo"
:class="[current==0||showLogin?'active':'']" @click="current==0||showLogin?'':setPhone()"> :class="[current==0||showLogin?'active':'']" @click="current==0||showLogin?'':setRegister()">
确定 确定
</view> </view>
</view> </view>
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
Id: 0, Id: 0,
OrderId: 0, OrderId: 0,
}, },
obj: null,
list:[ list:[
{ {
name:'我是业主', name:'我是业主',
...@@ -52,38 +53,126 @@ export default { ...@@ -52,38 +53,126 @@ export default {
}, },
onLoad(option) { onLoad(option) {
this.msg = JSON.parse(decodeURIComponent(option.msg)) this.msg = JSON.parse(decodeURIComponent(option.msg))
this.obj = JSON.parse(decodeURIComponent(option.obj))
this.QueryUsers() this.QueryUsers()
}, },
methods: { methods: {
// 更新手机号 // 更新手机号
setPhone(){ setPhone(){
if(this.guestInfor.code==0&&this.guestInfor.IsEnd==0){ if(this.msg.TCID==''||this.msg.HPSLOpenId==''||
this.msg.Unoinid==''||this.msg.Phone==''||this.msg.Id==''){
return uni.showToast({
title: '信息不完善,请稍后再试',
icon: 'none'
})
}
this.apipost("post_UpdateOrderGuest",this.msg,res => {
if (res.resultCode == 1) {
this.showLogin = false;
uni.hideLoading();
this.goWebUrl()
}}, (error) => {
uni.hideLoading();
uni.showToast({
title: error.message,
icon: "none",
});
})
},
// 注册账号
setRegister(){
if(this.showLogin) return; if(this.showLogin) return;
if(this.msg.TCID==''||this.msg.HPSLOpenId==''|| if(this.msg.Id==0||this.msg.OrderId==0){
this.msg.Unoinid==''||this.msg.Phone==''||this.msg.Id==''){ uni.showToast({
return uni.showToast({ title: '请选择任意人员',
title: '信息不完善,请稍后再试',
icon: 'none' icon: 'none'
}) })
return
} }
this.showLogin = true; let obj = this.obj
this.apipost("post_UpdateOrderGuest",this.msg,res => { var that = this;
if (res.resultCode == 1) { let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ?
uni.getStorageSync("SmallShopId").SmallShopId :
0;
let CounponPassword = uni.getStorageSync("CounponPassword") ?
uni.getStorageSync("CounponPassword").CounponPassword :
0;
let KeyWord = uni.getStorageSync("KeyWord") ?
uni.getStorageSync("KeyWord").KeyWord :
"";
let loginMsg = {
Source: 1,
OpenId: obj.OpenId,
Name: obj.Name,
Photo: obj.Photo,
Gender: obj.Gender,
Moblie: "",
SuperiorId: pid,
SmallShopId: SmallShopId,
UserPageType: Up,
CounponPassword: CounponPassword,
KeyWord: KeyWord,
Unoinid: obj.Unionid,
}
let url = "/api/AppletLogin/HPSLLogin"
that.request2({
url,
data: loginMsg,
},
(res) => {
that.showLogin = true; //防止多次点击登录
if (res.resultCode == 1) {
uni.setStorageSync("mall_UserInfo", res.data);
uni.removeStorageSync("pid");
uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("Up");
uni.removeStorageSync("CounponPassword");
uni.removeStorageSync("KeyWord");
const {OpenId,Unoinid,Name} = res.data
this.directUserLoginHandle(OpenId,Unoinid,Name)
}
},err=>{
uni.hideLoading();
uni.showToast({
title:err.message,
icon:'none'
})
}
);
},
directUserLoginHandle(OpenId,Unoinid,Name){
let Pid = 0
if(uni.getStorageSync('direct_user_id')){
Pid = uni.getStorageSync('direct_user_id')
if(isNaN(Pid)) Pid = 0
uni.removeStorageSync('direct_user_id')
}
const parameters={
OpenId,
Unoinid,
Pid,
Moblie: this.msg.Phone,
}
this.apipost("HePingGuoLvLogin_post", parameters, r =>{
if(this.guestInfor.code==0&&
this.guestInfor.IsEnd==0){
this.setPhone()
}else{
this.showLogin = false; this.showLogin = false;
uni.hideLoading(); uni.hideLoading();
this.goWebUrl() this.goWebUrl()
}}, (error) => { }
uni.hideLoading();
uni.showToast({ },err=>{
title: error.message,
icon: "none",
});
})
}else{
this.showLogin = false;
uni.hideLoading(); uni.hideLoading();
this.goWebUrl() uni.showToast({
} title:err.message,
icon:'none'
})
})
}, },
radioChange(evt){ radioChange(evt){
this.current = evt.detail.value; this.current = evt.detail.value;
...@@ -107,7 +196,17 @@ export default { ...@@ -107,7 +196,17 @@ export default {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.hideLoading(); uni.hideLoading();
this.guestInfor = res.data; this.guestInfor = res.data;
this.list = res.data.guest if(res.data.guest&&res.data.guest.length>0){
if(res.data.guest.length==1){
this.current = res.data.guest[0].Id
this.msg.Id = res.data.guest[0].Id
this.msg.OrderId = res.data.guest[0].OrderId
}
this.list = res.data.guest
}else{
this.GuestByPhone()
}
}}, (error) => { }}, (error) => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
...@@ -116,6 +215,31 @@ export default { ...@@ -116,6 +215,31 @@ export default {
}); });
}) })
}, },
// 手机号获取旅客信息
GuestByPhone(){
this.apipost("post_GetOrderGuestByPhone",{
TCID: this.msg.TCID,
Phone: this.msg.Phone,
}, (res) => {
if (res.resultCode == 1) {
this.guestInfor = res.data;
if(res.data.guest&&res.data.guest.length>0){
if(res.data.guest.length==1){
this.current = res.data.guest[0].Id
this.msg.Id = res.data.guest[0].Id
this.msg.OrderId = res.data.guest[0].OrderId
}
this.list = res.data.guest
}
}
}, (error) => {
uni.hideLoading();
uni.showToast({
title: error.message,
icon: "none",
});
})
},
goWebUrl() { goWebUrl() {
let url = `https://activity.oytour.com/html/ImpressionOpinionSurvey/opinionSurvey.html?TCID=${this.msg.TCID}&GuestId=${this.msg.Id}&OrderId=${this.msg.OrderId}&Phone=${this.msg.Phone}` let url = `https://activity.oytour.com/html/ImpressionOpinionSurvey/opinionSurvey.html?TCID=${this.msg.TCID}&GuestId=${this.msg.Id}&OrderId=${this.msg.OrderId}&Phone=${this.msg.Phone}`
if (url && url.length > 0) { if (url && url.length > 0) {
...@@ -132,7 +256,7 @@ export default { ...@@ -132,7 +256,7 @@ export default {
.obtainInforBox{ .obtainInforBox{
background: -webkit-gradient(linear, 0 0, 0 100%, from(#B2E7F7 ), to(#9BCFF3 )); background: -webkit-gradient(linear, 0 0, 0 100%, from(#B2E7F7 ), to(#9BCFF3 ));
padding: 50rpx 41rpx; padding: 50rpx 41rpx;
min-height: 100vh; height: 100vh;
} }
.obtainInforTitle{ .obtainInforTitle{
font-family: 068-SSZhengYaTi; font-family: 068-SSZhengYaTi;
......
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