Commit 4d1884bb by 胡悦

Merge branch 'kuangyq_v2.10.0' of http://192.168.3.233:8090/saas/mini-program/ai…

…-card into kuangyq_v2.10.0
2 parents 7946f2a8 9d449fec
...@@ -28,6 +28,7 @@ Component({ ...@@ -28,6 +28,7 @@ Component({
// 获取手机号 // 获取手机号
getPhoneNumber ({detail}) { getPhoneNumber ({detail}) {
console.log(detail) console.log(detail)
this.triggerEvent("getPhoneNumber")
getApp().login(true).then(({ getApp().login(true).then(({
data data
}) => { }) => {
......
...@@ -45,7 +45,11 @@ Page({ ...@@ -45,7 +45,11 @@ Page({
customerType: 0, customerType: 0,
// 是否授权昵称 // 是否授权昵称
hasUserInfo: false, hasUserInfo: false,
curTab: [trackData.COMPANY, trackData.CUBE] // 是否授权手机号
hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE],
// 员工名片信息
cardInfo: []
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
...@@ -69,20 +73,34 @@ Page({ ...@@ -69,20 +73,34 @@ Page({
goConsult() { goConsult() {
console.log("跳转到咨询页面"); console.log("跳转到咨询页面");
}, },
// 设置手机号
getPhoneNumber() {
console.log(11111111);
this.setData({
hasPhoneNumber: true
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(this.data.hasUserInfo); console.log(this.data.hasUserInfo);
// 获取员工名片信息 getApp().login().then(({data}) => {
const sessionId = util.getSessionId(); console.log(data);
let params = {}; if (data) {
params.cardId = 21; this.setData({
params.sessionId = sessionId; hasUserInfo: true
console.log(params, "+++"); })
// entmicroApi.getCardDetail(params).then((res) => { }
// console.log(res); if (data.phone) {
// }); this.setData({
hasPhoneNumber: true
})
} else {
this.getCardDetail()
}
})
}, },
/** /**
...@@ -279,5 +297,20 @@ Page({ ...@@ -279,5 +297,20 @@ Page({
}) })
} }
}) })
},
// 获取员工名片信息
getCardDetail() {
const sessionId = util.getSessionId();
let params = {};
params.cardId = 21;
params.sessionId = sessionId;
console.log(params, "+++");
entmicroApi.getCardDetail(params).then((res) => {
console.log(res);
if (res.data) {
} }
});
}
}) })
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<import src="../../template/channel/channel.wxml" /> <import src="../../template/channel/channel.wxml" />
<import src="../../template/company/company.wxml" /> <import src="../../template/company/company.wxml" />
<import src="../../template/menu/menu.wxml" /> <import src="../../template/menu/menu.wxml" />
<import src="../../template/cube/cube" /> <!-- <import src="../../template/cube/cube" />
<import src="../../template/equity/equity" /> <import src="../../template/equity/equity" />
<import src="../../template/clue/clue" /> <import src="../../template/clue/clue" /> -->
<view class="main-box"> <view class="main-box">
<user-info></user-info> <user-info data="{{cardInfo}}"></user-info>
<view class="main-bottom"> <view class="main-bottom">
<!-- 面向渠道 --> <!-- 面向渠道 -->
<template is="channel"></template> <template is="channel"></template>
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
</block> </block>
<!-- 方案介绍 --> <!-- 方案介绍 -->
<block wx:if="{{curTabIndex === 1 }}"> <block wx:if="{{curTabIndex === 1 }}">
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType}}"></template> <template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType, hasPhoneNumber}}"></template>
<block wx:if="{{curIntroduceIndex === 0}}"> <!-- <block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL}}"></template> <template is="cube" data="{{IMGURL}}"></template>
</block> </block>
<block wx:elif="{{curIntroduceIndex === 1}}"> <block wx:elif="{{curIntroduceIndex === 1}}">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</block> </block>
<block wx:elif="{{curIntroduceIndex == 2}}"> <block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue"></template> <template is="clue"></template>
</block> </block> -->
</block> </block>
</view> </view>
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
<view>企微魔方</view> <view>企微魔方</view>
<image class="m-t-md" src="https://b.zol-img.com.cn/sjbizhi/images/11/320x510/1592967802496.jpg"></image> <image class="m-t-md" src="https://b.zol-img.com.cn/sjbizhi/images/11/320x510/1592967802496.jpg"></image>
</view> </view>
<phone-number></phone-number> <phone-number bind:getPhoneNumber="getPhoneNumber" wx:if="{{!hasPhoneNumber}}"></phone-number>
</template> </template>
\ No newline at end of file \ No newline at end of file
<import src="../cube/cube" />
<import src="../equity/equity" />
<import src="../clue/clue" />
<template name="menu"> <template name="menu">
<view class="menu-list"> <view class="menu-list">
<block wx:for="{{menuList}}" wx:key="index"> <block wx:for="{{menuList}}" wx:key="index">
...@@ -6,4 +9,14 @@ ...@@ -6,4 +9,14 @@
</view> </view>
</block> </block>
</view> </view>
<view>
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL, hasPhoneNumber}}"></template>
</block>
<block wx:if="{{curIntroduceIndex === 1}}">
<template is="equity" data="{{hasPhoneNumber}}"></template>
</block>
<block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue" data="{{hasPhoneNumber}}"></template>
</block></view>
</template> </template>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!