重新修改背景音乐的功能实现,原来的功能不起作用

This commit is contained in:
2025-12-23 14:33:40 +08:00
parent 63c79e1235
commit 53cb2e9239
9 changed files with 125 additions and 27 deletions

View File

@@ -172,6 +172,7 @@ namespace WebSite.Controllers
return Json(new { IsSuccess = true, Message = HttpContext.InnerLanguage("SaveSuccess") });
}
/// <summary>
/// 上传BGM
/// </summary>
@@ -215,6 +216,7 @@ namespace WebSite.Controllers
}
sysHotel.WelcomeBGM = NewFileName;
SysHotelManager.Update(sysHotel);
return Json(new { IsSuccess = true, FileName = NewFileName }, JsonRequestBehavior.AllowGet);
}
@@ -232,6 +234,22 @@ namespace WebSite.Controllers
[Authorize()]
public ActionResult DeleteBGM()
{
try
{
var sysHotel = SysHotelManager.Get(CurrentHotelID);
sysHotel.WelcomeBGM = "";
SysHotelManager.Update(sysHotel);
return Json(new { IsSuccess = true }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(new { IsSuccess = false, Message = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 保存第三方对接信息
/// </summary>
@@ -282,6 +300,12 @@ namespace WebSite.Controllers
//sysHotel.TCLAppSecret = entity.TCLAppSecret;
SysHotelManager.Update(sysHotel);
if (!string.IsNullOrEmpty(entity.WelcomeBGM))
{
string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + entity.WelcomeBGM;
TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText",
Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = CurrentHotelID, MusicUrl = ffg, WelcomeText = entity.WelcomeSpeech }), CurrentHotelCode, "");//通知天猫精灵播放欢迎词
}
if (sysHotel.IsUseQianLiMa)
{
QianLiMa_PMS.QiYong(sysHotel.Code, "add");

View File

@@ -712,7 +712,29 @@ function dockingInfo() {
.dialog({ title: lang.DockingInformation, width: 600, height: 380 })
.dialog("open");
}
function deletemusic()
{
$.ajax({
url: '/SysHotel/DeleteBGM/',
type: 'Post',
//contentType: 'application/x-www-form-urlencoded',
contentType: 'application/json',
//data: JSON.stringify(getdata),
data: {},
success: function(response) {
$("#welcomebgmid").val("");
},
error: function(xhr, status, error) {
console.log(error);
},
beforeSend: function(xhr) {
console.log('Sending request...');
},
complete: function(xhr, status) {
console.log('Request completed.');
}
});
}
function uploadmusic()
{
var filename = $("#welcomebgm").val();
@@ -725,8 +747,10 @@ function uploadmusic()
secureuri: false,
fileElementId: "welcomebgm",
dataType: "json",
success: function (data) {
success: function (response) {
console.log(response);
var fname= response.FileName;
$("#welcomebgmid").val(fname);
},
error: function (data, status, e) {
$("#msg").html(e);

View File

@@ -80,8 +80,9 @@
</th>
<td colspan="3">
<input id="welcomebgmid" name="welcomebgm" value="<%: Model.WelcomeBGM %>" readonly="readonly"/>
<input type="file" id="welcomebgm" name="file" size="30" />
<input type="file" id="welcomebgm" name="file" size="30" /></br>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="uploadmusic();">Save</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="deletemusic();">Remove</a>
</td>
</tr>
<tr>