parent
cd4c7de91d
commit
7587b2cc5d
13 changed files with 205 additions and 1308 deletions
@ -1,113 +0,0 @@ |
||||
<template> |
||||
<view class="page"> |
||||
<view class="input"> |
||||
<uni-easyinput v-model="form.email" placeholder="请填写你的邮箱" :clearable="false" /> |
||||
</view> |
||||
<view class="input code-wrap"> |
||||
<uni-easyinput class="code" v-model="form.code" placeholder="验证码" :clearable="false" /> |
||||
<view class="send-code" @click="sendCode" :disabled="codeDisabled">{{ btnText }}</view> |
||||
</view> |
||||
<button type="primary" @click="submit">确认</button> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { updateMyEmail, mailCodeSend } from '@/apis/modules/user.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
userId: '', |
||||
form: { |
||||
email: '', |
||||
code: '' |
||||
}, |
||||
codeDisabled: false, |
||||
phoneTimer: null, |
||||
btnText: '发送验证码', |
||||
} |
||||
}, |
||||
onShow() { |
||||
|
||||
}, |
||||
methods: { |
||||
// 发送验证码 |
||||
sendCode() { |
||||
const { email } = this.form |
||||
if (!email) return this.$util.errMsg('请输入邮箱') |
||||
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱') |
||||
mailCodeSend({ |
||||
email, |
||||
platformId: 4 |
||||
}).then(res => { |
||||
this.phoneCountdown() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 验证码倒计时 |
||||
phoneCountdown() { |
||||
let count = 60 |
||||
if (!this.phoneTimer) { |
||||
this.codeDisabled = true |
||||
this.phoneTimer = setInterval(() => { |
||||
if (count > 0) { |
||||
count-- |
||||
this.btnText = `${count}秒后重试` |
||||
} else { |
||||
this.codeDisabled = false |
||||
clearInterval(this.phoneTimer) |
||||
this.phoneTimer = null |
||||
this.btnText = `发送验证码` |
||||
} |
||||
}, 1000) |
||||
} |
||||
}, |
||||
// 提交 |
||||
submit() { |
||||
const { email, code } = this.form |
||||
if (!email) return this.$util.errMsg('请输入邮箱') |
||||
if (!code) return this.$util.errMsg('请输入验证码') |
||||
updateMyEmail({ |
||||
email, |
||||
code, |
||||
platformId: 4 |
||||
}).then(res => { |
||||
this.$util.sucMsg('修改成功!') |
||||
setTimeout(() => { |
||||
uni.navigateBack() |
||||
}, 1500) |
||||
}).catch(res => {}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.page { |
||||
padding: 20px; |
||||
background-color: #fff; |
||||
} |
||||
/deep/.input { |
||||
margin-bottom: 15px; |
||||
.is-input-border { |
||||
border-color: #dedede !important; |
||||
} |
||||
} |
||||
.input { |
||||
margin-bottom: 20px; |
||||
} |
||||
.code-wrap { |
||||
display: flex; |
||||
} |
||||
.code { |
||||
flex: 1; |
||||
} |
||||
.send-code { |
||||
width: 100px; |
||||
margin-left: 20px; |
||||
text-align: center; |
||||
color: #4386ff; |
||||
font-size: 12px; |
||||
line-height: 36px; |
||||
border: 1px solid #4386ff; |
||||
border-radius: 5px; |
||||
} |
||||
</style> |
@ -1,285 +1,116 @@ |
||||
<template> |
||||
<view> |
||||
<view class="search-wrap"> |
||||
<image class="bg" src="@/static/image/info.png"></image> |
||||
<view class="info"> |
||||
<uni-search-bar class="search" radius="30" placeholder="请输入文章名称,标签" v-model="keyword" clearButton="auto" cancelButton="none" bgColor="#fff" /> |
||||
<view class="block"> |
||||
<view class="form-list"> |
||||
<view class="line with-arrow"> |
||||
<view class="name">LOGO</view> |
||||
<view class="val"> |
||||
<image class="avatar" src="@/static/image/info-bg.jpg"></image> |
||||
<uni-icons type="right" size="18" color="#ababab"></uni-icons> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="type"> |
||||
<view v-for="(item, i) in classifications.slice(0, 4)" :key="i" :class="['item', {active: active == item.id}]" @click="classificationClick(item, 1)">{{ item.classificationName }}</view> |
||||
<uni-icons class="icon" custom-prefix="iconfont" type="icon-filter" size="22" color="#007eff" @click="typeVisible = true"></uni-icons> |
||||
<view class="line with-arrow"> |
||||
<view class="name">幼儿园名称</view> |
||||
<view class="val"> |
||||
<input type="text" placeholder="请输入幼儿园名称" /> |
||||
<uni-icons type="right" size="18" color="#ababab"></uni-icons> |
||||
</view> |
||||
|
||||
<template v-if="list.length"> |
||||
<view class="list"> |
||||
<view v-for="(item, i) in list" :key="i" class="item" @click="toDetail(item)"> |
||||
<view class="title ell">{{ item.title }}</view> |
||||
<view class="texts"> |
||||
<view class="left"> |
||||
<view class="des">{{ item.mainBody }}</view> |
||||
<view class="metas"> |
||||
<text class="date">{{ item.releaseTime }}</text> |
||||
<view v-if="item.labelName" class="labels"> |
||||
<view v-for="(label, j) in item.labelName" :key="j" class="label">{{ label }}</view> |
||||
</view> |
||||
<view class="line with-arrow"> |
||||
<view class="name">标签</view> |
||||
<view class="val"> |
||||
<input type="text" placeholder="请输入标签" /> |
||||
<uni-icons type="right" size="18" color="#ababab"></uni-icons> |
||||
</view> |
||||
</view> |
||||
<image class="pic" :src="item.bannerImg"></image> |
||||
<view class="line textarea-line"> |
||||
<view class="name">幼儿园slogan</view> |
||||
<textarea placeholder="请输入幼儿园slogan"></textarea> |
||||
</view> |
||||
<view class="line textarea-line"> |
||||
<view class="name">地址</view> |
||||
<textarea placeholder="请输入地址"></textarea> |
||||
</view> |
||||
<view class="line textarea-line"> |
||||
<view class="name">幼儿园简介</view> |
||||
<textarea placeholder="请输入幼儿园简介"></textarea> |
||||
</view> |
||||
<uni-load-more :status="status" /> |
||||
</template> |
||||
<empty v-else></empty> |
||||
|
||||
<view :class="['type-popup', {active: typeVisible}]"> |
||||
<uni-icons class="close" type="closeempty" size="20" color="#757575" @click="closeType"></uni-icons> |
||||
<view class="title">所属分类</view> |
||||
<view class="types"> |
||||
<view v-for="(item, i) in classifications" :key="i" :class="['item', {active: active == item.id}]" @click="classificationClick(item)">{{ item.classificationName }}</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="block info"> |
||||
<view class="title">联系我们</view> |
||||
<view class="line">地址:测试测试</view> |
||||
<view class="line">联系电话:测试测试</view> |
||||
<image class="qrcode" src="@/static/image/info-bg.jpg"></image> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { partnerOperatingList, queryClassificationByType } from '@/apis/modules/article.js' |
||||
import { my } from '@/apis/modules/parner.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
classifications: [], |
||||
active: '', |
||||
typeVisible: false, |
||||
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
||||
status: 'more', // 上拉加载状态 more|loading|noMore |
||||
searchTimer: null, |
||||
articleNameSort: '', |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
} |
||||
}, |
||||
watch: { |
||||
keyword () { |
||||
this.active = '' |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initList() |
||||
}, 500) |
||||
} |
||||
}, |
||||
// 下拉刷新 |
||||
onPullDownRefresh() { |
||||
this.initList() |
||||
setTimeout(() => { |
||||
uni.stopPullDownRefresh() |
||||
}, 1500) |
||||
}, |
||||
// 上拉加载 |
||||
onReachBottom() { |
||||
if (this.reachBottom >= 0) { |
||||
this.reachBottom = 1 |
||||
this.status = 'loading' |
||||
this.getList() |
||||
|
||||
} |
||||
}, |
||||
onShow() { |
||||
this.keyword = '' |
||||
this.active = '' |
||||
this.typeVisible = false |
||||
this.initRole() |
||||
this.getInfo() |
||||
}, |
||||
methods: { |
||||
// 初始化权限 |
||||
initRole() { |
||||
if (!uni.getStorageSync('auth').includes('资讯')) { |
||||
this.per = false |
||||
} |
||||
this.initList() |
||||
this.getClassification() |
||||
// 获取个人信息 |
||||
getInfo() { |
||||
const { partnerId, teamId } = uni.getStorageSync('team') |
||||
my({ |
||||
partnerId, |
||||
teamId |
||||
}).then(({ my }) => { |
||||
this.info = my.info |
||||
}).catch(e => {}) |
||||
}, |
||||
toPage(path) { |
||||
this.$util.to(path) |
||||
}, |
||||
getList() { |
||||
const data = { |
||||
keyWord: this.keyword, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 4, |
||||
typeId: 2, |
||||
articleNameSort: this.articleNameSort, |
||||
classificationId: this.active |
||||
// 退出登录 |
||||
logout() { |
||||
const that = this |
||||
uni.showModal({ |
||||
title: '提示', |
||||
content: '确定要退出账号吗?', |
||||
success(res) { |
||||
if (res.confirm) { |
||||
uni.clearStorageSync() |
||||
that.$util.to('/pages/login/login') |
||||
} |
||||
} |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
partnerOperatingList(data).then(({ page, total }) => { |
||||
uni.hideLoading() |
||||
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值 |
||||
const list = page |
||||
list.forEach(e => { |
||||
if (e.labelName) e.labelName = e.labelName.split(',').slice(0, 2) // 只展示前两个标签 |
||||
e.mainBody = (e.summary || e.mainBody).replace(/(<[^>]+>)|(( )+)/g , '') |
||||
}) |
||||
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list |
||||
this.page++ // 每次获取了数据后page+1 |
||||
const noMore = this.list.length === total // 是否加载完所有数据 |
||||
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore |
||||
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1 |
||||
}).catch(e => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
initList() { |
||||
this.page = 1 |
||||
this.reachBottom = 0 |
||||
this.getList() |
||||
}, |
||||
// 获取所属分类 |
||||
getClassification() { |
||||
queryClassificationByType(2).then(({ data }) => { |
||||
this.classifications = [ |
||||
{ |
||||
id: '', |
||||
classificationName: '不限' |
||||
} |
||||
] |
||||
this.classifications.push(...data) |
||||
}).catch(e => {}) |
||||
}, |
||||
// 所属分类点击回调 |
||||
classificationClick(item, query) { |
||||
this.active = item.id |
||||
query && this.initList() |
||||
}, |
||||
// 关闭所属分类弹框 |
||||
closeType() { |
||||
this.typeVisible = false |
||||
this.initList() |
||||
}, |
||||
// 展开 |
||||
toggle(item) { |
||||
item.toggle = !item.toggle |
||||
}, |
||||
// 排序 |
||||
switchSort() { |
||||
this.articleNameSort = this.articleNameSort === 'desc' ? 'asc' : 'desc' |
||||
this.initList() |
||||
}, |
||||
// 跳转详情 |
||||
toDetail(item) { |
||||
this.$util.to(`/team/article/article?info=1&id=` + item.id) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.search-wrap { |
||||
position: relative; |
||||
height: 300rpx; |
||||
padding: 120rpx 10px 0; |
||||
.bg { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.info { |
||||
position: relative; |
||||
margin-top: 160rpx; |
||||
} |
||||
.text { |
||||
margin: 0 10px 10rpx; |
||||
font-size: 50rpx; |
||||
color: #fff; |
||||
} |
||||
.avatar { |
||||
width: 80rpx; |
||||
height: 80rpx; |
||||
border: 0; |
||||
border-radius: 50%; |
||||
} |
||||
.type { |
||||
.info { |
||||
position: relative; |
||||
display: flex; |
||||
padding: 30rpx; |
||||
background-color: #fff; |
||||
.item { |
||||
padding: 0 15rpx; |
||||
line-height: 1.6; |
||||
font-size: 28rpx; |
||||
padding: 24rpx; |
||||
.line { |
||||
margin: 20rpx 0; |
||||
font-size: 26rpx; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
&.active { |
||||
color: #007FFF; |
||||
font-weight: 600; |
||||
} |
||||
} |
||||
.icon { |
||||
.qrcode { |
||||
position: absolute; |
||||
right: 40rpx; |
||||
width: 40rpx; |
||||
} |
||||
} |
||||
.list { |
||||
background-color: #fff; |
||||
.item { |
||||
margin-bottom: 10rpx; |
||||
padding: 20rpx 40rpx; |
||||
border-bottom: 1px solid #f1f1f1; |
||||
} |
||||
.texts { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
} |
||||
.pic { |
||||
width: 260rpx; |
||||
height: 180rpx; |
||||
border-radius: 8px; |
||||
} |
||||
.left { |
||||
width: calc(100% - 280rpx); |
||||
} |
||||
.title { |
||||
margin-bottom: 20rpx; |
||||
font-size: 32rpx; |
||||
font-weight: 600; |
||||
color: #333; |
||||
} |
||||
.des { |
||||
display: -webkit-box; |
||||
-webkit-box-orient: vertical; |
||||
-webkit-line-clamp: 2; |
||||
text-overflow: ellipsis; |
||||
overflow: hidden; |
||||
} |
||||
.metas { |
||||
margin-top: 10rpx; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
} |
||||
.date { |
||||
font-size: 24rpx; |
||||
color: #ccc; |
||||
white-space: nowrap; |
||||
} |
||||
.labels { |
||||
display: inline-flex; |
||||
flex-wrap: wrap; |
||||
align-items: center; |
||||
margin-top: 15rpx; |
||||
} |
||||
.label { |
||||
width: 90rpx; |
||||
padding: 2px 6px; |
||||
margin: 0 10rpx 15rpx 0; |
||||
font-size: 24rpx; |
||||
color: #fff; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
overflow: hidden; |
||||
background-color: #ccc; |
||||
border-radius: 4px; |
||||
top: 30rpx; |
||||
right: 30rpx; |
||||
width: 120rpx; |
||||
height: 120rpx; |
||||
} |
||||
} |
||||
</style> |
||||
|
@ -1,62 +0,0 @@ |
||||
<template> |
||||
<view class="page"> |
||||
<view class="input"> |
||||
<uni-easyinput type="password" v-model.trim="form.password" placeholder="请输入旧密码"></uni-easyinput> |
||||
</view> |
||||
<view class="input"> |
||||
<uni-easyinput type="password" v-model.trim="form.newPassword" placeholder="请输入新密码"></uni-easyinput> |
||||
</view> |
||||
<view class="input"> |
||||
<uni-easyinput type="password" v-model.trim="form.reNewPassword" placeholder="请再次输入新密码"></uni-easyinput> |
||||
</view> |
||||
<button type="primary" @click="submit">确认</button> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { examinePassword } from '@/apis/modules/user.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: { |
||||
password: '', |
||||
newPassword: '', |
||||
reNewPassword: '' |
||||
}, |
||||
} |
||||
}, |
||||
methods: { |
||||
submit() { |
||||
const { form } = this |
||||
const { password, newPassword, reNewPassword } = form |
||||
if(!password) return this.$util.errMsg('请输入旧密码') |
||||
if(!newPassword) return this.$util.errMsg('请输入新密码') |
||||
if(!reNewPassword) return this.$util.errMsg('请确认新密码') |
||||
if(newPassword.length < 6 || reNewPassword.length < 6) return this.$util.errMsg('请输入6位数以上的密码') |
||||
if(newPassword !== reNewPassword) return this.$util.errMsg('输入的新密码不一致,请重新确认') |
||||
if(password === newPassword) return this.$util.errMsg('旧密码跟新密码不能一致') |
||||
|
||||
form.accountId = uni.getStorageSync('team').accountId |
||||
examinePassword(form).then(res => { |
||||
this.$util.sucMsg('修改成功!') |
||||
setTimeout(() => { |
||||
uni.navigateBack() |
||||
}, 1000) |
||||
}).catch(e => {}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.page { |
||||
padding: 20px; |
||||
background-color: #fff; |
||||
} |
||||
/deep/.input { |
||||
margin-bottom: 15px; |
||||
.is-input-border { |
||||
border-color: #dedede !important; |
||||
} |
||||
} |
||||
</style> |
@ -1,281 +0,0 @@ |
||||
<template> |
||||
<view> |
||||
<view :class="[{'not-auth': !per}]"> |
||||
<view class="filter"> |
||||
<uni-search-bar class="search" radius="30" placeholder="请输入方案名称" clearButton="auto" cancelButton="none" v-model="keyword" /> |
||||
</view> |
||||
|
||||
<ul class="tab"> |
||||
<li v-for="(tab, i) in classifications.slice(0, 4)" :class="{active: active === tab.id}" @click="tabChange(tab)">{{ tab.classificationName }}</li> |
||||
<uni-icons class="icon" custom-prefix="iconfont" type="icon-filter" size="22" color="#007eff" @click="typeVisible = true"></uni-icons> |
||||
</ul> |
||||
|
||||
<view v-if="list.length" class="list"> |
||||
<view v-for="(item, i) in list" class="item" @click="toDetail(item)"> |
||||
<view class="c-name ell">{{ item.title }}</view> |
||||
<view class="content"> |
||||
<view class="info"> |
||||
<view class="line"> |
||||
<view class="name">产品:</view> |
||||
<view class="val ell-wrap"> |
||||
<view v-if="!item.toggle" class="product ell">{{ item.productNames }}</view> |
||||
<view v-else class="product" v-html="item.productNamesHtml"></view> |
||||
<view v-if="item.productNames && item.productNames.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view> |
||||
</view> |
||||
</view> |
||||
<view class="line"> |
||||
<view class="name">更新日期:</view> |
||||
<view class="val">{{ item.updateTime }}</view> |
||||
</view> |
||||
<view class="line"> |
||||
<view class="name">适用专业:</view> |
||||
<view class="val">{{ item.applicableMajor }}</view> |
||||
</view> |
||||
</view> |
||||
<!-- <view class="detail" @click.stop="toEmail(i)">下载</view> --> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<empty v-else></empty> |
||||
|
||||
<view :class="['type-popup', {active: typeVisible}]"> |
||||
<uni-icons class="close" type="closeempty" size="20" color="#757575" @click="closeType"></uni-icons> |
||||
<view class="title">所属分类</view> |
||||
<view class="types"> |
||||
<view v-for="(item, i) in classifications" :key="i" :class="['item', {active: active == item.id}]" @click="classificationClick(item)">{{ item.classificationName }}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<notAuth v-if="!per"></notAuth> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { schemeList, queryClassificationByType } from '@/apis/modules/article.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
per: true, // 是否有权限 |
||||
active: '', |
||||
typeVisible: false, |
||||
classifications: [], |
||||
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
||||
status: 'more', // 上拉加载状态 more|loading|noMore |
||||
searchTimer: null, |
||||
articleNameSort: 'desc', |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
} |
||||
}, |
||||
watch: { |
||||
keyword () { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initList() |
||||
}, 500) |
||||
} |
||||
}, |
||||
// 下拉刷新 |
||||
onPullDownRefresh() { |
||||
this.initList() |
||||
setTimeout(() => { |
||||
uni.stopPullDownRefresh() |
||||
}, 1500) |
||||
}, |
||||
// 上拉加载 |
||||
onReachBottom() { |
||||
if (this.reachBottom >= 0) { |
||||
this.reachBottom = 1 |
||||
this.status = 'loading' |
||||
this.getList() |
||||
} |
||||
}, |
||||
onShow() { |
||||
this.per = true |
||||
this.keyword = '' |
||||
this.active = '' |
||||
this.initRole() |
||||
}, |
||||
methods: { |
||||
// 初始化权限 |
||||
initRole() { |
||||
const auth = uni.getStorageSync('auth') |
||||
if (!auth.includes('工作台:方案')) { |
||||
this.per = false |
||||
this.list = [ |
||||
{ |
||||
title: '智信云', |
||||
productNames: '智信云师资培训班', |
||||
applicableMajor: 'python实训系统', |
||||
updateTime: '2023-08-08' |
||||
}, |
||||
{ |
||||
title: '智信云', |
||||
productNames: '智信云师资培训班智信云师资培训班', |
||||
applicableMajor: 'python实训系统', |
||||
updateTime: '2023-08-08' |
||||
}, |
||||
{ |
||||
title: '智信云智信云', |
||||
productNames: '智信云师资培训班智信云师资培训班', |
||||
applicableMajor: 'python实训系统', |
||||
updateTime: '2023-08-08' |
||||
}, |
||||
{ |
||||
title: '智信云', |
||||
productNames: '智信云师资培训班智信云师资培训班', |
||||
applicableMajor: 'python实训系统实训系统', |
||||
updateTime: '2023-08-08' |
||||
}, |
||||
] |
||||
} else { |
||||
this.initList() |
||||
this.getClassification() |
||||
} |
||||
}, |
||||
getList() { |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
schemeList({ |
||||
keyWord: this.keyword, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 4, |
||||
classificationId: this.active |
||||
}).then(({ data }) => { |
||||
uni.hideLoading() |
||||
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值 |
||||
const list = data.records |
||||
list.forEach(e => { |
||||
if (e.productNames) { |
||||
e.toggle = e.productNames.length < 14 // 超过了14个字才需要显示展开按钮 |
||||
e.productNamesHtml = e.productNames.split(',').join('<br>') |
||||
} |
||||
}) |
||||
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list |
||||
this.page++ // 每次获取了数据后page+1 |
||||
const noMore = this.list.length === data.total // 是否加载完所有数据 |
||||
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore |
||||
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1 |
||||
}).catch(e => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
initList() { |
||||
this.page = 1 |
||||
this.reachBottom = 0 |
||||
this.getList() |
||||
}, |
||||
// 获取所属分类 |
||||
getClassification() { |
||||
queryClassificationByType(3).then(({ data }) => { |
||||
this.classifications = [ |
||||
{ |
||||
id: '', |
||||
classificationName: '不限' |
||||
} |
||||
] |
||||
this.classifications.push(...data) |
||||
}).catch(e => {}) |
||||
}, |
||||
// 所属分类点击回调 |
||||
classificationClick(item, query) { |
||||
this.active = item.id |
||||
query && this.initList() |
||||
}, |
||||
// 关闭所属分类弹框 |
||||
closeType() { |
||||
this.typeVisible = false |
||||
this.initList() |
||||
}, |
||||
// tab切换 |
||||
tabChange(tab) { |
||||
this.active = tab.id |
||||
this.initList() |
||||
}, |
||||
// 跳转详情 |
||||
toDetail(item) { |
||||
this.$util.to(`/team/scheme/scheme?id=` + item.id) |
||||
}, |
||||
// 发送邮箱 |
||||
toEmail(id) { |
||||
this.$util.to(`../send/send?id=${id}`) |
||||
}, |
||||
// 展开 |
||||
toggle(item) { |
||||
item.toggle = !item.toggle |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.tab { |
||||
position: relative; |
||||
justify-content: flex-start; |
||||
li { |
||||
padding: 0 30rpx; |
||||
} |
||||
.icon { |
||||
position: absolute; |
||||
top: 32rpx; |
||||
right: 44rpx; |
||||
} |
||||
} |
||||
|
||||
.list { |
||||
background-color: #fff; |
||||
.item { |
||||
padding: 20rpx 40rpx; |
||||
border-bottom: 1px solid #f1f1f1; |
||||
} |
||||
.c-name { |
||||
font-size: 30rpx; |
||||
color: #333; |
||||
} |
||||
.line { |
||||
display: flex; |
||||
padding: 10rpx 0; |
||||
} |
||||
.content { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
margin-top: 20rpx; |
||||
} |
||||
.name { |
||||
width: 140rpx; |
||||
margin-right: 10rpx; |
||||
white-space: nowrap; |
||||
font-size: 28rpx; |
||||
color: #999; |
||||
} |
||||
.val { |
||||
font-size: 28rpx; |
||||
color: #333; |
||||
} |
||||
.product { |
||||
max-width: 67vw; |
||||
white-space: pre-wrap; |
||||
&.ell { |
||||
white-space: nowrap; |
||||
} |
||||
} |
||||
.toggle { |
||||
margin-top: 10rpx; |
||||
white-space: nowrap; |
||||
font-size: 24rpx; |
||||
color: #0e92ef; |
||||
} |
||||
.detail { |
||||
margin-left: 20rpx; |
||||
font-size: 26rpx; |
||||
color: #1f83ff; |
||||
white-space: nowrap; |
||||
} |
||||
} |
||||
</style> |
@ -1,116 +0,0 @@ |
||||
<template> |
||||
<view class="wrap"> |
||||
<view class="title">{{ form.title }}</view> |
||||
|
||||
<view class="text">{{ form.applicableMajor }}</view> |
||||
<view class="text">{{ form.schemeIntroduction }}</view> |
||||
<view class="text" v-html="form.product"></view> |
||||
<template v-if="form.fileName"> |
||||
<view class="file">{{ form.fileName }}</view> |
||||
<view class="detail" @click.stop="download">下载</view> |
||||
</template> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { schemeFindById } from '@/apis/modules/article.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: '', |
||||
form: { |
||||
totalBrowsing: '' |
||||
} |
||||
} |
||||
}, |
||||
onShow() { |
||||
const pages = getCurrentPages() |
||||
const { options } = pages[pages.length - 1] |
||||
this.id = options.id |
||||
this.getInfo() |
||||
}, |
||||
methods: { |
||||
// 获取详情 |
||||
getInfo() { |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
schemeFindById(this.id).then(({ data }) => { |
||||
if (data.productList) data.product = data.productList.map(e => e.productName).join('<br>') |
||||
this.form = data |
||||
uni.hideLoading() |
||||
}).catch(e => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
// 下载方案文件 |
||||
download() { |
||||
uni.setStorageSync('files', { |
||||
copyWriting: this.form.title, |
||||
fileName: [this.form.fileName], |
||||
urls: [this.form.schemeFile] |
||||
}) |
||||
this.$util.to(`/team/send/send`) |
||||
// uni.showLoading({ |
||||
// title: '加载中', |
||||
// mask: true |
||||
// }) |
||||
// const url = this.form.schemeFile |
||||
// const that = this |
||||
// // 下载文件资源到本地 |
||||
// uni.downloadFile({ |
||||
// url, |
||||
// success: function(res) { |
||||
// console.log(444, res) |
||||
// uni.saveFile({ |
||||
// tempFilePath: res.tempFilePath, |
||||
// success: function(res) { |
||||
// console.log(555, res) |
||||
// // 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。 |
||||
// that.$util.isDoc(url.substring(url.lastIndexOf('.') +1)) && uni.openDocument({ |
||||
// filePath: res.savedFilePath, |
||||
// showMenu: true, // 允许出现分享功能 |
||||
// success: res => { |
||||
// uni.hideLoading() |
||||
// }, |
||||
// fail: openError => { |
||||
// uni.hideLoading() |
||||
// } |
||||
// }) |
||||
// } |
||||
// }) |
||||
// }, |
||||
// fail: function(err) { |
||||
// uni.hideLoading() |
||||
// } |
||||
// }) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.wrap { |
||||
padding: 30rpx; |
||||
background-color: #fff; |
||||
} |
||||
.title { |
||||
font-size: 34rpx; |
||||
font-weight: 600; |
||||
color: #333; |
||||
} |
||||
.text { |
||||
margin: 20rpx 0; |
||||
font-size: 28rpx; |
||||
line-height: 1.6; |
||||
} |
||||
.file { |
||||
margin: 20rpx 0; |
||||
font-size: 26rpx; |
||||
word-break: break-all; |
||||
} |
||||
.detail { |
||||
font-size: 30rpx; |
||||
color: #1f83ff; |
||||
} |
||||
</style> |
@ -1,95 +0,0 @@ |
||||
<template> |
||||
<view class="container"> |
||||
<uni-card :is-shadow="false" :border="false" padding="0" is-full> |
||||
<view class="form"> |
||||
<view class="line"> |
||||
<uni-data-checkbox v-model="myVal" :localdata="checkList" @change="myChange"></uni-data-checkbox> |
||||
<text>我的邮箱</text> |
||||
<uni-easyinput v-model="email" disabled /> |
||||
<view class="bind" @click="$util.to('../email/email')">绑定</view> |
||||
</view> |
||||
<view class="line"> |
||||
<uni-data-checkbox v-model="otherVal" :localdata="checkList" @change="otherChange"></uni-data-checkbox> |
||||
<text>其他邮箱</text> |
||||
<uni-easyinput v-model="otherEmail" placeholder="请输入其他邮箱" /> |
||||
</view> |
||||
<button type="primary" @click="submit">确认</button> |
||||
</view> |
||||
</uni-card> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mailFileSend } from '@/apis/modules/parner.js' |
||||
import { my } from '@/apis/modules/parner.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
email: '', |
||||
otherEmail: '', |
||||
myVal: 1, |
||||
otherVal: '', |
||||
checkList: [{ |
||||
text: '', |
||||
value: 1 |
||||
}], |
||||
} |
||||
}, |
||||
onShow() { |
||||
this.getInfo() |
||||
}, |
||||
methods: { |
||||
// 获取个人信息 |
||||
getInfo() { |
||||
const team = uni.getStorageSync('team') |
||||
my({ |
||||
partnerId: team.partnerId, |
||||
teamId: team.teamId |
||||
}).then(({ my }) => { |
||||
this.email = my.info.email |
||||
}).catch(e => {}) |
||||
}, |
||||
myChange(e) { |
||||
this.otherVal = '' |
||||
}, |
||||
otherChange(e) { |
||||
this.myVal = '' |
||||
}, |
||||
// 提交 |
||||
submit() { |
||||
const { otherEmail } = this |
||||
if (this.myVal && !this.email) return this.$util.errMsg('请选择其他邮箱!') |
||||
if (this.otherVal && !otherEmail) return this.$util.errMsg('请输入邮箱!') |
||||
const data = uni.getStorageSync('files') |
||||
data.mail = this.myVal ? this.email : otherEmail |
||||
mailFileSend(data).then(res => { |
||||
this.$util.sucMsg('发送成功!') |
||||
setTimeout(() => { |
||||
uni.navigateBack() |
||||
}, 1000) |
||||
}).catch(e => {}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.form { |
||||
padding: 15px; |
||||
background-color: #fff; |
||||
} |
||||
.line { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-bottom: 15px; |
||||
text { |
||||
margin: 0 10px 0 -20px; |
||||
} |
||||
} |
||||
.bind { |
||||
margin-left: 20rpx; |
||||
font-size: 26rpx; |
||||
color: #1f83ff; |
||||
white-space: nowrap; |
||||
} |
||||
</style> |
@ -1,289 +0,0 @@ |
||||
<template> |
||||
<view> |
||||
<view class="search-wrap"> |
||||
<image class="bg" src="@/static/image/study-bg.jpg"></image> |
||||
<view class="info"> |
||||
<view class="text">销售必备技能</view> |
||||
<uni-search-bar class="search" radius="30" placeholder="请输入文章名称,标签" v-model="keyword" clearButton="auto" cancelButton="none" bgColor="#fff" /> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="type"> |
||||
<view v-for="(item, i) in classifications.slice(0, 4)" :key="i" :class="['item', {active: active == item.id}]" @click="classificationClick(item, 1)">{{ item.classificationName }}</view> |
||||
<uni-icons class="icon" custom-prefix="iconfont" type="icon-filter" size="22" color="#007eff" @click="typeVisible = true"></uni-icons> |
||||
</view> |
||||
|
||||
<template v-if="list.length"> |
||||
<view class="list"> |
||||
<view v-for="(item, i) in list" :key="i" class="item" @click="toDetail(item)"> |
||||
<image class="pic" :src="item.bannerImg"></image> |
||||
<view class="right"> |
||||
<view class="title ell">{{ item.title }}</view> |
||||
<view v-if="item.labelName" class="labels"> |
||||
<view v-for="(label, j) in item.labelName.split(',').slice(0, 2)" :key="j" class="label">{{ label }}</view> |
||||
</view> |
||||
<view class="metas"> |
||||
<view class="meta"> |
||||
<uni-icons class="icon" type="eye" size="22" color="#007FFF"></uni-icons> |
||||
{{ item.learnerNumber }}人学过 |
||||
</view> |
||||
<view class="meta" @click.stop="collect(item)"> |
||||
<uni-icons class="icon" :type="item.collectionStatus ? 'star-filled' : 'star'" size="22" color="#007eff"></uni-icons> |
||||
{{ item.collectionNumber }} |
||||
</view> |
||||
</view> |
||||
<view v-if="item.lastReading" class="last">上次阅读</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<uni-load-more :status="status" /> |
||||
</template> |
||||
<empty v-else></empty> |
||||
|
||||
<view :class="['type-popup', {active: typeVisible}]"> |
||||
<uni-icons class="close" type="closeempty" size="20" color="#757575" @click="closeType"></uni-icons> |
||||
<view class="title">所属分类</view> |
||||
<view class="types"> |
||||
<view v-for="(item, i) in classifications" :key="i" :class="['item', {active: active == item.id}]" @click="classificationClick(item)">{{ item.classificationName }}</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { partnerOperatingList, queryClassificationByType, collectCourse } from '@/apis/modules/article.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
classifications: [], |
||||
active: '', |
||||
typeVisible: false, |
||||
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
||||
status: 'more', // 上拉加载状态 more|loading|noMore |
||||
searchTimer: null, |
||||
articleNameSort: '', |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
} |
||||
}, |
||||
watch: { |
||||
keyword () { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initList() |
||||
}, 500) |
||||
} |
||||
}, |
||||
// 下拉刷新 |
||||
onPullDownRefresh() { |
||||
this.initList() |
||||
setTimeout(() => { |
||||
uni.stopPullDownRefresh() |
||||
}, 1500) |
||||
}, |
||||
// 上拉加载 |
||||
onReachBottom() { |
||||
if (this.reachBottom >= 0) { |
||||
this.reachBottom = 1 |
||||
this.status = 'loading' |
||||
this.getList() |
||||
} |
||||
}, |
||||
onShow() { |
||||
this.keyword = '' |
||||
this.active = '' |
||||
this.typeVisible = false |
||||
this.initRole() |
||||
}, |
||||
methods: { |
||||
// 初始化权限 |
||||
initRole() { |
||||
if (!uni.getStorageSync('auth').includes('学习')) { |
||||
this.per = false |
||||
} |
||||
this.initList() |
||||
this.getClassification() |
||||
}, |
||||
getList() { |
||||
const data = { |
||||
keyWord: this.keyword, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 4, |
||||
typeId: 1, |
||||
articleNameSort: this.articleNameSort, |
||||
classificationId: this.active |
||||
} |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
partnerOperatingList(data).then(({ page, total }) => { |
||||
uni.hideLoading() |
||||
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值 |
||||
const list = page |
||||
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list |
||||
this.page++ // 每次获取了数据后page+1 |
||||
const noMore = this.list.length === total // 是否加载完所有数据 |
||||
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore |
||||
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1 |
||||
}).catch(e => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
initList() { |
||||
this.page = 1 |
||||
this.reachBottom = 0 |
||||
this.getList() |
||||
}, |
||||
// 获取所属分类 |
||||
getClassification() { |
||||
queryClassificationByType(1).then(({ data }) => { |
||||
this.classifications = [ |
||||
{ |
||||
id: '', |
||||
classificationName: '不限' |
||||
} |
||||
] |
||||
this.classifications.push(...data) |
||||
}).catch(e => {}) |
||||
}, |
||||
// 所属分类点击回调 |
||||
classificationClick(item, query) { |
||||
this.active = item.id |
||||
query && this.initList() |
||||
}, |
||||
// 关闭所属分类弹框 |
||||
closeType() { |
||||
this.typeVisible = false |
||||
this.initList() |
||||
}, |
||||
// 展开 |
||||
toggle(item) { |
||||
item.toggle = !item.toggle |
||||
}, |
||||
// 排序 |
||||
switchSort() { |
||||
this.articleNameSort = this.articleNameSort === 'desc' ? 'asc' : 'desc' |
||||
this.initList() |
||||
}, |
||||
// 收藏 |
||||
collect(item) { |
||||
const state = item.collectionStatus ? 0 : 1 |
||||
collectCourse(item.id, state).then(({ data }) => { |
||||
item.collectionStatus = state |
||||
state ? ++item.collectionNumber : --item.collectionNumber |
||||
}).catch(e => {}) |
||||
}, |
||||
// 跳转详情 |
||||
toDetail(item) { |
||||
this.$util.to(`/team/article/article?id=` + item.id) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.search-wrap { |
||||
position: relative; |
||||
height: 300rpx; |
||||
padding: 120rpx 10px 0; |
||||
.bg { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.info { |
||||
position: relative; |
||||
} |
||||
.text { |
||||
margin: 0 10px 10rpx; |
||||
font-size: 50rpx; |
||||
color: #fff; |
||||
} |
||||
} |
||||
.type { |
||||
position: relative; |
||||
display: flex; |
||||
padding: 30rpx; |
||||
background-color: #fff; |
||||
.item { |
||||
padding: 0 15rpx; |
||||
line-height: 1.6; |
||||
font-size: 28rpx; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
&.active { |
||||
color: #007FFF; |
||||
font-weight: 600; |
||||
} |
||||
} |
||||
.icon { |
||||
position: absolute; |
||||
right: 40rpx; |
||||
width: 40rpx; |
||||
} |
||||
} |
||||
.list { |
||||
background-color: #fff; |
||||
.item { |
||||
position: relative; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
margin-bottom: 10rpx; |
||||
padding: 20rpx 40rpx; |
||||
border-bottom: 1px solid #f1f1f1; |
||||
} |
||||
.pic { |
||||
width: 260rpx; |
||||
height: 180rpx; |
||||
border-radius: 8px; |
||||
} |
||||
.right { |
||||
width: calc(100% - 280rpx); |
||||
} |
||||
.title { |
||||
margin-bottom: 15rpx; |
||||
font-size: 32rpx; |
||||
font-weight: 600; |
||||
color: #333; |
||||
} |
||||
.labels { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
align-items: center; |
||||
} |
||||
.label { |
||||
padding: 2px 6px; |
||||
margin: 0 20rpx 15rpx 0; |
||||
font-size: 24rpx; |
||||
color: #fff; |
||||
background-color: #ccc; |
||||
border-radius: 4px; |
||||
} |
||||
.metas { |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.meta { |
||||
display: inline-flex; |
||||
align-items: center; |
||||
margin-right: 20rpx; |
||||
font-size: 24rpx; |
||||
} |
||||
.icon { |
||||
margin-right: 5rpx; |
||||
} |
||||
.last { |
||||
position: absolute; |
||||
bottom: 20rpx; |
||||
right: 40rpx; |
||||
font-size: 28rpx; |
||||
color: #007FFF; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue