| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <view class="page">
- <view class="header dis a-end">
- <image class="logo mr-2" src="/static/image/my/logo.png" mode=""></image>
- <view class="dis f-c a-start title">
- <text>晋掌柜</text>
- <text>高效、智能车险工具,让车险交易更简单</text>
- </view>
- </view>
- <view class="content-form mt-2" v-if="callback.isJoined==null">
- <view class="inviteHeader dis f-c a-c mt-3">
- <image class="avatar" :src="userInfo.headSculpture? userInfo.headSculpture :'/static/image/avatar.png'"
- mode=""></image>
- <text class="mt-2 mb-1"> <text class="font-weight">{{userInfo.name }}</text>邀请你加入</text>
- <text class="">{{userInfo.deptName}}</text>
- </view>
- <u--form labelPosition="left" :model="info" class="info" ref="ownerForm" labelWidth="60" errorType="message"
- :labelStyle="{fontWeight:'bold',color:'#333'}">
- <u-form-item label="手机号" borderBottom>
- <u--input v-model="info.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
- placeholderStyle="color:#999"></u--input>
- </u-form-item>
- <!-- #ifdef H5 -->
- <u-form-item label="验证码" borderBottom>
- <u--input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
- placeholderStyle="color:#999">
- <template slot="suffix">
- <u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
- style="color: #F9E000;" uniqueKey="h5Registr"></u-code>
- <view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
- </template>
- </u--input>
- </u-form-item>
- <u-form-item label="新密码" borderBottom>
- <u--input v-model="info.password" border="none" clearable placeholder="请输入密码"
- placeholderStyle="color:#999" :password="isHidePassword">
- <template slot="suffix">
- <image class="icon-img"
- :src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
- mode="" @tap="isHidePassword=!isHidePassword"></image>
- </template>
- </u--input>
- </u-form-item>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <u-form-item label="验证码" borderBottom>
- <u-input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
- placeholderStyle="color:#999">
- <template slot="suffix">
- <u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
- style="color: #F9E000;" uniqueKey="h5Registr"></u-code>
- <view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
- </template>
- </u-input>
- </u-form-item>
- <u-form-item label="新密码" borderBottom>
- <u-input v-model="info.password" border="none" clearable placeholder="请输入密码"
- placeholderStyle="color:#999" :password="isHidePassword">
- <template slot="suffix">
- <image class="icon-img"
- :src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
- mode="" @tap="isHidePassword=!isHidePassword"></image>
- </template>
- </u-input>
- </u-form-item>
- <!-- #endif -->
- </u--form>
- <view class="btn dis a-c j-c " @click="submitRegistr">
- 立即加入
- </view>
- <view class="description dis j-c">点击立即加入代表你已阅读并同意 <text
- style="color: #1F1F1F;margin: 0 10rpx;">用户协议</text> 和 <text
- style="color: #1F1F1F;margin-left: 10rpx;">隐私政策</text> </view>
- </view>
- <view class="content-form mt-2" v-if="callback.isJoined==0">
- <view class="inviteHeader dis f-c a-c mt-3">
- <image class="avatar" src="/static/icon/joinSuccess.png" mode=""></image>
- <text class="mt-2 mb-1 font-weight" style="font-size: 36rpx;">加入成功</text>
- <text class="" style="font-size: 30rpx;">您已加入{{callback.deptName}}。使用 +86{{callback.mobile}}
- 登录晋掌柜并选择进入{{callback.systemCode}},即可开展车险业务</text>
- </view>
- <view class="btn dis a-c j-c " style="margin-top: 150rpx;margin-bottom: 30rpx;" @click="redirectDownload">
- 下载晋掌柜
- </view>
- <view class="description dis j-c"> 已有晋掌柜APP
- <a style="color: #1F1F1F;margin-left: 10rpx;text-decoration: none;" href="zgcx://">打开</a>
- </view>
- </view>
- <view class="content-form mt-2" v-if="callback.isJoined==1">
- <view class="inviteHeader dis f-c a-c mt-3">
- <image class="avatar" src="/static/icon/joinSuccess.png" mode=""></image>
- <text class="mt-2 mb-1 font-weight" style="font-size: 36rpx;">您已加入该企业</text>
- <text class="" style="font-size: 30rpx;">你已加入该机构,无需重复加入。使用 +86{{callback.mobile}}
- 登录晋掌柜并选择进入{{callback.systemCode}},即可开展车险业务</text>
- </view>
- <view class="btn dis a-c j-c " style="margin-top: 150rpx;margin-bottom: 30rpx;" @click="redirectDownload">
- 下载晋掌柜
- </view>
- <view class="description dis j-c"> 已有晋掌柜APP <a
- style="color: #1F1F1F;margin-left: 10rpx;text-decoration: none;" href="zgcxapp://">打开</a>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- isHidePassword: true, //是否隐藏密码
- info: {
- mobile: "",
- password: "",
- smsCode: "",
- }, //表单
- tips2: '',
- userInfo: {}, //推荐人信息
- callback: {
- isJoined: null,
- },
- systemCode: "",
- page: "",
- }
- },
- onShow() {
- console.log(this.callback);
- },
- onLoad(options) {
- if (options) {
- console.log(options);
- this.systemCode = options.systemCode;
- this.page = options.page;
- this.userInfo = JSON.parse(options.info);
- }
- },
- methods: {
- //注册接口
- async submitRegistr() {
- let api = this.page == '分销员注册' ? 'distributorInvite' : 'invitationRegister'
- let res = await this.$http.post(`/appUser/${api}`, {
- userId: this.page == '分销员注册' ? this.userInfo.infoId : this.userInfo.id,
- systemCode: this.systemCode,
- ...this.info
- });
- if (res.code == 200) {
- this.callback = res.data;
- console.log(this.callback);
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- },
- redirectDownload() {
- uni.navigateTo({
- url: '/pages/registr/appPromoPage'
- })
- },
- codeChange2(text) {
- this.tips2 = text;
- },
- //点击发送验证码
- getCode2() {
- if (!this.info.mobile) {
- uni.showToast({
- title: '手机号为空',
- icon: 'none'
- });
- return;
- }
- if (this.$refs.uCode2.canGetCode) {
- this.smsCode(); // 向后端请求验证码
- uni.showLoading({
- title: '正在获取验证码'
- })
- setTimeout(() => {
- uni.hideLoading();
- // 这里此提示会被this.start()方法中的提示覆盖
- uni.$u.toast('验证码已发送');
- // 通知验证码组件内部开始倒计时
- this.$refs.uCode2.start();
- }, 1000);
- } else {
- uni.$u.toast('倒计时结束后再发送');
- }
- },
- //验证码接口
- async smsCode() {
- let res = await this.$http.get('/auth/sendSmsCode?mobile=' + this.info.mobile);
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep {
- .u-form-item__body {
- padding: 30rpx 0;
- }
- }
- .page {
- background-color: #f8f8f8;
- height: 100vh;
- }
- .header {
- width: 100%;
- padding: 30rpx 35rpx;
- box-sizing: border-box;
- background: linear-gradient(77deg, #FFFFFF 0%, #FFFDED 100%), #FFFFFF;
- .logo {
- width: 120rpx;
- height: 120rpx;
- }
- .title {
- margin-bottom: 8rpx;
- text:first-child {
- font-size: 36rpx;
- color: #333;
- font-weight: bold;
- margin-bottom: 12rpx;
- }
- text:last-child {
- font-size: 30rpx;
- color: #333;
- }
- }
- }
- .content-form {
- background-image: url('../../static/image/h5Registr-bg.png');
- background-size: 100% 100%;
- padding: 30rpx;
- box-sizing: border-box;
- .inviteHeader {
- .avatar {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- }
- text {
- font-size: 32rpx;
- color: #1F1F1F;
- }
- }
- .btn {
- margin: 40rpx 25rpx 90rpx;
- padding: 20rpx;
- box-sizing: border-box;
- background: #FDE935;
- border-radius: 45rpx 45rpx 45rpx 45rpx;
- font-size: 36rpx;
- color: #1F1F1F;
- font-weight: bold;
- }
- }
- .info {
- padding: 60rpx 25rpx;
- box-sizing: border-box;
- .icon-img {
- width: 30rpx;
- height: 30rpx;
- }
- }
- //发送验证码样式
- .u-page__code-text {
- padding: 4rpx 18rpx;
- background: rgba(253, 233, 53, 0.2);
- border-radius: 6rpx 6rpx 6rpx 6rpx;
- border: 1rpx solid #FDE935;
- color: #333333;
- font-size: 26rpx;
- }
- .description {
- font-size: 26rpx;
- color: #999;
- }
- </style>
|