This commit is contained in:
34701892@qq.com 2025-08-17 17:59:21 +08:00
commit 70aa8e6f58
8 changed files with 406 additions and 101 deletions

View File

@ -62,3 +62,8 @@ export const searchNews = (data: any) => {
return Request.post("/news/search", data); return Request.post("/news/search", data);
}; };
// 微信授权
export const doWxAuth = (data: any) => {
return Request.post("/common/auth", data);
};

View File

@ -24,7 +24,11 @@
<image :src="props.data.picture" mode="widthFix" /> <image :src="props.data.picture" mode="widthFix" />
</view> </view>
<view class="articleDes" :class="props?.data?.needpay && 'needpay'" v-html="props.data.content"> <view
class="articleDes"
:class="props?.data?.needpay && 'needpay'"
v-html="props.data.content"
>
</view> </view>
</view> </view>
</template> </template>

View File

@ -16,17 +16,31 @@
<!-- 两个标签 start --> <!-- 两个标签 start -->
<view class="r_r_tags"> <view class="r_r_tags">
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw"> <view
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 95vw"
>
<view class="r_tags"> <view class="r_tags">
<view class="tag" style="background-color: #fff9ec; color: #ffb100" <view
v-for="(item, index) in props.data.conceptLabels" :key="index">{{ item }}</view> class="tag"
style="background-color: #fff9ec; color: #ffb100"
v-for="(item, index) in props.data.conceptLabels"
:key="index"
>{{ item }}</view
>
</view> </view>
</view> </view>
<view style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw"> <view
style="display: flex; margin-top: 20rpx; overflow-x: auto; width: 100vw"
>
<view class="r_tags"> <view class="r_tags">
<view class="tag" style="background-color: #f5f8fe; color: #007aff" <view
v-for="(item, index) in props.data.industryLabels" :key="index">{{ item }}</view> class="tag"
style="background-color: #f5f8fe; color: #007aff"
v-for="(item, index) in props.data.industryLabels"
:key="index"
>{{ item }}</view
>
</view> </view>
</view> </view>
</view> </view>
@ -42,15 +56,17 @@
<image :src="props.data.picture" mode="widthFix" /> <image :src="props.data.picture" mode="widthFix" />
</view> </view>
<view style="padding: 35rpx;"> <view style="padding: 35rpx">
<!-- <text class="articleDes" :class="props?.data?.needpay && 'needpay'" style="white-space: pre-wrap;" <!-- <text class="articleDes" :class="props?.data?.needpay && 'needpay'" style="white-space: pre-wrap;"
v-html="props.data.content"> v-html="props.data.content">
</text> --> </text> -->
<rich-text class="articleDes" :class="props?.data?.needpay && 'needpay'" style="white-space: pre-wrap;" <rich-text
v-html="props.data.content"></rich-text> class="articleDes"
:class="props?.data?.needpay && 'needpay'"
style="white-space: pre-wrap"
v-html="props.data.content"
></rich-text>
</view> </view>
<!-- <view <!-- <view

View File

@ -3,12 +3,13 @@
<Navbar title="中证参考" :hasBack="false"></Navbar> <Navbar title="中证参考" :hasBack="false"></Navbar>
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="userContainer"> <view class="userContainer">
<u-avatar src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png" size="60"></u-avatar> <u-avatar
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/avatar.png"
size="60"
></u-avatar>
<view class="userData"> <view class="userData">
<text class="phone">{{ <text class="phone">{{
!isLoginStatus !isLoginStatus ? "未登录用户" : maskPhoneNumber()
? "未登录用户"
: maskPhoneNumber()
}}</text> }}</text>
<!-- <view class="setUserData"> <!-- <view class="setUserData">
编辑我的个人资料 编辑我的个人资料
@ -34,30 +35,53 @@
<!-- 其他功能区 --> <!-- 其他功能区 -->
<view class="otherContainer" v-if="isLoginStatus"> <view class="otherContainer" v-if="isLoginStatus">
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell title="已订阅栏目" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png" isLink <u-cell
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }" :titleStyle="{ title="已订阅栏目"
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/vip.png"
isLink
:iconStyle="{ width: '46rpx', height: '32rpx', marginRight: '14rpx' }"
:titleStyle="{
fontSize: '32rpx', fontSize: '32rpx',
color: '#333333', color: '#333333',
}" @click="handleClick(-1)"> }"
@click="handleClick(-1)"
>
</u-cell> </u-cell>
<u-cell title="我的收藏" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png" isLink <u-cell
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{ title="我的收藏"
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/star.png"
isLink
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
:titleStyle="{
fontSize: '32rpx', fontSize: '32rpx',
color: '#333333', color: '#333333',
}" @click="handleClick(0)"> }"
@click="handleClick(0)"
>
</u-cell> </u-cell>
<u-cell title="我喜欢的" icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png" isLink <u-cell
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{ title="我喜欢的"
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/like.png"
isLink
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
:titleStyle="{
fontSize: '32rpx', fontSize: '32rpx',
color: '#333333', color: '#333333',
}" @click="handleClick(1)"> }"
@click="handleClick(1)"
>
</u-cell> </u-cell>
<!-- title="浏览记录" :icon="time" :border="false" --> <!-- title="浏览记录" :icon="time" :border="false" -->
<u-cell icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png" isLink <u-cell
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }" :titleStyle="{ icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/time.png"
isLink
:iconStyle="{ width: '40rpx', height: '40rpx', marginRight: '20rpx' }"
:titleStyle="{
fontSize: '32rpx', fontSize: '32rpx',
color: '#333333', color: '#333333',
}" @click="handleClick(2)"> }"
@click="handleClick(2)"
>
<template #title> <template #title>
<view class="recordText"> <view class="recordText">
<text style="font-size: 32rpx">浏览记录</text> <text style="font-size: 32rpx">浏览记录</text>
@ -82,8 +106,12 @@
</view> </view>
<!-- 登录弹框 --> <!-- 登录弹框 -->
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose" <LoginPopup
@handlePopupSuccessCallback="handlePopupSuccessCallback" @handlePopupErrorCallback="handlePopupErrorCallback" /> :show="LoginShow"
@handlePopupClose="handlePopupClose"
@handlePopupSuccessCallback="handlePopupSuccessCallback"
@handlePopupErrorCallback="handlePopupErrorCallback"
/>
</view> </view>
</template> </template>
@ -103,26 +131,23 @@ const isLoginStatus = ref(false);
const LoginShow = ref(false); const LoginShow = ref(false);
onMounted(() => { onMounted(() => {
console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync('token')) console.log("🚀 ~ uni.getStorageSync('token'):", uni.getStorageSync("token"));
if (uni.getStorageSync('token')) { if (uni.getStorageSync("token")) {
isLoginStatus.value = true; isLoginStatus.value = true;
} }
}); });
// * // *
const maskPhoneNumber = (phoneNumber: string) => { const maskPhoneNumber = (phoneNumber: string) => {
if (!phoneNumber && uni.getStorageSync('userPhone')) { if (!phoneNumber && uni.getStorageSync("userPhone")) {
phoneNumber = uni.getStorageSync('userPhone') phoneNumber = uni.getStorageSync("userPhone");
} }
if (phoneNumber) { if (phoneNumber) {
return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); return phoneNumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
} else { } else {
return "未登录用户"; return "未登录用户";
} }
}; };
// //
@ -146,7 +171,10 @@ const loginBtnStatus = () => {
// 退 // 退
loginOut(); loginOut();
} else { } else {
LoginShow.value = true; // LoginShow.value = true;
uni.navigateTo({
url: "/pages/login/indexMini",
});
} }
}; };

View File

@ -1,21 +1,26 @@
<template> <template>
<view class="tabbar"> <view class="tabbar">
<view class="tabbar_item" @click="tabChange(0)"> <view class="tabbar_item" @click="tabChange(0)">
<image v-if="tabIndex == 1" <image v-if="tabIndex == 1" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_normal.png"
class="tabbar_img" /> class="tabbar_img" />
<image v-if="tabIndex == 0" <image v-if="tabIndex == 0" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/home_icon_pre.png"
class="tabbar_img" /> class="tabbar_img" />
<text class="tabbar_title" :style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }">海外资讯</text> <text class="tabbar_title" :style="{ color: tabIndex == 0 ? '#D13E3C' : '#757A80' }">海外资讯</text>
</view> </view>
<view class="tabbar_item" @click="tabChange(1)"> <view class="tabbar_item" @click="tabChange(1)">
<image v-if="tabIndex == 0" <image v-if="tabIndex == 0" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
class="tabbar_img" /> class="tabbar_img" />
<image v-if="tabIndex == 1" <image v-if="tabIndex == 1" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png" class="tabbar_img" />
<text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text>
</view>
</view>
<view class="tabbar_item" @click="tabChange(1)">
<image v-if="tabIndex == 0" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_normal.png"
class="tabbar_img" />
<image v-if="tabIndex == 1" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/mine_icon_pre.png"
class="tabbar_img" /> class="tabbar_img" />
<text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text> <text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text>
</view> </view>
@ -30,7 +35,6 @@ const tabIndex = ref(0);
function tabChange(index) { function tabChange(index) {
tabIndex.value = index; tabIndex.value = index;
emit("tabChange", index); emit("tabChange", index);
} }
onMounted(async () => { }); onMounted(async () => { });

View File

@ -22,6 +22,9 @@
{ {
"path": "pages/login/index" "path": "pages/login/index"
}, },
{
"path": "pages/login/indexMini"
},
{ {
"path": "pages/realtimeInfo/rankDetail" "path": "pages/realtimeInfo/rankDetail"
}, },

View File

@ -0,0 +1,232 @@
<template>
<view class="loginContainer">
<!-- prompt -->
<!-- <view class="prompt"></view> -->
<!-- logo -->
<view class="logo"></view>
<!-- <view class="bottom_btn" @click="goIndex"> 立即进入 </view> -->
<button
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
class="bottom_btn"
>
<view>
<text>立即进入</text>
</view>
</button>
<!-- 用户协议 -->
<view class="tips">
<u-checkbox class="checkbox" shape="circle"></u-checkbox>
<text class="r_userAgreement"
>已阅读并同意<text class="userAgreement" @click="goUserAgreement"
>江南农商银行隐私政策中证参考智能资讯小程序服务使用许可及服务协议</text
>首次登录的手机号将自动注册</text
>
</view>
</view>
</template>
<script setup lang="ts">
import { onMounted, ref, reactive, watch, nextTick, onActivated } from "vue";
import {
onLaunch,
onShow,
onLoad,
onShareAppMessage,
onShareTimeline,
onUnload,
} from "@dcloudio/uni-app";
import { doWxAuth } from "@/api/index";
import { onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
import { useShareStore } from "@/stores/shareStore";
const stores = useShareStore();
let timer = ref();
function goIndex() {
const subStatus = {
overseas: false, //
domestic: false, //
chinaSecurities: false, //
};
uni.setStorageSync("subStatus", subStatus);
//
uni.removeStorageSync("tabValue");
uni.removeStorageSync("colTypeValue");
uni.navigateTo({
url: "/pages/home/index",
});
}
//
function getPhoneNumber(phoneObj) {
uni.showLoading();
getWxCode(phoneObj.detail);
}
const codeWx = ref();
function getWxCode(phoneObj) {
console.log("🚀 ~ getWxCode ~ phoneObj:", phoneObj);
uni.login({
success: (res) => {
console.log("🚀 ~ getWxCode ~ res:", res);
if (res.code) {
// code
codeWx.value = res.code;
doWxAuthFn(phoneObj, res.code);
} else {
console.log("登录失败!" + res.errMsg);
}
},
});
}
/**
* 微信授权
* @param userInfo
*/
async function doWxAuthFn(phoneObj, jsCode) {
let { code, data } = await doWxAuth({
jsCode: jsCode,
encryptedData: phoneObj.encryptedData,
siv: phoneObj.iv,
});
uni.hideLoading();
if (code == 200) {
uni.setStorageSync("token", data.token);
uni.setStorageSync("userId", data.userId);
// #ifdef MP-WEIXIN
uni.setStorageSync("unionId", data.unionId);
// #endif
// #ifdef MP-ALIPAY
uni.setStorageSync("openId", data.openId);
// #endif
emit("authFinish", true);
} else {
emit("authFinish", false);
}
}
onShareAppMessage((res) => {
return {};
});
// onReachBottom(() => {
// console.log("🚀 ~ onReachBottom ~ onReachBottom:");
// });
//
onLoad((option) => {
// timer.value = setTimeout(() => {
// uni.navigateTo({
// url: "/pages/home/index",
// });
// }, 2000)
});
function goUserAgreement() {
wx.openPrivacyContract({
success: () => {}, //
fail: () => {}, //
complete: () => {},
});
}
//
onUnload(() => {
clearTimeout(timer.value);
});
onShow(() => {
stores.initWxConfig();
});
</script>
<style lang="scss" scoped>
.loginContainer {
height: 100vh;
overflow-y: auto;
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/log_bg.png);
background-size: cover;
position: relative;
box-sizing: border-box;
padding: 176rpx 0;
.prompt {
width: 80rpx;
height: 596rpx;
position: absolute;
left: 50%;
top: 0;
margin-top: 176rpx;
transform: translateX(-50%);
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/new_logo.png);
background-size: contain;
}
.logo {
width: 292rpx;
height: 68rpx;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
margin-bottom: 176rpx;
background-image: url(https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/images/logo.png);
background-size: cover;
}
}
.bottom_btn {
width: 360rpx;
height: 80rpx;
background: linear-gradient(to right, #fc5c69, #e7303f);
border-radius: 100rpx;
position: fixed;
bottom: 270rpx;
left: 50%;
transform: translate(-50%, 0);
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: 0.1);
display: flex;
color: white;
font-size: 32rpx;
text-align: center;
justify-content: center;
align-items: center;
}
.tips {
width: 87vw;
position: fixed;
bottom: 370rpx;
left: 50%;
transform: translate(-50%, 0);
display: flex;
align-items: start;
.checkbox {
}
:deep(.u-checkbox) {
margin-top: 5rpx;
}
.r_userAgreement {
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #192236;
line-height: 40rpx;
text-align: left;
font-style: normal;
}
.userAgreement {
color: #5978b2;
}
}
</style>

View File

@ -9,13 +9,22 @@
</view> </view>
<view class="bannerContainer"> <view class="bannerContainer">
<u-swiper :list="bannerList" keyName="image" class="banner" radius="10" autoPlay interval="5000" <u-swiper
img-mode="heightFix"></u-swiper> :list="bannerList"
keyName="image"
class="banner"
radius="10"
autoPlay
interval="5000"
img-mode="heightFix"
></u-swiper>
</view> </view>
<view class="subscribe" v-show="subShow"> <view class="subscribe" v-show="subShow">
<view class="subTitle">订阅要闻解锁全部资讯</view> <view class="subTitle">订阅要闻解锁全部资讯</view>
<view class="subBtn" @click="show = true">立即解锁 <text class="price">25</text>/</view> <view class="subBtn" @click="show = true"
>立即解锁 <text class="price">25</text>/</view
>
</view> </view>
<!-- 文章列表 --> <!-- 文章列表 -->
@ -32,7 +41,12 @@
</view> </view>
<!-- 全部解锁 --> <!-- 全部解锁 -->
<Pay :isShow="false" :show="show" @onClick="handleClick" @handleSub="handleSub" /> <Pay
:isShow="false"
:show="show"
@onClick="handleClick"
@handleSub="handleSub"
/>
<!-- 单篇解锁 --> <!-- 单篇解锁 -->
<Pay :show="Newsshow" @onClick="handleClose" @handleSub="handleNewsSub" /> <Pay :show="Newsshow" @onClick="handleClose" @handleSub="handleNewsSub" />
</view> </view>
@ -88,8 +102,7 @@ function back() {
}); });
} }
onShow(() => { onShow(() => {});
});
function handleSubListItem(id: any) { function handleSubListItem(id: any) {
uni.setStorageSync("newsItem", id); uni.setStorageSync("newsItem", id);