Commit a4914849 by sunerhu

1.修改邀请加盟选择不了所属组织Bug

2.修复进入邀请加盟页面查询到上一个人填写信息。
3.修复个人中心页面头像显示不正确/修复个人中心修改页
parent 55f4775c
...@@ -25,26 +25,32 @@ ...@@ -25,26 +25,32 @@
size="12" size="12"
></uni-icons> ></uni-icons>
</view> </view>
<!-- r -->
<!-- item.levelCode==A1 与 item.type == 2相关项-->
<!-- c3与type1 -->
<!-- B1与type1 -->
<!-- else -->
<view @click="open(item, i)" v-if="item.level && !item.hasChildren" style="width: 24rpx;height: 26rpx;display: inline-block;"></view> <view @click="open(item, i)" v-if="item.level && !item.hasChildren" style="width: 24rpx;height: 26rpx;display: inline-block;"></view>
<view v-else @click="open(item, i)" :class="item.levelCode == 'B1' ? 'content-box-title-a' : item.levelCode == 'C3' ? 'content-box-title-b':'content-box-title'"> <!-- <view @click="open(item, i)" :class="item.levelCode == 'B1'&& item.type ==1 ? 'content-box-title-a' : item.levelCode == 'C3' ? 'content-box-title-b':'content-box-title'">
<!-- class="d-header" --> </view> -->
<!-- class="d-header" --> <view @click="open(item, i)" style="flex: 1;text-align: left;" class="content-box-title-a" v-else-if="item.levelCode == 'B1'&& item.itemType == '1'">
<!-- :class="item.levelCode == 'B1' ? 'content-box-title-a' : item.levelCode == 'C3' ? 'content-box-title-b':'content-box-title'" --> <text >{{item.areaCenterName}}</text>
<!-- <view > -->
<text style="color: #000;" v-if="item.levelCode == 'A1'" >{{ item.name || '张麻花' }}</text>
<text style="color: #FFFFFF;" v-if="item.levelCode == 'B1'" >{{ item.name || '张麻花' }}</text>
<text v-else >{{ item.areaCenterName || '张麻花' }}</text>
<!-- </view> -->
</view> </view>
<view @click="open(item, i)" style="flex: 1;" class="content-box-title-b" v-else-if="item.levelCode == 'C3'&& item.itemType == '1'">
<text>{{item.areaCenterName}}</text>
</view>
<view style="flex: 1;" v-else>
<text>{{item.name}}</text>
</view>
</view> </view>
<!-- <text v-else class=""></text> --> <!-- <text v-else class=""></text> -->
<!-- </view> --> <!-- </view> -->
</view> </view>
<view class="d-td">{{ item.levelName }}</view> <view class="d-td" v-if="item.levelCode == 'A1'">{{ item.levelName }}</view>
<view class="d-td" v-else></view>
<view class="d-td" style="padding-right: 10rpx;">{{ item.count }}</view> <view class="d-td" style="padding-right: 10rpx;">{{ item.count }}</view>
</view> </view>
</block> </block>
...@@ -329,6 +335,8 @@ export default { ...@@ -329,6 +335,8 @@ export default {
.content-box-title-a { .content-box-title-a {
// min-width: 100rpx; // min-width: 100rpx;
flex: 1; flex: 1;
text-align: left;
margin-left: 40rpx;
// background: url('../../static/myteam/Group1660.png'); // background: url('../../static/myteam/Group1660.png');
// background: url('../../static/myteam/Group1660.png') no-repeat; // background: url('../../static/myteam/Group1660.png') no-repeat;
// background-repeat: no-repeat; // background-repeat: no-repeat;
...@@ -341,6 +349,8 @@ export default { ...@@ -341,6 +349,8 @@ export default {
.content-box-title-b{ .content-box-title-b{
// min-width: 100rpx; // min-width: 100rpx;
flex: 1; flex: 1;
margin-left: 40rpx;
text-align: left;
// min-height: 60rpx; // min-height: 60rpx;
// padding: 10rpx 0; // padding: 10rpx 0;
border: 2rpx solid #3F52B7; border: 2rpx solid #3F52B7;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
"statusbar": { "statusbar" : {
"immersed": false "immersed" : false
}, },
"usingComponents" : true, "usingComponents" : true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler" : "uni-app",
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>申请身份</text> <text>申请身份</text>
<picker @change="changeIdentity" :value="identityIdx" :range="identityArr" <text v-if="partnerLevelName">{{partnerLevelName}}</text>
<picker v-else @change="changeIdentity" :value="identityIdx" :range="identityArr"
range-key="name" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> range-key="name" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2">
<view class="uni-input">{{identityArr[identityIdx]['name']}} <view class="uni-input">{{identityArr[identityIdx]['name']}}
<text class="iconfont icon-youjiantou"></text> <text class="iconfont icon-youjiantou"></text>
...@@ -48,7 +49,8 @@ ...@@ -48,7 +49,8 @@
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>所属组织</text> <text>所属组织</text>
<picker @change="changeArea" :value="areaIdIdx" :range="cffpAreaQuerys" <text v-if="areaName">{{areaName}}</text>
<picker v-else @change="changeArea" :value="areaIdIdx" :range="cffpAreaQuerys"
range-key="areaName" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"> range-key="areaName" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2">
<view class="uni-input">{{cffpAreaQuerys[areaIdIdx]['areaName']}} <view class="uni-input">{{cffpAreaQuerys[areaIdIdx]['areaName']}}
<text class="iconfont icon-youjiantou"></text> <text class="iconfont icon-youjiantou"></text>
...@@ -57,12 +59,14 @@ ...@@ -57,12 +59,14 @@
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>姓名</text> <text>姓名</text>
<input type="text" class="form-control" v-model="applyParam.name" placeholder="请输入姓名" <text v-if="applyParam.name">{{applyParam.name}}</text>
<input v-else type="text" class="form-control" v-model="applyParam.name" placeholder="请输入姓名"
auto-blur=true @blur="checkInput(1,applyParam.name)" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"/> auto-blur=true @blur="checkInput(1,applyParam.name)" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"/>
</view> </view>
<view class="contentItem"> <view class="contentItem">
<text>手机号</text> <text>手机号</text>
<input type="text" class="form-control" v-model="applyParam.mobileNumber" placeholder="请输入手机号" maxlength="11" <text v-if="applyParam.mobileNumber">{{applyParam.mobileNumber}}</text>
<input v-else type="text" class="form-control" v-model="applyParam.mobileNumber" placeholder="请输入手机号" maxlength="11"
auto-blur=true @blur="checkInput(2,applyParam.mobileNumber)" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"/> auto-blur=true @blur="checkInput(2,applyParam.mobileNumber)" :disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2"/>
</view> </view>
<view class="contentItem"> <view class="contentItem">
...@@ -129,6 +133,10 @@ ...@@ -129,6 +133,10 @@
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`, maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
cffpAreaQuerys:[{areaId:null,areaName:"请选择所属组织",levelOrder:null}], cffpAreaQuerys:[{areaId:null,areaName:"请选择所属组织",levelOrder:null}],
areaIdIdx:0, areaIdIdx:0,
areaName: null,
partnerLevelName: null,
name:null,
mobile:null,
cffp_userInfo:{ cffp_userInfo:{
name:'', name:'',
mobile:'' mobile:''
...@@ -137,6 +145,16 @@ ...@@ -137,6 +145,16 @@
}, },
components:{}, components:{},
onLoad(options){ onLoad(options){
console.log(options, 'suiuhshuhsuibhu')
if(options.dataForm){
let dataOneForm = JSON.parse(options.dataForm)
this.applyParam.name = dataOneForm.name
this.applyParam.mobileNumber = dataOneForm.mobile
this.areaName = dataOneForm.areaName
this.partnerLevelName = dataOneForm.partnerLevel == 'A1' ? '事业伙伴' : '工作室'
this.applyParam.areaId = dataOneForm.areaId
uni.setStorageSync('applyId','')
}
this.erpInitialize(); this.erpInitialize();
// let routes = getCurrentPages(); // 获取当前打开过的页面路由数组 // let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
// let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由 // let curRoute = routes[routes.length - 1].route // 获取当前页面路由,也就是最后一个打开的页面路由
...@@ -144,11 +162,11 @@ ...@@ -144,11 +162,11 @@
if(!uni.getStorageSync('applyId') && options.shareId){ if(!uni.getStorageSync('applyId') && options.shareId){
this.queryById(options.id,null) this.queryById(options.id,null)
} }
this.cffp_userInfo = uni.getStorageSync('cffp_userInfo'); // this.cffp_userInfo = uni.getStorageSync('cffp_userInfo');
if(this.cffp_userInfo){ // if(this.cffp_userInfo){
this.applyParam.name = JSON.parse(uni.getStorageSync('cffp_userInfo'))['name']; // this.applyParam.name = JSON.parse(uni.getStorageSync('cffp_userInfo'))['name'];
this.applyParam.mobileNumber = JSON.parse(uni.getStorageSync('cffp_userInfo'))['mobile']; // this.applyParam.mobileNumber = JSON.parse(uni.getStorageSync('cffp_userInfo'))['mobile'];
} // }
}, },
mounted() { mounted() {
setTimeout(()=>{ setTimeout(()=>{
......
<template> <template>
<view class="container"> <view class="container">
<view class="shareheader" style="" v-if="coursesharing != 1"> <view class="shareheader" style="" v-if="coursesharing != 1">
<view class="iconfont icon-youjiantou" @click="goBack()"> <view class="iconfont icon-youjiantou" style="margin-left: 30rpx;" @click="goBack()">
</view> </view>
<view class="share-entrance"> <view class="share-entrance">
<view style="z-index: 99999;"> <view style="z-index: 99999;">
...@@ -182,27 +182,29 @@ ...@@ -182,27 +182,29 @@
jumpapp() { jumpapp() {
let platform = uni.getSystemInfoSync().platform let platform = uni.getSystemInfoSync().platform
if (platform == 'ios') { if (platform == 'ios') {
var loadDateTime = new Date(); // var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 500) {
window.location.href = "https://mcffp.anjibao.cn/app/"; window.location.href = "https://mcffp.anjibao.cn/app/";
} else { // window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
window.location = "www.baidu.com"; //ios下载地址 // var timeOutDateTime = new Date();
} // if (timeOutDateTime - loadDateTime < 500) {
}, 500); // window.location.href = "https://mcffp.anjibao.cn/app/";
// } else {
// window.location.href = "www.baidu.com"; //ios下载地址
// }
// }, 500);
} else if (platform == 'android') { } else if (platform == 'android') {
var loadDateTime = new Date();
window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
var timeOutDateTime = new Date();
if (timeOutDateTime - loadDateTime < 500) {
window.open('cffpapp://'); window.open('cffpapp://');
} else { // var loadDateTime = new Date();
// window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址 // window.setTimeout(function() { //如果没有安装app,便会执行setTimeout跳转下载页
window.location = "www.baidu.com"; //ios下载地址 // var timeOutDateTime = new Date();
} // if (timeOutDateTime - loadDateTime < 500) {
}, 500);
// } else {
// // window.location = "https://mdev.anjibao.cn/cffp/app.ipa"; //ios下载地址
// window.location = "www.baidu.com"; //ios下载地址
// }
// }, 500);
} }
}, },
...@@ -482,6 +484,7 @@ ...@@ -482,6 +484,7 @@
this.shareCode = option.shareCode this.shareCode = option.shareCode
this.shareUserId = option.shareUserId this.shareUserId = option.shareUserId
this.getuserRead() this.getuserRead()
uni.setStorageSync('h5_coursesharing', this.coursesharing);
// this.getshareData() // this.getshareData()
} }
...@@ -585,12 +588,12 @@ ...@@ -585,12 +588,12 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-right: 30rpx;
.image { .image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
margin-top: 10rpx; // margin-top: 10rpx;
margin-right: 25rpx; // margin-right: 25rpx;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="container"> <view class="container">
<view class="logo"> <view class="logo">
<view class="" style="width: 120rpx;"> <view class="" style="width: 120rpx;">
<image src="../../static/cffp_logo.jpg" alt="" mode="widthFix"></image> <image src="../../static/cffp_logo.png" alt="" mode="widthFix"></image>
</view> </view>
<text>欢迎使用CFFP</text> <text>欢迎使用CFFP</text>
</view> </view>
...@@ -36,10 +36,12 @@ ...@@ -36,10 +36,12 @@
getqueryById(){ getqueryById(){
api.queryById({id:this.shareId}).then(res =>{ api.queryById({id:this.shareId}).then(res =>{
this.areaName = res.data.data.areaName this.areaName = res.data.data.areaName
this.areaId = res.data.data.areaId
this.invitationName = res.data.data.invitationName this.invitationName = res.data.data.invitationName
this.name = res.data.data.name this.name = res.data.data.name
this.mobileNumber = res.data.data.mobileNumber this.mobileNumber = res.data.data.mobileNumber
this.levelaName = res.data.data.partnerLevel == 'B1' ?'工作室': '事业合作伙伴' this.levelaName = res.data.data.partnerLevel == 'B1' ?'工作室': '事业伙伴'
this.partnerLevel = res.data.data.partnerLevel
}) })
}, },
ckregister(){ ckregister(){
...@@ -50,7 +52,7 @@ ...@@ -50,7 +52,7 @@
// };' // };'
uni.navigateTo({ uni.navigateTo({
// url:'/pages/invitationRegister/invitationlogin?name=' + this.name+'&mobile=' +this.mobileNumber + '&id=' + this.shareId // url:'/pages/invitationRegister/invitationlogin?name=' + this.name+'&mobile=' +this.mobileNumber + '&id=' + this.shareId
url:`/pages/invitationRegister/invitationlogin?name=${this.name}&mobile=${this.mobileNumber}` url:`/pages/invitationRegister/invitationlogin?name=${this.name}&mobile=${this.mobileNumber}&areaName=${this.areaName}&partnerLevel=${this.partnerLevel}&shareId=${this.shareId}&areaId=${this.areaId}`
}) })
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
export default { export default {
data() { data() {
return { return {
imgSrc: '../../static/cffp_logo.jpg', imgSrc: '../../static/cffp_logo.png',
liginName: '登录', liginName: '登录',
disabledSendBtn:false, disabledSendBtn:false,
agreeFlag:false, agreeFlag:false,
...@@ -55,9 +55,13 @@ ...@@ -55,9 +55,13 @@
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options, 54)
this.form.name = options.name?options.name:'' this.form.name = options.name?options.name:''
this.form.mobile = options.mobile? options.mobile: '' this.form.mobile = options.mobile? options.mobile: ''
this.form.id = options.id?options.id:'' this.form.id = options.shareId?options.shareId:''
this.form.areaName = options.areaName
this.form.areaId = options.areaId
this.form.partnerLevel = options.partnerLevel
// this.form =JSON.parse( options.form) // this.form =JSON.parse( options.form)
}, },
methods:{ methods:{
...@@ -120,7 +124,7 @@ ...@@ -120,7 +124,7 @@
uni.setStorageSync('isLogin','1') uni.setStorageSync('isLogin','1')
uni.setStorageSync('cffp_userId',this.userId); uni.setStorageSync('cffp_userId',this.userId);
uni.navigateTo({ uni.navigateTo({
url:'/pages/application-process/basic-info?userId=' + this.userId url:'/pages/application-process/basic-info?userId=' + this.userId + '&dataForm=' + JSON.stringify(this.form) + '&shareId=' + this.form.id
}) })
}else{ }else{
uni.showToast({ uni.showToast({
...@@ -185,7 +189,7 @@ ...@@ -185,7 +189,7 @@
border-bottom: 1px solid #CECECE; border-bottom: 1px solid #CECECE;
padding: 20rpx; padding: 20rpx;
.grey{ .grey{
font-size: 28rpx; font-size: 24rpx;
color: #CECECE; color: #CECECE;
} }
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<text>是否跨区邀请:</text> <text>是否跨区邀请:</text>
<view class="isCrossBox"> <view class="isCrossBox">
<view :class="{checked:isCross}"> <view :class="{checked:isCross}">
<i class="circle" @click="isCross=true"></i> <i class="circle" @click="isCross = true"></i>
<text></text> <text></text>
</view> </view>
<view :class="{checked:!isCross}"> <view :class="{checked:!isCross}">
...@@ -157,6 +157,7 @@ ...@@ -157,6 +157,7 @@
inviteLists: [], inviteLists: [],
orgList: [], orgList: [],
orgdataList: [], orgdataList: [],
queryList:[],
queryorgList: [], queryorgList: [],
shareId: '', shareId: '',
realName:'', realName:'',
...@@ -185,8 +186,8 @@ ...@@ -185,8 +186,8 @@
queryorgchange(e) { queryorgchange(e) {
this.orgindex = e.detail.value this.orgindex = e.detail.value
}, },
bindPChange(){ bindPChange(e){
console.log('1') this.index = e.detail.value
}, },
// 查询组织list // 查询组织list
getqueryOrgList() { getqueryOrgList() {
...@@ -198,6 +199,7 @@ ...@@ -198,6 +199,7 @@
api.queryOrgList(CffpAreaQueryReqVO).then(res => { api.queryOrgList(CffpAreaQueryReqVO).then(res => {
if (res['success']) { if (res['success']) {
this.queryorgList = res.data.cffpAreaQuerys this.queryorgList = res.data.cffpAreaQuerys
console.log(this.queryorgList, 121255)
this.orgList = res.data.cffpAreaQuerys this.orgList = res.data.cffpAreaQuerys
this.changeorgkey() this.changeorgkey()
...@@ -222,7 +224,7 @@ ...@@ -222,7 +224,7 @@
// that.orgdataList = [] // that.orgdataList = []
console.log(that.orgList, 1115) console.log(that.orgList, 1115)
const list = that.orgList.map((item) => { that.queryList = that.orgList.map((item) => {
if(item.partnerLevel == orgKey || item.partnerLevel == 'ALL'){ if(item.partnerLevel == orgKey || item.partnerLevel == 'ALL'){
return item return item
} }
...@@ -234,15 +236,15 @@ ...@@ -234,15 +236,15 @@
// } // }
// } // }
// console.log(list, 551) // console.log(list, 551)
that.orgdataList = list.map((x) => x.areaName) that.orgdataList = that.queryList.map((x) => x.areaName)
}, },
// 发起邀请事件 // 发起邀请事件
shareToggle() { shareToggle() {
this.dataForm.partnerLevel = this.applyIdentity == 0 ? 'B1' : 'A1' this.dataForm.partnerLevel = this.applyIdentity == 0 ? 'B1' : 'A1'
this.dataForm.hasCrossDistrict = this.isCross == true ? '1' : '0' this.dataForm.hasCrossDistrict = this.isCross == true ? '1' : '0'
this.dataForm.areaId = this.isCross == true ? null : this.queryorgList[this.index].areaId this.dataForm.areaId = this.isCross == true ? null : this.queryList[this.index].areaId
this.dataForm.userId = this.userId this.dataForm.userId = this.userId
this.dataForm.areaName = this.isCross == false ? this.queryorgList[this.index].areaName : this.dataForm this.dataForm.areaName = this.isCross == false ? this.queryList[this.index].areaName : this.dataForm
.areaName .areaName
// this.dataForm.b1Name = this.applyIdentity == 'B1' ? this.dataForm.b1Name : null // this.dataForm.b1Name = this.applyIdentity == 'B1' ? this.dataForm.b1Name : null
// if(this.applyIdentity == 'B1'){ // if(this.applyIdentity == 'B1'){
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 头部信息 --> <!-- 头部信息 -->
<view class="basicInfoBox"> <view class="basicInfoBox">
<view class="avatar"> <view class="avatar">
<image :src="customerBasicInfo.headPicture?customerBasicInfo.headPicture:'../../static/myteam/Group1633.png'" alt="" srcset="" mode="widthFix"></image> <image :src="customerBasicInfo.headPicture?customerBasicInfo.headPicture:'../../static/myteam/Group1633.png'" alt="" srcset="" ></image>
</view> </view>
<view class="infoBox"> <view class="infoBox">
<view class="firstLineBox"> <view class="firstLineBox">
...@@ -224,19 +224,32 @@ ...@@ -224,19 +224,32 @@
.container{ .container{
padding-bottom: 160rpx; padding-bottom: 160rpx;
} }
.avatar {
width: 90rpx;
height: 80rpx;
/* border: 1rpx solid aqua; */
margin-right: 17rpx;
border-radius: 50%;
}
.avatar image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.basicInfoBox{ .basicInfoBox{
display: flex; display: flex;
padding: 67rpx 20rpx 60rpx 28rpx; padding: 67rpx 20rpx 60rpx 28rpx;
background:linear-gradient(26deg, #D8E2E5 0%, #F0E6DD 31%, #E7DBDF 100%); background:linear-gradient(26deg, #D8E2E5 0%, #F0E6DD 31%, #E7DBDF 100%);
.avatar{ // .avatar{
width: 0; // width: 0;
height: 80rpx; // height: 80rpx;
border-radius: 50%; // border-radius: 50%;
overflow: hidden; // margin-right: 17rpx;
margin-right: 17rpx; // background-color: #fff;
background-color: #fff; // flex: 0 0 80rpx;
flex: 0 0 80rpx;
} // }
.infoBox{ .infoBox{
width:100%; width:100%;
color: #666666; color: #666666;
......
<template> <template>
<lsj-upload <view class="content">
ref="lsjUpload" <view class="header">
childId="upload1" <view class="headportrait" @click="uploadAvatar()">
:width="width" <image :src="optionForm.headPicture ? optionForm.headPicture :'../../static/myteam/Group1633.png'"
:height="height" mode=""></image>
:option="option"
:size="size"
:formats="formats"
:debug="debug"
:instantly="instantly"
@progress=""
@change="onChange">
<view class="btn" :style="{width: width,height: height}">选择附件</view>
</lsj-upload>
<view class="padding">
<view>已选择文件列表:</view>
<!-- #ifndef MP-WEIXIN -->
<view v-for="(item,index) in files.values()" :key="index">
<image style="width: 100rpx;height: 100rpx;" :src="item.path" mode="widthFix"></image>
<text>{{item.path}}</text>
<text>{{item.name}}</text>
<text style="margin-left: 10rpx;">大小:{{item.size}}</text>
<text style="margin-left: 10rpx;">状态:{{item.type}}</text>
<text style="margin-left: 10rpx;">进度:{{item.progress}}</text>
<!-- <text style="margin-left: 10rpx;" v-if="item.responseText">服务端返回演示:{{item.responseText.code}}</text> -->
<text @click="clear(item.name)" style="margin-left: 10rpx;padding: 0 10rpx;border: 1rpx solid #007AFF;">删除</text>
</view> </view>
<!-- #endif --> </view>
<view class="band">
<!-- #ifdef MP-WEIXIN --> <view class="contentItem">
<view v-for="(item,index) in wxFiles" :key="index"> <text>真实名称</text>
<text>{{item.name}}</text> <input class="user-input" v-model="optionForm.realName" type="text" placeholder="请输入姓名" />
<text style="margin-left: 10rpx;">大小:{{item.size}}</text> </view>
<text style="margin-left: 10rpx;">状态:{{item.type}}</text> <view class="contentItem">
<text style="margin-left: 10rpx;">进度:{{item.progress}}</text> <text>昵称</text>
<view> <input class="user-input" v-model="optionForm.nickName" maxlength="10" type="text"
<button>删除</button> placeholder="请输入3~10个字符" />
</view>
<view class="contentItem">
<text>个人简介</text>
<textarea class="user-textarea" v-model="optionForm.userDescription" placeholder="请输入个人简介"></textarea>
</view>
</view>
<view class="footer">
<button class="user-button" @tap="submitinfo">保存</button>
</view> </view>
</view> </view>
<!-- #endif -->
</view>
</template> </template>
<script> <script>
export default { import {
CommonUpload
} from '@/util/uploaderFile'
import api from "@/api/api";
export default {
data() { data() {
return { return {
// 上传接口参数 dataForm: {
option: { loginId: "1",
// 上传服务器地址,此地址需要替换为你的接口地址 targetType: "5",
url: 'http://hlapi.j56.com/dropbox/document/upload', targetId: "1",
// 上传附件的key targetNo: "6",
name: 'file', targetUseFor: "12",
// 根据你接口需求自定义请求头 targetSeq: "0"
header: {
'Authorization': 'bearer eyJhbGciOiJSUzI1NiIsI',
'uid': '27682',
'client': 'app',
'accountid': 'DP',
}, },
// 根据你接口需求自定义body参数 optionForm: {}
formData: {
// 'orderId': 1000
} }
}, },
// 选择文件后是否立即自动上传,true=选择后立即上传 onLoad(options) {
instantly: false, this.optionForm = JSON.parse(options.customerBasicInfo)
// 必传宽高且宽高应与slot宽高保持一致 console.log(this.optionForm, 7777)
width: '180rpx',
height: '180rpx',
// 限制允许选择的格式,空串=不限制,默认为空
formats: 'png,jpg,mp4,pdf,docx',
// 文件上传大小限制
size: 10,
// 文件回显列表
files: new Map(),
// 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
wxFiles: [],
// 是否打印日志
debug: true,
// 演示用
tabIndex: 0,
list:[],
}
},
onReady() {
setTimeout(()=>{
console.log('----演示动态更新参数-----');
this.$refs.lsjUpload.setData('formData.orderId','动态设置的参数');
console.log('以下注释内容为-动态更新参数更多演示,放开后可查看演示效果');
// 修改option对象的name属性
// this.$refs.lsjUpload.setData('name','myFile');
// 修改option对象的formData内的属性
// this.$refs.lsjUpload.setData('formData.appid','1111');
// 替换option对象的formData
// this.$refs.lsjUpload.setData('formData',{appid:'222'});
// option对象的formData新增属性
// this.$refs.lsjUpload.setData('formData.newkey','新插入到formData的属性');
// ---------演示初始化值,用于已提交后再次编辑时需带入已上传文件-------
// 方式1=传入数组
let files1 = [{
name: '1.png'
},
{
name: '2.png',
}];
// 方式2=传入Map对象
let files2 = new Map();
files2.set('1.png',{name: '1.png'})
// 设置初始files列表
this.$refs.lsjUpload.setFiles(files1);
},2000)
}, },
methods: { methods: {
// 某文件上传结束回调(成功失败都回调) uploadAvatar(event) {
onuploadEnd(item) { let that = this;
console.log(`${item.name}已上传结束,上传状态=${item.type}`); CommonUpload(that.dataForm).then(res => {
this.optionForm.headPicture = res.data.filePath
// 更新当前状态变化的文件 })
this.files.set(item.name,item); },
// 修改个人资料接口
// 演示上传完成后取服务端数据 submitinfo() {
if (item['responseText']) { let UserRequestVO = {
console.log('演示服务器返回的字符串JSON转对象'); id: uni.getStorageSync('cffp_userId'),
this.files.get(item.name).responseText = JSON.parse(item.responseText); realName: this.optionForm.realName,
nickName: this.optionForm.nickName,
headPicture: this.optionForm.headPicture,
userDescription: this.optionForm.userDescription
} }
api.updateinfo(UserRequestVO).then(res => {
if (res.success) {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
});
uni.$emit("handClick", {
data: this.optionForm
});
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
// 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
// #ifdef MP-WEIXIN
this.wxFiles = [...this.files.values()];
// #endif
// 强制更新视图
this.$forceUpdate();
// ---可删除--演示判断是否所有文件均已上传成功
let isAll = [...this.files.values()].find(item=>item.type!=='success');
if (!isAll) {
console.log('已全部上传完毕');
}
else {
console.log(isAll.name+'待上传');
} }
})
}, },
// 上传进度回调 }
// (item) { }
// // 更新当前状态变化的文件 </script>
// this.files.set(item.name,item);
// console.log('打印对象',JSON.stringify(this.files.get(item.name)));
// // 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
// // #ifdef MP-WEIXIN
// this.wxFiles = [...this.files.values()];
// // #endif
// // 强制更新视图 <style scoped>
// this.$forceUpdate(); .content {
width: 100vw;
}
// }, .user-input {
// 文件选择回调 text-align: right;
onChange(files) { }
// 更新选择的文件
this.files = files;
// 强制更新视图
this.$forceUpdate();
// 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道 .user-textarea {
// #ifdef MP-WEIXIN border: 1px solid #C7C7C7;
this.wxFiles = [...this.files.values()]; width: 540rpx;
// #endif height: 270rpx;
}, border-radius: 10rpx;
// 手动上传 }
upload() {
// name=指定文件名,不指定则上传所有type等于waiting和fail的文件
this.$refs.lsjUpload.upload();
},
// 移除某个文件
clear(name) {
// name=指定文件名,不传name默认移除所有文件
this.$refs.lsjUpload.clear(name);
},
/** .band {
* 以下为演示 margin: 0 20rpx;
*/ font-size: 26rpx;
// DOM重排演示,重排后组件内部updated默认会触发show方法,若特殊情况未能触发updated也可以手动调用一次show() }
// 什么是DOM重排?自行百度去~
add() {
this.list.push('DOM重排测试');
},
// 切换视图演示,APP端因为是webview,层级比view高,
// 此时若不希望点击触发选择文件,需要手动调用hide()
// 手动调用hide后,需要调用show()才能恢复触发面
onTab(tabIndex) {
this.tabIndex = tabIndex;
if (tabIndex == 0 ) { .header {
this.$nextTick(()=>{ display: flex;
this.$refs.lsjUpload.show(); justify-content: center;
})
} }
else {
this.$refs.lsjUpload.hide(); .headportrait {
width: 250rpx;
height: 250rpx;
/* border: 1rpx solid aqua; */
border-radius: 50%;
} }
},
// 打开nvue窗口 .headportrait image {
open() { width: 100%;
uni.navigateTo({ height: 100%;
url: '/pages/nvue-demo/nvue-demo' border-radius: 50%;
});
} }
/* .headportrait-img {
width: 260rpx;
height: 260rpx;
border-radius: 50%;
background-size: cover;
background-repeat: no-repeat center;
} */
.contentItem {
margin-top: 40rpx;
display: flex;
justify-content: space-between;
border-bottom: 2rpx solid #E4E4E4;
padding: 20rpx;
} }
}
</script>
<style> .footer {
width: 500rpx;
height: 80rpx;
opacity: 1;
margin: 80rpx auto;
}
.user-button {
color: #FFFFFF;
background: #20269B;
border-radius: 80px;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment