|
@@ -101,13 +101,13 @@ var components
|
|
|
try {
|
|
|
components = {
|
|
|
uniFav: function () {
|
|
|
- return Promise.all(/*! import() | uni_modules/uni-fav/components/uni-fav/uni-fav */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-fav/components/uni-fav/uni-fav")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-fav/components/uni-fav/uni-fav.vue */ 538))
|
|
|
+ return Promise.all(/*! import() | uni_modules/uni-fav/components/uni-fav/uni-fav */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-fav/components/uni-fav/uni-fav")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-fav/components/uni-fav/uni-fav.vue */ 552))
|
|
|
},
|
|
|
uniCollapse: function () {
|
|
|
- return __webpack_require__.e(/*! import() | uni_modules/uni-collapse/components/uni-collapse/uni-collapse */ "uni_modules/uni-collapse/components/uni-collapse/uni-collapse").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue */ 549))
|
|
|
+ return __webpack_require__.e(/*! import() | uni_modules/uni-collapse/components/uni-collapse/uni-collapse */ "uni_modules/uni-collapse/components/uni-collapse/uni-collapse").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue */ 504))
|
|
|
},
|
|
|
uniCollapseItem: function () {
|
|
|
- return __webpack_require__.e(/*! import() | uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item */ "uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue */ 556))
|
|
|
+ return __webpack_require__.e(/*! import() | uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item */ "uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue */ 511))
|
|
|
},
|
|
|
uniPopup: function () {
|
|
|
return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 470))
|
|
@@ -227,7 +227,9 @@ var _default = {
|
|
|
discountList: [],
|
|
|
// 数据是否触底
|
|
|
is_bottom: false,
|
|
|
- scrollTop: 0
|
|
|
+ scrollTop: 0,
|
|
|
+ // 禁止滚动穿透
|
|
|
+ show: false
|
|
|
};
|
|
|
},
|
|
|
onLoad: function () {
|
|
@@ -286,6 +288,11 @@ var _default = {
|
|
|
return onShow;
|
|
|
}(),
|
|
|
methods: {
|
|
|
+ // 禁止滚动穿透
|
|
|
+ change: function change(e) {
|
|
|
+ var that = this;
|
|
|
+ that.show = e.show;
|
|
|
+ },
|
|
|
searchToken: function searchToken() {
|
|
|
var that = this;
|
|
|
try {
|
|
@@ -378,6 +385,7 @@ var _default = {
|
|
|
_context4.next = 3;
|
|
|
return that.$api("/coupon/specialQuery", 'GET', {
|
|
|
is_use: '0',
|
|
|
+ user: that.user._id,
|
|
|
type: '0'
|
|
|
});
|
|
|
case 3:
|
|
@@ -393,7 +401,64 @@ var _default = {
|
|
|
}))();
|
|
|
},
|
|
|
// 领取优惠券
|
|
|
- toReceive: function toReceive() {},
|
|
|
+ toReceive: function toReceive(item) {
|
|
|
+ var _this3 = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
|
+ var that, form, res;
|
|
|
+ return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
|
+ while (1) {
|
|
|
+ switch (_context5.prev = _context5.next) {
|
|
|
+ case 0:
|
|
|
+ that = _this3;
|
|
|
+ if (!that.user._id) {
|
|
|
+ _context5.next = 10;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ form = {
|
|
|
+ user: that.user._id,
|
|
|
+ type: item.type,
|
|
|
+ coupon: item._id,
|
|
|
+ is_use: '0'
|
|
|
+ };
|
|
|
+ if (item.expire_type == 'fixed') form.time = item.expire_time;else {
|
|
|
+ form.time = "".concat((0, _moment.default)().format('YYYY-MM-DD HH:mm:ss'), " \u81F3 ").concat((0, _moment.default)().add(item.days, 'days').format('YYYY-MM-DD HH:mm:ss'));
|
|
|
+ }
|
|
|
+ _context5.next = 6;
|
|
|
+ return that.$api("/userCoupon", 'POST', form);
|
|
|
+ case 6:
|
|
|
+ res = _context5.sent;
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '领取成功',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ that.toCoupon();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ _context5.next = 11;
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pagesIndex/login/index"
|
|
|
+ });
|
|
|
+ case 11:
|
|
|
+ case "end":
|
|
|
+ return _context5.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, _callee5);
|
|
|
+ }))();
|
|
|
+ },
|
|
|
+ // 去使用
|
|
|
+ toUser: function toUser(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pagesMy/coupon/index"
|
|
|
+ });
|
|
|
+ },
|
|
|
// 关闭弹框
|
|
|
toCouponClose: function toCouponClose() {
|
|
|
var that = this;
|
|
@@ -401,29 +466,30 @@ var _default = {
|
|
|
},
|
|
|
// 查询其他信息
|
|
|
searchOther: function searchOther() {
|
|
|
- var _this3 = this;
|
|
|
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
|
+ var _this4 = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
|
var that, res;
|
|
|
- return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
|
+ return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
|
while (1) {
|
|
|
- switch (_context5.prev = _context5.next) {
|
|
|
+ switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
- that = _this3;
|
|
|
- _context5.next = 3;
|
|
|
+ that = _this4;
|
|
|
+ _context6.next = 3;
|
|
|
return that.$api("/coupon/specialQuery", 'GET', {
|
|
|
is_use: '0',
|
|
|
discount_type: 'min',
|
|
|
+ user: that.user._id,
|
|
|
type: '0'
|
|
|
});
|
|
|
case 3:
|
|
|
- res = _context5.sent;
|
|
|
+ res = _context6.sent;
|
|
|
if (res.errcode == '0') that.$set(that, "couponList", res.data.slice(0, 3));
|
|
|
case 5:
|
|
|
case "end":
|
|
|
- return _context5.stop();
|
|
|
+ return _context6.stop();
|
|
|
}
|
|
|
}
|
|
|
- }, _callee5);
|
|
|
+ }, _callee6);
|
|
|
}))();
|
|
|
},
|
|
|
// 处理富文本
|
|
@@ -456,20 +522,20 @@ var _default = {
|
|
|
},
|
|
|
// 收藏
|
|
|
onClick: function onClick(item) {
|
|
|
- var _this4 = this;
|
|
|
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
|
+ var _this5 = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
|
var that, res, form;
|
|
|
- return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
|
+ return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
|
while (1) {
|
|
|
- switch (_context6.prev = _context6.next) {
|
|
|
+ switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
- that = _this4;
|
|
|
+ that = _this5;
|
|
|
if (!(that.user && that.user._id)) {
|
|
|
- _context6.next = 15;
|
|
|
+ _context7.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
if (!(item.is_collect == false)) {
|
|
|
- _context6.next = 9;
|
|
|
+ _context7.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form = {
|
|
@@ -479,20 +545,20 @@ var _default = {
|
|
|
type: '1',
|
|
|
create_time: (0, _moment.default)().format('YYYY-MM-DD HH:mm:ss')
|
|
|
};
|
|
|
- _context6.next = 6;
|
|
|
+ _context7.next = 6;
|
|
|
return that.$api("/like", 'POST', form);
|
|
|
case 6:
|
|
|
- res = _context6.sent;
|
|
|
- _context6.next = 12;
|
|
|
+ res = _context7.sent;
|
|
|
+ _context7.next = 12;
|
|
|
break;
|
|
|
case 9:
|
|
|
- _context6.next = 11;
|
|
|
+ _context7.next = 11;
|
|
|
return that.$api("/like/".concat(item.collect), 'DELETE', {});
|
|
|
case 11:
|
|
|
- res = _context6.sent;
|
|
|
+ res = _context7.sent;
|
|
|
case 12:
|
|
|
if (res.errcode == '0') that.search();
|
|
|
- _context6.next = 16;
|
|
|
+ _context7.next = 16;
|
|
|
break;
|
|
|
case 15:
|
|
|
uni.navigateTo({
|
|
@@ -500,10 +566,10 @@ var _default = {
|
|
|
});
|
|
|
case 16:
|
|
|
case "end":
|
|
|
- return _context6.stop();
|
|
|
+ return _context7.stop();
|
|
|
}
|
|
|
}
|
|
|
- }, _callee6);
|
|
|
+ }, _callee7);
|
|
|
}))();
|
|
|
},
|
|
|
// 分页
|