Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
81a5bca7
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,发现更多精彩内容 >>
提交
81a5bca7
编写于
10月 17, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序同步优惠劵
上级
fec3daea
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
1156 addition
and
16 deletion
+1156
-16
application/service/PluginsService.php
application/service/PluginsService.php
+1
-0
public/appmini/old/alipay/app.acss
public/appmini/old/alipay/app.acss
+70
-0
public/appmini/old/alipay/app.js
public/appmini/old/alipay/app.js
+2
-0
public/appmini/old/alipay/app.json
public/appmini/old/alipay/app.json
+3
-1
public/appmini/old/alipay/pages/coupon/coupon.acss
public/appmini/old/alipay/pages/coupon/coupon.acss
+0
-0
public/appmini/old/alipay/pages/coupon/coupon.axml
public/appmini/old/alipay/pages/coupon/coupon.axml
+30
-0
public/appmini/old/alipay/pages/coupon/coupon.js
public/appmini/old/alipay/pages/coupon/coupon.js
+131
-0
public/appmini/old/alipay/pages/coupon/coupon.json
public/appmini/old/alipay/pages/coupon/coupon.json
+3
-0
public/appmini/old/alipay/pages/goods-detail/goods-detail.acss
...c/appmini/old/alipay/pages/goods-detail/goods-detail.acss
+30
-0
public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
...c/appmini/old/alipay/pages/goods-detail/goods-detail.axml
+23
-0
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
+49
-0
public/appmini/old/alipay/pages/user-coupon/user-coupon.acss
public/appmini/old/alipay/pages/user-coupon/user-coupon.acss
+35
-0
public/appmini/old/alipay/pages/user-coupon/user-coupon.axml
public/appmini/old/alipay/pages/user-coupon/user-coupon.axml
+87
-0
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
+108
-0
public/appmini/old/alipay/pages/user-coupon/user-coupon.json
public/appmini/old/alipay/pages/user-coupon/user-coupon.json
+3
-0
public/appmini/old/baidu/app.css
public/appmini/old/baidu/app.css
+70
-0
public/appmini/old/baidu/app.js
public/appmini/old/baidu/app.js
+2
-0
public/appmini/old/baidu/app.json
public/appmini/old/baidu/app.json
+3
-1
public/appmini/old/baidu/pages/coupon/coupon.css
public/appmini/old/baidu/pages/coupon/coupon.css
+0
-0
public/appmini/old/baidu/pages/coupon/coupon.js
public/appmini/old/baidu/pages/coupon/coupon.js
+129
-0
public/appmini/old/baidu/pages/coupon/coupon.json
public/appmini/old/baidu/pages/coupon/coupon.json
+3
-0
public/appmini/old/baidu/pages/coupon/coupon.swan
public/appmini/old/baidu/pages/coupon/coupon.swan
+30
-0
public/appmini/old/baidu/pages/goods-detail/goods-detail.css
public/appmini/old/baidu/pages/goods-detail/goods-detail.css
+30
-0
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
+49
-1
public/appmini/old/baidu/pages/goods-detail/goods-detail.swan
...ic/appmini/old/baidu/pages/goods-detail/goods-detail.swan
+23
-0
public/appmini/old/baidu/pages/user-coupon/user-coupon.css
public/appmini/old/baidu/pages/user-coupon/user-coupon.css
+35
-0
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
+104
-0
public/appmini/old/baidu/pages/user-coupon/user-coupon.json
public/appmini/old/baidu/pages/user-coupon/user-coupon.json
+3
-0
public/appmini/old/baidu/pages/user-coupon/user-coupon.swan
public/appmini/old/baidu/pages/user-coupon/user-coupon.swan
+87
-0
public/appmini/old/weixin/app.wxss
public/appmini/old/weixin/app.wxss
+0
-1
public/appmini/old/weixin/pages/coupon/coupon.js
public/appmini/old/weixin/pages/coupon/coupon.js
+9
-6
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+2
-2
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
+0
-2
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
+2
-2
未找到文件。
application/service/PluginsService.php
浏览文件 @
81a5bca7
...
...
@@ -36,6 +36,7 @@ class PluginsService
public
static
function
PluginsData
(
$plugins
,
$attachment_field
=
[],
$is_cache
=
true
)
{
// 从缓存获取数据
$data
=
[];
$key
=
config
(
'shopxo.cache_plugins_data_key'
)
.
$plugins
;
if
(
$is_cache
===
true
)
{
...
...
public/appmini/old/alipay/app.acss
浏览文件 @
81a5bca7
...
...
@@ -337,4 +337,74 @@ textarea {
width: 210rpx;
height: 210rpx;
border: 1px dashed #e9e9e9;
}
/*
* 优惠劵 - 插件
*/
.coupon-container {
padding: 0 10rpx;
}
.coupon-container .item {
overflow: hidden;
height: 180rpx;
border: 1px solid #D2364C;
}
.coupon-container .v-left {
width: calc(100% - 140rpx);
padding: 30rpx 0 30rpx 20rpx;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
.coupon-container .v-left .base {
color: #D2364C;
}
.coupon-container .v-left .base .symbol {
font-family: Verdana, Tahoma;
font-size: 48rpx;
font-weight: 400;
}
.coupon-container .v-left .base .price {
font-weight: 700;
font-family: arial;
font-size: 76rpx;
}
.coupon-container .v-left .base .desc {
margin-left: 20rpx;
}
.coupon-container .v-left base-tips, .coupon-container .v-left .base-time {
margin-top: 10rpx;
}
.coupon-container .v-right {
background: #d2364c;
width: 140rpx;
height: 180rpx;
color: #fff;
font-weight: 500;
position: relative;
text-align: center;
}
.coupon-container .v-right:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
.coupon-container .v-right .circle {
display: block;
position: absolute;
left: -1px;
top: -3px;
width: 3px;
height: 180rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAACpCAYAAADur4c3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo3MjUzYzIwOS04ZWNlLTRlNTctODQ4OC01ZDExOTkwOGNkYmMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTM1QzgxREZGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTM1QzgxREVGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTJiNzVkOGUtZDc2Yi00MzEzLWFmNmYtYTJkNTRlYTI4YTY1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjcyNTNjMjA5LThlY2UtNGU1Ny04NDg4LTVkMTE5OTA4Y2RiYyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pvy+vnQAAAEqSURBVHjaYvz//z8DDDAxIAFyOVeBOAHEYfyPMDsLmXMfmfMT2YADDP8h4CEQq4A4aUDMA1LNSKZDXwJxGcg1yJaWIXOeInO+IxuwA+acK0AsA+IEADEbic7hhPOAer4DcQcQMyNb2oLMeYVsADcyZwPMObuBWBTEsQFpI9E54sjO+QvEc0F+YoHKJgHxJ2TnvEM2gBmZswrmnA1AzAXiaJPhHC1k58BNQ3bBTGTOR2QD/iJzFsH8Mw/kHxBHggzn2KA7BxzWyC5Yisz5imwACmc2LLY7QbEN4nCS4ZwAIGZFds5lUEpEdsF6nKn3PTJnAsiAV0BcBsSM5GamFCDmQXYOOJ8iu2Anzrz9HKU8ABlwDYgTKcnbo0XNaFEzWtQgipqOYVLUAAQYAKPWa4c8cIHnAAAAAElFTkSuQmCC) no-repeat;
}
.coupon-container .item-disabled .v-right {
background: #dfdfdf !important;
color: #c0c0c0 !important;
cursor: no-drop !important;
}
.coupon-container .item-disabled {
border: 1px solid #dfdfdf !important;
}
\ No newline at end of file
public/appmini/old/alipay/app.js
浏览文件 @
81a5bca7
...
...
@@ -60,6 +60,8 @@ App({
"
user_orderaftersale
"
:
"
退款/售后
"
,
"
user_orderaftersale_detail
"
:
"
订单售后
"
,
"
user_order_comments
"
:
"
订单评论
"
,
"
coupon
"
:
"
领劵中心
"
,
"
user_coupon
"
:
"
优惠劵
"
,
},
// 请求地址
...
...
public/appmini/old/alipay/app.json
浏览文件 @
81a5bca7
...
...
@@ -25,7 +25,9 @@
"pages/user-integral/user-integral"
,
"pages/user-goods-browse/user-goods-browse"
,
"pages/user-orderaftersale/user-orderaftersale"
,
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
,
"pages/coupon/coupon"
,
"pages/user-coupon/user-coupon"
],
"window"
:
{
"defaultTitle"
:
"shopxo"
,
...
...
public/appmini/old/alipay/pages/coupon/coupon.acss
0 → 100644
浏览文件 @
81a5bca7
public/appmini/old/alipay/pages/coupon/coupon.axml
0 → 100644
浏览文件 @
81a5bca7
<image a:if="{{(data_base || null) != null && (data_base.banner_images || null) != null}}" class="banner wh-auto dis-block" src="{{data_base.banner_images}}" mode="widthFix" />
<!-- 优惠劵列表 -->
<view a:if="{{data_list.length > 0}}" class="coupon-container">
<block a:for="{{data_list}}">
<view class="item spacing-mt 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_unit}}</text>
<text a:if="{{(item.desc || null) != null}}" class="desc cr-888">{{item.desc}}</text>
</view>
<view a: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" onTap="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>
</view>
</block>
</view>
<view a:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
\ No newline at end of file
public/appmini/old/alipay/pages/coupon/coupon.js
0 → 100644
浏览文件 @
81a5bca7
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
data_list
:
[],
data_base
:
null
,
},
onLoad
(
params
)
{
this
.
init
();
},
onShow
()
{
my
.
setNavigationBar
({
title
:
app
.
data
.
common_pages_title
.
coupon
});
},
init
()
{
// 获取数据
this
.
get_data_list
();
},
// 获取数据
get_data_list
()
{
var
self
=
this
;
my
.
showLoading
({
title
:
"
加载中...
"
});
if
(
self
.
data
.
data_list
.
length
<=
0
)
{
self
.
setData
({
data_list_loding_status
:
1
});
}
my
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
var
status
=
((
data
.
data
||
[]).
length
>
0
);
this
.
setData
({
data_base
:
data
.
base
||
null
,
data_list
:
data
.
data
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
status
?
3
:
0
,
data_bottom_line_status
:
status
,
});
// 导航名称
if
((
data
.
base
||
null
)
!=
null
&&
(
data
.
base
.
application_name
||
null
)
!=
null
)
{
my
.
setNavigationBar
({
title
:
data
.
base
.
application_name
});
}
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
,
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
my
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_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
.
data_list
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
my
.
showLoading
({
title
:
"
处理中...
"
});
my
.
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
=>
{
my
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
data_base
!=
null
&&
self
.
data
.
data_base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
data_list
:
temp_list
});
}
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
my
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data_list
();
},
});
public/appmini/old/alipay/pages/coupon/coupon.json
0 → 100644
浏览文件 @
81a5bca7
{
"pullRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/alipay/pages/goods-detail/goods-detail.acss
浏览文件 @
81a5bca7
...
...
@@ -266,4 +266,34 @@
}
.limitedtimediscount .countdown .ds {
padding: 0 4rpx;
}
/*
* 优惠劵 - 插件
*/
.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/alipay/pages/goods-detail/goods-detail.axml
浏览文件 @
81a5bca7
...
...
@@ -55,6 +55,29 @@
</view>
</view>
<!-- 优惠劵 -->
<view a: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 a:for="{{plugins_coupon_data.data}}">
<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_unit}}</text>
</view>
<view a:if="{{(item.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.use_limit_type_name}}</view>
<view a:if="{{(item.desc || null) != null}}" class="desc cr-888 single-text">{{item.desc}}</view>
</view>
<view class="v-right fr" onTap="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>
</view>
</block>
</scroll-view>
</view>
<!-- 属性导航 -->
<!-- <view a:if="{{false}}" class="spacing">
<view class="goods-attr-show-title bg-white arrow-right cr-666" onTap="good_attribute_nav_event">
...
...
public/appmini/old/alipay/pages/goods-detail/goods-detail.js
浏览文件 @
81a5bca7
...
...
@@ -40,6 +40,9 @@ Page({
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
// 优惠劵
plugins_coupon_data
:
null
,
},
onLoad
(
params
)
{
...
...
@@ -113,6 +116,7 @@ Page({
common_app_is_limitedtimediscount
:
data
.
common_app_is_limitedtimediscount
||
0
,
plugins_limitedtimediscount_data
:
data
.
plugins_limitedtimediscount_data
||
null
,
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
});
// 限时秒杀倒计时
...
...
@@ -713,6 +717,51 @@ Page({
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
my
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_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
)
{
my
.
showLoading
({
title
:
"
处理中...
"
});
my
.
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
=>
{
my
.
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
:
()
=>
{
my
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
},
// 自定义分享
onShareAppMessage
()
{
var
user
=
app
.
get_user_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
...
...
public/appmini/old/alipay/pages/user-coupon/user-coupon.acss
0 → 100644
浏览文件 @
81a5bca7
/*
* 导航
*/
.nav-tabs {
overflow: hidden;
background: #eee;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 1;
}
.nav-tabs .nav-item {
text-align: center;
width: 33.33%;
height: 80rpx;
line-height: 80rpx;
border-bottom: 6rpx solid transparent;
}
.nav-tabs .nav-item-active {
color: #d2364c;
border-bottom: 6rpx solid #d2364c;
}
/*
* 数据列表
*/
.coupon-container {
margin-top: 100rpx;
}
.coupon-container .item,
.coupon-container .v-right,
.coupon-container .v-right .circle {
height: 230rpx;
}
\ No newline at end of file
public/appmini/old/alipay/pages/user-coupon/user-coupon.axml
0 → 100644
浏览文件 @
81a5bca7
<view a:if="{{data_list != null}}">
<!-- 导航 -->
<view class="nav-tabs">
<block a:for="{{nav_tabs_list}}">
<view class="nav-item cr-666 fl {{item.value == nav_tabs_value ? 'nav-item-active' : ''}}" data-index="{{index}}" data-value="{{item.value}}" onTap="nav_tabs_event">{{item.name}}</view>
</block>
</view>
<!-- 优惠劵列表 -->
<view class="coupon-container">
<!-- 未使用 -->
<view a:if="{{(data_list.not_use || null) != null && data_list.not_use.length > 0 && nav_tabs_value == 'not_use'}}">
<block a:for="{{data_list.not_use}}">
<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>
<navigator url="/pages/index/index" open-type="switchTab" hover-class="none">
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};">
<text class="circle"></text>
<text>去使用</text>
</view>
</navigator>
</view>
</block>
</view>
<!-- 已使用 -->
<view a:if="{{(data_list.already_use || null) != null && data_list.already_use.length > 0 && nav_tabs_value == 'already_use'}}">
<block a:for="{{data_list.already_use}}">
<view class="item spacing-mt bg-white item-disabled">
<view class="v-left fl">
<view class="base single-text">
<text class="symbol">¥</text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.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.use_time_text}}</view>
</view>
<view class="v-right fr">
<text class="circle"></text>
<text>已使用</text>
</view>
</view>
</block>
</view>
<!-- 已过期 -->
<view a:if="{{(data_list.already_expire || null) != null && data_list.already_expire.length > 0 && nav_tabs_value == 'already_expire'}}">
<block a:for="{{data_list.already_expire}}">
<view class="item spacing-mt bg-white item-disabled">
<view class="v-left fl">
<view class="base single-text">
<text class="symbol">¥</text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.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_end_text}}</view>
</view>
<view class="v-right fr">
<text class="circle"></text>
<text>已过期</text>
</view>
</view>
</block>
</view>
</view>
</view>
<view a:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.axml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
\ No newline at end of file
public/appmini/old/alipay/pages/user-coupon/user-coupon.js
0 → 100644
浏览文件 @
81a5bca7
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
data_list
:
null
,
nav_tabs_list
:
[
{
name
:
"
未使用
"
,
value
:
"
not_use
"
},
{
name
:
"
已使用
"
,
value
:
"
already_use
"
},
{
name
:
"
已过期
"
,
value
:
"
already_expire
"
},
],
nav_tabs_value
:
'
not_use
'
,
},
onLoad
(
params
)
{
this
.
init
();
},
onShow
()
{
my
.
setNavigationBar
({
title
:
app
.
data
.
common_pages_title
.
user_coupon
});
},
init
()
{
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
my
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
},
// 获取数据
get_data_list
()
{
var
self
=
this
;
my
.
showLoading
({
title
:
"
加载中...
"
});
if
(
this
.
data
.
data_list
==
null
||
(
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
]
||
null
)
==
null
||
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
].
length
<=
0
)
{
this
.
setData
({
data_list_loding_status
:
1
});
}
my
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
self
.
setData
({
data_list
:
res
.
data
.
data
||
null
,
data_list_loding_msg
:
''
,
});
self
.
data_view_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
my
.
hideLoading
();
my
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
,
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 数据处理
data_view_handle
()
{
var
status
=
0
;
if
(
this
.
data
.
data_list
!=
null
&&
(
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
]
||
null
)
!=
null
&&
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
].
length
>
0
)
{
status
=
3
;
}
this
.
setData
({
data_list_loding_status
:
status
,
data_bottom_line_status
:
(
status
==
3
),
});
},
// 导航事件
nav_tabs_event
(
e
)
{
this
.
setData
({
nav_tabs_value
:
e
.
currentTarget
.
dataset
.
value
});
this
.
data_view_handle
();
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data_list
();
},
});
public/appmini/old/alipay/pages/user-coupon/user-coupon.json
0 → 100644
浏览文件 @
81a5bca7
{
"pullRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/baidu/app.css
浏览文件 @
81a5bca7
...
...
@@ -405,4 +405,74 @@ button[disabled].bg-primary {
width
:
210
rpx
;
height
:
210
rpx
;
border
:
1px
dashed
#e9e9e9
;
}
/*
* 优惠劵 - 插件
*/
.coupon-container
{
padding
:
0
10
rpx
;
}
.coupon-container
.item
{
overflow
:
hidden
;
height
:
180
rpx
;
border
:
1px
solid
#D2364C
;
}
.coupon-container
.v-left
{
width
:
calc
(
100%
-
140
rpx
);
padding
:
30
rpx
0
30
rpx
20
rpx
;
box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
}
.coupon-container
.v-left
.base
{
color
:
#D2364C
;
}
.coupon-container
.v-left
.base
.symbol
{
font-family
:
Verdana
,
Tahoma
;
font-size
:
48
rpx
;
font-weight
:
400
;
}
.coupon-container
.v-left
.base
.price
{
font-weight
:
700
;
font-family
:
arial
;
font-size
:
76
rpx
;
}
.coupon-container
.v-left
.base
.desc
{
margin-left
:
20
rpx
;
}
.coupon-container
.v-left
base-tips
,
.coupon-container
.v-left
.base-time
{
margin-top
:
10
rpx
;
}
.coupon-container
.v-right
{
background
:
#d2364c
;
width
:
140
rpx
;
height
:
180
rpx
;
color
:
#fff
;
font-weight
:
500
;
position
:
relative
;
text-align
:
center
;
}
.coupon-container
.v-right
:before
{
content
:
''
;
display
:
inline-block
;
height
:
100%
;
vertical-align
:
middle
;
}
.coupon-container
.v-right
.circle
{
display
:
block
;
position
:
absolute
;
left
:
-1px
;
top
:
-3px
;
width
:
3px
;
height
:
180
rpx
;
background
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAACpCAYAAADur4c3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo3MjUzYzIwOS04ZWNlLTRlNTctODQ4OC01ZDExOTkwOGNkYmMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTM1QzgxREZGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTM1QzgxREVGRDI5MTFFNTg3QjhGRUQ1MDY5OURERUQiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTJiNzVkOGUtZDc2Yi00MzEzLWFmNmYtYTJkNTRlYTI4YTY1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjcyNTNjMjA5LThlY2UtNGU1Ny04NDg4LTVkMTE5OTA4Y2RiYyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pvy+vnQAAAEqSURBVHjaYvz//z8DDDAxIAFyOVeBOAHEYfyPMDsLmXMfmfMT2YADDP8h4CEQq4A4aUDMA1LNSKZDXwJxGcg1yJaWIXOeInO+IxuwA+acK0AsA+IEADEbic7hhPOAer4DcQcQMyNb2oLMeYVsADcyZwPMObuBWBTEsQFpI9E54sjO+QvEc0F+YoHKJgHxJ2TnvEM2gBmZswrmnA1AzAXiaJPhHC1k58BNQ3bBTGTOR2QD/iJzFsH8Mw/kHxBHggzn2KA7BxzWyC5Yisz5imwACmc2LLY7QbEN4nCS4ZwAIGZFds5lUEpEdsF6nKn3PTJnAsiAV0BcBsSM5GamFCDmQXYOOJ8iu2Anzrz9HKU8ABlwDYgTKcnbo0XNaFEzWtQgipqOYVLUAAQYAKPWa4c8cIHnAAAAAElFTkSuQmCC)
no-repeat
;
}
.coupon-container
.item-disabled
.v-right
{
background
:
#dfdfdf
!important
;
color
:
#c0c0c0
!important
;
cursor
:
no-drop
!important
;
}
.coupon-container
.item-disabled
{
border
:
1px
solid
#dfdfdf
!important
;
}
\ No newline at end of file
public/appmini/old/baidu/app.js
浏览文件 @
81a5bca7
...
...
@@ -55,6 +55,8 @@ App({
"
user_orderaftersale
"
:
"
退款/售后
"
,
"
user_orderaftersale_detail
"
:
"
订单售后
"
,
"
user_order_comments
"
:
"
订单评论
"
,
"
coupon
"
:
"
领劵中心
"
,
"
user_coupon
"
:
"
优惠劵
"
,
},
// 请求地址
...
...
public/appmini/old/baidu/app.json
浏览文件 @
81a5bca7
...
...
@@ -25,7 +25,9 @@
"pages/user-integral/user-integral"
,
"pages/user-goods-browse/user-goods-browse"
,
"pages/user-orderaftersale/user-orderaftersale"
,
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
,
"pages/coupon/coupon"
,
"pages/user-coupon/user-coupon"
],
"window"
:
{
"navigationBarTitleText"
:
"{{application_title}}"
,
...
...
public/appmini/old/baidu/pages/coupon/coupon.css
0 → 100644
浏览文件 @
81a5bca7
public/appmini/old/baidu/pages/coupon/coupon.js
0 → 100644
浏览文件 @
81a5bca7
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
data_list
:
[],
data_base
:
null
},
onLoad
(
params
)
{
this
.
init
();
},
onShow
()
{
swan
.
setNavigationBarTitle
({
title
:
app
.
data
.
common_pages_title
.
coupon
});
},
init
()
{
// 获取数据
this
.
get_data_list
();
},
// 获取数据
get_data_list
()
{
var
self
=
this
;
swan
.
showLoading
({
title
:
"
加载中...
"
});
if
(
self
.
data
.
data_list
.
length
<=
0
)
{
self
.
setData
({
data_list_loding_status
:
1
});
}
swan
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
swan
.
hideLoading
();
swan
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
var
status
=
(
data
.
data
||
[]).
length
>
0
;
this
.
setData
({
data_base
:
data
.
base
||
null
,
data_list
:
data
.
data
||
[],
data_list_loding_msg
:
''
,
data_list_loding_status
:
status
?
3
:
0
,
data_bottom_line_status
:
status
});
// 导航名称
if
((
data
.
base
||
null
)
!=
null
&&
(
data
.
base
.
application_name
||
null
)
!=
null
)
{
swan
.
setNavigationBarTitle
({
title
:
data
.
base
.
application_name
});
}
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
swan
.
hideLoading
();
swan
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
swan
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_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
.
data_list
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
swan
.
showLoading
({
title
:
"
处理中...
"
});
swan
.
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
=>
{
swan
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
data_base
!=
null
&&
self
.
data
.
data_base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
data_list
:
temp_list
});
}
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
swan
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data_list
();
}
});
\ No newline at end of file
public/appmini/old/baidu/pages/coupon/coupon.json
0 → 100644
浏览文件 @
81a5bca7
{
"enablePullDownRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/baidu/pages/coupon/coupon.swan
0 → 100644
浏览文件 @
81a5bca7
<image s-if="(data_base || null) != null && (data_base.banner_images || null) != null" class="banner wh-auto dis-block" src="{{data_base.banner_images}}" mode="widthFix" />
<!-- 优惠劵列表 -->
<view s-if="data_list.length > 0" class="coupon-container">
<block s-for="item, index in data_list" s-key="item">
<view class="item spacing-mt 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_unit}}</text>
<text s-if="(item.desc || null) != null" class="desc cr-888">{{item.desc}}</text>
</view>
<view s-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="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>
</view>
</block>
</view>
<view s-if="data_list_loding_status != 3">
<import src="/pages/common/nodata.swan" />
<template is="nodata" data="{{{status: data_list_loding_status, msg: data_list_loding_msg}}}"></template>
</view>
<import src="/pages/common/bottom_line.swan" />
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
\ No newline at end of file
public/appmini/old/baidu/pages/goods-detail/goods-detail.css
浏览文件 @
81a5bca7
...
...
@@ -295,4 +295,34 @@
}
.limitedtimediscount
.countdown
.ds
{
padding
:
0
4
rpx
;
}
/*
* 优惠劵 - 插件
*/
.coupon-container
{
white-space
:
nowrap
;
box-sizing
:
border-box
;
padding
:
20
rpx
10
rpx
;
}
.coupon-container
scroll-view
{
height
:
174
rpx
;
}
.coupon-container
.item
{
display
:
inline-block
;
width
:
60vw
;
}
.coupon-container
.v-left
{
padding
:
20
rpx
0
20
rpx
20
rpx
;
}
.coupon-container
.item
:not
(
:last-child
)
{
margin-right
:
20
rpx
;
}
.coupon-container
.item
,
.coupon-container
.v-right
,
.coupon-container
.v-right
.circle
{
height
:
170
rpx
;
}
.coupon-container
.v-left
.base
.price
{
font-size
:
46
rpx
;
}
\ No newline at end of file
public/appmini/old/baidu/pages/goods-detail/goods-detail.js
浏览文件 @
81a5bca7
...
...
@@ -41,6 +41,9 @@ Page({
plugins_limitedtimediscount_time_millisecond
:
0
,
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
// 优惠劵
plugins_coupon_data
:
null
,
},
onLoad
(
params
)
{
...
...
@@ -112,7 +115,8 @@ Page({
common_app_is_use_mobile_detail
:
data
.
common_app_is_use_mobile_detail
||
0
,
common_app_is_limitedtimediscount
:
data
.
common_app_is_limitedtimediscount
||
0
,
plugins_limitedtimediscount_data
:
data
.
plugins_limitedtimediscount_data
||
null
plugins_limitedtimediscount_data
:
data
.
plugins_limitedtimediscount_data
||
null
,
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
});
// 限时秒杀倒计时
...
...
@@ -662,6 +666,50 @@ Page({
clearInterval
(
this
.
data
.
plugins_limitedtimediscount_timers
);
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
swan
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_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
)
{
swan
.
showLoading
({
title
:
"
处理中...
"
});
swan
.
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
=>
{
swan
.
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
:
()
=>
{
swan
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
},
// 自定义分享
onShareAppMessage
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
onShareAppMessage
'
)
||
null
;
...
...
public/appmini/old/baidu/pages/goods-detail/goods-detail.swan
浏览文件 @
81a5bca7
...
...
@@ -59,6 +59,29 @@
</view>
</view>
<!-- 优惠劵 -->
<view s-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 s-for="item, index in plugins_coupon_data.data" s-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_unit}}</text>
</view>
<view s-if="(item.use_limit_type_name || null) != null" class="base-tips cr-666 single-text">{{item.use_limit_type_name}}</view>
<view s-if="(item.desc || null) != null" class="desc cr-888 single-text">{{item.desc}}</view>
</view>
<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>
</view>
</block>
</scroll-view>
</view>
<!-- 属性导航 -->
<!-- <view wx:if="{{false}}" class="spacing">
<view class="goods-attr-show-title bg-white arrow-right cr-666" bindtap="good_attribute_nav_event">
...
...
public/appmini/old/baidu/pages/user-coupon/user-coupon.css
0 → 100644
浏览文件 @
81a5bca7
/*
* 导航
*/
.nav-tabs
{
overflow
:
hidden
;
background
:
#eee
;
position
:
fixed
;
left
:
0
;
top
:
0
;
width
:
100%
;
z-index
:
1
;
}
.nav-tabs
.nav-item
{
text-align
:
center
;
width
:
33.33%
;
height
:
80
rpx
;
line-height
:
80
rpx
;
border-bottom
:
6
rpx
solid
transparent
;
}
.nav-tabs
.nav-item-active
{
color
:
#d2364c
;
border-bottom
:
6
rpx
solid
#d2364c
;
}
/*
* 数据列表
*/
.coupon-container
{
margin-top
:
100
rpx
;
}
.coupon-container
.item
,
.coupon-container
.v-right
,
.coupon-container
.v-right
.circle
{
height
:
230
rpx
;
}
\ No newline at end of file
public/appmini/old/baidu/pages/user-coupon/user-coupon.js
0 → 100644
浏览文件 @
81a5bca7
const
app
=
getApp
();
Page
({
data
:
{
data_bottom_line_status
:
false
,
data_list_loding_status
:
1
,
data_list_loding_msg
:
''
,
data_list
:
null
,
nav_tabs_list
:
[{
name
:
"
未使用
"
,
value
:
"
not_use
"
},
{
name
:
"
已使用
"
,
value
:
"
already_use
"
},
{
name
:
"
已过期
"
,
value
:
"
already_expire
"
}],
nav_tabs_value
:
'
not_use
'
},
onLoad
(
params
)
{
this
.
init
();
},
onShow
()
{
swan
.
setNavigationBarTitle
({
title
:
app
.
data
.
common_pages_title
.
user_coupon
});
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
swan
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
},
// 获取数据
get_data_list
()
{
var
self
=
this
;
swan
.
showLoading
({
title
:
"
加载中...
"
});
if
(
this
.
data
.
data_list
==
null
||
(
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
]
||
null
)
==
null
||
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
].
length
<=
0
)
{
this
.
setData
({
data_list_loding_status
:
1
});
}
swan
.
request
({
url
:
app
.
get_request_url
(
"
user
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
swan
.
hideLoading
();
swan
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
self
.
setData
({
data_list
:
res
.
data
.
data
||
null
,
data_list_loding_msg
:
''
});
self
.
data_view_handle
();
}
else
{
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
});
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
swan
.
hideLoading
();
swan
.
stopPullDownRefresh
();
self
.
setData
({
data_bottom_line_status
:
false
,
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
服务器请求出错
'
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 数据处理
data_view_handle
()
{
var
status
=
0
;
if
(
this
.
data
.
data_list
!=
null
&&
(
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
]
||
null
)
!=
null
&&
this
.
data
.
data_list
[
this
.
data
.
nav_tabs_value
].
length
>
0
)
{
status
=
3
;
}
this
.
setData
({
data_list_loding_status
:
status
,
data_bottom_line_status
:
status
==
3
});
},
// 导航事件
nav_tabs_event
(
e
)
{
this
.
setData
({
nav_tabs_value
:
e
.
currentTarget
.
dataset
.
value
});
this
.
data_view_handle
();
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data_list
();
}
});
\ No newline at end of file
public/appmini/old/baidu/pages/user-coupon/user-coupon.json
0 → 100644
浏览文件 @
81a5bca7
{
"enablePullDownRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/baidu/pages/user-coupon/user-coupon.swan
0 → 100644
浏览文件 @
81a5bca7
<view s-if="data_list != null">
<!-- 导航 -->
<view class="nav-tabs">
<block s-for="item, index in nav_tabs_list" s-key="item">
<view class="nav-item cr-666 fl {{item.value == nav_tabs_value ? 'nav-item-active' : ''}}" data-index="{{index}}" data-value="{{item.value}}" bindtap="nav_tabs_event">{{item.name}}</view>
</block>
</view>
<!-- 优惠劵列表 -->
<view class="coupon-container">
<!-- 未使用 -->
<view s-if="(data_list.not_use || null) != null && data_list.not_use.length > 0 && nav_tabs_value == 'not_use'">
<block s-for="item, index in data_list.not_use" s-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 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>
<navigator url="/pages/index/index" open-type="switchTab" hover-class="none">
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};">
<text class="circle"></text>
<text>去使用</text>
</view>
</navigator>
</view>
</block>
</view>
<!-- 已使用 -->
<view s-if="(data_list.already_use || null) != null && data_list.already_use.length > 0 && nav_tabs_value == 'already_use'">
<block s-for="item, index in data_list.already_use" s-key="item">
<view class="item spacing-mt bg-white item-disabled">
<view class="v-left fl">
<view class="base single-text">
<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.use_time_text}}</view>
</view>
<view class="v-right fr">
<text class="circle"></text>
<text>已使用</text>
</view>
</view>
</block>
</view>
<!-- 已过期 -->
<view s-if="(data_list.already_expire || null) != null && data_list.already_expire.length > 0 && nav_tabs_value == 'already_expire'">
<block s-for="item, index in data_list.already_expire" s-key="item">
<view class="item spacing-mt bg-white item-disabled">
<view class="v-left fl">
<view class="base single-text">
<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_end_text}}</view>
</view>
<view class="v-right fr">
<text class="circle"></text>
<text>已过期</text>
</view>
</view>
</block>
</view>
</view>
</view>
<view s-if="data_list_loding_status != 3">
<import src="/pages/common/nodata.swan" />
<template is="nodata" data="{{{status: data_list_loding_status, msg: data_list_loding_msg}}}"></template>
</view>
<import src="/pages/common/bottom_line.swan" />
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
\ No newline at end of file
public/appmini/old/weixin/app.wxss
浏览文件 @
81a5bca7
...
...
@@ -445,7 +445,6 @@ button[disabled].bg-primary {
.coupon-container .v-left base-tips, .coupon-container .v-left .base-time {
margin-top: 10rpx;
}
.coupon-container .v-right {
background: #d2364c;
width: 140rpx;
...
...
public/appmini/old/weixin/pages/coupon/coupon.js
浏览文件 @
81a5bca7
...
...
@@ -25,9 +25,12 @@ Page({
get_data_list
()
{
var
self
=
this
;
wx
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
if
(
self
.
data
.
data_list
.
length
<=
0
)
{
self
.
setData
({
data_list_loding_status
:
1
});
}
wx
.
request
({
url
:
app
.
get_request_url
(
"
index
"
,
"
coupon
"
),
...
...
@@ -76,12 +79,12 @@ Page({
},
// 优惠劵领取事件
receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
receive_event
"
);
coupon_
receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_
receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
wx
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=receive_event
"
url
:
"
/pages/login/login?event_callback=
coupon_
receive_event
"
});
return
false
;
}
else
{
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
81a5bca7
...
...
@@ -789,11 +789,11 @@ Page({
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
receive_event
"
);
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_
receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
wx
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=receive_event
"
url
:
"
/pages/login/login?event_callback=
coupon_
receive_event
"
});
return
false
;
}
else
{
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
浏览文件 @
81a5bca7
...
...
@@ -292,11 +292,9 @@
padding: 0 4rpx;
}
/*
* 优惠劵 - 插件
*/
.coupon-container {
white-space: nowrap;
box-sizing: border-box;
...
...
public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
浏览文件 @
81a5bca7
...
...
@@ -40,7 +40,7 @@
<view class="base single-text">
<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>
...
...
@@ -62,7 +62,7 @@
<view class="base single-text">
<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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录