|
@@ -37,6 +37,9 @@
|
|
min-width: 112px;
|
|
min-width: 112px;
|
|
margin-bottom: 0 !important;
|
|
margin-bottom: 0 !important;
|
|
}
|
|
}
|
|
|
|
+ #pay .info .right .btn_createOrder button.toPay[disabled] {
|
|
|
|
+ background-color: #ddd;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
@@ -75,6 +78,11 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="order-phone-group">
|
|
|
|
+ <label for="order_phone">手机号码</label>
|
|
|
|
+ <input id="order_phone" autocomplete="off" placeholder="请输入手机号码" maxlength="11" type="tel">
|
|
|
|
+ <p>手机号码输入错误</p>
|
|
|
|
+ </div>
|
|
<!--字段包说明-->
|
|
<!--字段包说明-->
|
|
<span class="remind" style="display:none;">
|
|
<span class="remind" style="display:none;">
|
|
<span class="remindone_"></span>
|
|
<span class="remindone_"></span>
|
|
@@ -108,7 +116,7 @@
|
|
|
|
|
|
</p>
|
|
</p>
|
|
<p class="btn_createOrder">
|
|
<p class="btn_createOrder">
|
|
- <button class="toPay" data-need-bind-phone disabled="disabled">确认支付</button>
|
|
|
|
|
|
+ <button class="toPay pay_btn" data-need-bind-phone disabled>确认支付</button>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -118,6 +126,111 @@
|
|
<script src='{{Msg "seo" "cdn"}}/js/coupon/coupon.js?v={{Msg "seo" "version"}}'></script>
|
|
<script src='{{Msg "seo" "cdn"}}/js/coupon/coupon.js?v={{Msg "seo" "version"}}'></script>
|
|
<script src='{{Msg "seo" "cdn"}}/js/coupon/coupon-usd.js?v={{Msg "seo" "version"}}'></script>
|
|
<script src='{{Msg "seo" "cdn"}}/js/coupon/coupon-usd.js?v={{Msg "seo" "version"}}'></script>
|
|
<script>
|
|
<script>
|
|
|
|
+ var readClause = false
|
|
|
|
+ // @订单手机号-S
|
|
|
|
+ function OrderPhone (data) {
|
|
|
|
+ this.addListener = function () {
|
|
|
|
+ var _this = this
|
|
|
|
+ $(this.data.el).on('input propertychange change', function () {
|
|
|
|
+ _this.OrderPhoneCheck && clearTimeout(_this.OrderPhoneCheck)
|
|
|
|
+ var o_phone = $(this).val()
|
|
|
|
+ _this.result.phone = o_phone
|
|
|
|
+ _this.result.status = _this.check_phone(o_phone)
|
|
|
|
+ var o_parent = $(this).parents()
|
|
|
|
+ _this.OrderPhoneCheck = setTimeout( () => {
|
|
|
|
+ if (_this.result.status) {
|
|
|
|
+ o_parent.removeClass('error')
|
|
|
|
+ typeof _this.data.success === 'function' && _this.data.success()
|
|
|
|
+ } else {
|
|
|
|
+ o_parent.addClass('error')
|
|
|
|
+ typeof _this.data.error === 'function' && _this.data.error()
|
|
|
|
+ }
|
|
|
|
+ }, _this.data.time || 300)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.check_phone = function (phone) {
|
|
|
|
+ if (phone.trim().length === 0) {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ var result = /^[1][3-9][0-9]{9}$/.test(phone)
|
|
|
|
+ if (result) {
|
|
|
|
+ sessionStorage.setItem(_this.OrderPhoneCheckKey, phone)
|
|
|
|
+ }
|
|
|
|
+ return result
|
|
|
|
+ }
|
|
|
|
+ this.update = function (str) {
|
|
|
|
+ if (this.check_phone(str)) {
|
|
|
|
+ $(this.data.el).val(str)
|
|
|
|
+ this.result.phone = str
|
|
|
|
+ this.result.status = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.ajaxPhone = function () {
|
|
|
|
+ var isCache = sessionStorage.getItem(this.OrderPhoneCheckKey)
|
|
|
|
+ if (isCache) {
|
|
|
|
+ this.update(isCache)
|
|
|
|
+ }
|
|
|
|
+ var _this = this
|
|
|
|
+ $.get("/jypay/user/getAccountInfo?t=" + new Date().getTime(), function (r) {
|
|
|
|
+ if (r && r.data && r.data.phone) {
|
|
|
|
+ _this.update(r.data.phone)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.removeCachePhone = function () {
|
|
|
|
+ var levelTime = sessionStorage.getItem(_this.OrderPhoneCheckKey + '_level_time') || false
|
|
|
|
+ if (levelTime) {
|
|
|
|
+ var nowTime = new Date().getTime()
|
|
|
|
+ if (nowTime - levelTime > 5 * 60 * 1000) {
|
|
|
|
+ sessionStorage.removeItem(_this.OrderPhoneCheckKey)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ sessionStorage.setItem(_this.OrderPhoneCheckKey + '_level_time', nowTime)
|
|
|
|
+ window.addEventListener('pageshow', function(event) {
|
|
|
|
+ if (event.persisted || window.performance && window.performance.navigation.type != 2) {
|
|
|
|
+ sessionStorage.removeItem(_this.OrderPhoneCheckKey)
|
|
|
|
+ }
|
|
|
|
+ }, false);
|
|
|
|
+ window.addEventListener('beforeunload', function () {
|
|
|
|
+ sessionStorage.setItem(_this.OrderPhoneCheckKey + '_level_time', new Date().getTime())
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.data = data || {
|
|
|
|
+ el: 'input#order_phone',
|
|
|
|
+ time: 300
|
|
|
|
+ }
|
|
|
|
+ var _this = this
|
|
|
|
+ this.OrderPhoneCheck = null
|
|
|
|
+ this.OrderPhoneCheckKey = 'p19.3_order_phone'
|
|
|
|
+ this.result = {
|
|
|
|
+ phone: '',
|
|
|
|
+ status: true,
|
|
|
|
+ update: _this.update.bind(_this)
|
|
|
|
+ }
|
|
|
|
+ this.removeCachePhone()
|
|
|
|
+ this.addListener()
|
|
|
|
+ this.ajaxPhone()
|
|
|
|
+ return this.result
|
|
|
|
+ }
|
|
|
|
+ var OrderPhoneCheck = new OrderPhone({
|
|
|
|
+ el: 'input#order_phone',
|
|
|
|
+ time: 300,
|
|
|
|
+ success: function () {
|
|
|
|
+ checkSubmitStatus()
|
|
|
|
+ },
|
|
|
|
+ error: function () {
|
|
|
|
+ checkSubmitStatus()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ function checkSubmitStatus () {
|
|
|
|
+ var phonePass = OrderPhoneCheck.status
|
|
|
|
+ var allPass = readClause && phonePass
|
|
|
|
+ console.log(readClause, phonePass)
|
|
|
|
+ $('.pay_btn').prop("disabled", !allPass)
|
|
|
|
+ }
|
|
|
|
+ // @订单手机号-E
|
|
|
|
+
|
|
|
|
+
|
|
var getCouponParams = showCoupon(102, 100, false)
|
|
var getCouponParams = showCoupon(102, 100, false)
|
|
var msgMaxCount, msgCount, discount, unitPrice_normal, unitPrice_senior;
|
|
var msgMaxCount, msgCount, discount, unitPrice_normal, unitPrice_senior;
|
|
var orderMinPrice = 0;
|
|
var orderMinPrice = 0;
|
|
@@ -197,6 +310,8 @@
|
|
param.userLotteryId = couponParam.userLotteryId
|
|
param.userLotteryId = couponParam.userLotteryId
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ param.order_phone = OrderPhoneCheck.phone
|
|
|
|
+
|
|
$.ajax({
|
|
$.ajax({
|
|
url: "/subscribepay/dataExportPack/createOrder",
|
|
url: "/subscribepay/dataExportPack/createOrder",
|
|
data: param,
|
|
data: param,
|
|
@@ -258,11 +373,7 @@
|
|
$('#checkBoxjy').on('click', function () {
|
|
$('#checkBoxjy').on('click', function () {
|
|
$(this).toggleClass('hideBf');
|
|
$(this).toggleClass('hideBf');
|
|
readClause = $(this).hasClass("hideBf")
|
|
readClause = $(this).hasClass("hideBf")
|
|
- if (readClause) {
|
|
|
|
- $(".toPay").css("background-color", "#2CB7CA").removeAttr("disabled")
|
|
|
|
- } else {
|
|
|
|
- $(".toPay").css("background-color", "#ddd").attr("disabled", "disabled");
|
|
|
|
- }
|
|
|
|
|
|
+ checkSubmitStatus()
|
|
})
|
|
})
|
|
|
|
|
|
ChangePayMoney()
|
|
ChangePayMoney()
|