예제 #1
0
        public ActionResult RichText(int id = 0)
        {
            //string token = AccessTokenContainer.GetAccessToken(AccessTokenContainer.GetFirstOrDefaultAppId());
            string token = WxHelper.GetToken(webview_appid, webview_appsecret, false);

            ViewBag.appid     = AccessTokenContainer.GetFirstOrDefaultAppId();
            ViewBag.ticket    = JsApiTicketContainer.GetJsApiTicket(JsApiTicketContainer.GetFirstOrDefaultAppId());
            ViewBag.timestamp = JSSDKHelper.GetTimestamp();
            ViewBag.nonceStr  = JSSDKHelper.GetNoncestr();

            ViewBag.signature = JSSDKHelper.GetSignature(ViewBag.ticket, ViewBag.nonceStr, ViewBag.timestamp, GetPageUrl());
            ViewBag.pageUrl   = GetPageUrl();
            if (id == 0)
            {
                ViewBag.description = "";
            }
            else
            {
                EntGoods good = EntGoodsBLL.SingleModel.GetModel(id);
                if (good == null)
                {
                    ViewBag.description = "";
                    return(Content("产品不存在或已删除"));
                }
                ViewBag.description = good.description;
            }
            return(View());
        }
예제 #2
0
        /// <summary>
        /// 拼享惠产品描述编辑
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult PinRichText(int id = 0)
        {
            string token = WxHelper.GetToken(webview_appid, webview_appsecret, false);

            ViewBag.appid     = AccessTokenContainer.GetFirstOrDefaultAppId();
            ViewBag.ticket    = JsApiTicketContainer.GetJsApiTicket(JsApiTicketContainer.GetFirstOrDefaultAppId());
            ViewBag.timestamp = JSSDKHelper.GetTimestamp();
            ViewBag.nonceStr  = JSSDKHelper.GetNoncestr();

            ViewBag.signature = JSSDKHelper.GetSignature(ViewBag.ticket, ViewBag.nonceStr, ViewBag.timestamp, Server.UrlDecode(GetPageUrl()));
            ViewBag.pageUrl   = GetPageUrl();

            if (id == 0)
            {
                //string temp = RedisUtil.Get<string>(PinGoodsBLL.key_new_pin_goods);
                ViewBag.description = ""; //temp ?? "";
            }
            else
            {
                PinGoods good = PinGoodsBLL.SingleModel.GetModel(id);
                if (good == null)
                {
                    ViewBag.description = "";
                    return(Content("产品不存在或已删除"));
                }
                ViewBag.description = good.description;
            }
            return(View("RichText"));
        }
예제 #3
0
        public ActionResult PlatStoreDescriptionRichText(int id = 0)
        {
            //string token = AccessTokenContainer.GetAccessToken(AccessTokenContainer.GetFirstOrDefaultAppId());
            string token = WxHelper.GetToken(webview_appid, webview_appsecret, false);

            ViewBag.appid     = AccessTokenContainer.GetFirstOrDefaultAppId();
            ViewBag.ticket    = JsApiTicketContainer.GetJsApiTicket(JsApiTicketContainer.GetFirstOrDefaultAppId());
            ViewBag.timestamp = JSSDKHelper.GetTimestamp();
            ViewBag.nonceStr  = JSSDKHelper.GetNoncestr();
            ViewBag.signature = JSSDKHelper.GetSignature(ViewBag.ticket, ViewBag.nonceStr, ViewBag.timestamp, GetPageUrl());
            log4net.LogHelper.WriteInfo(this.GetType(), $"token={token};appid={ViewBag.appid};ticket={ViewBag.ticket};timestamp={ ViewBag.timestamp};nonceStr={ViewBag.nonceStr};signature={ViewBag.signature};pageUrl={GetPageUrl()}");

            if (id == 0)
            {
                // string temp = RedisUtil.Get<string>("temp_psd_description_0");
                ViewBag.description = "";//temp ?? "";
            }
            else
            {
                PlatStore platStore = PlatStoreBLL.SingleModel.GetModel(id);
                if (platStore == null || platStore.State == -1)
                {
                    ViewBag.description = "";
                    return(Content("店铺不存在或已删除"));
                }
                ViewBag.description = platStore.StoreDescription;
            }
            return(View());
        }