20 changed files with 1608 additions and 108 deletions
@ -0,0 +1,167 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
<view style="background: #fff;"> |
|||
|
|||
|
|||
<view style="margin-top: 30rpx;"> |
|||
<view class="inputRow"> |
|||
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image> |
|||
<input type="number" maxlength="6" @input="paswordInput1" :password="showPassword1" placeholder="原密码" |
|||
class="input" /> |
|||
<image class="showImage" :src="img1" mode="aspectFill" @click="showPas('1')"></image> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="inputRow"> |
|||
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image> |
|||
<input type="number" maxlength="6" @input="paswordInput2" :password="showPassword2" placeholder="新密码" |
|||
class="input" /> |
|||
<image :src="img2" class="showImage" mode="aspectFill" @click="showPas('2')"></image> |
|||
</view> |
|||
|
|||
<view class="inputRow" style="border-bottom: none;"> |
|||
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image> |
|||
<input type="number" maxlength="6" @input="paswordInput3" :password="showPassword3" placeholder="确认新密码" |
|||
class="input" /> |
|||
<image :src="img3" class="showImage"mode="aspectFill" @click="showPas('3')"></image> |
|||
|
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<view class="btn" @click="next"> |
|||
<text class="btnText">确定</text> |
|||
</view> |
|||
|
|||
<view v-show="errorsMsg!=''" style="width: 100%;margin-top: 50px;color: #f00; font-size: 18px;text-align: center;">{{errorsMsg}}</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
formData:{ |
|||
original:"", |
|||
password:"", |
|||
confirmPassword:"", |
|||
userSid:"" |
|||
}, |
|||
showPassword1: true, |
|||
showPassword2: true, |
|||
showPassword3: true, |
|||
img1: "/static/loginIcon/notShow.png", |
|||
img2: "/static/loginIcon/notShow.png", |
|||
img3: "/static/loginIcon/notShow.png", |
|||
errorsMsg:"", |
|||
} |
|||
}, |
|||
methods: { |
|||
showPas(index) { |
|||
|
|||
switch (index) { |
|||
case "1": |
|||
this.showPassword1 = !this.showPassword1 |
|||
this.img1 = this.showPassword1 ? "/static/loginIcon/notShow.png" : "/static/loginIcon/isShow.png" |
|||
break; |
|||
case "2": |
|||
this.showPassword2 = !this.showPassword2 |
|||
this.img2 = this.showPassword2 ? "/static/loginIcon/notShow.png" : "/static/loginIcon/isShow.png" |
|||
break; |
|||
case "3": |
|||
this.showPassword3 = !this.showPassword3 |
|||
this.img3 = this.showPassword3 ? "/static/loginIcon/notShow.png" : "/static/loginIcon/isShow.png" |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
paswordInput1(event) { |
|||
this.formData.original = event.target.value |
|||
}, |
|||
paswordInput2(event) { |
|||
this.formData.password = event.target.value; |
|||
}, |
|||
paswordInput3(event) { |
|||
this.formData.confirmPassword = event.target.value; |
|||
}, |
|||
next(){ |
|||
this.formData.userSid = getApp().globalData.sid |
|||
console.log('formData>>>', this.formData) |
|||
this.$api.updatePassword(this.formData).then((resp) => { |
|||
// if (resp.success) { |
|||
console.log('1111', resp) |
|||
this.errorsMsg = "" |
|||
|
|||
}).catch(e => { |
|||
console.log('eeeee', e) |
|||
|
|||
this.errorsMsg = e.msg |
|||
}) |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.pages { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.inputRow { |
|||
flex-direction: row; |
|||
display: flex; |
|||
margin-left: 30rpx; |
|||
margin-right: 30rpx; |
|||
margin-bottom: 10rpx; |
|||
margin-top: 10rpx; |
|||
padding-bottom: 10rpx; |
|||
border-bottom: 0.1px #F1F1F1 solid; |
|||
align-items: center; |
|||
|
|||
.input { |
|||
margin-left: 20rpx; |
|||
height: 70rpx; |
|||
flex: 1; |
|||
font-size: 32rpx; |
|||
} |
|||
|
|||
.drawableLeft { |
|||
width: 40rpx; |
|||
height: 40rpx; |
|||
margin: 20rpx; |
|||
} |
|||
|
|||
.showImage { |
|||
width: 20px; |
|||
height: 20px; |
|||
margin-left: 10px; |
|||
|
|||
} |
|||
} |
|||
|
|||
.btn { |
|||
display: flex; |
|||
width: 90%; |
|||
height: 80rpx; |
|||
flex-direction: column; |
|||
background-color: #007AFF; |
|||
margin-top: 80rpx; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
align-items: center; |
|||
justify-content: center; |
|||
border-radius: 10rpx; |
|||
|
|||
.btnText { |
|||
color: #ffffff; |
|||
font-size: 33rpx; |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,35 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
|
|||
<image style="margin-top: 30px;" src="../../static/baseIcon/NotPermission.png" mode="aspectFill"></image> |
|||
<text style="margin-top: 30px; color: #9F9F9F;">抱歉,您暂无权限访问该页面</text> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
onShow() { |
|||
wx.hideHomeButton() |
|||
|
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.pages{ |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
} |
|||
</style> |
@ -0,0 +1,353 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
<view> |
|||
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)"> |
|||
|
|||
<view class="item-top"> |
|||
|
|||
<view class="item-top-text">{{item.messageName}}</view> |
|||
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image> |
|||
</view> |
|||
|
|||
<view class="item-con"> |
|||
<view> |
|||
<text class="item-con-text">提交人:</text> |
|||
<text class="item-con-text">{{item.name}}</text> |
|||
</view> |
|||
<view style="margin-top: 8px;"> |
|||
<text class="item-con-text">提交时间:</text> |
|||
<text class="item-con-text">{{item.date}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<!-- <uni-load-more :status="loadingType"></uni-load-more> --> |
|||
|
|||
</view> |
|||
<!-- 加载....没有更多 --> |
|||
<view style="line-height: 60rpx;margin-bottom: 50rpx;"> |
|||
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
|||
</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
triggered: true, |
|||
status: 'loadmore', |
|||
iconType: 'flower', |
|||
loadText: { |
|||
loadmore: '轻轻上拉', |
|||
loading: '努力加载中', |
|||
nomore: '拉也没用,没有了' |
|||
}, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
userSid: "", |
|||
messageName: "", |
|||
state:"0", //0未读 1 已读 2全部 |
|||
} |
|||
}, |
|||
loadingType: 'more', //加载更多状态 |
|||
dataList: [ |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
|
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
|
|||
], |
|||
}; |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.listQuery.current = 1 |
|||
this.loadData('refresh'); |
|||
setTimeout(function() { |
|||
uni.stopPullDownRefresh(); |
|||
}, 2000); |
|||
}, |
|||
//加载更多 |
|||
onReachBottom() { |
|||
this.listQuery.current = this.listQuery.current + 1 |
|||
this.loadData(); |
|||
}, |
|||
onShow() { |
|||
console.log('onShow', getApp().globalData.isLogin) |
|||
|
|||
let token = uni.getStorageSync("Global-Auth-Token") |
|||
if (token != null && token.length != 0) { |
|||
getApp().globalData.token = token |
|||
} |
|||
let isLogin = uni.getStorageSync("isLogin") |
|||
if (isLogin != null && isLogin == 1) { |
|||
getApp().globalData.isLogin = isLogin |
|||
} |
|||
let sid = uni.getStorageSync("sid") |
|||
if (sid != null && sid.length != 0) { |
|||
getApp().globalData.sid = sid |
|||
} |
|||
|
|||
console.log('用户Sid', getApp().globalData.sid) |
|||
console.log('token', getApp().globalData.token) |
|||
console.log('是否登陆', getApp().globalData.isLogin) |
|||
|
|||
// setTimeout(() => { |
|||
if (getApp().globalData.isLogin) { |
|||
var userSid = getApp().globalData.sid |
|||
console.log(">>>>>", userSid) |
|||
|
|||
this.listQuery.params.userSid = userSid |
|||
|
|||
this.loadData(); |
|||
// uni.setTabBarBadge({ //显示数字 |
|||
// index: 0, //tabbar下标 |
|||
// text: '100' //数字 |
|||
// }) |
|||
} else { |
|||
|
|||
/* #ifdef MP-WEIXIN */ |
|||
this.WxSilentLogin() |
|||
/* #endif */ |
|||
|
|||
/* #ifdef APP-PLUS */ |
|||
uni.redirectTo({ |
|||
url: '../login/login' |
|||
}) |
|||
/* #endif */ |
|||
} |
|||
}, |
|||
methods: { |
|||
itemClick(item) { |
|||
console.log('item', item.pagepath) |
|||
uni.navigateTo({ |
|||
url: "/" + item.pagepath |
|||
}) |
|||
}, |
|||
//加载商品 ,带下拉刷新和上滑加载 |
|||
async loadData(type = 'add', loading) { |
|||
//没有更多直接返回 |
|||
if (type === 'add') { |
|||
if (this.loadingType === 'nomore') { |
|||
return; |
|||
} |
|||
this.loadingType = 'loading'; |
|||
} else { |
|||
this.loadingType = 'more'; |
|||
} |
|||
|
|||
var list = [] |
|||
|
|||
this.$api.messageListPage(this.listQuery).then((resp) => { |
|||
// if (resp.success) { |
|||
console.log('1111', resp) |
|||
|
|||
// list = resp.records |
|||
|
|||
for (var i = 0; i < resp.records.length; i++) { |
|||
var item = resp.records[i] |
|||
var title = item.map.thing2 |
|||
console.log("title", title) |
|||
|
|||
list.push({ |
|||
messageName: title, |
|||
name: item.map.thing3, |
|||
date: item.map.time1, |
|||
pagepath: item.pagepath |
|||
}) |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
console.log("消息列表", list) |
|||
if (type === 'refresh') { |
|||
this.dataList = []; |
|||
} |
|||
|
|||
this.dataList = this.dataList.concat(list); |
|||
console.log("消息列表>>>>>", this.dataList.length) |
|||
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
|||
this.loadingType = this.dataList.length > list.total ? 'nomore' : 'more'; |
|||
if (type === 'refresh') { |
|||
if (loading == 1) { |
|||
uni.hideLoading(); |
|||
} else { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
} |
|||
|
|||
}).catch(e => { |
|||
console.log('eeeee', e) |
|||
}) |
|||
|
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.pages { |
|||
width: 100%; |
|||
height: 100%; |
|||
|
|||
.newslist { |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #fff; |
|||
border-radius: 12px; |
|||
margin-left: 12px; |
|||
margin-right: 12px; |
|||
margin-top: 12px; |
|||
padding: 15px 20px; |
|||
|
|||
.item-top { |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
padding-bottom: 12px; |
|||
padding-left: 5px; |
|||
padding-right: 5px; |
|||
border-bottom: 1px solid #F1F3F5; |
|||
|
|||
.item-top-img { |
|||
width: 18px; |
|||
height: 18px; |
|||
} |
|||
|
|||
.item-top-text { |
|||
flex: 1; |
|||
margin-right: 10px; |
|||
font-size: 16px; |
|||
color: #101010; |
|||
font-weight: 600; |
|||
font-family: sans-serif; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 1; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
|
|||
.item-top-text2 { |
|||
font-size: 14px; |
|||
color: #0A59F7; |
|||
} |
|||
} |
|||
|
|||
.item-con { |
|||
margin-top: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.item-con-text { |
|||
font-size: 15px; |
|||
color: #666666; |
|||
} |
|||
} |
|||
|
|||
.item-bom { |
|||
width: 100%; |
|||
margin-top: 12px; |
|||
padding-top: 10px; |
|||
border-top: 1px solid #F1F3F5; |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
justify-content: end; |
|||
|
|||
.item-bom-img { |
|||
width: 14px; |
|||
height: 14px; |
|||
} |
|||
|
|||
.item-bom-text { |
|||
margin-left: 5px; |
|||
font-size: 14px; |
|||
color: #999; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,356 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
<view> |
|||
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)"> |
|||
|
|||
<view class="item-top"> |
|||
|
|||
<view class="item-top-text">{{item.messageName}}</view> |
|||
<image class="item-top-img" src="../../static/baseIcon/zy.png" mode="aspectFill"></image> |
|||
</view> |
|||
|
|||
<view class="item-con"> |
|||
<view> |
|||
<text class="item-con-text">提交人:</text> |
|||
<text class="item-con-text">{{item.name}}</text> |
|||
</view> |
|||
<view style="margin-top: 8px;"> |
|||
<text class="item-con-text">提交时间:</text> |
|||
<text class="item-con-text">{{item.date}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<!-- <uni-load-more :status="loadingType"></uni-load-more> --> |
|||
|
|||
</view> |
|||
<!-- 加载....没有更多 --> |
|||
<view style="line-height: 60rpx;margin-bottom: 50rpx;"> |
|||
<u-loadmore :status="status" :icon-type="iconType" |
|||
:loading-text="loadText.loading" |
|||
:loadmore-text="loadText.loadmore" |
|||
:nomore-text="loadText.nomore" /> |
|||
</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
triggered: true, |
|||
status: 'loadmore', |
|||
iconType: 'flower', |
|||
loadText: { |
|||
loadmore: '轻轻上拉', |
|||
loading: '努力加载中', |
|||
nomore: '拉也没用,没有了' |
|||
}, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
userSid: "", |
|||
messageName: "", |
|||
state:"1", //0未读 1 已读 2全部 |
|||
} |
|||
}, |
|||
loadingType: 'more', //加载更多状态 |
|||
dataList: [ |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
|
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
// { |
|||
// messageName: "36524质物库存汇总", |
|||
// name: "张磊", |
|||
// date: "2023-08-13 17:14" |
|||
|
|||
// }, |
|||
|
|||
], |
|||
}; |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.listQuery.current = 1 |
|||
this.loadData('refresh'); |
|||
setTimeout(function() { |
|||
uni.stopPullDownRefresh(); |
|||
}, 2000); |
|||
}, |
|||
//加载更多 |
|||
onReachBottom() { |
|||
this.listQuery.current = this.listQuery.current + 1 |
|||
this.loadData(); |
|||
}, |
|||
onShow() { |
|||
console.log('onShow', getApp().globalData.isLogin) |
|||
|
|||
let token = uni.getStorageSync("Global-Auth-Token") |
|||
if (token != null && token.length != 0) { |
|||
getApp().globalData.token = token |
|||
} |
|||
let isLogin = uni.getStorageSync("isLogin") |
|||
if (isLogin != null && isLogin == 1) { |
|||
getApp().globalData.isLogin = isLogin |
|||
} |
|||
let sid = uni.getStorageSync("sid") |
|||
if (sid != null && sid.length != 0) { |
|||
getApp().globalData.sid = sid |
|||
} |
|||
|
|||
console.log('用户Sid', getApp().globalData.sid) |
|||
console.log('token', getApp().globalData.token) |
|||
console.log('是否登陆', getApp().globalData.isLogin) |
|||
|
|||
// setTimeout(() => { |
|||
if (getApp().globalData.isLogin) { |
|||
var userSid = getApp().globalData.sid |
|||
console.log(">>>>>", userSid) |
|||
|
|||
this.listQuery.params.userSid = userSid |
|||
|
|||
this.loadData(); |
|||
// uni.setTabBarBadge({ //显示数字 |
|||
// index: 0, //tabbar下标 |
|||
// text: '100' //数字 |
|||
// }) |
|||
} else { |
|||
|
|||
/* #ifdef MP-WEIXIN */ |
|||
this.WxSilentLogin() |
|||
/* #endif */ |
|||
|
|||
/* #ifdef APP-PLUS */ |
|||
uni.redirectTo({ |
|||
url: '../login/login' |
|||
}) |
|||
/* #endif */ |
|||
} |
|||
}, |
|||
methods: { |
|||
itemClick(item) { |
|||
console.log('item', item.pagepath) |
|||
uni.navigateTo({ |
|||
url: "/" + item.pagepath |
|||
}) |
|||
}, |
|||
//加载商品 ,带下拉刷新和上滑加载 |
|||
async loadData(type = 'add', loading) { |
|||
//没有更多直接返回 |
|||
if (type === 'add') { |
|||
if (this.status === 'nomore') { |
|||
return; |
|||
} |
|||
this.status = 'loading'; |
|||
} else { |
|||
this.status = 'more'; |
|||
} |
|||
|
|||
var list = [] |
|||
|
|||
this.$api.messageListPage(this.listQuery).then((resp) => { |
|||
// if (resp.success) { |
|||
console.log('1111', resp) |
|||
|
|||
// list = resp.records |
|||
|
|||
for (var i = 0; i < resp.records.length; i++) { |
|||
var item = resp.records[i] |
|||
var title = item.map.thing2 |
|||
console.log("title", title) |
|||
|
|||
list.push({ |
|||
messageName: title, |
|||
name: item.map.thing3, |
|||
date: item.map.time1, |
|||
pagepath: item.pagepath |
|||
}) |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
console.log("消息列表", list) |
|||
if (type === 'refresh') { |
|||
this.dataList = []; |
|||
} |
|||
|
|||
this.dataList = this.dataList.concat(list); |
|||
console.log("消息列表>>>>>", this.dataList.length) |
|||
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了) |
|||
this.status = this.dataList.length > list.total ? 'nomore' : 'more'; |
|||
if (type === 'refresh') { |
|||
if (loading == 1) { |
|||
uni.hideLoading(); |
|||
} else { |
|||
uni.stopPullDownRefresh(); |
|||
} |
|||
} |
|||
|
|||
}).catch(e => { |
|||
console.log('eeeee', e) |
|||
}) |
|||
|
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.pages { |
|||
width: 100%; |
|||
height: 100%; |
|||
|
|||
.newslist { |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #fff; |
|||
border-radius: 12px; |
|||
margin-left: 12px; |
|||
margin-right: 12px; |
|||
margin-top: 12px; |
|||
padding: 15px 20px; |
|||
|
|||
.item-top { |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
padding-bottom: 12px; |
|||
padding-left: 5px; |
|||
padding-right: 5px; |
|||
border-bottom: 1px solid #F1F3F5; |
|||
|
|||
.item-top-img { |
|||
width: 18px; |
|||
height: 18px; |
|||
} |
|||
|
|||
.item-top-text { |
|||
flex: 1; |
|||
margin-right: 10px; |
|||
font-size: 16px; |
|||
color: #101010; |
|||
font-weight: 600; |
|||
font-family: sans-serif; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 1; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
|
|||
.item-top-text2 { |
|||
font-size: 14px; |
|||
color: #0A59F7; |
|||
} |
|||
} |
|||
|
|||
.item-con { |
|||
margin-top: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.item-con-text { |
|||
font-size: 15px; |
|||
color: #666666; |
|||
} |
|||
} |
|||
|
|||
.item-bom { |
|||
width: 100%; |
|||
margin-top: 12px; |
|||
padding-top: 10px; |
|||
border-top: 1px solid #F1F3F5; |
|||
display: flex; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
justify-content: end; |
|||
|
|||
.item-bom-img { |
|||
width: 14px; |
|||
height: 14px; |
|||
} |
|||
|
|||
.item-bom-text { |
|||
margin-left: 5px; |
|||
font-size: 14px; |
|||
color: #999; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,56 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
<view class="item" @click="itemClick('1')"> |
|||
|
|||
<text class="text">密码设置</text> |
|||
<image src="../../static/baseIcon/zy.png" style="width: 15px;height: 15px;"></image> |
|||
</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
itemClick(index) { |
|||
switch (index) { |
|||
case "1": |
|||
uni.navigateTo({ |
|||
url: '../index/ChangePassword' |
|||
}); |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.pages { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.item { |
|||
background: #fff; |
|||
padding: 20px 15px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
|
|||
.text { |
|||
color: #101010; |
|||
font-size: 16px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,114 @@ |
|||
<template> |
|||
<view class="pages"> |
|||
<view class="item" > |
|||
|
|||
<text class="text">头像</text> |
|||
<image :src="headImage" class="img" @click="chooseImage"></image> |
|||
</view> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import config from '@/common/config.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
uploadAction: config.baseUrl + "/portal/v1/sysuser/uploadfile", |
|||
headImage: getApp().globalData.headImage |
|||
// headImage: "https://supervise.yxtsoft.com/img/user/userImage.png" |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
chooseImage() { |
|||
wx.chooseImage({ |
|||
count: 1, // 可选择的图片数量 |
|||
sizeType: ['compressed'], // 压缩图片 |
|||
sourceType: ['album', 'camera'], // 来源:相册或相机 |
|||
success: (res)=> { |
|||
// 将选择的图片上传到服务器 |
|||
console.log(res.tempFilePaths); |
|||
this.uploadImage(res.tempFilePaths[0]); |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
uploadImage(imagePath) { |
|||
let _this = this |
|||
wx.uploadFile({ |
|||
url: _this.uploadAction, // 上传图片的接口地址 |
|||
fileType: "image", |
|||
filePath: imagePath, // 图片文件路径 |
|||
name: 'file', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |
|||
success: (res) => { |
|||
// 上传成功后,将服务器返回的图片地址更新到image标签中 |
|||
console.log("1111111",res.data) |
|||
|
|||
let info = JSON.parse(res.data) |
|||
|
|||
console.log("info", info) |
|||
console.log("data", info.data) |
|||
console.log("fullUrl",info.data.fullUrl) |
|||
_this.headImage=info.data.fullUrl |
|||
|
|||
console.log("2222",_this.headImage); |
|||
|
|||
getApp().globalData.headImage = _this.headImage |
|||
|
|||
_this.saveImaage( _this.headImage) |
|||
}, |
|||
fail: function (res) { |
|||
console.log(res); |
|||
} |
|||
}) |
|||
}, |
|||
saveImaage(url){ |
|||
|
|||
var info ={ |
|||
userSid:getApp().globalData.sid, |
|||
headImage:url, |
|||
} |
|||
console.log("info",info); |
|||
this.$api.uploadHandImage(info).then((resp) => { |
|||
// if (resp.success) { |
|||
console.log('1111', resp) |
|||
|
|||
}).catch(e => { |
|||
console.log('eeeee', e) |
|||
|
|||
}) |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.pages { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.item { |
|||
background: #fff; |
|||
padding: 20px 20px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
.text { |
|||
color: #101010; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.img { |
|||
width: 45px; |
|||
height:45px; |
|||
border-radius: 5px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
After Width: | Height: | Size: 10 KiB |
Loading…
Reference in new issue