Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
fec3daea
ShopXO
项目概览
飞鱼0526
/
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,发现更多精彩内容 >>
提交
fec3daea
编写于
10月 17, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序优惠劵
上级
b416af4c
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
104 addition
and
11 deletion
+104
-11
application/api/controller/Goods.php
application/api/controller/Goods.php
+4
-1
application/common.php
application/common.php
+13
-0
application/service/PluginsService.php
application/service/PluginsService.php
+18
-3
public/appmini/old/weixin/pages/coupon/coupon.js
public/appmini/old/weixin/pages/coupon/coupon.js
+1
-1
public/appmini/old/weixin/pages/coupon/coupon.wxml
public/appmini/old/weixin/pages/coupon/coupon.wxml
+2
-2
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+44
-0
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
+3
-3
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
+18
-0
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
+1
-1
未找到文件。
application/api/controller/Goods.php
浏览文件 @
fec3daea
...
...
@@ -169,7 +169,10 @@ class Goods extends Common
$ret
=
CallPluginsServiceMethod
(
'coupon'
,
'CouponService'
,
'CouponList'
,
$coupon_params
);
// 排除商品不支持的活动
if
(
!
empty
(
$ret
[
'data'
]))
{
$ret
[
'data'
]
=
CallPluginsServiceMethod
(
'coupon'
,
'BaseService'
,
'CouponListGoodsExclude'
,
[
'data'
=>
$ret
[
'data'
],
'goods_id'
=>
$goods_id
]);
}
// 返回数据
return
[
...
...
application/common.php
浏览文件 @
fec3daea
...
...
@@ -88,6 +88,12 @@ function PathToParams($key = null, $default = null, $path = '')
*/
function
CallPluginsData
(
$plugins
,
$attachment_field
=
[],
$service_name
=
''
,
$attachment_property
=
'base_config_attachment_field'
)
{
// 插件是否启用
if
(
app\service\PluginsService
::
PluginsStatus
(
$plugins
)
!=
1
)
{
return
DataReturn
(
'插件状态异常['
.
$plugins
.
']'
,
-
1
);
}
// 未指定附件字段则自动去获取
$attachment
=
[];
if
(
empty
(
$attachment_field
)
&&
!
empty
(
$attachment_property
))
...
...
@@ -128,6 +134,13 @@ function CallPluginsServiceMethod($plugins, $service, $method, $params = null)
{
if
(
method_exists
(
$plugins_class
,
$method
))
{
// 插件是否启用
if
(
app\service\PluginsService
::
PluginsStatus
(
$plugins
)
!=
1
)
{
return
DataReturn
(
'插件状态异常['
.
$plugins
.
']'
,
-
1
);
}
// 调用方法返回数据
return
$plugins_class
::
$method
(
$params
);
}
else
{
return
DataReturn
(
'类方法未定义['
.
$plugins
.
'-'
.
$service
.
'-'
.
$method
.
']'
,
-
1
);
...
...
application/service/PluginsService.php
浏览文件 @
fec3daea
...
...
@@ -46,10 +46,10 @@ class PluginsService
if
(
empty
(
$data
))
{
// 获取数据
$
data
=
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$plugins
])
->
value
(
'data'
);
if
(
!
empty
(
$
data
))
$
ret
=
self
::
PluginsField
(
$plugins
,
'data'
);
if
(
!
empty
(
$
ret
[
'data'
]
))
{
$data
=
json_decode
(
$
data
,
true
);
$data
=
json_decode
(
$
ret
[
'data'
]
,
true
);
// 是否有自定义附件需要处理
if
(
!
empty
(
$attachment_field
)
&&
is_array
(
$attachment_field
))
...
...
@@ -166,5 +166,20 @@ class PluginsService
$data
=
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$plugins
])
->
value
(
$field
);
return
DataReturn
(
'操作成功'
,
0
,
$data
);
}
/**
* 应用状态
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-10-17
* @desc description
* @param [string] $plugins [应用标记]
*/
public
static
function
PluginsStatus
(
$plugins
)
{
$ret
=
self
::
PluginsField
(
$plugins
,
'is_enable'
);
return
$ret
[
'data'
];
}
}
?>
\ No newline at end of file
public/appmini/old/weixin/pages/coupon/coupon.js
浏览文件 @
fec3daea
...
...
@@ -75,7 +75,7 @@ Page({
});
},
// 领取事件
//
优惠劵
领取事件
receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
receive_event
"
);
// 用户未绑定用户则转到登录页面
...
...
public/appmini/old/weixin/pages/coupon/coupon.wxml
浏览文件 @
fec3daea
...
...
@@ -8,12 +8,12 @@
<view class="base single-text" style="color:{{item.bg_color_value}};">
<text class="symbol">¥</text>
<text class="price">{{item.discount_value}}</text>
<text class="unit">{{item.type
== 0 ? '元' : '折'
}}</text>
<text class="unit">{{item.type
_unit
}}</text>
<text wx:if="{{(item.desc || null) != null}}" class="desc cr-888">{{item.desc}}</text>
</view>
<view wx:if="{{(item.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.use_limit_type_name}}</view>
</view>
<view class="v-right fr" bindtap="receive_event" data-index="{{index}}" data-value="{{item.id}}" style="background:{{item.bg_color_value}};">
<view class="v-right fr" bindtap="
coupon_
receive_event" data-index="{{index}}" data-value="{{item.id}}" style="background:{{item.bg_color_value}};">
<text class="circle"></text>
<text>{{item.is_operable_name}}</text>
</view>
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
fec3daea
...
...
@@ -787,6 +787,50 @@ Page({
}
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
wx
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=receive_event
"
});
return
false
;
}
else
{
var
self
=
this
;
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
var
temp_list
=
this
.
data
.
plugins_coupon_data
.
data
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
wx
.
showLoading
({
title
:
"
处理中...
"
});
wx
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
plugins_coupon_data
.
base
!=
null
&&
self
.
data
.
plugins_coupon_data
.
base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
'
plugins_coupon_data.data
'
:
temp_list
});
}
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
wx
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
},
// 自定义分享
onShareAppMessage
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
goods_favor_event
'
)
||
null
;
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
浏览文件 @
fec3daea
...
...
@@ -73,12 +73,12 @@
<view class="base single-text" style="color:{{item.bg_color_value}};">
<text class="symbol">¥</text>
<text class="price">{{item.discount_value}}</text>
<text class="unit">{{item.type == 0 ? '元' : '折'}}</text>
<text wx:if="{{(item.desc || null) != null}}" class="desc cr-888">{{item.desc}}</text>
<text class="unit">{{item.type_unit}}</text>
</view>
<view wx:if="{{(item.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.use_limit_type_name}}</view>
<view wx:if="{{(item.desc || null) != null}}" class="desc cr-888 single-text">{{item.desc}}</view>
</view>
<view class="v-right fr" bindtap="receive_event" data-index="{{index}}" data-value="{{item.id}}" style="background:{{item.bg_color_value}};">
<view class="v-right fr" bindtap="
coupon_
receive_event" data-index="{{index}}" data-value="{{item.id}}" style="background:{{item.bg_color_value}};">
<text class="circle"></text>
<text>{{item.is_operable_name}}</text>
</view>
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
浏览文件 @
fec3daea
...
...
@@ -293,15 +293,33 @@
}
/*
* 优惠劵 - 插件
*/
.coupon-container {
white-space: nowrap;
box-sizing: border-box;
padding: 20rpx 10rpx;
}
.coupon-container scroll-view {
height: 174rpx;
}
.coupon-container .item {
display: inline-block;
width: 60vw;
}
.coupon-container .v-left {
padding: 20rpx 0 20rpx 20rpx;
}
.coupon-container .item:not(:last-child) {
margin-right: 20rpx;
}
.coupon-container .item,
.coupon-container .v-right,
.coupon-container .v-right .circle {
height: 170rpx;
}
.coupon-container .v-left .base .price {
font-size: 46rpx;
}
\ No newline at end of file
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
浏览文件 @
fec3daea
...
...
@@ -16,7 +16,7 @@
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol">¥</text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.coupon.type
== 0 ? '元' : '折'
}}</text>
<text class="unit">{{item.coupon.type
_unit
}}</text>
<text wx:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view wx:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录