Commit 54f0bc13 by 前端

咨询弹框

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