1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- var util = require('../../../utils/util.js');
- var api = require('../../../config/api.js');
- var app = getApp();
- Page({
- data: {
- couponId: '',
- discId: '',
- storeId: '',
- storeTopicId: '',
- tickDiscount: {}
- },
- onLoad: function (options) {
- // 页面初始化 options为页面跳转所带来的参数
- // console.log('discId' + options.discId)
- // console.log('couponId' + options.couponId)
- if (options.couponId) {
- this.setData({
- couponId: options.couponId
- });
- }
- if (options.discId) {
- this.setData({
- discId: options.discId
- });
- }
- this.setData({
- storeId: options.storeId
- });
- this.getTickDiscountDetail();
- },
- onReady: function () { },
- onShow: function () { },
- onHide: function () {
- // 页面隐藏
- },
- onUnload: function () {
- // 页面关闭
- },
- getTickDiscountDetail() {
- var that = this;
- util.request(api.DiscountDetail, {
- couponId: that.data.couponId,
- storeId: that.data.storeId,
- discId: that.data.discId
- })
- .then(function (res) {
- if (res.errno === 0) {
- console.log(res.data);
- if (res.data) {
- that.setData({
- tickDiscount: res.data
- });
- }
- }
- });
- }
- })
|