Commit 6648ae8f authored by 张九刚's avatar 张九刚

Merge branch 'dev' of gitlab2.dui88.com:sparkprojects/20250528_FHQ1 into dev

parents 441eb5d8 55fccd95
......@@ -276,13 +276,13 @@ const handleBabyInfoConfirm = throttleTap(async () => {
req.babyGender = gender.value;
req.babyType = fetus.value;
}
const res = await userStore.createBabyInfo(req);
const success = await userStore.createBabyInfo(req);
console.log('success:', success);
hideLoading();
visible.value = false;
if (res.success) {
if (success) {
emit("confirm", {
date: date.value,
gender: gender.value,
......
......@@ -427,7 +427,7 @@ const formItems = ref([
const clearFormFields = () => {
formData.value.babyBirthday = "";
formData.value.dueDate = "";
if (userStore.babyInfo.content?.babyType == "") {
if (!userStore.babyInfo.content?.babyType) {
formData.value.babyType = "";
}
formData.value.babyGender = "";
......@@ -456,7 +456,6 @@ const getPickerIndex = (item) => {
if (item.mode === "date") {
if (typeof val === "string" && val.match(/^\d{4}-\d{2}-\d{2}$/)) {
const [year, month, day] = val.split("-").map(Number);
const currentYear = new Date().getFullYear();
const yearIdx = year - 1970;
const monthIdx = month - 1;
const dayIdx = day - 1;
......@@ -646,7 +645,7 @@ const handleUploadBackground = async (e) => {
function onDateStatusChange(status) {
if (pageType.value === "edit" && status < userStore.babyInfo.babyStage) {
uni.showToast({
title: "不能选择更早的阶段",
title: "不能超过当前时间哦~",
icon: "none",
});
return false;
......@@ -717,7 +716,7 @@ const initData = () => {
item.range = channelOptions.value;
} else if (
item.name === "babyType" &&
userStore.babyInfo.content?.babyType != ""
userStore.babyInfo.content?.babyType
) {
item.type = "display-obj";
}
......
......@@ -171,8 +171,9 @@ export const useUserStore = defineStore("userInfo", {
async createBabyInfo(babyInfo) {
const res = await updateBabyInfo(babyInfo);
if (res.success) {
this.loadBabyInfo();
this.loadUserInfo();
await this.loadBabyInfo();
await this.loadUserInfo();
await this.loadHomeInfo();
return true;
} else {
return false;
......
......@@ -23,14 +23,20 @@ export function jump({ type, url, extra = {} }) {
break;
case JumpType.MINI:
// 跳转到其他小程序页面
uni.navigateToMiniProgram({
console.log('extra:', url,extra);
const jumpParams = {
appId: extra.appId || '',
path: url,
extraData: extra.extraData || {},
envVersion: extra.envVersion || 'release',
envVersion: extra.envVersion || 'trial',
success: extra.success,
fail: extra.fail
})
}
console.log('jumpParams:', jumpParams);
uni.navigateToMiniProgram(jumpParams)
break;
case JumpType.H5:
// 跳转到 https 网络链接
......
......@@ -226,13 +226,16 @@ const handleToolClick = async (item) => {
return;
}
const { sign, timestamp, appId, partnerUserId } = res.data;
const { sign, timestamp, appId, partnerUserId, env } = res.data;
console.log('sign, timestamp, appId, partnerUserId:', sign, timestamp, appId, partnerUserId, env);
jump({
type: JumpType.MINI,
url: "/pages/partner/redirect",
extra: {
appId: "wx81ecfb5aa3fb512f",
envVersion: env,
extraData: {
sign, // 参考 4.请求参数
timestamp, // 参考 4.请求参数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment