fix: 修复请求头中错误的phone字段并优化登录流程
修复utils/index.ts中请求头phone字段错误使用token的问题 优化login/indexMini.vue登录成功后的跳转逻辑 添加comment/indexMini.vue组件并修复Tabbar.vue的标签闭合问题
This commit is contained in:
parent
70aa8e6f58
commit
e9f2799c13
|
|
@ -0,0 +1,126 @@
|
|||
<template>
|
||||
<view class="comment">
|
||||
|
||||
<view class="comment-count">
|
||||
<view class="count" @click="handleClickLike">
|
||||
<image
|
||||
:src="props.data.isLike ? 'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/zan_like_fill%402x.png' : 'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/zan_like_normal%402x.png'"
|
||||
class="icon" />
|
||||
<!-- <text class="num">{{ props.data.likeNums }}</text> -->
|
||||
<text class="num">点赞</text>
|
||||
</view>
|
||||
<view class="count" @click="handleClickStar">
|
||||
<image
|
||||
:src="props.data.isFav ? 'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/star_icon_fill%402x.png' : 'https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/star_icon_normal%402x.png'"
|
||||
class="icon" />
|
||||
<!-- <text class="num">{{ props.data.favNums }}</text> -->
|
||||
<text class="num">收藏</text>
|
||||
</view>
|
||||
<view class="count" @click="handleClickStar">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png" class="icon" />
|
||||
<!-- <text class="num">{{ props.data.favNums }}</text> -->
|
||||
<text class="num">分享</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
const emit = defineEmits(["handleClickLike", "handleClickStar"]);
|
||||
const messageShow = ref(false);
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => { },
|
||||
},
|
||||
});
|
||||
|
||||
const isLike = ref(false);
|
||||
const isStar = ref(false);
|
||||
const comment = ref("");
|
||||
|
||||
// 用户点赞
|
||||
const handleClickLike = () => {
|
||||
emit("handleClickLike");
|
||||
};
|
||||
// 用户收藏
|
||||
const handleClickStar = () => {
|
||||
// isStar.value = !isStar.value;
|
||||
emit("handleClickStar");
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
comment.value = "";
|
||||
uni.showToast({
|
||||
title: "提交成功",
|
||||
icon: "none",
|
||||
duration: 1500,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.comment {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 10rpx rgba(51, 51, 51, 0.3);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.comment-input {
|
||||
width: 100%;
|
||||
|
||||
.input-field {
|
||||
height: 72rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 52rpx;
|
||||
// font-size: 24rpx;
|
||||
font-size: var(--h4-font-size);
|
||||
color: #333;
|
||||
padding: 0 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-placeholder {
|
||||
color: rgba(51, 51, 51, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
.comment-count {
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
|
||||
|
||||
.count {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 24rpx;
|
||||
width: 33%;
|
||||
|
||||
.num {
|
||||
margin-left: 12rpx;
|
||||
// font-size: 24rpx;
|
||||
font-size: var(--h4-font-size);
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
class="tabbar_img" />
|
||||
<text class="tabbar_title" :style="{ color: tabIndex == 1 ? '#D13E3C' : '#757A80' }">全部</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
|
|||
|
|
@ -26,11 +26,7 @@
|
|||
/> -->
|
||||
|
||||
<!-- 底部栏 评论 / 收藏 -->
|
||||
<!-- <Comment
|
||||
:data="data"
|
||||
@handleClickLike="handleClickLike"
|
||||
@handleClickStar="handleClickStar"
|
||||
/> -->
|
||||
<Comment :data="data" @handleClickLike="handleClickLike" @handleClickStar="handleClickStar" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -46,7 +42,7 @@ import {
|
|||
import { getNewsList } from "@/api";
|
||||
import Article from "@/components/article/indexNewsInfo.vue";
|
||||
import Column from "@/components/column/index.vue";
|
||||
import Comment from "@/components/comment/index.vue";
|
||||
import Comment from "@/components/comment/indexMini.vue";
|
||||
import { useShareStore } from "@/stores/shareStore";
|
||||
import { Session } from "@/utils/storage";
|
||||
import { getNavHeight } from "@/utils/util"
|
||||
|
|
@ -60,6 +56,7 @@ const newType = ref<any>("");
|
|||
const columnList = ref<any>([]);
|
||||
const columnName = ref("");
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
console.log("🚀 ~ onReachBottom ~ onReachBottom:");
|
||||
});
|
||||
|
|
@ -241,4 +238,28 @@ const jumpDetail = (item: any) => {
|
|||
padding-bottom: 112rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.comment-count {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 24rpx;
|
||||
|
||||
.num {
|
||||
margin-left: 12rpx;
|
||||
// font-size: 24rpx;
|
||||
font-size: var(--h4-font-size);
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,7 @@
|
|||
|
||||
<!-- <view class="bottom_btn" @click="goIndex"> 立即进入 </view> -->
|
||||
|
||||
<button
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
class="bottom_btn"
|
||||
>
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="bottom_btn">
|
||||
<view>
|
||||
<text>立即进入</text>
|
||||
</view>
|
||||
|
|
@ -20,11 +16,8 @@
|
|||
<!-- 用户协议 -->
|
||||
<view class="tips">
|
||||
<u-checkbox class="checkbox" shape="circle"></u-checkbox>
|
||||
<text class="r_userAgreement"
|
||||
>已阅读并同意<text class="userAgreement" @click="goUserAgreement"
|
||||
>《江南农商银行隐私政策》《中证参考智能资讯小程序服务使用许可及服务协议》</text
|
||||
>,首次登录的手机号将自动注册。</text
|
||||
>
|
||||
<text class="r_userAgreement">已阅读并同意<text class="userAgreement"
|
||||
@click="goUserAgreement">《江南农商银行隐私政策》《中证参考智能资讯小程序服务使用许可及服务协议》</text>,首次登录的手机号将自动注册。</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -100,17 +93,15 @@ async function doWxAuthFn(phoneObj, jsCode) {
|
|||
uni.hideLoading();
|
||||
if (code == 200) {
|
||||
uni.setStorageSync("token", data.token);
|
||||
uni.setStorageSync("userId", data.userId);
|
||||
// #ifdef MP-WEIXIN
|
||||
// uni.setStorageSync("userId", data.userId);
|
||||
uni.setStorageSync("unionId", data.unionId);
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
uni.setStorageSync("openId", data.openId);
|
||||
// #endif
|
||||
uni.setStorageSync("phone", data.phone);
|
||||
uni.navigateTo({
|
||||
url: "/pages/minihome/index",
|
||||
|
||||
emit("authFinish", true);
|
||||
})
|
||||
} else {
|
||||
emit("authFinish", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,9 +123,9 @@ onLoad((option) => {
|
|||
|
||||
function goUserAgreement() {
|
||||
wx.openPrivacyContract({
|
||||
success: () => {}, // 打开成功
|
||||
fail: () => {}, // 打开失败
|
||||
complete: () => {},
|
||||
success: () => { }, // 打开成功
|
||||
fail: () => { }, // 打开失败
|
||||
complete: () => { },
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -211,11 +202,11 @@ onShow(() => {
|
|||
display: flex;
|
||||
align-items: start;
|
||||
|
||||
.checkbox {
|
||||
}
|
||||
|
||||
:deep(.u-checkbox) {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.r_userAgreement {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
|
|
@ -225,6 +216,7 @@ onShow(() => {
|
|||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.userAgreement {
|
||||
color: #5978b2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Request.setConfig((config: any) => {
|
|||
if (uni.getStorageSync("token")) {
|
||||
// config.header["Authorization"] = "Bearer " + uni.getStorageSync("token");
|
||||
config.header!["auth-token"] = uni.getStorageSync("token");
|
||||
config.header!["phone"] = uni.getStorageSync("token");
|
||||
config.header!["phone"] = uni.getStorageSync("phone");
|
||||
}
|
||||
|
||||
return config;
|
||||
|
|
|
|||
Loading…
Reference in New Issue