English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

ASP.NET MVC5+EF6+EasyUIバックエンド管理システム 微信公众账号開発のメッセージ管理

前言 

前節を振り返り、メッセージのリクエストと応答について詳しく理解しました。この節では、データベースの表を作成しますが、表の設計は非常に複雑です 

あなた自身が分析した状況構造に基づいて表を作成することもできます 

この表を利用するためには、表の結果に非常に精通する必要があります。この表の状況は非常に多岐にわたります 

思维导图 

私はこのようなモデルを分析し、表現するために思维导图を使うのが好きです

 

表構造 

思维导图に基づいて、構築できる表は以下の通りです3チャート表:メッセージ表、ルール表、タイプ表
メッセージ表:実際のメッセージ
ルール表:テキスト、画像文、音声など
タイプ表:テキスト、画像文、音声(デフォルトの応答、サブスクリプション応答)
也可以是两张表:规制表,消息表(+一个类型字段) 

我这里只设计一张表:消息表(+一个规则字段+一个类型字段) 

设计表结构与个人的平时习惯有关系,我还是喜欢简单的东西,别为了设计而去专门设计,这样只会增加系统的复杂度 

CREATE TABLE [dbo].[WC_MessageResponse](
 [Id] [varchar](50) NOT NULL,  --主キー 
 [OfficalAccountId] [varchar](50) NULL, --所属公众号
 [MessageRule] [int] NULL,   --消息规则(枚举)
 [Category] [int] NULL,   --类型(枚举)
 [MatchKey] [varchar](1000) NULL,  --关键字
 [TextContent] [varchar](max) NULL, --文本内容
 [ImgTextContext] [varchar](max) NULL, --图文文本内容
 [ImgTextUrl] [varchar](1000) NULL, --图文图片URL
 [ImgTextLink] [varchar](1000) NULL, --图文图片超链接
 [MeidaUrl] [varchar](1000) NULL,  --语音URL
 [MeidaLink] [varchar](1000) NULL,  --语音超链接
 [Enable] [bit] NOT NULL,   --有効かどうか
 [IsDefault] [bit] NOT NULL,  --是否默认
 [Remark] [varchar](2000) NULL,  --説明
 [Sort] [int] NOT NULL,   --排序
 [CreateTime] [datetime] NOT NULL,  --作成時間
 [CreateBy] [varchar](50) NOT NULL, --作成者
 [ModifyTime] [datetime] NOT NULL,  --更新時間
 [ModifyBy] [varchar](50) NULL,  --更新者
 CONSTRAINT [PK_WC_MessageResponse] PRIMARY KEY CLUSTERED 
(
 [Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[WC_MessageResponse] WITH CHECK ADD CONSTRAINT [FK_WC_MessageResponse_WC_OfficalAcconts] FOREIGN KEY([OfficalAccountId])
REFERENCES [dbo].[WC_OfficalAccounts] ([Id])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[WC_MessageResponse] CHECK CONSTRAINT [FK_WC_MessageResponse_WC_OfficalAcconts]
GO

表对应了两个枚举和关联主表公众号管理的主表 

CREATE TABLE [dbo].[WC_OfficalAccounts](
 [Id] [varchar](50) NOT NULL,  --主キー
 [OfficalId] [varchar](200) NULL, --公式アカウントのユニークID
 [OfficalName] [varchar](200) NOT NULL, --公式アカウントの名前
 [OfficalCode] [varchar](200) NOT NULL, --公式アカウントのアカウント
 [OfficalPhoto] [varchar](1000) NULL, --アイコン
 [OfficalKey] [varchar](500) NULL, --EncodingAESKey
 [ApiUrl] [varchar](1000) NULL,  --私たちのリソースサーバー
 [Token] [varchar](200) NULL,  --トークン
 [AppId] [varchar](200) NULL,  --AppId
 [AppSecret] [varchar](200) NULL, --Appsecret
 [AccessToken] [varchar](200) NULL, --アクセストークン
 [Remark] [varchar](2000) NULL,  --説明
 [Enable] [bit] NOT NULL,  --有効かどうか
 [IsDefault] [bit] NOT NULL,  --現在のデフォルト操作アカウントかどうか
 [Category] [int] NOT NULL,  --カテゴリ(メディアアカウント、企業アカウント、個人アカウント、開発テストアカウント)
 [CreateTime] [datetime] NOT NULL, --作成時間
 [CreateBy] [varchar](50) NOT NULL, --作成者
 [ModifyTime] [datetime] NOT NULL, --更新時間
 [ModifyBy] [varchar](50) NULL,  --更新者
 CONSTRAINT [PK_WC_OfficalAcconts] PRIMARY KEY CLUSTERED 
(
 [Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

対応するエnum 

 public enum WeChatReplyCategory
 {
 //テキスト
 Text =1,
 //图文
 Image =2,
 //音声
 Voice =3,
 //等しい、キーワードに応じて返信するために使用
 Equal=4,
 //含む、キーワードに応じて返信するために使用
 Contain = 5
 }
 public enum WeChatRequestRuleEnum
 {
 /// <summary>
 /// デフォルト返信、処理されていないもの
 /// </summary>
 Default =0,
 /// <summary>
 /// フォロワーレスプン
 /// </summary>
 Subscriber =1,
 /// <summary>
 /// テキスト返信
 /// </summary>
 Text =2,
 /// <summary>
 /// 画像返信
 /// </summary>
 Image =3,
 /// <summary>
 /// 音声返信
 /// </summary>
 Voice =4,
 /// <summary>
 /// 動画返信
 /// </summary>
 Video =5,
 /// <summary>
 /// 超リンク返信
 /// </summary>
 Link =6,
 /// <summary>
 /// LBS位置返信
 /// </summary>
 Location =7,
 }

エンümは、私たちが省略した残りの2つのテーブルに対応しています
 ここまで来て、テーブルの設計が非常に明確であると信じられています 

バックエンドコード 

増删改查非常普通,主要关注点在前端,前端処理提出のメッセージに、ルール、タイプを含めて、メッセージの最終表現を指定する必要があります

Controller

[HttpPost]
 [SupportFilter(ActionName = "Edit")]
 public JsonResult PostData(WC_MessageResponseModel model)
 {
  WC_OfficalAccountsModel accountModel = account_BLL.GetCurrentAccount();
  if (string.IsNullOrEmpty(model.Id))
  {
  model.Id = ResultHelper.NewId;
  }
  model.CreateBy = GetUserId();
  model.CreateTime = ResultHelper.NowTime;
  model.ModifyBy = GetUserId();
  model.ModifyTime = ResultHelper.NowTime;
  model.OfficalAccountId = accountModel.Id;
  model.Enable = true;
  model.IsDefault = true;
  if (m_BLL.PostData(ref errors, model))
  {
  LogHandler.WriteServiceLog(GetUserId(), "Id" + model.Id + ",OfficalAccountId" + model.OfficalAccountId, "成功", "保存", "WC_MessageResponse");
  return Json(JsonHandler.CreateMessage(1, Resource.SaveSucceed));
  }
  else
  {
  string ErrorCol = errors.Error;
  LogHandler.WriteServiceLog(GetUserId(), "Id" + model.Id + ",OfficalAccountId" + model.OfficalAccountId + "," + ErrorCol, "失敗", "保存", "WC_MessageResponse");
  return Json(JsonHandler.CreateMessage(0, Resource.SaveFail + ErrorCol));
  }
 }

BLL

public bool PostData(ref ValidationErrors errors, WC_MessageResponseModel model)
 {
  try
  {
  WC_MessageResponse entity = new WC_MessageResponse();
  if (IsExists(model.Id))
  {
   entity = m_Rep.GetById(model.Id);
  }
  entity.Id = model.Id;
  entity.OfficalAccountId = model.OfficalAccountId;
  entity.MessageRule = model.MessageRule;
  entity.Category = model.Category;
  entity.MatchKey = model.MatchKey;
  entity.TextContent = model.TextContent;
  entity.ImgTextContext = model.ImgTextContext;
  entity.ImgTextUrl = model.ImgTextUrl;
  entity.ImgTextLink = model.ImgTextLink;
  entity.MeidaUrl = model.MeidaUrl;
  entity.Enable = model.Enable;
  entity.IsDefault = model.IsDefault;
  entity.Remark = model.Remark;
  entity.CreateTime = model.CreateTime;
  entity.CreateBy = model.CreateBy;
  entity.Sort = model.Sort;
  entity.ModifyTime = model.ModifyTime;
  entity.ModifyBy = model.ModifyBy;
  if (m_Rep.PostData(entity))
  {
   return true;
  }
  else
  {
   errors.Add(Resource.NoDataChange);
   return false;
  }
  }
  catch (Exception ex)
  {
  errors.Add(ex.Message);
  ExceptionHander.WriteException(ex);
  return false;
  }
 }

DAL

public bool PostData(WC_MessageResponse model)
 {
  //すべてのスイッチがオフの場合、返信が無効化されていることを示しています
  if (model.Category == null)
  {
  return true;
  }
  //すべてをデフォルト外に設定します
  ExecuteSqlCommand(string.Format("update [dbo].[WC_MessageResponse] set IsDefault=0 where OfficalAccountId ='{0}' and MessageRule={1}
  //デフォルトの返信とサブスクライバ返信があり、それらは画像以外で別々に処理されません。なぜなら、それらには3この種のパターンがありますが、その中でデフォルトのものが1つだけです
  if (model.Category != (int)WeChatReplyCategory.Image && (model.MessageRule == (int)WeChatRequestRuleEnum.Default || model.MessageRule == (int)WeChatRequestRuleEnum.Subscriber))
  {
  //データベースにデータが存在するか確認してください
  var entity = Context.WC_MessageResponse.Where(p => p.OfficalAccountId == model.OfficalAccountId && p.MessageRule == model.MessageRule && p.Category == model.Category).FirstOrDefault();
  if (entity != null)}
  {
   //元のものを削除
   Context.WC_MessageResponse.Remove(entity);
  }
  }
  //すべてをデフォルトに設定
  ExecuteSqlCommand(string.Format("update [dbo].[WC_MessageResponse] set IsDefault=1 where OfficalAccountId ='{0}' and MessageRule={1}2}
  //修正
  if(IsExist(model.Id))
  {
  Context.Entry<WC_MessageResponse>(model).State = EntityState.Modified;
  return Edit(model);
  }
  else { 
  return Create(model);
  }
 }

DALレイヤーについて説明する必要があります 

デフォルトのリプライとフォローアップリプライには3種類:テキスト、图文、ボイス(ただし、1種類のみ可能ですので、IsDefaultフィールドを使用してどのリプライを実行するかを示します)したがって、これらのルールは別々に処理する必要があります。DALのコードの実行SQL文を見れば明らかです。 

したがって、フロントエンドを存分にデザインしましょう!

 

フロントエンドはどうデザインするか? 

私たちがマインドマップを見てみましょう: 

  

フロントエンドの完全なコード 

<style>
 .formtable td {
 vertical-align: top;
 padding: 10px;
 }
 .formtable th {
 text-align: left;
 padding: 10px;
 px; line 30px;
 }
 .formtablenormal {
  500px;
 }
 .formtablenormal th {
  border: 0px;
  text-align: right;
 }
 .formtablenormal td {
  border: 0px;
  vertical-align: middle;
 }
</style>
<script>
 //1テキスト2图文3音声
 var Category = {
 テキスト: 1,
 画像: 2,
 ボイス: 3,
 等しい: 4,
 含まれる: 5
 };
 //
 var RequestRule = {
 デフォルト:0、
 サブスクリバー: 1,
 テキスト: 2,
 画像: 3,
 ボイス: 4,
 ビデオ: 5,
 リンク: 6,
 位置: 7
 };
 function initDefault() {
 $('#swText0').switchbutton({
  onChange: function(checked) {
  if (checked) {
   $('#swImage0').switchbutton("uncheck");
   $('#swVoice0').switchbutton("uncheck");
   $("#div01").show();
   $("#div02,#div03").hide();
   $("#Category").val(Category.Text);
  }
  }
 });
 $('#swImage0').switchbutton({
  onChange: function(checked) {
  if (checked) {
   $('#swVoice0').switchbutton("uncheck");
   $('#swText0').switchbutton("uncheck");
   $("#div02").show();
   $("#div01,#div03").hide();
   $("#Category").val(Category.Image);
   $("#List0").datagrid("resize");
  }
  }
 });
 $('#swVoice0').switchbutton({
  onChange: function(checked) {
  if (checked) {
   $('#swImage0').switchbutton("uncheck");
   $('#swText0').switchbutton("uncheck");
   $("#div03").show();
   $("#div01,#div02").hide();
   $("#Category").val(Category.Voice);
  }
  }
 });
 //テキスト
 $.post('@Url.Action("GetList")', {
  page: 1,
  rows: 1,
  category: Category.Text,
  messageRule: RequestRule.Default
 },
 function(data) {
  var rows = data.rows;
  for (var i = 0; i < rows.length; i++){
  if (rows[i].Category == Category.Text) {
   $("#Text0").val(rows[i].TextContent);
   if (rows[i].IsDefault) {
   $('#swText0').switchbutton("check");
   $('#swImage0').switchbutton("uncheck");
   $('#swVoice0').switchbutton("uncheck");
   }
  }
  }
 });
 //音声
 $.post('@Url.Action("GetList")', {
  page: 1,
  rows: 1,
  category: Category.Voice,
  messageRule: RequestRule.Default
 },
 function (data) {
  var rows = data.rows;
  for (var i = 0; i < rows.length; i++){
  if (rows[i].Category == Category.Voice) {
   $("#VoiceTitle0").val(rows[i].TextContent);
   $("#VoiceContent0").val(rows[i].Remark);
   $("#VoiceUrl0").val(rows[i].MeidaUrl);
   if (rows[i].IsDefault) {
   $('#swVoice0').switchbutton("check");
   $('#swText0').switchbutton("uncheck");
   $('#swImage0').switchbutton("uncheck");
   }
  }
  }
 });
 $('#List0').datagrid({
  url: '@Url.Action("GetList")?messageRule=' + RequestRule.Default + '&category=' + Category.Image,
  width:SetGridWidthSub(40),
  methord: 'post',
  height:SetGridHeightSub(175),
  fitColumns: true,
  sortName: 'Sort',
  sortOrder: 'asc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  onLoadSuccess: function (data) {
  if (data.rows.length > 0)
  {
   if (data.rows[0].IsDefault) {
   $('#swImage0').switchbutton("check");
   $('#swText0').switchbutton("uncheck");
   $('#swVoice0').switchbutton("uncheck");
   $("#Category").val(Category.Image);
   }
  }
  },
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'TextContent',
  title: '标题',
   80,
  sortable: true
  },
  {
  field: 'ImgTextUrl',
  title: '画像',
   50,
  sortable: true,
  align: 'center', formatter: function (value) { return "<img width='80' height='80' src='" + value + ""/">" }
  },
  {
  field: 'ImgTextLink',
  title: '超链接',
   80,
  sortable: true
  },
  {
  field: 'ImgTextContext',
  title: '回复内容',
   180,
  sortable: true
  },
  ]]
 });
 $("#btnCreate02").unbind().click(function () {
  $("#modalwindow0").window({
  title: '@Resource.Create',
   700,
  px; line 500,
  iconCls: 'fa fa-plus
  }).window('open');
 });
 $("#btnSava01").unbind().click(function() {
  //デフォルトの返信
  $("#MessageRule").val(RequestRule.Default);
  if ($.trim($("#Text0").val())=="")
  {
  $.messager.alert('@Resource.Tip', '内容を入力する必要があります!', 'warning');
  return;
  }
  $("#TextContent").val($.trim($("#Text0").val()));
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
   data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 $("#btnSava02").unbind().click(function () {
  if ($.trim($("#ImageTitle0").val()) == "") {
  $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
  return;
  }
  if ($.trim($("#ImageUrl0").val()) == "") {
  「$.messager.alert」('@Resource.Tip', '画像はアップロードする必要があります!', 'warning');
  return;
  }
  if ($.trim($("#Sort0").val()) == "") {
  $.messager.alert('@Resource.Tip', '並び順を入力する必要があります!', 'warning');
  return;
  }
  //图文回复
  $("#MessageRule").val(RequestRule.Default);
  "$TextContent".val($("#ImageTitle0").val());
  "$ImgTextUrl".val($("#ImageUrl0").val());
  $("#ImgTextContext").val($("#ImageContent0").val());
  $("#ImgTextLink").val($("#ImageLink0").val());
  $("#Sort").val($("#Sort0").val());
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   if(data.type == 1){
   $("#Id")。val("");
   $("#List0").datagrid('reload');
   $("#modalwindow0").window('close');
   $("#ImageTitle0").val("");
   $("#form02 img)。attr("src","/Content/Images/NotPic.jpg);
   $("#ImageContent0").val("");
   $("#ImageLink0").val("");
   $("#Sort0").val(0);
   $('#FileUpload02").val('');
   }
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 $("#btnSava03").unbind().click(function() {
  //デフォルトの返信
  $("#MessageRule").val(RequestRule.Default);
  if ($.trim($("#Text0").val())=="")
  {
  if ($.trim($("#VoiceTitle0").val()) == "") {
   $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
   return;
  }
  if ($.trim($("#VoiceUrl0").val()) == "") {
   $.messager.alert('@Resource.Tip', '必须上传语音!', 'warning');
   return;
  }
  $("#TextContent").val($("#VoiceTitle0").val());
  $("#MeidaUrl").val($("#VoiceUrl0").val());
  $("#Remark").val($("#VoiceContent0").val());
  }
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 }
 function initSubscriber() {
  $('#swText1').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $('#swImage1').switchbutton("uncheck");
   $('#swVoice1').switchbutton("uncheck");
   $("#div11").show();
   $("#div12,#div13").hide();
   $("#Category").val(Category.Text);
  }
  }
 });
 $('#swImage1').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $('#swVoice1').switchbutton("uncheck");
   $('#swText1').switchbutton("uncheck");
   $("#div12").show();
   $("#div11,#div13").hide();
   $("#Category").val(Category.Image);
   $("#List")1").datagrid("resize");
  }
  }
 });
 $('#swVoice1').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $('#swImage1').switchbutton("uncheck");
   $('#swText1').switchbutton("uncheck");
   $("#div13").show();
   $("#div11,#div12").hide();
   $("#Category").val(Category.Voice);
  }
  }
 });
 //テキスト
 $.post('@Url.Action("GetList")', {
  page: 1,
  rows: 1,
  category: Category.Text,
  messageRule: RequestRule.Subscriber
 },
 function(data) {
  var rows = data.rows;
  for (var i = 0; i < rows.length; i++){
  if (rows[i].Category == Category.Text) {
   $("#Text1").val(rows[i].TextContent);
   if (rows[i].IsDefault) {
   $('#swText1').switchbutton("check");
   $('#swImage1').switchbutton("uncheck");
   $('#swVoice1').switchbutton("uncheck");
   }
  }
  }
 });
 //音声
 $.post('@Url.Action("GetList")', {
  page: 1,
  rows: 1,
  category: Category.Voice,
  messageRule: RequestRule.Subscriber
 },
 function (data) {
  var rows = data.rows;
  for (var i = 0; i < rows.length; i++){
  if (rows[i].Category == Category.Voice) {
   $("#VoiceTitle")1").val(rows[i].TextContent);
   $("#VoiceContent")1").val(rows[i].Remark);
   if (rows[i].IsDefault) {
   $('#swVoice1').switchbutton("check");
   $('#swText1').switchbutton("uncheck");
   $('#swImage1').switchbutton("uncheck");
   }
  }
  }
 });
 $('#List')1').datagrid({
  url: '@Url.Action("GetList")?messageRule=' + RequestRule.Subscriber + '&category=' + Category.Image,
  width:SetGridWidthSub(40),
  methord: 'post',
  height:SetGridHeightSub(175),
  fitColumns: true,
  sortName: 'Sort',
  sortOrder: 'asc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  onLoadSuccess: function (data) {
  if (data.rows.length > 0)
  {
   if (data.rows[0].IsDefault) {
   $('#swImage1').switchbutton("check");
   $('#swText1').switchbutton("uncheck");
   $('#swVoice1').switchbutton("uncheck");
   }
  }
  },
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'TextContent',
  title: '标题',
   80,
  sortable: true
  },
  {
  field: 'ImgTextUrl',
  title: '画像',
   50,
  sortable: true,
  align: 'center', formatter: function (value) { return "<img width='80' height='80' src='" + value + ""/">" }
  },
  {
  field: 'ImgTextLink',
  title: '超链接',
   80,
  sortable: true
  },
  {
  field: 'ImgTextContext',
  title: '回复内容',
   180,
  sortable: true
  },
  ]]
 });
 $("#btnCreate");12").unbind().click(function () {
  $("#modalwindow")1").window({
  title: '@Resource.Create',
   700,
  px; line 500,
  iconCls: 'fa fa-plus
  }).window('open');
 });
 $("#btnSava");11").unbind().click(function() {
  //デフォルトの返信
  $("#MessageRule").val(RequestRule.Subscriber);
  if ($.trim($("#Text1").val())==""
  {
  $.messager.alert('@Resource.Tip', '内容を入力する必要があります!', 'warning');
  return;
  }
  $("#TextContent").val($.trim($("#Text1);
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
   data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 $("#btnSava");12").unbind().click(function () {
  if (「$.trim」(「#ImageTitle」1").val()) == "" {
  $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
  return;
  }
  if (「$.trim」(「#ImageUrl」1").val()) == "" {
  「$.messager.alert」('@Resource.Tip', '画像はアップロードする必要があります!', 'warning');
  return;
  }
  if ($.trim($("#Sort1").val()) == "" {
  $.messager.alert('@Resource.Tip', '並び順を入力する必要があります!', 'warning');
  return;
  }
  //图文回复
  $("#MessageRule").val(RequestRule.Subscriber);
  「#TextContent」.val(「#ImageTitle」)1").val());
  「#ImgTextUrl」.val(「#ImageUrl」)1").val());
  「#ImgTextContext」.val(「#ImageContent」)1").val());
  「#ImgTextLink」.val(「#ImageLink」)1").val());
  「#Sort」.val(「#Sort」)1").val());
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   if(data.type == 1){
   $("#Id")。val("");
   $("#List")1)。datagrid('reload');
   $("#modalwindow")1)。window('close');
   「#ImageTitle」1)。val("");
   $("#form")12 img)。attr("src","/Content/Images/NotPic.jpg);
   $("#ImageContent1)。val("");
   $("#ImageLink1)。val("");
   $("#Sort1").val(0);
   $('#FileUpload12").val('');
   }
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 $("#btnSava");13").unbind().click(function() {
  //デフォルトの返信
  $("#MessageRule").val(RequestRule.Subscriber);
  if ($.trim($("#Text1").val())==""
  {
  if ($.trim($("#VoiceTitle");1").val()) == "" {
   $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
   return;
  }
  if ($.trim($("#VoiceUrl");1").val()) == "" {
   $.messager.alert('@Resource.Tip', '必须上传语音!', 'warning');
   return;
  }
  $("#TextContent").val($("#VoiceTitle");1").val());
  $("#MeidaUrl").val($("#VoiceUrl");1").val());
  $("#Remark").val($("#VoiceContent");1").val());
  }
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 }
 function initText() {
 $("#Category").val(Category.Equal);
 $('#List')2').datagrid({
  url: '@Url.Action("GetList")?messageRule=' + RequestRule.Text,
  width:SetGridWidthSub(40),
  methord: 'post',
  height:SetGridHeightSub(100),
  fitColumns: true,
  sortName: 'CreateTime',
  sortOrder: 'desc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'Category',
  title: 'Category',
   80,
  sortable: true,
  hidden: true
  },
  {
  field: 'MatchKey',
  title: '关键字',
   80,
  sortable: true,
  formatter: function (value,row,index){
   if (row.Category == Category.Equal) {
   return "(完全匹配)" + value
   } else {
   return "(模糊匹配)" + value
   }
  }
  },
  {
  field: 'TextContent',
  title: '回复内容',
   80,
  sortable: true
  },
  ]]
 });
 $('#swMessageRule2').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $("#Category").val(Category.Equal);
  } else {
   $("#Category").val(Category.Contain);
  }
  }
 });
 $("#btnCreate");2").unbind().click(function () {
  $("#modalwindow")2").window({
  title: '@Resource.Create',
   700,
  px; line 400,
  iconCls: 'fa fa-plus
  }).window('open');
 });
 $("#btnSava");2").unbind().click(function () {
  if ($.trim($("#TextMatchKey");2").val()) == "" {
  $.messager.alert('@Resource.Tip', '关键字必须填写!', 'warning');
  return;
  }
  if ($.trim($("#Text2").val()) == "" {
  $.messager.alert('@Resource.Tip', '内容を入力する必要があります!', 'warning');
  return;
  }
  //テキスト返信
  $("#MessageRule").val(RequestRule.Text);
  「#MatchKey」.val(「$.trim」(「#TextMatchKey」)2);
  $("#TextContent").val($("#Text2").val());
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   if(data.type == 1){
   $("#Id")。val("");
   $("#List")2)。datagrid('reload');
   $("#modalwindow")2)。window('close');
   $("#TextMatchKey")2)。val("");
   $("#Text2)。val("");
   }
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 }
 function initImage() {
 $("#Category").val(Category.Equal);
 $('#List')31').datagrid({
  url: '@Url.Action("GetListProperty")'63;messageRule=' + 「RequestRule.Image」,
   300,
  methord: 'post',
  height:SetGridHeightSub(100),
  fitColumns: true,
  sortName: 'CreateTime',
  sortOrder: 'desc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  onClickRow: function (index,data) {
  var row = $('#List31}).datagrid('getSelected');
  if (row != null)
  {
   $('#List')3}).datagrid({url:'@Url.Action("GetList")?messageRule='+「RequestRule.Image」+'&category='+row.Category+'&matchKey='+row.MatchKey});
  }
  },
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'Category',
  title: 'Category',
   80,
  sortable: true,
  hidden: true
  },
  {
  field: 'MatchKey',
  title: '关键字',
   130,
  sortable: true,
  formatter: function (value, row, index) {
   if (row.Category == Category.Equal) {
   return "(完全匹配)" + value
   } else {
   return "(模糊匹配)" + value
   }
  }
  },
  {
  field: 'CreateTime',
  title: '作成時間',
   80,
  sortable: true
  },
  ]]
 }).datagrid('getPager').pagination({ showPageList: true, showRefresh: false, displayMsg: '' });
 $('#List')3').datagrid({
  url:'@Url.Action("GetList")?messageRule='+「RequestRule.Image」+'&category=x&matchKey=x',
  width:SetGridWidthSub(340),
  methord: 'post',
  height:SetGridHeightSub(100),
  fitColumns: true,
  sortName: 'Sort',
  sortOrder: 'asc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'Category',
  title: 'Category',
   80,
  sortable: true,
  hidden: true
  },
  {
  field: 'TextContent',
  title: '标题',
   80,
  sortable: true
  },
  {
  field: 'MatchKey',
  title: '关键字',
   80,
  sortable: true,
  formatter: function (value,row,index){
   if (row.Category == Category.Equal) {
   return "(完全匹配)" + value
   } else {
   return "(模糊匹配)" + value
   }
  }
  },
  {
  field: 'ImgTextUrl',
  title: '画像',
   50,
  sortable: true,
  align: 'center', formatter: function (value) { return "<img width='80' height='80' src='" + value + ""/">" }
  },
  {
  field: 'ImgTextLink',
  title: '超链接',
   80,
  sortable: true
  },
  {
  field: 'ImgTextContext',
  title: '回复内容',
   180,
  sortable: true
  },
  {
  field: 'Sort',
  title: '並び順',
   50,
  sortable: true
  },
  ]]
 });
 $('#swMessageRule3').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $("#Category").val(Category.Equal);
  } else {
   $("#Category").val(Category.Contain);
  }
  }
 });
 $("#btnCreate");3").unbind().click(function () {
  $("#modalwindow")3").window({
  title: '@Resource.Create',
   700,
  px; line 550,
  iconCls: 'fa fa-plus
  }).window('open');
 });
 $("#btnSava");3").unbind().click(function () {
  if (「$.trim」(「#ImageTitle」3").val()) == "" {
  $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
  return;
  }
  if ($.trim($("#TextMatchKey");3").val()) == "" {
  $.messager.alert('@Resource.Tip', '关键字必须填写!', 'warning');
  return;
  }
  if (「$.trim」(「#ImageUrl」3").val()) == "" {
  「$.messager.alert」('@Resource.Tip', '画像はアップロードする必要があります!', 'warning');
  return;
  }
  //图文回复
  「#MessageRule」.val(「RequestRule.Image」)
  「#MatchKey」.val(「$.trim」(「#TextMatchKey」)3);
  「#TextContent」.val(「#ImageTitle」)3").val());
  「#ImgTextUrl」.val(「#ImageUrl」)3").val());
  「#ImgTextContext」.val(「#ImageContent」)3").val());
  「#ImgTextLink」.val(「#ImageLink」)3").val());
  「#Sort」.val(「#Sort」)3").val());
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   if(data.type == 1){
   $("#Id")。val("");
   $("#List")3)。datagrid('reload');
   $("#List")31)。datagrid('reload');
   $("#modalwindow")3)。window('close');
   「#ImageTitle」3)。val("");
   $("#form")3 img)。attr("src","/Content/Images/NotPic.jpg);
   $("#ImageContent3)。val("");
   $("#ImageLink3)。val("");
   $("#Sort3").val(0);
   $('#FileUpload3").val('');
   $("#TextMatchKey")3").val('');
   }
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 }
 function initVoice() {
 $("#Category").val(Category.Equal);
 $('#List')4').datagrid({
  url: '@Url.Action("GetList")?messageRule=' + RequestRule.Voice,
  width:SetGridWidthSub(40),
  methord: 'post',
  height:SetGridHeightSub(100),
  fitColumns: true,
  sortName: 'CreateTime',
  sortOrder: 'desc',
  idField: 'Id',
  pageSize: 15,
  pageList: [15, 20, 30, 40, 50],
  pagination: true,
  striped: true,
  //奇偶行是否区分
  singleSelect: true,
  //单选模式
  //rownumbers: true,//行号
  columns: [[{
  field: 'Id',
  title: 'Id',
   80,
  hidden: true
  },
  {
  field: 'Category',
  title: 'Category',
   80,
  sortable: true,
  hidden: true
  },
  {
  field: 'TextContent',
  title: '标题',
   80,
  sortable: true
  },
  {
  field: 'MatchKey',
  title: '关键字',
   80,
  sortable: true,
  formatter: function (value,row,index){
   if (row.Category == Category.Equal) {
   return "(完全匹配)" + value
   } else {
   return "(模糊匹配)" + value
   }
  }
  },
  {
  field: 'MeidaUrl',
  title: '语音',
   80,
  sortable: true,
  align: 'center', formatter: function (value) { return "<img width='80' height='80' src='" + value + ""/">" }
  },
  {
  field: 'ImgTextLink',
  title: '超链接',
   80,
  sortable: true
  },
  {
  field: 'ImgTextContext',
  title: '回复内容',
   80,
  sortable: true
  },
  ]]
 });
 $('#swMessageRule4').switchbutton({}}
  onChange: function(checked) {
  if (checked) {
   $("#Category").val(Category.Equal);
  } else {
   $("#Category").val(Category.Contain);
  }
  }
 });
 $("#btnCreate");4").unbind().click(function() {
  $("#modalwindow")4").window({
  title: '@Resource.Create',
   700,
  px; line 500,
  iconCls: 'fa fa-plus
  }).window('open');
 });
 $("#btnSava");4").unbind().click(function () {
  if ($.trim($("#VoiceTitle");4").val()) == "" {
  $.messager.alert('@Resource.Tip', '标题必须填写!', 'warning');
  return;
  }
  if ($.trim($("#TextMatchKey");4").val()) == "" {
  $.messager.alert('@Resource.Tip', '关键字必须填写!', 'warning');
  return;
  }
  if ($.trim($("#VoiceUrl");4").val()) == "" {
  $.messager.alert('@Resource.Tip', '必须上传语音!', 'warning');
  return;
  }
  //图文回复
  $("#MessageRule").val(RequestRule.Voice);
  $("#MatchKey").val($("#TextMatchKey");4").val());
  $("#TextContent").val($("#VoiceTitle");4").val());
  $("#MeidaUrl").val($("#VoiceUrl");4").val());
  $("#Remark").val($("#VoiceContent");4").val());
  if ($("#form").valid()) {
  $.ajax({
   url: "@Url.Action("PostData")",
   type: "Post",
  data: $("#form").serialize(),
  dataType: "json",
  success: function(data) {
   if(data.type == 1){
   $("#Id")。val("");
   $("#List")4)。datagrid('reload');
   $("#modalwindow")4)。window('close');
   $("#TextMatchKey")4)。val("");
   $("#VoiceTitle")4)。val("");
   $("#VoiceUrl")4)。val("");
   $("#VoiceContent")4)。val("");
   $("#FileUpload")4)。val("");
   $("#form")3 img)。attr("src","/Content/Images/NotPic.jpg);
   }
   $。messageBox5s('@Resource.Tip',data.message);
  }
  });
 }
 });
 }
 $(function(){
 $('#tt').tabs({
  justified:true,
  width:'100%,
  height:$(window).height() - 20
 });
 $('#tt').tabs({
  onSelect:function(title,index){
  switch(index){
   case RequestRule.Default:
   initDefault();
   break;
   case RequestRule.Subscriber:
   initSubscriber();
   break;
   case RequestRule.Text:
   initText();
   break;
   case RequestRule.Image:
   initImage();
   break;
   case RequestRule.Voice:
   initVoice();
   break;
  }
  }
 });
 //初期化第一个タブ
 initDefault();
 //自動幅高
 $(window).resize(function(){
  $('#tt').tabs({
  height:$(window).height() - 20
  });
  //$('#List')2).datagrid('resize',{
  // width:SetGridWidthSub(40),
  // height:SetGridHeightSub(100)
  //});
 });
 });
 $(function(){
 $('input.textbox').validatebox().bind('blur',function(){
  $(this).validatebox('enableValidation').validatebox('validate');
 });
 )
</script>
<form id="form" method="post">
 <input type="hidden" id="Id" name="Id" />
 <input type="hidden" id="MessageRule" name="MessageRule" />
 <input type="hidden" id="Category" name="Category" />
 <input type="hidden" id="MatchKey" name="MatchKey" />
 <input type="hidden" id="TextContent" name="TextContent" />
 <input type="hidden" id="ImgTextContext" name="ImgTextContext" />
 <input type="hidden" id="ImgTextUrl" name="ImgTextUrl" />
 <input type="hidden" id="ImgTextLink" name="ImgTextLink" />
 <input type="hidden" id="MeidaUrl" name="MeidaUrl" />
 <input type="hidden" id="MeidaLink" name="MeidaLink" />
 <input type="hidden" id="Remark" name="Remark" />
 <input type="hidden" id="Sort" name="Sort" value="0" />
 <input type="hidden" id="CreateTime" name="CreateTime" />
 <input type="hidden" id="CreateBy" name="CreateBy" />
 <input type="hidden" id="ModifyTime" name="ModifyTime" />
 <input type="hidden" id="ModifyBy" name="ModifyBy" />
</フォーム>
options="required:true"10<div style="padding:
 <div id="tt" class="easyui-tabs">
  <div title="[#1#]">}} 
  #]" >45<table class="formtable" style="height:-px; line45height:10px; width:-0%; border1bottom:7px solid #e
   <tr>
   <td><10<table class="formtablenormal" style="margin:
    テキスト: @Html.SwitchButtonByEdit("swText0", false)
   </td>
   <td><10<table class="formtablenormal" style="margin:
    画像: @Html.SwitchButtonByEdit("swImage0", false)
   </td>
   <td><10<table class="formtablenormal" style="margin:
    音声: @Html.SwitchButtonByEdit("swVoice0", false)
   </td>
   ", false)/td>
   <td><3<td style="width:
    00px;">-<div class="color/green">現在の操作アカウント:<span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</div>
   </td>
   </tr>
  </table>
  <div id="div0"1<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava0"1", "fa fa-" class="displaynone">
   </div>
   <textarea id="Text0" style="width: 3span>< 3300px;height:20px;"></textarea>
   </div>
  <div id="div0"2<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnCreate0"2", "fa fa-search", "返信を追加", ref perm, "Edit", false)
   </div>
   <div id="modalwindow0" class="easyui"-window" style="width:600px; height:550px;" data-options="modal:true,closed: true,minimizable:false,shadow:false">
   <div class="mvctool bgb">
    @Html.ToolButton("btnSava0"2", "fa fa-search", "保存して提出", ref perm, "Edit", false)
   </div>
   <テーブル class="formtablenormal">
    <tr><th>タイトル: </th><td><input type="text" id="ImageTitle0" class="textbox" data-" class="textbox" data /></td></tr>
    <tr>
    <th>画像: </th>
    <td>
     <form id="form0"2" method="post">
     <input type="hidden" name="ImageUrl0" id="ImageUrl0" />
     <img class="expic" src="/Content/Images/NotPic.jpg" />
     <br />
     <a href="javascript:$('#FileUpload02').トリガー('クリック');" class="files">@Resource.Browse</a>
     <input type="file" id="FileUpload0"2"class="displaynone" name="FileUpload0"2"onchange="Upload('SingleFile', 'ImageUrl0', 'FileUpload0"2', '1', '1', '#form0"2');" />
     <span class="uploading">@Resource.Uploading</span>
     </フォーム>
    </tr>
    <tr><th>内容: </th><td><textarea id="ImageContent0" style="width: 300px; height: 100px;"></textarea></td></tr>
    <tr><th>リンク: </th><td><input type="text" id="ImageLink0" /></td></tr>
    <tr><th>並び順: </th><td><input type="number" id="Sort0" value="0" /></td></tr>
   </table>
   </div>
   options="required:true"10<div style="padding:
   <table id="List0"></table>
   </div> 
  </div>
  <div id="div0"3<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava0"3", "fa fa-" class="displaynone">
   </div>
    plus", "保存提交", ref perm, "Edit", false)2<table class="formtablenormal" style="margin:
     <tr><th>タイトル: </th><td><input type="text" id="VoiceTitle0" /></td></tr>
     <tr><th>音声: </th><td>
        <form id="form0"3" method="post">
        <input type="text" name="VoiceUrl0" class="left" id="VoiceUrl0" />
        <a href="javascript:$('#FileUpload03').トリガー('クリック');" class="files">@Resource.Browse</a>
        " class="left" id="VoiceUrl0"/mpeg" id="FileUpload0"3"class="displaynone" name="FileUpload0"3"onchange="Upload('SingleFile', 'VoiceUrl0', 'FileUpload0'3', '', '', '#form03');" />
        <span class="uploading">@Resource.Uploading</span>
        </フォーム>
     </td></tr>
     <tr><th>説明: </', '', '', '#form0}}335px; height:300px;"></textarea></td></tr>
    </table>
   </div> 
  </div>
  <div title="[#2th><td><textarea id="VoiceContent0" style="width:
  #]" >45<table class="formtable" style="height:-px; line45height:10px; width:-0%; border1bottom:7px solid #e
   <tr>
   <td><10<table class="formtablenormal" style="margin:
    eaec">1音声: @Html.SwitchButtonByEdit("swVoice
   </td>
   <td><10<table class="formtablenormal" style="margin:
    テキスト: @Html.SwitchButtonByEdit("swText1音声: @Html.SwitchButtonByEdit("swVoice
   </td>
   <td><10<table class="formtablenormal" style="margin:
    画像: @Html.SwitchButtonByEdit("swImage1音声: @Html.SwitchButtonByEdit("swVoice
   </td>
   ", false)/td>
   <td><3<td style="width:
    00px;">-<div class="color/green">現在の操作アカウント:<span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</div>
   </td>
   </tr>
  </table>
  px;">11<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava11", "fa fa-" class="displaynone">
   </div>
   <textarea id="Text1"スタイル="幅: 3span>< 3300px;height:20px;"></textarea>
  </div>
  px;">12<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnCreate12", "fa fa-search", "返信を追加", ref perm, "Edit", false)
   @Html.ToolButton("btnEdit12", "fa fa-search", "編集", ref perm, "Edit", true)
   @Html.ToolButton("btnDelete12", "fa fa-search", "削除", ref perm, "Delete", false)
   </div>
   <div id="modalwindow1" class="easyui-window" style="width:600px; height:550px;" data-options="modal:true,closed: true,minimizable:false,shadow:false">
   <div class="mvctool bgb">
    @Html.ToolButton("btnSava12", "fa fa-search", "保存して提出", ref perm, "Edit", false)
   </div>
   <テーブル class="formtablenormal">
    <tr><th>タイトル: </th><td><input type="text" id="ImageTitle10px; margin:-" class="textbox" data /></td></tr>
    <tr>
    <th>画像: </th>
    <td>
     <フォーム id="フォーム12" method="post">
     <input type="hidden" name="ImageUrl1" id="ImageUrl1" />
     <img class="expic" src="/Content/Images/NotPic.jpg" />
     <br />
     <a href="javascript:$('#FileUpload12').トリガー('クリック');" class="files">@Resource.Browse</a>
     <input type="file" id="FileUpload12" class="displaynone" name="FileUpload12" onchange="Upload('SingleFile', 'ImageUrl1', 'FileUpload12', '1', '1', '#form12');" />
     <span class="uploading">@Resource.Uploading</span>
     </フォーム>
    </tr>
    <tr><th>内容: </th><td><textarea id="ImageContent1"スタイル="幅: 300px; height: 100px;"></textarea></td></tr>
    <tr><th>リンク: </th><td><input type="text" id="ImageLink1" /></td></tr>
    <tr><th>並び順: </th><td><input type="number" id="Sort1" value="0" /></td></tr>
   </table>
   </div>
   options="required:true"10<div style="padding:
   <table id="List1></table>
   </div>
  </div>
  px;">13<div id="div
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava13", "fa fa-" class="displaynone">
   </div>
   plus", "保存提交", ref perm, "Edit", false)2<table class="formtablenormal" style="margin:
   <tr><th>タイトル: </th><td><input type="text" id="VoiceTitle1" /></td></tr>
   <tr>
    <th>音声: </th>
    <td>
    <フォーム id="フォーム13" method="post">
     0px;">1<input type="text" name="VoiceUrl />
     <a href="javascript:$('#FileUpload13').トリガー('クリック');" class="files">@Resource.Browse</a>
     " class="left" id="VoiceUrl0"/<input type="file" accept="audio13" class="displaynone" name="FileUpload13" onchange="Upload('SingleFile', 'VoiceUrl1', 'FileUpload13', '', '', '#フォーム13');" />
     <span class="uploading">@Resource.Uploading</span>
    </フォーム>
    </td>
   </tr>
   <tr><th>説明: </th><td><テキストエリア id="VoiceContent1"スタイル="幅:335px; height:300px;"></textarea></td></tr>
   </table>
  </div> 
  </div>
  <div title="[#3#]" style="padding:10px">
  <div class="mvctool ">
   @Html.ToolButton("btnCreate2", "fa fa-search", "追加返信", ref perm, "Edit", true)
   @Html.ToolButton("btnEdit2", "fa fa-search", "編集", ref perm, "Edit", true)
   @Html.ToolButton("btnDelete2", "fa fa-search", "削除", ref perm, "Delete", false)
   <div class="rightdiv color-green">
   現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
  </div>
  <div id="modalwindow2"
   class="easyui-window
   style="width:600px; height:500px;" data-options="modal:true,closed: true,minimizable:false,shadow:false">
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava2", "fa fa-search", "保存して提出", ref perm, "Edit", false)
   <div class="rightdiv color-green">
    現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
   </div>
   <テーブル class="formtablenormal">
   <tr>
    <th>キーワード: </th>
    <td>
    <input type="text" id="TextMatchKey2" />
    </td>
   </tr>
   <tr>
    <th>ルール: </th>
    <td>
    @Html.SwitchButtonByEdit("swMessageRule2", true, "ぼやけた一致(キーワードが内容に含まれる場合)", "完全一致(内容とキーワードが完全に一致する場合)", "280")
    </td>
   </tr>
   <tr>
    <th>内容: </th>
    <td>
    <textarea id="Text2"スタイル="幅: 280px;height:200px"></textarea>
    </td>
   </tr>
   </table>
  </div>
  <table id="List2></table>
  </div>
  <div title="[#4#]" style="padding:10px">
  <div class="mvctool">
   @Html.ToolButton("btnCreate3", "fa fa-search", "追加返信", ref perm, "Edit", true)
   @Html.ToolButton("btnEdit3", "fa fa-search", "編集", ref perm, "Edit", true)
   @Html.ToolButton("btnDelete3", "fa fa-search", "削除", ref perm, "Delete", false)
   <div class="rightdiv color-green">
   現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
  </div>
  <div id="modalwindow3" class="easyui-window" style="width:600px; height:550px;" data-options="modal:true,closed: true,minimizable:false,shadow:false">
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava3", "fa fa-search", "保存して提出", ref perm, "Edit", false)
   <div class="rightdiv color-green">
    現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
   </div>
   <テーブル class="formtablenormal">
   <tr><th>タイトル: </th><td><input type="text" id="ImageTitle3" /></td></tr>
   <tr>
    <th>キーワード: </th>
    <td>
    <input type="text" id="TextMatchKey3" />
    </td>
   </tr>
   <tr>
    <th>ルール: </th>
    <td>
    @Html.SwitchButtonByEdit("swMessageRule3", true, "ぼやけた一致(キーワードが内容に含まれる場合)", "完全一致(内容とキーワードが完全に一致する場合)", "280")
    </td>
   </tr>
   <tr>
    <th>画像: </th>
    <td>
    <フォーム id="フォーム3" method="post">
     <input type="hidden" name="ImageUrl3" id="ImageUrl3" />
     <img class="expic" src="/Content/Images/NotPic.jpg" />
     <br />
     <a href="javascript:$('#FileUpload3').トリガー('クリック');" class="files">@Resource.Browse</a>
     <input type="file" id="FileUpload3" class="displaynone" name="FileUpload3" onchange="Upload('SingleFile', 'ImageUrl3', 'FileUpload3', '1', '1', '#form3');" />
     <span class="uploading">@Resource.Uploading</span>
    </フォーム>
    </td>
   </tr>
   <tr><th>内容: </th><td><textarea id="ImageContent3"スタイル="幅: 300px; height: 80px;"></textarea></td></tr>
   <tr><th>リンク: </th><td><input type="text" id="ImageLink3" /></td></tr>
   <tr><th>並び順: </th><td><input type="number" id="Sort3" value="0" /></td></tr>
   </table>
  </div>
  <table><tr><td><table id="List31></table></td><td> </td><td><table id="List3></table></td></tr></table>
  </div>
  <div title="[#5#]" style="padding:10px">
  <div class="mvctool ">
   @Html.ToolButton("btnCreate4", "fa fa-search", "返信を追加", ref perm, "Edit", false)
   @Html.ToolButton("btnEdit4", "fa fa-search", "編集", ref perm, "Edit", true)
   @Html.ToolButton("btnDelete4", "fa fa-search", "削除", ref perm, "Delete", false)
   <div class="rightdiv color-green">
   現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
  </div>
  <div id="modalwindow4"
   class="easyui-window
   style="width:600px; height:500px;" data-options="modal:true,closed: true,minimizable:false,shadow:false">
   <div class="mvctool bgb">
   @Html.ToolButton("btnSava4", "fa fa-search", "保存して提出", ref perm, "Edit", false)
   <div class="rightdiv color-green">
    現在の操作用公式アカウント: <span id="CurrentOfficalAccount">@ViewBag.CurrentOfficalAcount</span>
   </div>
   </div>
   <テーブル class="formtablenormal">
   <tr><th>タイトル: </th><td><input type="text" id="VoiceTitle4" /></td></tr>
   <tr>
    <th>キーワード: </th>
    <td>
    <input type="text" id="TextMatchKey4" />
    </td>
   </tr>
   <tr>
    <th>ルール: </th>
    <td>
    @Html.SwitchButtonByEdit("swMessageRule4", true, "ぼやけた一致(キーワードが内容に含まれる場合)", "完全一致(内容とキーワードが完全に一致する場合)", "280")
    </td>
   </tr>
   <tr>
    <th>音声: </th>
    <td>
    <フォーム id="フォーム4" method="post">
     <input type="text" class="left" name="VoiceUrl4" id="VoiceUrl4" />
     <a href="javascript:$('#FileUpload4').トリガー('クリック');" class="files">@Resource.Browse</a>
     <input type="file" id="FileUpload4" accept="オーディオ/mpeg" class="displaynone" name="FileUpload4" onchange="Upload('SingleFile', 'VoiceUrl4', 'FileUpload4', '', '', '#フォーム4');" />
     <span class="uploading">@Resource.Uploading</span>
    </フォーム>
    </td>
   </tr>
   <tr><th>説明: </th><td><テキストエリア id="VoiceContent4"スタイル="幅: 300px; height: 100px;"></textarea></td></tr>
   </table>
  </div>
  <table id="List4></table>
  </div>
  @*<div title="[#6#]"
   style="padding:10px">
  </div>*@
  @*<div title="[#7#]"
   styIe="padding:10px">
  </div>
  <div title="[#8#]"
   style="padding:10px">
  </div>*@
 </div>
 </div>

フロントエンドの思维导图を利用して、フロントエンドのコードを速やかに理解し、実際に応用します 

まとめ 

.メッセージの管理は非常に技術的なことです

1.メッセージがタスクのリプライがない場合、デフォルトのリプライを有効にする必要があります。さもなければ、ユーザーは反応を受けず、体験を失います 

2.キーワードのデザインは一般的に一環一環で、ガイド的な役割を果たします
例えば:

キーワード:(私は)   回复: 按1参加して賞品一つを取得、按2直接取得50円
キーワード:(1)       回复: 按3以下の通り、鉄観音茶一斗分を取得4普洱茶を取得
キーワード:(3または4)  回复:あなたの住所と電話番号及び受信人を返信してください
これにより、システムとユーザーの間の完全な対話を得ることができます。もちろん、ユーザーの最終情報も処理する必要があります。

この記事は『ASP.NET微信開発教程汇总』にまとめられています。皆さん、ぜひ学習してください。

管理システムに関する詳細な内容は、『管理系统专题』をクリックして学習してください。

これでこの記事のすべての内容が終わりました。皆様の学習に役立つことを願っています。また、呐喊教程を多くの人がサポートしてくれることを願っています。

声明:この記事の内容はインターネットから収集され、著作権者に帰属します。インターネットユーザーが自発的に貢献し、アップロードしたものであり、このサイトは所有権を持ちません。人工的な編集は行われていません。著作権侵害の疑いがある場合は、以下のメールアドレスにご連絡ください:notice#oldtoolbag.com(メール送信時は、#を@に変更してください。通報をお願いし、関連する証拠を提供してください。一旦確認がとれましたら、このサイトは即座に侵害疑いのコンテンツを削除します。)

おすすめ