diff --git a/application/service/PluginsService.php b/application/service/PluginsService.php
index 3a83967f524422e0a5d24d1d29df1dee1896eaf9..7335df767987d8c0b934cfd4353609e64f90386f 100755
--- a/application/service/PluginsService.php
+++ b/application/service/PluginsService.php
@@ -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)
{
diff --git a/public/appmini/old/alipay/app.acss b/public/appmini/old/alipay/app.acss
index 56959c4916b2022d281a03b0a56f9bc74118a98b..7fa3fe4f5024e54179d93f2a4fd764bf0d799b3e 100644
--- a/public/appmini/old/alipay/app.acss
+++ b/public/appmini/old/alipay/app.acss
@@ -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
diff --git a/public/appmini/old/alipay/app.js b/public/appmini/old/alipay/app.js
index 45d762b0c1cf083f3d48f77384f5333dd31f7661..347436d59279cd5ce4fc90790b9166eef51a6a14 100644
--- a/public/appmini/old/alipay/app.js
+++ b/public/appmini/old/alipay/app.js
@@ -60,6 +60,8 @@ App({
"user_orderaftersale": "退款/售后",
"user_orderaftersale_detail": "订单售后",
"user_order_comments": "订单评论",
+ "coupon": "领劵中心",
+ "user_coupon": "优惠劵",
},
// 请求地址
diff --git a/public/appmini/old/alipay/app.json b/public/appmini/old/alipay/app.json
index 52281267119d71b68ca6a34de716263d8328b037..ae2b02648b4f3effd162e8c994e9646f817d19f4 100644
--- a/public/appmini/old/alipay/app.json
+++ b/public/appmini/old/alipay/app.json
@@ -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",
diff --git a/public/appmini/old/alipay/pages/coupon/coupon.acss b/public/appmini/old/alipay/pages/coupon/coupon.acss
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/public/appmini/old/alipay/pages/coupon/coupon.axml b/public/appmini/old/alipay/pages/coupon/coupon.axml
new file mode 100644
index 0000000000000000000000000000000000000000..24037eb5bd7246bf2a1d33b1630216af7bc899bd
--- /dev/null
+++ b/public/appmini/old/alipay/pages/coupon/coupon.axml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ ¥
+ {{item.discount_value}}
+ {{item.type_unit}}
+ {{item.desc}}
+
+ {{item.use_limit_type_name}}
+
+
+
+ {{item.is_operable_name}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/coupon/coupon.js b/public/appmini/old/alipay/pages/coupon/coupon.js
new file mode 100644
index 0000000000000000000000000000000000000000..2482429765a60f932cca891212ce987e2b04fa04
--- /dev/null
+++ b/public/appmini/old/alipay/pages/coupon/coupon.js
@@ -0,0 +1,131 @@
+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();
+ },
+
+});
diff --git a/public/appmini/old/alipay/pages/coupon/coupon.json b/public/appmini/old/alipay/pages/coupon/coupon.json
new file mode 100644
index 0000000000000000000000000000000000000000..ed3a57db1414299558d96397899dde30bc79134f
--- /dev/null
+++ b/public/appmini/old/alipay/pages/coupon/coupon.json
@@ -0,0 +1,3 @@
+{
+ "pullRefresh": true
+}
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/goods-detail/goods-detail.acss b/public/appmini/old/alipay/pages/goods-detail/goods-detail.acss
index 338e4b8e66d6bae36a09f458deb84d786f0f9fae..0895ec716f76a3660bbf58e622b3402f27d8dd0f 100644
--- a/public/appmini/old/alipay/pages/goods-detail/goods-detail.acss
+++ b/public/appmini/old/alipay/pages/goods-detail/goods-detail.acss
@@ -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
diff --git a/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml b/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
index 86cf0f05e2b10a09763f581f7c4febffbb728013..e470bf9119d6c3bc5624948a2edd2af96c7af8a9 100644
--- a/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
+++ b/public/appmini/old/alipay/pages/goods-detail/goods-detail.axml
@@ -55,6 +55,29 @@
+
+
+
+
+
+
+
+ ¥
+ {{item.discount_value}}
+ {{item.type_unit}}
+
+ {{item.use_limit_type_name}}
+ {{item.desc}}
+
+
+
+ {{item.is_operable_name}}
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.coupon.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ {{item.time_start_text}} 至 {{item.time_end_text}}
+
+
+
+
+ 去使用
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ 使用 {{item.use_time_text}}
+
+
+
+ 已使用
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ 过期 {{item.time_end_text}}
+
+
+
+ 已过期
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/appmini/old/alipay/pages/user-coupon/user-coupon.js b/public/appmini/old/alipay/pages/user-coupon/user-coupon.js
new file mode 100644
index 0000000000000000000000000000000000000000..9762ceb3ff4fd2b1a44aefbdd83c51545203a691
--- /dev/null
+++ b/public/appmini/old/alipay/pages/user-coupon/user-coupon.js
@@ -0,0 +1,108 @@
+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();
+ },
+
+});
diff --git a/public/appmini/old/alipay/pages/user-coupon/user-coupon.json b/public/appmini/old/alipay/pages/user-coupon/user-coupon.json
new file mode 100644
index 0000000000000000000000000000000000000000..ed3a57db1414299558d96397899dde30bc79134f
--- /dev/null
+++ b/public/appmini/old/alipay/pages/user-coupon/user-coupon.json
@@ -0,0 +1,3 @@
+{
+ "pullRefresh": true
+}
\ No newline at end of file
diff --git a/public/appmini/old/baidu/app.css b/public/appmini/old/baidu/app.css
index 93c2bc256911758a975cb3a881007ab4ec9c3005..4fe08e418eede6ef01b3e73f676235e559d1ebde 100755
--- a/public/appmini/old/baidu/app.css
+++ b/public/appmini/old/baidu/app.css
@@ -405,4 +405,74 @@ button[disabled].bg-primary {
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
diff --git a/public/appmini/old/baidu/app.js b/public/appmini/old/baidu/app.js
index c60b5c06b159f5d17e846e71d3c9608fa9467ad1..0cae405a06350e0244469cedb2b3c1be8e3abbbb 100755
--- a/public/appmini/old/baidu/app.js
+++ b/public/appmini/old/baidu/app.js
@@ -55,6 +55,8 @@ App({
"user_orderaftersale": "退款/售后",
"user_orderaftersale_detail": "订单售后",
"user_order_comments": "订单评论",
+ "coupon": "领劵中心",
+ "user_coupon": "优惠劵",
},
// 请求地址
diff --git a/public/appmini/old/baidu/app.json b/public/appmini/old/baidu/app.json
index 1c43ee16a3cba62cc50ab943f50e1556224f4cd9..5caf4d933017de0ff1f6c55c6cab57b281246768 100755
--- a/public/appmini/old/baidu/app.json
+++ b/public/appmini/old/baidu/app.json
@@ -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}}",
diff --git a/public/appmini/old/baidu/pages/coupon/coupon.css b/public/appmini/old/baidu/pages/coupon/coupon.css
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/public/appmini/old/baidu/pages/coupon/coupon.js b/public/appmini/old/baidu/pages/coupon/coupon.js
new file mode 100644
index 0000000000000000000000000000000000000000..d3137fdee8a3f0813beed38ceec11c90a5af9d03
--- /dev/null
+++ b/public/appmini/old/baidu/pages/coupon/coupon.js
@@ -0,0 +1,129 @@
+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
diff --git a/public/appmini/old/baidu/pages/coupon/coupon.json b/public/appmini/old/baidu/pages/coupon/coupon.json
new file mode 100644
index 0000000000000000000000000000000000000000..331ad4f3d98660918818a7657404ac8cb0a6f312
--- /dev/null
+++ b/public/appmini/old/baidu/pages/coupon/coupon.json
@@ -0,0 +1,3 @@
+{
+ "enablePullDownRefresh": true
+}
\ No newline at end of file
diff --git a/public/appmini/old/baidu/pages/coupon/coupon.swan b/public/appmini/old/baidu/pages/coupon/coupon.swan
new file mode 100644
index 0000000000000000000000000000000000000000..578f9a557bf9e67a42819a5e4ab0de6e660731d1
--- /dev/null
+++ b/public/appmini/old/baidu/pages/coupon/coupon.swan
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+ ¥
+ {{item.discount_value}}
+ {{item.type_unit}}
+ {{item.desc}}
+
+ {{item.use_limit_type_name}}
+
+
+
+ {{item.is_operable_name}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/appmini/old/baidu/pages/goods-detail/goods-detail.css b/public/appmini/old/baidu/pages/goods-detail/goods-detail.css
index cb8b4a63ad1bb90ee3ad7278e2b15a2ce1d60d9a..bfbaf19109b4384ceb04ea677c9c622583018147 100755
--- a/public/appmini/old/baidu/pages/goods-detail/goods-detail.css
+++ b/public/appmini/old/baidu/pages/goods-detail/goods-detail.css
@@ -295,4 +295,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
diff --git a/public/appmini/old/baidu/pages/goods-detail/goods-detail.js b/public/appmini/old/baidu/pages/goods-detail/goods-detail.js
index 469b85856ae70a87e5a2be3fd70a3384c2aa649f..888541e678234efbd1582184e6c9cea34060c880 100755
--- a/public/appmini/old/baidu/pages/goods-detail/goods-detail.js
+++ b/public/appmini/old/baidu/pages/goods-detail/goods-detail.js
@@ -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;
diff --git a/public/appmini/old/baidu/pages/goods-detail/goods-detail.swan b/public/appmini/old/baidu/pages/goods-detail/goods-detail.swan
index 1bf5bf2e09366da7c2e107960838940b3b059319..ae92f3bc414aa5bd404022d9984dfe4db1f0f17f 100755
--- a/public/appmini/old/baidu/pages/goods-detail/goods-detail.swan
+++ b/public/appmini/old/baidu/pages/goods-detail/goods-detail.swan
@@ -59,6 +59,29 @@
+
+
+
+
+
+
+
+ ¥
+ {{item.discount_value}}
+ {{item.type_unit}}
+
+ {{item.use_limit_type_name}}
+ {{item.desc}}
+
+
+
+ {{item.is_operable_name}}
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.coupon.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ {{item.time_start_text}} 至 {{item.time_end_text}}
+
+
+
+
+ 去使用
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.coupon.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ 使用 {{item.use_time_text}}
+
+
+
+ 已使用
+
+
+
+
+
+
+
+
+
+
+
+ ¥
+ {{item.coupon.discount_value}}
+ {{item.coupon.type_unit}}
+ {{item.coupon.desc}}
+
+ {{item.coupon.use_limit_type_name}}
+ 过期 {{item.time_end_text}}
+
+
+
+ 已过期
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/appmini/old/weixin/app.wxss b/public/appmini/old/weixin/app.wxss
index d0fb71f170639fd596fdbd2d18ad67d72bed0c0b..5a853961dedd8f1fd3e08db55dfbe173812e51b7 100755
--- a/public/appmini/old/weixin/app.wxss
+++ b/public/appmini/old/weixin/app.wxss
@@ -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;
diff --git a/public/appmini/old/weixin/pages/coupon/coupon.js b/public/appmini/old/weixin/pages/coupon/coupon.js
index 8c52f184f23912c9a214e68a847c5508f15deca1..a6b8e13180c64192d4c0a8fee1aebe6824bafea8 100644
--- a/public/appmini/old/weixin/pages/coupon/coupon.js
+++ b/public/appmini/old/weixin/pages/coupon/coupon.js
@@ -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 {
diff --git a/public/appmini/old/weixin/pages/goods-detail/goods-detail.js b/public/appmini/old/weixin/pages/goods-detail/goods-detail.js
index 76595254dbb803460fa157b5f66d21215ae027c6..e0932bbafa50a75ec4a260819f021b60a05e972c 100755
--- a/public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+++ b/public/appmini/old/weixin/pages/goods-detail/goods-detail.js
@@ -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 {
diff --git a/public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss b/public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
index 381a66842c96f2de42338ea6e3beb2ef0c190651..7da1b3dda9e2255fb29f88db1211a344023b8be4 100755
--- a/public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
+++ b/public/appmini/old/weixin/pages/goods-detail/goods-detail.wxss
@@ -292,11 +292,9 @@
padding: 0 4rpx;
}
-
/*
* 优惠劵 - 插件
*/
-
.coupon-container {
white-space: nowrap;
box-sizing: border-box;
diff --git a/public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml b/public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
index 53ccd76bf003e59bd199016f9d74ea9b1aacd873..23e148f5786c7a02cc9926ccdd290d0e07a63956 100644
--- a/public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
+++ b/public/appmini/old/weixin/pages/user-coupon/user-coupon.wxml
@@ -40,7 +40,7 @@
¥
{{item.coupon.discount_value}}
- {{item.coupon.type == 0 ? '元' : '折'}}
+ {{item.coupon.type_unit}}
{{item.coupon.desc}}
{{item.coupon.use_limit_type_name}}
@@ -62,7 +62,7 @@
¥
{{item.coupon.discount_value}}
- {{item.coupon.type == 0 ? '元' : '折'}}
+ {{item.coupon.type_unit}}
{{item.coupon.desc}}
{{item.coupon.use_limit_type_name}}