|
@@ -38,12 +38,13 @@ |
|
|
//#region 导入
|
|
|
//#region 导入
|
|
|
import { ref, reactive } from "vue";
|
|
|
import { ref, reactive } from "vue";
|
|
|
import { voiceTotalApi, loginPhoneApi } from "../../api/login.js";
|
|
|
import { voiceTotalApi, loginPhoneApi } from "../../api/login.js";
|
|
|
|
|
|
|
|
|
|
|
|
import { userInfoModules } from "@/store/modules/userInfo";
|
|
|
//#endregion
|
|
|
//#endregion
|
|
|
|
|
|
const userInfoModulesPinia = userInfoModules();
|
|
|
|
|
|
|
|
|
//#region 勾选
|
|
|
//#region 勾选
|
|
|
const checkboxValue1 = ref([]);
|
|
|
const checkboxValue1 = ref([]);
|
|
|
const checkboxList1 = reactive([
|
|
|
|
|
|
|
|
|
const checkboxList1 = ref([
|
|
|
{
|
|
|
{
|
|
|
name: "同意智像相机用户使用协议",
|
|
|
name: "同意智像相机用户使用协议",
|
|
|
disabled: false,
|
|
|
disabled: false,
|
|
@@ -58,6 +59,7 @@ async function toCreate() { |
|
|
content: "同意慧图相机用户使用协议?",
|
|
|
content: "同意慧图相机用户使用协议?",
|
|
|
success: function (res) {
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
|
if (res.confirm) {
|
|
|
|
|
|
checkboxList1.value[0].disabled = true;
|
|
|
handleLogin();
|
|
|
handleLogin();
|
|
|
} else if (res.cancel) {
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
}
|
|
@@ -70,13 +72,29 @@ async function handleLogin() { |
|
|
// uni.getUserInfo({});
|
|
|
// uni.getUserInfo({});
|
|
|
uni.getUserProfile({
|
|
|
uni.getUserProfile({
|
|
|
desc: "用于完善用户信息",
|
|
|
desc: "用于完善用户信息",
|
|
|
success: (res1) => {
|
|
|
|
|
|
|
|
|
success: async (res1) => {
|
|
|
userInfo.value = res1.userInfo;
|
|
|
userInfo.value = res1.userInfo;
|
|
|
console.log(res1);
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
title: "获取成功",
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
userInfoModulesPinia.userInfo = res1.userInfo;
|
|
|
|
|
|
console.log(userInfoModulesPinia.openId, "拿出openid");
|
|
|
|
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
appId: "wx75cf14e3a0d45821",
|
|
|
|
|
|
openId: userInfoModulesPinia.openId,
|
|
|
|
|
|
encryptedData: res1.encryptedData,
|
|
|
|
|
|
iv: res1.iv,
|
|
|
|
|
|
};
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res2 = await loginPhoneApi(data);
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
title: "获取成功",
|
|
|
|
|
|
});
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
icon: "none",
|
|
|
|
|
|
title: "获取失败",
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
fail: (err) => {
|
|
|
console.log(err);
|
|
|
console.log(err);
|
|
|