123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace LYFZ.Web.WeiXinAPP.Satisfaction
- {
- public partial class SatisfactionOrderView : System.Web.UI.Page
- {
-
- protected void Page_Load(object sender, EventArgs e)
- {
- string StrClientView = "";
- if (!IsPostBack)
- {
- string StrClientNumber = "";
- string cusid = Request.QueryString["cusid"];
- string appid = Request.QueryString["appid"];
- string openid = Request.QueryString["openid"];
- if (!string.IsNullOrEmpty(Request.QueryString["cusid"]) && !string.IsNullOrEmpty(Request.QueryString["openid"]) && !string.IsNullOrEmpty(Request.QueryString["appid"]))
- {
- LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = LYFZ.WeixinServers.Global.GetCustomerModelById(cusid);
- //cusModel.GetRequestUrl()
- string getCheckText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl()
- + "/Api/WXApi.ashx/GetWXCustomerHaveOrder?openid=" + openid + "&appid=" + appid);
- dynamic dyObject = Newtonsoft.Json.JsonConvert.DeserializeObject(getCheckText);
- Newtonsoft.Json.Linq.JArray arrayList = (Newtonsoft.Json.Linq.JArray)dyObject.data;
- if (arrayList.Count>0)
- {
- if (arrayList.Count > 1)
- {
- StrClientView = Funt_GetOrderMianPanel(arrayList, StrTitleText: "我的订单", StrNotShowText: "Ord_Number,Ordv_ViceNumber", LinkAddressName: "SatisfactionOrderDetail.aspx", openid: openid, cusid: cusid, appid: appid);
- }
- else
- {
- Response.Redirect("SatisfactionOrderDetail.aspx?cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "&OrdNumber=" + arrayList[0]["Ord_Number"] + "&ViceOrdNumber=" + arrayList[0]["Ordv_ViceNumber"]);
- }
- }
- else
- { StrClientView = " <div style='text-align: center'><label class='weui_cell weui_check_label' style='text-align: center'>您未订单,暂无订单评价!</label></div>"; }
- }
- ViewState["ClientView"] = StrClientView;
- }
- }
- string Funt_GetOrderMianPanel(Newtonsoft.Json.Linq.JArray dt, string StrTitleText, string StrNotShowText = "", string LinkAddressName = "",string openid="",string cusid="",string appid="")
- {
- string StrDataList = "";
- List<string> NotShowTextlist = StrNotShowText.Split(',').ToList();
- if (dt != null && dt.Count > 0)
- {
- for (int i = 0; i < dt.Count; i++)
- {
- Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)dt[i];
- IDictionary<string, object> keys = new Dictionary<string, object>();
- foreach (var item in jobject)
- {
- keys.Add(item.Key, item.Value);
- }
- string StrOnClick = "";
- if (!string.IsNullOrEmpty(LinkAddressName))
- {
- string strLinkName = "";
- for (int k = 0; k < NotShowTextlist.Count; k++)
- {
- if (k == 0)
- {
- if (LinkAddressName.Trim().IndexOf('?') == -1)
- { strLinkName += "?" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); }
- else
- { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + keys[NotShowTextlist[k].Trim()].ToString(); }
- }
- else
- { strLinkName += "&" + NotShowTextlist[k].Trim() + "=" + jobject[NotShowTextlist[k].Trim()].ToString(); }
- }
- StrOnClick = "onclick=\"window.location.href = '" + LinkAddressName + strLinkName + "&cusid=" + cusid + "&openId=" + openid + "&appid=" + appid + "'\"";
- StrOnClick = StrOnClick.Replace("Ord_Number", "OrdNumber").Replace("Ordv_ViceNumber", "ViceOrdNumber");
- }
- StrDataList += "<div class='figure'>" +
- " <h3 class='figure-caption'>" + StrTitleText + "-" + (i + 1) + "</h3>" +
- " <div class='figure-content'>" +
- " <div class='grid'>" +
- " <div class='col-12'>" +
- " <span " + StrOnClick + ">";
- foreach (string key in keys.Keys)
- {
- bool IsFind = false;
- for (int k = 0; k < NotShowTextlist.Count; k++)
- {
- if (key.Equals(NotShowTextlist[k]))
- { IsFind = true; break; }
- }
- if (IsFind)
- { continue; }
- StrDataList += " <div class='grid-item'><span class='grid-item-title'>" + key + ":</span><span>" + keys[key] + "</span></div>";
- }
- StrDataList += " </span>" +
- " </div>" +
- " </div>" +
- " </div>" +
- "</div>";
- }
- }
- else
- {
- StrDataList += "<div class='figure'>" +
- //" <h3 class='figure-caption'>" + StrTitleText + "</h3>" +
- " <div class='figure-content'>" +
- " <div class='grid'>" +
- " <div class='col-12'>" +
- " <span>" +
- " <div class='grid-item'><span> 未查找到任何相关数据。</span></div>" +
- " </span>" +
- " </div>" +
- " </div>" +
- " </div>" +
- "</div>";
- }
- return StrDataList;
- }
- }
- }
|