Merge branch 'xie0928'

This commit is contained in:
@fawn-nine
2023-10-07 17:01:03 +08:00
3 changed files with 213 additions and 146 deletions

View File

@@ -75,7 +75,7 @@
<image :src="item.images" mode="aspectFit"></image> <image :src="item.images" mode="aspectFit"></image>
</view> </view>
<text style="padding-right: 10rpx;">{{item.name}}</text> <text style="padding-right: 10rpx;">{{item.name}}</text>
<u-icon v-if="item.canListen == 'true'" name="volume" color="#71d5a1" size="24" <u-icon v-if="item.canListen == true" name="volume" color="#71d5a1" size="24"
@click="goToListen(item.id)"></u-icon> @click="goToListen(item.id)"></u-icon>
<u-icon v-else name="volume" color="#71d5a1" size="24" <u-icon v-else name="volume" color="#71d5a1" size="24"
@click="goToListenNone(item.id)"></u-icon> @click="goToListenNone(item.id)"></u-icon>

View File

@@ -52,7 +52,7 @@
<view class="playList" v-if="libLIst.length > 0"> <view class="playList" v-if="libLIst.length > 0">
<view class="item" v-for="(item,index) in libLIst" :key="index" > <view class="item" v-for="(item,index) in libLIst" :key="index" >
<view > <view >
<view v-if="3 > index" <view v-if="item.isFree == 1"
:class="[ :class="[
userInfo.playingInfo.bookId==item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '']" @click="listenOne(item, index)"> userInfo.playingInfo.bookId==item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '']" @click="listenOne(item, index)">
<span :class="['graytitle']">{{item.chapter}}</span>&nbsp;&nbsp; <span :class="['graytitle']">{{item.chapter}}</span>&nbsp;&nbsp;
@@ -155,7 +155,9 @@
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
}, },
onHide() {
this.libLIst = []
},
//第一次加载 //第一次加载
onLoad(e) { onLoad(e) {
this.bookId = e.Id this.bookId = e.Id
@@ -303,7 +305,13 @@
if(res.code == 0){ if(res.code == 0){
console.log(res,999) console.log(res,999)
if(res.BookCatalogue.length > 0){ if(res.BookCatalogue.length > 0){
this.libLIst = res.BookCatalogue res.BookCatalogue.map( item => {
if(item.isFree == 1){
this.libLIst.push(item)
}
})
console.log('改变后的试听目录',this.libLIst)
//this.libLIst = res.BookCatalogue
// this.fengImg = res.images // this.fengImg = res.images
} }
} }

View File

@@ -50,8 +50,8 @@
<view class="tanchu"> <view class="tanchu">
<view class="dp_title">请输入昵称</view> <view class="dp_title">请输入昵称</view>
<u--input v-model="userMes.nickname" placeholder="请输入昵称" border="surround" clearable></u--input> <u--input v-model="userMes.nickname" placeholder="请输入昵称" border="surround" clearable></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="choseNickname(userMes.nickname)" <u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定"
style="margin-top: 50rpx;"></u-button> @click="choseNickname(userMes.nickname)" style="margin-top: 50rpx;"></u-button>
<view @click="nicknameShow=false" class="dp_canBtn">取消</view> <view @click="nicknameShow=false" class="dp_canBtn">取消</view>
</view> </view>
</u-popup> </u-popup>
@@ -88,16 +88,21 @@
</u-popup> </u-popup>
<!-- 密码 --> <!-- 密码 -->
<u-popup :show="passwordShow" :round="10" @close="passwordShow=false"> <u-popup :show="passwordShow" :round="10" @close="cancelPass">
<view class="tanchu"> <view class="tanchu">
<view class="dp_title">请修改密码</view> <view class="dp_title">请修改密码</view>
<u--input v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable> <u--input v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable
@input="inputMethod(userMes.password)">
</u--input> </u--input>
<view class="" style="font-size: 28rpx; color: #999;">
<p v-if="note != ''">{{note}}</p>
<p v-html="str2" style="margin-top: 10rpx;"></p>
</view>
<u--input v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable <u--input v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable
style="margin-top: 20rpx;"></u--input> style="margin-top: 20rpx;"></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()" <u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()"
style="margin-top: 50rpx;"></u-button> style="margin-top: 50rpx;"></u-button>
<view @click="passwordShow=false" class="dp_canBtn">取消</view> <view @click="cancelPass" class="dp_canBtn">取消</view>
</view> </view>
</u-popup> </u-popup>
<!-- <view class="btn_box"> <!-- <view class="btn_box">
@@ -113,10 +118,18 @@
import { import {
mapState mapState
} from 'vuex'; } from 'vuex';
// 密码验证的正则
//1、密码为八位及以上并且字母数字特殊字符三项都包括
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
//2、密码为八位及以上并且字母、数字、特殊字符三项中有两项强度是中等
var mediumRegex = new RegExp(
"^(?=.{8,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[a-z])(?=.*\\W))|((?=.*[0-9])(?=.*\\W))|((?=.*[A-Z])(?=.*\\W))).*$",
"g");
var enoughRegex = new RegExp("(?=.{8,}).*", "g");
export default { export default {
data() { data() {
return { return {
playData:{}, playData: {},
userMes: { userMes: {
id: '', id: '',
age: '', age: '',
@@ -125,7 +138,7 @@
tel: '', tel: '',
password: '', password: '',
Repassword: '', Repassword: '',
oldName:'', // 老的用户名 oldName: '', // 老的用户名
}, },
avatarShow: false, avatarShow: false,
nicknameShow: false, nicknameShow: false,
@@ -142,6 +155,9 @@
id: 0, id: 0,
} }
], ],
note: '',
str2: '',
passwordOk:false, // 密码是否满足规则
}; };
}, },
//第一次加载 //第一次加载
@@ -158,7 +174,7 @@
uni.hideTabBar(); uni.hideTabBar();
this.getData(); this.getData();
}, },
components:{ components: {
musicPlay musicPlay
}, },
//方法 //方法
@@ -181,7 +197,37 @@
}); });
} }
}, },
cancelPass(){
this.passwordShow = false,
this.userMes.password = '',
this.userMes.Repassword = ''
this.note = '',
this.str2 = ''
},
// 密码验证
inputMethod(value) {
this.passwordOk = false
console.log('输入的值为:', value)
if (strongRegex.test(value)) {
//console.log('强密码-----',value)
this.str2 = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度至少为8位。'
this.note = ''
this.passwordOk = true
} else if (mediumRegex.test(value)) {
//console.log('中等密码-----',value)
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度至少为8位。'
this.str2 = "<span style='color:#2979ff'>密码强度中等!</span>"
this.passwordOk = true
} else if (enoughRegex.test(value)) {
//console.log('弱密码-----',value)
this.str2 = "<span style='color:#f3a73f'>密码强度太弱!</span>"
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度至少为8位。'
} else {
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度至少为8位。'
//console.log('密码-----',value)
}
},
// 头像 // 头像
choseAvatar(e) { choseAvatar(e) {
let that = this let that = this
@@ -200,7 +246,7 @@
// 年龄 // 年龄
choseAge(e) { choseAge(e) {
let that = this let that = this
if(that.userMes.age<=0){ if (that.userMes.age <= 0) {
uni.showToast({ uni.showToast({
title: "年龄不能小于0", title: "年龄不能小于0",
icon: 'none' icon: 'none'
@@ -214,16 +260,16 @@
// 昵称 // 昵称
choseNickname(e) { choseNickname(e) {
let that = this let that = this
if(e && e != ''){ if (e && e != '') {
that.choseData() that.choseData()
that.nicknameShow = false that.nicknameShow = false
}else{ } else {
that.userMes.nickname = that.userMes.oldName that.userMes.nickname = that.userMes.oldName
console.log(that.userMes.nickname) console.log(that.userMes.nickname)
uni.showToast({ uni.showToast({
title:'昵称不可为空', title: '昵称不可为空',
icon:'none' icon: 'none'
}) })
} }
}, },
@@ -238,7 +284,17 @@
// 修改密码 // 修改密码
chosePassword() { chosePassword() {
if(!this.passwordOk){
console.log('不满足密码格式',this.note)
uni.showToast({
title:this.note,
icon: 'none'
})
return
}
let that = this let that = this
if (that.userMes.Repassword == '' || that.userMes.password == '') { if (that.userMes.Repassword == '' || that.userMes.password == '') {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@@ -253,6 +309,7 @@
}); });
return return
} }
that.choseData() that.choseData()
that.passwordShow = false that.passwordShow = false
}, },
@@ -270,7 +327,7 @@
}).then(function(res) { }).then(function(res) {
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title: "修改成功" title: "修改成功,退出登陆后生效"
}); });
} }
}).catch(function(error) { }).catch(function(error) {
@@ -305,9 +362,11 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/style/mixin.scss'; @import '@/style/mixin.scss';
.btn_box {
.btn_box {
margin-top: 40rpx; margin-top: 40rpx;
padding: 10px; padding: 10px;
button { button {
font-size: 32rpx; font-size: 32rpx;
background-color: #e5e5e5; background-color: #e5e5e5;
@@ -321,6 +380,7 @@
} }
} }
} }
.tabulate { .tabulate {
.per_list { .per_list {
font-size: 30rpx; font-size: 30rpx;
@@ -423,7 +483,6 @@
color: #888; color: #888;
} }
} }
.submit{
} .submit {}
</style> </style>