Exemple #1
0
        // GET: m/i/123
        public ActionResult I(String id)
        {
            string Pagehtml = "";

            id = DESEncrypt.Decrypt(id);
            if (id != null)
            {
                appbase            AppBase      = new Psd.H5Show.BLL.appbase().GetModel(int.Parse(id));
                List <apppagebase> appPageBases = new Psd.H5Show.BLL.apppagebase().GetModelList(" Appid='" + AppBase.ID + "' and DELFLAG=0 order by orderby");

                foreach (apppagebase appPageBase in appPageBases)
                {
                    string PageList = "<div class='swiper-slide' title='@title'>";

                    List <apppageinfo> appPageInfos = new Psd.H5Show.BLL.apppageinfo().GetModelList(" PAGEID='" + appPageBase.ID + "'");
                    foreach (apppageinfo appPageInfo in appPageInfos)
                    {
                        switch (appPageInfo.KitType)
                        {
                        case "image":
                            string   imgSrc = appPageInfo.KitContent;
                            string[] ims    = imgSrc.Split('=');
                            imgSrc = ims[1].Substring(0, ims[1].Length - 1);

                            string KitItem = "<div class='ani' swiper-animate-effect='@effect' swiper-animate-duration='@durationss' " +
                                             "swiper-animate-delay='@delayss' style='position:absolute !important;left: @left; top: @top;" +
                                             " z-index: @zindex; width: @width; height: @height; ' >" +
                                             "<img style=\"transform:rotate(@transformdeg); width:100%;height:100%;\" src=\'../../" + imgSrc + "\'></div>";
                            KitItem   = KitItem.Replace("@effect", appPageInfo.KitAnEffect);
                            KitItem   = KitItem.Replace("@durations", appPageInfo.KitAnDuration.ToString());
                            KitItem   = KitItem.Replace("@delays", appPageInfo.KitAnDelay.ToString());
                            KitItem   = KitItem.Replace("@left", appPageInfo.KitLeft.ToString());
                            KitItem   = KitItem.Replace("@top", appPageInfo.KitTop.ToString());
                            KitItem   = KitItem.Replace("@width", appPageInfo.KitWidth.ToString());
                            KitItem   = KitItem.Replace("@height", appPageInfo.KitHeight.ToString());
                            KitItem   = KitItem.Replace("@transform", appPageInfo.KitAngleZ.ToString());
                            PageList += KitItem;
                            break;
                        }
                    }

                    PageList = PageList.Replace("@title", appPageBase.Title);

                    PageList += "</div>";
                    Pagehtml += PageList;
                }

                ViewBag.AppBase = AppBase;
            }
            else
            {
                Pagehtml = "非法参数";
            }
            ViewBag.Pagehtml = Pagehtml;

            return(View());
        }
Exemple #2
0
        public ActionResult GetAppPageKit(string pagecode, string appcode)
        {
            JsonResult json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            List <apppageinfo> AppPageKitList = new List <apppageinfo>();
            user_account       userAccount    = new user_account();
            apppagebase        appPageBase    = new apppagebase();
            appbase            appBase        = new appbase();
            JsonResult         jsonResult     = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            pagecode = DESEncrypt.Decrypt(pagecode);
            if (pagecode == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "错误编码";
            }
            else
            {
                appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                appBase     = new Psd.H5Show.BLL.appbase().GetModel(appPageBase.AppId);
                if (Request.Cookies["PsdH5ShowUserCode"] == null)
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,你还未登录呢";
                }
                else
                {
                    userAccount =
                        Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                            Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                    if (!userAccount.ID.Equals(appBase.Uid))
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "无权限编辑此页面";
                    }
                    else
                    {
                        AppPageKitList = new Psd.H5Show.BLL.apppageinfo().GetModelList(" Pageid='" + pagecode + "'");

                        json.Data = AppPageKitList;
                    }
                }
            }
            return(json);
        }
Exemple #3
0
        /// <summary>
        /// 保存页面结果
        /// </summary>
        /// <param name="length">The length.</param>
        /// <param name="pagecode">The pagecode.</param>
        /// <param name="kitlist">The kitlist.</param>
        /// <returns></returns>
        public ActionResult EditPageSaveKitsActionResult(string length, string pagecode, string kitlist)
        {
            kitlist = "{\"KitList\":" + kitlist + "}";
            JavaScriptSerializer ser = new JavaScriptSerializer();

            Psd.H5Show.Model.Tools.kitmodel pageKitModel = ser.Deserialize <Psd.H5Show.Model.Tools.kitmodel>(kitlist);
            foreach (Psd.H5Show.Model.Tools.KitList pageKit in pageKitModel.KitList)
            {
                apppageinfo AppPageInfo = new Psd.H5Show.BLL.apppageinfo().GetModel(int.Parse(pageKit.Kid));
                AppPageInfo.KitAnDelay    = double.Parse(pageKit.delay.Substring(0, pageKit.delay.Length - 1)); //运行时间
                AppPageInfo.KitAnDuration = double.Parse(pageKit.duration.Substring(0, pageKit.duration.Length - 1));
                string   lnk  = pageKit.link;
                string[] link = lnk.Split('|');
                AppPageInfo.KitLinkType = int.Parse(link[0]);
                AppPageInfo.KitAnEffect = pageKit.effect;
                AppPageInfo.KitLinkUrl  = link[1];
                AppPageInfo.KitAngleZ   = pageKit.angleZ.ToString();
                AppPageInfo.KitContent  = "<img src=" + pageKit.img + ">";
                AppPageInfo.KitWidth    = pageKit.style.width;
                AppPageInfo.KitHeight   = pageKit.style.height;
                AppPageInfo.KitLeft     = pageKit.style.left;
                AppPageInfo.KitTop      = pageKit.style.top;
                if (new Psd.H5Show.BLL.apppageinfo().Update(AppPageInfo))
                {
                    Msg.Result = 1;
                    Msg.Msg    = "哟嚯!保存成功,赶紧预览下看看您的作品吧!";
                }
                else
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,竟然保存失败了,您可以Ctrl+F5刷新下 再看看吧";
                }
            }
            JsonResult jsonResult = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;


            jsonResult.Data = Msg;
            return(jsonResult);
        }
Exemple #4
0
        public ActionResult EditPageCreateKitActionResult(string pagecode, string t)
        {
            user_account userAccount = new user_account();
            apppagebase  appPageBase = new apppagebase();
            appbase      appBase     = new appbase();
            JsonResult   jsonResult  = new JsonResult();

            jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            pagecode = DESEncrypt.Decrypt(pagecode);
            if (pagecode == null)
            {
                Msg.Result = 0;
                Msg.Msg    = "错误编码";
            }
            else
            {
                appPageBase = new Psd.H5Show.BLL.apppagebase().GetModel(int.Parse(pagecode));
                appBase     = new Psd.H5Show.BLL.appbase().GetModel(appPageBase.AppId);
                if (Request.Cookies["PsdH5ShowUserCode"] == null)
                {
                    Msg.Result = 0;
                    Msg.Msg    = "哎哟,你还未登录呢";
                }
                else
                {
                    userAccount =
                        Psd.H5Show.BLL.AppTools.GetUserCodeToUseraccountModel(
                            Request.Cookies["PsdH5ShowUserCode"].Value.ToString());
                    if (!userAccount.ID.Equals(appBase.Uid))
                    {
                        Msg.Result = 0;
                        Msg.Msg    = "无权限编辑此页面";
                    }
                    else
                    {
                        switch (t)
                        {
                        case "image":     //图片类型  图片控件初始化加载 配置

                            apppageinfo appPageInfo = new apppageinfo();
                            appPageInfo.PageId        = int.Parse(pagecode);
                            appPageInfo.KitAnDelay    = 0.5;
                            appPageInfo.KitAnDuration = 0.5;
                            appPageInfo.KitAnEffect   = "fadeInUp";
                            appPageInfo.KitAngleZ     = "0";
                            appPageInfo.KitLeft       = "0px";
                            appPageInfo.KitTop        = "0px";
                            appPageInfo.KitType       = t;
                            appPageInfo.KitStyle      = "";
                            appPageInfo.KitLinkUrl    = "";
                            appPageInfo.KitLinkType   = 0;
                            appPageInfo.KitWidth      = "auto";
                            appPageInfo.KitHeight     = "auto";
                            appPageInfo.KitContent    = "<img src=\"../../content/image/demo.png\">";
                            appPageInfo.ID            = Psd.H5Show.BLL.AppTools.getMaxIdToTable("apppageinfo") + 1;
                            var imgcontrol =
                                "<div class='imgview ani' swiper-animate-effect='" + appPageInfo.KitAnEffect +
                                "' swiper-animate-duration='" + appPageInfo.KitAnDuration +
                                "s' swiper-animate-delay='" + appPageInfo.KitAnDelay + "s' width='" +
                                appPageInfo.KitWidth + "' " +
                                " Ptype='imgview' link='" + appPageInfo.KitLinkType + "|" + appPageInfo.KitLinkUrl +
                                "' id='" + appPageInfo.ID.ToString() + "' style='style='left:" + appPageInfo.KitTop +
                                ";top:" + appPageInfo.KitTop +
                                ";z-index:1'>" + appPageInfo.KitContent + "</div >";
                            try
                            {
                                new Psd.H5Show.BLL.apppageinfo().Add(appPageInfo);
                                List <apppageinfo> KitList =
                                    new Psd.H5Show.BLL.apppageinfo().GetModelList(" PageId='" + pagecode + "'");
                                Msg.Result = 1;
                                Msg.Msg    = imgcontrol;
                            }
                            catch (Exception es)
                            {
                                Msg.Msg = es.ToString();
                                throw;
                            }


                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            jsonResult.Data = Msg;
            return(jsonResult);
        }