功能完成
This commit is contained in:
parent
0cdad3e244
commit
cfc0150419
3
App.vue
3
App.vue
|
|
@ -20,6 +20,9 @@
|
|||
globalData: {
|
||||
webApi: 'https://apijy.leapy.cn/',
|
||||
imgUrl: 'https://resource.leapy.cn/',
|
||||
// 机构
|
||||
org_id: '1',
|
||||
secretKey: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtdxd5D6SahDExxEPsEvHkT5RShkay2xAYdqNGuQnLHcf8yJqPkwylyz8mrGUqrhahC/rbkzUk/liT0omMkmKWkm+cNSyVxqv4YvQ5446LAbqsbaZqxtbsJbtcL4tUZospwnwZynwQnNIO8hmeF3EOuuX7WzaxwS7Ugf8acn9Tez8GCijhtipqySr9Q5SLd9F7HV8EXohpfNDR5uAEL7hgJWe1tGi91eScSt9IEMS2CWEZzCi6WilfyQ8cSFjlBL9MC/LAnlm48b+MS2KBIVDtA2PodGWQMWn8UzXrob6Du2gjlBIWUr5Hu5/kx1IhVYZCctHHBK+fSqftTdJMsRQRwIDAQAB'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
54
api/login.js
54
api/login.js
|
|
@ -1,5 +1,7 @@
|
|||
import { apiResquest } from '@/utils/lib/request.js'
|
||||
|
||||
|
||||
// 登录
|
||||
export const login = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/user.login',
|
||||
|
|
@ -7,7 +9,7 @@ export const login = (query) => {
|
|||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
// 注册
|
||||
export const register = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/user.register',
|
||||
|
|
@ -16,3 +18,53 @@ export const register = (query) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export const userInfo = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/user.info',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 用户信息v2
|
||||
export const preInfo = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/pre.info',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户信息v2
|
||||
export const infoEdit = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/info.edit',
|
||||
method: 'post',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 资源详情接口
|
||||
export const fileGet = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/file.get',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
// 地址
|
||||
export const regionList = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/region.list',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
import {
|
||||
apiResquest
|
||||
} from '@/utils/lib/request.js'
|
||||
|
||||
|
||||
// 是否填写
|
||||
export const trainHas = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/train.has',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const trainSubmit = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/train.submit',
|
||||
method: 'post',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 分组列表(无需登录)
|
||||
export const groupList = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/group.list',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
// 资源列表(无需登录)
|
||||
export const assetList = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/asset.list',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
// 资源详情接口
|
||||
export const assetInfo = (query) => {
|
||||
return apiResquest({
|
||||
url: 'v1/asset.info',
|
||||
method: 'get',
|
||||
query: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,39 @@
|
|||
### liu-choose-address适用于uni-app项目的多级选择组件
|
||||
### 本组件目前兼容微信小程序、H5
|
||||
### 本组件支持省市区选择、多级选择、自定义选择级数、自定义选择项、通过接口异步加载选择项
|
||||
|
||||
### 使用方式
|
||||
``` html
|
||||
<button @click="openAddress">打开地址选择器</button>
|
||||
<liuChooseAddress ref="scroll" @change='chooseSuccess'></liuChooseAddress>
|
||||
```
|
||||
``` javascript
|
||||
import liuChooseAddress from '@/components/liu-choose-address/liu-choose-address.vue' //地址选择器
|
||||
export default {
|
||||
components: {liuChooseAddress},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//打开地址选择器
|
||||
openAddress() {
|
||||
this.$refs.scroll.open()
|
||||
},
|
||||
//地址选择成功
|
||||
chooseSuccess(e) {
|
||||
console.log('所选择的地址信息:', e)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 属性说明
|
||||
| 名称 | 类型 | 默认值 | 描述 |
|
||||
| ----------------------------|--------------- | ---------------------- | ---------------|
|
||||
| animation | Boolean | true | 是否开启动画
|
||||
| safeArea | Boolean | true | 是否开启安全条
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 弹出层 -->
|
||||
<view :class="['scroll-popup', isShow ? 'scroll-open' : '', animation ? 'scroll-animation' : '']">
|
||||
<view class="scroll-box">
|
||||
<view class="scroll-top">
|
||||
<view class="scroll-top-left" @click="getResult('cancel')">取消</view>
|
||||
<view class="scroll-top-right" v-if="checkArr.length == tabList.length"
|
||||
@click="getResult('confirm')">确定</view>
|
||||
</view>
|
||||
<scroll-view class="scroll-title" scroll-x="true" :scroll-left="scrollViewWidth" scroll-with-animation>
|
||||
<view class="scroll-title-item-box" v-for="(i, e) in tabList" @click="checkTab(e)" :key="e">
|
||||
<view v-if="tabId >= e" :id="'se-' + e"
|
||||
:class="['scroll-title-item', tabId == e ? ' scroll-title-item-true' : '']">
|
||||
{{ checkArr[e] ? checkArr[e].label : i.title }}
|
||||
<image class="span" :src='nextImg' v-if="tabId > e"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view class="scroll-view_H" scroll-y="true">
|
||||
<view class="scroll-view-grid-box" v-if="checkBox && checkBox.length && checkBox[tabId].length">
|
||||
<view v-for="(item, index) in checkBox[tabId]" :key="index" @click="check(index)"
|
||||
:class="checkArr && checkArr[tabId] && checkArr[tabId].label == item.label ? 'scroll-view-item-true' : 'scroll-view-item'">
|
||||
{{ item.label || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll-view-noBox" v-else>
|
||||
<image :src="noDataImg"></image>
|
||||
<view class="text">暂无数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-show="safeArea" class="scroll-temp"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 遮罩层 -->
|
||||
<view v-show="isShow" class="scroll-mask"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import noData from './noData.png'
|
||||
import next from './next.png'
|
||||
import cityList from './city.js'; //模拟数据
|
||||
export default {
|
||||
props: {
|
||||
//是否开启动画
|
||||
animation: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
//是否开启安全条
|
||||
safeArea: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
checkBox: [],
|
||||
noDataImg: '',
|
||||
nextImg: '',
|
||||
tabId: 0, //计算当前顶部滑块id
|
||||
checkArr: [],
|
||||
id: 0, //通tabId,他们2的区别是,id先赋值,tabId在数据请求成功后才会赋值
|
||||
tabList: [{
|
||||
title: '选择所在省',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
title: '选择所在市',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
title: '选择所在区县',
|
||||
id: 2
|
||||
}
|
||||
],
|
||||
scrollViewWidth: 0,
|
||||
elWidth: 0,
|
||||
cityList: cityList,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.nextImg = next
|
||||
this.noDataImg = noData
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.isShow = true;
|
||||
this.init();
|
||||
},
|
||||
close() {
|
||||
this.isShow = false;
|
||||
},
|
||||
init() {
|
||||
// 初始化数据
|
||||
this.id = 0;
|
||||
this.tabId = 0;
|
||||
this.checkBox = [];
|
||||
this.checkArr = [];
|
||||
//初始化求出滚动的宽度
|
||||
this.createSelectorQuery().select('.scroll-title').boundingClientRect(rect => {
|
||||
this.scrollViewWidth = Math.round(rect.width);
|
||||
}).exec();
|
||||
this.getData();
|
||||
},
|
||||
async check(index) {
|
||||
this.$set(this.checkArr, this.id, this.checkBox[this.id][index]);
|
||||
if (this.id < this.tabList.length - 1) this.id = this.id + 1;
|
||||
await this.getData(); //同步请求
|
||||
//获取点击元素的宽度求出元素一半的宽度
|
||||
this.createSelectorQuery().select('#se-' + this.tabId).boundingClientRect(rect => {
|
||||
this.elWidth = Math.round(rect.width);
|
||||
}).exec();
|
||||
//定时器别删,不然最后一步有Bug
|
||||
setTimeout(() => {
|
||||
this.scrollViewWidth = this.scrollViewWidth + this.elWidth;
|
||||
});
|
||||
if (this.tabId < this.tabList.length - 1) this.tabId = this.tabId + 1;
|
||||
},
|
||||
checkTab(e) {
|
||||
if (e == this.id) return;
|
||||
this.id = e;
|
||||
this.tabId = e;
|
||||
this.checkArr = this.checkArr.splice(0, e);
|
||||
},
|
||||
getResult(event) {
|
||||
if (event == 'confirm') {
|
||||
if (this.checkArr.length != this.tabList.length) return;
|
||||
let result = this.checkArr;
|
||||
this.$emit('change', {
|
||||
value: result
|
||||
})
|
||||
}
|
||||
this.close();
|
||||
},
|
||||
//使用本地假数据进行加载
|
||||
async getData() {
|
||||
if (this.checkArr.length == this.tabList.length) return;
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
//模拟数据实例-------------------------
|
||||
let list = [];
|
||||
if (this.checkArr.length) {
|
||||
setTimeout(() => {
|
||||
var id = this.checkArr[this.id - 1].value
|
||||
let idList = this.checkBox[this.id - 1].find(item => {
|
||||
return item.value == id;
|
||||
})
|
||||
idList.children.map(e => {
|
||||
list.push(e);
|
||||
});
|
||||
uni.hideLoading();
|
||||
this.$set(this.checkBox, this.id, list), 500;
|
||||
});
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.cityList.map(e => {
|
||||
list.push(e);
|
||||
});
|
||||
uni.hideLoading();
|
||||
this.$set(this.checkBox, this.id, list), 500;
|
||||
});
|
||||
}
|
||||
//接口请求数据实例--------------
|
||||
// let params = {
|
||||
// code: this.checkArr && this.checkArr.length > 0 ? this.checkArr[this.checkArr.length - 1]
|
||||
// .code : ''
|
||||
// };
|
||||
// await getData(params).then(res => {
|
||||
// if (res.code == 200) {
|
||||
// this.$set(this.checkBox, this.id, res.data);
|
||||
// } else {
|
||||
// this.$set(this.checkBox, this.id, []);
|
||||
// }
|
||||
// uni.hideLoading()
|
||||
// })
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 弹出层默认样式 */
|
||||
.scroll-popup {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
bottom: -100%;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
/* 点击按钮是将盒子 bottom 值归零即可实现弹出效果,
|
||||
同理,如需更改弹出方向只需将bottom改成top、left、right即可
|
||||
(默认样式的方向也需一起更改哦) */
|
||||
.scroll-open {
|
||||
bottom: 0px !important;
|
||||
}
|
||||
|
||||
.scroll-animation {
|
||||
transition: all 0.25s linear;
|
||||
}
|
||||
|
||||
/* 遮罩层样式 */
|
||||
.scroll-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
z-index: 998;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: #ffff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding-bottom: 60rpx;
|
||||
height: 700rpx;
|
||||
}
|
||||
|
||||
.scroll-temp {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.scroll-top {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
|
||||
.scroll-top-left {
|
||||
float: left;
|
||||
padding-left: 24rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.scroll-top-right {
|
||||
float: right;
|
||||
padding-right: 24rpx;
|
||||
color: #1890ff;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.scroll-title {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.scroll-view_H {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
line-height: 500rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.scroll-title-item {
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
position: absolute !important;
|
||||
right: -48rpx !important;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
width: 28rpx !important;
|
||||
height: 28rpx !important;
|
||||
margin: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-title-item-box {
|
||||
display: inline-block;
|
||||
margin: 0 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.scroll-title-item-true {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #1890ff;
|
||||
}
|
||||
|
||||
.scroll-view-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin: 16rpx;
|
||||
}
|
||||
|
||||
.scroll-view-grid-box {
|
||||
width: calc(100% - 20rpx);
|
||||
margin: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.scroll-view-noBox {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #888;
|
||||
font-size: 28rpx;
|
||||
margin-top: -40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-view-item {
|
||||
padding: 0rpx 24rpx;
|
||||
text-align: left;
|
||||
border-radius: 6rpx;
|
||||
background: #f7f7f7;
|
||||
color: #333333;
|
||||
font-size: 28rpx;
|
||||
margin: 12rpx 4rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scroll-view-item-true {
|
||||
padding: 0rpx 24rpx;
|
||||
text-align: left;
|
||||
border-radius: 6rpx;
|
||||
background-color: #1890ff;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
margin: 12rpx 4rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
|
|
@ -121,7 +121,7 @@
|
|||
position: relative;
|
||||
width: 750rpx;
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
/* min-height: 100vh; */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
{
|
||||
"name": "share-bbs",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"uview-ui": "^1.8.4"
|
||||
}
|
||||
},
|
||||
"node_modules/uview-ui": {
|
||||
"version": "1.8.4",
|
||||
"resolved": "https://registry.nlark.com/uview-ui/download/uview-ui-1.8.4.tgz",
|
||||
"integrity": "sha1-4yu/I3lCHTGQIuMk4ct7U4fTvUQ="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"uview-ui": {
|
||||
"version": "1.8.4",
|
||||
"resolved": "https://registry.nlark.com/uview-ui/download/uview-ui-1.8.4.tgz",
|
||||
"integrity": "sha1-4yu/I3lCHTGQIuMk4ct7U4fTvUQ="
|
||||
}
|
||||
}
|
||||
"name": "Retired",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"jsencrypt": "^3.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/jsencrypt": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
|
||||
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"jsencrypt": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
|
||||
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
{
|
||||
"dependencies": {}
|
||||
}
|
||||
"dependencies": {
|
||||
"jsencrypt": "^3.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
61
pages.json
61
pages.json
|
|
@ -6,6 +6,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"navigationBarTextStyle": "white"
|
||||
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
|
|
@ -149,10 +150,37 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{ // 新鲜事
|
||||
"path": "pages/news/document",
|
||||
"style": {
|
||||
"navigationBarTitleText": "文档",
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{ // 新鲜事/话题/分类
|
||||
"path": "pages/news/news-topic-cate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分类",
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{ // 新鲜事/话题/分类
|
||||
"path": "pages/home/train",
|
||||
"style": {
|
||||
"navigationBarTitleText": "技能培训意向",
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{ // 新鲜事/话题/分类
|
||||
"path": "pages/mine/history",
|
||||
"style": {
|
||||
"navigationBarTitleText": "历史记录",
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
|
|
@ -328,7 +356,7 @@
|
|||
}, { // 我的/设置/绑定邮箱
|
||||
"path": "pages/mine/edit-info",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改资料"
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}, { // 我的/设置/意见反馈
|
||||
"path": "pages/mine/feedback",
|
||||
|
|
@ -386,20 +414,21 @@
|
|||
"text": "首页",
|
||||
"iconPath": "/static/img/tabbar/home.png",
|
||||
"selectedIconPath": "/static/img/tabbar/home-ed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/news/news",
|
||||
"text": "课程",
|
||||
"iconPath": "/static/img/tabbar/news.png",
|
||||
"selectedIconPath": "/static/img/tabbar/news-ed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/paper/paper",
|
||||
"text": "技能",
|
||||
"iconPath": "/static/img/tabbar/paper.png",
|
||||
"selectedIconPath": "/static/img/tabbar/paper-ed.png"
|
||||
},
|
||||
{
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// "pagePath": "pages/news/news",
|
||||
// "text": "课程",
|
||||
// "iconPath": "/static/img/tabbar/news.png",
|
||||
// "selectedIconPath": "/static/img/tabbar/news-ed.png"
|
||||
// },
|
||||
// {
|
||||
// "pagePath": "pages/paper/paper",
|
||||
// "text": "技能",
|
||||
// "iconPath": "/static/img/tabbar/paper.png",
|
||||
// "selectedIconPath": "/static/img/tabbar/paper-ed.png"
|
||||
// }
|
||||
, {
|
||||
"pagePath": "pages/mine/mine",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/img/tabbar/mine.png",
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<view class="flex flex-row justify-between items-center">
|
||||
<!-- 头像 -->
|
||||
<view class="flex flex-row justify-center items-center">
|
||||
<image class="img-header mr-10" :src="info.userPic" mode="widthFix" lazy-load
|
||||
@click.stop="$u.route('/pages/mine/user-space')"></image>
|
||||
<view class="flex justify-center items-center text-gray-500 text-30">{{item.username}}
|
||||
<image class="img-header mr-10" src="../../../static/img/demo/logo.jpg" mode="widthFix" lazy-load>
|
||||
</image>
|
||||
<view class="flex justify-start items-center text-gray-500 text-30" style="width: 400rpx;">{{item.asset_name}}
|
||||
<!-- <view class="iconfont iconxingbie-nan tag-age"
|
||||
:class="[item.sex == 0 ? 'iconxingbie-nan' :'iconxingbie-nv girl']">
|
||||
<text class="ml-10">{{item.age}}</text>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<text class="iconfont iconjia mr-10 text-24"></text>关注
|
||||
</view>
|
||||
</template> -->
|
||||
2024-06-24
|
||||
{{item.create_time?item.create_time.split(' ')[0]:''}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
|
|
|
|||
|
|
@ -6,157 +6,46 @@
|
|||
<!-- 详细信息 -->
|
||||
<info-list :item="info" isDetail @mark="handleMark" @comment="handleComment" @share="handleShare"
|
||||
@follow="handleFollow">
|
||||
<view class="text-30 my-20 text-gray-600">{{info.content}}</view>
|
||||
<view>
|
||||
<image class="w-full" v-for="(item,index) in info.images" :key="index" :src="item" mode="aspectFill"
|
||||
@click="handlePreview(index)"></image>
|
||||
<view class="text-30 my-20 text-gray-600">
|
||||
<u-parse :content="info.content"></u-parse>
|
||||
</view>
|
||||
</info-list>
|
||||
<!-- <u-gap height="20" bgColor="#F9FAFB"></u-gap>
|
||||
<view class="p-20 text-30 font-bold">
|
||||
最新评论<text class="ml-10">3</text>
|
||||
</view> -->
|
||||
<!-- 评论列表 -->
|
||||
<!-- <view class="comment">
|
||||
<image class="rounded-full mr-20" src="../../static/img/header/a.svg" mode="aspectFill"
|
||||
style="width: 100rpx;height: 100rpx;"></image>
|
||||
<view class="flex-1 flex flex-col">
|
||||
<view class="text-28 font-bold text-blue">
|
||||
Jay
|
||||
</view>
|
||||
<view class="comment-text text-26 line-1 my-10">
|
||||
天青色等烟雨,而我在等你。
|
||||
</view>
|
||||
<view class="comment-replay text-blue flex items-center">
|
||||
2条回复<text class="iconfont iconqianjin"></text>
|
||||
</view>
|
||||
<view class="flex justify-between text-24 my-10">
|
||||
<view class="text-gray-500">
|
||||
2022-10-09 10:08
|
||||
</view>
|
||||
<view class="text-blue">
|
||||
回复
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 分享功能 -->
|
||||
<popup-share :show.sync="showShare"></popup-share>
|
||||
<!-- 底部操作栏 -->
|
||||
<!-- <view class="bottom-input">
|
||||
</view>
|
||||
<bottom-input v-if="showComment" @submit="submit"></bottom-input> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
detailInfo
|
||||
} from "@/utils/data/data.js"
|
||||
import InfoList from "@/pages/home/cpns/info-list.vue"
|
||||
import {
|
||||
assetInfo
|
||||
} from '@/api/train.js'
|
||||
export default {
|
||||
components: {
|
||||
InfoList,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showComment: false, // 评论
|
||||
showShare: false, // 分享
|
||||
info: {},
|
||||
assets_id: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e);
|
||||
e.data && this.init(JSON.parse(e.data))
|
||||
},
|
||||
// 监听原生标题栏按钮点击事件
|
||||
onNavigationBarButtonTap(e) {
|
||||
switch (e.index) {
|
||||
case 0:
|
||||
// 分享
|
||||
this.showShare = true
|
||||
break;
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
this.showShare = false
|
||||
},
|
||||
// 监听:小程序中用户点击分享
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: this.info.title,
|
||||
path: '/pages/home/detail?data=' + JSON.stringify(this.info)
|
||||
}
|
||||
this.assets_id = e.assets_id
|
||||
this.getAssetInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init(data) {
|
||||
// 增加字段
|
||||
const result = {
|
||||
content: detailInfo,
|
||||
images: [
|
||||
'/static/img/list/01.jpg', '/static/img/list/01.jpg', '/static/img/list/01.jpg'
|
||||
]
|
||||
}
|
||||
this.info = {
|
||||
...data,
|
||||
...result
|
||||
}
|
||||
uni.setNavigationBarTitle({
|
||||
title: data.title
|
||||
getAssetInfo() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
},
|
||||
// 表情
|
||||
handleMark(item) {
|
||||
switch (item.value) {
|
||||
case 'smile':
|
||||
if (this.info.infoNum.index == 1) return // 微笑
|
||||
else if (this.info.infoNum.index == 2) this.info.infoNum.cryNum--
|
||||
this.info.infoNum.index = 1
|
||||
this.info.infoNum.smileNum++
|
||||
break;
|
||||
case 'cry':
|
||||
if (this.info.infoNum.index == 2) return // 踩
|
||||
else if (this.info.infoNum.index == 1) this.info.infoNum.smileNum--
|
||||
this.info.infoNum.index = 2
|
||||
this.info.infoNum.cryNum++
|
||||
break
|
||||
}
|
||||
const title = item.value === 'smile' ? '谢谢表扬' : '继续加油'
|
||||
uni.showToast({
|
||||
title,
|
||||
icon: 'none',
|
||||
assetInfo({
|
||||
id: this.assets_id
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
this.info = res.data
|
||||
})
|
||||
},
|
||||
// 评论
|
||||
handleComment() {
|
||||
this.showComment = true
|
||||
},
|
||||
// 分享
|
||||
handleShare() {
|
||||
this.showShare = true
|
||||
},
|
||||
// 关注
|
||||
handleFollow(item) {
|
||||
this.info.isFollow = item.value
|
||||
const title = item.value ? '关注成功' : '取消成功'
|
||||
uni.showToast({
|
||||
title,
|
||||
icon: 'none',
|
||||
})
|
||||
},
|
||||
// 预览
|
||||
handlePreview(current) {
|
||||
uni.previewImage({
|
||||
urls: this.info.images,
|
||||
current
|
||||
})
|
||||
},
|
||||
// 提交评论
|
||||
submit(data) {
|
||||
this.showComment = false
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,105 +1,234 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-sticky>
|
||||
<u-swiper :list="topicList.swiper" keyName="image" circular height="470rpx" bgColor="#ffffff"></u-swiper>
|
||||
<view class="search-input">
|
||||
<u-search searchIconColor='#e6e6e6' placeholderColor='#e6e6e6' color='#FFFFFF' placeholder="搜索招聘/课程/技能"
|
||||
v-model="keyword" :showAction="false"></u-search>
|
||||
</view>
|
||||
<view class="tabs-list">
|
||||
<view class="left">
|
||||
<view class="item" @click="btntabs(index)" v-for="(item,index) in tabsList" :key="index">
|
||||
<image class="images" :src="currect==index?item.imgSelect:item.img" mode=""></image>
|
||||
<text :style="{color:currect==index?'#006EEF':'#707070'}" class="text1">{{item.title}}</text>
|
||||
<view style="position: relative;">
|
||||
<u-swiper :list="swiper" keyName="image" circular height="470rpx" bgColor="#ffffff"></u-swiper>
|
||||
<view class="search-input">
|
||||
<view style="width: 90%;margin: 0 auto;">
|
||||
<u-search @search='search' searchIconColor='#e6e6e6' placeholderColor='#e6e6e6' color='#FFFFFF'
|
||||
placeholder="搜索招聘/课程/技能" v-model="queryParams.asset_name" :showAction="false"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<image class="images1" src="../../static/img/demo/gengduo.png" mode=""></image>
|
||||
<view class="tabs-list">
|
||||
<view class="list">
|
||||
<view class="left">
|
||||
<view class="item" @click="btntabs(item)" v-for="(item,index) in tabsList" :key="index">
|
||||
<image class="images" :src="queryParams.type==item.type?item.imgSelect:item.img"
|
||||
mode=""></image>
|
||||
<text :style="{color:queryParams.type==item.type?'#006EEF':'#707070'}"
|
||||
class="text1">{{item.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="btnMore" class="right">
|
||||
<image class="images1" src="../../static/img/demo/gengduo.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<view class="last-update">
|
||||
<topic-list v-if='index<=5' :item="item" v-for="(item,index) in topicList.list" :key="index"></topic-list>
|
||||
<view v-if="assetList.length>0" class="last-update">
|
||||
<topic-list @click.native="goTopicDetail(item)" :item="item" v-for="(item,index) in assetList"
|
||||
:key="index"></topic-list>
|
||||
</view>
|
||||
<u-loadmore v-if="assetList.length>0" :status="status" />
|
||||
<view v-if="assetList.length==0" class="default-img">
|
||||
<image style='width: 400rpx;height: 200rpx' src="../../static/img/demo/default-img.png" mode=""></image>
|
||||
<text class="desc">暂无内容,去其他的看看吧</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
newsList,
|
||||
topicList
|
||||
} from "@/utils/data/data.js"
|
||||
import InfoList from "@/pages/home/cpns/info-list.vue"
|
||||
import NewsTopicNav from "@/pages/news/cpns/news-topic-nav.vue"
|
||||
import TopicList from "@/pages/news/cpns/topic-list.vue"
|
||||
import {
|
||||
trainHas,
|
||||
assetList,
|
||||
assetInfo
|
||||
} from '@/api/train.js'
|
||||
import {
|
||||
userInfo
|
||||
} from '@/api/login.js'
|
||||
export default {
|
||||
components: {
|
||||
InfoList,
|
||||
NewsTopicNav,
|
||||
TopicList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
currect: 0,
|
||||
|
||||
// 导航标签
|
||||
tabIndex: 1,
|
||||
tabList: [{
|
||||
name: "关注",
|
||||
id: 'follow'
|
||||
},
|
||||
queryParams: {
|
||||
asset_name: "",
|
||||
org_id: getApp().globalData.org_id,
|
||||
type: 1,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
swiper: [ // 轮播图
|
||||
{
|
||||
name: "话题",
|
||||
id: 'topic'
|
||||
image: '/static/img/demo/winter1.jpeg',
|
||||
}
|
||||
],
|
||||
swiperHeight: 0,
|
||||
// 关注列表
|
||||
followList: {
|
||||
// 加载更多
|
||||
loadStatus: 'loadmore',
|
||||
// 列表数据
|
||||
list: newsList[0].list
|
||||
},
|
||||
// 话题列表
|
||||
topicList: {
|
||||
swiper: [ // 轮播图
|
||||
{
|
||||
image: '/static/img/demo/winter1.jpeg',
|
||||
}
|
||||
],
|
||||
assetList: [],
|
||||
|
||||
list: topicList[1].list
|
||||
},
|
||||
tabsList: [{
|
||||
img: '/static/img/demo/zhaopin.png',
|
||||
imgSelect: '/static/img/demo/zhaopin-select.png',
|
||||
title: '招聘',
|
||||
type: 1
|
||||
},
|
||||
{
|
||||
img: '/static/img/demo/jineng.png',
|
||||
imgSelect: '/static/img/demo/jineng-select.png',
|
||||
title: '技能',
|
||||
type: 2
|
||||
},
|
||||
{
|
||||
img: '/static/img/demo/kecheng.png',
|
||||
imgSelect: '/static/img/demo/kecheng-select.png',
|
||||
title: '课程',
|
||||
type: 3
|
||||
}
|
||||
]
|
||||
],
|
||||
userInfo: {},
|
||||
status: 'loadmore',
|
||||
count: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onReachBottom() {
|
||||
if (this.assetList.length >= that.count) {
|
||||
this.status = 'nomore';
|
||||
return
|
||||
}
|
||||
this.page++
|
||||
this.status = 'loading';
|
||||
this.getList()
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.getUserInfo()
|
||||
this.getList()
|
||||
},
|
||||
onShow() {
|
||||
//查看是否填写意向调查表
|
||||
this.getTrainHas()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
var that = this
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
var res = await assetList(that.queryParams)
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
if (res.data.length < that.queryParams.limit) {
|
||||
that.status = 'nomore'
|
||||
}
|
||||
that.assetList = that.assetList.concat(res.data)
|
||||
that.count = res.count
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.page = 1
|
||||
this.assetList = []
|
||||
this.getList()
|
||||
},
|
||||
getUserInfo() {
|
||||
userInfo().then(res => {
|
||||
this.userInfo = res.data
|
||||
uni.setStorageSync('userInfo', res.data)
|
||||
})
|
||||
},
|
||||
getTrainHas() {
|
||||
trainHas().then(res => {
|
||||
if (!res.data.train) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先选择技能培训意向表',
|
||||
success: function(res) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/train'
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// swiper滑动
|
||||
changeSwiper(e) {
|
||||
this.tabIndex = e.detail.current
|
||||
},
|
||||
btntabs(index) {
|
||||
this.currect = index
|
||||
btntabs(item) {
|
||||
this.queryParams.type = item.type
|
||||
this.page = 1
|
||||
this.assetList = []
|
||||
this.getList()
|
||||
},
|
||||
// 更多
|
||||
btnMore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/news/news-topic-cate?type=' + this.queryParams.type
|
||||
})
|
||||
},
|
||||
getPdfInfo(item) {
|
||||
// pdf文档
|
||||
uni.showLoading({
|
||||
title: '加载文档中..'
|
||||
})
|
||||
assetInfo({
|
||||
id: item.asset_id
|
||||
}).then(res => {
|
||||
uni.downloadFile({
|
||||
url: res.data.pdf_url,
|
||||
success: function(res) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: 'pdf',
|
||||
showMenu: true,
|
||||
success: function(res) {
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
complete: function(r) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
//
|
||||
goTopicDetail(item) {
|
||||
switch (this.queryParams.type) {
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/detail?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
this.getPdfInfo(item)
|
||||
break;
|
||||
case 3:
|
||||
// 课程
|
||||
uni.navigateTo({
|
||||
url: '/pages/news/course?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,72 +240,97 @@
|
|||
}
|
||||
|
||||
.search-input {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
bottom: 270rpx;
|
||||
width: 100%;
|
||||
// position: relative;
|
||||
// bottom: 270rpx;
|
||||
position: absolute;
|
||||
bottom: 200rpx;
|
||||
}
|
||||
|
||||
.tabs-list {
|
||||
// border: solid 1px red;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
bottom: 200rpx;
|
||||
height: 180rpx;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: -70rpx;
|
||||
|
||||
.left {
|
||||
width: 80%;
|
||||
.list {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// border: solid 1px red;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
// position: relative;
|
||||
// bottom: 200rpx;
|
||||
height: 180rpx;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
.left {
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// border: solid 1px red;
|
||||
|
||||
.images {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
.item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.images {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
}
|
||||
|
||||
.text1 {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text1 {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-top: 10rpx;
|
||||
.right {
|
||||
width: 20%;
|
||||
// border:solid 1px blue;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.images1 {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 20%;
|
||||
// border:solid 1px blue;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.images1 {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.last-update {
|
||||
// border: solid 1px red;
|
||||
position: relative;
|
||||
bottom: 200rpx;
|
||||
// position: relative;
|
||||
// bottom: 200rpx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
padding: 70rpx 0 20rpx;
|
||||
|
||||
}
|
||||
|
||||
.default-img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 250rpx;
|
||||
|
||||
.desc {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #595959;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/.u-search__content {
|
||||
background-color: rgba(255, 255, 255, 0.4) !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,186 @@
|
|||
<template>
|
||||
<view class="train">
|
||||
<view class="list-item">
|
||||
<u-radio-group iconPlacement="right" v-model="radiovalue1" placement="column" @change="groupChange">
|
||||
<view class="radio-item" v-for="(item, index) in radiolist1" :key="index">
|
||||
<u-radio :customStyle="{margin:'8px'}" :label="item.name" :name="item.name">
|
||||
</u-radio>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="fixed">
|
||||
<view class="set-button">
|
||||
<button @click="trainSubmit" class="button">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
trainSubmit
|
||||
} from '@/api/train.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 基本案列数据
|
||||
//职业技能培训意向 1.汽车维修工 2.电工 3.车工 4.化工总控工 5.铣工 6.焊工 7.鉴定评估师
|
||||
// 8.工业机器人系统操作员 9.建筑信息模型技术员 10.机动车检测工 11.企业人力资源管理师
|
||||
// 12.计算机程序设计员 13.电子商务师 14.营养师 15.风险管理师 16.健康管理师 17.中式面点师
|
||||
// 18.消防设施操作员
|
||||
radiolist1: [{
|
||||
name: '汽车维修工',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
name: '电工',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
name: '车工',
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
name: '化工总控工',
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
name: '铣工',
|
||||
id: 5
|
||||
},
|
||||
{
|
||||
name: '焊工',
|
||||
id: 6
|
||||
},
|
||||
{
|
||||
name: '鉴定评估师',
|
||||
id: 7
|
||||
},
|
||||
{
|
||||
name: '工业机器人系统操作员',
|
||||
id: 8
|
||||
},
|
||||
{
|
||||
name: '建筑信息模型技术员',
|
||||
id: 9
|
||||
},
|
||||
{
|
||||
name: '机动车检测工',
|
||||
id: 10
|
||||
},
|
||||
{
|
||||
name: '企业人力资源管理师',
|
||||
id: 11
|
||||
},
|
||||
{
|
||||
name: '计算机程序设计员',
|
||||
id: 12
|
||||
},
|
||||
{
|
||||
name: '电子商务师',
|
||||
id: 13
|
||||
},
|
||||
{
|
||||
name: '营养师',
|
||||
id: 14
|
||||
},
|
||||
{
|
||||
name: '风险管理师',
|
||||
id: 15
|
||||
},
|
||||
{
|
||||
name: '健康管理师',
|
||||
id: 16
|
||||
},
|
||||
{
|
||||
name: '中式面点师',
|
||||
id: 17
|
||||
},
|
||||
{
|
||||
name: '消防设施操作员',
|
||||
id: 18
|
||||
}
|
||||
|
||||
],
|
||||
radiovalue1: '',
|
||||
train: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
groupChange(n) {
|
||||
console.log('groupChange', n);
|
||||
this.radiolist1.forEach(item => {
|
||||
if (item.name == n) {
|
||||
this.train = item.id
|
||||
}
|
||||
})
|
||||
console.log(this.train);
|
||||
},
|
||||
async trainSubmit() {
|
||||
var that = this
|
||||
if (!this.train) {
|
||||
uni.showToast({
|
||||
title: '请先选择技能培训意向',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
})
|
||||
try {
|
||||
var res = await trainSubmit({
|
||||
train: that.train
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.list-item {
|
||||
padding: 20rpx 20rpx 200rpx 20rpx;
|
||||
|
||||
.radio-item {
|
||||
border-bottom: solid 1px #F5F5F5;
|
||||
padding: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
height: 180rpx;
|
||||
box-shadow: 0rpx -4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.set-button {
|
||||
padding-top: 30rpx;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
|
||||
.button {
|
||||
background: linear-gradient(to right, #00B7FF, #006EEF);
|
||||
border-radius: 20rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,79 +1,205 @@
|
|||
<template>
|
||||
<!-- 我的/设置/修改资料 -->
|
||||
<view class="edit-info wrap-card">
|
||||
<u-cell-group :border='false'>
|
||||
<u-cell title="头像" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleHeader">
|
||||
<image slot="value" class="header-img" :src="form.avatar" mode="aspectFill"></image>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="昵称" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleName">
|
||||
<view slot="value">
|
||||
{{form.username}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="性别" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleSex">
|
||||
<view slot="value">
|
||||
{{sexList[form.sex]}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="生日" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
|
||||
<view slot="value">
|
||||
<uni-datetime-picker ref="birth" type="date" :clear-icon="false" v-model="form.birth">{{form.birth}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF" @click="handleBirth"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="情感" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleEmotion">
|
||||
<view slot="value">
|
||||
{{emoList[form.emotion]}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="职业" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleJob">
|
||||
<view slot="value">
|
||||
{{jobList[form.job]}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="家乡" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="showCity">
|
||||
<view slot="value">
|
||||
{{form.city}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="30" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
<view class="edit-info">
|
||||
<view style="padding-bottom: 200rpx;">
|
||||
<u-cell-group :border='false'>
|
||||
<u-cell title="姓名" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleName">
|
||||
<view class="input-val" style="width: 400rpx;" slot="value">
|
||||
{{userInfo.name}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="身份证号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleIdcard">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.idcard}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="手机号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleMobile">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.contact_mobile}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="性别" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleSex">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.sex?sexList[userInfo.sex-1]:''}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="生日" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
|
||||
v-model="userInfo.birthday">{{userInfo.birthday}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="学历" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleEmotion">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.degree?educationList[userInfo.degree-1]:''}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="政治面貌" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleJob">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.political?politicalList[userInfo.political-1]:''}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="安置地" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="showCity">
|
||||
<view class="input-val" style="width: 450rpx;" slot="value">
|
||||
{{userInfo.to_province_name}}-{{userInfo.to_city_name}}-{{userInfo.to_area_name}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell v-if="userInfo.reside_province_name" title="现居住地" size="large" :border='false'
|
||||
:titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}" @click="showReside">
|
||||
<view class="input-val" style="width: 450rpx;" slot="value">
|
||||
{{userInfo.reside_province_name}}-{{userInfo.reside_city_name}}-{{userInfo.reside_area_name}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="详细地址" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleDetail">
|
||||
<view class="input-val" style="width: 450rpx;" slot="value">
|
||||
{{userInfo.detail}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="入伍时间" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
|
||||
v-model="userInfo.join_time">{{userInfo.join_time}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="退役时间" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
|
||||
v-model="userInfo.retire_time">{{userInfo.retire_time}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="人员类别" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleCategory">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.category?categoryList[userInfo.category-1]:''}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="健康状态" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handleHealth">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{ userInfo.health?healthList[userInfo.health-1]:''}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
<u-cell title="职业技能培训意向" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
|
||||
@click="handlePurpose">
|
||||
<view class="input-val" style="width: 350rpx;" slot="value">
|
||||
{{userInfo.purpose}}
|
||||
</view>
|
||||
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
<!-- 底部操作 -->
|
||||
<view class="wrap-bottom-bar">
|
||||
<view class="bar-placeholder"></view>
|
||||
<view class="bar-content">
|
||||
<u-button :customStyle="btnStyle" :ripple="true" shape="circle" @click="submit">完成</u-button>
|
||||
<view class="fixed">
|
||||
<view class="set-button">
|
||||
<button @click="submit" class="button">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 昵称 -->
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="输入昵称" :value="form.username" placeholder="请输入内容"
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="输入昵称" :value="userInfo.name" placeholder="请输入内容"
|
||||
@confirm="nameConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 城市选择 -->
|
||||
<city-picker themeColor="#007AFF" ref="cityPicker" :pickerValueDefault="cityDefault" @onConfirm="confirmCity">
|
||||
</city-picker>
|
||||
<!-- 身份证号 -->
|
||||
<uni-popup ref="idcardDialog" type="dialog">
|
||||
<uni-popup-dialog :before-close='true' ref="inputClose" mode="input" title="输入身份证" :value="userInfo.idcard"
|
||||
placeholder="请输入内容" @close="idcardClose" @confirm="idcardConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 手机号码 -->
|
||||
<uni-popup ref="mobileDialog" type="dialog">
|
||||
<uni-popup-dialog :before-close='true' ref="inputClose" mode="input" title="输入手机号"
|
||||
:value="userInfo.contact_mobile" placeholder="请输入内容" @close="mobileClose"
|
||||
@confirm="mobileConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 详细地址 -->
|
||||
<uni-popup ref="detailDialog" type="dialog">
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="输入详细地址" :value="userInfo.detail" placeholder="请输入内容"
|
||||
@confirm="detailConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 意向 -->
|
||||
<uni-popup ref="purposeDialog" type="dialog">
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="输入职业技能培训意向" :value="userInfo.purpose"
|
||||
placeholder="请输入内容" @confirm="purposeConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 安置地城市选择 -->
|
||||
<liuChooseAddress ref="scroll" @change='chooseSuccess'></liuChooseAddress>
|
||||
<!-- 现居地城市选择 -->
|
||||
<liuChooseAddress ref="scrolls" @change='chooseSuccesss'></liuChooseAddress>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
register,
|
||||
infoEdit,
|
||||
preInfo,
|
||||
} from "@/api/login.js"
|
||||
import liuChooseAddress from '@/components/liu-choose-address/liu-choose-address.vue'
|
||||
|
||||
import {
|
||||
rsaEncrypt
|
||||
} from '@/utils/lib/rsa.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
liuChooseAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo: {
|
||||
code: "", //登录code
|
||||
org_id: "", //机构ID 默认1
|
||||
name: "", //姓名
|
||||
idcard: "", //身份证号
|
||||
sex: "", //性别 1.男 2.女
|
||||
birthday: "", //出生日期
|
||||
degree: "", //学历 1.博士研究生 2.硕士研究生 3.本科 4.大专 5.高中 6.初中及以下
|
||||
political: "", //政治面貌 1.中共党员 2.中共预备党员 3.中共团员 4.群众
|
||||
to_province_code: "", //省代码 安置地
|
||||
to_province_name: "", //省名称 安置地
|
||||
to_city_code: "", //市代码 安置地
|
||||
to_city_name: "", //市名称 安置地
|
||||
to_area_code: "", //区县代码 安置地
|
||||
to_area_name: "", //区县名称 安置地
|
||||
category: "", //人员类别 1.退役军官 2.退役士兵
|
||||
join_time: "", //入伍时间
|
||||
retire_time: "", //退役时间
|
||||
health: "", //健康状态 1.健康或良好 2.一般或较弱 3.有慢性病 4.患有大病 5.残疾
|
||||
reside_province_code: "", //省代码 现居住地
|
||||
reside_province_name: "", //省名称 现居住地
|
||||
reside_city_code: "", //市代码 现居住地
|
||||
reside_city_name: "", //市名称 现居住地
|
||||
reside_area_code: "", //区县代码 现居住地
|
||||
reside_area_name: "", //区县名称 现居住地
|
||||
detail: "", //详细地址 现居住地
|
||||
contact_mobile: "", //联系电话
|
||||
purpose: "" //职业技能培训意向
|
||||
},
|
||||
form: {
|
||||
avatar: '/static/img/header/a.svg',
|
||||
username: 'MrThinco',
|
||||
sex: 0,
|
||||
emotion: 1,
|
||||
|
|
@ -81,31 +207,58 @@
|
|||
birth: '2020-10-10',
|
||||
city: '四川成都'
|
||||
},
|
||||
sexList: ['男', '女', '保密'],
|
||||
emoList: ['未婚', '已婚', '离异', '保密'],
|
||||
jobList: ['软件工程师', '维修工程师', '运维工程师', '测试工程师'],
|
||||
cityDefault: [0, 0, 1],
|
||||
sexList: ['男', '女'],
|
||||
// 1.博士研究生 2.硕士研究生 3.本科 4.大专 5.高中 6.初中及以下
|
||||
educationList: ['博士研究生', '硕士研究生', '本科', '大专', '高中', '初中及以下'],
|
||||
//政治面貌 1.中共党员 2.中共预备党员 3.中共团员 4.群众
|
||||
politicalList: ['中共党员', '中共预备党员', '中共团员', '群众'],
|
||||
// 人员类别
|
||||
categoryList: ['退役军官', '退役士兵'],
|
||||
healthList: ['健康或良好', '一般或较弱', '有慢性病', '患有大病', '残疾'],
|
||||
// cityDefault: [0, 0, 1],
|
||||
// 按钮配置
|
||||
btnStyle: {
|
||||
width: "90%",
|
||||
height: "75rpx",
|
||||
background: "linear-gradient(-45deg,#01906c,#34D399)",
|
||||
background: "linear-gradient(to right, #00B7FF, #006EEF)",
|
||||
color: "#FFFFFF",
|
||||
fontSize: "30rpx",
|
||||
},
|
||||
isPickerVisible: false, // 控制选择器显示状态
|
||||
selectedAddress: '', // 存储选择的地址
|
||||
pageType: 'edit'
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options,'');
|
||||
if (options.type && options.type == 'register') {
|
||||
this.userInfo.org_id = 1
|
||||
this.userInfo.code = options.code
|
||||
this.pageType = options.type
|
||||
uni.setNavigationBarTitle({
|
||||
title: '用户注册'
|
||||
});
|
||||
|
||||
} else {
|
||||
this.getPreInfo()
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改资料'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 修改头像
|
||||
handleHeader() {
|
||||
// 选择图片
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], //从相册选择
|
||||
success: function(res) {
|
||||
this.form.avatar = res.tempFilePaths[0]
|
||||
}
|
||||
getPreInfo() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
preInfo().then(res => {
|
||||
uni.hideLoading()
|
||||
this.userInfo = res.data
|
||||
this.userInfo.org_id = 1
|
||||
this.userInfo.name = ''
|
||||
this.userInfo.idcard = ''
|
||||
this.userInfo.contact_mobile = ''
|
||||
})
|
||||
},
|
||||
// 修改昵称
|
||||
|
|
@ -113,7 +266,82 @@
|
|||
this.$refs.inputDialog.open()
|
||||
},
|
||||
nameConfirm(val) {
|
||||
this.form.username = val
|
||||
this.userInfo.name = val
|
||||
},
|
||||
// 身份证号
|
||||
handleIdcard() {
|
||||
this.$refs.idcardDialog.open()
|
||||
},
|
||||
async idcardConfirm(val) {
|
||||
var reslut = await this.isValidIDCard(val)
|
||||
if (!reslut) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的身份证号',
|
||||
icon: 'none'
|
||||
})
|
||||
this.userInfo.idcard = ''
|
||||
return
|
||||
}
|
||||
this.userInfo.idcard = val
|
||||
this.$refs.idcardDialog.close()
|
||||
},
|
||||
idcardClose() {
|
||||
this.$refs.idcardDialog.close()
|
||||
},
|
||||
// 手机号
|
||||
handleMobile() {
|
||||
this.$refs.mobileDialog.open()
|
||||
},
|
||||
handleDetail() {
|
||||
this.$refs.detailDialog.open()
|
||||
},
|
||||
handlePurpose() {
|
||||
this.$refs.purposeDialog.open()
|
||||
},
|
||||
purposeConfirm(val) {
|
||||
this.userInfo.purpose = val
|
||||
},
|
||||
async mobileConfirm(val) {
|
||||
var reslut = await this.isValidPhoneNumber(val)
|
||||
if (!reslut) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
this.userInfo.contact_mobile = ''
|
||||
return
|
||||
}
|
||||
this.userInfo.contact_mobile = val
|
||||
this.$refs.mobileDialog.close()
|
||||
},
|
||||
mobileClose() {
|
||||
this.$refs.mobileDialog.close()
|
||||
},
|
||||
detailConfirm(val) {
|
||||
this.userInfo.detail = val
|
||||
},
|
||||
isValidPhoneNumber(phone) {
|
||||
const regex = /^1[3-9]\d{9}$/; // 正则表达式,匹配以1开头,后面跟随9位数字
|
||||
return regex.test(phone);
|
||||
},
|
||||
isValidIDCard(id) {
|
||||
// 正则表达式验证格式
|
||||
const regex = /^(?:\d{15}|\d{17}[\dxX])$/;
|
||||
if (!regex.test(id)) {
|
||||
return false; // 格式不匹配
|
||||
}
|
||||
// 如果是18位身份证,进行校验位的计算
|
||||
if (id.length === 18) {
|
||||
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
|
||||
const checksum = '10X98765432';
|
||||
let sum = 0;
|
||||
for (let i = 0; i < 17; i++) {
|
||||
sum += parseInt(id[i]) * weights[i];
|
||||
}
|
||||
const calculatedCheckDigit = checksum[sum % 11];
|
||||
return calculatedCheckDigit === id[17].toUpperCase(); // 校验位匹配
|
||||
}
|
||||
return true; // 15位身份证通过格式验证即为有效
|
||||
},
|
||||
// 修改性别
|
||||
handleSex() {
|
||||
|
|
@ -121,7 +349,7 @@
|
|||
uni.showActionSheet({
|
||||
itemList: this.sexList,
|
||||
success: function(res) {
|
||||
_this.form.sex = res.tapIndex
|
||||
_this.userInfo.sex = res.tapIndex + 1
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res.errMsg);
|
||||
|
|
@ -136,9 +364,10 @@
|
|||
handleEmotion() {
|
||||
const _this = this
|
||||
uni.showActionSheet({
|
||||
itemList: this.emoList,
|
||||
itemList: this.educationList,
|
||||
success: function(res) {
|
||||
_this.form.emotion = res.tapIndex
|
||||
console.log(res, 'res');
|
||||
_this.userInfo.degree = res.tapIndex + 1
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res.errMsg);
|
||||
|
|
@ -149,38 +378,263 @@
|
|||
handleJob() {
|
||||
const _this = this
|
||||
uni.showActionSheet({
|
||||
itemList: this.jobList,
|
||||
itemList: this.politicalList,
|
||||
success: function(res) {
|
||||
_this.form.job = res.tapIndex
|
||||
_this.userInfo.political = res.tapIndex + 1
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res.errMsg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改城市
|
||||
confirmCity(e) {
|
||||
console.log('e', e)
|
||||
this.form.city = e.label
|
||||
handleCategory() {
|
||||
const _this = this
|
||||
uni.showActionSheet({
|
||||
itemList: this.categoryList,
|
||||
success: function(res) {
|
||||
_this.userInfo.category = res.tapIndex + 1
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res.errMsg)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleHealth() {
|
||||
const _this = this
|
||||
uni.showActionSheet({
|
||||
itemList: this.healthList,
|
||||
success: function(res) {
|
||||
_this.userInfo.health = res.tapIndex + 1
|
||||
},
|
||||
fail: function(res) {
|
||||
console.log(res.errMsg)
|
||||
}
|
||||
})
|
||||
},
|
||||
showCity() {
|
||||
this.$refs.cityPicker.show()
|
||||
this.$refs.scroll.open()
|
||||
},
|
||||
showReside() {
|
||||
this.$refs.scrolls.open()
|
||||
},
|
||||
chooseSuccess(e) {
|
||||
this.userInfo.to_province_code = e.value[0].value
|
||||
this.userInfo.to_province_name = e.value[0].label
|
||||
|
||||
this.userInfo.to_city_code = e.value[1].value
|
||||
this.userInfo.to_city_name = e.value[1].label
|
||||
|
||||
this.userInfo.to_area_code = e.value[2].value
|
||||
this.userInfo.to_area_name = e.value[2].label
|
||||
},
|
||||
|
||||
chooseSuccesss(e) {
|
||||
this.userInfo.reside_province_code = e.value[0].value
|
||||
this.userInfo.reside_province_name = e.value[0].label
|
||||
|
||||
this.userInfo.reside_city_code = e.value[1].value
|
||||
this.userInfo.reside_city_name = e.value[1].label
|
||||
|
||||
this.userInfo.reside_area_code = e.value[2].value
|
||||
this.userInfo.reside_area_name = e.value[2].label
|
||||
},
|
||||
// 提交
|
||||
submit() {
|
||||
var that = this
|
||||
console.log(that.userInfo);
|
||||
if (!that.userInfo.name) {
|
||||
uni.showToast({
|
||||
title: '请输入姓名',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.idcard) {
|
||||
uni.showToast({
|
||||
title: '请输入身份证号',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.contact_mobile) {
|
||||
uni.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.contact_mobile) {
|
||||
uni.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.sex) {
|
||||
uni.showToast({
|
||||
title: '请选择性别',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.birthday) {
|
||||
uni.showToast({
|
||||
title: '请选择出生日期',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.degree) {
|
||||
uni.showToast({
|
||||
title: '请选择学历',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.political) {
|
||||
uni.showToast({
|
||||
title: '请选择政治面貌',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.to_province_name) {
|
||||
uni.showToast({
|
||||
title: '请选择安置地',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.reside_city_name) {
|
||||
uni.showToast({
|
||||
title: '请选择现居地',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.category) {
|
||||
uni.showToast({
|
||||
title: '请选择人员类别',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.join_time) {
|
||||
uni.showToast({
|
||||
title: '请选择入伍时间',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.retire_time) {
|
||||
uni.showToast({
|
||||
title: '请选择退役时间',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.health) {
|
||||
uni.showToast({
|
||||
title: '请选择健康状态',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.detail) {
|
||||
uni.showToast({
|
||||
title: '请填写详细地址',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!that.userInfo.purpose) {
|
||||
uni.showToast({
|
||||
title: '请填写职业技能培训意向',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
})
|
||||
that.userInfo.name = rsaEncrypt(that.userInfo.name);
|
||||
that.userInfo.idcard = rsaEncrypt(that.userInfo.idcard);
|
||||
that.userInfo.contact_mobile = rsaEncrypt(that.userInfo.contact_mobile);
|
||||
infoEdit(that.userInfo).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
title: '提交成功',
|
||||
icon: 'none'
|
||||
})
|
||||
if (that.pageType == 'edit') {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 400)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
}, 400)
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.edit-info {
|
||||
.header-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 100%;
|
||||
margin-right: 10rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
height: 180rpx;
|
||||
box-shadow: 0rpx -4rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.set-button {
|
||||
padding-top: 30rpx;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
|
||||
.button {
|
||||
background: linear-gradient(to right, #00B7FF, #006EEF);
|
||||
border-radius: 20rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
.input-val {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
/deep/.uni-popup .uni-popup__wrapper {
|
||||
bottom: 200rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<template>
|
||||
<!-- 新鲜事页/话题分类 -->
|
||||
<view class="news-topic-cate">
|
||||
|
||||
<!-- 标签 -->
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs class="wrap-card" ref="tabs" @change="changeTab" :list="typeList" :current="tabIndex"
|
||||
lineColor="#3c9cff" keyName='name' :activeStyle="{color:'#3c9cff'}" :inactiveStyle="{color:'#909399'}"
|
||||
lineWidth="30" :scrollable="false">
|
||||
</u-tabs>
|
||||
</u-sticky>
|
||||
<!-- 图文列表 -->
|
||||
<!-- 有内容 -->
|
||||
<view v-if="assetList.length > 0">
|
||||
<topic-list @click.native="goTopicDetail(item1)" :item="item1" v-for="(item1,index1) in assetList"
|
||||
:key="index1"></topic-list>
|
||||
<u-loadmore :status="status"></u-loadmore>
|
||||
</view>
|
||||
<!-- 无内容 -->
|
||||
<view v-else>
|
||||
<view class="default-img">
|
||||
<image style='width: 400rpx;height: 200rpx' src="../../static/img/demo/default-img.png" mode="">
|
||||
</image>
|
||||
<text class="desc">暂无内容,去其他的看看吧</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
topicList
|
||||
} from "@/utils/data/data.js"
|
||||
import TopicList from "@/pages/news/cpns/topic-lists.vue"
|
||||
import {
|
||||
groupList,
|
||||
assetList,
|
||||
assetInfo
|
||||
} from '@/api/train.js'
|
||||
export default {
|
||||
components: {
|
||||
TopicList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 标签栏
|
||||
tabIndex: 0,
|
||||
queryParams: {
|
||||
org_id: getApp().globalData.org_id,
|
||||
type: '',
|
||||
group_id: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
// groupParams: {
|
||||
// type: "",
|
||||
// org_id: getApp().globalData.org_id,
|
||||
// },
|
||||
// groupList: [],
|
||||
assetList: [],
|
||||
typeList: [{
|
||||
type: 1,
|
||||
name: '招聘'
|
||||
},
|
||||
{
|
||||
type: 2,
|
||||
name: '技能'
|
||||
},
|
||||
{
|
||||
type: 3,
|
||||
name: '课程'
|
||||
}
|
||||
],
|
||||
count: 0,
|
||||
status: 'loadmore',
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.assetList.length >= that.count) {
|
||||
this.status = 'nomore';
|
||||
return
|
||||
}
|
||||
this.page++
|
||||
this.status = 'loading';
|
||||
this.getList()
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
this.queryParams.type = this.typeList[0].type
|
||||
// this.groupParams.type = this.typeList[0].type
|
||||
// this.getGroupList()
|
||||
this.getLists()
|
||||
},
|
||||
methods: {
|
||||
// getGroupList() {
|
||||
// var that = this
|
||||
// groupList(that.groupParams).then(res => {
|
||||
// that.groupList = res.data
|
||||
// that.queryParams.group_id = res.data[0].group_id
|
||||
// that.getLists()
|
||||
// })
|
||||
// },
|
||||
|
||||
async getLists() {
|
||||
var that = this
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
var res = await assetList(that.queryParams)
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
if (res.data.length < that.queryParams.limit) {
|
||||
that.status = 'nomore'
|
||||
}
|
||||
that.assetList = that.assetList.concat(res.data)
|
||||
that.count = res.count
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
getPdfInfo(item) {
|
||||
// pdf文档
|
||||
uni.showLoading({
|
||||
title: '加载文档中..'
|
||||
})
|
||||
assetInfo({
|
||||
id: item.asset_id
|
||||
}).then(res => {
|
||||
uni.downloadFile({
|
||||
url: res.data.pdf_url,
|
||||
success: function(res) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: 'pdf',
|
||||
showMenu: true,
|
||||
success: function(res) {
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
complete: function(r) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
goTopicDetail(item) {
|
||||
console.log(item, 'item');
|
||||
switch (item.type) {
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/detail?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
this.getPdfInfo(item)
|
||||
break;
|
||||
case 3:
|
||||
// 课程
|
||||
uni.navigateTo({
|
||||
url: '/pages/news/course?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
// tab栏切换
|
||||
changeTab(item) {
|
||||
this.tabIndex = item.index
|
||||
this.swiperIndex = item.index
|
||||
this.page = 1
|
||||
this.assetList = []
|
||||
this.queryParams.type = item.type
|
||||
this.getLists()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f7f8ff;
|
||||
}
|
||||
|
||||
.news-topic-cate {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top));
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.default-img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 350rpx;
|
||||
|
||||
.desc {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #595959;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,13 +5,12 @@
|
|||
<view class="status-bar bg-white pt-30"></view>
|
||||
<!-- 头像栏 -->
|
||||
<view class="flex items-center wrap-card" hover-class="bg-gray-100" @click="$u.route('/pages/mine/set')">
|
||||
<image class="header-img" src="/static/img/header/a.svg" mode=""
|
||||
@click.stop="$u.route('/pages/mine/set')"></image>
|
||||
<image class="header-img" src="/static/img/header/a.svg" mode="" @click.stop="$u.route('/pages/mine/set')">
|
||||
</image>
|
||||
<view class="flex flex-col flex-1 px-20">
|
||||
<text class="text-32 font-bold">MrThinco</text>
|
||||
<text class="text-28 text-gray-500 mt-10">17729744485</text>
|
||||
<text class="text-32 font-bold">{{userInfo.name}}</text>
|
||||
<text class="text-28 text-gray-500 mt-10">{{userInfo.contact_mobile}}</text>
|
||||
</view>
|
||||
<text class="iconfont iconqianjin"></text>
|
||||
</view>
|
||||
<!-- 统计栏 -->
|
||||
<!-- <view class="wrap-card flex items-center">
|
||||
|
|
@ -27,7 +26,7 @@
|
|||
</view> -->
|
||||
<!-- 广告位 -->
|
||||
<view class="wrap-card">
|
||||
<image class="adv-img rounded-20" src="../../static/img/list/01.jpg" mode="aspectFill"></image>
|
||||
<image class="adv-img rounded-20" src="../../static/img/demo/winter1.jpeg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 设置 -->
|
||||
<u-cell-group :border='false'>
|
||||
|
|
@ -40,27 +39,32 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userInfo,
|
||||
fileGet,
|
||||
|
||||
} from '@/api/login.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 统计列表
|
||||
countList: [{
|
||||
num: 12,
|
||||
name: '帖子'
|
||||
},
|
||||
{
|
||||
num: 278,
|
||||
name: '动态'
|
||||
},
|
||||
{
|
||||
num: 369,
|
||||
name: '评论'
|
||||
},
|
||||
{
|
||||
num: 750,
|
||||
name: '粉丝'
|
||||
}
|
||||
],
|
||||
// countList: [{
|
||||
// num: 12,
|
||||
// name: '帖子'
|
||||
// },
|
||||
// {
|
||||
// num: 278,
|
||||
// name: '动态'
|
||||
// },
|
||||
// {
|
||||
// num: 369,
|
||||
// name: '评论'
|
||||
// },
|
||||
// {
|
||||
// num: 750,
|
||||
// name: '粉丝'
|
||||
// }
|
||||
// ],
|
||||
// 设置列表
|
||||
setList: [
|
||||
// {
|
||||
|
|
@ -70,37 +74,146 @@
|
|||
// },
|
||||
{
|
||||
icon: 'iconliulan',
|
||||
name: '浏览历史'
|
||||
name: '浏览历史',
|
||||
url: 'history',
|
||||
},
|
||||
// {
|
||||
// icon: 'iconrenzheng',
|
||||
// name: '社区认证'
|
||||
// },
|
||||
// {
|
||||
// icon: 'iconshenhe',
|
||||
// name: '审核帖子'
|
||||
// },
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
|
||||
{
|
||||
icon: 'iconshezhi1',
|
||||
name: '我的设置',
|
||||
url: 'set'
|
||||
},
|
||||
{
|
||||
icon: 'iconshenhe',
|
||||
name: '役士兵职业技能培训申请表',
|
||||
url: 'file2'
|
||||
|
||||
},
|
||||
{
|
||||
icon: 'iconshenhe',
|
||||
name: '退役士兵教育培训承训机构申请表',
|
||||
url: 'file1'
|
||||
}
|
||||
// #endif
|
||||
]
|
||||
],
|
||||
userInfo: {},
|
||||
flieList: {}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo()
|
||||
this.getFileGet()
|
||||
},
|
||||
// 监听导航栏按钮点击
|
||||
onNavigationBarButtonTap() {
|
||||
this.goSet()
|
||||
},
|
||||
methods: {
|
||||
getFileGet() {
|
||||
fileGet().then(res => {
|
||||
this.flieList = res.data
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
userInfo().then(res => {
|
||||
this.userInfo = res.data
|
||||
uni.setStorageSync('userInfo', res.data)
|
||||
})
|
||||
},
|
||||
goSet() {
|
||||
this.$u.route('/pages/mine/set')
|
||||
},
|
||||
goPage(url) {
|
||||
if (url) this.$u.route('/pages/mine/' + url)
|
||||
goPage(type) {
|
||||
switch (type) {
|
||||
case 'history':
|
||||
this.$u.route('/pages/mine/' + type)
|
||||
break;
|
||||
case 'set':
|
||||
this.$u.route('/pages/mine/' + type)
|
||||
break;
|
||||
case 'file2':
|
||||
this.downloadFile(this.flieList.file2)
|
||||
break;
|
||||
case 'file1':
|
||||
this.downloadFile(this.flieList.file1)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
downloadFile(url) {
|
||||
uni.showLoading({
|
||||
title: '正在下载...',
|
||||
});
|
||||
uni.downloadFile({
|
||||
url: url, // 文件的 URL
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
// 下载成功
|
||||
const tempFilePath = res.tempFilePath;
|
||||
|
||||
// 保存文件到本地
|
||||
uni.saveFile({
|
||||
tempFilePath: tempFilePath,
|
||||
success: (saveRes) => {
|
||||
// 文件保存成功,获取保存后的文件路径
|
||||
const savedFilePath = saveRes.savedFilePath;
|
||||
|
||||
// 提示用户文件已保存,并显示保存路径
|
||||
uni.showToast({
|
||||
title: '文件已保存',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
// 打开文件
|
||||
uni.openDocument({
|
||||
showMenu: true,
|
||||
filePath: savedFilePath,
|
||||
fileType: 'xlsx', // 根据文件类型设置
|
||||
success: () => {
|
||||
console.log('文件打开成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '打开文件失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('打开文件失败:', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('保存文件失败:', err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '下载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('下载文件失败:', err);
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -119,4 +232,4 @@
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -2,23 +2,10 @@
|
|||
<!-- 我的/设置页 -->
|
||||
<view class="set">
|
||||
<u-cell-group :border='false'>
|
||||
<u-cell v-for="(item,index) in setList" :key="index" :title="item.name" :value="item.value" isLink
|
||||
size="large" :border='false' @click="goPage(item.url)">
|
||||
<u-cell v-for="(item,index) in setList" :key="index" :title="item.name" isLink size="large" :border='false'
|
||||
@click="goPage(item.url)">
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
<!-- 底部操作 -->
|
||||
<!-- <view class="wrap-bottom-bar">
|
||||
<view class="bar-placeholder"></view>
|
||||
<view class="bar-content">
|
||||
<u-button :customStyle="btnStyle" :ripple="true" shape="circle" @click="goPage('logout')">退出</u-button>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 退出 -->
|
||||
<!-- <u-modal title="提示" @cancel="logoutShow=false" showCancelButton :show="logoutShow" @confirm="logout"
|
||||
ref="uModal" :asyncClose="true" content="您是否确定要,退出登录?"></u-modal> -->
|
||||
<!-- 注销 -->
|
||||
<!-- <u-modal title="提示" @cancel="cancleShow=false" showCancelButton :show="cancleShow" @confirm="cancleShow=false"
|
||||
ref="uModal" :asyncClose="true" content="您是否确定要,注销账号?"></u-modal> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -26,95 +13,21 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
logoutShow: false,
|
||||
cancleShow: false,
|
||||
// 设置列表
|
||||
setList: [
|
||||
// {
|
||||
// name: '账号与安全',
|
||||
// url: 'edit-pwd'
|
||||
// },
|
||||
// {
|
||||
// name: '绑定邮箱',
|
||||
// url: 'bind-email'
|
||||
// },
|
||||
{
|
||||
name: '修改资料',
|
||||
url: 'edit-info'
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// name: '清除缓存',
|
||||
// url: 'clear'
|
||||
// },
|
||||
// {
|
||||
// name: '意见反馈',
|
||||
// url: 'feedback'
|
||||
// },
|
||||
// {
|
||||
// name: '关于社区',
|
||||
// url: 'about'
|
||||
// },
|
||||
// {
|
||||
// name: '注销账号',
|
||||
// url: 'cancle'
|
||||
// }
|
||||
|
||||
],
|
||||
// 按钮配置
|
||||
btnStyle: {
|
||||
width: "90%",
|
||||
height: "75rpx",
|
||||
background: "linear-gradient(-45deg,#01906c,#34D399)",
|
||||
color: "#FFFFFF",
|
||||
fontSize: "30rpx",
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getStorage()
|
||||
},
|
||||
methods: {
|
||||
goPage(url) {
|
||||
if (url === 'cancle') return this.cancleShow = true // 注销
|
||||
if (url === 'logout') return this.logoutShow = true // 退出
|
||||
if (url === 'clear') return this.clearStorage() // 清除缓存
|
||||
this.$u.route('/pages/mine/' + url)
|
||||
},
|
||||
// 退出
|
||||
logout() {
|
||||
this.logoutShow = false
|
||||
this.$u.route('/pages/mine/login')
|
||||
},
|
||||
// 清除缓存
|
||||
clearStorage() {
|
||||
const _this = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否要清除所有缓存?',
|
||||
cancelText: '不清除',
|
||||
confirmText: '清除',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.clearStorage()
|
||||
_this.getStorage()
|
||||
_this.$u.toast('清除成功')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取缓存
|
||||
getStorage() {
|
||||
const _this = this
|
||||
// 获取缓存信息
|
||||
uni.getStorageInfo({
|
||||
success: function(res) {
|
||||
// 当前占用的空间大小, 单位:kb
|
||||
const value = res.currentSize
|
||||
const val = value > 1024 ? (value / 1024).toFixed(2) + 'MB' : value
|
||||
.toFixed(2) + 'KB'
|
||||
_this.$set(_this.setList[3],'value', val)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -122,4 +35,4 @@
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.set {}
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -1,178 +1,86 @@
|
|||
<template>
|
||||
<view class="content" >
|
||||
<zxVideo :url="urls" :isSpeed="isSpeed" :showCasting="showCasting" :lockButton="lockButton"></zxVideo>
|
||||
</view>
|
||||
<view>
|
||||
<zxVideo :url="info.video_url" :isSpeed="isSpeed" :showCasting="showCasting" :lockButton="lockButton"></zxVideo>
|
||||
<view class="detail">
|
||||
<view class="title">
|
||||
{{info.asset_name}}
|
||||
</view>
|
||||
<view class="desc">
|
||||
{{info.digest}}
|
||||
</view>
|
||||
<view class="parse">
|
||||
<u-parse :content="info.content"></u-parse>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import zxVideo from '@/components/zx-video/zx-video.vue';
|
||||
export default {
|
||||
components: {
|
||||
zxVideo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urls:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
|
||||
//是否打开倍速功能
|
||||
isSpeed:true,
|
||||
//是否显示投屏按钮
|
||||
showCasting:true,
|
||||
//是否显示锁屏按钮
|
||||
lockButton:true
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
import zxVideo from '@/components/zx-video/zx-video.vue';
|
||||
import {
|
||||
assetInfo
|
||||
} from '@/api/train.js'
|
||||
export default {
|
||||
components: {
|
||||
zxVideo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urls: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
|
||||
//是否打开倍速功能
|
||||
isSpeed: true,
|
||||
//是否显示投屏按钮
|
||||
showCasting: true,
|
||||
//是否显示锁屏按钮
|
||||
lockButton: true,
|
||||
|
||||
assets_id: '',
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.assets_id = option.assets_id
|
||||
this.getAssetInfo()
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
getAssetInfo() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
assetInfo({
|
||||
id: this.assets_id
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
this.info = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.content {
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
|
||||
}
|
||||
.top-video {
|
||||
width: 100%;
|
||||
height: 422rpx;
|
||||
}
|
||||
.mvdetail {
|
||||
width: 100%;
|
||||
padding: 50rpx 40rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
.mvdetail-name {
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
color: #333;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.mvdetail-tag {
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
color: #6cb5ff;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.mvdetail-tag-item {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.mvdetail-desc {
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
color: #666;
|
||||
margin-top: 30rpx;
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
.mvdetail-btn {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
.share-item {
|
||||
width: 134rpx;
|
||||
height: 46rpx;
|
||||
border: 2rpx solid #d2d2d2;
|
||||
border-radius: 24rpx;
|
||||
padding: 0 18rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.share-item-img {
|
||||
float: left;
|
||||
width: 26rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
.share-item-title {
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
line-height: 1;
|
||||
margin: 10rpx 0 0 16rpx;
|
||||
}
|
||||
|
||||
.video-heizith-menu {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
bottom: 20%;
|
||||
z-index: 998;
|
||||
font-size: 20rpx;
|
||||
width: 52rpx;
|
||||
height: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 38rpx;
|
||||
border: 1rpx solid #fff;
|
||||
border-radius: 8rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.modal {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 9999;
|
||||
}
|
||||
.modal-content {
|
||||
position: absolute;
|
||||
left: 46rpx;
|
||||
bottom: 20%;
|
||||
z-index: 9999;
|
||||
|
||||
}
|
||||
.modal-content-txt {
|
||||
text-align: left;
|
||||
padding-bottom: 20rpx;
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.speed-option {
|
||||
float: left;
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
text-align: center;
|
||||
line-height: 68rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 4rpx;
|
||||
margin-right: 10rpx;
|
||||
z-index: 9999;
|
||||
|
||||
|
||||
}
|
||||
.speed-option.active {
|
||||
/* border-bottom: 2rpx solid #fd750b; */
|
||||
color: #fd750b;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 30rpx;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #000000,
|
||||
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #595959;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.parse{
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
<template>
|
||||
<!-- 新鲜事/话题列表 -->
|
||||
<view class="topic-list flex items-center" @click="goTopicDetail(item)">
|
||||
<image style="width: 200rpx; height: 140rpx;" :src="item.img" lazy-load mode="aspectFill"></image>
|
||||
<view class="topic-list flex items-center">
|
||||
<image style="width: 200rpx; height: 150rpx;" :src="item.cover" lazy-load mode="aspectFill"></image>
|
||||
<view class="my-20 flex-1">
|
||||
<view class="text-black text-32">#{{item.title}}#</view>
|
||||
<view class="text-gray-400 text-26 my-10">{{item.desc}}</view>
|
||||
<view class="text-gray-400 text-24 my-10 flex w-full">
|
||||
<view class="w-1-2 text-left">观看量:{{item.totalNum}}</view>
|
||||
<view class="w-1-2 text-left">今日:{{item.todayNum}}</view>
|
||||
<view class="text-black text-32 asset_name">{{item.asset_name}}</view>
|
||||
<view class="text-gray-400 text-26 my-10 digest">{{item.digest}}</view>
|
||||
<view class="operation">
|
||||
<view>点击量:{{formatNumber(item.read_num)}}</view>
|
||||
<view>今日:{{formatNumber(item.today)}}</view>
|
||||
<!-- <view v-if='item.type==2' class="download"><u-icon name="download" color="#9CA3AF "
|
||||
size="24"></u-icon>下载</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -33,31 +35,14 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 话题详情
|
||||
goTopicDetail(item) {
|
||||
// this.$u.route({
|
||||
// url: '/pages/news/news-topic-detail',
|
||||
// params: item
|
||||
// })
|
||||
this.$u.route('pages/home/detail', {
|
||||
data: JSON.stringify({
|
||||
age: 30,
|
||||
commentNum: 388,
|
||||
coverPic: "/static/img/list/01.jpg",
|
||||
infoNum: {
|
||||
cryNum: 2,
|
||||
index: 0,
|
||||
smileNum: 13
|
||||
},
|
||||
isFollow: false,
|
||||
sex: 1,
|
||||
shareNum: 32,
|
||||
title: "做一件有价值的事情,坚持下去等待时间的回报吧!",
|
||||
type: "img",
|
||||
userPic: "/static/img/header/a.svg",
|
||||
username: "芒种"
|
||||
})
|
||||
})
|
||||
formatNumber(num) {
|
||||
if (num >= 10000) {
|
||||
return (num / 10000).toFixed(1) + 'w'; // 保留一位小数并加上'w'
|
||||
} else if (num >= 1000) {
|
||||
return (num / 1000).toFixed(1) + 'k'; // 保留一位小数并加上'k'
|
||||
} else {
|
||||
return num.toString(); // 小于1000直接返回数字
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +53,8 @@
|
|||
background-color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
padding:15rpx 10rpx;
|
||||
padding: 15rpx 10rpx;
|
||||
|
||||
image {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
|
|
@ -76,4 +62,36 @@
|
|||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.digest {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
/* 定义显示的行数 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.asset_name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.operation {
|
||||
// border: solid 1px red;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #9CA3AF;
|
||||
font-size: 26rpx;
|
||||
padding: 0 20rpx 0 0;
|
||||
|
||||
.download {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
<template>
|
||||
<!-- 新鲜事/话题列表 -->
|
||||
<view class="topic-list flex items-center">
|
||||
<image style="width: 200rpx; height: 150rpx;" :src="item.cover" lazy-load mode="aspectFill"></image>
|
||||
<view class="my-20 flex-1">
|
||||
<view class="text-black text-32 asset_name">{{item.asset_name}}</view>
|
||||
<view class="text-gray-400 text-26 my-10 digest">{{item.digest}}</view>
|
||||
<view class="operation">
|
||||
<view>点击量:{{formatNumber(item.read_num)}}</view>
|
||||
<view>今日:{{formatNumber(item.today)}}</view>
|
||||
<!-- <view v-if='item.type==2' class="download"><u-icon name="download" color="#9CA3AF "
|
||||
size="24"></u-icon>下载</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* newsTopicList 新鲜事页话题列表
|
||||
* @description 用于新鲜事页中话题栏下面的话题列表
|
||||
* @author MrThinco
|
||||
* @property {Object} item 信息
|
||||
*/
|
||||
export default {
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatNumber(num) {
|
||||
if (num >= 10000) {
|
||||
return (num / 10000).toFixed(1) + 'w'; // 保留一位小数并加上'w'
|
||||
} else if (num >= 1000) {
|
||||
return (num / 1000).toFixed(1) + 'k'; // 保留一位小数并加上'k'
|
||||
} else {
|
||||
return num.toString(); // 小于1000直接返回数字
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.topic-list {
|
||||
background-color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 15rpx 10rpx;
|
||||
|
||||
image {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.digest {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
/* 定义显示的行数 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.asset_name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.operation {
|
||||
// border: solid 1px red;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #9CA3AF;
|
||||
font-size: 26rpx;
|
||||
padding: 0 20rpx 0 0;
|
||||
|
||||
.download {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<!-- <web-view :src="allUrl"></web-view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
allUrl: "",
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.allUrl = '/hybrid/html/web/viewer.html?file='+encodeURIComponent('https://resource.leapy.cn/retired/职业技能培训.pdf')
|
||||
this.getDocment()
|
||||
},
|
||||
methods: {
|
||||
getDocment() {
|
||||
var that = this
|
||||
uni.showLoading({
|
||||
title: '正在加载中..'
|
||||
})
|
||||
uni.downloadFile({
|
||||
url: 'https://resource.leapy.cn/retired/职业技能培训.pdf',
|
||||
success: function(res) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: 'pdf',
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
uni.hideLoading()
|
||||
console.log('打开文档成功');
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading()
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
},
|
||||
complete: function(r) {
|
||||
console.log(r, 'r');
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,30 +1,35 @@
|
|||
<template>
|
||||
<!-- 新鲜事页/话题分类 -->
|
||||
<view class="news-topic-cate">
|
||||
<u-navbar placeholder>
|
||||
<u-icon slot="left" @click="nav" name="arrow-left" color="#000000" size="22"></u-icon>
|
||||
<view slot="center" style="margin-right: 100rpx;">
|
||||
<u-search v-model="queryParams.asset_name" placeholder="搜索新鲜事" @search='search'
|
||||
:showAction="false"></u-search>
|
||||
</view>
|
||||
</u-navbar>
|
||||
<!-- 标签 -->
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs class="wrap-card" ref="tabs" @change="changeTab" :list="tablist" :current="tabIndex"
|
||||
lineColor="#3c9cff" :activeStyle="{color:'#3c9cff'}" :inactiveStyle="{color:'#909399'}" lineWidth="30"
|
||||
:scrollable="false">
|
||||
<u-tabs class="wrap-card" ref="tabs" @change="changeTab" :list="groupList" :current="tabIndex"
|
||||
lineColor="#3c9cff" keyName='group_name' :activeStyle="{color:'#3c9cff'}"
|
||||
:inactiveStyle="{color:'#909399'}" lineWidth="30" :scrollable="false">
|
||||
</u-tabs>
|
||||
</u-sticky>
|
||||
<!-- 图文列表 -->
|
||||
<swiper class="wrap-card flex-1" :current="swiperIndex" @animationfinish="animationfinish">
|
||||
<swiper-item class="h-full" v-for="(item, index) in swiperList" :key="index">
|
||||
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
|
||||
<!-- 有内容 -->
|
||||
<template v-if="item.list.length > 0">
|
||||
<topic-list class="px-20" :item="item1" v-for="(item1,index1) in item.list" :key="index1"></topic-list>
|
||||
<u-loadmore :status="loadStatus[tabIndex]"></u-loadmore>
|
||||
</template>
|
||||
<!-- 无内容 -->
|
||||
<template v-else>
|
||||
<u-empty text="本来无一物,何处惹尘埃" icon="/static/img/demo/winter.png" textSize="16" marginTop='25%'
|
||||
mode="list"></u-empty>
|
||||
</template>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 有内容 -->
|
||||
<view v-if="assetList.length > 0">
|
||||
<topic-list @click.native="goTopicDetail(item1)" :item="item1" v-for="(item1,index1) in assetList"
|
||||
:key="index1"></topic-list>
|
||||
<u-loadmore :status="status"></u-loadmore>
|
||||
</view>
|
||||
<!-- 无内容 -->
|
||||
<view v-else>
|
||||
<view class="default-img">
|
||||
<image style='width: 400rpx;height: 200rpx' src="../../static/img/demo/default-img.png" mode="">
|
||||
</image>
|
||||
<text class="desc">暂无内容,去其他的看看吧</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -32,83 +37,189 @@
|
|||
import {
|
||||
topicList
|
||||
} from "@/utils/data/data.js"
|
||||
import TopicList from "@/pages/news/cpns/topic-list.vue"
|
||||
import TopicList from "@/pages/news/cpns/topic-lists.vue"
|
||||
import {
|
||||
groupList,
|
||||
assetList,
|
||||
assetInfo
|
||||
} from '@/api/train.js'
|
||||
export default {
|
||||
components: {
|
||||
TopicList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 加载更多
|
||||
loadStatus: ['loadmore', 'loadmore', 'loadmore', 'loadmore', 'loadmore', 'loadmore'],
|
||||
// 标签栏
|
||||
tabIndex: 0,
|
||||
tablist: [{
|
||||
name: "关注"
|
||||
},
|
||||
{
|
||||
name: "谷雨"
|
||||
},
|
||||
{
|
||||
name: "芒种"
|
||||
},
|
||||
{
|
||||
name: "小满",
|
||||
count: 5
|
||||
},
|
||||
{
|
||||
name: "霜降"
|
||||
},
|
||||
{
|
||||
name: "寒露"
|
||||
}
|
||||
],
|
||||
// 列表数据
|
||||
swiperIndex: 0,
|
||||
swiperList: topicList
|
||||
queryParams: {
|
||||
asset_name: "",
|
||||
org_id: getApp().globalData.org_id,
|
||||
type: '',
|
||||
group_id: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
groupParams: {
|
||||
type: "",
|
||||
org_id: getApp().globalData.org_id,
|
||||
},
|
||||
groupList: [],
|
||||
assetList: [],
|
||||
count: 0,
|
||||
status: 'loadmore',
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.assetList.length >= that.count) {
|
||||
this.status = 'nomore';
|
||||
return
|
||||
}
|
||||
this.page++
|
||||
this.status = 'loading';
|
||||
this.getList()
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
this.queryParams.type = options.type
|
||||
this.groupParams.type = options.type
|
||||
this.getGroupList()
|
||||
},
|
||||
methods: {
|
||||
getGroupList() {
|
||||
var that = this
|
||||
groupList(that.groupParams).then(res => {
|
||||
that.groupList = res.data
|
||||
that.queryParams.group_id = res.data[0].group_id
|
||||
that.getLists()
|
||||
})
|
||||
},
|
||||
|
||||
async getLists() {
|
||||
var that = this
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
var res = await assetList(that.queryParams)
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
if (res.data.length < that.queryParams.limit) {
|
||||
that.status = 'nomore'
|
||||
}
|
||||
that.assetList = that.assetList.concat(res.data)
|
||||
that.count = res.count
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
getPdfInfo(item) {
|
||||
// pdf文档
|
||||
uni.showLoading({
|
||||
title: '加载文档中..'
|
||||
})
|
||||
assetInfo({
|
||||
id: item.asset_id
|
||||
}).then(res => {
|
||||
uni.downloadFile({
|
||||
url: res.data.pdf_url,
|
||||
success: function(res) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: 'pdf',
|
||||
showMenu: true,
|
||||
success: function(res) {
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
complete: function(r) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
goTopicDetail(item) {
|
||||
console.log(item,'item');
|
||||
switch (item.type) {
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/detail?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
this.getPdfInfo(item)
|
||||
break;
|
||||
case 3:
|
||||
// 课程
|
||||
uni.navigateTo({
|
||||
url: '/pages/news/course?assets_id=' + item.asset_id
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
// tab栏切换
|
||||
changeTab(item) {
|
||||
this.tabIndex = item.index
|
||||
this.swiperIndex = item.index
|
||||
this.page = 1
|
||||
this.assetList = []
|
||||
this.queryParams.group_id = item.group_id
|
||||
this.getLists()
|
||||
},
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
this.tabIndex = e.detail.current
|
||||
this.swiperIndex = e.detail.current
|
||||
nav() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
// scroll-view到底部加载更多
|
||||
reachBottom() {
|
||||
// 是否可加载
|
||||
if (this.loadStatus[this.tabIndex] !== 'loadmore') return;
|
||||
// 加载更多
|
||||
this.loadStatus.splice(this.tabIndex, 1, "loading");
|
||||
setTimeout(() => {
|
||||
this.getList(this.tabIndex);
|
||||
}, 1000);
|
||||
search() {
|
||||
this.page = 1
|
||||
this.assetList = []
|
||||
this.getLists()
|
||||
},
|
||||
// 获取列表
|
||||
getList(idx) {
|
||||
// 随机添加5条数据
|
||||
for (let i = 0; i < 5; i++) {
|
||||
let index = this.$u.random(0, this.swiperList[idx].list.length - 1);
|
||||
let data = JSON.parse(JSON.stringify(this.swiperList[idx].list[index]));
|
||||
this.swiperList[idx].list.push(data);
|
||||
}
|
||||
// 更新加载状态
|
||||
this.loadStatus.splice(this.tabIndex, 1, "nomore")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f7f8ff;
|
||||
}
|
||||
|
||||
.news-topic-cate {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - var(--window-top));
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
.default-img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 350rpx;
|
||||
|
||||
.desc {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #595959;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 282 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 148 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 278 KiB |
|
|
@ -2,7 +2,6 @@ import {
|
|||
login
|
||||
} from '@/api/login.js'
|
||||
|
||||
|
||||
function codes() {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
|
|
@ -11,12 +10,18 @@ function codes() {
|
|||
if (res.errMsg == "login:ok") {
|
||||
login({
|
||||
code: res.code,
|
||||
org_id: "1",
|
||||
}).then(res => {
|
||||
console.log(res, '切换门店code返回---------')
|
||||
org_id: getApp().globalData.org_id,
|
||||
}).then(response => {
|
||||
//注册的 保存token
|
||||
if (res.data.token) {
|
||||
uni.setStorageSync('token', res.data.token)
|
||||
if (response.data.token) {
|
||||
uni.setStorageSync('token', response.data.token)
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/mine/edit-info?type=register' + '&code=' + res.code
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,15 +13,8 @@ export const apiResquest = (prams) => {
|
|||
},
|
||||
success: (res) => {
|
||||
// uni.hideLoading()
|
||||
if (res.data.code != 200) {
|
||||
if (res.data.code == 402 || res.data.code == 401) {
|
||||
if (res.data.code == 1) {
|
||||
wxCode.codes()
|
||||
}
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
resolve(res.data);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
// rsa.js
|
||||
import JSEncrypt from 'jsencrypt';
|
||||
|
||||
const publicKey = `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtdxd5D6SahDExxEPsEvHkT5RShkay2xAYdqNGuQnLHcf8yJqPkwylyz8mrGUqrhahC/rbkzUk/liT0omMkmKWkm+cNSyVxqv4YvQ5446LAbqsbaZqxtbsJbtcL4tUZospwnwZynwQnNIO8hmeF3EOuuX7WzaxwS7Ugf8acn9Tez8GCijhtipqySr9Q5SLd9F7HV8EXohpfNDR5uAEL7hgJWe1tGi91eScSt9IEMS2CWEZzCi6WilfyQ8cSFjlBL9MC/LAnlm48b+MS2KBIVDtA2PodGWQMWn8UzXrob6Du2gjlBIWUr5Hu5/kx1IhVYZCctHHBK+fSqftTdJMsRQRwIDAQAB`;
|
||||
|
||||
export const rsaEncrypt = (data) => {
|
||||
const encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(publicKey);
|
||||
const encryptedData = encrypt.encrypt(data);
|
||||
return encryptedData;
|
||||
};
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
export default {
|
||||
// 网络状态获取
|
||||
getNetwork(){
|
||||
getNetwork() {
|
||||
uni.getNetworkType({
|
||||
success(res) {
|
||||
if (res.networkType === 'none') {
|
||||
|
|
@ -43,37 +43,38 @@ export default {
|
|||
})
|
||||
},
|
||||
// 热更新
|
||||
update(){
|
||||
update() {
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
|
||||
uni.request({
|
||||
url: 'http://www.example.com/update/',
|
||||
data: {
|
||||
version: widgetInfo.version,
|
||||
name: widgetInfo.name
|
||||
},
|
||||
success: (result) => {
|
||||
var data = result.data;
|
||||
if (data.update && data.wgtUrl) {
|
||||
uni.downloadFile({
|
||||
url: data.wgtUrl,
|
||||
success: (downloadResult) => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime.install(downloadResult.tempFilePath, {
|
||||
force: false
|
||||
}, function() {
|
||||
console.log('install success...');
|
||||
plus.runtime.restart();
|
||||
}, function(e) {
|
||||
console.error('install fail...');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
uni.request({
|
||||
url: 'http://www.example.com/update/',
|
||||
data: {
|
||||
version: widgetInfo.version,
|
||||
name: widgetInfo.name
|
||||
},
|
||||
success: (result) => {
|
||||
var data = result.data;
|
||||
if (data.update && data.wgtUrl) {
|
||||
uni.downloadFile({
|
||||
url: data.wgtUrl,
|
||||
success: (downloadResult) => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime.install(downloadResult.tempFilePath, {
|
||||
force: false
|
||||
}, function() {
|
||||
console.log('install success...');
|
||||
plus.runtime.restart();
|
||||
}, function(e) {
|
||||
console.error('install fail...');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue