Commit 9e38b683 by sunerhu

修改了一些Bug

parent 3da0eafc
......@@ -85,6 +85,10 @@ export default {
saveApplyInfo(params){
return request(`${cffpURL}/partner/saveApplyInfo`, "POST", params)
},
// 查询所属组织List
queryOrgList(params){
return request(`${cffpURL}/orgInfo/queryOrgList`, "POST", params)
},
//学习认证列表
queryCertificateList(params){
return request(`${cffpURL}/certificate/queryCertificateList`, "POST", params)
......@@ -223,10 +227,14 @@ export default {
},
// 我的团队
queryMyTeamInfo(params){
return request(`${cffpURL}/cffp/orgInfo/queryMyTeamInfo`, "POST", params)
return request(`${cffpURL}/orgInfo/queryMyTeamInfo`, "POST", params)
},
// 学习统计
// 我的团队展开LIST
userStudyCount(params){
return request(`${cffpURL}/orgInfo/teamDetail`, "POST", params)
},
// 学习统计
teamDetail(params){
return request(`${cffpURL}/study/userStudyCount`, "POST", params)
},
// 课程包学习进度明细
......@@ -256,5 +264,5 @@ export default {
// 认证--上传就个人信息
uploadSignUpUserInfo(params){
return request(`${cffpURL}/user/uploadSignUpUserInfo`, "POST", params)
},
}
}
<template>
<view>
<view class="personalInfo">
<view class="ulBox">
<view v-for="item in menuList.filter(v=>v.isShow)" :key="item.title" @click="goDetail(item)"
class="liBox">
<view class="infoBox">
<!-- <image :src="'/static/moduleIcon/'+item.icon+'.png'" alt="" srcset="" mode="widthFix"></image> -->
<text>{{item.title}}</text>
</view>
<view class="iconBox">
<view class="" v-if="item.isType == 'text'">
<text>{{item.contentType}}</text>
</view>
<!-- <view class="" v-else-if="item.isType == 'input'">
<input>{{item.contentType}}</input>
</view> -->
<i v-else class="iconfont icon-youjiantou"></i>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
menuList: {
type: Array
}
},
data() {
return {}
},
mounted() {
console.log(this.minorMenuLists, 7412)
},
methods: {
goDetail(item) {
console.log(item, 844)
if (item.isShow == true && item.isOpen == true) {
if (item.isTips == true) {
uni.showModal({
title: item.title,
content: '确定要进行' + item.title + '操作吗?',
showCancel: true,
success: function(res) {
if (res.confirm) {
uni.showToast({
title: '操作成功',
icon: 'none'
});
} else {
console.log('已取消')
}
}
});
} else if (item.link != null) {
uni.navigateTo({
url: item.link
});
}else {
console.log('错误抛出')
}
} else {
common.errorDialog(2, '该模块正在开发中,敬请期待!', '提示');
}
}
}
}
</script>
<style lang="scss">
.personalInfo {
background: #fff;
width: 95%;
margin: 6rpx auto 0;
.ulBox {
padding: 0 30rpx;
.liBox {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
height: 92rpx;
.infoBox {
display: flex;
align-items: center;
image {
width: 52rpx !important;
height: 52rpx;
}
}
&:last-child {
border: none;
}
}
}
}
</style>
......@@ -8,23 +8,45 @@
<!-- // 一级循环 -->
<view class="content-sam-box">
<view class="" v-for="(pointItem,index) in dataList" :key="index">
<view class="" style="display: flex;">
<view class="content-box-title" v-if="pointItem.title" @click="subordinate(index)">
<span>{{pointItem.title}}</span>
<view class="" style="display: flex;" v-if="type == '1'">
<view class="content-box-title" v-if="pointItem.name" @click="subordinate(index,pointItem)">
<span>{{pointItem.name}}</span>
</view>
<view class="content-box-title" v-if="pointItem.levelName">
<span>{{pointItem.levelName}}</span>
</view>
<view class="content-box-title" v-if="pointItem.rank">
<span>{{pointItem.rank}}</span>
<view class="content-box-title" v-if="pointItem.courserNum !=null">
<span>{{pointItem.courserNum}}</span>
</view>
<view class="content-box-title" v-if="pointItem.name">
</view>
<view class="" style="display: flex;" v-if="type == '2'">
<view class="content-box-title" v-if="pointItem.name" @click="subordinate(index,pointItem)">
<span>{{pointItem.name}}</span>
</view>
<view class="content-box-title" v-if="pointItem.name">
<view class="content-box-title" v-if="pointItem.levelName">
<span>{{pointItem.levelName}}</span>
</view>
<view class="content-box-title" v-if="pointItem.courserNum !=null">
<span>{{pointItem.courserNum}}</span>
</view>
</view>
<view class="" style="display: flex;" v-if="type == '3'">
<view class="content-box-title" v-if="pointItem.org" @click="subordinate(index,pointItem)">
<span>{{pointItem.org}}</span>
</view>
<view class="content-box-title" v-if="pointItem.levelName">
<span>{{pointItem.levelName}}</span>
</view>
<view class="content-box-title" v-if="pointItem.name !=null">
<span>{{pointItem.name}}</span>
</view>
<view class="content-box-title" v-if="pointItem.referrer !=null">
<span>{{pointItem.referrer}}</span>
</view>
</view>
<!-- 二级循环 -->
<view class="" v-if="table_index == index && this.tableone == true">
<view class="" v-if="table_index == index && this.tableone == true && pointItem.levelCode != 'A1'">
<view class="" v-for="(itq, index) in dtList">
<view style="display: flex;">
<view class="content-box-title-a" @click="cktable(itq)">
......@@ -45,28 +67,32 @@
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from "../../api/api";
export default {
props: {
dataList: {
type: Array
type: Array,
default: null
},
datatitleList: {
type: Array
type: Array,
default: null
},
tabletype: {
type: String
}
type: String,
default: null
},
type:{
type: String ,// 这里用来去区分是哪个页面传来的值 1直属团队 2.所辖团队 3.其他团队
default: null
},
},
name: "myteam-table",
data() {
......@@ -74,31 +100,37 @@
table_index: '', // 第一级
tableone: false,
tablesubordinate:'', // 第二级
dtList: [{
name: '测试二级服务中心',
id: 1,
},
{
name: '第二',
id: 2,
}
]
dataFoList:[],
};
},
mounted() {
console.log(this.dataList, 741741)
console.log(this.type, 774557)
// if(this.type == 1){
// this.dataFoList = this.dataList.map((x,index) => ({
// name:x.name
// par:x.levelName
// data: x.courserNum
// }))
// }
},
methods: {
cktable(e) {
this.tablesubordinate = e.id
},
subordinate(index) {
if(this.tabletype == 1) {
return true
subordinate(index,val) {
console.log(val.levelCode, 7744)
if(this.tabletype == 1 || val.levelCode == 'A1') {
return
} else {
this.tableone = this.table_index == index ? !this.tableone : true
this.table_index = index
api.userStudyCount().then(res=>{
console.log(res, 4455)
})
}
this.tableone = this.table_index == index ? !this.tableone : true
this.table_index = index
}
},
}
}
</script>
......
......@@ -408,15 +408,15 @@
}
},
{
"path" : "pages/sign/sign",
"style" :
{
"navigationBarTitleText": "签名",
"enablePullDownRefresh": false
}
// {
// "path" : "pages/sign/sign",
// "style" :
// {
// "navigationBarTitleText": "签名",
// "enablePullDownRefresh": false
// }
}
// }
],
// "tabBar": {
// "color": "#7A7E83", // tab 上的文字默认颜色
......
......@@ -19,9 +19,6 @@
<text>证件类型</text>
<!-- <input v-model="openForm.userIdType" class="user-input" maxlength="10" type="text"
placeholder="请输入证件类型" /> -->
<!-- <picker mode="" :range="" @change="">
<view>{{erplizeList[index]}}</view>
</picker> -->
<picker v-if="erplizeList " @change="bindPickerChange($event,erplizeList)" :value="index"
:range="erplizeList" range-key="name">
<view style="background-color: white;">{{ erplizeList[index].name }}</view>
......@@ -96,6 +93,10 @@
methods: {
async getquerySignUpInfo() {
this.$refs.Loading.show()
setTimeout(() => {
this.$refs.Loading.hide()
}, 3000)
let UserSignUpInfoQueryRequestVO = {
userSignUpId:this.openForm.signupId
}
......@@ -129,8 +130,8 @@
});
setTimeout(()=>{
uni.navigateBack(1)
},500)
this.getquerySignUpInfo()
},1000)
//this.getquerySignUpInfo()
}
this.loading = false
})
......
......@@ -12,11 +12,11 @@
<view class="ulBox">
<view class="liBox">
<text>姓名:</text>
<text><input class="uni-input" maxlength="15" placeholder="姓名" /></text>
<text><input v-model="dataForm.name" class="uni-input" maxlength="15" placeholder="姓名" /></text>
</view>
<view class="liBox">
<text>手机号:</text>
<text><input class="uni-input" type="number" maxlength="11" placeholder="手机号" /></text>
<text><input v-model="dataForm.mobileNumber" class="uni-input" type="number" maxlength="11" placeholder="手机号" /></text>
</view>
<view class="liBox">
<text>申请身份:</text>
......@@ -28,7 +28,12 @@
</view>
<view class="liBox">
<text>所属组织:</text>
<text>XXXXXX</text>
<text>
<input v-if="isCross==true" v-model="dataForm.areaName" class="uni-input" placeholder="请填写组织名称" />
<picker v-else @change="bindPChange" :value="index" :range="orgList">
<view class="uni-input">{{ orgList[index]}}</view>
</picker>
</text>
</view>
<view class="liBox">
<text>是否跨区邀请:</text>
......@@ -38,11 +43,19 @@
<text></text>
</view>
<view :class="{checked:!isCross}">
<i class="circle" @click="isCross=false"></i>
<i class="circle" @click="isCross = false"></i>
<text></text>
</view>
</view>
</view>
<!-- <view class="liBox" v-if="isCross== true">
<text>所属组织名称:</text>
<text>
<picker @change="bindPickerChange" :value="applyIdentity" :range="identityArr">
<view class="uni-input">{{identityArr[applyIdentity]}}</view>
</picker>
</text>
</view> -->
</view>
<share></share>
<button type="primary" plain="true" class="sendInvite" @click="shareToggle()">发出邀请</button>
......@@ -60,7 +73,7 @@
</view>
<view class="liBox">
<text>申请身份:</text>
<text>{{item.partnerLevel == '1'? '事业伙伴' : '工作室'}}</text>
<text>{{item.partnerLevel == 'A1'? '事业伙伴' : '工作室'}}</text>
</view>
<view class="liBox">
<text>所属组织:</text>
......@@ -72,8 +85,9 @@
</view>
<view class="liBox">
<text>邀请状态:</text>
<text v-if="item.approvalStatus=='0'">审核中</text>
<text v-else-if="item.approvalStatus=='1'" class="success">邀请成功</text>
<text v-if="item.approvalStatus=='0'">邀请中</text>
<text v-else-if="item.approvalStatus=='1'">审核中</text>
<text v-else-if="item.approvalStatus=='3'" class="success">邀请成功</text>
<text v-else class="fail">邀请失败</text>
</view>
</view>
......@@ -111,15 +125,48 @@
export default {
data() {
return {
dataForm:{
applyType: '1', //申请类型邀请加盟传 1 申请加盟传 2
operatStep: '1', // 99:最后一步,1:第一步,2:为第二步该obj 为第一步
userId:'1', // 目前Id 为1
name: '', //姓名
mobileNumber:'', //被邀请人手机号
partnerLevel:'' ,//被邀请人身份
hasCrossDistrict: '' ,//是否跨区邀请
areaId: '' ,//所属组织Id
areaName: '' //所属组织名称
},
userId:'1',
tabType:1,
identityArr:['工作室','事业伙伴'],
applyIdentity:0,
index: 0,
isCross:true,
inviteLists:[]
inviteLists:[],
orgList: [],
queryorgList:[]
};
},
onLoad() {
this.getqueryOrgList()
},
methods:{
queryorgchange(e){
this.orgindex = e.detail.value
},
// 查询组织list
getqueryOrgList(){
let CffpAreaQueryReqVO = {
userId: this.userId,
partnerLevel: this.applyIdentity == 0 ? 'A1' : 'B1'
}
api.queryOrgList(CffpAreaQueryReqVO).then(res=>{
if(res['success']){
this.queryorgList = res.data.cffpAreaQuerys
this.orgList = res.data.cffpAreaQuerys.map((x)=> x.areaName)
}
})
},
switchTab(type){
this.tabType = type;
if(this.tabType===2){
......@@ -129,8 +176,33 @@
bindPickerChange: function(e) {
this.applyIdentity = e.detail.value
},
// 发起邀请事件
shareToggle() {
this.$refs.share.open()
this.dataForm.partnerLevel = this.applyIdentity == 0 ? 'A1' : 'B1'
this.dataForm.hasCrossDistrict = this.isCross == true ? '1' : '0'
this.dataForm.areaId = this.queryorgList[this.index].areaId
this.dataForm.areaName = this.queryorgList[this.index].areaName
if(this.dataForm.name == "" || this.dataForm.mobileNumber == "" || this.dataForm.areaName == ""){
uni.showToast({
title: '请将信息补充完整',
duration: 2000,
icon: 'none'
});
return
}
api.saveApplyInfo(this.dataForm).then(res =>{
if(res['success']){
this.switchTab(2)
}
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
});
})
// this.$refs.share.open()
},
closeShare(){
this.$refs.share.close()
......
<template>
<view class="">
<text>这里是手机绑定页面</text>
<view @click="dia()">此页面暂时废弃</view>
</view>
</template>
......@@ -12,7 +12,11 @@
}
},
methods:{
dia(){
uni.showLoading({
title:'jiazia'
})
}
}
}
</script>
......
......@@ -156,13 +156,9 @@
}
},
userinfo(){
// uni.navigateTo({
// url:`/pages/personalCenter/user-information?customerBasicInfo=` + JSON.stringify(this.customerBasicInfo)
// })
uni.navigateTo({
url:`/pages/sign/sign`
url:`/pages/personalCenter/user-information?customerBasicInfo=` + JSON.stringify(this.customerBasicInfo)
})
},
// 弹窗
errorDialog(type,content){
......
......@@ -14,7 +14,7 @@
</template>
<script>
import MenuList from "./menulist.vue"
import MenuList from "@/components/menuList/menuList.vue"
export default {
components:{
......@@ -26,11 +26,12 @@
{
title: '手机号绑定',
icon: '',
link: null,
link: '',
contentType:"183****9247",
isOpen: true,
isShow: true,
isType: false,
isTips: false,
isType: 'text'
},
{
title: '重置密码',
......@@ -38,7 +39,8 @@
link: '/pages/personalCenter/accountoperation/resetpassword',
isOpen: true,
isShow: true,
isType: false,
isTips: false,
isType: 'radio'
},
{
title: '注销账号',
......@@ -46,7 +48,8 @@
link: '',
isOpen: true,
isShow: true,
isType: true,
isTips: true,
isType: 'radio'
}
]
}
......
......@@ -35,7 +35,7 @@
goDetail(item) {
console.log(item, 844)
if (item.isShow == true && item.isOpen == true) {
if (item.isType == true) {
if (item.isTips == true) {
uni.showModal({
title: item.title,
content: '确定要进行' + item.title + '操作吗?',
......
......@@ -5,7 +5,8 @@
</template>
<script>
import MenuList from "./menulist.vue"
import MenuList from "@/components/menuList/menuList.vue"
export default {
components:{ MenuList },
data() {
......@@ -16,7 +17,7 @@
link: '/pages/personalCenter/system/accontsetting',
isOpen: true,
isShow: true,
isType: false,
isTips: false,
},
{
title: '清除缓存',
......@@ -24,7 +25,7 @@
link: '',
isOpen: true,
isShow: true,
isType: true,
isTips: true,
},
{
title: '关于CFFP财富中心',
......@@ -32,7 +33,7 @@
link: '/pages/personalCenter/accountoperation/aboutcffp',
isOpen: true,
isShow: true,
isType: false,
isTips: false,
},
]
}
......
......@@ -10,7 +10,7 @@
合计:{{item.rank}}
</view>
<view class="">
<myteam-table :datatitleList="datatitleList" :dataList="item.dataL" ></myteam-table>
<myteam-table :datatitleList="datatitleList" :dataList="raiseList" type="2"></myteam-table>
<!-- <view class="table-content">
<span>辖下组织/成员</span>
<span>职级</span>
......@@ -31,6 +31,11 @@
<script>
import MyteamTable from '@/components/myteam/myteam-table.vue';
export default {
props:{
raiseList:{
type:Array
}
},
components:{
MyteamTable
},
......
......@@ -2,7 +2,7 @@
<view class="content">
<view class="content-header">
<view class="concent-title">
<text class="concent-text">北京一级团队</text>
<text class="concent-text">{{levelName}}</text>
</view>
</view>
<view style="text-align: right;margin: 20px;">
......@@ -12,7 +12,7 @@
</view>
<view class="">
<myteam-table :datatitleList="datatitleList" :dataList="dataList"></myteam-table>
<myteam-table :datatitleList="datatitleList" :dataList="dataList" type="1"></myteam-table>
</view>
</view>
</template>
......@@ -20,32 +20,32 @@
<script>
import MyteamTable from '@/components/myteam/myteam-table.vue';
export default {
props: {
directList: {
type: Array
},
levelName: {
type: String
}
},
components:{
MyteamTable
},
data() {
return {
datatitleList:['辖下组织/成员','职级','合计'],
dataList: [{
title: '所属组织1',
rank: 1,
name: 'sun',
},
{
title: '所属组织2',
rank: 1,
name: 'sun',
recommend: '很好'
},
{
title: '所属组织3',
rank: 1,
name: 'sun',
recommend: '很好'
},
]
datatitleList:['辖下组织/成员','职级','成员数量'],
dataList: []
}
},
mounted(){
// this.dataList = this.directList.map((x,index) => ({
// name:x.name,
// levelName:x.levelName,
// courserNum: x.courserNum
// }))
this.dataList = this.directList
console.log(this.directList, 74852)
}
}
</script>
......
......@@ -12,7 +12,7 @@
<span class="content-box-title">{{pointItem.recommend}}</span>
</view> -->
<view class="">
<myteam-table :datatitleList="datatitleList" :dataList="dataList" :tabletype="1"></myteam-table>
<myteam-table :datatitleList="datatitleList" :dataList="dataList" tabletype="1" type="3"></myteam-table>
</view>
</view>
</template>
......@@ -20,33 +20,49 @@
<script>
import MyteamTable from '@/components/myteam/myteam-table.vue';
export default {
props: {
otherList: {
type: Array,
default: null
}
},
components:{
MyteamTable
},
data() {
return {
datatitleList: ['所属组织', '职级', '姓名', '姓名'],
dataList: [{
title: '所属组织1',
rank: 1,
name: 'sun',
recommend: '很好'
},
{
title: '所属组织2',
rank: 1,
name: 'sun',
recommend: '很好'
},
{
title: '所属组织3',
rank: 1,
name: 'sun',
recommend: '很好'
},
]
datatitleList: ['所属组织', '职级', '姓名', '推荐关系'],
dataList:[],
// dataList: [{
// title: '所属组织1',
// rank: 1,
// name: 'sun',
// recommend: '很好'
// },
// {
// title: '所属组织2',
// rank: 1,
// name: 'sun',
// recommend: '很好'
// },
// {
// title: '所属组织3',
// rank: 1,
// name: 'sun',
// recommend: '很好'
// },
// ]
}
},
mounted() {
this.dataList = this.otherList.map((x,index) => ({
org:x.org,
levelName:x.levelName,
name: x.name,
referrer:x.referrer
}))
console.log(this.otherList, 7778878788)
}
}
</script>
......
......@@ -8,59 +8,79 @@
</view>
<!-- tab内容 -->
<view class="tabContent">
<view v-if="tabType===1">
<members></members>
<view v-if="tabType===1">
<members v-if="directList" :directList="directList" :levelName = "levelName"></members>
</view>
<view v-if="tabType===2">
<jurisdiction></jurisdiction>
<view v-if="tabType===2">
<jurisdiction v-if="raiseList" :raiseList="raiseList"></jurisdiction>
</view>
<view class="other" v-if="tabType===3">
<other-team></other-team>
<other-team v-if="otherList" :otherList="otherList"></other-team>
</view>
</view>
</view>
</template>
<script>
import Members from './members.vue';
import OtherTeam from './otherteam.vue';
import Jurisdiction from './jurisdiction.vue';
import api from "../../../api/api";
import Members from './members.vue';
import OtherTeam from './otherteam.vue';
import Jurisdiction from './jurisdiction.vue';
export default {
components:{
OtherTeam,Members,Jurisdiction
components: {
OtherTeam,
Members,
Jurisdiction
},
data() {
return {
tabType: 1,
userStudyLists: [],
userId: '1'
userId: '5',
directList: null, //直属团队数组
raiseList: null, //所辖团队数组
otherList: null, // 其他
levelName: null
}
},
methods: {
userStudyList() {
api.userStudyList({
onLoad() {
},
mounted() {
this.switchTab(1)
this.getmyseatem()
},
methods:{
getmyseatem() {
api.queryMyTeamInfo({
userId: this.userId
}).then(res => {
if (res['success']) {
this.userStudyLists = res['data']['userStudyTimeInfos'];
}).then(res =>{
console.log(res, 7744)
if(res['success']){
this.levelName = res.data.orgInfo.levelName;
this.directList = res['data']['directList'];
this.raiseList = res['data']['raiseList'];
this.otherList = res['data']['other'];
}
console.log(res)
})
},
// userStudyList() {
// api.userStudyList({
// userId: this.userId
// }).then(res => {
// if (res['success']) {
// this.userStudyLists = res['data']['userStudyTimeInfos'];
// }
// console.log(res)
// })
// },
switchTab(type) {
console.log(type, 784758)
this.tabType = type;
},
dateFormat(val) {
return dataHandling.dateFormat(val);
}
},
onLoad() {
},
mounted() {
this.switchTab(1)
}
}
</script>
......@@ -70,6 +90,7 @@
height: 100%;
text-align: center;
margin-bottom: 20px;
.tabTitle {
color: #666666;
background-color: #fff;
......@@ -86,24 +107,27 @@
}
}
}
.tabContent{
.tabContent {
display: flex;
align-items: center;
justify-content: space-between;
.direct-team {
width: 223px;
height: 40px;
opacity: 1;
border: 1px solid #3F52B7;
margin: 15px auto;
text {
color: #333;
color: #333;
}
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -12,7 +12,7 @@
</view>
<view class="timeSelectContent">
<picker @change="mountdchange" :value="index" :range="mountdList">
<picker @change="mountdchange" :value="montdindex" :range="mountdList">
<view class="uni-input"> {{mountdList[montdindex] || "选择月份"}} </view>
</picker>
</view>
......
......@@ -20,7 +20,7 @@
</view>
</view>
<view class="footer">
<button class="user-button" @click="submitinfo()">保存</button>
<button class="user-button" @tap="submitinfo">保存</button>
</view>
</view>
</template>
......@@ -57,10 +57,6 @@
},
// 修改个人资料接口
submitinfo(){
uni.showLoading({
title: '加载中',
mask: true
});
let UserRequestVO = {
id: 1,
realName: this.optionForm.realName,
......@@ -78,9 +74,12 @@
uni.$emit("handClick", {
data: this.optionForm
});
uni.navigateBack({
delta: 1
})
setTimeout(()=>{
uni.navigateBack({
delta: 1
})
}, 1000)
}
})
},
......
<template>
<view class="signa">
<canvas class="canvas" disable-scroll="true" :style="{'width':'100vw','height':'80vh'}" canvas-id="designature"
@touchstart="starts" @touchmove="moves" @touchend="end"></canvas>
<view class="btn">
<view class="cancel-btn" @click="clear">
重写
</view>
<view class="save-btn" @click="save">
保存
</view>
</view>
</view>
</template>
<script>
/*
* 已兼容h5和小程序端
*
* 如有问题可以加qq:549791959
* 里面的计算都是自己转换公式得出的,不容易啊
*
*/
export default {
data() {
return {
resultUrl: '',
dom: null,
line: [],
width: '0px',
height: '0px',
radius: 0,
staffDeptId: '',
id: '',
type: '',
inspectTemplateId: ''
}
},
onLoad(option) {
this.staffDeptId = option.staffDeptId
this.id = option.id
this.type = option.type
this.inspectTemplateId = option.inspectTemplateId
},
created() {
uni.getSystemInfo({
success: (res) => {
this.width = res.windowWidth - 50 + 'px';
this.height = res.windowHeight - 15 + 'px';
}
});
this.dom = uni.createCanvasContext('designature', this);
},
methods: {
end(e) {
},
distance(a, b) {
let x = b.x - a.x;
let y = b.y - a.y;
return Math.sqrt(x * x + y * y);
},
starts(e) {
this.line.push({
points: [{
time: new Date().getTime(),
x: e.touches[0].x,
y: e.touches[0].y,
dis: 0
}]
})
let currentPoint = {
x: e.touches[0].x,
y: e.touches[0].y
}
this.currentPoint = currentPoint
this.drawer(this.line[this.line.length - 1])
},
moves(e) {
let point = {
x: e.touches[0].x,
y: e.touches[0].y
}
this.lastPoint = this.currentPoint,
this.currentPoint = point
this.line[this.line.length - 1].points.push({
time: new Date().getTime(),
x: e.touches[0].x,
y: e.touches[0].y,
dis: this.distance(this.currentPoint, this.lastPoint)
})
this.drawer(this.line[this.line.length - 1])
},
drawer(item) {
let x1, x2, y1, y2, len, radius, r, cx, cy, t = 0.5,
x, y;
var time = 0;
if (item.points.length > 2) {
let lines = item.points[item.points.length - 3];
let line = item.points[item.points.length - 2];
let end = item.points[item.points.length - 1];
x = line.x;
y = line.y;
x1 = lines.x;
y1 = lines.y;
x2 = end.x;
y2 = end.y;
var dis = 0;
time = (line.time - lines.time) + (end.time - line.time)
dis = line.dis + lines.dis + end.dis;
var dom = this.dom;
var or = Math.min(time / dis * this.linePressure + this.lineMin, this.lineMax);
cx = (x - (Math.pow(1 - t, 2) * x1) - Math.pow(t, 2) * x2) / (2 * t * (1 - t))
cy = (y - (Math.pow(1 - t, 2) * y1) - Math.pow(t, 2) * y2) / (2 * t * (1 - t))
dom.setLineCap('round')
dom.beginPath();
dom.setStrokeStyle('black')
dom.setLineWidth(5)
dom.moveTo(x1, y1);
dom.quadraticCurveTo(cx, cy, x2, y2);
dom.stroke();
dom.draw(true)
}
},
clear() {
this.dom.clearRect(0, 0, 1000, 1000)
this.dom.draw()
this.line = []
},
save() {
var t = this;
if (t.line.length != 0) {
uni.canvasToTempFilePath({
canvasId: 'designature',
fileType: 'png',
quality: 1, //图片质量
success: function(res) {
// t.uploadFile(res.tempFilePath)
// t.$emit('getImg',res.tempFilePath)
// uni.navigateBack({
// delta:1
// })
},
fail(e) {
// console.log(e)
}
}, this)
} else {
uni.showToast({
title: '请上传签字内容',
icon: 'none'
});
}
},
uploadFile(event) {
uni.uploadFile({
url: '/api/file/upload', // 后端api接口
filePath: event, // uni.chooseImage函数调用后获取的本地文件路劲
name: 'file', //后端通过'file'获取上传的文件对象
// formData: this.sendDate,
formData: { //后台所需除图片外的参数可以写在这里面 ,单张多张都可
requestVO: JSON.stringify(dataForm)
},
header: {
'X-Authorization': uni.getStorageSync('uni-token') ? uni.getStorageSync('uni-token') : ''
},
success: (res) => {
let data = JSON.parse(res.data)
var recordId = data.data.recordId
var url = data.data.link
if (this.type == 1) {
const data = {
shopownerFileRecordId: recordId,
manager: url
}
uni.$emit("handClick", {
data: data
});
uni.navigateBack({
delta: 1
})
} else {
const data = {
inspectFileRecordId: recordId,
inspector: url
}
uni.$emit("handClick", {
data: data
});
uni.navigateBack({
delta: 1
})
uni.navigateTo({
url:'/pages/report/report?managerUrl='+managerUrl + '&id=' + this.id + '&staffDeptId=' + this.staffDeptId + '&inspectTemplateId=' + this.inspectTemplateId + '&inspectFileRecordId=' + inspectFileRecordId
})
}
uni.hideLoading();
}
});
},
}
}
</script>
<style scoped lang="scss">
.canvas {
width: 100%;
background-color: #FFFFFF;
// position: absolute;
z-index: 100;
// left: 45px;
border: 1px solid #d6d6d6;
}
.btn {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 40upx 0 40upx;
margin-top: 60upx;
}
.cancel-btn {
background: #C0C0C0;
width: 300upx;
text-align: center;
height: 80upx;
line-height: 80upx;
}
.save-btn {
width: 300upx;
height: 80upx;
text-align: center;
color: #FFFFFF;
line-height: 80upx;
background: #007AFF;
}
// .signa {
// position: relative;
// overflow: hidden;
// background-color: #fbfbfb;
// height: 100vh;
// width: 100vw;
// .canvas {
// background-color: #FFFFFF;
// position: absolute;
// z-index: 9999;
// left: 45px;
// border: 1px solid #d6d6d6;
// }
// .btn {
// height: 100vh;
// position: fixed;
// background-color: #007AFF;
// font-size: 32rpx;
// .cancel-btn {
// width: 42vh;
// position: fixed;
// left: 50rpx;
// border: 1rpx solid #a9a1a1;
// transform: rotate(90deg);
// color: #666;
// margin-left: -21vh;
// margin-top: 21vh;
// height: 65rpx;
// line-height: 65rpx;
// border-radius: 3px;
// text-align: center;
// justify-content: center;
// }
// .save-btn {
// position: absolute;
// z-index: 999;
// display: inline-flex;
// margin-top: 67vh;
// margin-left: -21vh;
// transform: rotate(90deg);
// background: #A91F52;
// width: 42vh;
// left: 50rpx;
// border-radius: 3px;
// border: 1rpx solid #A91F52;
// color: #fff;
// height: 65rpx;
// line-height: 65rpx;
// text-align: center;
// justify-content: center;
// }
// }
// }
</style>
......@@ -55,6 +55,17 @@ export function uploadFilepdf(params) {
extension: ['.pdf', '.doc'],
success: function(res) {
console.log(res, 5588)
var str = res.tempFiles[0].name; //截取后4位
let a = str.substring(str.length - 3);
console.log(a , 'aaaaaa')
if(a !== 'pdf') {
uni.showToast({
title: '上传文件格式不正确!',
duration: 2000,
icon: 'none'
});
return
}
var name = res.tempFiles[0].name
// res.tempFiles 数组
// for (var i = 0; i < res.tempFiles.length; i++) {
......
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