Commit 85754020 authored by jt's avatar jt

Merge branch 'feihesanqi_20251014' of gitlab2.dui88.com:fh/20250528_FHQ1 into feihesanqi_20251014

parents dcfa67a3 df50e6f2
<script setup lang="ts">
import {computed, inject} from 'vue'
import {computed, inject, watch, ref} from 'vue'
import {jump} from '@/utils'
import {MdConfig} from "../types";
import {useMD} from "../use-md";
......@@ -18,6 +18,8 @@ const props = defineProps<{
const pageName = inject('pageName', '')
const needRevoke = ref(false)
const style = computed(() => {
const area = props.properties.area
return {
......@@ -35,22 +37,36 @@ const emit = defineEmits<{
(e: 'getphonenumber', e: any): void
}>()
function onClick(e) {
emit('click', e)
function onClick(e, revoke = false) {
if (!revoke) {
emit('click', e)
logClick()
}
if ((!props.properties.needLogin || props.isLogin) && props.properties.link) {
jump(props.properties.link)
}
logClick()
}
function onGetPhoneNumber(e) {
needRevoke.value = true
emit('getphonenumber', e)
}
watch(() => props.isLogin, async (newVal) => {
if (newVal && needRevoke.value) {
needRevoke.value = false
onClick(null, true)
}
})
</script>
<template>
<button class="click-area" :class="{'debug-mode': debugMode}" :style="style"
:open-type="openType ?? (properties.needLogin && !isLogin ? 'getPhoneNumber' : undefined)"
@click="onClick"
@getphonenumber="(e) => emit('getphonenumber', e)"
@getphonenumber="onGetPhoneNumber"
/>
</template>
......
......@@ -13,7 +13,7 @@ const gotPrizeModalRef = ref<InstanceType<typeof GotPrizeModal>>()
const updateShareData = inject('updateShareData')
const onGetPhoneNumber = inject('onGetPhoneNumber')
const { proxy } = getCurrentInstance()
const {proxy} = getCurrentInstance()
const $baseUrl = proxy.$baseUrl
const props = defineProps<{
......@@ -44,56 +44,54 @@ const inviteBtnProperties = computed(() => {
async function updateInvitationInfo() {
const resp = await fetchInvitationInfo()
console.log('invitationInfo:', resp.data)
return invitationInfo.value = resp.data
}
async function tryAssist() {
if (invitationInfo) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
const invitationCode = options.invitationCode;
if (invitationCode && !isAssist.value && props.isLogin) {
console.log('处理助力邀请码:', invitationCode)
try {
const unionId = uni.getStorageSync('unionId');
const res = await invitationAssist(invitationCode, unionId);
if (res && res.success) {
uni.showToast({
title: '助力成功',
icon: 'none',
duration: 2000
});
isAssist.value = true;
// 助力成功后重新获取数据
await updateInvitationInfo();
return Promise.resolve();
} else {
uni.showToast({
title: res.message,
icon: 'none',
duration: 2000
});
return Promise.reject();
}
} catch (error) {
console.error('助力请求失败:', error)
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
const invitationCode = options.invitationCode;
if (invitationCode && !isAssist.value && props.isLogin) {
console.log('处理助力邀请码:', invitationCode)
try {
const unionId = uni.getStorageSync('unionId');
const res = await invitationAssist(invitationCode, unionId);
if (res && res.success) {
uni.showToast({
title: '助力成功',
icon: 'none',
duration: 2000
});
isAssist.value = true;
await updateInvitationInfo();
return Promise.resolve();
} else {
uni.showToast({
title: error.message,
title: res.message,
icon: 'none',
duration: 2000
});
return Promise.reject();
}
} catch (error) {
console.error('助力请求失败:', error)
uni.showToast({
title: error.message,
icon: 'none',
duration: 2000
});
return Promise.reject();
}
}
}
async function initComponent() {
await tryAssist()
await tryAssist().catch(console.log) // catch是为了不阻断逻辑
await updateInvitationInfo()
......@@ -114,12 +112,12 @@ async function initComponent() {
watch(() => props.isLogin, async (newVal) => {
if (newVal) {
initComponent()
initComponent().catch(console.log)
}
})
onMounted(async () => {
initComponent()
initComponent().catch(console.log)
})
</script>
......@@ -130,7 +128,7 @@ onMounted(async () => {
<template
v-for="i in 2">
<image
v-if="i-1 < 2 - invitationInfo.nextRewardNeedCount"
v-if="isLogin ? i-1 < 2 - invitationInfo.nextRewardNeedCount : false"
class="avatar"
:src="getCdnUrl('home/icon-fill.png')"
/>
......@@ -154,14 +152,14 @@ onMounted(async () => {
background-color: rgba(255, 0, 0, 0.3);
}
.avatars{
.avatars {
position: absolute;
left: 24rpx;
top: 108rpx;
display: flex;
gap: 25rpx;
.avatar{
.avatar {
width: 63rpx;
height: 63rpx;
}
......
......@@ -38,6 +38,7 @@ import {useUserStore} from '@/stores/user';
import ClickArea from "./components/ClickArea.vue";
import ImageSwiper from "./components/ImageSwiper.vue";
import InviteTask from "./components/InviteTask.vue";
import { hideLoading, showLoading } from "@/utils";
const DEBUG_MODE = false
......@@ -48,7 +49,7 @@ const loading = ref(true) // 加载状态
// 邀请相关数据
const shareData = ref({
title: '星妈会超级品牌周来啦!',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png',
path: '/activities/1015/home',
})
......@@ -61,6 +62,7 @@ const isLogin = computed(()=>{
})
function updateShareData(data) {
console.log('updateShareData:', data)
Object.assign(shareData.value, data)
}
......@@ -187,6 +189,7 @@ onMounted(async () => {
// Phone authorization
const onGetPhoneNumber = async (e) => {
console.log('onGetPhoneNumber', e.detail)
showLoading('授权中...')
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const options = currentPage.options;
......@@ -197,7 +200,8 @@ const onGetPhoneNumber = async (e) => {
// console.warn('onGetPhoneNumber', e.detail)
// 隐藏授权弹窗
userStore.phoneCallback(e.detail, null, null, async () => {
// 重新获取用户信息(登录后)
hideLoading()
// 重新获取用户信息(登录后)getphonenumber
await Promise.all([
userStore.loadUserInfo(),
userStore.loadMemberInfo(),
......@@ -209,10 +213,12 @@ const onGetPhoneNumber = async (e) => {
}
})
} catch (error) {
hideLoading()
console.error('授权后处理失败:', error)
uni.showToast({title: '授权失败', icon: 'none'});
}
} else {
hideLoading()
uni.showToast({title: '授权失败', icon: 'none'});
}
};
......
const version = 'v1'
const version = 'v2'
const baseUrl = 'http://127.0.0.1:8080/activity/1015'
export const getCdnUrl = (path) => `${baseUrl}/${version}/${path}`
......
const version = 'v1'
const version = 'v2'
//const baseUrl = 'http://127.0.0.1:8080/activity/1015'
const baseUrl = 'https://course.feihe.com/momclub-picture/activity/1015'
......
......@@ -14,7 +14,7 @@ export function homeConfig(){
shareConfig: {
title: '星妈会超级品牌周来啦!北纬47°六水香大米上新!',
path: '/activities/1015/home',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png',
imageUrl: 'https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png',
},
components: [
{
......
{
"background": {
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/bg.jpg",
"image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/bg.jpg",
"style": {
"backgroundPosition": {
"y": "calc(4937rpx + 845rpx)"
......@@ -10,7 +10,7 @@
"shareConfig": {
"title": "星妈会超级品牌周来啦!北纬47°六水香大米上新!",
"path": "/activities/1015/home",
"imageUrl": "https://course.feihe.com/momclub-picture/activity/1015/v1/share-image.png"
"imageUrl": "https://course.feihe.com/momclub-picture/activity/1015/v2/share-image.png"
},
"components": [
{
......@@ -23,7 +23,7 @@
"indicatorDots": true,
"items": [
{
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/banner-0.png",
"image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/banner-0.png",
"mdConfig": {
"pageName": "1015专题活动页面",
"componentName": "banner头图",
......@@ -32,7 +32,7 @@
}
},
{
"image": "https://course.feihe.com/momclub-picture/activity/1015/v1/home/banner-1.png",
"image": "https://course.feihe.com/momclub-picture/activity/1015/v2/home/banner-1.png",
"mdConfig": {
"pageName": "1015专题活动页面",
"componentName": "banner头图",
......
import {useGlobalStore} from "@/stores/global";
const version = 'v1'
const version = 'v2'
export function getCdnUrl(path){
const {baseUrl} = useGlobalStore()
......
......@@ -4,4 +4,4 @@ const {
} = requestModule;
export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand'});
\ No newline at end of file
export const fetchBrandJSON = () => api.get('/c/front/content',{type:'brand_V1'});
\ No newline at end of file
......@@ -9,9 +9,9 @@ const {
*/
export const fetchHomeInfo = () => api.get('/c/user/index');
export const fetchHomeJSON = () => api.get('/c/front/content', { type: 'home' });
export const fetchCanEatIndex = () => api.get('/c/eat/index');
export const fetchCanEatJoin = (data) => api.post('/c/eat/join', data);
export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home_V1'});
......@@ -8,7 +8,7 @@ const {
* @returns
*/
export const fetchIntegralJSON = () => api.get('/c/front/content',{type:'integral'});
export const fetchIntegralJSON = () => api.get('/c/front/content',{type:'integral_V1'});
/**
* 获取生日礼接口
......
......@@ -46,7 +46,7 @@ export const fetchMemberInfo = () => api.get('/c/user/memberInfo');
*/
export const updateBabyInfo = (data) => api.post('/c/user/saveBaby', data);
export const fetchUserJSON = () => api.get('/c/front/content',{type:'my'});
export const fetchUserJSON = () => api.get('/c/front/content', { type: 'my_V1' });
/** 查询用户是否参与生育补贴和鹤礼2.0*/
export const checkParticipation = (data) => api.get('/c/fertility/index', data);
......
......@@ -17,9 +17,9 @@
<image class="diamondbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.BTN}`" mode="aspectFit"
@click="jump('diamond')"></image>
<!-- <image class="diamonddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.DIAMOND.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="diamonddesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>-->
<view class="diamonddesc" :style="{ color: getColor() }">
<!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>
</view>
<view v-if="currentLevelName === 'starshine'" class="starshine">
......@@ -40,9 +40,9 @@
@click="jump('starshine')"></image>
<!-- <image class="starshinedesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARSHINE.DESC}`" mode="aspectFit">
</image> -->
<!-- <view class="starshinedesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>-->
<view class="starshinedesc" :style="{ color: getColor() }">
<!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>
</view>
<view v-if="currentLevelName === 'starlight'" class="starlight">
......@@ -63,9 +63,9 @@
@click="jump('starlight')"></image>
<!-- <image class="starlightdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.STARLIGHT.DESC}`" mode="aspectFit">
</image> -->
<!-- <view class="starlightdesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>-->
<view class="starlightdesc" :style="{ color: getColor() }">
<!-- 7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课 -->
</view>
</view>
<view v-if="currentLevelName === 'gold'" class="gold">
......@@ -80,9 +80,9 @@
<image class="goldbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.BTN}`" mode="aspectFit"
@click="jump('gold')"></image>
<!-- <image class="golddesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.GOLD.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="golddesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则
</view>-->
<view class="golddesc" :style="{ color: getColor() }">
<!-- 5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 -->
</view>
</view>
<view v-if="currentLevelName === 'platinum'" class="platinum">
......@@ -102,9 +102,9 @@
<image class="platinumbtn" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.BTN}`" mode="aspectFit"
@click="jump('platinum')"></image>
<!-- <image class="platinumdesc" :src="`${$baseUrl}${BABY_CLASS_IMAGES.PLATINUM.DESC}`" mode="aspectFit"></image> -->
<!-- <view class="platinumdesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则
</view>-->
<view class="platinumdesc" :style="{ color: getColor() }">
<!-- 5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则 -->
</view>
</view>
</view>
......@@ -195,8 +195,7 @@ const jump = (level) => {
// 跳转到 H5 页面,地址暂时默认 https://www.baidu.com
// 可以根据不同等级跳转到不同的地址
//const url = 'https://member.feihe.com/memberH5/#/courses'
const url = 'https://mom.feihe.com/expertsView?from=home'
const url = 'https://mom.feihe.com/babyWikipedia';
// 使用 uni.navigateTo 跳转到 webview 页面
uni.navigateTo({
......
......@@ -6,10 +6,10 @@ export const BABY_CLASS_IMAGES = {
DIAMOND: {
BG: `pointRights/babyClass/${version}/DiamondBg.png`,
TITLE: `pointRights/babyClass/${version}/DiamondTitle.png`,
IPS1: `pointRights/babyClass/${version}/DiamondIps1.png`,
IPS2: `pointRights/babyClass/${version}/DiamondIps2.png`,
IPS3: `pointRights/babyClass/${version}/DiamondIps3.png`,
IPS4: `pointRights/babyClass/${version}/DiamondIps4.png`,
IPS1: `pointRights/babyClass/${version}/DiamondIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/DiamondIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/DiamondIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/DiamondIps4-1.png`,
BTN: `pointRights/babyClass/${version}/DiamondBtn.png`,
DESC: `pointRights/babyClass/${version}/DiamondDesc.png`
},
......@@ -18,10 +18,10 @@ export const BABY_CLASS_IMAGES = {
STARSHINE: {
BG: `pointRights/babyClass/${version}/StarshineBg.png`,
TITLE: `pointRights/babyClass/${version}/StarshineTitle.png`,
IPS1: `pointRights/babyClass/${version}/StarshineIps1.png`,
IPS2: `pointRights/babyClass/${version}/StarshineIps2.png`,
IPS3: `pointRights/babyClass/${version}/StarshineIps3.png`,
IPS4: `pointRights/babyClass/${version}/StarshineIps4.png`,
IPS1: `pointRights/babyClass/${version}/StarshineIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/StarshineIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/StarshineIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/StarshineIps4-1.png`,
BTN: `pointRights/babyClass/${version}/StarshineBtn3.png`,
DESC: `pointRights/babyClass/${version}/StarshineDesc.png`
},
......@@ -30,10 +30,10 @@ export const BABY_CLASS_IMAGES = {
STARLIGHT: {
BG: `pointRights/babyClass/${version}/StarlightBg.png`,
TITLE: `pointRights/babyClass/${version}/StarlightTitle.png`,
IPS1: `pointRights/babyClass/${version}/StarlightIps1.png`,
IPS2: `pointRights/babyClass/${version}/StarlightIps2.png`,
IPS3: `pointRights/babyClass/${version}/StarlightIps3.png`,
IPS4: `pointRights/babyClass/${version}/StarlightIps4.png`,
IPS1: `pointRights/babyClass/${version}/StarlightIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/StarlightIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/StarlightIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/StarlightIps4-1.png`,
BTN: `pointRights/babyClass/${version}/StarlightBtn.png`,
DESC: `pointRights/babyClass/${version}/StarlightDesc.png`
},
......@@ -42,10 +42,10 @@ export const BABY_CLASS_IMAGES = {
GOLD: {
BG: `pointRights/babyClass/${version}/GoldIpsBg.png`,
TITLE: `pointRights/babyClass/${version}/GoldIpsTitle.png`,
IPS1: `pointRights/babyClass/${version}/GoldIps1.png`,
IPS2: `pointRights/babyClass/${version}/GoldIps2.png`,
IPS3: `pointRights/babyClass/${version}/GoldIps3.png`,
IPS4: `pointRights/babyClass/${version}/GoldIps4.png`,
IPS1: `pointRights/babyClass/${version}/GoldIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/GoldIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/GoldIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/GoldIps4-1.png`,
BTN: `pointRights/babyClass/${version}/GoldBtn.png`,
DESC: `pointRights/babyClass/${version}/GoldDesc.png`
},
......@@ -54,10 +54,10 @@ export const BABY_CLASS_IMAGES = {
PLATINUM: {
BG: `pointRights/babyClass/${version}/PlatinumBg.png`,
TITLE: `pointRights/babyClass/${version}/PlatinumTitle.png`,
IPS1: `pointRights/babyClass/${version}/PlatinumIps1.png`,
IPS2: `pointRights/babyClass/${version}/PlatinumIps2.png`,
IPS3: `pointRights/babyClass/${version}/PlatinumIps3.png`,
IPS4: `pointRights/babyClass/${version}/PlatinumIps4.png`,
IPS1: `pointRights/babyClass/${version}/PlatinumIps1-1.png`,
IPS2: `pointRights/babyClass/${version}/PlatinumIps2-1.png`,
IPS3: `pointRights/babyClass/${version}/PlatinumIps3-1.png`,
IPS4: `pointRights/babyClass/${version}/PlatinumIps4-1.png`,
BTN: `pointRights/babyClass/${version}/PlatinumBtn.png`,
DESC: `pointRights/babyClass/${version}/PlatinumDesc2.png`
}
......
.task_complete_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
.background_container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
}
.task_complete_container {
position: relative;
width: 600rpx;
height: 500rpx;
// background: #ffffff;
border-radius: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
// box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.3);
z-index: 2;
// padding: 40rpx;
.task_title {
font-size: 64rpx;
font-weight: bold;
color: #ffffff;
margin-bottom: 20rpx;
text-align: center;
}
.points_text {
font-size: 32rpx;
color: #ffffff;
margin-bottom: 40rpx;
text-align: center;
}
.coin_icon {
width: 119rpx;
height: 116rpx;
margin-bottom: 40rpx;
}
.accept_button {
width: 300rpx;
height: 80rpx;
background: #D3A458;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 30rpx;
.accept_text {
font-size: 32rpx;
color: #ffffff;
font-weight: bold;
}
}
}
.close_button {
position: absolute;
top: calc(1150rpx);
left: 50%;
transform: translateX(-50%);
width: 56rpx;
height: 56rpx;
background: rgba(255, 255, 255, 0.5);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.2);
z-index: 2;
.close_icon {
font-size: 36rpx;
color: #333333;
font-weight: bold;
line-height: 1;
}
}
}
<template>
<view class="task_complete_overlay" v-if="visible" @click="handleClose">
<!-- 背景容器,右下角镂空透明圆角矩形 -->
<view class="background_container"></view>
<view class="task_complete_container">
<!-- 任务完成标题 -->
<text class="task_title">完成{{ taskTitle }}任务</text>
<!-- 获得积分文字 -->
<text class="points_text">获得{{ points }}积分</text>
<!-- 金币图标 -->
<image class="coin_icon" :src="$baseUrl + `integral/1023/jifenIcon1.png`" mode="aspectFit" />
<!-- 开心收下按钮 -->
<view class="accept_button" @click="handleAccept">
<text class="accept_text">开心收下</text>
</view>
</view>
<!-- 关闭按钮 -->
<view class="close_button" @click="handleClose">
<text class="close_icon">×</text>
</view>
</view>
</template>
<script setup>
import { defineProps, defineEmits } from 'vue';
// Props 定义
const props = defineProps({
visible: {
type: Boolean,
default: false
},
points: {
type: Number,
default: 100
},
taskTitle: {
type: String,
default: 'xxx'
}
});
// Emits 定义
const emit = defineEmits(['close', 'accept']);
// 关闭弹窗
const handleClose = () => {
emit('close');
};
// 开心收下按钮点击
const handleAccept = () => {
emit('accept');
emit('close');
};
</script>
<style lang="less" scoped>
@import '@/components/qiandao/TaskComplete.less';
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -306,6 +306,7 @@
"desc": "产品溯源",
"bgUrl": "my/suyuan.png"
}, {
"hidden": true,
"link": {
"extra": {},
"type": 3,
......@@ -341,14 +342,32 @@
],
"specialAttentionOptions": ["过敏", "长肉", "肠道", "消化", "脑发育"],
"activeInfo": [{
"img": "https://course.feihe.com/momclub-picture/my/vipAct251009001.jpg",
"img": "https://course.feihe.com/momclub-picture/my/vipAct251019001.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"title": "兑换礼品",
"url": "/subPackages/shopMainList/topicNew/index?id=1001165"
"title": "玉米",
"url": "/subPackages/shopMainProcess/product/index?productId=822672030077575915&skuId=822672030077575917"
}, {
"img": "https://course.feihe.com/momclub-picture/my/vipAct251019101.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"title": "积分市集",
"url": "/subPackages/shopMainList/topicNew/index?id=1001167"
}, {
"img": "https://course.feihe.com/momclub-picture/my/vipAct251019201.png",
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"title": "樊文花",
"url": "/subPackages/shopMainProcess/product/index?productId=821844522041316920&skuId=821844522041316921"
}],
"channelOptions": ["电商(京东/天猫)", "母婴店"]
}
......
......@@ -219,8 +219,8 @@
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enableShare": true,
"shareAppMessage": true,
"shareTimeline": false
"enableShareAppMessage": true,
"enableShareTimeline": true
}
},
{
......@@ -403,7 +403,7 @@
"path" : "orderList/orderList",
"style" :
{
"navigationBarTitleText" : "订单列表"
"navigationBarTitleText" : "我的订单"
}
}
]
......
.page1{
height: calc(100vh - 218rpx);
}
.page2{
height: 100vh !important;
}
// 星妈实验室详情页面样式
.xingmalabdetailpage {
width: 750rpx;
height: calc(100vh - 218rpx);
left: 0rpx;
top: 0rpx;
overflow-y: auto;
......
......@@ -22,7 +22,9 @@ const registered = ref(undefined)
const urlMap = {
//'main': 'http://192.168.0.5:8001/#/page',
'main': 'https://momclub-uat.feihe.com/h5/#/page',
'main': 'https://momclub.feihe.com/h5/#/page',
//'main': 'https://momclub-test.feihe.com/h5/#/page',
//'main': 'https://momclub-uat.feihe.com/h5/#/page',
};
const shareData = ref(null)
......@@ -47,9 +49,10 @@ const handleBack = () => {
}
async function ensureAutoLogin() {
if (!globalStore.cuk) {
//debugger
//if (!globalStore.cuk) {
await userStore.normalAutoLogin()
}
//}
}
onShow(async () => {
......
......@@ -37,6 +37,8 @@ async function onRegisterCancel() {
userStore.loadUserInfo(),
])
//用户信息更新,抛出事件
uni.$emit("updateUserInfo");
uni.navigateBack({
delta: 1
})
......
......@@ -17,6 +17,15 @@
@record="handleInvitePrizePanelRecord"
@prize="handleInvitePrizePanelPrize"
/>
<!-- 任务完成弹窗 -->
<TaskComplete
:visible="globalStore.isShowTaskComplete"
:points="globalStore.taskCompletePoints"
:taskTitle="globalStore.taskCompleteTitle"
@close="handleCloseTaskComplete"
@accept="handleAcceptTaskComplete"
/>
<button v-if="isBackApp" class="back-app" open-type="launchApp" app-parameter="wechat" @binderror="handleLaunchAppError"
:style="{
......@@ -38,7 +47,7 @@
</view>
<!-- 悬浮授权手机号模块 -->
<view class="auth-phone-module" v-if="!false">
<view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile">
<image class="auth-phone-bg" :src="$baseUrl + 'homepage/Q3Res/accessBg.png'"></image>
<view class="auth-phone-btn-container">
<image class="auth-phone-btn" :src="$baseUrl + 'homepage/Q3Res/accessBtn.png'" @tap="handleAuthPhoneClick">
......@@ -58,6 +67,7 @@ import Integral from "@/views/Integral.vue";
import My from "@/views/My.vue";
import WxFriendCircleSimplePage from "@/components/WxFriendCircleSimplePage.vue";
import InvitePrizePanel from "@/components/integralArea/InvitePrizePanel.vue";
import TaskComplete from "@/components/qiandao/TaskComplete.vue";
import { useGlobalStore } from "@/stores/global.js";
import { useUserStore } from "@/stores/user.js";
import { jump, JumpType } from "../../utils";
......@@ -226,6 +236,17 @@ const handleInvitePrizePanelPrize = () => {
globalStore.isShowInvitePrizePanel = false;
// 这里可以添加跳转到奖品页面的逻辑
};
// 任务完成弹窗处理方法
const handleCloseTaskComplete = () => {
globalStore.isShowTaskComplete = false;
};
const handleAcceptTaskComplete = () => {
console.log('接受任务完成奖励');
globalStore.isShowTaskComplete = false;
// 这里可以添加接受奖励后的逻辑
};
</script>
<style lang="scss" scoped>
......
......@@ -17,6 +17,9 @@ export const useGlobalStore = defineStore('global', {
unionId: unionId,
baseUrl: '',
isShowInvitePrizePanel: false, // 是否显示邀请奖品弹窗
isShowTaskComplete: false, // 是否显示任务完成弹窗
taskCompletePoints: 100, // 任务完成获得的积分
taskCompleteTitle: 'xxx', // 任务完成的任务名称
};
},
actions: {
......@@ -53,6 +56,17 @@ export const useGlobalStore = defineStore('global', {
setIsShowLoading(v){
this.isShowLoading = v
},
/**
* 显示任务完成弹窗
* @param {number} points 获得的积分
* @param {string} taskTitle 任务名称
*/
showTaskComplete(points = 100, taskTitle = 'xxx') {
this.taskCompletePoints = points;
this.taskCompleteTitle = taskTitle;
this.isShowTaskComplete = true;
}
},
});
\ No newline at end of file
......@@ -21,31 +21,31 @@ import md from "../md.js";
const globalStore = useGlobalStore();
export const useUserStore = defineStore("userInfo", {
state: () => {
return {
userInfo: null,
babyInfo: null,
memberInfo: null,
babyNickCache: [],
cepingjieguoInfo: null,
};
},
state: () => {
return {
userInfo: null,
babyInfo: null,
memberInfo: null,
babyNickCache: [],
cepingjieguoInfo: null,
};
},
getters: {
isLogin: (state) => {
return state.userInfo?.memberId !== "not_login"
}
},
actions: {
/**
* 更新用户信息
* @param {Object} userInfo
*/
setUserInfo(userInfo) {
this.userInfo = userInfo;
},
setMemberInfo(memberInfo) {
this.memberInfo = memberInfo;
},
isLogin: (state) => {
return state.userInfo?.memberId !== "not_login"
}
},
actions: {
/**
* 更新用户信息
* @param {Object} userInfo
*/
setUserInfo(userInfo) {
this.userInfo = userInfo;
},
setMemberInfo(memberInfo) {
this.memberInfo = memberInfo;
},
/**
* 更新宝宝信息
......@@ -76,8 +76,7 @@ export const useUserStore = defineStore("userInfo", {
* @param {Object} data : {encryptedData, iv, code}
* @returns
*/
async phoneCallback(data, onOpenRegisterFn = () => {
}, cb = null, cb2 = null, invitationInfo = null) {
async phoneCallback(data, onOpenRegisterFn = () => {}, cb = null, cb2 = null, invitationInfo = null) {
uni.login({
provider: "weixin",
success: async (res) => {
......@@ -85,7 +84,9 @@ export const useUserStore = defineStore("userInfo", {
if (res.errMsg === "login:ok") {
// 用户手机授权F
const {
data: {babyExistence}
data: {
babyExistence
}
} = await fetchAutoPhone({
phoneEncryptedData: data.encryptedData,
phoneIv: data.iv,
......@@ -126,6 +127,7 @@ export const useUserStore = defineStore("userInfo", {
// 缓存用户memberId
uni.setStorageSync('memberId', data?.memberId)
}
uni.setStorageSync('loginStatus', data?.memberId == "not_login" ? 0 : 1)
this.userInfo = data;
},
......@@ -171,7 +173,9 @@ export const useUserStore = defineStore("userInfo", {
const RETRY_DELAY = 1000; // 1 second
try {
const {data} = await fetchBabyInfo();
const {
data
} = await fetchBabyInfo();
console.log("babyInfo-宝宝信息", data);
if (data?.memberId !== "not_login") {
......@@ -299,7 +303,9 @@ export const useUserStore = defineStore("userInfo", {
provider: "weixin",
success: async (res) => {
if (res.errMsg === "login:ok") {
const {data} = await autoLoginByCode(res.code);
const {
data
} = await autoLoginByCode(res.code);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) {
globalStore.setCuk(data.cuk, data.openId, data.unionId);
......@@ -329,7 +335,9 @@ export const useUserStore = defineStore("userInfo", {
provider: "weixin",
success: async (res) => {
if (res.errMsg === "login:ok") {
const {data} = await autoLoginByCode(res.code);
const {
data
} = await autoLoginByCode(res.code);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) {
globalStore.setCuk(data.cuk, data.openId, data.unionId);
......
import {
JumpType,
jump
} from ".";
import {
useUserStore
} from "../stores/user";
export function checkLogin(back) {
const userStore = useUserStore();
const memberInfo = userStore.memberInfo;
if (!memberInfo?.memberId || memberInfo?.memberId == "not_login") { //未登录
jump({
type: JumpType.INNER,
url: "/pages/activity/register"
})
// 监听用户信息更新
uni.$once('updateUserInfo', () => {
if (back) {
back();
}
})
return
}
if (back) {
back();
}
}
\ No newline at end of file
......@@ -138,10 +138,10 @@ export function throttleTap(fn, delay = 1000) {
let loadingCount = 0;
let loadingTimer = null;
export function showLoading() {
export function showLoading(title = "加载中") {
if (loadingCount == 0) {
uni.showLoading({
title: "加载中",
title,
mask: true,
});
......
......@@ -3,7 +3,7 @@
<!-- 内容区域 -->
<view class="content">
<view class="menu-list">
<view class="menu-item" @tap="handleItemTap('modifyPhone')">
<!-- <view class="menu-item" @tap="handleItemTap('modifyPhone')">
<view class="menu-left">
<view class="menu-icon">
<image :src="$baseUrl + 'homepage/Q3Res/icon_phone.png'" mode="aspectFit"
......@@ -12,7 +12,7 @@
<text class="menu-text">修改手机号</text>
</view>
<text class="arrow"></text>
</view>
</view> -->
<view class="menu-item" @tap="handleItemTap('partnership')">
<view class="menu-left">
......@@ -77,6 +77,8 @@
</template>
<script>
import { jump, JumpType } from '../../utils';
export default {
data() {
return {
......@@ -131,11 +133,17 @@ export default {
break
case 'userPolicy':
// 跳转到用户政策页面
// uni.navigateTo({ url: '/pages/userPolicy/index' })
jump({
type: JumpType.H5,
url: 'https://secret.feihe.com/index.html'
});
break
case 'privacyPolicy':
// 跳转到隐私协议页面
// uni.navigateTo({ url: '/pages/privacyPolicy/index' })
jump({
type: JumpType.H5,
url: 'https://secret.feihe.com/secret.html'
});
break
case 'cancelAccount':
// 跳转到注销账号页面
......
This diff is collapsed.
......@@ -160,9 +160,8 @@
v-if="video2Channel.videoUrl || (video2Channel.finderUserName && video2Channel.feedId)">
<video v-if="video2Channel.videoUrl" ref="brandVideo2Ref" id="brandVideo2" class="videoposter"
:src="video2Channel.videoUrl?.indexOf('http') === 0 ? video2Channel.videoUrl : $baseUrl + video2Channel.videoUrl"
:autoplay="false"
:autoplay="false" object-fit="cover" @loadedmetadata="onVideoLoadedMeta" @play="onVideo2Play"
:poster="video2Channel.posterUrl?.indexOf('http') === 0 ? video2Channel.posterUrl : $baseUrl + video2Channel.posterUrl"
object-fit="cover" @loadedmetadata="onVideoLoadedMeta" @play="onVideo2Play"
@ended="onVideo2Ended"></video>
<image v-else class="videoposter" :data-comlog="{
xcxComponentClick: 'true',
......@@ -427,14 +426,21 @@ export default {
async initBrandInfo() {
const { data } = await fetchBrandJSON();
if (data) {
this.swiperList = data.swiperList;
this.swiperList = data.swiperList || [{
"title": "默认图",
"url": this.$baseUrl + "homepage/brandSwiperDefaultBg.png"
}];
this.erqiPeizhi = data.erqiPeizhi;
this.productTabList = data.productTabList || [];
this.productInfoList = data.product || [];
this.esgInfoList = data.esgInfoList[0] || [];
this.qrInfoList = data.qrInfoList;
this.ipDesc = data.ipDesc;
this.swiperIconList = data.swiperIconList;
this.swiperIconList = data.swiperIconList || [{
activeUrl: this.$baseUrl + "homepage/brandSwiperDefaultBg.png",
baseUrl: this.$baseUrl + "homepage/brandSwiperDefaultBg.png",
text: "默认图"
}];
this.testVideoUrl = data.videoUrl;
if (data.videoUrl.indexOf('http') === -1) {
data.videoUrl = this.$baseUrl + data.videoUrl;
......@@ -569,11 +575,11 @@ export default {
md.sensorComponentLogTake(evt.currentTarget.dataset.comlog);
}
}
const { productId, skuId, contentImg, contentImgLen, shareTitle, shareImg, title, link } = item;
const { productId, skuId, contentImg, contentImgLen, shareTitle, shareImg, title, link, entrySource } = item;
const tabName = this.productTabList[this.channelTabIndex];
if (productId && skuId) {
const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}&entrySource=xmh_wechatmp_brand_profamily`;
if (productId && skuId && entrySource) {
const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}&entrySource=${entrySource}`;
const type = JumpType.MINI;
const extra = {
appId: 'wx4205ec55b793245e', //星妈优选小程序
......
......@@ -70,11 +70,11 @@
<!-- <button
v-if="homeStore && !homeStore.isLogin && item.title!='星妈会Lab' && item.title!='星妈起名' && item.title!='喂养工具' && item.title!='产检提醒' && item.title!='宝宝生长测评' && item.title!='体质测试'"
open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" class="sq_btn"></button> -->
<image class="tool_bg"
:src="item.icon?.indexOf('http') === 0 ? item.icon : $baseUrl + item.icon"
<image class="tool_bg" :src="$baseUrl + 'homepage/Q3Res/toolBg.png'"
@tap="handleToolClick(item)">
</image>
<!-- <image class="tool_icon" :src="$baseUrl + item.icon"></image> -->
<image class="tool_icon"
:src="item.icon?.indexOf('http') === 0 ? item.icon : $baseUrl + item.icon"></image>
<!-- <image class="tool_jt" :src="$baseUrl + toolList.jtIcon"></image> -->
<view class="tool_title">{{ item.title }}</view>
<view class="tool_context">{{ item.context }}</view>
......@@ -632,7 +632,13 @@ export default {
} = await fetchHomeJSON();
console.warn("data", data)
if (data) {
this.swiperList = data.swiperList;
this.swiperList = data.swiperList || [
{
"link": {},
"title": "默认图",
"url": this.$baseUrl + "homepage/homeSwiperDefaultBg.png"
},
];
this.vipConfigList = data.vipConfigList;
// this.vipCardList = data.vipCardList;
this.contentImgList = data.contentImgList;
......@@ -1636,7 +1642,9 @@ export default {
left: 0rpx;
top: 0rpx;
width: 400rpx;
pointer-events: none;
height: 470rpx;
z-index: 1;
border-radius: 40rpx;
}
......@@ -1645,6 +1653,7 @@ export default {
left: 300rpx;
top: 510rpx;
width: 74rpx;
pointer-events: none;
height: 44rpx;
}
......@@ -1652,6 +1661,7 @@ export default {
position: absolute;
left: 30rpx;
top: 510rpx;
pointer-events: none;
color: #000;
font-size: 36rpx;
width: 300rpx;
......@@ -1672,6 +1682,7 @@ export default {
font-size: 24rpx;
color: #999;
width: 300rpx;
pointer-events: none;
z-index: 2;
overflow: hidden;
display: -webkit-box;
......
......@@ -502,7 +502,7 @@
import { ref, onMounted, onBeforeMount, computed, watch } from 'vue';
import { jump, JumpType } from '@/utils/index.js'
import { useUserStore } from "@/stores/user";
import { fetchIntegralJSON, fetchBatchReceiveJSON } from '../api/integral';
import { fetchIntegralJSON, fetchBatchReceiveJSON, taskCompleteJSON } from '../api/integral';
import RegisterLayer from "../components/RegisterLayer.vue";
import { showLoading, hideLoading } from '../utils'
......@@ -1533,6 +1533,7 @@ const showSignRuleDes = ref(false);
const showTaskPop = ref(false);
const showTaskPerson = ref(false);
const showGongzhonghaoPop = ref(false);
const taskId = ref(0);
// 公众号弹窗参数
const gongzhonghaoTitle = ref('公众号');
......@@ -1793,9 +1794,15 @@ onShow(async () => {
initNetData()
}
//完成了浏览任务
if(taskId.value > 0) {
// const res = await taskCompleteJSON(taskId.value);
// console.log('taskCompleteJSON res:', res);
globalStore.isShowTaskComplete = true;
globalStore.taskCompletePoints = 10;//res?.data?.credits;
globalStore.taskCompleteTitle = '浏览任务'//res?.data?.taskName;
}
const res = await taskCompleteJSON(data.task.id, isdebug.value);
console.log('taskCompleteJSON res:', res);
})
onMounted(async () => {
......@@ -1863,14 +1870,14 @@ onMounted(async () => {
quanyiListIcon.value = [];
imgInfos.value.forEach((element, index) => {
quanyiListIcon.value.push(element.img);
privilegeSizes.value.push({ width: element.width, height: element.height, name: element.name });
});
await userStore.loadMemberInfo();
await integralStore.getSigninAndTaskInfo(isdebug.value);
await integralStore.getPointsBenefitCoupon(isdebug.value);
quanyiListIcon.value.push(element.img);
privilegeSizes.value.push({ width: element.width, height: element.height, name: element.name });
});
await userStore.loadMemberInfo();
await integralStore.getSigninAndTaskInfo(isdebug.value);
await integralStore.getPointsBenefitCoupon(isdebug.value);
//初始化签掉数据
......@@ -2912,6 +2919,7 @@ const handleTaskClick = async (data) => {
});
return;
}
switch (data.task.taskTodoExtra.type) {
case 'Perfect':
showTaskPop.value = false; // 先关闭TaskPop
......@@ -2921,6 +2929,7 @@ const handleTaskClick = async (data) => {
break;
case 'BROWSE_PAGE'://浏览商城
showTaskPop.value = false;
taskId.value = data.task.id;
jump({
type: JumpType.H5,
......
This diff is collapsed.
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