| | |
| | | <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'"> |
| | | <view class="pb30"> |
| | | <!-- 如果不是连盟汇会员,需要填写个人信息,报名后会自动加入活动发起的分会 --> |
| | | <view class="reg-section join-box p30 radius24 bg-white" v-if="!activityData.is_member"> |
| | | <view class="tips f28 p20 radius12"><text class="iconfont icon-gantanhao mr10"></text> 您还不是{{activityData.store_name}}的会员,请完善以下信息,提交报名后即可成为会员。</view> |
| | | <view class="reg-section join-box p30 radius24 bg-white" v-if="!activityData.is_member || is_friend"> |
| | | <view class="tips f28 p20 radius12" v-if="!activityData.is_member && !is_friend"><text class="iconfont icon-gantanhao mr10"></text> 您还不是{{activityData.store_name}}的会员,请完善以下信息,提交报名后即可成为会员。</view> |
| | | <view class="tips f28 p20 radius12 friend" v-if="is_friend"><text class="iconfont icon-gantanhao mr10"></text>您正在帮朋友报名,以下信息请填写您朋友的信息</view> |
| | | <view class="item d-s-c"> |
| | | <view class="item-name">真实姓名</view> |
| | | <input type="text" maxlength="30" class="flex-1" placeholder="请输入真实姓名" v-model="formData.real_name" placeholder-class= |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { pay } from '@/common/pay.js'; |
| | | import PointsForm from './points'; // 积分选择弹窗 |
| | | export default { |
| | | components: { |
| | |
| | | activityData: {}, |
| | | isOpenPoints: false, // 是否打开积分弹窗 |
| | | validate: false, |
| | | payData: [], // 半屏小程序相关 |
| | | isFirst: false, |
| | | }; |
| | | }, |
| | | props: ['isOpenReg', 'in_radius'], |
| | | props: ['isOpenReg', 'in_radius', 'is_friend'], |
| | | |
| | | onLoad() {}, |
| | | onShow() { |
| | | let self = this; |
| | | console.log('pay-res') |
| | | let options = wx.getEnterOptionsSync(); |
| | | // 从半屏小程序返回时执行 |
| | | if (options.scene == '1038' && self.isFirst == true) { |
| | | self.isFirst = false; |
| | | self.onPayResult(options.referrerInfo.extraData); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | // 半屏小程序返回 |
| | | onPayResult(e) { |
| | | console.log(e) |
| | | let self = this; |
| | | self.loading = false; |
| | | uni.hideLoading(); |
| | | self.isFirst = false; |
| | | if (e.pay_result == 'success') { |
| | | self.paySuccess(self.payData); |
| | | } else { |
| | | if(self.order_id > 0){ |
| | | //兼容重新付款 |
| | | }else{ |
| | | self.payError(self.payData); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | paySuccess(result) { |
| | | let self = this; |
| | | self.showSuccess("支付成功", function() { |
| | | self.$emit('close', 1); |
| | | }) |
| | | |
| | | }, |
| | | payError(result) { |
| | | let self = this; |
| | | self.showSuccess("支付成功", function() { |
| | | self.$emit('close', 2); |
| | | }) |
| | | }, |
| | | |
| | | // 是否使用余额支付 |
| | | onUseBalance(e) { |
| | | if (e.target.value == true) { |
| | |
| | | activity_id: self.activityData.activity_id, |
| | | is_member: self.activityData.is_member, |
| | | pay_source: self.getPlatform(), |
| | | in_radius: self.in_radius ? 1 : 0 // 如果为1,报名成功后直接签到 |
| | | in_radius: self.in_radius ? 1 : 0, // 如果为1,报名成功后直接签到 |
| | | is_friend: self.is_friend ? 1 : 0, // 是否是帮朋友报名 |
| | | }) |
| | | ) |
| | | }, function(result) { |
| | | }, function(res) { |
| | | uni.hideLoading(); |
| | | if (result.data.online_money) { |
| | | pay(result, self, function() { |
| | | |
| | | }, function() { |
| | | reg_success = 2; // 失败 |
| | | }); |
| | | } else if (result.code != 1) { |
| | | if (res.data.online_money) { |
| | | // 半屏小程序支付 by lyzflash |
| | | if (res.data.payment.is_embed) { |
| | | // console.log(res.data.payment); |
| | | self.isFirst = true; |
| | | uni.openEmbeddedMiniProgram({ |
| | | appId: res.data.payment.embed_app_id, |
| | | path: res.data.payment.embed_path, |
| | | extraData: res.data.payment.extraData, |
| | | envVersion: 'release', // develop开发版 trial体验版 release正式版 |
| | | success:function() { |
| | | console.log('打开半屏小程序成功'); |
| | | }, |
| | | fail:function() { |
| | | console.log('打开半屏小程序失败'); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | pay(res, self, self.paySuccess, self.payError); |
| | | } else if (res.code != 1) { |
| | | reg_success = 2; // 失败 |
| | | } |
| | | self.$emit('close', reg_success); |
| | |
| | | // 验证数据 |
| | | validateForm() { |
| | | let self = this; |
| | | if (!self.activityData.is_member) { |
| | | if (!self.activityData.is_member || self.is_friend) { |
| | | if (!self.formData.real_name) { |
| | | return self.showTips('请输入您的真实姓名'); |
| | | return self.showTips('请输入真实姓名'); |
| | | } |
| | | if (!self.formData.mobile) { |
| | | return self.showTips('请输入您的手机号码'); |
| | | return self.showTips('请输入手机号码'); |
| | | } |
| | | if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(self.formData.mobile)) { |
| | | return self.showTips('请输入正确的手机号码'); |
| | |
| | | .tips { |
| | | background-color: #f7f7f7; |
| | | color: #333; |
| | | |
| | | &.friend { |
| | | background-color: #FCF8ED; |
| | | color: #CEAD60; |
| | | |
| | | .iconfont{ |
| | | color: #CEAD60; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .pay-box { |