Authored by ZhongW

商品池添加链接优化

1 var $ = require('jquery'), 1 var $ = require('jquery'),
2 common = require('../../../common/common'); 2 common = require('../../../common/common');
3 3
  4 + var ZeroClipboard = require("../../../common/util/ZeroClipboard.min");
  5 + ZeroClipboard.config({swfPath: "http://cdn.yoho.cn/yohobuy-portal/assets/images/ZeroClipboard.swf"});
  6 +
4 var g = new common.grid({ 7 var g = new common.grid({
5 el: "#product-pool", 8 el: "#product-pool",
6 hash: false, 9 hash: false,
@@ -196,16 +199,20 @@ $(document).on("click", "#deletePool", function () { @@ -196,16 +199,20 @@ $(document).on("click", "#deletePool", function () {
196 $(document).on("click", "#viewUrl", function () { 199 $(document).on("click", "#viewUrl", function () {
197 var index = $(this).data("index"); 200 var index = $(this).data("index");
198 var item = g.rows[index]; 201 var item = g.rows[index];
199 - var html = "<table>"+  
200 - "<tr><td>【PC】</td><td>http://search.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"</td></tr>"+ 202 + var html = "<div class=\"alert alert-success\">点击链接名称可复制链接</div>"+
  203 + "<table class=\"table table-hover\">"+
  204 + "<tr><td><a class=\"btn btn-xs btn-success info-copy\" data-clipboard-text='http://search.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"' >【PC】</a></td><td style=\"padding-top:15px \">http://search.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"</td></tr>"+
  205 + "<tr><td><a class=\"btn btn-xs btn-success info-copy\" data-clipboard-text='http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"'>【H5】</a></td><td style=\"padding-top:15px \">http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"</td></tr>"+
  206 + "<tr><td><a class=\"btn btn-xs btn-success info-copy\" data-clipboard-text='http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"&openby:yohobuy={\"params\":{\"title\":"+item.poolName+",\"productPool\":"+item.id+"}}'>【APP】</a></td><td >http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"&openby:yohobuy={\"params\":{\"title\":"+item.poolName+",\"productPool\":"+item.id+"}}"+"</td></tr>"+
201 "</table>"; 207 "</table>";
202 -  
203 - /* var html = "<font color='red'>【PC】</font><br>http://search.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"<br>";  
204 - html += "<font color='red'>【H5】</font><br>http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"<br>";  
205 - html += "<font color='red'>【APP】</font><br>http://search.m.yohobuy.com/?filter_poolId="+item.id+"&title="+item.poolName+"&openby:yohobuy={\"params\":{\"shop_id\":\"1284\",\"title\":\"上衣\",\"productPool\":\"2522\"}}";*/  
206 - common.dialog.confirm("查看商品池链接", html, function () { 208 + common.dialog.confirm("商品池链接", html, function () {
207 209
208 }); 210 });
  211 + new ZeroClipboard($(".info-copy"));
  212 +});
  213 +
  214 +$(document).on('click', '.info-copy', function () {
  215 + common.util.__tip("链接已复制好,可贴粘", "success")
209 }); 216 });
210 217
211 //添加SKN到商品池 218 //添加SKN到商品池