Commit 54f0bc13 by 前端

咨询弹框

1 parent 16732c93
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
// pages/tab/index/index.js // pages/tab/index/index.js
import Draw from "../../../utils/Draw"; import Draw from "../../../utils/Draw";
import { entmicroApi } from "../../../api/api"; import { entmicroApi } from "../../../api/api";
import { commonMixin } from '../../../mixins/index' import { commonMixin } from "../../../mixins/index";
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import {senceData, productData} from './constant/senceData' import { senceData, productData } from "./constant/senceData";
Page({ Page({
behaviors: [commonMixin], behaviors: [commonMixin],
/** /**
...@@ -21,35 +21,36 @@ Page({ ...@@ -21,35 +21,36 @@ Page({
{ {
name: "增值转化", name: "增值转化",
icon: "icon-product", icon: "icon-product",
icon1: "icon-product1" icon1: "icon-product1",
}, },
{ {
name: "系统订阅", name: "系统订阅",
icon: "icon-measure", icon: "icon-measure",
icon1: "icon-measure" icon1: "icon-measure",
}, },
{ {
name: "公司介绍", name: "公司介绍",
icon: "icon-company", icon: "icon-company",
icon1: "icon-company1" icon1: "icon-company1",
}, },
{ {
name: "视频直播", name: "视频直播",
icon: "icon-video", icon: "icon-video",
icon1: "icon-video" icon1: "icon-video",
}, },
], ],
curTabIndex: 0, curTabIndex: 0,
// 员工名片信息 // 员工名片信息
cardInfo: null, cardInfo: null,
defaultInfo: { defaultInfo: {
staffName: '虚拟员工', staffName: "虚拟员工",
operation: '虚拟职位', operation: "虚拟职位",
staffPhone: 'xxxxxxxx', staffPhone: "xxxxxxxx",
image: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg', image:
qrCode: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg' "https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
qrCode:
"https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
}, },
// 是否授权手机号 // 是否授权手机号
hasPhoneNumber: false, hasPhoneNumber: false,
...@@ -58,29 +59,28 @@ Page({ ...@@ -58,29 +59,28 @@ Page({
autoplay: true, autoplay: true,
// 增值转化模块 // 增值转化模块
senceData, senceData,
productData productData,
}, },
// 一级菜单 // 一级菜单
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
this.setData({ this.setData({
autoplay: false autoplay: false,
}) });
// 视频直播是跳转新页面,不需要设置激活样式 // 视频直播是跳转新页面,不需要设置激活样式
// 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播 // 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播
switch (curTabIndex) { switch (curTabIndex) {
case 2: case 2:
this.setData({ this.setData({
curTabIndex: curTabIndex, curTabIndex: curTabIndex,
autoplay: true autoplay: true,
}) });
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]); // wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
break break;
case 3: case 3:
wx.openChannelsUserProfile({ wx.openChannelsUserProfile({
finderUserName: 'sphPIdcy0NVpuao', finderUserName: "sphPIdcy0NVpuao",
}) });
// wx.$Track.sendTrack(trackData.VIDEO); // wx.$Track.sendTrack(trackData.VIDEO);
break; break;
default: default:
...@@ -91,15 +91,12 @@ Page({ ...@@ -91,15 +91,12 @@ Page({
} }
}, },
// 咨询 // 咨询
handleOpen(e) { handleOpen(e) {},
},
// 更新手机号 // 更新手机号
updatePhoneNumber(e) { updatePhoneNumber(e) {
console.log(e) console.log(e);
if (e.detail) { if (e.detail) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true,
...@@ -108,7 +105,7 @@ Page({ ...@@ -108,7 +105,7 @@ Page({
}, },
// 合作申请 // 合作申请
toApplication() { toApplication() {
console.log('合作申请') console.log("合作申请");
}, },
/** /**
...@@ -127,32 +124,46 @@ Page({ ...@@ -127,32 +124,46 @@ Page({
this.getCardDetail(); this.getCardDetail();
}); });
wx.hideShareMenu({ wx.hideShareMenu({
menus: ['shareAppMessage'] menus: ["shareAppMessage"],
}) });
this.setData({ this.setData({
productData: this.addAll(productData) productData: this.addAll(productData),
}) });
}, },
addAll(data) { addAll(data) {
for (let i in data) { for (let i in data) {
let arr = [], let arr = [],
m = [], m = [],
n = [] n = [];
data[i].map(item => { data[i].map((item) => {
arr = arr.concat(item.productList) arr = arr.concat(item.productList);
m = item.videoList m = item.videoList;
n = item.posterList n = item.posterList;
}) });
const allData = { const allData = {
name: '全部', name: "全部",
productList: arr, productList: arr,
videoList: m, videoList: m,
posterList: n posterList: n,
} };
data[i].unshift(allData) data[i].unshift(allData);
} }
return data return data;
},
// 咨询
handleOpen() {
this.setData({
showCustomer: true,
});
},
closeQR() {
console.log(1111);
this.setData({
showCustomer: false,
});
}, },
/** /**
...@@ -164,12 +175,12 @@ Page({ ...@@ -164,12 +175,12 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const userInfo = wx.$util.getUserInfo() const userInfo = wx.$util.getUserInfo();
this.setData({ this.setData({
hasPhoneNumber: !!(userInfo && userInfo.phone) hasPhoneNumber: !!(userInfo && userInfo.phone),
}) });
const options = wx.getEnterOptionsSync() const options = wx.getEnterOptionsSync();
wx.$trackData = options.query wx.$trackData = options.query;
if (wx.$trackData.merchant) { if (wx.$trackData.merchant) {
// wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]) // wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
} }
...@@ -199,15 +210,16 @@ Page({ ...@@ -199,15 +210,16 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = wx.$storage.get("scene").cardId const cardId = wx.$storage.get("scene").cardId;
// merchantId 兼容旧链接 // merchantId 兼容旧链接
const merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId const merchant =
const shareType = 'SHARE_HOME' wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId;
console.log('cardId', cardId, 'merchant', merchant) const shareType = "SHARE_HOME";
console.log("cardId", cardId, "merchant", merchant);
return { return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`, title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg, imageUrl: this.data.shareImg,
path: `pages/tab/index/index?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}` path: `pages/tab/index/index?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}`,
}; };
}, },
setShareInfo(data = {}) { setShareInfo(data = {}) {
...@@ -323,16 +335,18 @@ Page({ ...@@ -323,16 +335,18 @@ Page({
}); });
} catch (error) { } catch (error) {
draw_function.toDataURL(({ path }) => { draw_function.toDataURL(({ path }) => {
this.setData({ this.setData(
{
shareImg: path, shareImg: path,
shareDisabled: false shareDisabled: false,
}, () => { },
() => {
wx.showShareMenu({ wx.showShareMenu({
menus: ['shareAppMessage'] menus: ["shareAppMessage"],
}) });
}) }
);
}); });
} }
}); });
}; };
...@@ -341,35 +355,34 @@ Page({ ...@@ -341,35 +355,34 @@ Page({
// 获取员工名片信息 // 获取员工名片信息
getCardDetail() { getCardDetail() {
console.log(wx.showMeasure) console.log(wx.showMeasure);
this.setData({ this.setData({
'tabList[3].isShow': wx.showMeasure "tabList[3].isShow": wx.showMeasure,
}) });
console.log(wx.$storage.get('scene'), wx.$trackData.cardId) console.log(wx.$storage.get("scene"), wx.$trackData.cardId);
const scene = wx.$storage.get('scene'); const scene = wx.$storage.get("scene");
let params = { let params = {
cardId: wx.$trackData.cardId || scene.cardId cardId: wx.$trackData.cardId || scene.cardId,
}; };
entmicroApi.getCardDetail(params).then(({data, code, message}) => { entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
wx.hideLoading() wx.hideLoading();
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
icon: 'none', icon: "none",
duration: 2000 duration: 2000,
}) });
} }
const cardInfo = data || this.data.defaultInfo const cardInfo = data || this.data.defaultInfo;
console.log(data, cardInfo) console.log(data, cardInfo);
this.setData({ this.setData(
cardInfo {
},()=>{ cardInfo,
},
() => {
this.setShareInfo(cardInfo); this.setShareInfo(cardInfo);
}) }
);
}); });
}, },
}); });
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"company-introduce": "./components/companyIntroduce/companyIntroduce", "company-introduce": "./components/companyIntroduce/companyIntroduce",
"activity-info": "./components/activity/activity", "activity-info": "./components/activity/activity",
"glsx-discover": "glsx-applet-component/discover/index", "glsx-discover": "glsx-applet-component/discover/index",
"scenario": "./components/scenario/scenario" "scenario": "./components/scenario/scenario",
"customer": "../../../components/customer/customer"
}, },
"navigationBarTitleText": "广联数科智能名片" "navigationBarTitleText": "广联数科智能名片"
} }
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
</scenario> </scenario>
</block> </block>
<block wx:if="{{curTabIndex == 1}}">系统订阅</block> <block wx:if="{{curTabIndex == 1}}">系统订阅</block>
<block wx-if="{{curTabIndex == 2}}"> <block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}"></company-introduce> <company-introduce autoplay="{{autoplay}}"></company-introduce>
</block> </block>
...@@ -34,3 +33,5 @@ ...@@ -34,3 +33,5 @@
</view> </view>
</view> </view>
<phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> <phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<!-- 客服咨询 -->
<customer wx:if="{{showCustomer}}" bindcloseQR="closeQR"></customer>
\ 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!