jufubao-base 1.0.118 → 1.0.119-beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/src/components/JfbBaseCard/Attr.js +380 -287
- package/src/components/JfbBaseCard/JfbBaseCard.vue +51 -2
- package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +0 -4
- package/src/components/JfbBaseConDialog/JfbBaseConDialog.vue +6 -1
- package/src/components/JfbBaseConFlashHome/Api.js +60 -0
- package/src/components/JfbBaseConFlashHome/Attr.js +129 -0
- package/src/components/JfbBaseConFlashHome/JfbBaseConFlashHome.vue +388 -0
- package/src/components/JfbBaseConFlashHome/JfbBaseConFlashHomeLess.less +80 -0
- package/src/components/JfbBaseConFlashHome/JfbBaseConFlashHomeMixin.js +30 -0
- package/src/components/JfbBaseConFlashHome/Mock.js +5 -0
- package/src/components/JfbBaseConFlashList/Api.js +60 -0
- package/src/components/JfbBaseConFlashList/Attr.js +117 -0
- package/src/components/JfbBaseConFlashList/JfbBaseConFlashList.vue +656 -0
- package/src/components/JfbBaseConFlashList/JfbBaseConFlashListLess.less +80 -0
- package/src/components/JfbBaseConFlashList/JfbBaseConFlashListMixin.js +30 -0
- package/src/components/JfbBaseConFlashList/Mock.js +5 -0
- package/src/components/JfbBaseConList/JfbBaseConList.vue +4 -2
- package/src/components/JfbBaseConPhone/Api.js +70 -0
- package/src/components/JfbBaseConPhone/Attr.js +10 -0
- package/src/components/JfbBaseConPhone/JfbBaseConPhone.vue +486 -0
- package/src/components/JfbBaseConPhone/JfbBaseConPhoneLess.less +80 -0
- package/src/components/JfbBaseConPhone/JfbBaseConPhoneMixin.js +30 -0
- package/src/components/JfbBaseConPhone/Mock.js +26 -0
- package/src/components/JfbBaseMySetting/JfbBaseMySetting.vue +2 -2
- package/src/components/JfbBasePhoneCollect/JfbBasePhoneCollect.vue +1 -1
- package/src/components/JfbBaseSaasBlessDetail/Api.js +59 -0
- package/src/components/JfbBaseSaasBlessDetail/Attr.js +24 -0
- package/src/components/JfbBaseSaasBlessDetail/JfbBaseSaasBlessDetail.vue +341 -0
- package/src/components/JfbBaseSaasBlessDetail/JfbBaseSaasBlessDetailLess.less +80 -0
- package/src/components/JfbBaseSaasBlessDetail/JfbBaseSaasBlessDetailMixin.js +30 -0
- package/src/components/JfbBaseSaasBlessDetail/Mock.js +5 -0
- package/src/components/JfbBaseSaasBlessDialog/Api.js +25 -0
- package/src/components/JfbBaseSaasBlessDialog/Attr.js +50 -0
- package/src/components/JfbBaseSaasBlessDialog/JfbBaseSaasBlessDialog.vue +309 -0
- package/src/components/JfbBaseSaasBlessDialog/JfbBaseSaasBlessDialogLess.less +80 -0
- package/src/components/JfbBaseSaasBlessDialog/JfbBaseSaasBlessDialogMixin.js +30 -0
- package/src/components/JfbBaseSaasBlessDialog/Mock.js +5 -0
- package/src/components/JfbBaseSaasBlessReceive/Api.js +25 -0
- package/src/components/JfbBaseSaasBlessReceive/Attr.js +24 -0
- package/src/components/JfbBaseSaasBlessReceive/JfbBaseSaasBlessReceive.vue +201 -0
- package/src/components/JfbBaseSaasBlessReceive/JfbBaseSaasBlessReceiveLess.less +80 -0
- package/src/components/JfbBaseSaasBlessReceive/JfbBaseSaasBlessReceiveMixin.js +30 -0
- package/src/components/JfbBaseSaasBlessReceive/Mock.js +5 -0
- package/src/components/JfbBaseSaasHome/Api.js +48 -0
- package/src/components/JfbBaseSaasHome/Attr.js +35 -0
- package/src/components/JfbBaseSaasHome/JfbBaseSaasHome.vue +402 -0
- package/src/components/JfbBaseSaasHome/JfbBaseSaasHomeLess.less +80 -0
- package/src/components/JfbBaseSaasHome/JfbBaseSaasHomeMixin.js +30 -0
- package/src/components/JfbBaseSaasHome/Mock.js +5 -0
- package/src/components/JfbBaseSaasLogin/Api.js +98 -0
- package/src/components/JfbBaseSaasLogin/Attr.js +59 -0
- package/src/components/JfbBaseSaasLogin/JfbBaseSaasLogin.vue +700 -0
- package/src/components/JfbBaseSaasLogin/JfbBaseSaasLoginLess.less +80 -0
- package/src/components/JfbBaseSaasLogin/JfbBaseSaasLoginMixin.js +30 -0
- package/src/components/JfbBaseSaasLogin/Mock.js +5 -0
- package/src/components/JfbBaseSaasLogin/saaslogin_copy.vue +410 -0
- package/src/components/JfbBaseSaasNewsDetail/Api.js +27 -0
- package/src/components/JfbBaseSaasNewsDetail/Attr.js +14 -0
- package/src/components/JfbBaseSaasNewsDetail/JfbBaseSaasNewsDetail.vue +144 -0
- package/src/components/JfbBaseSaasNewsDetail/JfbBaseSaasNewsDetailLess.less +80 -0
- package/src/components/JfbBaseSaasNewsDetail/JfbBaseSaasNewsDetailMixin.js +30 -0
- package/src/components/JfbBaseSaasNewsDetail/Mock.js +5 -0
- package/src/components/JfbBaseSaasNewsList/Api.js +26 -0
- package/src/components/JfbBaseSaasNewsList/Attr.js +24 -0
- package/src/components/JfbBaseSaasNewsList/JfbBaseSaasNewsList.vue +182 -0
- package/src/components/JfbBaseSaasNewsList/JfbBaseSaasNewsListLess.less +80 -0
- package/src/components/JfbBaseSaasNewsList/JfbBaseSaasNewsListMixin.js +30 -0
- package/src/components/JfbBaseSaasNewsList/Mock.js +5 -0
- package/src/components/JfbBaseSassPhoneCollect/Api.js +51 -0
- package/src/components/JfbBaseSassPhoneCollect/Attr.js +438 -0
- package/src/components/JfbBaseSassPhoneCollect/JfbBaseSassPhoneCollect.vue +266 -0
- package/src/components/JfbBaseSassPhoneCollect/JfbBaseSassPhoneCollectLess.less +80 -0
- package/src/components/JfbBaseSassPhoneCollect/JfbBaseSassPhoneCollectMixin.js +30 -0
- package/src/components/JfbBaseSassPhoneCollect/Mock.js +5 -0
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="jfb-base-saas-login"
|
|
4
|
+
@click="handleEditxSelect"
|
|
5
|
+
:class="{ editx : isEditx && active }"
|
|
6
|
+
>
|
|
7
|
+
<!--#ifdef H5-->
|
|
8
|
+
<view
|
|
9
|
+
class="jfb-base-saas-login__edit"
|
|
10
|
+
:class="{ editx : isEditx && active }"
|
|
11
|
+
v-if="isEditx && active"
|
|
12
|
+
>
|
|
13
|
+
<view class="jfb-base-saas-login__edit-icon" @click="delEdit">删除</view>
|
|
14
|
+
</view>
|
|
15
|
+
<!-- #endif -->
|
|
16
|
+
<view class="jfb-base-saas-login__body" :style="{
|
|
17
|
+
minHeight: layoutInfo.bodyMinHeightPx + 'px'
|
|
18
|
+
}">
|
|
19
|
+
<view v-if="showStep === 1" class="panel-login-auth">
|
|
20
|
+
<view class="logo-wrap">
|
|
21
|
+
<image mode="aspectFit" :src="logo" />
|
|
22
|
+
<view :style="{ color: logoTextColor, }" >{{ partnerName }}</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="login_types">
|
|
25
|
+
<xd-button
|
|
26
|
+
v-if="hasAuthLogin"
|
|
27
|
+
:disabled="!panelIsChecked"
|
|
28
|
+
type="primary"
|
|
29
|
+
radius="20rpx"
|
|
30
|
+
@click="doLoginAuth"
|
|
31
|
+
>快捷登录</xd-button>
|
|
32
|
+
<view class="login-pub">
|
|
33
|
+
<xd-button
|
|
34
|
+
v-if="hasAccountLogin"
|
|
35
|
+
:disabled="!panelIsChecked"
|
|
36
|
+
type="primary"
|
|
37
|
+
radius="20rpx"
|
|
38
|
+
@click="doLoginAccount"
|
|
39
|
+
>账号登录</xd-button>
|
|
40
|
+
</view>
|
|
41
|
+
|
|
42
|
+
<view class="protocol">
|
|
43
|
+
<xd-form-checkbox
|
|
44
|
+
class="xd-form-checkbox"
|
|
45
|
+
v-model="panel_1_checked"
|
|
46
|
+
mode="default"
|
|
47
|
+
multiple
|
|
48
|
+
:localdata="[{ value: 1, text: '请阅读并同意《隐私政策》《用户服务协议》' },]"
|
|
49
|
+
>
|
|
50
|
+
<template slot="a1">
|
|
51
|
+
<view>
|
|
52
|
+
<text>请阅读并同意</text>
|
|
53
|
+
<text @click.stop="handlePrivacy('privacy_privacy')" :style="{color: mainColor}">《隐私政策》</text>
|
|
54
|
+
<text @click.stop="handlePrivacy('privacy_service')" :style="{color: mainColor}">《用户服务协议》</text>
|
|
55
|
+
</view>
|
|
56
|
+
</template>
|
|
57
|
+
</xd-form-checkbox>
|
|
58
|
+
</view>
|
|
59
|
+
</view>
|
|
60
|
+
</view>
|
|
61
|
+
<view v-if="showStep === 2" class="panel-login-password">
|
|
62
|
+
<!-- <view class="phone-login-type">
|
|
63
|
+
<view
|
|
64
|
+
v-if="phoneLogin"
|
|
65
|
+
class="_item"
|
|
66
|
+
:class="{ active: accountLoginType === 'phone' }"
|
|
67
|
+
@click="setAccountLoginType('phone')"
|
|
68
|
+
>验证码登录<text :style="{ background: mainColor }"></text
|
|
69
|
+
></view>
|
|
70
|
+
<view
|
|
71
|
+
v-if="pwdLogin"
|
|
72
|
+
class="_item"
|
|
73
|
+
:class="{ active: accountLoginType === 'pwd' }"
|
|
74
|
+
@click="setAccountLoginType('pwd')"
|
|
75
|
+
>密码登录<text :style="{ background: mainColor }"></text
|
|
76
|
+
></view>
|
|
77
|
+
</view> -->
|
|
78
|
+
<view style="margin-top: 40rpx">
|
|
79
|
+
<xd-form
|
|
80
|
+
label-width="130"
|
|
81
|
+
label-align="right"
|
|
82
|
+
content-align="left"
|
|
83
|
+
:border="true"
|
|
84
|
+
paddingBetween="40"
|
|
85
|
+
>
|
|
86
|
+
<xd-form-item class="form-item" label="手机号" content-align="left">
|
|
87
|
+
<xd-form-input
|
|
88
|
+
v-model="accountForm.phone_number"
|
|
89
|
+
placeholder="请输入11位手机号"
|
|
90
|
+
/>
|
|
91
|
+
</xd-form-item>
|
|
92
|
+
<xd-form-item
|
|
93
|
+
v-if="accountLoginType === 'phone'"
|
|
94
|
+
label="验证码"
|
|
95
|
+
content-align="left"
|
|
96
|
+
>
|
|
97
|
+
<view class="flex align-center">
|
|
98
|
+
<xd-form-input
|
|
99
|
+
v-model="accountForm.verification_code"
|
|
100
|
+
placeholder="请输入验证码"
|
|
101
|
+
/>
|
|
102
|
+
<view
|
|
103
|
+
class="get_code"
|
|
104
|
+
@click="reGetCode"
|
|
105
|
+
:style="{ color: mainColor }"
|
|
106
|
+
>{{ time ? time + "秒后获取" : "获取验证码" }}
|
|
107
|
+
</view>
|
|
108
|
+
</view>
|
|
109
|
+
</xd-form-item>
|
|
110
|
+
<xd-form-item
|
|
111
|
+
v-if="accountLoginType === 'pwd'"
|
|
112
|
+
label="密码"
|
|
113
|
+
content-align="left"
|
|
114
|
+
>
|
|
115
|
+
<xd-form-input
|
|
116
|
+
type="password"
|
|
117
|
+
v-model="accountForm.password"
|
|
118
|
+
placeholder="请输入密码"
|
|
119
|
+
/>
|
|
120
|
+
</xd-form-item>
|
|
121
|
+
</xd-form>
|
|
122
|
+
</view>
|
|
123
|
+
|
|
124
|
+
<view class="form-group" style="padding-bottom:0">
|
|
125
|
+
<xd-form-checkbox
|
|
126
|
+
class="xd-form-checkbox"
|
|
127
|
+
v-model="panel_2_checked"
|
|
128
|
+
mode="default"
|
|
129
|
+
multiple
|
|
130
|
+
:localdata="[{ value: 1, text: '登录即同意《隐私政策》《用户服务协议》' },]"
|
|
131
|
+
>
|
|
132
|
+
<template slot="a1">
|
|
133
|
+
<view>
|
|
134
|
+
<text>请阅读并同意</text>
|
|
135
|
+
<text @click.stop="handlePrivacy('privacy_privacy')" :style="{color: mainColor}">《隐私政策》</text>
|
|
136
|
+
<text @click.stop="handlePrivacy('privacy_service')" :style="{color: mainColor}">《用户服务协议》</text>
|
|
137
|
+
</view>
|
|
138
|
+
</template>
|
|
139
|
+
</xd-form-checkbox>
|
|
140
|
+
</view>
|
|
141
|
+
<view class="form-group">
|
|
142
|
+
<xd-button
|
|
143
|
+
style="flex: 1"
|
|
144
|
+
type="primary"
|
|
145
|
+
radius="10rpx"
|
|
146
|
+
:disabled="!panelTwoIsChecked"
|
|
147
|
+
@click="doLoginForm"
|
|
148
|
+
>登录</xd-button>
|
|
149
|
+
</view>
|
|
150
|
+
<view
|
|
151
|
+
v-if="accountLoginType === 'pwd'"
|
|
152
|
+
class="forget_password"
|
|
153
|
+
@click="toValidPhone"
|
|
154
|
+
>忘记密码</view>
|
|
155
|
+
</view>
|
|
156
|
+
</view>
|
|
157
|
+
</view>
|
|
158
|
+
</template>
|
|
159
|
+
|
|
160
|
+
<script>
|
|
161
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
162
|
+
import XdButton from "@/components/XdButton/XdButton";
|
|
163
|
+
import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
|
|
164
|
+
import XdFormInput from "@/components/XdFormInput/XdFormInput";
|
|
165
|
+
import XdForm from "@/components/XdForm/XdForm";
|
|
166
|
+
import XdFormItem from "@/components/XdFormItem/XdFormItem";
|
|
167
|
+
import XdDailog from "@/components/XdDailog/XdDailog"
|
|
168
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
169
|
+
import JfbBaseSaasLoginMixin from "./JfbBaseSaasLoginMixin";
|
|
170
|
+
import { mapState } from "vuex"
|
|
171
|
+
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
172
|
+
import componentsMixins from "@/mixins/componentsMixins";
|
|
173
|
+
import extsMixins from "@/mixins/extsMixins";
|
|
174
|
+
import getServiceUrl from "@/common/getServiceUrl";
|
|
175
|
+
import { Base64 } from "js-base64";
|
|
176
|
+
import * as dd from "dingtalk-jsapi"
|
|
177
|
+
export default {
|
|
178
|
+
name: "JfbBaseSaasLogin",
|
|
179
|
+
components: {
|
|
180
|
+
XdFontIcon,
|
|
181
|
+
XdButton,
|
|
182
|
+
XdFormCheckbox,
|
|
183
|
+
XdFormInput,
|
|
184
|
+
XdForm,
|
|
185
|
+
XdFormItem,
|
|
186
|
+
XdDailog
|
|
187
|
+
},
|
|
188
|
+
mixins: [
|
|
189
|
+
componentsMixins, extsMixins, JfbBaseSaasLoginMixin
|
|
190
|
+
],
|
|
191
|
+
computed: {
|
|
192
|
+
...mapState(['jfbAuthorize']),
|
|
193
|
+
panelIsChecked() {
|
|
194
|
+
return this.panel_1_checked.includes(1);
|
|
195
|
+
},
|
|
196
|
+
panelTwoIsChecked() {
|
|
197
|
+
return this.panel_2_checked.includes(1);
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
data() {
|
|
201
|
+
return {
|
|
202
|
+
accountForm: {
|
|
203
|
+
phone_number: "",
|
|
204
|
+
password: "",
|
|
205
|
+
verification_code: ""
|
|
206
|
+
},
|
|
207
|
+
showStep: 1,
|
|
208
|
+
time: 0,
|
|
209
|
+
panel_1_checked: "",
|
|
210
|
+
panel_2_checked: "",
|
|
211
|
+
pwdLogin: null,
|
|
212
|
+
phoneLogin: null,
|
|
213
|
+
accountLoginType: "phone", //phone: 验证码登录 pwd: 密码登录
|
|
214
|
+
redirect_url: "", //401回跳地址
|
|
215
|
+
hasAuthLogin: false, //是否有授权登录
|
|
216
|
+
hasAccountLogin: false, //是否有账号登录 包含 验证码、密码登录
|
|
217
|
+
quickLogin: null,
|
|
218
|
+
biz_name: "login",
|
|
219
|
+
|
|
220
|
+
dialogShow: false,
|
|
221
|
+
companyList: [],
|
|
222
|
+
logo: "",
|
|
223
|
+
partnerName: "",
|
|
224
|
+
logoTextColor: "",
|
|
225
|
+
base: "",
|
|
226
|
+
sub_company_id: "1",
|
|
227
|
+
|
|
228
|
+
//面板
|
|
229
|
+
callback_url: "", //面板配置登录完跳转地址
|
|
230
|
+
forget_pwd_url: "", //忘记密码跳转地址
|
|
231
|
+
phone_number_login_url: "", //手机号登陆URL
|
|
232
|
+
phone_auth_callback_url: "", //手机认证回调URL
|
|
233
|
+
error_callback_url: "", //错误回调URL
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
watch: {
|
|
237
|
+
container(value) {
|
|
238
|
+
this.init(value)
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
created() {
|
|
242
|
+
this.init(this.container);
|
|
243
|
+
this.base = this.jfbAuthorize.getBasePath(this);
|
|
244
|
+
this.site_logo = getServiceUrl(this.projectAttr["site_logo"]);
|
|
245
|
+
},
|
|
246
|
+
methods: {
|
|
247
|
+
onJfbLoad(options) {
|
|
248
|
+
this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
|
|
249
|
+
if(options.sub_company_id){
|
|
250
|
+
this.sub_company_id = options.sub_company_id;
|
|
251
|
+
}else if(options['x-common']){
|
|
252
|
+
let decodeParams = Base64.decode(options['x-common']);
|
|
253
|
+
if(decodeParams.sub_company_id){
|
|
254
|
+
this.sub_company_id = decodeParams.sub_company_id;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
this.p_getPlatform();
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* @description 监听事件变化
|
|
261
|
+
* @param container {object} 业务组件对象自己
|
|
262
|
+
*/
|
|
263
|
+
init(container) {
|
|
264
|
+
let name, logo;
|
|
265
|
+
if (this.projectAttr["site_logo"])
|
|
266
|
+
logo = getServiceUrl(this.projectAttr["site_logo"], "size3");
|
|
267
|
+
this.callback_url = getContainerPropsValue(container, "content.callback_url", {value: ''}).value;
|
|
268
|
+
this.forget_pwd_url = getContainerPropsValue(container, "content.forget_pwd_url", {value: ''}).value;
|
|
269
|
+
this.logo = logo || "//dummyimage.com/100x100";
|
|
270
|
+
this.partnerName = name || "聚福宝福利";
|
|
271
|
+
this.logoTextColor = getContainerPropsValue(container, "content.logoTextColor", "#333");
|
|
272
|
+
},
|
|
273
|
+
handleRedirectUrl(){
|
|
274
|
+
let { redirect_url, callback_url } = this;
|
|
275
|
+
|
|
276
|
+
//不同项目直接域名替换
|
|
277
|
+
if (/^(@site_domain@).+$/.test(redirect_url)) {
|
|
278
|
+
redirect_url = redirect_url.replace(/@site_domain@/, location.origin)
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
let redirectURL = new URL(redirect_url);
|
|
282
|
+
redirect_url = redirectURL.href;
|
|
283
|
+
} catch (e) {
|
|
284
|
+
redirect_url = location.origin + this.base + redirect_url;
|
|
285
|
+
}
|
|
286
|
+
return redirect_url;
|
|
287
|
+
},
|
|
288
|
+
getReqParams(){
|
|
289
|
+
let redirect_url = this.handleRedirectUrl();
|
|
290
|
+
let params = {
|
|
291
|
+
sub_company_id: this.sub_company_id,
|
|
292
|
+
callback_url: redirect_url,
|
|
293
|
+
phone_number_login_url: location.origin + this.base + this.phone_number_login_url,
|
|
294
|
+
phone_auth_callback_url: location.origin + this.base + this.phone_auth_callback_url,
|
|
295
|
+
error_callback_url: location.origin + this.base + this.error_callback_url,
|
|
296
|
+
};
|
|
297
|
+
return params;
|
|
298
|
+
},
|
|
299
|
+
p_getPlatform(){
|
|
300
|
+
let params = this.getReqParams();
|
|
301
|
+
|
|
302
|
+
jfbRootExec("getPlatform", {
|
|
303
|
+
vm: this,
|
|
304
|
+
data: params
|
|
305
|
+
}).then(res => {
|
|
306
|
+
this.handleAuthResult(res);
|
|
307
|
+
})
|
|
308
|
+
},
|
|
309
|
+
/**
|
|
310
|
+
* @description 获取到登陆方式之后处理
|
|
311
|
+
*/
|
|
312
|
+
handleAuthResult(res) {
|
|
313
|
+
if (res.quick_enabled) {
|
|
314
|
+
this.hasAuthLogin = true;
|
|
315
|
+
this.quickLogin = res.quick;
|
|
316
|
+
}
|
|
317
|
+
if (res.other.length > 0) {
|
|
318
|
+
this.hasAccountLogin = true;
|
|
319
|
+
res.other.forEach((item) => {
|
|
320
|
+
if (item.login_platform_code === "JFB") {
|
|
321
|
+
this.phoneLogin = item;
|
|
322
|
+
}
|
|
323
|
+
// else if (item.login_platform_code === "account") {
|
|
324
|
+
// this.pwdLogin = item;
|
|
325
|
+
// }
|
|
326
|
+
});
|
|
327
|
+
// if (!this.phoneLogin) this.accountLoginType = "pwd";
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
//企业微信登录
|
|
331
|
+
p_loginWxEnter(){
|
|
332
|
+
let params = this.getReqParams();
|
|
333
|
+
params['code'] = ""; //企业微信code
|
|
334
|
+
jfbRootExec("loginWxEnter", {
|
|
335
|
+
vm: this,
|
|
336
|
+
data: params
|
|
337
|
+
}).then(res => {
|
|
338
|
+
|
|
339
|
+
})
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
//获取钉钉免登码
|
|
343
|
+
p_loginDing(){
|
|
344
|
+
dd.getAuthCode({
|
|
345
|
+
corpId: 'ding12345xxx',
|
|
346
|
+
success: (res) => {
|
|
347
|
+
const { authCode } = res;
|
|
348
|
+
jfbRootExec("loginDing", {
|
|
349
|
+
vm: this,
|
|
350
|
+
data: {
|
|
351
|
+
sub_company_id: this.sub_company_id,
|
|
352
|
+
code: authCode
|
|
353
|
+
}
|
|
354
|
+
}).then(res => {
|
|
355
|
+
const { access_code, phone_auth, phone_number } = res;
|
|
356
|
+
//手机号是否认证: Y已认证 N未认证
|
|
357
|
+
if(phone_auth === 'N'){
|
|
358
|
+
this.$xdUniHelper.redirectTo({
|
|
359
|
+
url: `${phone_auth_callback_url}?access_code=${access_code}&phone_number=${phone_number}`
|
|
360
|
+
});
|
|
361
|
+
}else{
|
|
362
|
+
this.toHomeAfterLogin();
|
|
363
|
+
}
|
|
364
|
+
})
|
|
365
|
+
},
|
|
366
|
+
fail: () => {},
|
|
367
|
+
complete: () => {},
|
|
368
|
+
})
|
|
369
|
+
},
|
|
370
|
+
//账号登录
|
|
371
|
+
doLoginForm() {
|
|
372
|
+
const { phone_number, password, verification_code } = this.accountForm;
|
|
373
|
+
let err_tip = "";
|
|
374
|
+
if (!phone_number) err_tip = "手机号不能为空";
|
|
375
|
+
else if (!verification_code) err_tip = "验证码不能为空";
|
|
376
|
+
if (err_tip) {
|
|
377
|
+
return uni.showToast({
|
|
378
|
+
title: err_tip,
|
|
379
|
+
icon: "none",
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
this.$xdShowLoading({})
|
|
384
|
+
jfbRootExec("sassPhoneLogin", {
|
|
385
|
+
vm: this,
|
|
386
|
+
data: {
|
|
387
|
+
biz_name: this.biz_name,
|
|
388
|
+
phone_number: phone_number,
|
|
389
|
+
valid_code: verification_code,
|
|
390
|
+
},
|
|
391
|
+
})
|
|
392
|
+
.then((res) => {
|
|
393
|
+
this.$xdHideLoading()
|
|
394
|
+
if(res.list.length === 0){
|
|
395
|
+
uni.showToast({
|
|
396
|
+
title: '该用户没有所属企业',
|
|
397
|
+
duration: 2000
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
else if(res.list.length > 1){
|
|
401
|
+
this.companyList = res.list;
|
|
402
|
+
this.dialogShow = true;
|
|
403
|
+
}else{
|
|
404
|
+
this.p_passportSaasLogin(res.list[0])
|
|
405
|
+
}
|
|
406
|
+
})
|
|
407
|
+
.catch(error => {
|
|
408
|
+
this.$xdHideLoading()
|
|
409
|
+
this.$xdLog.catch(error)
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
//选择企业后,需要passport登录
|
|
413
|
+
p_passportSaasLogin(item){
|
|
414
|
+
let redirect_url = this.handleRedirectUrl();
|
|
415
|
+
const { phone_number, password, verification_code } = this.accountForm;
|
|
416
|
+
jfbRootExec("passportSaasLogin", {
|
|
417
|
+
vm: this,
|
|
418
|
+
data: {
|
|
419
|
+
access_token: item.access_code,
|
|
420
|
+
redirect_url,
|
|
421
|
+
phone_number,
|
|
422
|
+
valid_code: verification_code,
|
|
423
|
+
biz_name: this.biz_name
|
|
424
|
+
}
|
|
425
|
+
}).then(res => {
|
|
426
|
+
this.jfbAuthorize.setAllToken(res);
|
|
427
|
+
this.toHomeAfterLogin();
|
|
428
|
+
})
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
toHomeAfterLogin() {
|
|
432
|
+
let { redirect_url, callback_url } = this;
|
|
433
|
+
if (redirect_url) redirect_url = redirect_url;
|
|
434
|
+
this.$xdUniHelper.redirectTo({
|
|
435
|
+
url: redirect_url || callback_url || this.settings.index,
|
|
436
|
+
});
|
|
437
|
+
},
|
|
438
|
+
//跳转忘记密码
|
|
439
|
+
toValidPhone() {
|
|
440
|
+
this.$xdUniHelper.navigateTo({
|
|
441
|
+
url: this.forget_pwd_url,
|
|
442
|
+
});
|
|
443
|
+
},
|
|
444
|
+
handlePrivacy(code){
|
|
445
|
+
let params = `page_id=${this.pageAttr["page_id"]}`;
|
|
446
|
+
params = `${params}&container_id=${this.containerId}${code}`;
|
|
447
|
+
this.$xdUniHelper.navigateTo({
|
|
448
|
+
url: `/pages/content/content?${params}`
|
|
449
|
+
})
|
|
450
|
+
},
|
|
451
|
+
doLoginAccount() {
|
|
452
|
+
console.log("doLoginAccount", this.panel_1_checked);
|
|
453
|
+
if (this.panel_1_checked.includes(1)) {
|
|
454
|
+
this.showStep = 2;
|
|
455
|
+
} else {
|
|
456
|
+
this.$xdConfirm({
|
|
457
|
+
content: "请阅读并勾选读用户协议与隐私协议",
|
|
458
|
+
cancel: false,
|
|
459
|
+
confirmText: "我知道了",
|
|
460
|
+
$vm: this,
|
|
461
|
+
});
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
reGetCode() {
|
|
466
|
+
if (this.time > 0) return;
|
|
467
|
+
const { phone_number } = this.accountForm;
|
|
468
|
+
if (!/^1[3-9]\d{9}$/.test(phone_number)) {
|
|
469
|
+
uni.showToast({
|
|
470
|
+
title: "请填写正确的手机号",
|
|
471
|
+
icon: "none",
|
|
472
|
+
});
|
|
473
|
+
return false;
|
|
474
|
+
}
|
|
475
|
+
this.$xdShowLoading({});
|
|
476
|
+
jfbRootExec("sendMsg", {
|
|
477
|
+
vm: this,
|
|
478
|
+
data: {
|
|
479
|
+
phone_number,
|
|
480
|
+
biz_name: this.biz_name,
|
|
481
|
+
},
|
|
482
|
+
}).then((res) => {
|
|
483
|
+
this.$xdHideLoading();
|
|
484
|
+
this.time = 120;
|
|
485
|
+
this.interval = setInterval(() => {
|
|
486
|
+
this.time--;
|
|
487
|
+
if (this.time === 0) {
|
|
488
|
+
clearTimeout(this.interval);
|
|
489
|
+
}
|
|
490
|
+
}, 1000);
|
|
491
|
+
}).catch((error) => {
|
|
492
|
+
this.$xdHideLoading();
|
|
493
|
+
console.error(error);
|
|
494
|
+
this.$xdLog.catch(error)
|
|
495
|
+
});
|
|
496
|
+
},
|
|
497
|
+
onJfbScroll(options) {
|
|
498
|
+
|
|
499
|
+
},
|
|
500
|
+
onJfbReachBottom(options) {
|
|
501
|
+
console.log('event.onJfbReachBottom', options)
|
|
502
|
+
},
|
|
503
|
+
onJfbShow(options) {
|
|
504
|
+
console.log('event.onJfbShow', options)
|
|
505
|
+
},
|
|
506
|
+
onJfbHide(options) {
|
|
507
|
+
console.log('event.onJfbHide', options)
|
|
508
|
+
},
|
|
509
|
+
onJfbBack(options) {
|
|
510
|
+
console.log('event.onJfbBack', options)
|
|
511
|
+
this.$xdUniHelper.navigateBack();
|
|
512
|
+
},
|
|
513
|
+
onJfbUpdate(...data) {
|
|
514
|
+
console.log('event.onJfbUpdate', data)
|
|
515
|
+
},
|
|
516
|
+
onJfbCustomEvent(options) {
|
|
517
|
+
console.log('event.onJfbReachBottom', options)
|
|
518
|
+
},
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
</script>
|
|
523
|
+
|
|
524
|
+
<style scoped lang="less">
|
|
525
|
+
@import "./JfbBaseSaasLoginLess.less";
|
|
526
|
+
|
|
527
|
+
.jfb-base-saas-login {
|
|
528
|
+
border: 1px dashed rgba(0, 0, 0, 0);
|
|
529
|
+
box-sizing: border-box;
|
|
530
|
+
&__body{
|
|
531
|
+
.xd-form-checkbox {
|
|
532
|
+
/deep/ .checklist-content .checklist-text {
|
|
533
|
+
font-size: 26rpx !important;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
.xd-form-checkbox {
|
|
537
|
+
/deep/ .checklist-box {
|
|
538
|
+
margin: 0;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
.xd-form-checkbox {
|
|
542
|
+
/deep/ .checklist-group {
|
|
543
|
+
justify-content: center;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
.xd-form-checkbox {
|
|
547
|
+
/deep/ .checklist-text {
|
|
548
|
+
margin-left: unit(20,rpx) !important;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.form-group {
|
|
553
|
+
padding: 40rpx 70rpx;
|
|
554
|
+
}
|
|
555
|
+
.form-item {
|
|
556
|
+
/deep/ .uni-forms-item {
|
|
557
|
+
padding-left: unit(30rpx) !important;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
.get_code {
|
|
561
|
+
color: @xd-base-color;
|
|
562
|
+
font-size: 24rpx;
|
|
563
|
+
margin-right: unit(20,rpx);
|
|
564
|
+
}
|
|
565
|
+
.panel-login-auth {
|
|
566
|
+
.logo-wrap {
|
|
567
|
+
text-align: center;
|
|
568
|
+
margin: unit(165,rpx) 0;
|
|
569
|
+
image {
|
|
570
|
+
width: 180rpx;
|
|
571
|
+
height: 180rpx;
|
|
572
|
+
margin-bottom: unit(12,rpx);
|
|
573
|
+
}
|
|
574
|
+
view {
|
|
575
|
+
font-size: unit(36,rpx);
|
|
576
|
+
font-weight: 600;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
.login_types {
|
|
580
|
+
padding: 10rpx 50rpx;
|
|
581
|
+
|
|
582
|
+
.protocol {
|
|
583
|
+
font-size: 24rpx;
|
|
584
|
+
margin-top: 40rpx;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
.panel-login-password {
|
|
589
|
+
/deep/ .uni-forms-item__label {
|
|
590
|
+
.label-text {
|
|
591
|
+
font-size: 26rpx;
|
|
592
|
+
color: #a6a6a6;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
/deep/ .uni-easyinput__placeholder-class {
|
|
596
|
+
font-size: 26rpx;
|
|
597
|
+
color: #d4d4d4;
|
|
598
|
+
}
|
|
599
|
+
.phone-login-type {
|
|
600
|
+
display: flex;
|
|
601
|
+
color: #808080;
|
|
602
|
+
font-size: 32rpx;
|
|
603
|
+
padding: 40rpx 70rpx;
|
|
604
|
+
align-items: center;
|
|
605
|
+
._item {
|
|
606
|
+
margin: 0 30rpx;
|
|
607
|
+
position: relative;
|
|
608
|
+
line-height: 2;
|
|
609
|
+
&:first-child {
|
|
610
|
+
margin-left: 0;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&.active {
|
|
614
|
+
color: #383838;
|
|
615
|
+
font-size: 36rpx;
|
|
616
|
+
|
|
617
|
+
text {
|
|
618
|
+
position: absolute;
|
|
619
|
+
height: 6rpx;
|
|
620
|
+
width: 90rpx;
|
|
621
|
+
border-radius: 6rpx;
|
|
622
|
+
left: 50%;
|
|
623
|
+
bottom: 0;
|
|
624
|
+
transform: translateX(-50%);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
.forget_password {
|
|
630
|
+
font-size: 24rpx;
|
|
631
|
+
color: #a6a6a6;
|
|
632
|
+
text-align: right;
|
|
633
|
+
margin: 20rpx 70rpx 0 0;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.not_login {
|
|
637
|
+
position: fixed;
|
|
638
|
+
width: 100%;
|
|
639
|
+
text-align: center;
|
|
640
|
+
bottom: 100rpx;
|
|
641
|
+
font-size: 24rpx;
|
|
642
|
+
color: #fe7a63;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
.panel-forget-password {
|
|
646
|
+
/deep/ .uni-forms-item__label {
|
|
647
|
+
.label-text {
|
|
648
|
+
font-size: 26rpx;
|
|
649
|
+
color: #a6a6a6;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
/deep/ .uni-easyinput__placeholder-class {
|
|
653
|
+
font-size: 26rpx;
|
|
654
|
+
color: #d4d4d4;
|
|
655
|
+
}
|
|
656
|
+
.forget_tip {
|
|
657
|
+
box-sizing: border-box;
|
|
658
|
+
width: 600rpx;
|
|
659
|
+
border-radius: 10rpx;
|
|
660
|
+
box-shadow: 0px 0px 20px 0px #00000019;
|
|
661
|
+
padding: 64rpx 46rpx;
|
|
662
|
+
margin: 200rpx auto;
|
|
663
|
+
text-align: center;
|
|
664
|
+
font-size: 32rpx;
|
|
665
|
+
.contact_phone {
|
|
666
|
+
color: @xd-base-color;
|
|
667
|
+
font-size: 56rpx;
|
|
668
|
+
margin: 20rpx 0 30rpx;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
.panel-reset-password {
|
|
673
|
+
/deep/ .uni-forms-item__label {
|
|
674
|
+
width: 185rpx !important;
|
|
675
|
+
.label-text {
|
|
676
|
+
font-size: 26rpx;
|
|
677
|
+
color: #a6a6a6;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
/deep/ .uni-easyinput__placeholder-class {
|
|
681
|
+
font-size: 26rpx;
|
|
682
|
+
color: #d4d4d4;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
.flex {
|
|
688
|
+
display: flex;
|
|
689
|
+
}
|
|
690
|
+
.flex-sub {
|
|
691
|
+
flex: 1;
|
|
692
|
+
}
|
|
693
|
+
.align-center {
|
|
694
|
+
align-items: center;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.login-pub {
|
|
698
|
+
margin-top: unit(40, rpx);
|
|
699
|
+
}
|
|
700
|
+
</style>
|