Browse Source

空调按钮提示

程志平 3 years ago
parent
commit
116ac32def
2 changed files with 88 additions and 9 deletions
  1. 8 1
      pages/index/index.vue
  2. 80 8
      pages/recharge/recharge.vue

+ 8 - 1
pages/index/index.vue

@@ -13,7 +13,8 @@
 					<image src="../../static/images/recharge2x.png" mode=""></image>
 					<text>水电充值</text>
 				</navigator>
-				<navigator :url="'/pagesAir/shareAir/shareAir'" open-type="navigate" class="menu_item">
+				<!-- <navigator :url="'/pagesAir/shareAir/shareAir'" open-type="navigate" class="menu_item"> -->
+				<navigator url="" open-type="navigate" class="menu_item" @tap="deving">
 					<image src="../../static/images/air.png" mode=""></image>
 					<text>共享空调</text>
 				</navigator>
@@ -69,6 +70,12 @@
 			}
 		},
 		methods: {
+			deving() {
+				uni.showToast({
+					title: '正在开发中...',
+					duration: 2000
+				})
+			},
 			/**
 			 * 控制环境,test为true测试环境,false则是正式环境
 			 */

+ 80 - 8
pages/recharge/recharge.vue

@@ -3,6 +3,7 @@
 		<view class="title">
 			<text class="iconfont icon-qian"></text>
 			<text>江西南昌交通学院</text>
+			<text>(墨轩湖校区)</text>
 		</view>
 		<view class="input_amount">
 			<view class="amount_tip">充值金额(元)</view>
@@ -22,7 +23,7 @@
 			</view>
 			<view class="reminder">温馨提示:最少充值金额为10元</view>
 			<view class="payment">支付金额:<text>{{amount}}</text>元</view>
-			<button class="btn_submit" type="primary" @tap="chongzhi">确认提交</button>
+			<button class="btn_submit" type="primary" @tap="tip">确认提交</button>
 			<button class="btn_tel" type="default" @tap="callPhone">客服热线:{{phone_number}}</button>
 			<view class="tips">
 				尊敬的用户,你好!因项目提现业务配置问题导致您无法提现对此,我们深表歉意!您可致电运营商处理提现问题,运营商电话:13645689854。感谢您对我们工作的支持和理解。
@@ -40,7 +41,8 @@
 				IP: '',
 				code: '',
 				ceshi: 'code',
-				test: this.$store.state.test
+				test: this.$store.state.test,
+				isXiaoqu: false
 			};
 		},
 		onLoad() {
@@ -48,6 +50,9 @@
 				this.amount = 0.01
 			}
 		},
+		onReady() {
+			this.has_user_info();
+		},
 		methods: {
 			/**
 			 * 获得code
@@ -82,7 +87,7 @@
 					// console.log(res);
 					const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
 					let ip = reg.exec(res.data);
-					
+
 					// 获取code
 					this.getCode(ip[0])
 				}
@@ -98,7 +103,7 @@
 					});
 					return
 				}
-				
+
 				const res = await this.$myRequest({
 					host: this.ceshi,
 					url: '/HotWaters/wpPay.action',
@@ -112,7 +117,7 @@
 						ip: param_ip
 					}
 				})
-				
+
 				// console.log(res);
 				if (res.data.pay == 'error') {
 					uni.showToast({
@@ -205,6 +210,68 @@
 				this.amount = m
 			},
 			/**
+			 * 是否有用户信息
+			 */
+			has_user_info() {
+				try {
+					const value = uni.getStorageSync('userinfo_storage_key');
+					// console.log(value.campus);
+					if (value.campus != '墨轩湖校区') {
+						this.isXiaoqu = false;
+					} else {
+						this.isXiaoqu = true;
+					}
+				} catch (e) {
+					// console.log(e)
+					uni.showToast({
+						title: '异常:' + e,
+						duration: 3000
+					})
+				}
+
+				this.tip(false);
+			},
+			/**
+			 * 提示
+			 */
+			tip(param) {
+				if (!this.isXiaoqu) {
+					if (param == false) {
+						uni.showModal({
+							title: '提示',
+							content: '目前只对【墨轩湖校区】进行充值!请知晓!',
+							showCancel: false,
+							confirmText: '我已知晓',
+							confirmColor: '#F00',
+							success: function(res) {
+								if (res.confirm) {
+									// console.log('用户点击确定');
+								}
+							}
+						});
+					} else{
+						let _this = this;
+						uni.showModal({
+							title: '提示',
+							content: '目前只对【墨轩湖校区】的【热水钱包】进行充值!',
+							confirmText: '对,没错',
+							confirmColor: '#F00',
+							cancelText: '哦,错了',
+							success: function(res) {
+								if (res.confirm) {
+									// console.log('用户点击确定');
+									_this.chongzhi()
+								} else if (res.cancel){
+									// console.log('用户点击取消');
+								}
+							}
+						});
+					}
+				} else {
+					this.chongzhi()
+				}
+			},
+			/**
 			 * 调用接口实现充值功能
 			 */
 			chongzhi() {
@@ -282,6 +349,10 @@
 			display: flex;
 			align-items: center;
 			padding: 40rpx;
+			font-size: 36rpx;
+			font-family: Microsoft YaHei-3970(82674968);
+			color: #333333;
+			font-weight: bold;
 
 			text:nth-child(1) {
 				color: $my-color-primary;
@@ -289,10 +360,11 @@
 			}
 
 			text:nth-child(2) {
-				font-size: 32rpx;
 				margin-left: 15rpx;
-				font-family: Microsoft YaHei-3970(82674968);
-				color: #333333;
+			}
+
+			text:nth-child(3) {
+				color: #F00;
 			}
 		}