Commit 65ab4bde 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 7e098e17 79d2e8fa
...@@ -18,17 +18,27 @@ const secretKey = { ...@@ -18,17 +18,27 @@ const secretKey = {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b', secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b',
}, }
},
uat: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b',
}
},
prod: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b',
}
}, },
uat: {},
prod: {},
} [target[index]] } [target[index]]
const domain = { const domain = {
ip: 'http://192.168.3.181:8394', ip: 'http://192.168.3.181:8394',
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn', uat: 'https://scrm.test.glsx.com.cn',
prod: 'https://scrm.cgacar.com', prod: 'https://scrm.glsx.com.cn',
} [target[index]] } [target[index]]
const pathEnum = { const pathEnum = {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @LastEditTime: 2022-09-02 13:48:49 * @LastEditTime: 2022-09-02 13:48:49
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import {menuMixin} from '../../../mixins/index' import { menuMixin } from "../../../mixins/index";
Page({ Page({
behaviors: [menuMixin], behaviors: [menuMixin],
/** /**
...@@ -38,7 +38,7 @@ Page({ ...@@ -38,7 +38,7 @@ Page({
], ],
curTabIndex: 0, curTabIndex: 0,
// 0-员工,1-代理商 // 0-员工,1-代理商
customerType: 0 customerType: 0,
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
...@@ -58,6 +58,11 @@ Page({ ...@@ -58,6 +58,11 @@ Page({
}); });
} }
}, },
// 跳转咨询页面
goConsult() {
console.log("跳转到咨询页面");
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -77,7 +82,7 @@ Page({ ...@@ -77,7 +82,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.setShareInfo() this.setShareInfo();
}, },
/** /**
...@@ -105,125 +110,128 @@ Page({ ...@@ -105,125 +110,128 @@ Page({
*/ */
onShareAppMessage() { onShareAppMessage() {
return { return {
title: `您好,我向你推荐了广联数科的${'你的名字'}的智能名片~`, title: `您好,我向你推荐了广联数科的${"你的名字"}的智能名片~`,
imageUrl: this.data.shareImg imageUrl: this.data.shareImg,
} };
}, },
setShareInfo() { setShareInfo() {
const canvasWidth = 208, const canvasWidth = 208,
canvasHeight = 166, canvasHeight = 166,
textBaseline = 'top' textBaseline = "top";
const draw_function = new Draw(this, { const draw_function = new Draw(this, {
width: canvasWidth, width: canvasWidth,
height: canvasHeight, height: canvasHeight,
// pixelRatio: 2, // pixelRatio: 2,
// backgroundColor: '#096' // backgroundColor: '#096'
}) });
const drawCard = callBack => { const drawCard = (callBack) => {
let index = 0 let index = 0;
const iconWidth = 9, const iconWidth = 9,
iconHeight = 9, iconHeight = 9,
iconX = 18, iconX = 18,
iconY = 79, iconY = 79,
imgList = [{ imgList = [
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png', {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png",
x: 0, x: 0,
y: 0, y: 0,
width: canvasWidth, width: canvasWidth,
height: 124 height: 124,
}, { },
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png', {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png",
x: 15, x: 15,
y: 18, y: 18,
width: 152, width: 152,
height: 10 height: 10,
}, { },
url: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg', {
url: "https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
x: 154, x: 154,
y: 36, y: 36,
width: 36, width: 36,
height: 36 height: 36,
}, { },
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png', {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png",
x: iconX, x: iconX,
y: iconY, y: iconY,
width: iconWidth, width: iconWidth,
height: iconHeight height: iconHeight,
}, },
{ {
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png', url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png",
x: iconX, x: iconX,
y: iconY + 13, y: iconY + 13,
width: iconWidth, width: iconWidth,
height: iconHeight height: iconHeight,
}, },
{ {
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png', url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png",
x: 64, x: 64,
y: 138, y: 138,
width: 80, width: 80,
height: 24 height: 24,
} },
], ],
textList = [{ textList = [
text: '你的名字', {
text: "你的名字",
x: 18, x: 18,
y: 36, y: 36,
color: '#2D2D33', color: "#2D2D33",
fontWeight: 600, fontWeight: 600,
fontSize: 14 fontSize: 14,
}, },
{ {
text: '市场总监', text: "市场总监",
x: 22 + draw_function.getTextWidth('你的名字', 14), x: 22 + draw_function.getTextWidth("你的名字", 14),
y: 40, y: 40,
color: '#6E6E7A', color: "#6E6E7A",
fontWeight: 400, fontWeight: 400,
fontSize: 8 fontSize: 8,
}, },
{ {
text: '18888888888', text: "18888888888",
x: 30, x: 30,
y: 80, y: 80,
color: '#6E6E7A', color: "#6E6E7A",
fontSize: 7 fontSize: 7,
}, },
{ {
text: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层', text: "深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层",
x: 30, x: 30,
y: 94, y: 94,
color: '#6E6E7A', color: "#6E6E7A",
fontSize: 7, fontSize: 7,
lineNum: 2, lineNum: 2,
width: 185, width: 185,
lineHeight: 9 lineHeight: 9,
} },
] ];
const drawImages = callBack => { const drawImages = (callBack) => {
draw_function.drawImages(imgList[index], () => { draw_function.drawImages(imgList[index], () => {
index += 1 index += 1;
if (index != imgList.length) drawImages(callBack) if (index != imgList.length) drawImages(callBack);
else callBack() else callBack();
}) });
} };
drawImages(() => { drawImages(() => {
try { try {
textList.map((e, ind) => { textList.map((e, ind) => {
e.textBaseline = textBaseline e.textBaseline = textBaseline;
draw_function.drawText(e) draw_function.drawText(e);
if (ind == textList.length - 1) throw true if (ind == textList.length - 1) throw true;
}) });
} catch (error) { } catch (error) {
draw_function.toDataURL(({ draw_function.toDataURL(({ path }) => {
path
}) => {
this.setData({ this.setData({
shareImg: path shareImg: path,
}) });
}) });
} }
})
}
drawCard()
}
});
\ No newline at end of file \ No newline at end of file
});
};
drawCard();
},
});
<!-- pages/tab/index/index.wxml --> <!-- pages/tab/index/index.wxml -->
<user-info></user-info> <view class="main-box">
<user-info></user-info>
<view class="main-bottom">
<!-- 面向渠道 --> <!-- 面向渠道 -->
<import src="../../template/channel/channel.wxml" /> <import src="../../template/channel/channel.wxml" />
<template is="channel"></template> <template is="channel"></template>
...@@ -25,7 +27,9 @@ ...@@ -25,7 +27,9 @@
<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}}"></template>
</block> </block>
</view>
<!-- 服务咨询 --> <!-- 服务咨询 -->
<view> <view bindtap="goConsult">
<image mode="widthFix" class="icon-consult" webp src="{{IMGURL}}home/custom.png"></image> <image mode="widthFix" class="icon-consult" webp src="{{IMGURL}}home/custom.png"></image>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
page { page {
background-color: #F5F5F7; background-color: #F5F5F7;
} }
.tab-list { .tab-list {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
...@@ -61,5 +62,20 @@ page { ...@@ -61,5 +62,20 @@ page {
width: 80rpx; width: 80rpx;
position: absolute; position: absolute;
right: 6rpx; right: 6rpx;
bottom: 76rpx; bottom: 90rpx;
}
.main-box {
box-sizing: border-box;
height: 100%;
position: absolute;
width: 100%;
display: flex;
flex-direction: column;
}
.main-bottom {
background: #FFFFFF;
padding: 24rpx 0;
flex: 1;
} }
\ 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!