Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
75ddce71
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75ddce71
编写于
6月 14, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序购物车新增删除功能
上级
31a895fa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
37 deletion
+42
-37
application/service/IntegralService.php
application/service/IntegralService.php
+8
-0
public/appmini/old/weixin/pages/buy/buy.wxml
public/appmini/old/weixin/pages/buy/buy.wxml
+1
-1
public/appmini/old/weixin/pages/cart/cart.js
public/appmini/old/weixin/pages/cart/cart.js
+20
-32
public/appmini/old/weixin/pages/cart/cart.wxml
public/appmini/old/weixin/pages/cart/cart.wxml
+5
-0
public/appmini/old/weixin/pages/cart/cart.wxss
public/appmini/old/weixin/pages/cart/cart.wxss
+4
-0
public/static/common/js/common.js
public/static/common/js/common.js
+4
-4
未找到文件。
application/service/IntegralService.php
浏览文件 @
75ddce71
...
...
@@ -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
;
...
...
public/appmini/old/weixin/pages/buy/buy.wxml
浏览文件 @
75ddce71
...
...
@@ -47,7 +47,7 @@
<!-- 扩展数据展示 -->
<view wx:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view wx:for="{{extension_data}}" wx:key="key" class="item oh">
<text class="cr-666">{{item.name}}
<text class="cr-666
fl
">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
...
...
public/appmini/old/weixin/pages/cart/cart.js
浏览文件 @
75ddce71
...
...
@@ -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
({
...
...
public/appmini/old/weixin/pages/cart/cart.wxml
浏览文件 @
75ddce71
...
...
@@ -32,7 +32,12 @@
<text class="sales-price">¥{{item.price}}</text>
<text wx:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price}}</text>
<text class="buy-number cr-888">x{{item.stock}}</text>
<!-- 删除操作 -->
<view class="fr delete" data-id="{{item.id}}" bindtap="cart_delete_event">删除</view>
</view>
</view>
</view>
...
...
public/appmini/old/weixin/pages/cart/cart.wxss
浏览文件 @
75ddce71
...
...
@@ -38,6 +38,10 @@
.goods-item .selected {
margin-top: 60rpx;
}
.goods-item .delete {
color: #e00303;
margin-right: 10rpx;
}
/**
* 数量操作
...
...
public/static/common/js/common.js
浏览文件 @
75ddce71
...
...
@@ -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
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录