diff --git a/src/App.vue b/src/App.vue index 66e8f78..ac1e267 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,14 +8,16 @@ onLaunch(() => { console.log("App Launch"); stores.initWxConfig(); }); -onShow(() => {}); +onShow(() => { }); onHide(() => { console.log("App Hide"); + uni.setStorageSync('homeTabIndex', null) }); diff --git a/src/components/mine.vue b/src/components/mine.vue index 480cbf5..e0d23b1 100644 --- a/src/components/mine.vue +++ b/src/components/mine.vue @@ -64,6 +64,8 @@ + + diff --git a/src/components/mineMini.vue b/src/components/mineMini.vue index 8d12aa1..1771326 100644 --- a/src/components/mineMini.vue +++ b/src/components/mineMini.vue @@ -63,6 +63,14 @@ + + + @@ -111,10 +119,11 @@ onMounted(() => { }); // 将手机号的中间四位用 * 代替 -const maskPhoneNumber = (phoneNumber: string) => { - if (!phoneNumber && uni.getStorageSync("userPhone")) { - phoneNumber = uni.getStorageSync("userPhone"); - } +const maskPhoneNumber = () => { + // if (!phoneNumber && uni.getStorageSync("userPhone")) { + // phoneNumber = uni.getStorageSync("userPhone"); + // } + let phoneNumber = uni.getStorageSync("userPhone"); if (phoneNumber) { return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); } else { @@ -161,7 +170,14 @@ const handleClick = (val: number) => { uni.navigateTo({ url: "/pages/subscribed/index", }); - } else { + } else if (val === 3) { + wx.openPrivacyContract({ + success: () => { }, // 打开成功 + fail: () => { }, // 打开失败 + complete: () => { }, + }); + } + else { uni.navigateTo({ url: `/pages/bookmark/index?tabs=${val}`, }); diff --git a/src/config/index.ts b/src/config/index.ts index 1520d10..747d942 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,5 +1,5 @@ // const baseURL = "http://192.168.31.25:8060/api"; -// export const baseUrl = "http://192.168.3.38:8040/apih5"; -export const baseUrl = "https://cankao.cs.com.cn/apih5"; +export const baseUrl = "http://192.168.3.38:8040/apih5"; +// export const baseUrl = "https://cankao.cs.com.cn/apih5"; export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav"; diff --git a/src/pages/bookmark/components/articleList.vue b/src/pages/bookmark/components/articleList.vue index 36e2890..760475c 100644 --- a/src/pages/bookmark/components/articleList.vue +++ b/src/pages/bookmark/components/articleList.vue @@ -29,7 +29,7 @@ const props = defineProps({ const doDetail = (item: any) => { console.log("🚀 ~ doDetail ~ item:", item) uni.navigateTo({ - url: `/pages/detail/index?id=${item.id}`, + url: `/pages/detail/indexNewsInfo?id=${item.id}`, }); }; diff --git a/src/pages/bookmark/index.vue b/src/pages/bookmark/index.vue index 5393eca..e329145 100644 --- a/src/pages/bookmark/index.vue +++ b/src/pages/bookmark/index.vue @@ -8,7 +8,8 @@ }"> - + diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue index edeab61..0dc9d7a 100644 --- a/src/pages/detail/indexNewsInfo.vue +++ b/src/pages/detail/indexNewsInfo.vue @@ -1,9 +1,13 @@ @@ -37,6 +49,14 @@ import { doWxAuth } from "@/api/index"; import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app"; import { useShareStore } from "@/stores/shareStore"; const stores = useShareStore(); +const checked = ref([]) + +watch(checked, (newVal) => { + console.log("🚀 ~ newVal:", newVal) + if (newVal) { + } +}) + let timer = ref(); @@ -62,6 +82,7 @@ function getPhoneNumber(phoneObj) { uni.showLoading(); getWxCode(phoneObj.detail); } + const codeWx = ref(); function getWxCode(phoneObj) { console.log("🚀 ~ getWxCode ~ phoneObj:", phoneObj); @@ -96,7 +117,7 @@ async function doWxAuthFn(phoneObj, jsCode) { // uni.setStorageSync("userId", data.userId); uni.setStorageSync("unionId", data.unionId); uni.setStorageSync("openId", data.openId); - uni.setStorageSync("phone", data.phone); + uni.setStorageSync("userPhone", data.phone); uni.redirectTo({ url: "/pages/minihome/index", }); @@ -120,6 +141,15 @@ onLoad((option) => { // }, 2000) }); +// 点击用户协议 +function needCheck() { + uni.showToast({ + title: "请先同意用户协议", + icon: 'none' + }) +} + + function goUserAgreement() { wx.openPrivacyContract({ success: () => { }, // 打开成功 @@ -135,6 +165,7 @@ onUnload(() => { onShow(() => { stores.initWxConfig(); + uni.setStorageSync('homeTabIndex', null) }); diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index 28395b8..6dc6af8 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -6,13 +6,9 @@ - + @@ -48,6 +44,7 @@ const list = ref([ display: flex; align-items: center; position: relative; + .title { font-size: 16px; color: #fff; diff --git a/src/pages/minihome/index.vue b/src/pages/minihome/index.vue index c61bf66..c164b60 100644 --- a/src/pages/minihome/index.vue +++ b/src/pages/minihome/index.vue @@ -118,11 +118,16 @@ onShow(() => { } else { tabChange(0) } + + uni.setStorageSync('homeTabIndex', null) + }) onMounted(async () => { getNewsList() }); + +