Commit 1b70b3d7 authored by spc's avatar spc

merge activity-page

parent 18232b63
......@@ -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() }">
<!-- <view class="diamonddesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>
</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() }">
<!-- <view class="starshinedesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>
</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() }">
<!-- <view class="starlightdesc" :style="{ color: getColor() }">
7类课程:⼩⼉常⻅病-急救,产后恢复运动实操课,痱⼦,尿布疹,⼩⼉常⻅病-常⻅疾病护理,新⽣⼉⻩疸,⼉童安全⽤药操作课
</view>
</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() }">
<!-- <view class="golddesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则
</view>
</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() }">
<!-- <view class="platinumdesc" :style="{ color: getColor() }">
5类课程:产检,⼉童疫苗,婴幼⼉护理,⼩⼉发热,⼩⼉7种常⻅病的治疗⽅法和⽤药原则
</view>
</view>-->
</view>
</view>
......@@ -195,7 +195,8 @@ const jump = (level) => {
// 跳转到 H5 页面,地址暂时默认 https://www.baidu.com
// 可以根据不同等级跳转到不同的地址
const url = 'https://member.feihe.com/memberH5/#/courses'
//const url = 'https://member.feihe.com/memberH5/#/courses'
const url = 'https://mom.feihe.com/expertsView?from=home'
// 使用 uni.navigateTo 跳转到 webview 页面
uni.navigateTo({
......
......@@ -44,7 +44,7 @@
<template v-if="type == '2'">
{{ isType == '0' ? '添加状态' : isType == '3' ? '我知道了' : isType == '1' ? '切换状态' : '修改状态' }}
</template>
<button v-if="isNotLogin" type="primary" class="phone-button" open-type="getPhoneNumber"
<button v-if="false && isNotLogin" type="primary" class="phone-button" open-type="getPhoneNumber"
@getphonenumber="getRealtimePhoneNumber" />
</view>
</view>
......@@ -60,6 +60,7 @@ import {
watch
} from 'vue'
import { useUserStore } from "@/stores/user";
import {jump, JumpType} from "@/utils";
// 接受父组件参数
const props = defineProps({
type: {
......@@ -147,6 +148,10 @@ const modifyState = async () => {
// 跳转新增产检页面
const onAdd = () => {
if (props.isNotLogin == true) {
jump({
type: JumpType.INNER,
url: "/pages/activity/register",
})
return;
}
// 0 添加状态或者宝宝 1 切换状态 2 修改状态 3 宝宝已达上限
......
......@@ -812,4 +812,4 @@
}
]
}
}
\ No newline at end of file
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -27,6 +27,20 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/activity/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/activity/register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
......@@ -198,17 +212,15 @@
}
},
{
"path" : "pages/middlePage/middlePage",
"style" :
{
"navigationBarTitleText" : ""
"path": "pages/middlePage/middlePage",
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "pages/heliaixinTools/heliaixinTools",
"style" :
{
"navigationBarTitleText" : "鹤礼爱心"
"path": "pages/heliaixinTools/heliaixinTools",
"style": {
"navigationBarTitleText": "鹤礼爱心"
}
}
],
......@@ -296,6 +308,23 @@
}
}
]
},
{
"root": "subPackages",
"pages": [
{
"path": "momclub/momclub",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "xmhAactivity/xmhAactivity",
"style": {
"navigationBarTitleText": ""
}
}
]
}
],
"globalStyle": {
......
<template>
<web-view :src="src" @message="onMessage"/>
</template>
<script setup>
import {ref, watch, nextTick} from "vue";
import {onLoad, onShow, onShareAppMessage, onShareTimeline} from "@dcloudio/uni-app";
import {useGlobalStore} from "../../stores/global";
import {useUserStore} from "../../stores/user";
import {jump, JumpType} from "../../utils";
const userStore = useUserStore();
const globalStore = useGlobalStore()
function getRegistered() {
return userStore.userInfo?.memberId !== "not_login"
}
const pageOptions = ref({})
const src = ref("");
const registered = ref(false)
const urlMap = {
//'main': 'http://192.168.0.5:8001/#/page',
'main': 'https://momclub-uat.feihe.com/h5/#/page',
};
const shareData = ref(null)
onShow(() => {
registered.value = getRegistered()
})
function joinUrlAndQs(url, qs) {
return qs
? url + (url.includes('?') ? (url.endsWith('?') ? '' : '&') : '?') + qs
: url
}
watch(() => registered.value, (newVal, oldVal) => {
if (newVal !== oldVal) {
const oldSrc = src.value
src.value = ''
nextTick(() => {
src.value = joinUrlAndQs(oldSrc, 'registered=' + newVal)
})
}
})
function initOk() {
console.log(userStore.userInfo)
let url = "";
const options = pageOptions.value
if (options.type) {
const type = options.type;
url = urlMap[type];
} else if (options.url) {
url = decodeURIComponent(options.url)
}
const params = {}
const {unionId, cuk} = globalStore
if (unionId && !params.unionId) params.unionId = unionId
if (cuk && !params.cuk) params.cuk = cuk
const {memberId} = userStore.userInfo
if (memberId) params.crmId = memberId
const paramStr = Object.keys(params)
.filter(key => params[key] !== undefined && params[key] !== null && params[key] !== '')
.map(key => `${key}=${encodeURIComponent(params[key])}`)
.join('&')
url = joinUrlAndQs(url, paramStr)
if(options.params){
url = joinUrlAndQs(url, decodeURIComponent(options.params))
}
src.value = url
console.log('webview url:', url)
}
onLoad(async (options) => {
pageOptions.value = options
console.log('页面参数:', options)
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
await userStore.normalAutoLogin()
await userStore.loadUserInfo()
registered.value = getRegistered()
if(options.needLogin && !registered.value) {
jump({
type: JumpType.INNER,
url: '/pages/activity/register',
})
}else{
initOk()
}
});
function onMessage(e) {
const data = e.detail.data
const lastData = data[data.length - 1]
console.log('webview 消息接收:', lastData)
switch (lastData.type) {
case 'share':
shareData.value = lastData.payload
break;
}
}
function shareHook() {
if (shareData.value) {
const {url, title, imageUrl = ''} = shareData.value
console.log('使用分享数据:', shareData.value)
return {
title,
path: url || '/pages/index/index',
imageUrl,
success: function (res) {
console.log('分享成功:', res)
//星妈会埋点方法,用户分享成功后触发事件
},
fail: function (res) {
console.log('分享失败:', res)
},
complete: function (res) {
console.log('分享完成:', res)
}
}
}
// 如果没有分享数据,返回默认分享
return {
path: '/pages/index/index'
}
}
onShareAppMessage((options) => {
console.log('分享给朋友数据:', shareData.value)
return shareHook()
})
onShareTimeline((options) => {
console.log('分享到朋友圈数据:', shareData.value)
return shareHook()
})
</script>
<script>
/*export default {
onShareAppMessage() {
return this.shareHook()
}
}*/
</script>
\ No newline at end of file
<script setup>
import {ref} from "vue";
import RegisterLayer from "../../components/RegisterLayer.vue";
import {useUserStore} from "../../stores/user";
import {jump, JumpType} from "../../utils";
import md from "../../md";
import Checkbox from "./toggle-button/index.vue";
const userStore = useUserStore();
const showRegisterLayer = ref(false);
const readProtocol = ref(false);
async function clickBack() {
uni.navigateBack({
delta: 1
})
}
async function onRegisterConfirm(data) {
console.log('注册确认:', data);
showRegisterLayer.value = false;
await Promise.all([
userStore.loadMemberInfo(),
userStore.loadUserInfo(),
])
uni.navigateBack({
delta: 1
})
}
async function getRealtimePhoneNumber(e) {
console.log("获取手机号码", e);
if (e.detail.errMsg !== "getPhoneNumber:ok") {
uni.showToast({
title: "请授权使用手机号",
icon: "none",
});
return;
}
await userStore.phoneCallback(e.detail, () => {
showRegisterLayer.value = true;
});
}
// 页面跳转
const navigateTo = (url) => {
uni.navigateTo({
url,
animationDuration: 0,
fail: (err) => {
console.error("页面跳转失败:", err);
uni.showToast({
title: "页面跳转失败",
icon: "none",
});
},
});
};
const handleHot = (e) => {
const type = e.currentTarget.dataset.type;
md.sensorLog(e);
console.log("handleHot", type);
md.sensorComponentLogTake({
xcxComponentClick: "true",
pageName: "我的页面",
componentName: "查看协议",
componentContent: type === "member" ? "会员规则" : "隐私协议"
})
if (type === "member") {
navigateTo("/pages/webview/webview?type=MEMBER_URL");
} else if (type === "privacy") {
navigateTo("/pages/webview/webview?type=PRIVACY_URL");
}
};
function clickRegister(e){
uni.showToast({
title: "请先阅读并同意协议《会员规则》及《隐私协议》",
icon: "none",
});
}
function testClick() {
jump({
type: JumpType.MINI,
url: '/subPackages/xmhMainProcess/mine/index',
extra: {
appId: 'wx4205ec55b793245e',
}
})
}
</script>
<template>
<div class="page">
<view >
<image src="@/assets/images/back-btn.png" class="btn-back" @click="clickBack"/>
</view>
<div class="content">
<div class="logo-container">
<image src="@/assets/logo.png" class="logo"/>
<text>星妈会</text>
</div>
<button v-if="readProtocol" class="register-button" open-type="getPhoneNumber" @getphonenumber="getRealtimePhoneNumber">
授权登录
</button>
<button v-else class="register-button disabled" @click="clickRegister">
授权登录
</button>
<!-- <button @click="testClick">
测试
</button>-->
<view class="protocol-container">
<Checkbox v-model="readProtocol" class="checkbox"/>
我已阅读并同意
<view class="link" :data-log="{
xcxClick: '注册页面点击',
pageName: '注册页面',
buttonName: '会员规则',
}" @click="handleHot" data-type="member">《会员规则》
</view>
<view class="link" :data-log="{
xcxClick: '注册页面点击',
pageName: '注册页面',
buttonName: '隐私协议',
}" @click="handleHot" data-type="privacy">《隐私协议》
</view>
</view>
</div>
<RegisterLayer v-model="showRegisterLayer" @confirm="onRegisterConfirm"/>
</div>
</template>
<style lang="less" scoped>
.page {
width: 100vw;
display: flex;
flex-direction: column;
align-items: center;
.btn-back{
position: absolute;
left: 10rpx;
top: 100rpx;
width: 60rpx;
height: 60rpx;
}
.logo-container{
width: 100vw;
display: flex;
align-items: center;
gap: 12rpx;
flex-direction: column;
background-image: linear-gradient(180deg, #F4E2B2 0%, transparent 100%);
padding-top: 350rpx;
padding-bottom: 80rpx;
.logo{
width: 176rpx;
height: 176rpx;
}
}
.content {
display: flex;
flex-direction: column;
align-items: center;
.register-button {
width: 600rpx;
height: 94rpx;
border-radius: 100rpx;
background-color: #d3a358;
color: white;
margin-top: 130rpx;
&.disabled{
background-color: #E3CC9E;
}
}
.protocol-container {
margin: 40rpx 0;
font-size: 24rpx;
display: flex;
align-items: center;
gap: 4rpx;
color: #797979;
.link {
color: #d3a358;
}
}
}
}
</style>
\ No newline at end of file
<script setup>
import { ref } from 'vue'
import checkSelectImg from './assets/check-select.png'
import checkUnselectImg from './assets/check-unselect.png'
const props = defineProps({
modelValue: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['update:modelValue'])
const handleClick = () => {
emit('update:modelValue', !props.modelValue)
}
</script>
<template>
<div class="checkbox-wrapper">
<img :src="modelValue ? checkSelectImg : checkUnselectImg" class="checkbox" @click="handleClick"/>
</div>
</template>
<style scoped lang="less">
.checkbox-wrapper {
display: flex;
align-items: center;
justify-content: center;
.checkbox {
width: 22rpx;
height: 22rpx;
}
}
</style>
\ No newline at end of file
......@@ -209,6 +209,7 @@ import { showLoading, hideLoading, jump, JumpType } from '../../utils/index.js'
import { useXingmaLabStore } from '../../stores/xingmaLab'
import Xingmalabnotimepop from '../../components/xingmaLab/Xingmalabnotimepop.vue'
import md from '../../md';
import {useUserStore} from "@/stores/user";
// 定义组件名称
defineOptions({
......@@ -223,6 +224,7 @@ const cangpinList = ref([]);
const shoucangList = ref([]);
const xingmaLabStore = useXingmaLabStore();
const userStore = useUserStore();
// 弹窗显示状态
const showNoTimePopup = ref(false) // 无次数弹窗
......@@ -537,6 +539,13 @@ const switchSubTab = async (subTab) => {
}
const handleBottomNavFabu = () => {
if(userStore.userInfo?.memberId === "not_login"){
jump({
type: JumpType.INNER,
url: "/pages/activity/register",
})
return
}
md.sensorComponentLogTake({
xcxComponentClick: "true",
......
const hosts = [
{value: 'https://guide-api.feihe.com', alias: '生产环境'},
{value: 'https://guide-api-test.feihe.com', alias: 'test环境'},
{value: 'https://guide-api-uat.feihe.com', alias: 'uat环境'},
]
const pages = [
{value: '/mini/#/page/momHome/index', alias: '妈妈爱活动'},
{value: '/mini/#/page/home/index?page_source=3', alias: '路演活动'},
]
const mpPage = 'pages/activity/index'
function joinUrlAndQs(url, qs) {
return qs
? url + (url.includes('?') ? (url.endsWith('?') ? '' : '&') : '?') + qs
: url
}
for (const page of pages) {
for (const host of hosts) {
const url = joinUrlAndQs(mpPage, `url=${encodeURIComponent(host.value + page.value)}`)
console.log(`${page.alias}-${host.alias}: ${url}`)
}
}
This diff is collapsed.
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
......@@ -37,8 +37,10 @@ export function jump({ type, url, extra = {} }) {
console.log("jumpParams:", jumpParams);
if(extra.embedded || jumpParams.appId === 'wx4205ec55b793245e'){ // 星妈优选的小程序都为半屏拉起
console.log('半屏拉起', jumpParams)
uni.openEmbeddedMiniProgram(jumpParams);
}else{
console.log('直接跳转', jumpParams)
uni.navigateToMiniProgram(jumpParams);
}
break;
......@@ -64,7 +66,7 @@ export function formatDate(timestamp){
console.error('无效的时间戳:', timestamp);
return '';
}
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
......
......@@ -569,9 +569,9 @@ export default {
}
const { productId, skuId, contentImg, contentImgLen, shareTitle, shareImg, title, link } = item;
const tabName = this.productTabList[this.channelTabIndex];
if (productId && skuId) {
const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}`;
if(productId && skuId){
const url = `subPackages/shopMainProcess/product/index?productId=${productId}&skuId=${skuId}&entrySource=xmh_wechatmp_brand_profamily`;
const type = JumpType.MINI;
const extra = {
appId: 'wx4205ec55b793245e', //星妈优选小程序
......
This diff is collapsed.
......@@ -16,8 +16,7 @@
<image class="banner_cover" :src="$baseUrl + 'my/cover_white.png'" mode="aspectFill" />
</view>
<button v-if="!cfgStatus.isRegister" type="primary" class="phone-button" open-type="getPhoneNumber"
@getphonenumber="getRealtimePhoneNumber" />
<button v-if="!cfgStatus.isRegister" type="primary" class="phone-button" @click="clickRegisterShield"/>
<!-- 用户信息区域 -->
<view class="user-info" :style="{ 'min-height': cfgStatus.showDetail ? '343rpx' : '180rpx' }">
......@@ -95,13 +94,16 @@
<view class="tool-container" v-if="toolList?.length > 0">
<text class="tool-title"> 工具 </text>
<view class="tool-list">
<view class="tool-item" v-for="item in toolList" :key="item.title" @click="handleToolClick(item)">
<image class="tool-icon" :src="item.bgUrl?.includes('http') ? item.bgUrl : $baseUrl + item.bgUrl"
mode="aspectFit" />
<!-- || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评' -->
<button v-if="(item.title == '医生问诊') && !cfgStatus.isRegister" class="tool-btn-register" type="primary"
open-type="getPhoneNumber" @getphonenumber="getRealtimePhoneNumber" />
</view>
<template v-for="item in toolList" :key="item.title">
<view v-if="!item.hidden" class="tool-item" @click="handleToolClick(item)">
<image class="tool-icon" :src="$baseUrl + item.bgUrl" mode="aspectFit" />
<!-- || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评' -->
<button
v-if="(item.title == '医生问诊') && !cfgStatus.isRegister"
class="tool-btn-register" type="primary" open-type="getPhoneNumber"
@getphonenumber="getRealtimePhoneNumber" />
</view>
</template>
</view>
</view>
......@@ -204,6 +206,12 @@ const handleHot = (e) => {
}
};
function clickRegisterShield(){
jump({
type: JumpType.INNER,
url: "/pages/activity/register",
})
}
// 页面跳转
const navigateTo = (url) => {
......@@ -304,12 +312,12 @@ const handleEditProfile = (e) => {
componentContent: "资料编辑"
})
const type = userStore.babyInfo?.allBabyBaseInfo?.length == 0 ? "add" : "edit";
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
(item) => item.selected
)?.id;
const type = userStore.babyInfo?.allBabyBaseInfo?.length ? "edit" : "add";
if (type === "edit") {
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
(item) => item.selected
)?.id;
navigateTo(`/pages/person/person?type=${type}&id=${babyId.value}`);
} else {
navigateTo(`/pages/person/person?type=${type}`);
......
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