diff --git a/App.vue b/App.vue index de77746..a778c6e 100644 --- a/App.vue +++ b/App.vue @@ -39,7 +39,7 @@ storeAddress: '' }, onLaunch: function() { - let that = this; + /* let that = this; uni.getStorage({ key: 'payuser', success: (res) => { @@ -52,9 +52,14 @@ }) } - }); + }); */ + }, + onShow: function() { + this.globalData.Dictionaries =uni.getStorageSync("Dictionaries")|| ''; + this.globalData.userInfo = uni.getStorageSync("payuser") || ''; + this.globalData.token = uni.getStorageSync("paytoken") || ''; + this.globalData.openId = uni.getStorageSync("openId") || ''; }, - onShow: function() {}, onHide: function() {} } diff --git a/pages/index/activity_Funds_transaction_records/activity_Funds_transaction_records.vue b/pages/index/activity_Funds_transaction_records/activity_Funds_transaction_records.vue index 1e8e23a..40c5194 100644 --- a/pages/index/activity_Funds_transaction_records/activity_Funds_transaction_records.vue +++ b/pages/index/activity_Funds_transaction_records/activity_Funds_transaction_records.vue @@ -20,8 +20,9 @@ 交易对象类型: 充值 - 活动金 - 活动 + 返利金 + 活动金额充值 + 活动金额回收 diff --git a/pages/index/activity_add/activity_add.vue b/pages/index/activity_add/activity_add.vue index 536984d..e6d7f85 100644 --- a/pages/index/activity_add/activity_add.vue +++ b/pages/index/activity_add/activity_add.vue @@ -25,9 +25,9 @@ - 优惠金额 - + 优惠金额 + {{price}} @@ -126,6 +126,12 @@ //结束时间转化 endDate() { return this.getDate('end'); + }, + placeholderTip(){ + if(this.preferentialType==3){ + return "折扣比例(10~99),例98折:98" + } + return '请输入优惠金额' } }, methods: { @@ -224,7 +230,7 @@ }); return; } - if (!this.price) { + if (!this.price){ uni.showToast({ title: '请输入优惠金额', icon: "none", @@ -232,6 +238,18 @@ }); return; } + if(this.preferentialType==3){ + let reg =/^[1-9][0-9]$/; //10-99最低打一折 + if(!reg.test(this.price)){ + this.price=""; + uni.showToast({ + title: '请输入正确的折扣比例,例如99折输入:99,打七折输入:70', + icon: "none", + duration: 2000 + }); + return + } + } if (!this.end_date) { uni.showToast({ title: '请选择结束时间', diff --git a/pages/index/recharge_balance/recharge_balance.vue b/pages/index/recharge_balance/recharge_balance.vue index d2454d2..5d20d66 100644 --- a/pages/index/recharge_balance/recharge_balance.vue +++ b/pages/index/recharge_balance/recharge_balance.vue @@ -103,6 +103,23 @@ }); return; } + + let _this = this; + uni.showModal({ + title: '提示', + content: `确定充值${this.inputAmount}元吗?`, + success: function(res) { + if (res.confirm) { + _this.createrOrder(); + } else if (res.cancel) { + + // console.log('用户点击取消'); + } + } + }); + + }, + createrOrder(){ uni.showLoading({ title: '正在提交订单...' }) @@ -114,7 +131,7 @@ "tradePrice": this.inputAmount, "openId": app.globalData.openId } - + rebateCreate(goods).then(res => { uni.hideLoading(); if (res.return_code == '000000') { @@ -128,7 +145,7 @@ } }) } - + if (this.type == 2) { let data = { "activityNo": this.activityNo, diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 63e097e..db39bcb 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -205,6 +205,7 @@ getDictionaries().then(res => { if (res.return_code == '000000') { app.globalData.Dictionaries = res.return_data; + uni.setStorageSync("Dictionaries",res.return_data) } }) }, diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 9c93c9d..d2ab096 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -50,10 +50,11 @@ getAccessToken(params).then(res => { if (res.return_code == '000000' && res.return_data.openid) { app.globalData.openId = res.return_data.openid; - uni.setStorage({ + /* uni.setStorage({ key: "openId", data: res.return_data.openid - }) + }) */ + uni.setStorageSync("openId",res.return_data.openid); if (this.userInfo) { uni.reLaunch({ url: '../tabBar/home/home'