diff --git a/application/service/IntegralService.php b/application/service/IntegralService.php index e153bb91f6459735ecc31895fe9876b15dc17636..f45fbee7f1f0b96a712355032523f07411882333 100755 --- a/application/service/IntegralService.php +++ b/application/service/IntegralService.php @@ -12,6 +12,7 @@ namespace app\service; use think\Db; use app\service\MessageService; +use app\service\UserService; /** * 积分服务层 @@ -53,6 +54,13 @@ class IntegralService $integral = ($data['type'] == 0) ? $data['original_integral']-$data['new_integral'] : $data['new_integral']-$data['original_integral']; $detail = $msg.'积分'.$type_msg.$integral; MessageService::MessageAdd($user_id, '积分变动', $detail); + + // 用户登录数据更新防止数据存储session不同步展示 + if(in_array(APPLICATION_CLIENT_TYPE, ['pc', 'h5'])) + { + UserService::UserLoginRecord($user_id); + } + return true; } return false; diff --git a/public/appmini/old/weixin/pages/buy/buy.wxml b/public/appmini/old/weixin/pages/buy/buy.wxml index 5e0fa32b431394384439de983ece48bc4c13efb1..c168e701d6129042a871f8a1d2cf1208921af783 100755 --- a/public/appmini/old/weixin/pages/buy/buy.wxml +++ b/public/appmini/old/weixin/pages/buy/buy.wxml @@ -47,7 +47,7 @@ - {{item.name}} + {{item.name}} {{item.tips}} diff --git a/public/appmini/old/weixin/pages/cart/cart.js b/public/appmini/old/weixin/pages/cart/cart.js index 2cae0978b7e98a29bfba61389c29ae501403bb15..51e6000b097836c068e8e5f27e75e081fa4ee001 100755 --- a/public/appmini/old/weixin/pages/cart/cart.js +++ b/public/appmini/old/weixin/pages/cart/cart.js @@ -175,38 +175,6 @@ Page({ }); }, - // 滑动操作 - right_item_event(e) { - var type = e.detail.type; - var index = e.extra; - var id = this.data.data_list[index]['id']; - var goods_id = this.data.data_list[index]['goods_id']; - - // 收藏 - if (type == 'edit') { - this.goods_favor_event(id, goods_id, type); - } else { - wx.showModal({ - title: '温馨提示', - content: '删除后不可恢复,确定继续吗?', - confirmText: '确定', - cancelText: '取消', - success: (result) => { - if (result.confirm) { - this.cart_delete(id, type); - } else { - this.setData({ swipe_index: null }); - } - } - }); - } - }, - - // 滑动操作 - swipe_start_event(e) { - this.setData({ swipe_index: e.index }); - }, - // 收藏事件 goods_favor_event(id, goods_id, type) { wx.request({ @@ -227,6 +195,26 @@ Page({ }); }, + // 删除操作事件 + cart_delete_event(e) { + var id = e.currentTarget.dataset.id || null; + if (id !== null) { + wx.showModal({ + title: '温馨提示', + content: '删除后不可恢复,确定继续吗?', + confirmText: '确认', + cancelText: '暂不', + success: (result) => { + if (result.confirm) { + this.cart_delete(id, 'delete'); + } + }, + }); + } else { + app.showToast("参数有误"); + } + }, + // 购物车删除 cart_delete(id, type) { wx.request({ diff --git a/public/appmini/old/weixin/pages/cart/cart.wxml b/public/appmini/old/weixin/pages/cart/cart.wxml index 4abdcffa5fea89ae8cf437d30e7eaaf7bd2ba5ac..25ab41ebebe67168f871e620fd93c1c28e2d8991 100755 --- a/public/appmini/old/weixin/pages/cart/cart.wxml +++ b/public/appmini/old/weixin/pages/cart/cart.wxml @@ -32,7 +32,12 @@ ¥{{item.price}} ¥{{item.original_price}} x{{item.stock}} + + + 删除 + + diff --git a/public/appmini/old/weixin/pages/cart/cart.wxss b/public/appmini/old/weixin/pages/cart/cart.wxss index e10d68fe23caa107c370971de021944372111664..9e570af6c5b6e913c216c2cc89a88046f93d2972 100755 --- a/public/appmini/old/weixin/pages/cart/cart.wxss +++ b/public/appmini/old/weixin/pages/cart/cart.wxss @@ -38,6 +38,10 @@ .goods-item .selected { margin-top: 60rpx; } +.goods-item .delete { + color: #e00303; + margin-right: 10rpx; +} /** * 数量操作 diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 917ada7d76ac492982203032e242323398dcfc91..1bb76492222012cba608fe3f8df8641ff1d2bb29 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -806,7 +806,7 @@ function DataDelete(e) url:url, type:'POST', dataType:"json", - timeout:e.attr('timeout') || 30000, + timeout:e.attr('data-timeout') || 30000, data:{"id":id}, success:function(result) { @@ -926,7 +926,7 @@ function AjaxRequest(e) url:url, type:'POST', dataType:"json", - timeout:e.attr('timeout') || 30000, + timeout:e.attr('data-timeout') || 30000, data:{"id":id, "value": value, "field": field}, success:function(result) { @@ -1340,7 +1340,7 @@ $(function() var id = $tag.attr('data-id'); var state = ($tag.attr('data-state') == 1) ? 0 : 1; var url = $tag.attr('data-url'); - var field = $tag.attr('field') || ''; + var field = $tag.attr('data-field') || ''; var is_update_status = $tag.attr('data-is-update-status') || 0; if(id == undefined || url == undefined) { @@ -1353,7 +1353,7 @@ $(function() url:url, type:'POST', dataType:"json", - timeout:$tag.attr('timeout') || 30000, + timeout:$tag.attr('data-timeout') || 30000, data:{"id":id, "state":state, "field":field}, success:function(result) {