Merge branch 'dev_vedio' into test5.9
Showing
4 changed files
with
69 additions
and
5 deletions
@@ -46,6 +46,7 @@ | @@ -46,6 +46,7 @@ | ||
46 | <script type="text/template" id="fenmianTemp"> | 46 | <script type="text/template" id="fenmianTemp"> |
47 | [[each goodsList as item index]] | 47 | [[each goodsList as item index]] |
48 | <div class="form-group"> | 48 | <div class="form-group"> |
49 | + <div class="cover-color" style="text-align: left; margin-left: 10px">颜色封面:</div> | ||
49 | <div class="fm-side col-sm-2"> | 50 | <div class="fm-side col-sm-2"> |
50 | <div class="goods-img-left"> | 51 | <div class="goods-img-left"> |
51 | <p>SKC: [[item.productSkc]]</p> | 52 | <p>SKC: [[item.productSkc]]</p> |
@@ -60,9 +61,7 @@ | @@ -60,9 +61,7 @@ | ||
60 | [[if index2%2==1]] </td></tr><tr><td>[[/if]] | 61 | [[if index2%2==1]] </td></tr><tr><td>[[/if]] |
61 | [[/each]]</td> | 62 | [[/each]]</td> |
62 | </tr></table> | 63 | </tr></table> |
63 | - | ||
64 | </div> | 64 | </div> |
65 | - <div class="cover-color">颜色封面:</div> | ||
66 | </div> | 65 | </div> |
67 | <ul class="cover-image-list col-sm-10 image_index_class" style="padding: 0;margin: 0;" data-index=[[index]]> | 66 | <ul class="cover-image-list col-sm-10 image_index_class" style="padding: 0;margin: 0;" data-index=[[index]]> |
68 | [[each item.goodsImagesList as _item _index]] | 67 | [[each item.goodsImagesList as _item _index]] |
@@ -71,7 +70,7 @@ | @@ -71,7 +70,7 @@ | ||
71 | <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[_item.imageUrl]]"></a> | 70 | <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[_item.imageUrl]]"></a> |
72 | <i class="remove-item-btn glyphicon glyphicon-remove-circle"></i> | 71 | <i class="remove-item-btn glyphicon glyphicon-remove-circle"></i> |
73 | </div> | 72 | </div> |
74 | - <div class="cover-color"> | 73 | + <div class="cover-color" style="line-height: 26px; height: 52px;"> |
75 | [[if _item.isDefault=="Y"]] | 74 | [[if _item.isDefault=="Y"]] |
76 | <a href="javascript:;" class="btn btn-default btn-metro info" data-i="0">默认</a> | 75 | <a href="javascript:;" class="btn btn-default btn-metro info" data-i="0">默认</a> |
77 | [[else]] | 76 | [[else]] |
@@ -92,6 +91,11 @@ | @@ -92,6 +91,11 @@ | ||
92 | [[else]] | 91 | [[else]] |
93 | <a href="javascript:;" class="btn btn-default btn-metro" data-i="2">女封</a> | 92 | <a href="javascript:;" class="btn btn-default btn-metro" data-i="2">女封</a> |
94 | [[/if]] | 93 | [[/if]] |
94 | + [[/if]] | ||
95 | + [[if _item.vedioUrlId && _item.vedioUrlId != ""]] | ||
96 | + <a href="javascript:;" class="btn-use-vedio btn btn-default info" data-index="[[_index]]" data-skcIndex="[[index]]" data-productSkc="[[item.productSkc]]" data-vedioId="[[_item.vedioUrlId]]">调用视频</a> | ||
97 | + [[else]] | ||
98 | + <a href="javascript:;" class="btn-use-vedio btn btn-default " data-index="[[_index]]" data-skcIndex="[[index]]" data-productSkc="[[item.productSkc]]">调用视频</a> | ||
95 | [[/if]] | 99 | [[/if]] |
96 | </div> | 100 | </div> |
97 | </li> | 101 | </li> |
@@ -44,7 +44,7 @@ var Iaccount = { | @@ -44,7 +44,7 @@ var Iaccount = { | ||
44 | var apiCofig = { | 44 | var apiCofig = { |
45 | //root:__dirname, | 45 | //root:__dirname, |
46 | EnvConst:{ | 46 | EnvConst:{ |
47 | - domain:"http://192.168.102.48:8088/platform", | 47 | + domain:"http://192.168.102.210:8088/platform", |
48 | //domain:"http://127.0.0.1:8088/platform", | 48 | //domain:"http://127.0.0.1:8088/platform", |
49 | // domain:"http://172.16.6.200:8088/platform", | 49 | // domain:"http://172.16.6.200:8088/platform", |
50 | //domain:"http://192.168.102.202:8088/platform", | 50 | //domain:"http://192.168.102.202:8088/platform", |
@@ -366,7 +366,7 @@ var g = new common.grid({ | @@ -366,7 +366,7 @@ var g = new common.grid({ | ||
366 | 366 | ||
367 | 367 | ||
368 | //html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn" id="btn-item-info">查看</a>'); | 368 | //html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn btn-info btn-xs edit-class-btn" id="btn-item-info">查看</a>'); |
369 | - html.push('<a href="/goods/audit/info/' + item.productSkn + '" class="btn btn-info btn-xs info-btn">查看</a>'); | 369 | + html.push('<a target="_black" href="/goods/audit/info/' + item.productSkn + '" class="btn btn-info btn-xs info-btn">查看</a>'); |
370 | 370 | ||
371 | //if (item.status == 3 || item.status == 6) { // 驳回 | 371 | //if (item.status == 3 || item.status == 6) { // 驳回 |
372 | // html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass">通过</a>'); | 372 | // html.push('<a data-index="'+ item.__index+ '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn" id="btn-item-pass">通过</a>'); |
@@ -623,3 +623,63 @@ function sknDefaultImgFileupload() { | @@ -623,3 +623,63 @@ function sknDefaultImgFileupload() { | ||
623 | } | 623 | } |
624 | }); | 624 | }); |
625 | } | 625 | } |
626 | + | ||
627 | +//封面视频调用弹出 | ||
628 | +var uesVedioDialog = null, uesVedioIndex=0; | ||
629 | +$(document).on('click', '.btn-use-vedio', function() { | ||
630 | + var productSkc = $(this).attr('data-productSkc'); // 当前点击的图片的skc信息 | ||
631 | + var skcIndex = $(this).attr('data-skcIndex'); | ||
632 | + var uesVedioIndex = $(this).data("index"); // 当前点击图片在当前skc中的序号 | ||
633 | + var selectVedioId = $(this).attr("data-vedioId"); // 当前图片已经选择的视频id 没选择则为null | ||
634 | + common.util.__ajax({ | ||
635 | + url: '/productVideo/queryProductVideoList', | ||
636 | + data: { | ||
637 | + skn: NETSALEDATA.baseProductInfo.baseProduct.productSkn | ||
638 | + } | ||
639 | + }, function(res) { | ||
640 | + var data = res.data; | ||
641 | + var imgHtml = ''; | ||
642 | + if (res.code == 200 && data instanceof Array && data.length > 0) { | ||
643 | + var vedioHtml = "<table><tr>"; | ||
644 | + $.each(data, function(i, vedioItem) { | ||
645 | + var select_img_class = ""; | ||
646 | + if (selectVedioId && selectVedioId == vedioItem.id) { | ||
647 | + select_img_class = " select_img"; | ||
648 | + } | ||
649 | + vedioHtml += '<td><div style="height:123px; width:125px;margin:5px;text-align: center;line-height:20px" ><a style="display:inline-block" class="vedio_a'+ select_img_class + '"><img class="use-vedio"' | ||
650 | + + ' src="http://admin.portal.yohobuy.com/static/assets/images/defaultvideo.png' | ||
651 | + + '" alt="" data-vedioid="' + vedioItem.id + '" data-index="' + i + '" style="cursor:pointer;" /></a><span style="display:inline;height:100%;line-height:0px">' + vedioItem.videoName + "-" | ||
652 | + + vedioItem.id +'</span></div></td>'; | ||
653 | + }) | ||
654 | + | ||
655 | + vedioHtml += "</tr></table></div>"; | ||
656 | + imgHtml += vedioHtml; | ||
657 | + | ||
658 | + uesVedioDialog = common.dialog.confirm("调用视频", imgHtml, function(){ // 确认事件触发 | ||
659 | + var newSelectVedioId = $(".vedio_a.select_img").find('img').attr('data-vedioid'); // 重新选择的视频id 如果无值则代表需要清除当前封面的视频 | ||
660 | + if (newSelectVedioId) { | ||
661 | + $('a[data-index='+ uesVedioIndex +'][data-productSkc='+ productSkc +']').attr('data-vedioId', newSelectVedioId).addClass('info'); | ||
662 | + } else { | ||
663 | + $('a[data-index='+ uesVedioIndex +'][data-productSkc='+ productSkc +']').attr('data-vedioId', '').removeClass('info'); | ||
664 | + } | ||
665 | + resetVedioId(skcIndex, uesVedioIndex, newSelectVedioId); | ||
666 | + },function(){ // 取消的事件触发 | ||
667 | + | ||
668 | + }); | ||
669 | + } else { | ||
670 | + common.util.__tip('没有可调用的视频', 'warning'); | ||
671 | + } | ||
672 | + }, true); | ||
673 | +}); | ||
674 | + | ||
675 | +$(document).on('click', '.use-vedio', function(event) { //点击调用的视频列表 | ||
676 | + var index=$(this).data("index"); | ||
677 | + $(".vedio_a").not($(this).parent("a")).removeClass("select_img"); | ||
678 | + $(this).parent("a").toggleClass("select_img"); | ||
679 | +}); | ||
680 | + | ||
681 | +function resetVedioId(skcIndex, uesVedioIndex, newSelectVedioId) { //设置视频Id到内存中goodList中 | ||
682 | + var item = goodsList[skcIndex].goodsImagesList[uesVedioIndex]; | ||
683 | + item.vedioUrlId = newSelectVedioId; | ||
684 | + renderGoodList(); | ||
685 | +}; |
-
Please register or login to post a comment