Authored by OF1706

弹框

@@ -101,7 +101,7 @@ Cart = { @@ -101,7 +101,7 @@ Cart = {
101 var $this = $(this); 101 var $this = $(this);
102 var $item = $this.closest('li[data-role="pitem"]'); 102 var $item = $this.closest('li[data-role="pitem"]');
103 var selectArray = []; 103 var selectArray = [];
104 - var content = '<div><span></span>删除商品</div><p>确定从购物车中删除此商品?</p>'; 104 + var content = '<div><i class="iconfont">&#xe684;</i>删除商品</div><p>确定要从购物车中删除该商品?</p>';
105 var countJSON; 105 var countJSON;
106 106
107 selectArray.push({ 107 selectArray.push({
@@ -4,19 +4,30 @@ @@ -4,19 +4,30 @@
4 * @date: 2016/01/06 4 * @date: 2016/01/06
5 */ 5 */
6 var $ = require('yoho-jquery'), 6 var $ = require('yoho-jquery'),
7 - Dialog = require('../plugins/dialog').Dialog; 7 + Dialog = require('../common/dialog').Dialog;
  8 +
  9 +function createRDialog( ) {
  10 + return $('.r-dialog');
  11 +}
8 12
9 function RDialog(opts) { 13 function RDialog(opts) {
  14 + var that = this;
10 var option = $.extend(true, {}, { 15 var option = $.extend(true, {}, {
11 className: 'r-dialog', 16 className: 'r-dialog',
12 closeIcon: true 17 closeIcon: true
13 }, opts); 18 }, opts);
14 19
15 - option.closeIcon = '<span class="close">' + '<i class="iconfont">&#xe60d;</i>' + '</span>';  
16 option.content = '<div class="dialog-content">' + option.content + '</div>'; 20 option.content = '<div class="dialog-content">' + option.content + '</div>';
17 option.btns.name = ''; 21 option.btns.name = '';
18 22
  23 + that.$el = createRDialog(opts);
  24 + this.$el.css({
  25 + 'margin-top': -this.$el.height() / 2,
  26 + 'margin-left': -this.$el.width() / 2
  27 + });
  28 +
19 Dialog.call(this, option); 29 Dialog.call(this, option);
  30 +
20 } 31 }
21 32
22 RDialog.prototype = new Dialog({ 33 RDialog.prototype = new Dialog({
@@ -1394,8 +1394,11 @@ @@ -1394,8 +1394,11 @@
1394 } 1394 }
1395 } 1395 }
1396 } 1396 }
1397 -.r-dialog{ 1397 +.r-dialog.yoho-dialog{
1398 min-width: 420px; 1398 min-width: 420px;
  1399 + box-sizing: border-box;
  1400 +}
  1401 +.r-dialog{
1399 padding: 40px 20px; 1402 padding: 40px 20px;
1400 1403
1401 .close { 1404 .close {
@@ -1411,9 +1414,9 @@ @@ -1411,9 +1414,9 @@
1411 i { 1414 i {
1412 display: inline-block; 1415 display: inline-block;
1413 color: #d0021b; 1416 color: #d0021b;
1414 - font-size: 24px; 1417 + font-size: 26px;
1415 margin-right: 20px; 1418 margin-right: 20px;
1416 - vertical-align: middle; 1419 + vertical-align: baseline;
1417 } 1420 }
1418 h3 { 1421 h3 {
1419 margin-top: 35px; 1422 margin-top: 35px;