This commit is contained in:
devil_gong 2018-10-12 14:25:21 +08:00
parent 15c08953a0
commit bc18175ca7
13 changed files with 70 additions and 47 deletions

View File

@ -284,7 +284,7 @@ $(function()
<if condition="!empty($data['content_app'])">
<foreach name="data.content_app" item="v">
img_file_upload_show('.images-file-tag-{{$v.id}}');
ImageFileUploadShow('.images-file-tag-{{$v.id}}');
</foreach>
</if>
});

View File

@ -141,7 +141,7 @@
$.AMUI.progress.done();
Prompt(e.msg, 'success');
$('#data-list-'+e.data_id).remove();
$('.top-nav-cart-total').text(parseInt(e.data));
HomeCartNumberTotalUpdate(parseInt(e.data));
} else {
$('form.form-validation').find('button[type="submit"]').button('reset');
$.AMUI.progress.done();

View File

@ -66,7 +66,11 @@
<a id="mc-menu-hd" href="<if condition="empty($user)">javascript:;<else />{{:U('Home/Cart/Index')}}</if>" target="_top">
<i class="am-icon-shopping-cart am-icon-fw"></i>
<span>购物车</span>
<strong class="am-badge am-badge-danger am-round top-nav-cart-total">{{$common_cart_total}}</strong>
<if condition="$common_cart_total gt 0">
<strong class="am-badge am-badge-danger am-round common-cart-total">{{$common_cart_total}}</strong>
<else />
<strong class="common-cart-total am-round">{{$common_cart_total}}</strong>
</if>
</a>
</div>
</div>

View File

@ -8,7 +8,7 @@
<li <if condition="strtolower(CONTROLLER_NAME.ACTION_NAME) eq 'cartindex'">class="active"</if>>
<a <if condition="empty($user)">href="javascript:;" class="login-event"<else /> href="{{:U('Home/Cart/Index')}}"</if>><i class="am-icon-shopping-basket"></i>购物车</a>
<notempty name="common_cart_total">
<span class="am-badge am-badge-danger am-round top-nav-cart-total hot-icon">{{$common_cart_total}}</span>
<span class="am-badge am-badge-danger am-round common-cart-total hot-icon">{{$common_cart_total}}</span>
</notempty>
</li>
<li <if condition="strtolower(CONTROLLER_NAME.ACTION_NAME) eq 'userindex'">class="active"</if>>

View File

@ -63,6 +63,9 @@
</foreach>
</ul>
</notempty>
<empty name="user_address_list">
<div class="table-no"><i class="am-icon-warning"></i> {{:L('common_not_data_tips')}}</div>
</empty>
</div>
</div>
<!-- content end -->

View File

@ -136,7 +136,7 @@ $(function()
$content_tag.append(html);
$content_tag.attr('index', index);
$(this).attr('index', i+1);
img_file_upload_show('.images-file-tag-'+index);
ImageFileUploadShow('.images-file-tag-'+index);
});
// 手机详情删除

View File

@ -162,14 +162,14 @@ function IsExitsFunction(fun_name)
}
/**
* [Get_Tag_Value 根据tag对象获取值]
* [GetTagValue 根据tag对象获取值]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-10-07T20:53:40+0800
* @param {[object]} tag_obj [tag对象]
*/
function Get_Tag_Value(tag_obj)
function GetTagValue(tag_obj)
{
// 默认值
var v = null;
@ -246,8 +246,8 @@ function FromInit(form_name)
{
validity.valid = true;
} else {
var v1 = Get_Tag_Value($(validity.field));
var v2 = Get_Tag_Value($(tag));
var v1 = GetTagValue($(validity.field));
var v2 = GetTagValue($(tag));
validity.valid = (v1 == null && v2 == null) ? false : true;
}
}
@ -587,12 +587,12 @@ function Tree(id, url, level, is_add_node)
}
/**
* [img_file_upload_show 图片上传预览]
* [ImageFileUploadShow 图片上传预览]
* @param {[string]} class_name [class名称]
* @param {[string]} show_img [预览图片id或class]
* @param {[string]} default_images [默认图片]
*/
function img_file_upload_show(class_name, show_img, default_images)
function ImageFileUploadShow(class_name, show_img, default_images)
{
$(document).on("change", class_name, function(imgFile)
{
@ -988,7 +988,7 @@ $(function()
* @param {[string]} type [edit, add]
* @return {[object]} [处理后的数据]
*/
function fun_save_win_additional(data, type)
function FunSaveWinAdditional(data, type)
{
// 额外处理数据
if($('#tree').length > 0)
@ -1061,7 +1061,7 @@ $(function()
}
// 填充数据
var data = fun_save_win_additional($(this).data('json'), 'edit');
var data = FunSaveWinAdditional($(this).data('json'), 'edit');
// 开始填充数据
FormDataFill(data, '#'+tag);
@ -1077,7 +1077,7 @@ $(function()
$('#tree').on('click', '.tree-submit-add-node', function()
{
// 清空表单数据
tree_form_init();
TreeFormInit();
// 父节点赋值
var id = parseInt($(this).data('id')) || 0;
@ -1129,7 +1129,7 @@ $(function()
*/
$('.tree-submit-add').on('click', function()
{
tree_form_init();
TreeFormInit();
});
/**
@ -1140,7 +1140,7 @@ $(function()
* @date 2018-08-06
* @desc description
*/
function tree_form_init()
function TreeFormInit()
{
// 更改窗口名称
$title = $('#data-save-win').find('.am-popup-title');
@ -1150,7 +1150,7 @@ $(function()
var data = {"id":"", "pid":0, "name":"", "sort":0, "is_enable":1, "icon":""};
// 额外处理数据
data = fun_save_win_additional(data, 'init');
data = FunSaveWinAdditional(data, 'init');
// 清空表单
FormDataFill(data);
@ -1366,7 +1366,7 @@ $(function()
// 图片预览
if($('.images-file-event').length > 0)
{
img_file_upload_show('.images-file-event');
ImageFileUploadShow('.images-file-event');
}
// 图片组合input清除按钮
@ -1436,12 +1436,12 @@ $(function()
$(this).parent().removeClass('plug-images-add-tag');
// 继续添加
plug_images_list_add('add');
PlugImagesListAdd('add');
}
});
// 多图片上传 - 继续添加
function plug_images_list_add(event)
function PlugImagesListAdd(event)
{
var max = $plug_images_list.data('max-count') || 0;
var count = $plug_images_list.find('li').length;
@ -1469,7 +1469,7 @@ $(function()
// 初始化
if($plug_images_list.length > 0)
{
plug_images_list_add('init');
PlugImagesListAdd('init');
}
// 多图片上传 - 点击事件禁止
@ -1482,7 +1482,7 @@ $(function()
$(document).on('click', '.plug-images-delete-submit', function()
{
$(this).parent().parent().parent().remove();
plug_images_list_add('del');
PlugImagesListAdd('del');
});
/* 搜索切换 */

View File

@ -1,11 +1,3 @@
@charset "utf-8";
/* CSS Document */
*, *:after, *:before{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box; }
/*任何标签、包括它前面、后面生成的内容都不要影响盒子的边框*/
ul, li, ol {list-style: none;}
dl,dt,dd{ margin:0px auto; padding:0px;}
[class*="am-u-"] {padding-left:0rem;padding-right:0rem;}
@ -23,7 +15,6 @@ img{ width:100%;}
/* select */
.sort-nav{padding:0px;font-size:12px}
.suggest{ display:none;}
.select li { margin: 5px 0px; }
.select dl{zoom:1;position:relative;line-height:24px; }
@ -48,7 +39,7 @@ li.select-result dt {left:-26px; top:0;font-weight:bold;width:50px;}
/*排序*/
.sort-nav { width:100%; background: #fff; overflow: hidden; height: 30px; }
.sort-nav li{ float:left;width:33.33%;height:30px; line-height:30px; text-align:center; padding:0px 0px;cursor: pointer;}
.sort-nav li a{font-size:14px;}
.sort-nav li a{font-size:14px; text-decoration: none;}
.sort-nav li.first {color: #F03726;}
@ -77,7 +68,6 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
.search-pages-submit { margin: 10px 0; }
@media only screen and (min-width: 640px) {
/* select */
.theme-popover { padding: 0 5px; }
@ -91,13 +81,10 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
.select li{list-style:none;padding:0px 0px 0px 100px;border-top:#eee 1px dashed;float: none;display: block;height: auto;}
.select-result dl dt{width:100px;}
.screening-remove-submit{width:80px;float:right;margin-right:20px;}
.search-content .am-badge{font-size:14px ;padding:0px 0px;background: none; }
/*排序*/
.sort-nav{padding:0px 0px;margin:10px 5px; font-size: 12px;width:auto;overflow: hidden;}
.sort-nav li{ display:inline; padding:0px 20px;width:auto;border-right:1px solid #eee;}
@ -115,13 +102,11 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
/*搜索结果*/
li.select-result dl {padding: 10px 0px 0px 0px;}
.scoll{ margin-top:70px;}
.am-slider-default .am-direction-nav a {z-index:0;}
span.am-icon-th-list{color:orangered;margin-right:1px ;}
/*改写的布局*/
.flood li{width:33.3%;float: left; text-align: center;}
.smallnav img{max-width:60px;}
@ -149,7 +134,7 @@ dl#select3 .dd-conent{ left:-200%; right:0px;}
.data-list li:nth-child(2n) .i-pic.limit { margin-right: 0px; }
.data-list li:nth-child(2n+1) .i-pic.limit { margin-left: 0px; }
.screening-remove-submit { margin-top: -28px; }
.select .title-tips { padding: 0 5px; }
.select .title-tips { padding: 5px 5px 0 5px; }
.sort-nav li { border-bottom: 1px solid #eee; }
.select-list .dd-conent { overflow-y: scroll;overflow-x: hidden; }
}

View File

@ -3,7 +3,6 @@
*/
ul.address-list {
overflow: hidden;
margin-top: 10px;
}
ul.address-list li.address-default {
@ -40,6 +39,12 @@ ul.address-list li:nth-child(2n) {
margin-right: 0;
}
@media only screen and (min-width: 641px) {
ul.address-list {
margin-top: 10px;
}
}
@media only screen and (min-width: 1025px) {
ul.address-list li {
width: calc(25% - 8px);
@ -53,6 +58,19 @@ ul.address-list li:nth-child(2n) {
}
}
@media only screen and (max-width: 641px) {
.control .address-submit-save {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 2;
}
.am-footer {
padding-bottom: 30px;
}
}
/**
* 地址添加/编辑

View File

@ -1,8 +1,5 @@
var store = $.AMUI.store;
if(!store.enabled)
if(store.enabled)
{
alert('Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.');
} else {
// 选择缓存key
var store_address_key = 'store-buy-address-selected-index';
var store_use_new_address_status_key = 'store-buy-use-new-address-status-count';

View File

@ -49,8 +49,7 @@ $(function()
stock = 1;
}
self.parents('.stock-tag').find('input').val(stock);
var temp_price = FomatFloat(stock*price, 2);
self.parents('tr').find('.total-price-content').text('¥'+temp_price);
self.parents('tr').find('.total-price-content').text('¥'+FomatFloat(stock*price, 2));
// 开启进度条
$.AMUI.progress.start();
@ -69,6 +68,9 @@ $(function()
{
PromptCenter(result.msg, 'success');
// 数量更新
self.parents('tr').find('.wap-number').text('x'+stock);
// 计算选择的商品总数和总价
cart_base_total();
} else {

View File

@ -11,6 +11,20 @@ if(!store.enabled)
var store_user_menu_key = 'store-user-menu-active-key';
}
// 购物车数量更新
function HomeCartNumberTotalUpdate(number)
{
var $this = $('.common-cart-total');
if(number <= 0)
{
$this.text('');
$this.removeClass('am-badge am-badge-danger');
} else {
$this.text(number);
$this.addClass('am-badge am-badge-danger');
}
}
$(function()
{
// 选中处理

View File

@ -98,7 +98,7 @@ function CartAdd(e)
if(result.code == 0)
{
$('.top-nav-cart-total').text(parseInt(result.data));
HomeCartNumberTotalUpdate(parseInt(result.data));
PromptCenter(result.msg, 'success');
} else {
PromptCenter(result.msg);