富文本前台接收 方法实例

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../common/common.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<title>美丽乡村</title>
<style type="text/css">
#country {
    overflow-y: auto;
    overflow-x: hidden;
}

.countryItem {
    margin-bottom: 10px;
    color: #333;
}

.countryTexeCon {
    padding: 10px 15px;
    background-color: #ffffff;
}

.countryName {
    padding-bottom: 5px;
    color: #333;
}

.countryPro {
    color: #929292;
    font-size: 14px;
    height: auto;
    word-break: break-all;
}

.countryItem>img {
    width: calc(100% - 6px);
    height: 100%;
    border: 3px solid #f1f1f1;
}

.countryText {
    position: relative;
}

.countryTextTitle {
    padding: 15px 0px;
    position: absolute;
    top: 0px;
    left: 0px;
    border-bottom: 1px solid #cccccc;
    color: #333;
    width: 100%;
    text-align: center;
    font-size: 21px;
    background-color: #fbfbfb;
}

.countryTextTitle>img {
    position: absolute;
    top: 9px;
    left: 12px;
    width: 21px;
    padding: 10px;
}

.countryText {
    padding-top: 60px;
    background-color: #fff;
}

.countryTextBody {
    padding: 15px;
}

.countryTextBody .text {
    text-indent: 28px;
}

.countryTextBody2 img {
    max-width: 95%;
    margin: 5px auto;
    display: inherit;
}

.goArea {
    margin-top: 5px;
    padding: 5px 0;
    background-color: aliceblue;
    position: relative;
    height: 25px;
}

.goArea>img {
    position: absolute;
    left: 10px;
    top: 5px;
    width: 23px;
}

.goArea>div {
    position: absolute;
    right: 10px;
    top: 6px;
}

.goWay {
    background-color: #0DBEF5;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    padding: 2px 10px;
    padding-left: 22px;
    margin-left: 10px;
    cursor: pointer;
    position: relative;
}

.goWayImg {
    position: absolute;
    top: 2px;
    left: 5px;
    width: 16px;
}
.countryTextBody img{
    max-width:100%;
}
[v-cloak] {
    display: none;
}
</style>
</head>
<body style="background-color: #fbf7e9;">
    <div id="country"  v-cloak>
        <div class="countryList" v-show="bl">
            <div class="countryItem" v-for="(item,index) in countryList"
                @click="goCountryText(item)">
                <img :src=item.pictureUpload />
                <div class="countryTexeCon">
                    <div class="countryName">{{item.name}}</div>
                    <div class="countryPro">{{item.brief}}</div>
                </div>
            </div>
        </div>
        <div class="countryText" v-show="!bl">
            <div class="countryTextTitle">
                <span>{{countryText.name}}</span> <img src="image/leftArrow.png"
                    @click="backCountryList()" />
            </div>
            <div class="countryTextBody">
                <div v-html=‘countryText.description‘></div>
                <div class="goArea">
                    <img src="image/goArea.png">
                    <div>
                        <span class="goWay">公交<img class="goWayImg"
                            src="image/busIc.png"></span> <span class="goWay">驾车<img
                            class="goWayImg" src="image/driveIc.png"></span> <span
                            class="goWay">步行<img class="goWayImg"
                            src="image/walkIc.png"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="textR"></div>
</body>
<script type="text/javascript">
    var base = $("base").attr("href");
    var country = new Vue(
            {
                el : ‘#country‘,
                created : function() {
                    this.$http(
                                    {
                                        url : base+"rest/transportCountry?id=",
                                    }).then(
                                    function(res) {
                                        var tempC = res.data;
                                        for (var i = 0; i < tempC.length; i++) {
                                            var str = tempC[i].description;
                                            var temp = document.getElementById("textR");
                                            temp.innerHTML = str;
                                            var output = temp.innerText || temp.textContent;
                                            temp.innerHTML = "";
                                            console.debug(tempC[i].description);
                                            tempC[i].description = output;
                                        }
                                        this.countryList = tempC;
                                    });
                },
                data : {
                    countryList : "",
                    bl : true,
                    countryText : {
                        name : "",
                        info : []
                    }
                },
                methods : {
                    goCountryText : function(item) {
                        this.bl = false;
                        this.countryText = item;
                    },
                    backCountryList : function() {
                        this.bl = true;
                    }
                }
            });
    function updateBusSize() {
        $("#country").height($(window).height());
    };
    // 更新页面元素高度
    updateBusSize();
    $(window).resize(function() {
        updateBusSize();
    });
    var nowA = "";
    var geolocation = new BMap.Geolocation();
    geolocation.getCurrentPosition(function(r) {
        if (this.getStatus() == BMAP_STATUS_SUCCESS) {
            nowA = r.point.lat + ‘,‘ + r.point.lng;
        } else {
            alert(‘failed‘ + this.getStatus());
        }
    }, {
        enableHighAccuracy : true
    });
    $(".goWay").click(
                    function() {
                        var way = $(this).text();
                        var goway = "";
                        if (way == "公交") {
                            goway = "transit";
                        } else if (way == "驾车") {
                            goway = "driving";
                        } else if (way == "步行") {
                            goway = "walking";
                        }
                        location.href = "http://api.map.baidu.com/direction?origin=latlng:"
                                + nowA
                                + "|name:&destination=latlng:"
                                + country.countryText.lat
                                + ","
                                + country.countryText.lng
                                + "|name:"
                                + country.countryText.name
                                + "&mode="
                                + goway
                                + "&region=南京&output=html&src=yourCompanyName|yourAppName"
                    });
</script>
</html>
时间: 2024-08-26 00:43:41

富文本前台接收 方法实例的相关文章

富文本Html.fromHtml方法

用于对选中的部分进行格式更改,或者添加图片 这是Textview使用富文本 Toast和富文本结合使用, Toast toast2 = Toast.makeText(getApplicationContext(), "这是个提示", Toast.LENGTH_SHORT);toast2.show();toast2.setGravity(Gravity.LEFT|Gravity.CENTER, 100, 0);Spanned spanned = Html.fromHtml("我

artEditor 富文本编辑器实际方法

界面效果 网址:https://github.com/baixuexiyang/artEditor 引入文件: 界面代码   <!DOCTYPE html>   <html lang="en">   <head>   <meta charset="UTF-8">   <title>artEditor</title>   <meta http-equiv="Access-Contr

kindeditor富文本框使用方法

这周我一共使用了两个文本框编辑器!我的上一篇文档讲的是wangeditor这个编辑器,现在就来讲讲kindeditor这个编辑器! 首先还是去它的官网去下载脚本! http://kindeditor.net/demo.php 所做的操作和那个wangeditor编辑器差不多都是需要在你的HTML的<body>里面加上下面这段标签: 1 <textarea style="width: 98%;" rows="15" name="Conten

百度 迷你版 UMeditor富文本编辑器 使用方法

第一步:下载编辑器 到官网下载 umeditor 最新版源码版本,下载之后打开 _examples/index.html 就可以看到演示例子.[下载页面] 第二步:部署编辑器到页面 解压下载的包,放到你的项目中. 在你的页面要插入编辑器的位置,插入代码: <!-- 加载编辑器的容器 --> <script id="container" name="content" type="text/plain" style="wi

vue-quill-editor 富文本集成quill-image-extend-module插件实例,以及UglifyJsPlugin打包抱错问题处理

官网 vue-quill-editor Toolbar Module - Quill vue-quill-image-upload 图片支持上传服务器并调整大小 1.在 package.json 中加入 "quill-image-extend-module": "^1.1.2" 依赖 2.在编辑器组件中引入以下代码 <template> <div class="in-editor-panel"> <quill-edi

转载的一个富文本,挺实用的

文章内容大纲 1.NSMutableAttributedString的基本使用 2.NSMutableAttributedString的简易封装 3.使用开源代码GOBMarkupPaser处理富文本 4.UITextKit简介 5.编程思想的相关思考 前言 富文本使用案例: 这里我自己也用了富文本实现了简单的却也是常用的例子: 对于最后面的¥50中划线这种设置,估计只有富文本最好用了. 在IOS或者Mac OS X通过UIKit提供的用来显示字符串控件有三个: UILable,UITextFi

iOS之富文本总结

文章内容大纲 1.NSMutableAttributedString的基本使用 2.NSMutableAttributedString的简易封装 3.使用开源代码GOBMarkupPaser处理富文本 4.UITextKit简介 5.编程思想的相关思考 前言 富文本使用案例: 这里我自己也用了富文本实现了简单的却也是常用的例子: 对于最后面的¥50中划线这种设置,估计只有富文本最好用了. 在IOS或者Mac OS X通过UIKit提供的用来显示字符串控件有三个: UILable,UITextFi

django之百度Ueditor富文本编辑器后台集成

Python3 + Django2.0 百度Ueditor 富文本编辑器的集成 百度富文本编辑器官网地址:http://fex.baidu.com/ueditor/ 疑问:为什么要二次集成? 答案:因为百度富文本编辑器Ueditor没有对python的支持 步骤1: 在官网下载Ueditor的任意版本代码:http://ueditor.baidu.com/website/download.html#ueditor 步骤2: 将下载的代码放入到 django 项目中 步骤3:前端引用 在前端HTM

PHP如何搭建百度Ueditor富文本编辑器

本文为大家分享了PHP搭建百度Ueditor富文本编辑器的方法,供大家参考,具体内容如下 下载UEditor 官网:下载地址 将下载好的文件解压到thinkphp项目中,本文是解压到PUBLIC目录下并改文件夹名称为ueditor 第一步 引入javascript 在html中如入下面的js语句引入相关文件 ? 1 2 <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ued