Commit b3faf297 authored by youjie's avatar youjie

外卖系统意见调查

parent cdcb1df3
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<h4 class="ganxiecydc"></h4> <h4 class="ganxiecydc"></h4>
<div class="FillincommentsIn"> <div class="FillincommentsIn">
<div class="FillincommentsInLD"> <div class="FillincommentsInLD">
<div><span>领队:</span><span class="lindui"></span></div> <div id="lindui"><span>领队:</span><span class="lindui"></span></div>
<div><span>导游:</span><span class="daoyou"></span></div> <div id="daoyou"><span>导游:</span><span class="daoyou"></span></div>
</div> </div>
<div class="FillincommentsInT"> <div class="FillincommentsInT">
<div><span>团期:</span><span class="tuanqi1"></span></div> <div><span>团期:</span><span class="tuanqi1"></span></div>
...@@ -44,10 +44,12 @@ ...@@ -44,10 +44,12 @@
<script src="../../js/layer/layer.js"></script> <script src="../../js/layer/layer.js"></script>
<script src="../../js/mian.js"></script> <script src="../../js/mian.js"></script>
<script> <script>
var qMsg = query() var qMsg = {}
var newMsg = {}
var priceInfo = null var priceInfo = null
var dataList = null var dataList = null
var GuestSurveyInfo = null var GuestSurveyInfo = null
var userInfo = getLocalStorage()
var texts = [ var texts = [
'非常不满意', '非常不满意',
...@@ -57,7 +59,23 @@ ...@@ -57,7 +59,23 @@
'非常满意' '非常满意'
] ]
var STAR_IMG = new Array("../../images/Star1.png", "../../images/Star2.png"); 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() getPriceInfo()
GetSurveyShowList() GetSurveyShowList()
...@@ -121,9 +139,15 @@ ...@@ -121,9 +139,15 @@
var postMsg = []; var postMsg = [];
if (dataList && dataList.length > 0) { if (dataList && dataList.length > 0) {
dataList.forEach(item => { dataList.forEach(item => {
item.GuestId = qMsg.GuestId; if(localStorage.TakeoutVersion==1){
item.TCID = qMsg.TCID; item.c = newMsg.c
item.OrderID = qMsg.OrderId; item.t = newMsg.t
item.g = newMsg.g
}else{
item.TCID = qMsg.TCID;
item.OrderID = qMsg.OrderId
}
item.GuestId = qMsg.GuestId
if (item.SurveyType === 2 || item.SurveyType === 3) { if (item.SurveyType === 2 || item.SurveyType === 3) {
item.SurveyOptionsList.forEach(y => { item.SurveyOptionsList.forEach(y => {
//单选 //单选
...@@ -142,6 +166,7 @@ ...@@ -142,6 +166,7 @@
}) })
item.ScoreNum = 0; item.ScoreNum = 0;
} }
postMsg.push(item); postMsg.push(item);
}) })
} }
...@@ -170,14 +195,16 @@ ...@@ -170,14 +195,16 @@
} }
function GetBusSurveyInfo() { function GetBusSurveyInfo() {
var msg = {
IsShow: 1,
SurveyType: -1,
...newMsg
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: `${getApiUrl().urlPost}`, url: `${getApiUrl().urlPost}`,
contentType: "application/json", contentType: "application/json",
data: getAjaxData("survey_post_GetGuestSurveyInfo", { data: getAjaxData("survey_post_GetGuestSurveyInfo", msg),
IsShow: 1,
SurveyType: -1
}),
async: false, async: false,
success: function(res) { success: function(res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
...@@ -200,14 +227,16 @@ ...@@ -200,14 +227,16 @@
} }
function GetSurveyShowList() { function GetSurveyShowList() {
var msg = {
IsShow: 1,
SurveyType: -1,
...newMsg
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: `${getApiUrl().urlPost}`, url: `${getApiUrl().urlPost}`,
contentType: "application/json", contentType: "application/json",
data: getAjaxData("survey_post_GetSurveyShowList", { data: getAjaxData("survey_post_GetSurveyShowList", msg),
IsShow: 1,
SurveyType: -1
}),
async: false, async: false,
success: function(res) { success: function(res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
...@@ -240,20 +269,24 @@ ...@@ -240,20 +269,24 @@
} }
function getPriceInfo() { function getPriceInfo() {
var msg = {
tcid: qMsg.TCID,
...newMsg
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: `${getApiUrl().urlPost}`, url: `${getApiUrl().urlPost}`,
contentType: "application/json", contentType: "application/json",
data: getAjaxData("miniProgram_post_GetBasePrice", { data: getAjaxData("miniProgram_post_GetBasePrice", msg),
tcid: this.qMsg.TCID
}),
async: false, async: false,
success: function(res) { success: function(res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
let data = res.data let data = res.data
priceInfo = data priceInfo = data
if (priceInfo && priceInfo.LeaderName && priceInfo.LeaderName != '') $('.lindui').html(priceInfo.LeaderName) if (priceInfo && priceInfo.LeaderName && priceInfo.LeaderName != '') $('.lindui').html(priceInfo.LeaderName)
else $('#lindui').hide()
if (priceInfo && priceInfo.GuideName && priceInfo.GuideName != '') $('.daoyou').html(priceInfo.GuideName) 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.StartDateStr && priceInfo.StartDateStr != '') $('.tuanqi1').html(priceInfo.StartDateStr)
if (priceInfo && priceInfo.EndDateStr && priceInfo.EndDateStr != '') $('.tuanqi2').html(priceInfo.EndDateStr) if (priceInfo && priceInfo.EndDateStr && priceInfo.EndDateStr != '') $('.tuanqi2').html(priceInfo.EndDateStr)
} else { } else {
...@@ -474,12 +507,12 @@ ...@@ -474,12 +507,12 @@
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
border-radius: 5px; border-radius: 5px;
background-color: #EE4554; background-color: #419efd;
color: #fff; color: #fff;
} }
.submitB.active { .submitB.active {
background-color: rgba(238, 69, 84, .5); background-color: rgba(65, 158, 253 .5);
} }
.pinfen img { .pinfen img {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="tipBox" id="tipBox"> <div class="tipBox" id="tipBox">
<div class="tipImgBox"> <div class="tipImgBox">
<div class="tipImg"> <div class="tipImg">
<img src="../../images/login/gou_big.png"/> <img src="../../images/login/gou_big_blue.png"/>
<h4>&nbsp;&nbsp;&nbsp;提交意见成功!</h4> <h4>&nbsp;&nbsp;&nbsp;提交意见成功!</h4>
</div> </div>
</div> </div>
......
...@@ -2,7 +2,9 @@ let locationName = window.location.hostname; ...@@ -2,7 +2,9 @@ let locationName = window.location.hostname;
function getApiUrl() { function getApiUrl() {
//ERP接口地址 //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接口地址 //ERP-Jave接口地址
let erpJavaApiUrl = "http://192.168.2.215:9000/"; let erpJavaApiUrl = "http://192.168.2.215:9000/";
let urlSignalrUrl = "http://192.168.2.65:7838/signalr"; let urlSignalrUrl = "http://192.168.2.65:7838/signalr";
...@@ -10,13 +12,15 @@ function getApiUrl() { ...@@ -10,13 +12,15 @@ function getApiUrl() {
let erpViittoFileUrl = "http://192.168.5.46:8130" let erpViittoFileUrl = "http://192.168.5.46:8130"
if (locationName.indexOf('oytour') !== -1) { if (locationName.indexOf('oytour') !== -1) {
erpApiUrl = "https://reborn.oytour.com/api/common/post"; erpApiUrl = "https://reborn.oytour.com/api/common/post";
erpApiUrlTakVer = "http://htapi.oytour.com/api/common/post";//外卖版本
erpJavaApiUrl = "https://efficient.oytour.com/" erpJavaApiUrl = "https://efficient.oytour.com/"
urlSignalrUrl = "http://hpye.oytour.com/signalr"; urlSignalrUrl = "http://hpye.oytour.com/signalr";
erpUploadUrl = "http://upload.oytour.com"; erpUploadUrl = "http://upload.oytour.com";
erpViittoFileUrl = "http://imgfile.oytour.com" erpViittoFileUrl = "http://imgfile.oytour.com"
} }
let url = { let url = {
urlPost: erpApiUrl, urlPost: localStorage.TakeoutVersion==0?erpApiUrl:erpApiUrlTakVer,
urlJava: erpJavaApiUrl, urlJava: erpJavaApiUrl,
urlSignalr: urlSignalrUrl, urlSignalr: urlSignalrUrl,
UploadUrl: erpUploadUrl, UploadUrl: erpUploadUrl,
...@@ -140,16 +144,49 @@ function getJavaA(msg, tk) { ...@@ -140,16 +144,49 @@ function getJavaA(msg, tk) {
function query(url) { function query(url) {
url = location.href url = location.href
let str = url.substr(url.indexOf('?') + 1) let str = url.substr(url.indexOf('?') + 1)
const arr = str.split('&') let arr = str.split('&')
let json = {} let json = {}
for (let i = 0; i < arr.length; i++) { json = parseUrlParams(url)
let item = arr[i].split('=') // for (let i = 0; i < arr.length; i++) {
json[item[0]] = item[1] // let item = arr[i].split('=')
} // json[item[0]] = item[1]
// }
return json 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) { function random_string(len) {
len = len || 32; len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
...@@ -190,4 +227,4 @@ function UploadSelfFile(path, files, successCall, ocr) { ...@@ -190,4 +227,4 @@ function UploadSelfFile(path, files, successCall, ocr) {
}); });
} }
} }
} }
\ No newline at end of file
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