师傅通过分享链接邀请其他师傅加入团队,登录带参数问题修复
This commit is contained in:
parent
7cc29e8168
commit
524690b2b4
|
|
@ -23,7 +23,7 @@ export default {
|
|||
if (args.data instanceof Object) {
|
||||
args.data.deptId = globalData.deptId;
|
||||
args.data.from = globalData.from;
|
||||
if (!args.data.workerId) {
|
||||
if (!args.data.workerId && userInfo && userInfo.workerId) {
|
||||
args.data.workerId = userInfo.workerId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@
|
|||
{{content}}
|
||||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="hideModal" @click="cancelCallback">{{cancelMsg}}</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
||||
@click="confirmCallback">{{confirmMsg}}</view>
|
||||
<view class="action margin-0 flex-sub text-black" @tap="hideModal">{{cancelMsg}}</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="confirmCallback">{{confirmMsg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -19,6 +18,7 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'confirm-modal',
|
||||
emits: ["confirm", 'cancel'],
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
|
|
@ -31,10 +31,6 @@
|
|||
confirmMsg: {
|
||||
type: String,
|
||||
default: '确定'
|
||||
},
|
||||
cancelCallback: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
@ -47,13 +43,12 @@
|
|||
this.isShow = true
|
||||
},
|
||||
hideModal(e) {
|
||||
this.isShow = false
|
||||
this.$emit('cancel');
|
||||
this.isShow = false;
|
||||
},
|
||||
confirmCallback(e) {
|
||||
uni.$emit(this.$globalFun.CONFIRM);
|
||||
},
|
||||
cancelCallback(e) {
|
||||
uni.$emit(this.$globalFun.CANCEL);
|
||||
this.$emit('confirm');
|
||||
this.hideModal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,20 +8,23 @@
|
|||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-xl text-left">
|
||||
<view class="margin-top-sm">
|
||||
<view class="padding-xl text-left bg-white">
|
||||
<!-- <view class="margin-top-sm">
|
||||
<text>团队成员师傅ID:</text>
|
||||
<input class="radius-input margin-top-sm" type="text" v-model="workerId"></input>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
</view> -->
|
||||
<!-- <view>
|
||||
<text>成员师傅备注:</text>
|
||||
<input class="radius-input margin-top-sm" type="text" v-model="workerName"></input>
|
||||
</view> -->
|
||||
<view>
|
||||
是否确认加入{{inviteMasterObj.name}}的团队?
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="hideModal">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
||||
@click="confirm">邀请</view>
|
||||
@click="confirm">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -31,11 +34,17 @@
|
|||
export default {
|
||||
name: 'invite-master',
|
||||
emits: ['confirm'],
|
||||
props: {
|
||||
inviteMasterObj: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
workerId: '',
|
||||
workerName: ''
|
||||
workerId: null,
|
||||
// workerName: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -47,14 +56,14 @@
|
|||
this.resetData();
|
||||
},
|
||||
resetData() {
|
||||
this.workerId = '',
|
||||
this.workerName = ''
|
||||
this.workerId = null
|
||||
// this.workerName = ''
|
||||
},
|
||||
confirm() {
|
||||
this.$emit('confirm', {
|
||||
leaderId: this.$request.getCurUserInfo().workerId,
|
||||
workerId: this.workerId,
|
||||
workerName: this.workerName
|
||||
leaderId: this.inviteMasterObj.workerId,
|
||||
workerId: this.$request.getCurUserInfo().workerId,
|
||||
// workerName: this.workerName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
<view class="flex justify-end align-center">
|
||||
<view v-if="Boolean(member.showEditInput)" :key="member.workerId"
|
||||
class="flex justify-end align-center margin-lr-sm">
|
||||
<input class="radius-input" type="text" v-model="member.workerName" placeholder="姓名备注"></input>
|
||||
<input class="radius-input" type="text" v-model="member.workerName"
|
||||
placeholder="姓名备注"></input>
|
||||
<view class="text-lg margin-left-sm">
|
||||
<text class="cuIcon-roundcheckfill text-main-color" :data-index="index"
|
||||
@click="editWorkerName"></text>
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view v-else class="flex justify-end margin-lr-sm" :key="member.workerId">
|
||||
<text>{{member.workerName}}</text>
|
||||
<text>{{member.workerName ? member.workerName : ''}}</text>
|
||||
<text class="text-lg" :data-index="index" @click="showEditInput"><text
|
||||
class="cuIcon-edit margin-left-xs"></text></text>
|
||||
</view>
|
||||
|
|
@ -42,13 +43,22 @@
|
|||
<view class="cu-bar bg-white tabbar border shop fixed-bottom-bar">
|
||||
<view class="left-grid text-center" data-modal="takeRateSet" @click="showModalByRef('setTakeRateModal')">
|
||||
<view>设置扣点</view>
|
||||
<view v-if="curUserInfo.leaderTeamRate">(扣点:<text class="text-red">{{Number(curUserInfo.leaderTeamRate)*100}}%</text>)</view>
|
||||
<view v-if="curUserInfo.leaderTeamRate">(扣点:<text
|
||||
class="text-red">{{Number(curUserInfo.leaderTeamRate)*100}}%</text>)</view>
|
||||
</view>
|
||||
<!-- <view class="bg-main-color submit" @click="showModalByRef('inviteMasterModal')">邀请团队</view> -->
|
||||
<view class="bg-main-color submit">
|
||||
<button class="cu-btn bg-main-color" open-type="share" style="width: 100%; height: 100%;">
|
||||
<text class="cuIcon-share"></text>
|
||||
<text>邀请师傅</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="bg-main-color submit" @click="showModalByRef('inviteMasterModal')">邀请团队</view>
|
||||
</view>
|
||||
|
||||
<set-take-rate ref="setTakeRateModal" :leaderTeamRate="Number(curUserInfo.leaderTeamRate)*100" :leaderTeamMoney="curUserInfo.leaderTeamMoney" @confirm="applySetTakeRate"></set-take-rate>
|
||||
<invite-master ref="inviteMasterModal" @confirm="inviteMaster"></invite-master>
|
||||
<set-take-rate ref="setTakeRateModal" :leaderTeamRate="Number(curUserInfo.leaderTeamRate)*100"
|
||||
:leaderTeamMoney="curUserInfo.leaderTeamMoney" @confirm="applySetTakeRate"></set-take-rate>
|
||||
<invite-master ref="inviteMasterModal" :inviteMasterObj="inviteMasterObj" @confirm="inviteMaster"></invite-master>
|
||||
<confirm-modal ref="confirmModal" :content="'当前无法加入师傅团队,请先登录并完成师傅入驻申请。'" @confirm="goToIndex"></confirm-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -68,13 +78,47 @@
|
|||
members: [],
|
||||
pageNum: 0,
|
||||
pageSize: 0,
|
||||
curUserInfo: null
|
||||
curUserInfo: {},
|
||||
inviteMasterObj: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
onLoad(options) {
|
||||
if (options && options.inviteMasterObj) {
|
||||
// 点击邀请链接进入的页面
|
||||
this.beInvited2Team(JSON.parse(decodeURIComponent(options.inviteMasterObj)));
|
||||
} else {
|
||||
this.loadData();
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '邀请你成为我的团队成员',
|
||||
path: '/pages/area-proxy/my-team?inviteMasterObj=' + encodeURIComponent(JSON.stringify(this.curUserInfo)),
|
||||
// imageUrl: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big5000.jpg'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async beInvited2Team(inviteMasterObj) {
|
||||
this.inviteMasterObj = inviteMasterObj;
|
||||
let curUserInfo = await this.login();
|
||||
if (curUserInfo == null || curUserInfo.status !== 0) {
|
||||
// 提示登录和入驻成为师傅,返回首页
|
||||
this.showModalByRef('confirmModal');
|
||||
} else {
|
||||
this.showModalByRef('inviteMasterModal');
|
||||
}
|
||||
},
|
||||
async login() {
|
||||
// 更新缓存中的userInfo
|
||||
await this.$request.storageExistUser();
|
||||
// 返回缓存中的userInfo
|
||||
return this.$request.getCurUserInfo();
|
||||
},
|
||||
goToIndex() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
async loadData() {
|
||||
// this.myTeamInfo = await this.$api.data('myTeamInfo');
|
||||
// this.members = this.myTeamInfo.members;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@
|
|||
this.curUserInfo = curUserInfo;
|
||||
|
||||
// 是否展示选择入驻类型的模态框
|
||||
this.isShowSteer = this.curUserInfo.type != null && this.curUserInfo.type != undefined ? false : true;
|
||||
this.isShowSteer = this.curUserInfo.type == null || this.curUserInfo.status !== 0 ? true : false;
|
||||
|
||||
this.myInfo = await this.$api.data('myInfo');
|
||||
// this.isShowSteer = !this.myInfo.entryType;
|
||||
|
|
@ -227,8 +227,13 @@
|
|||
this.servModules = newServModules;
|
||||
},
|
||||
async chooseEntryType(typeCode) {
|
||||
let status = 1;
|
||||
if (typeCode === 1) {
|
||||
status = 0;
|
||||
}
|
||||
await this.$request.updateWorker({
|
||||
type: typeCode
|
||||
type: typeCode,
|
||||
status: status
|
||||
});
|
||||
if (typeCode === 1) {
|
||||
this.$emit('changeCurPageCode', 'supplyChainPage');
|
||||
|
|
|
|||
Loading…
Reference in New Issue