1 Commits

Author SHA1 Message Date
徐哼唧L
97ff3915c0 游客模式 2023-12-06 16:26:45 +08:00
10 changed files with 603 additions and 405 deletions

View File

@@ -2,7 +2,7 @@
<view> <view>
<view class="footer_box" :class="{ footer_bg: bg }"> <view class="footer_box" :class="{ footer_bg: bg }">
<view v-for="(item, index) of navigationList" :key="index" class="footer_item"> <view v-for="(item, index) of navigationList" :key="index" class="footer_item">
<view class="footer_nav_item" @click="onPageJump(item.pagePath)"> <view class="footer_nav_item" @click="onPageJump(item.pagePath,index+1)">
<image v-if="item.pagePath == path" class="footer_nav_item_image footer_nav_item_image_scale" <image v-if="item.pagePath == path" class="footer_nav_item_image footer_nav_item_image_scale"
:src="'/' + item.selectedIconPath" mode="aspectFit"></image> :src="'/' + item.selectedIconPath" mode="aspectFit"></image>
<image v-else class="footer_nav_item_image" :src="'/' + item.iconPath" mode="aspectFit"></image> <image v-else class="footer_nav_item_image" :src="'/' + item.iconPath" mode="aspectFit"></image>
@@ -69,12 +69,24 @@
}, },
//方法 //方法
methods: { methods: {
onPageJump(url) { onPageJump(url,num) {
if (uni.getStorageSync("anonymous") == '0000000000' && (num == 2 || num == 3)) {
uni.showToast({
icon: 'none',
title: '请先登录'
})
// setTimeout(() => {
// uni.navigateTo({
// url: "/pages/user/login"
// });
// }, 1000)
} else {
if (this.path !== url) { if (this.path !== url) {
uni.switchTab({ uni.switchTab({
url: '/' + url url: '/' + url
}); });
} }
}
}, },
} }
}; };

View File

@@ -6,10 +6,10 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/"; // socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式 // baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
baseUrl = "http://192.168.110.110:9200/pb/"; // baseUrl = "http://192.168.110.110:9200/pb/";
// baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1 // baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
// socketUrl = "ws://8.129.186.35:6001/"; // socketUrl = "ws://8.129.186.35:6001/";
} else if (process.env.NODE_ENV === 'production') { } else if (process.env.NODE_ENV === 'production') {

View File

@@ -240,13 +240,13 @@ export const h5Login = function(type = "judge", callback) {
appMutual("jumpLogin", null, function() { appMutual("jumpLogin", null, function() {
if (type == "force") { if (type == "force") {
// 没登录跳转回登录页 // 没登录跳转回登录页
uni.showToast({ // uni.showToast({
icon: 'none', // icon: 'none',
title: '用户信息失效,请重新登陆。' // title: '用户信息失效,请重新登陆。'
}) // })
uni.navigateTo({ // uni.navigateTo({
url: "/pages/user/login" // url: "/pages/user/login"
}); // });
}else{ }else{
uni.showModal({ uni.showModal({
title:"提示", title:"提示",

View File

@@ -125,9 +125,11 @@ $http.requestStart = function(options) {
let storeUserInfo = store.state.userInfo; let storeUserInfo = store.state.userInfo;
if (!storeUserInfo.token) { // nvue页面读取不到vuex里面数据将取缓存 if (!storeUserInfo.token) { // nvue页面读取不到vuex里面数据将取缓存
storeUserInfo = uni.getStorageSync("userInfo"); storeUserInfo = uni.getStorageSync("userInfo");
uni.setStorageSync('anonymous', '0000000000');
} }
if (storeUserInfo.token) { if (storeUserInfo.token) {
options.header['token'] = storeUserInfo.token; options.header['token'] = storeUserInfo.token;
uni.setStorageSync('anonymous', storeUserInfo.token);
}; };
return options; return options;
} }
@@ -161,8 +163,9 @@ $http.dataFactory = async function(res) {
// 返回正确的结果(then接受数据) // 返回正确的结果(then接受数据)
return Promise.resolve(httpData); return Promise.resolve(httpData);
} else if (httpData.code == "401") { } else if (httpData.code == "401") {
console.log(uni.getStorageSync("anonymous"))
// token失效 // token失效
if (uni.getStorageSync('guidePages') == 2) { if (uni.getStorageSync('guidePages') == 2 && uni.getStorageSync("anonymous") != '0000000000') {
uni.showToast({ uni.showToast({
title: '登录失效,请重新登录', title: '登录失效,请重新登录',
icon: 'none' icon: 'none'

View File

@@ -448,8 +448,18 @@
url: '../peanut/shopping' url: '../peanut/shopping'
}); });
}, },
// 关联商品点击按钮组件 // 关联商品点击按钮组件
buttonClickLink(e) { buttonClickLink(e) {
// 游客跳转
if (uni.getStorageSync("anonymous") == '0000000000') {
uni.showToast({
icon: 'none',
title: '请先登录'
})
return
}
console.log('点击的是关联商品的组件') console.log('点击的是关联商品的组件')
if (e.index == 0) { if (e.index == 0) {
// 点击的是加入购物车 // 点击的是加入购物车
@@ -484,6 +494,14 @@
}, },
// 点击按钮组间 // 点击按钮组间
buttonClick(e) { buttonClick(e) {
// 游客跳转
if (uni.getStorageSync("anonymous") == '0000000000') {
uni.showToast({
icon: 'none',
title: '请先登录'
})
return
}
// console.log(e) // console.log(e)
if (e.index == 0) { if (e.index == 0) {
// 点击的是加入购物车 // 点击的是加入购物车

View File

@@ -67,6 +67,7 @@
<view v-if="item.clockIn != null && item.clockIn != 2" @click="goDaKa(item)"> <view v-if="item.clockIn != null && item.clockIn != 2" @click="goDaKa(item)">
<image src="../../static/icon/home1.png" mode="aspectFit"></image> <image src="../../static/icon/home1.png" mode="aspectFit"></image>
</view> </view>
<view v-else @click="noOp()"> <view v-else @click="noOp()">
<image class="gray" src="../../static/icon/home1.png" mode="aspectFit"></image> <image class="gray" src="../../static/icon/home1.png" mode="aspectFit"></image>
</view> </view>

View File

@@ -12,7 +12,7 @@
</view> </view>
<view class="fiveIcon flexbox" style="justify-content: space-around;"> <view class="fiveIcon flexbox" style="justify-content: space-around;">
<div class="item item1" @click="onPageJump('../acupoint/acupoint')"> <div class="item item1" @click="anonymous?onYouAlert():onPageJump('../acupoint/acupoint')">
<image src="../../static/icon/five1.png" mode="aspectFit"></image> <image src="../../static/icon/five1.png" mode="aspectFit"></image>
<text>经穴检索</text> <text>经穴检索</text>
</div> </div>
@@ -24,7 +24,7 @@
<image src="../../static/icon/five4.png" mode="aspectFit"></image> <image src="../../static/icon/five4.png" mode="aspectFit"></image>
<text>五运六气</text> <text>五运六气</text>
</div> --> </div> -->
<div class="item item1" @click="onPageJump('../peanut/searchFor')"> <div class="item item1" @click="anonymous?onYouAlert():onPageJump('../peanut/searchFor')">
<image src="../../static/icon/five3.png" mode="aspectFit"></image> <image src="../../static/icon/five3.png" mode="aspectFit"></image>
<text>书名检索</text> <text>书名检索</text>
</div> </div>
@@ -51,28 +51,28 @@
</view> </view>
<!-- <view class="home_nar" v-if="showEbook"> --> <!-- <view class="home_nar" v-if="showEbook"> -->
<view class="home_nar"> <view class="home_nar">
<view class="hn_cl_tit shuguan" @click="onPageJump('../clock/index')"> <view class="hn_cl_tit shuguan" @click="anonymous?onYouAlert():onPageJump('../clock/index')">
<image src="../../static/icon/home1-1.png" mode="aspectFit"></image> <image src="../../static/icon/home1-1.png" mode="aspectFit"></image>
<!-- <text> </text> --> <!-- <text> </text> -->
</view> </view>
<view class="hn_cl_tit dianzishu" @click="onPageJump('../listen/home')"> <view class="hn_cl_tit dianzishu" @click="anonymous?onYouAlert():onPageJump('../listen/home')">
<image src="../../static/icon/home2-1.png" mode="aspectFit"></image> <image src="../../static/icon/home2-1.png" mode="aspectFit"></image>
<!-- <text> </text> --> <!-- <text> </text> -->
</view> </view>
<!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> --> <!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> -->
<view class="hn_cl_tit shuping" @click="onPageJump('../comments/commentsList')"> <view class="hn_cl_tit shuping" @click="anonymous?onYouAlert():onPageJump('../comments/commentsList')">
<image src="../../static/icon/home3-1.png" mode="aspectFit"></image> <image src="../../static/icon/home3-1.png" mode="aspectFit"></image>
<!-- <text> </text> --> <!-- <text> </text> -->
</view> </view>
<view class="hn_cl_tit chaoshi" @click="onPageJump('../talkBook/talkBook')"> <view class="hn_cl_tit chaoshi" @click="anonymous?onYouAlert():onPageJump('../talkBook/talkBook')">
<image src="../../static/icon/home4-1.png" mode="aspectFit"></image> <image src="../../static/icon/home4-1.png" mode="aspectFit"></image>
<!-- <text> </text> --> <!-- <text> </text> -->
</view> </view>
<view class="hn_cl_tit chaoshi" @click="onPageJump('../yian/yian')"> <view class="hn_cl_tit chaoshi" @click="anonymous?onYouAlert():onPageJump('../yian/yian')">
<image src="../../static/icon/home5-1.png" mode="aspectFit"></image> <image src="../../static/icon/home5-1.png" mode="aspectFit"></image>
<!-- <text> </text> --> <!-- <text> </text> -->
</view> </view>
@@ -221,7 +221,8 @@
<!-- </view> --> <!-- </view> -->
<scroll-view class="scroll-view_H " scroll-x="true" scroll-left="0"> <scroll-view class="scroll-view_H " scroll-x="true" scroll-left="0">
<view class="ProTabs"> <view class="ProTabs">
<text v-for="item in tagList" :key="item.splId" :class="[tabsid == item.splId ? 'cur' :'']" @click="tabsChange(item)">{{item.labelName}}</text> <text v-for="item in tagList" :key="item.splId" :class="[tabsid == item.splId ? 'cur' :'']"
@click="tabsChange(item)">{{item.labelName}}</text>
</view> </view>
</scroll-view> </scroll-view>
<!-- 商品展示 --> <!-- 商品展示 -->
@@ -238,7 +239,8 @@
{{item.productName}} {{item.productName}}
</view> </view>
<view class="goodsPrice"> <view class="goodsPrice">
<span class="price" v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</span> <span class="price"
v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</span>
<span class="price" v-else>{{item.price}}</span> <span class="price" v-else>{{item.price}}</span>
<span class="Salesnum">已售{{item.sumSales}} </span> <span class="Salesnum">已售{{item.sumSales}} </span>
</view> </view>
@@ -248,7 +250,8 @@
<view class=""> <view class="">
<view v-if="status==0" style="text-align: center;"> <view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon> <u-loading-icon style="display: inline-block;"></u-loading-icon>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font> <font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中
</font>
</view> </view>
<view v-if="status==1"> <view v-if="status==1">
<u-divider text="全部加载完成"></u-divider> <u-divider text="全部加载完成"></u-divider>
@@ -278,7 +281,8 @@
import repciptData from '@/static/json/repcipt.json' import repciptData from '@/static/json/repcipt.json'
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
import { import {
mapState,mapMutations mapState,
mapMutations
} from 'vuex'; } from 'vuex';
export default { export default {
data() { data() {
@@ -322,7 +326,8 @@
page: 1, page: 1,
totalPage: 0, totalPage: 0,
tjProList: [], tjProList: [],
status : 3 status: 3,
anonymous: false, //游客
}; };
}, },
onPageScroll(e) { onPageScroll(e) {
@@ -347,7 +352,8 @@
this.tjProList = [] this.tjProList = []
uni.hideTabBar(); uni.hideTabBar();
this.getData(); this.getData();
this.getTags() this.getTags();
this.anonyMo();
}, },
// 页面加载完毕 // 页面加载完毕
onReady() { onReady() {
@@ -399,6 +405,14 @@
methods: { methods: {
...mapMutations(['setUserInfo']), ...mapMutations(['setUserInfo']),
// ...mapMutations(['setLoadingShow']), // ...mapMutations(['setLoadingShow']),
// 游客模式
anonyMo() {
if (uni.getStorageSync("anonymous") == '0000000000') {
this.anonymous = true
} else {
this.anonymous = false
}
},
// 获取商品标签 // 获取商品标签
getTags() { getTags() {
this.loadingNow = false this.loadingNow = false
@@ -531,7 +545,9 @@
console.log('关闭订单成功', index); console.log('关闭订单成功', index);
if (index == this.ComplateRequestArr.length - 1) { // 最后一个支付订单 if (index == this.ComplateRequestArr.length - 1) { // 最后一个支付订单
this.setUserInfo({restoreFlag:false}); this.setUserInfo({
restoreFlag: false
});
// console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++') // console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++')
} }
@@ -709,7 +725,13 @@
}); });
}, },
// 游客跳转
onYouAlert() {
uni.showToast({
icon: 'none',
title: '请先登录'
})
},
}, },
@@ -717,46 +739,115 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.fiveIcon{justify-content: space-between; text-align: center;
.fiveIcon {
justify-content: space-between;
text-align: center;
text { text {
font-size: 28rpx; color: #11a669; font-size: 28rpx;
color: #11a669;
} }
image{width: 56rpx; height: 56rpx; margin: 0 auto; }
image {
width: 56rpx;
height: 56rpx;
margin: 0 auto;
} }
.hehan{width: 80%; margin: 10rpx auto;} }
.hehan {
width: 80%;
margin: 10rpx auto;
}
.zhekou { .zhekou {
.goodsName{margin-bottom: 20rpx;} .goodsName {
margin-bottom: 20rpx;
} }
.activityPrice{font-size: 60rpx;}
.priceAndnum{ font-size: 24rpx !important;
.price{color: #9b9b9b !important; font-size: inherit; font-weight: normal !important; display: block;}
} }
.activityPrice {
font-size: 60rpx;
}
.priceAndnum {
font-size: 24rpx !important;
.price {
color: #9b9b9b !important;
font-size: inherit;
font-weight: normal !important;
display: block;
}
}
.ProTabs { .ProTabs {
// margin: 20rpx 0; // margin: 20rpx 0;
padding: 0 20rpx; padding: 0 20rpx;
text{padding: 8rpx 14rpx; font-size: 32rpx; display: inline-block; border-radius: 10rpx; overflow: hidden;
text {
padding: 8rpx 14rpx;
font-size: 32rpx;
display: inline-block;
border-radius: 10rpx;
overflow: hidden;
// background-color: #eee; // background-color: #eee;
color: #55aa7f; margin-right: 10rpx;} color: #55aa7f;
text.cur{background-color:#55aa7f ; color: #fff;} margin-right: 10rpx;
} }
text.cur {
background-color: #55aa7f;
color: #fff;
}
}
// .newBook{margin-top: 10rpx;} // .newBook{margin-top: 10rpx;}
.scroll-view_H{background-color: #fff;white-space: nowrap;
padding:10rpx ; margin-top: 12rpx;}
.scroll-view_H { .scroll-view_H {
.item { padding: 10rpx; overflow: hidden; display: inline-block; padding-bottom: 0; background-color: #fff;
width: 180rpx !important; margin-right: 20rpx; border-radius: 10rpx; white-space: nowrap;
padding: 10rpx;
margin-top: 12rpx;
}
.scroll-view_H {
.item {
padding: 10rpx;
overflow: hidden;
display: inline-block;
padding-bottom: 0;
width: 180rpx !important;
margin-right: 20rpx;
border-radius: 10rpx;
.videoBox { .videoBox {
image{display: block; width:150rpx; image {
display: block;
width: 150rpx;
height: 170rpx; height: 170rpx;
} }
} }
.bookName{display: block; margin-top: 6rpx; color: #666; font-size: 24rpx; white-space: nowrap;
overflow-x: hidden; overflow: hidden; .bookName {
text-overflow: ellipsis;} display: block;
margin-top: 6rpx;
color: #666;
font-size: 24rpx;
white-space: nowrap;
overflow-x: hidden;
overflow: hidden;
text-overflow: ellipsis;
} }
}
// .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;} // .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;}
} }
.flexbox{display: flex;}
.flexbox {
display: flex;
}
.head_line { .head_line {
padding-top: 8rpx; padding-top: 8rpx;
margin: 12rpx 0 0 0; margin: 12rpx 0 0 0;
@@ -792,32 +883,56 @@
background-size: cover; background-size: cover;
padding: 20rpx; padding: 20rpx;
position: relative; position: relative;
// margin-bottom:60rpx; // margin-bottom:60rpx;
// height: 400rpx; margin-bottom: 130rpx; // height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 { .icon_hua_1 {
// margin: 0 auto; // margin: 0 auto;
width: 100%; text-align: center; width: 100%;
text-align: center;
height: 80rpx;
image {
width: 150rpx;
height: 80rpx; height: 80rpx;
image{width: 150rpx; height: 80rpx;}
} }
.icon_hua{width: 100%; text-align: center; display: block;
image{width: 150rpx; height: 150rpx; margin: 0 auto;}
} }
.search_box { margin: 0 auto; margin-top: 20rpx; align-items: center;
width: calc(100% - 30rpx); margin-top: 0; .icon_hua {
width: 100%;
text-align: center;
display: block;
image {
width: 150rpx;
height: 150rpx;
margin: 0 auto;
}
}
.search_box {
margin: 0 auto;
margin-top: 20rpx;
align-items: center;
width: calc(100% - 30rpx);
margin-top: 0;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.search{height: 56upx; .search {
height: 56upx;
display: flex; display: flex;
width: 86%; margin: 0 auto; width: 86%;
margin: 0 auto;
align-items: center; align-items: center;
padding: 0upx 40upx; padding: 0upx 40upx;
background-color: #fff; background-color: #fff;
border-radius: 20upx; border-radius: 20upx;
box-shadow: 0 0px 10px 1px #54a96633; box-shadow: 0 0px 10px 1px #54a96633;
} }
.prompt { .prompt {
color: #838383; font-size: 24rpx; color: #838383;
font-size: 24rpx;
} }
@@ -831,11 +946,15 @@
margin-right: 20upx; margin-right: 20upx;
} }
} }
.searBtn { .searBtn {
width: 80rpx; align-items: center; width: 80rpx;
font-size: 30rpx; color: #fff; align-items: center;
font-size: 30rpx;
color: #fff;
} }
} }
.home_nar { .home_nar {
background-color: #fff; background-color: #fff;
padding: 40rpx 10rpx; padding: 40rpx 10rpx;
@@ -843,6 +962,7 @@
display: flex; display: flex;
color: #333; color: #333;
margin-bottom: 0; margin-bottom: 0;
// .dianzishu{ margin-right:10rpx; // .dianzishu{ margin-right:10rpx;
// background-color:#f8d6f4 ; border: 2px solid #edcce9; // background-color:#f8d6f4 ; border: 2px solid #edcce9;
// } // }
@@ -858,6 +978,7 @@
//display: flex; //display: flex;
align-content: center; align-content: center;
justify-content: center; justify-content: center;
image { image {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
@@ -865,7 +986,15 @@
margin: 0 auto; margin: 0 auto;
// margin: 0 20rpx; // margin: 0 20rpx;
} }
text{ display:block; text-align: center; margin-top:4rpx; font-size: 36rpx; color: #000; font-weight:blod;}
text {
display: block;
text-align: center;
margin-top: 4rpx;
font-size: 36rpx;
color: #000;
font-weight: blod;
}
} }
@@ -1129,13 +1258,15 @@
.goods { .goods {
width: 100%; width: 100%;
margin:0 0 50rpx 0; background-color: #fff; margin: 0 0 50rpx 0;
background-color: #fff;
.goodsItem { .goodsItem {
display: inline-block; display: inline-block;
width: 46%; width: 46%;
border-radius: 20rpx; border-radius: 20rpx;
padding: 25rpx; padding-bottom: 5rpx; padding: 25rpx;
padding-bottom: 5rpx;
margin: 0 20rpx 20rpx 20rpx; margin: 0 20rpx 20rpx 20rpx;
background-color: #fff; background-color: #fff;
border: 1px solid #eee; border: 1px solid #eee;
@@ -1157,12 +1288,17 @@
.goodsPrice { .goodsPrice {
font-size: 28rpx; font-size: 28rpx;
margin: 5rpx 0 0 3rpx; margin: 5rpx 0 0 3rpx;
display: flex; justify-content: space-between; display: flex;
justify-content: space-between;
.price { .price {
font-weight: bold; font-weight: bold;
color: #ff0000; color: #ff0000;
} }
.Salesnum{color: #9b9b9b;}
.Salesnum {
color: #9b9b9b;
}
} }
} }
} }

View File

@@ -5,12 +5,12 @@
<view style="height: 50rpx;"></view> <view style="height: 50rpx;"></view>
<view class="per_mes"> <view class="per_mes">
<image :src="userMes.avatar" v-if="userMes.avatar!=null" class="per_mes_img"></image> <image :src="userMes.avatar" v-if="userMes.avatar!=null" class="per_mes_img"></image>
<image src="../../static/icon/home_icon_1.png" v-if="userMes.avatar==null" class="per_mes_img"></image> <image src="../../static/icon/home_icon_1.png" v-if="userMes.avatar==null" class="per_mes_img" @click="signOut()"></image>
<view> <view>
<text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text> <text class="name" v-if="userMes.nickname!=null">{{userMes.nickname}}</text>
<text class="name" v-if="userMes.nickname==null">设置</text> <text class="name" v-if="userMes.nickname==null" @click="signOut()">登录</text>
<!-- <image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image> --> <!-- <image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image> -->
<text style="margin-left: 20rpx;font-size: 22rpx;color: #888;">({{userMes.tel}})</text> <text style="margin-left: 20rpx;font-size: 22rpx;color: #888;" v-if="userMes.tel">({{userMes.tel}})</text>
<!-- <text class="tong">累计读书5本 <!-- <text class="tong">累计读书5本
<span style="margin: 0 20upx;">|</span> 今日读50分钟 <span style="margin: 0 20upx;">|</span> 今日读50分钟
@@ -35,7 +35,7 @@
<b class="kt_btn" @click="onPageJump('./opeVip')">立即续费</b> <b class="kt_btn" @click="onPageJump('./opeVip')">立即续费</b>
</view> --> </view> -->
<view class="chong_zhi"> <view class="chong_zhi" v-if="!anonymous">
<view class="zhanghu" @click="onPageJump('../user/persCount')"> <view class="zhanghu" @click="onPageJump('../user/persCount')">
我的账户 我的账户
<text style="float: right;line-height: 85rpx;"> > </text> <text style="float: right;line-height: 85rpx;"> > </text>
@@ -55,6 +55,7 @@
</view> </view>
<view class="xiugai"> <view class="xiugai">
<view v-if="!anonymous">
<view class="nav_list" @click="switchTab('../bookShop/orderList')"> <view class="nav_list" @click="switchTab('../bookShop/orderList')">
<text>我的订单</text> <text>我的订单</text>
</view> </view>
@@ -102,7 +103,16 @@
<view class="nav_list" @click="logout"> <view class="nav_list" @click="logout">
<text>注销帐号</text> <text>注销帐号</text>
</view> </view>
</view>
<view v-if="anonymous">
<view class="nav_list" @click="newOnShare">
<text>分享App</text>
</view>
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
<text>关于我们</text>
</view>
</view>
</view> </view>
<u-modal :show="signShow" :content="signContent" :showCancelButton="true" @cancel="signShow=false" <u-modal :show="signShow" :content="signContent" :showCancelButton="true" @cancel="signShow=false"
@@ -115,6 +125,7 @@
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
<z-navigation></z-navigation> <z-navigation></z-navigation>
</view> </view>
</template> </template>
@@ -123,7 +134,8 @@
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
// import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare'; // import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare';
import { import {
mapState,mapMutations mapState,
mapMutations
} from 'vuex'; } from 'vuex';
export default { export default {
data() { data() {
@@ -135,6 +147,7 @@
playData: {}, playData: {},
isAndorid: true, isAndorid: true,
platform: null, // 设备系统 platform: null, // 设备系统
anonymous: false, //游客
}; };
}, },
//第一次加载 //第一次加载
@@ -155,6 +168,7 @@
// 隐藏原生的tabbar // 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
this.getData(); this.getData();
this.anonyMo();
}, },
components: { components: {
musicPlay musicPlay
@@ -216,6 +230,18 @@
url: url url: url
}); });
}, },
// 游客模式
anonyMo() {
if (uni.getStorageSync("anonymous") == '0000000000') {
this.anonymous = true
} else {
this.anonymous = false
}
},
getData() { getData() {
// 获取个人信息 // 获取个人信息
if (this.userInfo.id != undefined) { if (this.userInfo.id != undefined) {
@@ -280,7 +306,9 @@
// 退出登录 // 退出登录
signOut() { signOut() {
this.signShow = false this.signShow = false
this.setUserInfo({'token': null}) this.setUserInfo({
'token': null
})
uni.reLaunch({ uni.reLaunch({
url: '../user/login' url: '../user/login'
}); });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB