免登录

This commit is contained in:
2024-10-09 10:38:59 +08:00
parent 14070f5402
commit 6bd1235e97
5 changed files with 1629 additions and 135 deletions

View File

@@ -23,6 +23,18 @@
}
}
},
{
"path": "pages/user/visitor",
"style": {
"navigationBarTitleText": "游客登录",
"enablePullDownRefresh": false, // 禁止下拉刷新,
"app-plus": {
"bounce": "none",
"titleNView": false,
"popGesture": "none"
}
}
},
{
"path": "pages/homePage/index/index",
"style": {

View File

@@ -33,7 +33,7 @@
<view class="goods_box">
<view class="curriulum_title_box">
<view v-if="this.options.isMiaosha==1" class="miaosha_box">
<view v-if="this.options.isMiaosha == 1" class="miaosha_box">
<view class="price_box">
<view class="price_left">
<template
@@ -103,7 +103,7 @@
</text>
</view>
<view class="curriulum_title" style="margin-top: 40rpx;"
<view class="curriulum_title" style="margin-top: 40rpx"
>{{ curriculumData.productName }}
</view>
</view>
@@ -405,7 +405,7 @@
textColor="#333"
lineColor="#b0b0b0"
></u-divider>
<view class="small_class_teaching_box" style="background-color: #B7E0E2">
<view class="small_class_teaching_box" style="background-color: #b7e0e2">
<view class="common_divider divider_box"> </view>
<common-rich-detail :detailInfo="detailInfo" style="padding: 10rpx">
@@ -524,7 +524,7 @@
@selectGoods="selectGoods"
@onHandleClickBuy="onHandleClickBuy"
></common-select-goods>
<u-popup
<u-popup
:show="showInfo"
mode="bottom"
@close="closeShowInfo"
@@ -715,7 +715,7 @@ export default {
urlList: {
list: "app/phone.do?getCourseDetail_new",
curriculumInfo: "app/phone.do?getCourseInfo",
detailInfo: "sociology/product/getProductDetail",
goodsList: "book/shopproduct/getGlProductList",
},
customButtonGroup1: [
@@ -799,6 +799,11 @@ export default {
// this.searchList = []
},
onShow() {
if (this.options.type == "visitor") {
this.urlList.detailInfo = "visitor/getProductDetail";
} else {
this.urlList.detailInfo = "sociology/product/getProductDetail";
}
this.selectGoodsData = {};
this.getCourseDescriptionData();
this.show = false;
@@ -814,8 +819,24 @@ export default {
this.showInfo = true;
},
openPopup() {
if (this.options.type == "visitor") {
console.log("this.options.type at line 1090:", this.options.type);
uni.showModal({
content: "登陆后可购买本商品",
confirmText: "去登录",
cancelText: "再逛逛", confirmColor:'#018f89',//确定按钮颜色
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/user/login/login",
});
}
},
});
return;
}
// this.selectGoodsData = this.goodsList[0];
this.$refs.commonSelectGoods.open()
this.$refs.commonSelectGoods.open();
// this.show = true;
this.$forceUpdate();
},
@@ -823,13 +844,45 @@ export default {
this.show = false;
},
selectGoods(data) {
if (this.options.type == "visitor") {
console.log("this.options.type at line 1090:", this.options.type);
uni.showModal({
content: "登陆后可购买本商品",
confirmText: "去登录",
cancelText: "再逛逛", confirmColor:'#018f89',//确定按钮颜色
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/user/login/login",
});
}
},
});
return;
}
this.selectGoodsData = data;
this.$refs.commonSelectGoods.open()
this.$refs.commonSelectGoods.open();
// this.show = true;
this.$forceUpdate();
},
onHandleClickBuy1() {
if (this.options.type == "visitor") {
console.log("this.options.type at line 1090:", this.options.type);
uni.showModal({
content: "登陆后可购买本商品",
confirmText: "去登录",
cancelText: "再逛逛", confirmColor:'#018f89',//确定按钮颜色
success(res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/user/login/login",
});
}
},
});
return;
}
this.$refs.commonSelectGoods.open();
// this.show = true;
},
@@ -844,7 +897,9 @@ export default {
productImages: this.selectGoodsData.productImages,
productId: this.selectGoodsData.productId,
productName: this.selectGoodsData.productName,
price: this.selectGoodsData.activityPrice?this.selectGoodsData.activityPrice:this.selectGoodsData.price,
price: this.selectGoodsData.activityPrice
? this.selectGoodsData.activityPrice
: this.selectGoodsData.price,
goodsType: this.selectGoodsData.goodsType,
},
],
@@ -1462,7 +1517,7 @@ export default {
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
@import "@/style/mixin.scss";
.u-grid-list {
// height: 40rpx;
}
@@ -1747,7 +1802,7 @@ export default {
background: #cef8ea;
text-align: center;
border-radius: 10rpx;
box-shadow: 0px 0px 6rpx 0px #E9DCCC;
box-shadow: 0px 0px 6rpx 0px #e9dccc;
}
}
@@ -2058,7 +2113,6 @@ export default {
padding-right: 0 !important;
}
.parameterList {
/deep/.list_item {
// border-bottom: none;

View File

@@ -1,6 +1,7 @@
<template>
<view class="commonPageBox">
<public-module></public-module>
<view class="header_box"></view>
<view class="appJump">
<view class="everhealth item flexbox" @click="appjumpfun('everhealth')">
@@ -58,7 +59,7 @@
<image
:src="v.icon"
mode="aspectFill"
style="width: 59rpx; height: 59rpx"
style="width: 49rpx; height: 49rpx"
></image>
</view>
<view class="cate_item_name">{{ v.title }}</view>
@@ -213,67 +214,7 @@ export default {
dataInfo: {},
flashSaleList: [], //试听
miaoShaContent: "",
cateList: [
{
title: "儒",
url: "/pages/curriculum/cate/index",
imgUrl: require("@/static/icon/homePage/cate_ru.png"),
style: {
width: "62rpx",
height: "56rpx",
},
},
// {
// title: "释",
// url: "/pages/curriculum/cate/index",
// imgUrl: require("@/static/icon/homePage/cate_shi.png"),
// style: {
// width: "49rpx",
// height: "61rpx",
// },
// },
// {
// title: "道",
// url: "/pages/curriculum/cate/index",
// imgUrl: require("@/static/icon/homePage/cate_dao.png"),
// style: {
// width: "59rpx",
// height: "59rpx",
// },
// },
{
title: "医",
url: "/pages/curriculum/cate/index",
imgUrl: require("@/static/icon/homePage/cate_yi.png"),
style: {
width: "61rpx",
height: "61rpx",
},
},
{
title: "美",
url: "/pages/curriculum/cate/index",
imgUrl: require("@/static/icon/homePage/cate_mei.png"),
style: {
width: "59rpx",
height: "59rpx",
},
},
{
title: "文",
url: "/pages/curriculum/cate/index",
imgUrl: require("@/static/icon/homePage/cate_wen.png"),
style: {
width: "61rpx",
height: "60rpx",
},
},
],
cateList: [ ],
curriculumList: [
{
name: "课程设置",
@@ -314,7 +255,15 @@ export default {
async onTabItemTap() {
this.requestAll();
},
async onPullDownRefresh() {
console.log('下拉刷新')
await this.requestAll();
setTimeout(() => {
uni.stopPullDownRefresh();
console.log('下拉刷新已停止');
}, 50);
},
methods: {
...mapMutations(["setUserInfo"]),
goVideo() {
@@ -395,6 +344,7 @@ export default {
if (res.code == 0) {
that.cateList = res.labels ? res.labels : [];
}
});
},
@@ -703,33 +653,37 @@ function calcTimer(timer) {
.cate_box {
width: 100%;
height: 198rpx;
height: auto;
background: $themeColor;
background-repeat: no-repeat;
display: flex;
justify-content: center;
flex-wrap: wrap;
// justify-content: center;
background-size: 100% 100%;
// background-image: url("@/static/icon/cate_bg.png");
box-shadow: 0rpx 0rpx 6rpx 0rpx #f9f6ea;
border-radius: 7rpx;
display: flex;
align-items: center;
justify-content: space-around;
padding: 20rpx 31rpx;
// display: flex;
// align-items: center;
// justify-content: space-around;
padding: 10rpx 10rpx 0;
box-sizing: border-box;
.cate_item_box {
min-width: 110rpx;
width: 25%;
height: 100%;
padding: 10rpx 0 10rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.cate_item_border {
width: 75rpx;
height: 98rpx;
width: 65rpx;
height: 78rpx;
background-size: 100% 100%;
background-image: url("@/static/icon/homePage/cate_bg.png");
border-radius: 4rpx;
@@ -743,11 +697,11 @@ function calcTimer(timer) {
}
.cate_item_name {
margin-top: 21rpx;
margin-top: 10rpx;
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 43rpx;
font-size: 36rpx;
color: #000000;
// line-height: 46rpx;
text-align: center;

View File

@@ -153,7 +153,15 @@
<button @click="onSubmit" class="active" v-if="btnShow"> </button>
<button v-else> </button>
</view>
<view class="loginHelp" v-if="submitClickNum > 0">
<!-- <view class="loginHelp"> -->
<text>登录遇到问题</text
><text
class="link"
@click="onPageJump('/pages/homePage/index/workOrder', 'login')"
>去反馈问题</text
>
</view>
<!-- <view class="third_party_login_box">
<view class="third_party_title"><text>第三方登录</text></view>
<view class="third_party_content">
@@ -178,6 +186,9 @@
>
</view>
</view>
<view class="youKeL" style="margin-bottom: 40rpx" v-if="isAndorid">
<view @click="onPageJump('/pages/user/visitor')">免登陆体验</view>
</view>
<!-- <view class="youKeL" style="margin-bottom: 80rpx">
<view
@@ -249,16 +260,8 @@
@close="yhxyShow = false"
>
<view class="tanchu">
<view
class="dp_title"
v-html="yhxyText.title
"
></view>
<view
class="dp_content"
v-html="yhxyText.content
"
></view>
<view class="dp_title" v-html="yhxyText.title"></view>
<view class="dp_content" v-html="yhxyText.content"></view>
<!-- <yhxyPage></yhxyPage> -->
</view>
</u-popup>
@@ -269,17 +272,9 @@
:round="10"
@close="yszcShow = false"
>
<view class="tanchu" >
<view
class="dp_title"
v-html="yszcText.title
"
></view>
<view
class="dp_content"
v-html="yszcText.content
"
></view>
<view class="tanchu">
<view class="dp_title" v-html="yszcText.title"></view>
<view class="dp_content" v-html="yszcText.content"></view>
<!-- <yszcPage></yszcPage> -->
</view>
</u-popup>
@@ -352,6 +347,8 @@ export default {
sendEmailcode: "common/user/getMailCaptcha", //密码登录
apiLogin: "app/phone.do?loginV2",
},
isAndorid: true,
submitClickNum:0, // 登陆按钮点击次数
};
},
@@ -378,7 +375,7 @@ export default {
this.brand = 3000;
this.loginForm = {};
this.getOS();
// #endif
},
created() {
@@ -387,8 +384,8 @@ export default {
//页面显示
onShow() {
console.log("at line 362:", uni.getStorageSync("userInfo"));
this.getSettlement(101,'yszcText');
this.getSettlement(100,'yhxyText');
this.getSettlement(101, "yszcText");
this.getSettlement(100, "yhxyText");
//this.closeMusic()
},
onReady() {
@@ -407,7 +404,16 @@ export default {
methods: {
...mapMutations(["setUserInfo"]),
...mapMutations(["setHealthMes"]),
getOS() {
let oprateOs = "";
oprateOs = uni.getSystemInfoSync().platform;
// console.log(oprateOs)
if (oprateOs == "android") {
this.isAndorid = true;
} else {
this.isAndorid = false;
}
},
changeType(val) {
this.loginForm = {};
this.type = 2000;
@@ -469,26 +475,22 @@ export default {
});
},
// 获取协议内容
async getSettlement(id,type) {
//隐私策略
async getSettlement(id, type) {
//隐私策略
var data = await this.$commonJS.getAgreement(id);
if (data.content) {
data.content = data.content.replace(
/<h5>/g,
'<view style="font-weight: bold;font-size: 32rpx;margin-top: 20rpx;margin-bottom: 20rpx;">'
);
data.content = data.content.replace(
/<\/h5>/g,
"</view>"
);
data.content = data.content.replace(/<\/h5>/g, "</view>");
}
if (type == "yszcText") {
this.yszcText = data;
}
if (type == "yhxyText") {
this.yhxyText = data;
}
if(type=='yszcText'){
this.yszcText=data
}
if(type=='yhxyText'){
this.yhxyText=data
}
//用户协议
// this.yhxyText = await this.$commonJS.getAgreement(108);
@@ -515,11 +517,12 @@ this.yhxyText=data
});
},
onPageJump(url) {
uni.navigateTo({
url: url,
});
},
onPageJump(url,name) {
console.log('点击了');
uni.navigateTo({
url: `${url}?name=${name}`
});
},
onInput() {
// this.clearTime && clearTimeout(this.clearTime)
// this.clearTime = setTimeout(() => {
@@ -580,6 +583,7 @@ this.yhxyText=data
if (this.loginForm.quCode == null || this.loginForm.quCode == 86) {
// 如果没选择国家code默认是中国大陆
if (!this.$base.phoneRegular.test(this.loginForm.phone)) {
this.submitClickNum += 1
uni.showToast({
title: "手机格式不正确",
icon: "none",
@@ -677,6 +681,7 @@ this.yhxyText=data
}
if (this.loginForm.quCode == null || this.loginForm.quCode == 86) {
if (!this.$base.phoneRegular.test(this.loginForm.phone)) {
this.submitClickNum += 1
this.$commonJS.showToast("手机格式不正确");
return;
@@ -706,10 +711,13 @@ this.yhxyText=data
await this.$http
.get(this.urlList.registerOrLogin, httpData)
.then(async (res) => {
this.submitClickNum = 0
res.userInfo.token = res.token.token;
await this.setUserInfo(res.userInfo);
console.log("res.userInfo哈哈红红火火恍恍惚惚 at line 593:", res.token);
console.log(
"res.userInfo哈哈红红火火恍恍惚惚 at line 593:",
res.token
);
uni.setStorageSync("token", res.token.token);
// socket.init();
uni.showToast({
@@ -717,7 +725,7 @@ this.yhxyText=data
});
setTimeout(() => {
uni.setStorageSync('isJump', 'false')
uni.setStorageSync("isJump", "false");
uni.switchTab({
url: "/pages/homePage/index/index",
success: function () {
@@ -727,7 +735,13 @@ this.yhxyText=data
},
});
}, 100);
});
}).catch(e => {
uni.showToast({
title:'登陆失败',
icon:'none'
})
this.submitClickNum += 1
});
} else {
if (!this.loginForm.phoneEmail) {
uni.showToast({
@@ -749,6 +763,7 @@ this.yhxyText=data
await this.$http
.post(this.urlList.passwordLogin, httpData)
.then(async (res) => {
this.submitClickNum = 0
console.log("res.userInfo at line 593:", res.token);
res.userInfo.token = res.token.token;
await this.setUserInfo(res.userInfo);
@@ -767,7 +782,13 @@ this.yhxyText=data
},
});
}, 500);
});
}).catch(e => {
uni.showToast({
title:'登陆失败',
icon:'none'
})
this.submitClickNum += 1
});
}
},
@@ -1432,5 +1453,8 @@ this.yhxyText=data
border-radius: 10rpx;
padding: 5rpx 15rpx;
}
}
}.loginHelp{border: 1px solid #f5dab1; margin-top: 16rpx; font-size: 26rpx; text-align: center;
padding: 10rpx; background-color: #fdf6ec; border-radius: 15rpx;
.link{color: #e6a23c;}
}
</style>

1450
pages/user/visitor.vue Normal file

File diff suppressed because it is too large Load Diff