Authored by 陶雨

Merge branch 'release/qqtest' of http://git.dev.yoho.cn/platform/yohobuy-portal-…

…fe into release/qqtest
@@ -176,32 +176,38 @@ $(document).on('click', 'input[name="brandType"]', function () { @@ -176,32 +176,38 @@ $(document).on('click', 'input[name="brandType"]', function () {
176 176
177 function plusStarOP(prefix, url, item) { 177 function plusStarOP(prefix, url, item) {
178 178
179 -  
180 -  
181 var a = new common.edit('#templete-top'); 179 var a = new common.edit('#templete-top');
182 common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () { 180 common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () {
183 181
184 - return a.submit(url,function(option){  
185 - //设置图片  
186 - if(imgArr.length) {  
187 - option.data.activityImg = imgArr.toString();  
188 - }  
189 - imgArr = [];  
190 - option.success=function(res){  
191 - res=res.data;  
192 - if(res.code=="200"){  
193 - a.$tip("提交成功", function() {  
194 - g.reload();  
195 - }, 'growl-success');  
196 - }else{ 182 + console.log('type' + $('#brandType').val());
  183 + var type = $('#brandType').val();
  184 + if(type) {
  185 + return a.submit(url,function(option){
  186 + //设置图片
  187 + if(imgArr.length) {
  188 + option.data.activityImg = imgArr.toString();
  189 + }
  190 + imgArr = [];
  191 + option.success=function(res){
  192 + res=res.data;
  193 + if(res.code=="200"){
  194 + a.$tip("提交成功", function() {
  195 + g.reload();
  196 + }, 'growl-success');
  197 + }else{
  198 + a.$tip(res.message);
  199 + }
  200 + return false;
  201 + };
  202 + option.error=function(res){
197 a.$tip(res.message); 203 a.$tip(res.message);
198 } 204 }
199 - return false;  
200 - },  
201 - option.error=function(res){  
202 - a.$tip(res.message);  
203 - }  
204 - }); 205 + });
  206 + } else {
  207 + a.$tip('类型不能为空');
  208 + return;
  209 + }
  210 +
205 211
206 }); 212 });
207 213
  1 +/**
  2 + * Created by wangqianjun on 16/5/16.
  3 + * 静态文件管理
  4 + */
  5 +
  6 +var $ = require('jquery');
  7 +common = require('../common/common');
  8 +datepicker = require('../util/datepicker');
  9 +
  10 +require('../common/umeditor.config');
  11 +require('../common/umeditor');
  12 +require('../common/zh-cn');
  13 +
  14 +var baidu;
  15 +
  16 +var ENUM = {
  17 + AuditEnum: {
  18 + '0': '待审核',
  19 + '1': '审核通过',
  20 + '2': '审核失败',
  21 + },
  22 +
  23 + RecommendEnum: {
  24 + true: '已推荐',
  25 + false: '未推荐'
  26 + },
  27 +
  28 + RewardEnum: {
  29 + false: '未发送奖励',
  30 + true: '奖励已发放'
  31 + }
  32 +};
  33 +
  34 +
  35 +var g = new common.grid({
  36 + el: '#basicTable',
  37 + size: 10,
  38 + parms: function () {
  39 +
  40 + return {
  41 + status: $('#status').val(),
  42 + recomReward: $('#recomReward').val(),
  43 + hasImage: $('#hasImage').val(),
  44 + beginTime: common.util.__input('beginTime'),
  45 + endTime: common.util.__input('endTime'),
  46 + uid: common.util.__input('uid'),
  47 + productName: common.util.__input('productName'),
  48 + productSkn: common.util.__input('productSkn'),
  49 + orderCode: common.util.__input('orderCode')
  50 + };
  51 + },
  52 + columns: [{
  53 + display: '订单号',
  54 + name: "orderId"
  55 + }, {
  56 + display: '商品名称',
  57 + render: function (item) {
  58 + var goods = item.goods;
  59 + if (goods != null) {
  60 + productHref = "http://item.yohobuy.com/product/pro_" + item.productId + "_" + goods.goodsId + "/" + goods.cnAlphabet + ".html";
  61 + }
  62 + return '<a href="' + item.productHref + '">' + item.productName + '</a>'
  63 + }
  64 + }, {
  65 + display: '用户id',
  66 + name: "uid"
  67 + }, {
  68 + display: '商品图片',
  69 + render: function (item) {
  70 + var goods = item.goods;
  71 + var goodImgUrl = "";
  72 + if (goods != null && goods.goodsImg != null && goods.goodsImg.length > 0) {
  73 + goodImgUrl = goods.goodsImg[0].imageUrl;
  74 + }
  75 +
  76 + return '<img src="' + goodImgUrl + '" width="100" height="60"/>'
  77 +
  78 + }
  79 + }, {
  80 + display: "评价图片",
  81 + render: function (item) {
  82 +
  83 + //item.url = common.util.__template(item.url,{mode:2,width:100,height:100});
  84 + return '<img src="' + item.url + '" width="100" height="60"/>'
  85 + }
  86 + }, {
  87 + display: '评价内容',
  88 + name: "content",
  89 + //width:'15%',
  90 + style: "width:15%; word-break:break-all;"
  91 + }
  92 + , {
  93 + display: '评价星级',
  94 + name: "satisfied"
  95 + }, {
  96 + display: '审核状态',
  97 + render: function (item) {
  98 + return "<p>" + ENUM.AuditEnum[item.status] + "</p>";
  99 + }
  100 + },
  101 + {
  102 + display: '审核返币',
  103 + render: function (item) {
  104 + return "<p>" + ENUM.RewardEnum[item.shareReward] + "</p>";
  105 + }
  106 + },
  107 + {
  108 + display: '推荐状态',
  109 + render: function (item) {
  110 + return "<p>" + ENUM.RecommendEnum[item.recomReward] + "</p>";
  111 + }
  112 + }, {
  113 + display: "创建时间",
  114 +
  115 + render: function (item) {
  116 + var t = new Date(item.createTime * 1000);
  117 + var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
  118 + return "<p>" + formatted + "</p>";
  119 + }
  120 + }, {
  121 + display: '备注',
  122 + name: "remark"
  123 + }, {
  124 + display: '操作',
  125 + //}
  126 + render: function (items) {
  127 + var HtmArr = [];
  128 +
  129 + HtmArr.push('<a data-index="' + items.__index + '" style="margin-bottom:10px;" href="JavaScript:;" class="btn btn-info btn-xs info-modify">编辑</a>');
  130 + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
  131 +
  132 + return HtmArr.join('');
  133 + }
  134 + }
  135 + ]
  136 +});
  137 +g.init('/shareOrder/shareOrderList');
  138 +
  139 +
  140 +//添加
  141 +$(document).on('click', '#add', function () {
  142 + staticFileOP("新增", '', {});
  143 +
  144 +});
  145 +
  146 +//删除
  147 +$(document).on('click', '.info-del', function () {
  148 + var item = g.rows[$(this).data("index")];
  149 +
  150 + common.dialog.confirm("温馨提示", "确定要删除吗?", function () {
  151 + common.util.__ajax({
  152 + url: '',
  153 + data: {
  154 + uid: item.uid,
  155 + }
  156 + }, function (res) {
  157 + if (res.code == 200) {
  158 + g.reload();
  159 + } else {
  160 + common.util.__tip(res.message);
  161 + }
  162 + });
  163 + });
  164 +});
  165 +
  166 +$(document).on('click', '#filter', function () {
  167 + g.reload();
  168 +});
  169 +
  170 +
  171 +$(document).on('click', '#add', function () {
  172 + g.reload();
  173 +});
  174 +
  175 +//编辑
  176 +$(document).on('click', '.info-modify', function () {
  177 + var item = g.rows[$(this).data("index")];
  178 + staticFileOP("编辑", '/guang/relationship/updateRel', item);
  179 +});
  180 +
  181 +function staticFileOP(prefix, url, item) {
  182 +
  183 + var a = new common.edit(".confirm", {
  184 + //"bucket" : "author"
  185 + });
  186 +
  187 + //下拉框
  188 + new common.dropDown({
  189 + el: "#type"
  190 + });
  191 +
  192 + var dialog = new common.dialog({
  193 + title: prefix + '静态文件',
  194 + content: common.util.__template2($("#template").html(), item),
  195 + button: [{
  196 + value: '提交',
  197 + callback: function () {
  198 + a.submit(url, function (option) {
  199 + //option.data.
  200 +
  201 + option.success = function (res) {
  202 + res = res.data;
  203 + if (res.code == 200) {
  204 + a.$tip('提交成功', function () {
  205 + g.reload();
  206 + })
  207 + } else {
  208 + a.$tip(res.message);
  209 + }
  210 + }
  211 + });
  212 +
  213 + return false;
  214 + }
  215 + }]
  216 +
  217 + });
  218 +
  219 + baidu && baidu.destroy();
  220 + baidu = UM.getEditor('baidueditor');
  221 + //baidu.setContent(module.contentData.data.text);
  222 +
  223 + a.init();
  224 +}
  1 +/**
  2 + * Created by wangqianjun on 16/5/16.
  3 + */
  4 +exports.domain = require('../config/common.js').domain;
  5 +
  6 +exports.res = [
  7 + {//逛-> 资讯管理 空白页
  8 + route: '/operations/staticFileManager/index',
  9 + method: 'GET',
  10 + view: 'pages/operations/staticFileManager',
  11 + src: '/operations/staticFileManager',
  12 + data: {
  13 + iscreate: true
  14 + }
  15 + }
  16 +];
  17 +
  18 +
  1 +<div class="pageheader">
  2 + <div class="media">
  3 + <div class="pageicon pull-left">
  4 + <i class="fa fa-th-list"></i>
  5 + </div>
  6 + <div class="media-body">
  7 + <ul class="breadcrumb">
  8 + <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
  9 + <li><a href="">运营管理</a></li>
  10 + <li>静态文件管理</li>
  11 + </ul>
  12 +
  13 + <div>
  14 + <div style="width: 30%;float: left;">
  15 + <h4>静态文件管理</h4>
  16 + </div>
  17 + </div>
  18 + </div>
  19 + </div>
  20 +</div>
  21 +
  22 +
  23 +<div class="contentpanel">
  24 + <div class="panel panel-default" style="margin-bottom:10px;">
  25 + <div class="panel-body">
  26 + <div class="form-inline">
  27 +
  28 + <div class="form-group">
  29 + <select id="sel-type" class="form-control" style="width:120px">
  30 + <option value="">选择类型</option>
  31 + <option value="0">专题</option>
  32 + <option value="1">有图</option>
  33 + </select>
  34 + </div>
  35 +
  36 + <div class="form-group">
  37 + <input type="text" id="beginTime" class="form-control panel-input hasDatepicker" name="start_time"
  38 + placeholder="开始时间" value="" kl_vkbd_parsed="true">
  39 + </div>
  40 +
  41 + <div class="form-group">
  42 + <input type="text" id="endTime" class="form-control panel-input hasDatepicker" name="end_time"
  43 + placeholder="结束时间" value="" kl_vkbd_parsed="true">
  44 + </div>
  45 +
  46 + <button type="submit" id="filter" class="btn btn-info">查询</button>
  47 + <button type="submit" id="all" class="btn btn-info">全部</button>
  48 + <button type="submit" id="add" class="btn btn-info">新增</button>
  49 + </div>
  50 +
  51 +
  52 + </div>
  53 + </div>
  54 + <div class="panel panel-primary-head">
  55 + <div id="basicTable_wrapper" class="dataTables_wrapper no-footer">
  56 + <div class="dataTables_length" id="basicTable">
  57 + </div>
  58 + <nav>
  59 + <ul id="pagination" class="pagination pagination-lg"></ul>
  60 + </nav>
  61 + </div>
  62 + </div>
  63 +</div>
  64 +
  65 +<script type="text/template" id="template">
  66 +
  67 + <div class="form-group">
  68 + <label for="type" class="col-sm-2 control-label">静态文件类型:</label>
  69 +
  70 + <div class="col-sm-8">
  71 + <select class="form-control" value="[[adsImgSize]]" id="type">
  72 + <option value="">选择类型</option>
  73 + <option value="10881088">1088X1088</option>
  74 + <option value="1088680">1088X680</option>
  75 + <option value="1088340">1088X340</option>
  76 + </select>
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="form-group">
  81 + <label for="authorDesc" class="col-sm-2 control-label">页面标题:</label>
  82 + <div class="col-sm-10">
  83 + <input type="text" value="[[authorDesc]]" name="content" id="authorDesc" placeholder="页面标题" required="required" class="form-control">
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group">
  88 + <label for="authorDesc" class="col-sm-2 control-label">页面关键词:</label>
  89 + <div class="col-sm-10">
  90 + <input type="text" value="[[authorDesc]]" name="content" id="authorDesc" placeholder="页面关键词" required="required" class="form-control">
  91 + </div>
  92 + </div>
  93 +
  94 + <div class="form-group">
  95 + <label for="authorDesc" class="col-sm-2 control-label">页面介绍:</label>
  96 + <div class="col-sm-10">
  97 + <input type="text" value="[[authorDesc]]" name="content" id="authorDesc" placeholder="页面介绍" required="required" class="form-control">
  98 + </div>
  99 + </div>
  100 +
  101 + <div class="rows">
  102 + <label for="baidueditor" class="col-sm-2 control-label">内容:</label>
  103 + <script id="baidueditor" style="width: 100%;" name="content" type="text/plain"></script>
  104 + </div>
  105 +
  106 +
  107 +</script>
  108 +
  109 +