Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
e8acc7a4
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e8acc7a4
编写于
10月 17, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序优惠劵使用
上级
fa1bc1cf
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
137 addition
and
7 deletion
+137
-7
application/api/controller/Buy.php
application/api/controller/Buy.php
+6
-0
application/api/controller/Goods.php
application/api/controller/Goods.php
+2
-0
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+1
-1
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+2
-2
public/appmini/old/weixin/pages/buy/buy.js
public/appmini/old/weixin/pages/buy/buy.js
+52
-1
public/appmini/old/weixin/pages/buy/buy.json
public/appmini/old/weixin/pages/buy/buy.json
+4
-1
public/appmini/old/weixin/pages/buy/buy.wxml
public/appmini/old/weixin/pages/buy/buy.wxml
+41
-1
public/appmini/old/weixin/pages/buy/buy.wxss
public/appmini/old/weixin/pages/buy/buy.wxss
+28
-0
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+1
-1
未找到文件。
application/api/controller/Buy.php
浏览文件 @
e8acc7a4
...
...
@@ -60,6 +60,9 @@ class Buy extends Common
// 支付方式
$payment_list
=
PaymentService
::
BuyPaymentList
([
'is_enable'
=>
1
,
'is_open_user'
=>
1
]);
// 当前选中的优惠劵
$coupon_id
=
isset
(
$params
[
'coupon_id'
])
?
intval
(
$params
[
'coupon_id'
])
:
0
;
// 数据返回组装
$result
=
[
'goods_list'
=>
$ret
[
'data'
][
'goods'
],
...
...
@@ -67,6 +70,9 @@ class Buy extends Common
'base'
=>
$ret
[
'data'
][
'base'
],
'extension_data'
=>
$ret
[
'data'
][
'extension_data'
],
'common_order_is_booking'
=>
(
int
)
MyC
(
'common_order_is_booking'
,
0
),
// 优惠劵
'plugins_coupon_data'
=>
CallPluginsServiceMethod
(
'coupon'
,
'BaseService'
,
'BuyUserCouponData'
,
[
'order_goods'
=>
$ret
[
'data'
][
'goods'
],
'coupon_id'
=>
$coupon_id
]),
];
return
DataReturn
(
'操作成功'
,
0
,
$result
);
}
...
...
application/api/controller/Goods.php
浏览文件 @
e8acc7a4
...
...
@@ -126,6 +126,8 @@ class Goods extends Common
'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_poster_share'
=>
(
int
)
MyC
(
'common_app_is_poster_share'
),
// 优惠劵
'plugins_coupon_data'
=>
$this
->
PluginsCouponGoods
(
$goods_id
),
];
...
...
public/appmini/old/weixin/app.js
浏览文件 @
e8acc7a4
...
...
@@ -67,7 +67,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
request_url
:
'
http://tp5-dev.com/
'
,
request_url
:
'
https://test.shopxo.net/
'
,
//
request_url: 'https://test.shopxo.net/',
// 基础信息
application_title
:
"
{{application_title}}
"
,
...
...
public/appmini/old/weixin/app.json
浏览文件 @
e8acc7a4
{
"pages"
:
[
"pages"
:
[
"pages/goods-detail/goods-detail"
,
"pages/index/index"
,
"pages/goods-category/goods-category"
,
"pages/cart/cart"
,
...
...
@@ -8,7 +8,7 @@
"pages/login/login"
,
"pages/paytips/paytips"
,
"pages/goods-search/goods-search"
,
"pages/goods-detail/goods-detail"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-attribute/goods-attribute"
,
"pages/buy/buy"
,
...
...
public/appmini/old/weixin/pages/buy/buy.js
浏览文件 @
e8acc7a4
...
...
@@ -15,6 +15,12 @@ Page({
extension_data
:
[],
payment_id
:
0
,
common_order_is_booking
:
0
,
// 优惠劵
plugins_coupon_data
:
null
,
plugins_use_coupon_id
:
0
,
plugins_choice_coupon_value
:
'
选择优惠劵
'
,
popup_plugins_coupon_status
:
false
,
},
onLoad
(
params
)
{
if
((
params
.
data
||
null
)
==
null
||
app
.
get_length
(
JSON
.
parse
(
params
.
data
))
==
0
)
...
...
@@ -70,6 +76,7 @@ Page({
var
data
=
this
.
data
.
params
;
data
[
'
address_id
'
]
=
this
.
data
.
address_id
;
data
[
'
payment_id
'
]
=
this
.
data
.
payment_id
;
data
[
'
coupon_id
'
]
=
this
.
data
.
plugins_use_coupon_id
;
wx
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
buy
"
),
method
:
"
POST
"
,
...
...
@@ -89,8 +96,21 @@ Page({
extension_data
:
data
.
extension_data
||
[],
data_list_loding_status
:
3
,
common_order_is_booking
:
data
.
common_order_is_booking
||
0
,
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
});
// 优惠劵选择处理
if
((
data
.
plugins_coupon_data
||
null
)
!=
null
)
{
if
((
data
.
plugins_coupon_data
.
coupon_choice
||
null
)
!=
null
)
{
this
.
setData
({
plugins_choice_coupon_value
:
data
.
plugins_coupon_data
.
coupon_choice
.
coupon
.
desc
});
}
else
{
var
coupon_count
=
((
data
.
plugins_coupon_data
.
coupon_list
||
null
)
!=
null
)
?
data
.
plugins_coupon_data
.
coupon_list
.
length
:
0
;
this
.
setData
({
plugins_choice_coupon_value
:
(
coupon_count
>
0
)
?
'
可选优惠劵
'
+
coupon_count
+
'
张
'
:
'
暂无可用优惠劵
'
});
}
}
// 地址
if
(
this
.
data
.
address
==
null
||
this
.
data
.
address_id
==
0
)
{
if
((
data
.
base
.
address
||
null
)
!=
null
)
{
...
...
@@ -141,6 +161,7 @@ Page({
data
[
'
address_id
'
]
=
this
.
data
.
address_id
;
data
[
'
payment_id
'
]
=
this
.
data
.
payment_id
;
data
[
'
user_note
'
]
=
this
.
data
.
user_note_value
;
data
[
'
coupon_id
'
]
=
this
.
data
.
plugins_use_coupon_id
;
// 数据验证
var
validation
=
[
...
...
@@ -203,6 +224,36 @@ Page({
}
}
this
.
setData
({
payment_list
:
data
||
[]});
}
},
// 优惠劵弹层开启
plugins_coupon_open_event
(
e
)
{
this
.
setData
({
popup_plugins_coupon_status
:
true
});
},
// 优惠劵弹层关闭
plugins_coupon_close_event
(
e
)
{
this
.
setData
({
popup_plugins_coupon_status
:
false
});
},
// 优惠劵选择
plugins_coupon_use_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
this
.
setData
({
plugins_use_coupon_id
:
value
,
popup_plugins_coupon_status
:
false
,
});
this
.
init
();
},
// 不使用优惠劵
plugins_coupon_not_use_event
(
e
)
{
this
.
setData
({
plugins_use_coupon_id
:
0
,
popup_plugins_coupon_status
:
false
,
});
this
.
init
();
},
});
public/appmini/old/weixin/pages/buy/buy.json
浏览文件 @
e8acc7a4
{
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"component-popup"
:
"/components/popup/popup"
}
}
\ No newline at end of file
public/appmini/old/weixin/pages/buy/buy.wxml
浏览文件 @
e8acc7a4
...
...
@@ -44,6 +44,12 @@
<!-- 留言 -->
<textarea bindinput="bind_user_note_event" maxlength="60" auto-height placeholder="留言" class="content-textarea bg-white spacing-mb" />
<!-- 优惠劵 -->
<view class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- 扩展数据展示 -->
<view wx:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view wx:for="{{extension_data}}" wx:key="key" class="item oh">
...
...
@@ -79,4 +85,38 @@
<view wx:if="{{goods.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
\ No newline at end of file
</view>
<!-- 优惠劵选择 -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<view wx:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">不使用优惠劵</text>
</view>
<block wx:for="{{plugins_coupon_data.coupon_list}}" wx:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<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_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>
<view class="base-time cr-888 single-text">{{item.time_start_text}} 至 {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-index="{{index}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
</view>
</block>
</view>
</view>
</component-popup>
\ No newline at end of file
public/appmini/old/weixin/pages/buy/buy.wxss
浏览文件 @
e8acc7a4
...
...
@@ -130,4 +130,32 @@
padding: 10rpx;
min-height: 10vh;
width: 100%;
}
/**
* 插件
*/
.plugins-coupon {
padding: 25rpx 40rpx 25rpx 10rpx;
}
.plugins-coupon-popup {
padding-top: 20rpx;
}
.plugins-coupon-popup .close {
margin-right: 20rpx;
}
.coupon-container {
max-height: 80vh;
overflow-y: scroll;
overflow-x: hidden;
padding-bottom: 20rpx;
}
.coupon-container .item,
.coupon-container .v-right,
.coupon-container .v-right .circle {
height: 230rpx;
}
.coupon-container .not-use-tips {
color: #f7b240;
font-size: 32rpx;
}
\ No newline at end of file
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
e8acc7a4
...
...
@@ -69,7 +69,7 @@ Page({
params
=
app
.
launch_params_handle
(
params
);
// 参数赋值,初始化
//
params['goods_id']=2;
params
[
'
goods_id
'
]
=
2
;
this
.
setData
({
params
:
params
});
this
.
init
();
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录