Commit 60032ee2 authored by youjie's avatar youjie

no message

parent 8f08c668
......@@ -26,7 +26,7 @@
<template v-if="guestInfor.code==0&&guestInfor.IsEnd==0">
去填写
</template>
<template v-if="(guestInfor.code==0||guestInfor.code==1)&&guestInfor.IsEnd==1">
<template v-else>
查看
</template>
<button v-if="guestInfor.code==0&&guestInfor.IsEnd==0"
......@@ -59,7 +59,7 @@ export default {
}
},
onLoad(option) {
// let scene = "tcid=23430"
// let scene = "tcid=25137"
// console.log(encodeURIComponent(scene),'------')
let t = decodeURIComponent(option.scene).split('&')
t.forEach(x => {
......@@ -155,7 +155,8 @@ export default {
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){
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();
}}, (error) => {
......@@ -178,9 +179,12 @@ export default {
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){
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) => {
uni.hideLoading();
uni.showToast({
......@@ -191,6 +195,7 @@ export default {
},
// 手机号授权
async getPhoneNumber(e) {
console.log(e,'-----e')
let that = this
if(e.detail.errMsg&&e.detail.errMsg=="getPhoneNumber:ok"&&e.detail.code) {
// 用户点击了允许授权
......@@ -205,8 +210,9 @@ export default {
}, (res) => {
if (res.resultCode == 1) {
that.msg.Phone = res.data.phoneNumber;
if(that.guestInfor.guest.length==0)that.GuestByPhone()
else that.setRegister()
if(that.guestInfor.guest&&that.guestInfor.guest.length==0)that.GuestByPhone()
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) => {
uni.hideLoading();
uni.showToast({
......@@ -238,7 +244,14 @@ export default {
if (res.resultCode == 1) {
this.showLogin = false;
uni.hideLoading();
this.goWebUrl()
if(this.guestInfor.guest&&
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1){
this.goWebUrl()
}else{
this.goUrl()
}
}}, (error) => {
uni.hideLoading();
uni.showToast({
......@@ -256,6 +269,13 @@ export default {
})
return
}
if(this.msg.Id==0||this.msg.OrderId==0){
uni.showToast({
title: '请选择任意人员',
icon: 'none'
})
return
}
let obj = this.obj
var that = this;
that.showLogin = false;
......@@ -292,15 +312,7 @@ export default {
(res) => {
that.showLogin = true; //防止多次点击登录
if (res.resultCode == 1) {
this.showDialog = false;
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.setStorageSync("mall_UserInfo", res.data);
uni.removeStorageSync("pid");
uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("Up");
......@@ -333,10 +345,7 @@ export default {
Moblie: this.msg.Phone,
}
this.apipost("HePingGuoLvLogin_post", parameters, r =>{
if(this.guestInfor.guest&&
this.guestInfor.guest.length>0&&
this.guestInfor.guest.length==1&&
this.guestInfor.code==0&&
if(this.guestInfor.code==0&&
this.guestInfor.IsEnd==0){
this.setPhone()
}else{
......@@ -355,8 +364,9 @@ export default {
},
goUrl() {
let msg = JSON.stringify(this.msg)
let obj = JSON.stringify(this.obj)
uni.navigateTo({
url: `/pages/customerAction/obtainInfor?msg=${encodeURIComponent(msg)}`,
url: `/pages/customerAction/obtainInfor?msg=${encodeURIComponent(msg)}&obj=${encodeURIComponent(obj)}`,
});
},
goWebUrl() {
......
......@@ -2,7 +2,7 @@
<view class="obtainInforBox column">
<view class="obtainInforTitle">请选以下任意代表填写意见</view>
<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">
<radio-group @change="radioChange">
<label class="obtainInforLab row" v-for="(item, index) in guestInfor.guest" :key="index">
......@@ -14,7 +14,7 @@
</radio-group>
</scroll-view>
<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>
......@@ -31,6 +31,7 @@ export default {
Id: 0,
OrderId: 0,
},
obj: null,
list:[
{
name:'我是业主',
......@@ -52,38 +53,126 @@ export default {
},
onLoad(option) {
this.msg = JSON.parse(decodeURIComponent(option.msg))
this.obj = JSON.parse(decodeURIComponent(option.obj))
this.QueryUsers()
},
methods: {
// 更新手机号
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.msg.TCID==''||this.msg.HPSLOpenId==''||
this.msg.Unoinid==''||this.msg.Phone==''||this.msg.Id==''){
return uni.showToast({
title: '信息不完善,请稍后再试',
if(this.msg.Id==0||this.msg.OrderId==0){
uni.showToast({
title: '请选择任意人员',
icon: 'none'
})
return
}
this.showLogin = true;
this.apipost("post_UpdateOrderGuest",this.msg,res => {
if (res.resultCode == 1) {
let obj = this.obj
var that = this;
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;
uni.hideLoading();
this.goWebUrl()
}}, (error) => {
uni.hideLoading();
uni.showToast({
title: error.message,
icon: "none",
});
})
}else{
this.showLogin = false;
}
},err=>{
uni.hideLoading();
this.goWebUrl()
}
uni.showToast({
title:err.message,
icon:'none'
})
})
},
radioChange(evt){
this.current = evt.detail.value;
......@@ -107,7 +196,17 @@ export default {
if (res.resultCode == 1) {
uni.hideLoading();
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) => {
uni.hideLoading();
uni.showToast({
......@@ -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() {
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) {
......@@ -132,7 +256,7 @@ export default {
.obtainInforBox{
background: -webkit-gradient(linear, 0 0, 0 100%, from(#B2E7F7 ), to(#9BCFF3 ));
padding: 50rpx 41rpx;
min-height: 100vh;
height: 100vh;
}
.obtainInforTitle{
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