Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
dac1db76
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,发现更多精彩内容 >>
提交
dac1db76
编写于
10月 18, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序优惠劵使用
上级
1e453746
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
308 addition
and
39 deletion
+308
-39
public/appmini/old/alipay/pages/buy/buy.acss
public/appmini/old/alipay/pages/buy/buy.acss
+32
-0
public/appmini/old/alipay/pages/buy/buy.axml
public/appmini/old/alipay/pages/buy/buy.axml
+41
-1
public/appmini/old/alipay/pages/buy/buy.js
public/appmini/old/alipay/pages/buy/buy.js
+59
-1
public/appmini/old/alipay/pages/buy/buy.json
public/appmini/old/alipay/pages/buy/buy.json
+4
-1
public/appmini/old/baidu/pages/buy/buy.css
public/appmini/old/baidu/pages/buy/buy.css
+32
-0
public/appmini/old/baidu/pages/buy/buy.js
public/appmini/old/baidu/pages/buy/buy.js
+61
-3
public/appmini/old/baidu/pages/buy/buy.json
public/appmini/old/baidu/pages/buy/buy.json
+4
-1
public/appmini/old/baidu/pages/buy/buy.swan
public/appmini/old/baidu/pages/buy/buy.swan
+41
-1
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+2
-2
public/appmini/old/weixin/pages/buy/buy.wxml
public/appmini/old/weixin/pages/buy/buy.wxml
+27
-27
public/appmini/old/weixin/pages/buy/buy.wxss
public/appmini/old/weixin/pages/buy/buy.wxss
+4
-1
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+1
-1
未找到文件。
public/appmini/old/alipay/pages/buy/buy.acss
浏览文件 @
dac1db76
...
...
@@ -122,3 +122,35 @@
.extension-list .item .text-tips {
color: #ff8f44;
}
/**
* 插件样式区域
*/
/**
* 优惠劵
*/
.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: 50rpx;
}
.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/alipay/pages/buy/buy.axml
浏览文件 @
dac1db76
...
...
@@ -45,6 +45,12 @@
<!-- 留言 -->
<textarea onInput="bind_user_note_event" maxlength="60" auto-height placeholder="留言" class="spacing-mb" />
<!-- 优惠劵 -->
<view a:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" onTap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- 扩展数据展示 -->
<view a:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view a:for="{{extension_data}}" class="item oh">
...
...
@@ -81,3 +87,37 @@
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- 优惠劵选择 -->
<popup show="{{popup_plugins_coupon_status}}" position="bottom" onClose="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 a: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 onTap="plugins_coupon_not_use_event">不使用优惠劵</text>
</view>
<block a:for="{{plugins_coupon_data.coupon_list}}">
<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 a:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view a: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}}" onTap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
</view>
</block>
</view>
</view>
</popup>
\ No newline at end of file
public/appmini/old/alipay/pages/buy/buy.js
浏览文件 @
dac1db76
...
...
@@ -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
)
...
...
@@ -72,6 +78,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
;
my
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
buy
"
),
method
:
"
POST
"
,
...
...
@@ -79,6 +86,7 @@ Page({
dataType
:
"
json
"
,
headers
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
my
.
stopPullDownRefresh
();
my
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
...
...
@@ -92,8 +100,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
)
{
...
...
@@ -120,6 +141,7 @@ Page({
}
},
fail
:
()
=>
{
my
.
stopPullDownRefresh
();
my
.
hideLoading
();
this
.
setData
({
data_list_loding_status
:
2
,
...
...
@@ -130,6 +152,11 @@ Page({
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
init
();
},
// 用户留言事件
bind_user_note_event
(
e
)
{
this
.
setData
({
user_note_value
:
e
.
detail
.
value
});
...
...
@@ -142,6 +169,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
=
[
...
...
@@ -204,6 +232,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/alipay/pages/buy/buy.json
浏览文件 @
dac1db76
{
"pullRefresh"
:
false
"pullRefresh"
:
true
,
"usingComponents"
:
{
"popup"
:
"mini-antui/es/popup/index"
}
}
\ No newline at end of file
public/appmini/old/baidu/pages/buy/buy.css
浏览文件 @
dac1db76
...
...
@@ -131,3 +131,35 @@
min-height
:
10vh
;
width
:
100%
;
}
/**
* 插件样式区域
*/
/**
* 优惠劵
*/
.plugins-coupon
{
padding
:
25
rpx
40
rpx
25
rpx
10
rpx
;
}
.plugins-coupon-popup
{
padding-top
:
20
rpx
;
}
.plugins-coupon-popup
.close
{
margin-right
:
20
rpx
;
}
.coupon-container
{
max-height
:
80vh
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
padding-bottom
:
50
rpx
;
}
.coupon-container
.item
,
.coupon-container
.v-right
,
.coupon-container
.v-right
.circle
{
height
:
230
rpx
;
}
.coupon-container
.not-use-tips
{
color
:
#f7b240
;
font-size
:
32
rpx
;
}
\ No newline at end of file
public/appmini/old/baidu/pages/buy/buy.js
浏览文件 @
dac1db76
...
...
@@ -14,7 +14,13 @@ Page({
is_first
:
1
,
extension_data
:
[],
payment_id
:
0
,
common_order_is_booking
:
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
)
{
...
...
@@ -67,12 +73,14 @@ 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
;
swan
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
buy
"
),
method
:
"
POST
"
,
data
:
data
,
dataType
:
"
json
"
,
success
:
res
=>
{
swan
.
stopPullDownRefresh
();
swan
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
...
...
@@ -84,9 +92,22 @@ Page({
total_price
:
data
.
base
.
actual_price
,
extension_data
:
data
.
extension_data
||
[],
data_list_loding_status
:
3
,
common_order_is_booking
:
data
.
common_order_is_booking
||
0
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
)
{
...
...
@@ -114,6 +135,7 @@ Page({
}
},
fail
:
()
=>
{
swan
.
stopPullDownRefresh
();
swan
.
hideLoading
();
this
.
setData
({
data_list_loding_status
:
2
,
...
...
@@ -125,6 +147,11 @@ Page({
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
init
();
},
// 用户留言事件
bind_user_note_event
(
e
)
{
this
.
setData
({
user_note_value
:
e
.
detail
.
value
});
...
...
@@ -137,6 +164,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
=
[{
fields
:
'
address_id
'
,
msg
:
'
请选择地址
'
}];
...
...
@@ -197,6 +225,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
();
},
});
\ No newline at end of file
public/appmini/old/baidu/pages/buy/buy.json
浏览文件 @
dac1db76
{
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"component-popup"
:
"/components/popup/popup"
}
}
\ No newline at end of file
public/appmini/old/baidu/pages/buy/buy.swan
浏览文件 @
dac1db76
...
...
@@ -44,6 +44,12 @@
<!-- 留言 -->
<textarea bindinput="bind_user_note_event" maxlength="60" auto-height placeholder="留言" class="content-textarea bg-white spacing-mb" />
<!-- 优惠劵 -->
<view s-if="(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0" 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 s-if="extension_data.length > 0" class="extension-list spacing-mb">
<view s-for="item, index in extension_data" s-key="key" class="item oh">
...
...
@@ -80,3 +86,37 @@
<import src="/pages/common/nodata.swan" />
<template is="nodata" data="{{{status: data_list_loding_status, msg: data_list_loding_msg}}}"></template>
</view>
<!-- 优惠劵选择 -->
<component-popup status="{{popup_plugins_coupon_status}}" 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 s-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 s-for="item, index in plugins_coupon_data.coupon_list" s-key="key">
<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 s-if="(item.coupon.desc || null) != null" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view s-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/app.json
浏览文件 @
dac1db76
{
"pages"
:
[
"pages/goods-detail/goods-detail"
,
"pages"
:
[
"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.wxml
浏览文件 @
dac1db76
...
...
@@ -119,4 +119,4 @@
</block>
</view>
</view>
</component-popup>
\ No newline at end of file
</component-popup>
\ No newline at end of file
public/appmini/old/weixin/pages/buy/buy.wxss
浏览文件 @
dac1db76
...
...
@@ -133,7 +133,10 @@
}
/**
* 插件
* 插件样式区域
*/
/**
* 优惠劵
*/
.plugins-coupon {
padding: 25rpx 40rpx 25rpx 10rpx;
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
dac1db76
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录