Commit 4d18d576 authored by lg's avatar lg

chore: 通用注册页

parent a69b0551
......@@ -16,8 +16,8 @@ const {
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
......
......@@ -34,6 +34,13 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/activity/register",
"style": {
"navigationBarTitleText": "注册",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
......@@ -205,10 +212,9 @@
}
},
{
"path" : "pages/middlePage/middlePage",
"style" :
{
"navigationBarTitleText" : ""
"path": "pages/middlePage/middlePage",
"style": {
"navigationBarTitleText": ""
}
}
],
......
......@@ -3,13 +3,20 @@
</template>
<script setup>
import {ref} from "vue";
import {onLoad, onShareAppMessage, onShareTimeline} from "@dcloudio/uni-app";
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";
const userStore = useUserStore();
const globalStore = useGlobalStore()
function getRegistered(){
return userStore?.userInfo?.memberId != "not_login"
}
const src = ref("");
const registered = ref(getRegistered())
const urlMap = {
'main': 'http://192.168.10.108:8001/#/page',
......@@ -17,6 +24,21 @@ const urlMap = {
const shareData = ref(null)
onShow(() => {
registered.value = getRegistered()
})
watch(() => registered.value, (newVal) => {
if (newVal) {
const oldSrc = src.value
src.value = ''
nextTick(() => {
src.value = oldSrc
})
}
})
onLoad((options) => {
console.log('页面参数:', options)
......
<script setup>
import {ref} from "vue";
import RegisterLayer from "../../components/RegisterLayer.vue";
import {useUserStore} from "../../stores/user";
const userStore = useUserStore();
const showRegisterLayer = ref(false);
function onRegisterConfirm(data) {
console.log('注册确认:', data);
showRegisterLayer.value = false;
uni.navigateBack({
delta: 1
})
}
async function getRealtimePhoneNumber(e) {
console.log("获取手机号码", e);
uni.navigateBack({
delta: 1
})
return
if (e.detail.errMsg !== "getPhoneNumber:ok") {
uni.showToast({
title: "请授权使用手机号",
icon: "none",
});
return;
}
await userStore.phoneCallback(e.detail, () => {
showRegisterLayer.value = true;
});
}
</script>
<template>
<button type="primary" class="phone-button" open-type="getPhoneNumber" @getphonenumber="getRealtimePhoneNumber">
注册
</button>
<RegisterLayer v-model="showRegisterLayer" @confirm="onRegisterConfirm"/>
</template>
<style scoped>
.phone-button {
margin-top: 100px;
width: 90%;
}
</style>
\ No newline at end of file
......@@ -79,7 +79,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,
......
......@@ -641,8 +641,9 @@ import MonthGift from '../components/pointRightsCom/monthGift.vue';
import YearGift from '../components/pointRightsCom/yearGift.vue';
import ShengriliTipPanel from '../components/quanyi/shengriliTipPanel.vue';
//todo 测试入口 待删除
function clickTest(){
navigateTo('/pages/webview/webview?url=' + encodeURIComponent('http://localhost:8001/#/page?id=49'))
navigateTo('/pages/activity/index?type=main&params=' + encodeURIComponent('id=32'))
}
// 进度条图片加载错误处理
......
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