Merge branch 'dev_addUrl' into grey
Showing
1 changed file
with
26 additions
and
1 deletions
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, |
@@ -19,7 +22,8 @@ var g = new common.grid({ | @@ -19,7 +22,8 @@ var g = new common.grid({ | ||
19 | return '<a id="detailPool" class="btn btn-xs btn-info" data-index="'+item.__index+'">详情</a>' + | 22 | return '<a id="detailPool" class="btn btn-xs btn-info" data-index="'+item.__index+'">详情</a>' + |
20 | '<a id="editPool" class="btn btn-xs btn-primary" data-index="'+item.__index+'">编辑</a>' + | 23 | '<a id="editPool" class="btn btn-xs btn-primary" data-index="'+item.__index+'">编辑</a>' + |
21 | '<a id="emptyPool" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空</a>' + | 24 | '<a id="emptyPool" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空</a>' + |
22 | - '<a id="deletePool" class="btn btn-xs btn-danger" data-index="'+item.__index+'">删除</a>'; | 25 | + '<a id="deletePool" class="btn btn-xs btn-danger" data-index="'+item.__index+'">删除</a>'+ |
26 | + '<a id="viewUrl" class="btn btn-xs btn-danger" data-index="'+item.__index+'">查看链接</a>'; | ||
23 | }} | 27 | }} |
24 | ] | 28 | ] |
25 | }); | 29 | }); |
@@ -190,6 +194,27 @@ $(document).on("click", "#deletePool", function () { | @@ -190,6 +194,27 @@ $(document).on("click", "#deletePool", function () { | ||
190 | Bll.deletePool(item); | 194 | Bll.deletePool(item); |
191 | }); | 195 | }); |
192 | 196 | ||
197 | + | ||
198 | +//查看链接 | ||
199 | +$(document).on("click", "#viewUrl", function () { | ||
200 | + var index = $(this).data("index"); | ||
201 | + var item = g.rows[index]; | ||
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>"+ | ||
207 | + "</table>"; | ||
208 | + common.dialog.confirm("商品池链接", html, function () { | ||
209 | + | ||
210 | + }); | ||
211 | + new ZeroClipboard($(".info-copy")); | ||
212 | +}); | ||
213 | + | ||
214 | +$(document).on('click', '.info-copy', function () { | ||
215 | + common.util.__tip("链接已复制好,可贴粘", "success") | ||
216 | +}); | ||
217 | + | ||
193 | //添加SKN到商品池 | 218 | //添加SKN到商品池 |
194 | $(document).on("click", "#addSknBtn", function () { | 219 | $(document).on("click", "#addSknBtn", function () { |
195 | if($('#addSknText').val().length > 0){ | 220 | if($('#addSknText').val().length > 0){ |
-
Please register or login to post a comment