Commit ee5791a7 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 58f58341 31c5a654
module.exports = Behavior({
data: {
// menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
// templateMethods: [{"tap": "selectIntroduce"}],
// curIntroduceIndex: 0
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0
},
// selectIntroduce(e) {
// console.log(e.currentTarget);
// const curIntroduceIndex = e.currentTarget.dataset.index;
// this.setData({
// curIntroduceIndex: curIntroduceIndex,
// });
// },
// methods: {
// // 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
// },
});
methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
console.log(e.currentTarget);
const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
curIntroduceIndex: curIntroduceIndex,
});
},
},
});
\ No newline at end of file
......@@ -8,11 +8,12 @@
// pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index";
Page({
// behaviors: [menuMixin],
behaviors: [menuMixin],
/**
* 页面的初始数据
*/
data: {
introduceName: "",
tabList: [
{
name: "公司介绍",
......@@ -35,15 +36,10 @@ Page({
icon1: "icon-cooperation",
},
],
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
curTabIndex: 0,
curIntroduceIndex: 0,
templateMethods: [{"tap": "selectIntroduce"}],
// 0-员工,1-代理商
customerType: 0
customerType: 0,
},
// tab栏切换
introduce(e) {
const curTabIndex = e.currentTarget.dataset.index;
// 视频直播和合作申请是跳转新页面,不需要设置激活样式
......@@ -63,24 +59,10 @@ Page({
}
},
// 方案介绍tab栏切换
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
console.log(e.currentTarget);
const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
curIntroduceIndex: curIntroduceIndex,
});
},
// 跳转咨询页面
goConsult() {
console.log("跳转到咨询页面");
},
jump() {
wx.$router.go("applicationAccount");
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -99,7 +81,9 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() {
this.setShareInfo();
},
/**
* 生命周期函数--监听页面隐藏
......@@ -124,5 +108,130 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
onShareAppMessage() {
return {
title: `您好,我向你推荐了广联数科的${"你的名字"}的智能名片~`,
imageUrl: this.data.shareImg,
};
},
setShareInfo() {
const canvasWidth = 208,
canvasHeight = 166,
textBaseline = "top";
const draw_function = new Draw(this, {
width: canvasWidth,
height: canvasHeight,
// pixelRatio: 2,
// backgroundColor: '#096'
});
const drawCard = (callBack) => {
let index = 0;
const iconWidth = 9,
iconHeight = 9,
iconX = 18,
iconY = 79,
imgList = [
{
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png",
x: 0,
y: 0,
width: canvasWidth,
height: 124,
},
{
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png",
x: 15,
y: 18,
width: 152,
height: 10,
},
{
url: "https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
x: 154,
y: 36,
width: 36,
height: 36,
},
{
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png",
x: iconX,
y: iconY,
width: iconWidth,
height: iconHeight,
},
{
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png",
x: iconX,
y: iconY + 13,
width: iconWidth,
height: iconHeight,
},
{
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png",
x: 64,
y: 138,
width: 80,
height: 24,
},
],
textList = [
{
text: "你的名字",
x: 18,
y: 36,
color: "#2D2D33",
fontWeight: 600,
fontSize: 14,
},
{
text: "市场总监",
x: 22 + draw_function.getTextWidth("你的名字", 14),
y: 40,
color: "#6E6E7A",
fontWeight: 400,
fontSize: 8,
},
{
text: "18888888888",
x: 30,
y: 80,
color: "#6E6E7A",
fontSize: 7,
},
{
text: "深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层",
x: 30,
y: 94,
color: "#6E6E7A",
fontSize: 7,
lineNum: 2,
width: 185,
lineHeight: 9,
},
];
const drawImages = (callBack) => {
draw_function.drawImages(imgList[index], () => {
index += 1;
if (index != imgList.length) drawImages(callBack);
else callBack();
});
};
drawImages(() => {
try {
textList.map((e, ind) => {
e.textBaseline = textBaseline;
draw_function.drawText(e);
if (ind == textList.length - 1) throw true;
});
} catch (error) {
draw_function.toDataURL(({ path }) => {
this.setData({
shareImg: path,
});
});
}
});
};
drawCard();
},
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!