diff --git a/components/productList.vue b/components/productList.vue index c4071b2..7d99d03 100644 --- a/components/productList.vue +++ b/components/productList.vue @@ -7,8 +7,7 @@ {{item.userinfo.name}} {{item.userinfo.posname}} - + 拨打电话 @@ -33,7 +32,7 @@ + @click="handleCall(user.authlist,item.userinfo.phone)"> 联系方式 @@ -77,11 +76,38 @@ }, computed: { ...mapState(["user"]), + userInfo() { + return this.user.name ? this.user : uni.getStorageSync('UserInfo') + } }, methods: { handleActive(item) { this.$emit("handleDetail", item) + }, + handleCall(authlist, num) { + let that = this + console.log("authlist", authlist, that.userInfo) + if (authlist.length) { + let arr = authlist.findIndex(v => v.code == 'phone:show') + if (arr == -1) { + that.$store.commit("changeSecratary", true); + } else { + uni.makePhoneCall({ + phoneNumber: num, //仅为示例 + success: () => { + console.log("拨打电话成功") + that.$model.getSetClickNumber({ + userId: that.userInfo.id ? that.userInfo.id : 0, + clickPhone: num, + }).then(res => {}); + } + }) + } + } else { + that.$store.commit("changeSecratary", true); + } } + } } diff --git a/components/secratary.vue b/components/secratary.vue index b154f8a..0c7969c 100644 --- a/components/secratary.vue +++ b/components/secratary.vue @@ -39,7 +39,7 @@ }, watch: { isSecratary() { - console.log("isSecratary", this.isSecratary) + // console.log("isSecratary", this.isSecratary) } }, methods: { diff --git a/pageTwo/login/add.vue b/pageTwo/login/add.vue index 8eb4e5a..1d70e1a 100644 --- a/pageTwo/login/add.vue +++ b/pageTwo/login/add.vue @@ -1,16 +1,6 @@