Commit d2e3b81e authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/0702-v.2.2.0' into 0702-v.2.2.0

parents 10871e65 6af34f65
...@@ -56,18 +56,23 @@ class UploadFileService ...@@ -56,18 +56,23 @@ class UploadFileService
switch ($type) { switch ($type) {
case 'chat': case 'chat':
$path .= 'static/chat_image/'; $path .= 'static/chat_image/';
$internet_path = CHAT_IMG_URL;
break; break;
case 'user_header' : case 'user_header' :
$path .= 'static/user_header/'; $path .= 'static/user_header/';
$internet_path = '';
break; break;
case 'agent_header' : case 'agent_header' :
$path .= 'static/head_portrait/'; $path .= 'static/head_portrait/';
$internet_path = '';
break; break;
case 'house_img': case 'house_img':
$path .= 'resource/lib/Attachments/images/'; $path .= 'resource/lib/Attachments/images/';
$internet_path = '';
break; break;
case 'business_school' : case 'business_school' :
$path .= 'static/business_school/'; $path .= 'static/business_school/';
$internet_path = '';
break; break;
default : default :
$data['code'] = 101; $data['code'] = 101;
...@@ -88,6 +93,7 @@ class UploadFileService ...@@ -88,6 +93,7 @@ class UploadFileService
if ($info) { if ($info) {
$data['code'] = 200; $data['code'] = 200;
$data["msg"][$k]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径 $data["msg"][$k]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径
$data["msg"][$k]['internet_img_name'] = $internet_path . $data["msg"][$k]['img_path'];
$data["msg"][$k]['img_ext'] = $info->getExtension(); $data["msg"][$k]['img_ext'] = $info->getExtension();
} else { } else {
$data['code'] = 101; $data['code'] = 101;
...@@ -103,6 +109,7 @@ class UploadFileService ...@@ -103,6 +109,7 @@ class UploadFileService
if ($info) { if ($info) {
$data['code'] = 200; $data['code'] = 200;
$data["msg"]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径 $data["msg"]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径
$data["msg"]['internet_img_name'] = $internet_path . $data["msg"]['img_path'];
$data["msg"]['img_ext'] = $info->getExtension(); $data["msg"]['img_ext'] = $info->getExtension();
} else { } else {
$data['code'] = 101; $data['code'] = 101;
......
...@@ -331,6 +331,7 @@ ...@@ -331,6 +331,7 @@
<label>请选择一个图像文件:</label> <label>请选择一个图像文件:</label>
<button type="button btn2" class="btn btn-default">上传图片</button> <button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input"/> <input type="file" id="file_input"/>
<div id="container_body_img_area"></div>
</div> </div>
</div> </div>
<ul class="img-pre-ul" id="xiangqing_pic_ul"> <ul class="img-pre-ul" id="xiangqing_pic_ul">
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
<div class="pull-right"> <div class="pull-right">
<ul class="bread_btn"> <ul class="bread_btn">
<li> <li>
<a href="new_text.html" class="btn btn-default add_alert" target="_blank"><i class="icon-plus"></i> 新增文章 <a href="new_text.html" class="btn btn-default add_alert" target="_self"><i class="icon-plus"></i> 新增文章
</a> </a>
</li> </li>
</ul> </ul>
......
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
if(!doc.addEventListener) return; if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false); win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);</script><script type=text/javascript src=./vconsole.min.js></script><script type=text/javascript>if(~location.origin.indexOf('api.tonglianjituan.com')){console.log('正式服')}else{var vConsole=new VConsole()};</script><link href=./static/css/app.2f68450ee9131bc7966b2a9be394fa22.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.94d51f6620cb57f6116c.js></script><script type=text/javascript src=./static/js/app.d7d3f9bca7c902a57aa7.js></script></body></html> })(document, window);</script><script type=text/javascript src=./vconsole.min.js></script><script type=text/javascript>if(~location.origin.indexOf('api.tonglianjituan.com')){console.log('正式服')}else{var vConsole=new VConsole()};</script><link href=./static/css/app.0384396bacb087bd73b7dac32b95f8cc.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.94d51f6620cb57f6116c.js></script><script type=text/javascript src=./static/js/app.861267062f5d7aa4508f.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"version":3,"sources":["webpack:///webpack/bootstrap a8effb7b01da42f5afa2"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a8effb7b01da42f5afa2"],"sourceRoot":""} {"version":3,"sources":["webpack:///webpack/bootstrap c0fda64e6f356317bc84"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c0fda64e6f356317bc84"],"sourceRoot":""}
\ No newline at end of file \ No newline at end of file
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
color: #1A1A1A; color: #1A1A1A;
line-height: .56rem; line-height: .56rem;
margin-top: .5rem; margin-top: .5rem;
padding-bottom:1rem;
} }
.sec-right{ .sec-right{
margin-left: .32rem; margin-left: .32rem;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h1>{{articleTitle}}</h1> <h1>{{articleTitle}}</h1>
<p>{{articleTime}}</p> <p>{{articleTime}}</p>
</div> </div>
<div v-html="articleContent">{{articleContent}}</div> <div class="oh article-content-area" v-html="articleContent">{{articleContent}}</div>
</article> </article>
<div class="list-commnet-area"> <div class="list-commnet-area">
...@@ -219,9 +219,12 @@ ...@@ -219,9 +219,12 @@
background-color: white; background-color: white;
padding: .3rem; padding: .3rem;
} }
article{
/*而如果在组件中使用了v-html,要为myHtml中的标签添加CSS样式,我们需要在写样式的时候添加>>>:*/
.article-content-area >>> img{
max-width: 6.9rem;
} }
.article-bar>h1{ .article-bar>h1{
font-size: .4rem; font-size: .4rem;
color: #1a1a1a; color: #1a1a1a;
...@@ -245,6 +248,7 @@ ...@@ -245,6 +248,7 @@
height: .98rem; height: .98rem;
} }
/*按钮区域样式*/
.btn-comment-area{ .btn-comment-area{
position: fixed; position: fixed;
bottom: 0; bottom: 0;
...@@ -278,6 +282,8 @@ ...@@ -278,6 +282,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
/*评论输入框区域*/
.real-comment-area{ .real-comment-area{
position: fixed; position: fixed;
left: 0; left: 0;
......
...@@ -7,73 +7,116 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -7,73 +7,116 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
id: '', id: '',
house_id: '', house_id: '',
house_fatherid: '', house_fatherid: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
image_file: '',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
follow.getList(0); follow.getList(0);
follow.event(); follow.event();
follow.getaddPicList2();
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
_doc.on('click', '.span-del', function(e) {
e.preventDefault();
e.stopPropagation(); //时间轴点击出现
$(this).parent().remove();
});
_doc.on('click', '.span-del2', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).prev().attr('class');
$(this).parent().remove();
follow.spandelList($(this).prev().attr('class'));
});
_doc.on('click', 'a[href="#modal-time"]', function(e) { _doc.on('click', 'a[href="#modal-time"]', function(e) {
follow.house_id = $(this).attr("data-id"); follow.house_id = $(this).attr("data-id");
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + follow.house_id); $('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + follow.house_id);
}); });
//搜索按钮点击事件
$("#search").click(function() { $("#search").click(function() {
follow.getList(1); follow.getList(1);
}); });
//收款图片按钮点击的事件
_doc.on('click', '.add-pic', function() {//区分收款记录的id 和 father-id 获取图片 和保存图片 都区分 _doc.on('click', '.add-pic', function() {//区分收款记录的id 和 father-id 获取图片 和保存图片 都区分
follow.house_id = $(this).attr("data-id"); var _this = $(this);
follow.house_fatherid = $(this).attr("father-id"); follow.house_id = _this.attr("data-id");
follow.getaddPicList(); follow.house_fatherid = _this.attr("father-id");
follow.getaddPicList();//获取已经上传的图片信息
}); });
//重置按钮的事件
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
}); });
//导出列表事件
$("#export").click(function() { //导出列表 $("#export").click(function() { //导出列表
follow.exportList(); follow.exportList();
}); });
//编辑按钮点击事件
$(document).delegate(".submit_edit2", "click", function() { //提交 $(document).delegate(".submit_edit2", "click", function() { //提交
follow.house_id2 = $(this).attr("data-id"); var _this = $(this);
follow.house_id2 = _this.attr("data-id");
console.log(follow.house_id2); console.log(follow.house_id2);
$("#real_money").val($(this).attr("data-money")); $("#real_money").val(_this.attr("data-money"));
}); });
$(document).delegate(".submit_edit", "click", function() { //提交
//编辑-收付金额-保存
$(document).delegate(".submit_edit", "click", function() {
follow.Submit_follow(); follow.Submit_follow();
}); });
$(document).on("input", "#cus_fang", function() { //手机号搜索客方2
if($("#cus_fang").val() == '') { //收款图片-点击添加图片事件
$(".user-ul2").html(''); $('#file_input').on('change', function(){
} else { var _this = $(this);
follow.search_phone2(); var formData = new FormData();
} formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': urlDeal(_data.data.internet_img_name)
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
}); });
$(document).delegate(".addphone2", "click", function() { //list2消失
follow.addphone2(this); //图片删除事件
_doc.on('click', '.span-del', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).parent().remove();
});
//图片删除,已有的则调用接口删除
_doc.on('click', '.span-del2', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
if(confirm('确认删除吗?')){
_this.parent().remove();
follow.spandelList(_this.prev().attr('data-imgid'));
};
}); });
//保存上传的图片 //保存上传的图片
_doc.on('click', '#saveBtn', function(e) { _doc.on('click', '#saveBtn', function(e) {
var _this = $(this); var _this = $(this);
...@@ -81,24 +124,19 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -81,24 +124,19 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
e.stopPropagation(); e.stopPropagation();
var imgname = []; var imgname = [];
for(var i = 0; i < $('.result').length; i++) { for(var i = 0; i < $('.result').length; i++) {
imgname[i] = $('.result>img').get(i).getAttribute("class"); imgname[i] = $('.result>img').attr('data-imgname');
} };
console.log(imgname.join(',')); console.log(imgname.join(','));
var id_pic; var id_pic = follow.house_fatherid > 0?follow.house_fatherid:follow.house_id;
if(follow.house_fatherid > 0) {
id_pic = follow.house_fatherid;
} else {
id_pic = follow.house_id;
}
var _data = { var _data = {
img_id: id_pic, img_id: id_pic
}; };
//无新的图片上传 不调用接口 //无新的图片上传 不调用接口
if(imgname.join(',')) { if(imgname.join(',')) {
_data['img_name'] = imgname.join(','); _data['img_name'] = imgname.join(',');
} else { } else {
return return
} };
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/addReceiptImg', url: '/index/addReceiptImg',
...@@ -107,6 +145,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -107,6 +145,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
beforeSend: function() {}, beforeSend: function() {},
success: function(_data) { success: function(_data) {
if(typeof _data === 'object') { if(typeof _data === 'object') {
alert('保存成功');
follow.getList(0); follow.getList(0);
} else { } else {
alert('数据错误'); alert('数据错误');
...@@ -124,38 +163,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -124,38 +163,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}); });
}); });
}, },
addphone2: function(obj) { //编辑-收付金额-保存
var user_ht = $(obj).html();
$("#cus_fang").val(user_ht);
$(".user-ul2").html('');
follow.agent_id = $(obj).attr("data-id");
},
search_phone2: function() { //手机号
$.ajax({
url: '/index/select_by_phone',
type: 'POST',
async: true,
data: {
"phone": $("#cus_fang").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i, item) {
user_ul2 += '<li class="addphone2" data-id="' + item.id + '">' + item.id + '-' + item.realname + '-' + item.phone + '</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
Submit_follow: function() { //提交 Submit_follow: function() { //提交
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
...@@ -172,7 +180,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -172,7 +180,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
} }
}); });
}, },
spandelList: function(n) { //删除已经保cun的时图片都调用 spandelList: function(n) { //删除已经保存的图片都调用
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url': '/index/deleteReceiptImg', 'url': '/index/deleteReceiptImg',
...@@ -188,13 +196,10 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -188,13 +196,10 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}); });
}, },
getaddPicList: function() { //获取收款图片 getaddPicList: function() {
var id_pic; //获取收款图片
if(follow.house_fatherid > 0) { $('#container_body_img_area').html('');//每回先清空所有图片
id_pic = follow.house_fatherid; var id_pic = follow.house_fatherid > 0?follow.house_fatherid:follow.house_id;
} else {
id_pic = follow.house_id;
}
$('.result2,.result').remove(); //删除之前存在的图片 显示从接口获取的数据 用来区分新添加的 和 已经保存的 $('.result2,.result').remove(); //删除之前存在的图片 显示从接口获取的数据 用来区分新添加的 和 已经保存的
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
...@@ -207,12 +212,11 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -207,12 +212,11 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
if(data.code == 200) { if(data.code == 200) {
//渲染已经有的列表 //渲染已经有的列表
for(i = 0; i < data.data.length; i++) { for(i = 0; i < data.data.length; i++) {
var result = '<div class="result2"><img class="' + data.data[i].id + '" src="' + data.data[i].img_name + '" alt=""/> <span class="span-del2">删除</span></div>'; $('#container_body_img_area').append('<div class="result2"><img data-imgid="{0}" src="{1}" alt=""/> <span class="span-del2">删除</span></div>'.stringFormatObj({
div = document.createElement('div'); '0': data.data[i].id,
div.innerHTML = result; '1': urlDeal(data.data[i].img_name)
document.getElementById('container_body').appendChild(div); }));
}  };
} else {} } else {}
} }
}); });
......
...@@ -159,4 +159,10 @@ function hideTel(str){ ...@@ -159,4 +159,10 @@ function hideTel(str){
}else{ }else{
return str; return str;
} }
}
//处理url信息,改为当前域名的协议
function urlDeal(urlStr, httpStr) {
//处理
return urlStr.replace(/(http|https):\/\//g, (httpStr ? (httpStr + ':') : location.protocol) + '//');
} }
\ No newline at end of file
...@@ -345,7 +345,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde ...@@ -345,7 +345,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
}); });
}, },
//点击编辑 调用的接口 //点击编辑 调用的接口
announcement_details: function() { //提交 announcement_details: function() {
var news_id = getUrlParam('id');//地址栏获取的商铺或者街铺id var news_id = getUrlParam('id');//地址栏获取的商铺或者街铺id
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
...@@ -360,18 +360,14 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde ...@@ -360,18 +360,14 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
//获取标签 id
$("#announcement_title").val(data.data.title); $("#announcement_title").val(data.data.title);
$("#district_id2").val(data.data.s_label_id*1);//商学院标签id $("#district_id2").val(data.data.s_label_id*1);//商学院标签id
// 获取封面图
var _data = data['data']; var _data = data['data'];
// 封面图一张
if(_data['cover_plan']){ if(_data['cover_plan']){
_imgUploadLiebiao.html('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({ _imgUploadLiebiao.html('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _data['cover_plan'] '0': _data['cover_plan']
})); }));
}; };
// 封面图一张
_dajiangtangObj.find('iframe').contents().find('body').html(_data['content']); //大讲堂 _dajiangtangObj.find('iframe').contents().find('body').html(_data['content']); //大讲堂
} else { } else {
} }
......
<script id="get_collection_tpl" type="text/template"> <script id="get_collection_tpl" type="text/template">
[% if(it) { %] [% if(it&&it.length!=0) { %]
[% for(var item in it){ %] [% for(var item in it){ %]
<tr class="text-center"> <tr class="text-center">
<td>[%= it[item]['create_time'] %]</td> <td>[%= it[item]['create_time'] %]</td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<td>[%= it[item]["comment_number"] %]</td> <td>[%= it[item]["comment_number"] %]</td>
<td> <td>
<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]["id"] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_blank"> <a class="btn1 btn-success" href="new_text.html?id=[%= it[item]["id"] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_self">
编辑 编辑
</a> </a>
[% if(check_auth('index/delNews')) { %] [% if(check_auth('index/delNews')) { %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment