Commit b3faf297 authored by youjie's avatar youjie

外卖系统意见调查

parent cdcb1df3
......@@ -23,8 +23,8 @@
<h4 class="ganxiecydc"></h4>
<div class="FillincommentsIn">
<div class="FillincommentsInLD">
<div><span>领队:</span><span class="lindui"></span></div>
<div><span>导游:</span><span class="daoyou"></span></div>
<div id="lindui"><span>领队:</span><span class="lindui"></span></div>
<div id="daoyou"><span>导游:</span><span class="daoyou"></span></div>
</div>
<div class="FillincommentsInT">
<div><span>团期:</span><span class="tuanqi1"></span></div>
......@@ -44,10 +44,12 @@
<script src="../../js/layer/layer.js"></script>
<script src="../../js/mian.js"></script>
<script>
var qMsg = query()
var qMsg = {}
var newMsg = {}
var priceInfo = null
var dataList = null
var GuestSurveyInfo = null
var userInfo = getLocalStorage()
var texts = [
'非常不满意',
......@@ -57,7 +59,23 @@
'非常满意'
]
var STAR_IMG = new Array("../../images/Star1.png", "../../images/Star2.png");
$('.ganxiecydc').html('感谢' + decodeURIComponent(qMsg.SurName) + (qMsg.Sex == 1 ? "先生" : "女士") + '参与意见调查')
if(localStorage.TakeoutVersion==1){
qMsg = {
GuestId: userInfo.GuestId,
SurName: userInfo.SurName,
Sex: userInfo.Sex,
guestMobile: userInfo.guestMobile,
}
newMsg = {
c: userInfo.c,
t: userInfo.t,
g: userInfo.g,
}
}else{
qMsg = query()
}
$('.ganxiecydc').html('感谢' + decodeURIComponent(qMsg.SurName) + `${qMsg.Sex == 1?'先生':qMsg.Sex == 2?'女士':'先生/女士'}参与意见调查`)
getPriceInfo()
GetSurveyShowList()
......@@ -121,9 +139,15 @@
var postMsg = [];
if (dataList && dataList.length > 0) {
dataList.forEach(item => {
item.GuestId = qMsg.GuestId;
if(localStorage.TakeoutVersion==1){
item.c = newMsg.c
item.t = newMsg.t
item.g = newMsg.g
}else{
item.TCID = qMsg.TCID;
item.OrderID = qMsg.OrderId;
item.OrderID = qMsg.OrderId
}
item.GuestId = qMsg.GuestId
if (item.SurveyType === 2 || item.SurveyType === 3) {
item.SurveyOptionsList.forEach(y => {
//单选
......@@ -142,6 +166,7 @@
})
item.ScoreNum = 0;
}
postMsg.push(item);
})
}
......@@ -170,14 +195,16 @@
}
function GetBusSurveyInfo() {
var msg = {
IsShow: 1,
SurveyType: -1,
...newMsg
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlPost}`,
contentType: "application/json",
data: getAjaxData("survey_post_GetGuestSurveyInfo", {
IsShow: 1,
SurveyType: -1
}),
data: getAjaxData("survey_post_GetGuestSurveyInfo", msg),
async: false,
success: function(res) {
if (res.resultCode === 1) {
......@@ -200,14 +227,16 @@
}
function GetSurveyShowList() {
var msg = {
IsShow: 1,
SurveyType: -1,
...newMsg
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlPost}`,
contentType: "application/json",
data: getAjaxData("survey_post_GetSurveyShowList", {
IsShow: 1,
SurveyType: -1
}),
data: getAjaxData("survey_post_GetSurveyShowList", msg),
async: false,
success: function(res) {
if (res.resultCode === 1) {
......@@ -240,20 +269,24 @@
}
function getPriceInfo() {
var msg = {
tcid: qMsg.TCID,
...newMsg
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlPost}`,
contentType: "application/json",
data: getAjaxData("miniProgram_post_GetBasePrice", {
tcid: this.qMsg.TCID
}),
data: getAjaxData("miniProgram_post_GetBasePrice", msg),
async: false,
success: function(res) {
if (res.resultCode === 1) {
let data = res.data
priceInfo = data
if (priceInfo && priceInfo.LeaderName && priceInfo.LeaderName != '') $('.lindui').html(priceInfo.LeaderName)
else $('#lindui').hide()
if (priceInfo && priceInfo.GuideName && priceInfo.GuideName != '') $('.daoyou').html(priceInfo.GuideName)
else $('#daoyou').hide()
if (priceInfo && priceInfo.StartDateStr && priceInfo.StartDateStr != '') $('.tuanqi1').html(priceInfo.StartDateStr)
if (priceInfo && priceInfo.EndDateStr && priceInfo.EndDateStr != '') $('.tuanqi2').html(priceInfo.EndDateStr)
} else {
......@@ -474,12 +507,12 @@
margin-top: 20px;
margin-bottom: 20px;
border-radius: 5px;
background-color: #EE4554;
background-color: #419efd;
color: #fff;
}
.submitB.active {
background-color: rgba(238, 69, 84, .5);
background-color: rgba(65, 158, 253 .5);
}
.pinfen img {
......
......@@ -14,10 +14,11 @@
<title>验证</title>
</head>
<body>
<div class="login_contentBox">
<div class="login_content" id="login_content">
<div class="login_button" id="login_button">
<button onclick="changeLoginType(1)">手机号验证</button>
<button onclick="changeLoginType(2)">护照号验证</button>
<button id="buttonSJ" onclick="changeLoginType(1)">手机号验证</button>
<button id="buttonHZ" onclick="changeLoginType(2)">护照号验证</button>
</div>
</div>
<div class="Passport_phone" id="login_phone">
......@@ -25,9 +26,6 @@
<h3>身份确认</h3>
<input type="phone" class="form-control" id="loginFormT" autocomplete="new-password" placeholder="请输入手机号码" onblur="activeFun(1)">
<button onclick="guestLogin()" class="PassportB" id="loginB">确认</button>
<div class="loginBackBox">
<img class="BackImg" onclick="goBack()" src="../../images/login/login_arrowleft.png" />
</div>
</div>
</div>
<div class="Passport_phone" id="Passport_phone">
......@@ -35,12 +33,9 @@
<h3>身份确认</h3>
<input type="phone" class="form-control" id="PassportFormT" autocomplete="new-password" placeholder="请输入护照号" onblur="activeFun(2)">
<button onclick="guestLogin()" class="PassportB" id="PassportB">确认</button>
<div class="loginBackBox">
<img class="BackImg" onclick="goBack()" src="../../images/login/login_arrowleft.png" />
</div>
</div>
</div>
<script src="../../js/md5.js"></script>
<script type="text/javascript" src="../../js/autosize.js"></script>
<script type="text/javascript" src="../../js/jquery-1.10.2.js"></script>
......@@ -50,13 +45,43 @@
var phoneReg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/
var IsNumEn = /^[a-zA-Z0-9]+$/
var msg = {
type: 0, //1-手机号码验证登录,2-护照号码验证登录
type: 1, //1-手机号码验证登录,2-护照号码验证登录
//E75385750 13970261014
guestMobile: "", //1-为手机号码,2-护照号码
TCID: query().TCID
TCID: ""
}
var userInfo = {}
var oldUserInfo = getLocalStorage()
if(query().c&&query().t&&query().g){
localStorage.TakeoutVersion = 1
msg.c = query().c
msg.t = query().t
msg.g = query().g
if(oldUserInfo.c==msg.c&&oldUserInfo.t==msg.t&&oldUserInfo.g==msg.g){
setTimeout(() => {
if(localStorage.TakeoutVersion==1)
window.location.href = `guestSign.html`
}, 300);
}else{
userInfo = {
...getLocalStorage(),
c: msg.c,
t: msg.t,
g: msg.g,
}
localStorage.userInfo = JSON.stringify(userInfo)
}
}else{
localStorage.TakeoutVersion = 0
msg.TCID = query().TCID
if(userInfo&&userInfo.guestMobile) localStorage.removeItem("userInfo")
}
$('#login_content').show()
$('#login_phone').hide()
$('#login_phone').show()
document.getElementById("buttonSJ").classList.add("active")
$('#Passport_phone').hide()
function goBack() {
......@@ -66,9 +91,18 @@
}
function changeLoginType(type) {
$('#login_content').hide()
if (type == 1) $('#login_phone').show()
if (type == 2) $('#Passport_phone').show()
if (type == 1) {
$('#login_phone').show()
$('#Passport_phone').hide()
document.getElementById("buttonSJ").classList.add("active")
document.getElementById("buttonHZ").classList.remove("active")
}
if (type == 2) {
$('#Passport_phone').show()
$('#login_phone').hide()
document.getElementById("buttonHZ").classList.add("active")
document.getElementById("buttonSJ").classList.remove("active")
}
msg.type = type
}
......@@ -77,25 +111,28 @@
let phone = $(`#loginFormT`).val()
let obj = $(`#loginB`)
//电话验证
if (!phoneReg.test(phone)) {
obj.attr('disabled', true);
return layer.msg('请输入有效的手机号码!');
if(localStorage.TakeoutVersion==1){
if(phone.length==0) return layer.msg('请输入手机号码!');
}else {
if(!phoneReg.test(phone)) return layer.msg('请输入有效的手机号码!');
}
msg.guestMobile = phone
}
if (msg.type == 2) {
let Passport = $(`#PassportFormT`).val()
// let objPassport = $(`#PassportB`)
// //电话验证
let objPassport = $(`#PassportB`)
//护照验证
if(localStorage.TakeoutVersion==1){
if (Passport.length==0) {
return layer.msg('请输入护照号!');
}
}else{
// if (!IsNumEn.test(Passport)) {
// objPassport.attr('disabled', true);
// return layer.msg('请输入有效的护照号!');
// } else {
// objPassport.attr('disabled', false);
// }
}
msg.guestMobile = Passport
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlPost}`,
......@@ -106,6 +143,19 @@
if (res.resultCode === 1) {
var tempData = res.data
if (tempData && tempData.length > 0) {
if(localStorage.TakeoutVersion==1){
var datas = {
GuestId: tempData[0].Id,
SurName: tempData[0].SurName ? tempData[0].SurName : tempData[0].Name,
Sex: tempData[0].Sex,
c: query().c,
t: query().t,
g: query().g,
guestMobile: msg.guestMobile,
}
localStorage.userInfo = JSON.stringify(datas)
window.location.href = `guestSign.html`
}else{
var datas = {
TCID: msg.TCID,
GuestId: tempData[0].Id,
......@@ -113,12 +163,17 @@
Sex: tempData[0].Sex,
OrderId: tempData[0].OrderId,
}
//记录订单id GuestId
if (msg.type == 1) window.location.href = 'MobileVerification.html?TCID=' + datas.TCID + '&GuestId=' + datas
.GuestId + '&SurName=' + datas.SurName + '&Sex=' + datas.Sex + '&OrderId=' + datas.OrderId + '&phone=' +
msg.guestMobile
if (msg.type == 2) window.location.href = 'guestSign.html?TCID=' + datas.TCID + '&GuestId=' + datas.GuestId +
'&SurName=' + datas.SurName + '&Sex=' + datas.Sex + '&OrderId=' + datas.OrderId + '&phone=' + msg.guestMobile
}
}else{
layer.msg("此账号已完成意见调查,请勿重复提交!")
}
} else {
layer.msg(res.message)
}
......@@ -130,47 +185,51 @@
}
function activeFun(type) {
msg.type = type
if (type == 1) {
let phone = $(`#loginFormT`).val()
let obj = $(`#loginB`)
//电话验证
if (!phoneReg.test(phone)) {
obj.attr('disabled', true);
return layer.msg('请输入有效的手机号码!');
} else {
obj.attr('disabled', false);
if (localStorage.TakeoutVersion==1) {
if(phone.length==0) return layer.msg('请输入手机号码!');
}else{
if(!phoneReg.test(phone)) return layer.msg('请输入有效的手机号码!');
}
msg.guestMobile = phone
}
if (type == 2) {
// let Passport = $(`#PassportFormT`).val()
// let objPassport = $(`#PassportB`)
// //电话验证
let Passport = $(`#PassportFormT`).val()
let objPassport = $(`#PassportB`)
//护照验证
if(localStorage.TakeoutVersion==1){
if(Passport.length==0) return layer.msg('请输入护照号!');
}else{
// if (!IsNumEn.test(Passport)) {
// objPassport.attr('disabled', true);
// return layer.msg('请输入有效的护照号!');
// } else {
// objPassport.attr('disabled', false);
// layer.msg('请输入有效的护照号!');
// }
}
msg.guestMobile = Passport
}
}
</script>
</body>
<style>
.login_content {
height: 100%;
.login_contentBox{
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.login_content {
}
.login_button {
width: 100%;
display: flex;
flex-direction: column;
flex-direction: row;
align-items: center;
padding: 0 10%;
padding: 50px 5% 30px 5%;
}
.login_button button {
......@@ -178,17 +237,21 @@
height: 40px;
margin-bottom: 20px;
border: 0;
background-color: #419EFD;
color: #fff;
border-radius: 5px;
}
.login_button button:last-child {
background-color: #67C239;
/* background-color: #67C239; */
/* background-color: rgba(65, 158, 253,.5); */
margin-left: 20px;
}
.login_button button.active{
color: #fff;
background-color: #419EFD;
box-shadow: 0 0 3px 0px #419EFD;
}
.login_phone {
padding: 0 10%;
padding: 0 5%;
height: 100%;
display: flex;
flex-direction: column;
......@@ -251,15 +314,17 @@
}
.Passport_phone {
height: 100%;
overflow: hidden;
padding: 0 10%;
margin: 0 5%;
padding: 30px 5%;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 3px 0px #ddd;
}
.PassportForm {
margin-top: 50px;
display: flex;
flex-direction: column;
padding-bottom: 10px;
}
.PassportForm input {
......@@ -276,9 +341,14 @@
height: 40px;
margin-top: 20px;
border-radius: 5px;
background-color: #EE4554;
background-color: #419EFD;
color: #fff;
}
.form-control{
height: 38px;
-webkit-box-shadow: inherit;
box-shadow: inherit
}
</style>
</html>
......@@ -17,7 +17,7 @@
<div class="tipBox" id="tipBox">
<div class="tipImgBox">
<div class="tipImg">
<img src="../../images/login/gou_big.png"/>
<img src="../../images/login/gou_big_blue.png"/>
<h4>&nbsp;&nbsp;&nbsp;提交意见成功!</h4>
</div>
</div>
......
......@@ -2,7 +2,9 @@ let locationName = window.location.hostname;
function getApiUrl() {
//ERP接口地址
let erpApiUrl = "http://192.168.5.46/api/common/post";
let erpApiUrl = "http://192.168.5.204:8030/api/common/post";
let erpApiUrlTakVer = "http://192.168.5.204:8065/api/common/post";//外卖版本
//ERP-Jave接口地址
let erpJavaApiUrl = "http://192.168.2.215:9000/";
let urlSignalrUrl = "http://192.168.2.65:7838/signalr";
......@@ -10,13 +12,15 @@ function getApiUrl() {
let erpViittoFileUrl = "http://192.168.5.46:8130"
if (locationName.indexOf('oytour') !== -1) {
erpApiUrl = "https://reborn.oytour.com/api/common/post";
erpApiUrlTakVer = "http://htapi.oytour.com/api/common/post";//外卖版本
erpJavaApiUrl = "https://efficient.oytour.com/"
urlSignalrUrl = "http://hpye.oytour.com/signalr";
erpUploadUrl = "http://upload.oytour.com";
erpViittoFileUrl = "http://imgfile.oytour.com"
}
let url = {
urlPost: erpApiUrl,
urlPost: localStorage.TakeoutVersion==0?erpApiUrl:erpApiUrlTakVer,
urlJava: erpJavaApiUrl,
urlSignalr: urlSignalrUrl,
UploadUrl: erpUploadUrl,
......@@ -140,16 +144,49 @@ function getJavaA(msg, tk) {
function query(url) {
url = location.href
let str = url.substr(url.indexOf('?') + 1)
const arr = str.split('&')
let arr = str.split('&')
let json = {}
for (let i = 0; i < arr.length; i++) {
let item = arr[i].split('=')
json[item[0]] = item[1]
}
json = parseUrlParams(url)
// for (let i = 0; i < arr.length; i++) {
// let item = arr[i].split('=')
// json[item[0]] = item[1]
// }
return json
}
function parseUrlParams(url) {
const params = {};
// 提取查询字符串(问号后的部分)
const queryString = url.split('?')[1] || '';
// 分割键值对(按 & 分割)
const keyValuePairs = queryString.split('&');
for (const pair of keyValuePairs) {
if (!pair) continue; // 跳过空字符串(如 ?&a=b 的情况)
// 分割键和值(按第一个 = 分割,处理值中含 = 的情况)
const eqIndex = pair.indexOf('=');
const key = eqIndex === -1 ? pair : pair.slice(0, eqIndex);
const value = eqIndex === -1 ? '' : pair.slice(eqIndex + 1);
// 解码 URL 编码(处理 %20、中文等)
const decodedKey = key //decodeURIComponent(key.replace(/\+/g, ' ')); // 替换 + 为空格(兼容表单提交)
const decodedValue = value //decodeURIComponent(value.replace(/\+/g, ' '));
// 处理重复键(可选:若键已存在,转为数组存储)
if (params.hasOwnProperty(decodedKey)) {
if (!Array.isArray(params[decodedKey])) {
params[decodedKey] = [params[decodedKey]]; // 初始转为数组
}
params[decodedKey].push(decodedValue);
} else {
params[decodedKey] = decodedValue;
}
}
return params;
}
function random_string(len) {
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
......
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