Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
b416af4c
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
b416af4c
编写于
10月 17, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优惠劵
上级
3bea0b22
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
83 addition
and
7 deletion
+83
-7
application/api/controller/Coupon.php
application/api/controller/Coupon.php
+1
-1
application/api/controller/Goods.php
application/api/controller/Goods.php
+38
-0
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+2
-2
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+5
-4
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
+23
-0
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
+14
-0
未找到文件。
application/api/controller/Coupon.php
浏览文件 @
b416af4c
...
@@ -52,7 +52,7 @@ class Coupon extends Common
...
@@ -52,7 +52,7 @@ class Coupon extends Common
'is_user_receive'
=>
1
,
'is_user_receive'
=>
1
,
],
],
'm'
=>
0
,
'm'
=>
0
,
'n'
=>
100000
0
,
'n'
=>
0
,
'is_sure_receive'
=>
1
,
'is_sure_receive'
=>
1
,
'user'
=>
$this
->
user
,
'user'
=>
$this
->
user
,
];
];
...
...
application/api/controller/Goods.php
浏览文件 @
b416af4c
...
@@ -126,6 +126,7 @@ class Goods extends Common
...
@@ -126,6 +126,7 @@ class Goods extends Common
'common_app_is_limitedtimediscount'
=>
(
int
)
MyC
(
'common_app_is_limitedtimediscount'
),
'common_app_is_limitedtimediscount'
=>
(
int
)
MyC
(
'common_app_is_limitedtimediscount'
),
'common_app_is_good_thing'
=>
(
int
)
MyC
(
'common_app_is_good_thing'
),
'common_app_is_good_thing'
=>
(
int
)
MyC
(
'common_app_is_good_thing'
),
'common_app_is_poster_share'
=>
(
int
)
MyC
(
'common_app_is_poster_share'
),
'common_app_is_poster_share'
=>
(
int
)
MyC
(
'common_app_is_poster_share'
),
'plugins_coupon_data'
=>
$this
->
PluginsCouponGoods
(
$goods_id
),
];
];
// 秒杀
// 秒杀
...
@@ -140,6 +141,43 @@ class Goods extends Common
...
@@ -140,6 +141,43 @@ class Goods extends Common
return
DataReturn
(
'success'
,
0
,
$result
);
return
DataReturn
(
'success'
,
0
,
$result
);
}
}
/**
* 商品详情优惠劵
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-10-17
* @desc description
* @param [int] $goods_id [商品id]
*/
private
function
PluginsCouponGoods
(
$goods_id
)
{
// 获取基础配置信息
$base
=
CallPluginsData
(
'coupon'
);
// 优惠劵列表
$coupon_params
=
[
'where'
=>
[
'is_enable'
=>
1
,
'is_user_receive'
=>
1
,
],
'm'
=>
0
,
'n'
=>
0
,
'is_sure_receive'
=>
1
,
'user'
=>
$this
->
user
,
];
$ret
=
CallPluginsServiceMethod
(
'coupon'
,
'CouponService'
,
'CouponList'
,
$coupon_params
);
// 排除商品不支持的活动
$ret
[
'data'
]
=
CallPluginsServiceMethod
(
'coupon'
,
'BaseService'
,
'CouponListGoodsExclude'
,
[
'data'
=>
$ret
[
'data'
],
'goods_id'
=>
$goods_id
]);
// 返回数据
return
[
'base'
=>
$base
[
'data'
],
'data'
=>
$ret
[
'data'
],
];
}
/**
/**
* 用户商品收藏
* 用户商品收藏
* @author Devil
* @author Devil
...
...
public/appmini/old/weixin/app.json
浏览文件 @
b416af4c
{
{
"pages"
:
[
"pages"
:
[
"pages/goods-detail/goods-detail"
,
"pages/index/index"
,
"pages/index/index"
,
"pages/goods-category/goods-category"
,
"pages/goods-category/goods-category"
,
"pages/cart/cart"
,
"pages/cart/cart"
,
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
"pages/login/login"
,
"pages/login/login"
,
"pages/paytips/paytips"
,
"pages/paytips/paytips"
,
"pages/goods-search/goods-search"
,
"pages/goods-search/goods-search"
,
"pages/goods-detail/goods-detail"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-attribute/goods-attribute"
,
"pages/goods-attribute/goods-attribute"
,
"pages/buy/buy"
,
"pages/buy/buy"
,
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
b416af4c
...
@@ -59,9 +59,9 @@ Page({
...
@@ -59,9 +59,9 @@ Page({
// 海报分享
// 海报分享
common_app_is_poster_share
:
0
,
common_app_is_poster_share
:
0
,
},
on_error
(
e
)
{
// 优惠劵
console
.
log
(
e
)
plugins_coupon_data
:
null
,
},
},
onLoad
(
params
)
{
onLoad
(
params
)
{
...
@@ -69,7 +69,7 @@ Page({
...
@@ -69,7 +69,7 @@ Page({
params
=
app
.
launch_params_handle
(
params
);
params
=
app
.
launch_params_handle
(
params
);
// 参数赋值,初始化
// 参数赋值,初始化
//
params['goods_id']=2;
params
[
'
goods_id
'
]
=
2
;
this
.
setData
({
params
:
params
});
this
.
setData
({
params
:
params
});
this
.
init
();
this
.
init
();
},
},
...
@@ -151,6 +151,7 @@ Page({
...
@@ -151,6 +151,7 @@ Page({
'
share_product.brand_info.name
'
:
data
.
goods
.
brand_name
,
'
share_product.brand_info.name
'
:
data
.
goods
.
brand_name
,
common_app_is_poster_share
:
data
.
common_app_is_poster_share
||
0
,
common_app_is_poster_share
:
data
.
common_app_is_poster_share
||
0
,
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
});
});
// 限时秒杀倒计时
// 限时秒杀倒计时
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
浏览文件 @
b416af4c
...
@@ -64,6 +64,29 @@
...
@@ -64,6 +64,29 @@
</view>
</view>
</view>
</view>
<!-- 优惠劵 -->
<view wx:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0}}" class="coupon-container wh-auto spacing-mt bg-white">
<scroll-view scroll-x="true">
<block wx:for="{{plugins_coupon_data.data}}" wx:key="item">
<view class="item bg-white {{item.is_operable == 0 ? 'item-disabled' : ''}}" style="border:1px solid {{item.bg_color_value}};">
<view class="v-left fl">
<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>
</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}};">
<text class="circle"></text>
<text>{{item.is_operable_name}}</text>
</view>
</view>
</block>
</scroll-view>
</view>
<!-- 属性导航 -->
<!-- 属性导航 -->
<!-- <view wx:if="{{false}}" class="spacing">
<!-- <view wx:if="{{false}}" class="spacing">
<view class="goods-attr-show-title bg-white arrow-right cr-666" bindtap="good_attribute_nav_event">
<view class="goods-attr-show-title bg-white arrow-right cr-666" bindtap="good_attribute_nav_event">
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
浏览文件 @
b416af4c
...
@@ -290,4 +290,18 @@
...
@@ -290,4 +290,18 @@
}
}
.limitedtimediscount .countdown .ds {
.limitedtimediscount .countdown .ds {
padding: 0 4rpx;
padding: 0 4rpx;
}
.coupon-container {
white-space: nowrap;
box-sizing: border-box;
padding: 20rpx 10rpx;
}
.coupon-container .item {
display: inline-block;
}
.coupon-container .item:not(:last-child) {
margin-right: 20rpx;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录