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 宝宝已达上限
......
This diff is collapsed.
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}`)
}
}
......@@ -76,7 +76,8 @@ 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) => {
......@@ -84,7 +85,7 @@ export const useUserStore = defineStore("userInfo", {
if (res.errMsg === "login:ok") {
// 用户手机授权F
const {
data: babyExistence
data: {babyExistence}
} = await fetchAutoPhone({
phoneEncryptedData: data.encryptedData,
phoneIv: data.iv,
......@@ -170,7 +171,7 @@ 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") {
......@@ -298,7 +299,7 @@ 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);
......@@ -322,27 +323,34 @@ export const useUserStore = defineStore("userInfo", {
* @param {sy使用}
* @returns
*/
async normalAutoLogin(cb = null) {
normalAutoLogin(cb = null) {
return new Promise((resolve, reject) => {
uni.login({
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);
cb && cb();
resolve()
}
} else {
uni.showToast({
title: res.errMsg,
icon: "error",
});
reject(res.errMsg)
}
md.sensors.init();
},
fail: (err) => {
reject(err)
}
});
})
},
async createBabyInfo(babyInfo) {
......
<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;
......
......@@ -570,8 +570,8 @@ 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', //星妈优选小程序
......
......@@ -68,8 +68,8 @@
<!-- 进度条 -->
<view class="progress-bar-container">
<!-- 进度条背景图片 -->
<image :src="$baseUrl + `integral/${tupianBanben}/barBgVip${index}.png`"
class="progress-bar-bg" mode="aspectFit" @error="onProgressBarError" />
<image :src="$baseUrl + `integral/${tupianBanben}/barBgVip${index}.png`" class="progress-bar-bg"
mode="aspectFit" @error="onProgressBarError" />
<!-- 进度条填充图片 -->
<view class="progress-bar-mask">
<image :src="$baseUrl + `integral/${tupianBanben}/barVip${index}.png`"
......@@ -166,7 +166,7 @@
<view class="info-row" @click="integralDetailHandler">
<text class="count-text">{{ `当前:${points} 积分` }}</text>
<text class="expire-text" v-if="willExpiredPoints > 0">{{ `(${willExpiredPoints ?
willExpiredPoints : 0}积分将到期)`}}</text>
willExpiredPoints : 0}积分将到期)` }}</text>
<image class="integral-detail-arrow"
:src="$baseUrl + `integral/${tupianBanben}/integralArrow.png`" mode="aspectFit" />
</view>
......@@ -179,11 +179,12 @@
<view class="privilege-container">
<!-- 第一行 -->
<view class="privilege-header">
<text class="quanyi-title" :style="{ color: getColor('quanyiTitle')[itemIndex].titleColor }" @click="testGoto195">LV{{
<text class="quanyi-title" :style="{ color: getColor('quanyiTitle')[itemIndex].titleColor }"
@click="testGoto195">LV{{
(Number(itemIndex) + 1) }}专享权益</text>
<text class="title-text" :style="{ color: getColor('quanyiTitle')[itemIndex].quanyiNumColor }">当前可享<text
class="highlight"
:style="{ color: getColor('quanyiTitle')[itemIndex].quanyiNumColor }">{{ quanyiBgs[itemIndex].quanyiNum }}</text>项权益,升级解锁更多权益~</text>
class="highlight" :style="{ color: getColor('quanyiTitle')[itemIndex].quanyiNumColor }">{{
quanyiBgs[itemIndex].quanyiNum }}</text>项权益,升级解锁更多权益~</text>
<!-- <text class="title-text" v-if="!islogin"
:style="{ color: getColor('quanyiTitle')[itemIndex].quanyiNumColor }">最高可享 <text class="highlight"
:style="{ color: getColor('quanyiTitle')[itemIndex].quanyiNumColor }">10</text> 项权益会员</text> -->
......@@ -368,9 +369,9 @@
<text class="title-text1">{{ goodItem?.goodsName }}</text>
</view>
<text v-if="Number(goodItem?.priceSale) && Number(goodItem?.credits)" class="num0">低至{{
goodItem?.credits}}<text class="price-text0">积分</text><text
goodItem?.credits }}<text class="price-text0">积分</text><text
class="price-text1">+</text><text class="price-text0">¥</text>{{
goodItem?.priceSale}}</text>
goodItem?.priceSale }}</text>
<text v-else-if="Number(goodItem?.priceSale)" class="price-text"><text class="num">¥{{
goodItem?.priceSale }}</text></text>
<text v-else-if="Number(goodItem?.credits)" class="price-text"><text class="num">{{
......@@ -383,83 +384,55 @@
<!-- 商品内容 -->
<view class="goods-content">
<view
class="goods-list"
v-if="activeIndex === 0"
>
<view
class="goods-item"
v-for="i in goodsData[0]?.titles?.length"
:key="i"
:style="{
background:`url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}"
>
<view class="goods-item-container" @click="handleGoodsItemClick('xingpin',i)">
<image
class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[0]?.goodsImgs[i-1]}`"
mode="aspectFit"
/>
<view class="goods-list" v-if="activeIndex === 0">
<view class="goods-item" v-for="i in goodsData[0]?.titles?.length" :key="i" :style="{
background: `url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}">
<view class="goods-item-container" @click="handleGoodsItemClick('xingpin', i)">
<image class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[0]?.goodsImgs[i - 1]}`"
mode="aspectFit" />
<view class="title-container1">
<text class="title-text1">{{ goodsData[0]?.titles[i-1] }}</text>
<text class="title-text1">{{ goodsData[0]?.titles[i - 1] }}</text>
</view>
<text class="num0">{{ goodsData[0]?.prices[i-1].split("积分+")[0]}}<text class="price-text0">积分</text><text class="price-text1">+</text><text class="price-text0">¥</text>{{ goodsData[0]?.prices[i-1].split("积分+")[1] }}</text>
<text class="num0">{{ goodsData[0]?.prices[i - 1].split("积分+")[0] }}<text
class="price-text0">积分</text><text class="price-text1">+</text><text
class="price-text0">¥</text>{{ goodsData[0]?.prices[i - 1].split("积分+")[1]
}}</text>
</view>
</view>
</view>
<view
class="goods-list"
v-if="activeIndex === 1"
>
<view
class="goods-item"
v-for="i in goodsData[1]?.titles?.length"
:key="i"
:style="{
background:`url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}"
>
<view class="goods-item-container" @click="handleGoodsItemClick('lingyuan',i)">
<view class="goods-list" v-if="activeIndex === 1">
<view class="goods-item" v-for="i in goodsData[1]?.titles?.length" :key="i" :style="{
background: `url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}">
<view class="goods-item-container" @click="handleGoodsItemClick('lingyuan', i)">
<image
class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[1]?.goodsImgs[i-1]}`"
mode="aspectFit"
/>
<image class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[1]?.goodsImgs[i - 1]}`"
mode="aspectFit" />
<view class="title-container1">
<text class="title-text1">{{ goodsData[1]?.titles[i-1] }}</text>
<text class="title-text1">{{ goodsData[1]?.titles[i - 1] }}</text>
</view>
<text class="price-text"><text class="num">{{ goodsData[1]?.prices[i-1] }}</text>积分</text>
<text class="price-text"><text class="num">{{ goodsData[1]?.prices[i - 1] }}</text>积分</text>
</view>
</view>
</view>
<view
class="goods-list"
v-if="activeIndex === 2"
>
<view
class="goods-item"
v-for="i in goodsData[2]?.titles?.length"
:key="i"
:style="{
background:`url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}"
>
<view class="goods-item-container" @click="handleGoodsItemClick('beiwei',i)">
<image
class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[2]?.goodsImgs[i-1]}`"
mode="aspectFit"
/>
<view class="goods-list" v-if="activeIndex === 2">
<view class="goods-item" v-for="i in goodsData[2]?.titles?.length" :key="i" :style="{
background: `url(${$baseUrl}integral/1022/listItemImgBg${itemIndex}.png) no-repeat center/contain`
}">
<view class="goods-item-container" @click="handleGoodsItemClick('beiwei', i)">
<image class="goods-img"
:src="$baseUrl + `integral/${tupianBanben}/${goodsData[2]?.goodsImgs[i - 1]}`"
mode="aspectFit" />
<view class="title-container1">
<text class="title-text1">{{ goodsData[2]?.titles[i-1] }}</text>
<text class="title-text1">{{ goodsData[2]?.titles[i - 1] }}</text>
</view>
<text class="price-text"><text class="num">{{ goodsData[2]?.prices[i-1] }}</text>积分</text>
<text class="price-text"><text class="num">{{ goodsData[2]?.prices[i - 1] }}</text>积分</text>
</view>
......@@ -543,6 +516,7 @@ import TaskPop from '../components/renwu/TaskPop.vue';
import TaskPerson from '../components/renwu/TaskPerson.vue';
import bannerDataIntegral from '../mock/bannerDataIntegral.json';
import jifenGoodsData from '../mock/jifenGoodsData.json';
import { onShow } from "@dcloudio/uni-app";
// 进度条图片加载错误处理
const onProgressBarError = (e) => {
......@@ -2300,6 +2274,15 @@ const handleExchargeClick = () => {
//会员权益点击跳转
const handlePrivilegeClick = (item, index) => {
if (!islogin.value) {
needReinit.value = true
jump({
type: JumpType.INNER,
url: "/pages/activity/register",
})
return;
}
// jump({
// type: JumpType.H5,
......
......@@ -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" />
<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" />
<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";
const type = userStore.babyInfo?.allBabyBaseInfo?.length ? "edit" : "add";
if (type === "edit") {
babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
(item) => item.selected
)?.id;
if (type === "edit") {
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