Commit 29b85e4c by 前端

Merge branch 'kuangyq_v2.10.0' into 'master'

v2.10.0

See merge request !2
2 parents 5128e50c e770b4f1
Showing 83 changed files with 4089 additions and 282 deletions
import api from './request' import api from './request'
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import wechatApi from './wechatApi'
import entmicroApi from './entmicroApi'
const common = 'scrm.api.carlife.common.' const common = 'scrm.api.carlife.common.'
module.exports = { module.exports = {
ssoApi, ssoApi,
entmicroApi,
wechatApi,
commonApi: { commonApi: {
/**上传图片 /**上传图片
*/ */
......
import api from "./request";
module.exports = {
// 智能名片详情
getCardDetail(data) {
return api.post(
{
method: `entmicro.api.business.card.cardDetail`,
...data,
},
true
);
},
}
\ No newline at end of file \ No newline at end of file
const target = [ const target = ["ip", "dev", "uat", "beta", "prod"];
'ip',
'dev',
'uat',
'prod'
]
/** /**
* *
0本地 0本地
...@@ -11,32 +6,51 @@ const target = [ ...@@ -11,32 +6,51 @@ const target = [
2测试 2测试
3生产 3生产
*/ */
const index = 2 const index = 2;
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
sso: { sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89', appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b', secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
}, },
}, },
uat: {}, uat: {
prod: {}, sso: {
} [target[index]] appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
},
beta: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
},
prod: {
sso: {
appKey: "8b31ae1009ccb0f96130ca4bd90e3d89",
secret: "02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b",
},
},
}[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', beta: "http://scrm.beta.glsx.com.cn",
} [target[index]] prod: "https://scrm.glsx.com.cn",
}[target[index]];
const pathEnum = { const pathEnum = {
sso: '/rop-scrm-sso/', sso: '/rop-scrm-sso/',
wechat: '/rop-scrm-wechat/',
business: '/rop-scrm-entmicro/'
} }
module.exports = { module.exports = {
index, index,
domain, domain,
pathEnum, pathEnum,
secretKey, secretKey,
}
\ No newline at end of file \ No newline at end of file
};
...@@ -23,9 +23,9 @@ class Request { ...@@ -23,9 +23,9 @@ class Request {
wx.showNavigationBarLoading() wx.showNavigationBarLoading()
let header = RequestMethods === 'POST' ? { let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} : {} } : {'Cache-Control': 'no-cache'}
const merchantId = wx.$util.getStorageSync('srcm_shopmall_merchant_id') // const merchantId = wx.$util.getStorageSync('srcm_shopmall_merchant_id')
if (merchantId) header.merchantId = merchantId // if (merchantId) header.merchantId = merchantId
let projectName = this.getRopProject(params.method) let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName] const path = pathEnum[projectName]
...@@ -71,7 +71,6 @@ class Request { ...@@ -71,7 +71,6 @@ class Request {
if (code == '0') { if (code == '0') {
resolve(data.data) resolve(data.data)
} else { } else {
console.log(data)
wx.showToast({ wx.showToast({
title: message || '系统异常', title: message || '系统异常',
icon: 'none' icon: 'none'
...@@ -81,7 +80,6 @@ class Request { ...@@ -81,7 +80,6 @@ class Request {
}, },
fail(error) { fail(error) {
wx.hideLoading() wx.hideLoading()
console.error(`接口异常:`, error)
wx.showToast({ wx.showToast({
title: '系统异常', title: '系统异常',
icon: 'error' icon: 'error'
...@@ -115,7 +113,7 @@ class Request { ...@@ -115,7 +113,7 @@ class Request {
params.v = '1.0.0' params.v = '1.0.0'
params.format = 'json' params.format = 'json'
params.locale = 'zh_CN' params.locale = 'zh_CN'
params.source = 'dj-wechat' params.source = 'Aicard-wechat'
params.appKey = appKey params.appKey = appKey
return sign(params, secret, noSignAttr) return sign(params, secret, noSignAttr)
} }
...@@ -124,8 +122,8 @@ class Request { ...@@ -124,8 +122,8 @@ class Request {
return projectName return projectName
} }
getMock() { getMock() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/config' let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/aicard-config'
if (index == 3) url = 'https://oss-config.test.glsx.com.cn/mock/6274e3050da5034a58680aa6/config' if (index == 3 || index == 4) url = 'https://oss-config.test.glsx.com.cn/mock/6274e3050da5034a58680aa6/aicard-config'
return new Promise((resolve) => { return new Promise((resolve) => {
wx.request({ wx.request({
url, url,
......
...@@ -4,7 +4,7 @@ module.exports = { ...@@ -4,7 +4,7 @@ module.exports = {
/**wx.login登录 */ /**wx.login登录 */
jsCodeLogin(data) { jsCodeLogin(data) {
return api.post({ return api.post({
method: `${path}jscode.login`, method: `${path}jscode.getOpenId`,
...data ...data
}, true) }, true)
}, },
...@@ -22,6 +22,13 @@ module.exports = { ...@@ -22,6 +22,13 @@ module.exports = {
...data ...data
}, true) }, true)
}, },
/**根据openId获取用户信息 */
getUserInfo(data) {
return api.post({
method: `${path}userProfile.getUserInfo`,
...data
}, true)
},
/**退出 */ /**退出 */
logout() { logout() {
return api.post({ return api.post({
......
import api from './request'
const path = 'scrm.api.wechat.'
module.exports = {
/** 解析scene */
getSceneById(data) {
return api.post({
method: `${path}get.scene.by.id`,
...data
}, true)
}
}
...@@ -3,24 +3,31 @@ import router from './router/index.js' ...@@ -3,24 +3,31 @@ import router from './router/index.js'
import util from './utils/util.js' import util from './utils/util.js'
import './utils/Track' import './utils/Track'
import { import {
ssoApi ssoApi,
wechatApi
} from './api/api' } from './api/api'
import {trackData} from './utils/data'
App({ App({
onLaunch: function () { onLaunch: function (options) {
/**挂载到wx对象 */ /**挂载到wx对象 */
wx.$util = util wx.$util = util
wx.$router = router wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
const systemInfo = wx.getStorageSync('srcm_shopmall_system_info') wx.$appId = wx.getAccountInfoSync().miniProgram.appId
const systemInfo = wx.getStorageSync('aicard_system_info')
if (!systemInfo) wx.getSystemInfo({ if (!systemInfo) wx.getSystemInfo({
success(res) { success(res) {
util.setStorageSync('srcm_shopmall_system_info', res) util.setStorageSync('aicard_system_info', res)
} }
}) })
this.login() if (options.path != 'pages/tab/index/index') {
this.login()
}
}, },
login(returnResponse) { login(returnResponse) {
let _this = this let _this = this
let openId = null
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.login({ wx.login({
success({ success({
...@@ -28,31 +35,58 @@ App({ ...@@ -28,31 +35,58 @@ App({
}) { }) {
ssoApi.jsCodeLogin({ ssoApi.jsCodeLogin({
code, code,
appId: _this.globalData.appId appId: wx.$appId
}).then(res => { }).then(res => {
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
if (returnResponse) { util.setSessionId(res.data.sessionId)
resolve(res) openId = res.data.openId
} else { util.setStorageSync('openId', openId)
if (res.code != -1) { if (wx.$trackData.scene) {
if (res.code == 0) { _this.getScene(wx.$trackData.scene).then(res => {
util.setUserInfo(res.data) wx.$trackData.merchant = res.merchantId
util.setSessionId(res.data.sessionId) wx.$trackData.cardId = res.cardId
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId)
})
}
ssoApi.getUserInfo({
openId
}).then(result => {
if (returnResponse) {
resolve(result)
} else {
if (result.code == 0) {
util.setUserInfo(result.data)
} else { } else {
util.showToast(res.message || '网络异常') util.showToast(result.message || '网络异常')
} }
resolve(result)
} }
resolve(res) })
}
}).catch(() => { }).catch(() => {
wx.$authStatus = true wx.$authStatus = true
reject() reject()
}) })
} }
}) })
}) })
}, },
getScene(scene) {
return new Promise((resolve, reject) => {
wechatApi.getSceneById({
id: decodeURIComponent(scene).split('=')[1]
}).then(({data}) => {
let op = {}
data.scene.split('&').map(item => {
const [key, val] = item.split("=")
op[key] = val
})
resolve(op)
})
})
},
globalData: { globalData: {
} }
})
\ No newline at end of file \ No newline at end of file
})
\ No newline at end of file \ No newline at end of file
...@@ -2,20 +2,22 @@ ...@@ -2,20 +2,22 @@
"pages": [ "pages": [
"pages/tab/index/index", "pages/tab/index/index",
"pages/applicationAccount/applicationAccount", "pages/applicationAccount/applicationAccount",
"pages/applicationPartener/applicationPartener" "pages/applicationPartener/applicationPartener",
"pages/applySuccess/applySuccess",
"pages/tab/introduction/introduction",
"pages/addTransform/addTransform/addTransform",
"pages/addTransform/addTransformDetail/addTransformDetail"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin", "navigationBarTitleText": "广联数科智能名片",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"usingComponents": {}, "usingComponents": {
"sitemapLocation": "sitemap.json", "authorize": "components/Authorize/Authorize",
"permission": { "phone-number": "components/PhoneNumber/PhoneNumber"
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}, },
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents" "lazyCodeLoading": "requiredComponents"
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,3 +4,7 @@ ...@@ -4,3 +4,7 @@
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
} }
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
\ No newline at end of file \ No newline at end of file
// components/Authorize/Authorize.js // components/Authorize/Authorize.js
import {
componentsMixin
} from '../../mixins/index'
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
scopeType: String, scopeType: String,
checkSetting: { /**是否自动打开 */
autoOpen: Boolean,
show: Boolean,
title: {
type: String,
value: '是否打开授权设置?'
},
confirmText: {
type: String,
value: '确定'
},
cancelText: {
type: String,
value: '取消'
},
buttonType: String,
confirmColor: String,
cancelColor: String,
isShowCheck: {
type: Boolean, type: Boolean,
value: false, value: true
observer: function (newVal, oldVal) { },
this.check() init: {
type: Boolean,
observer(n) {
if (n) this.check()
} }
} }
}, },
observers: {
'show': function (newVal) {
this.setData({
openSet: newVal
})
}
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
...@@ -28,45 +59,88 @@ Component({ ...@@ -28,45 +59,88 @@ Component({
* 禁止滑动 * 禁止滑动
*/ */
noScroll: wx.$util.noScroll(), noScroll: wx.$util.noScroll(),
cancel() { cancel(e) {
let {
confirm
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this
if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({
desc: title,
success(res) {
_this.triggerEvent('success', {
message: '授权成功',
data: res
})
}
})
}
this.setData({ this.setData({
openSet: false openSet: false
}) })
this.triggerEvent('cancel')
}, },
/**检验是否已授权位置 */
check() { check() {
const _this = this const _this = this
let { let {
scopeType buttonType,
scopeType,
autoOpen
} = this.properties } = this.properties
let type = `scope.${scopeType}` if (buttonType != 'getPhoneNumber') {
let buttonType = 'openSetting' let type = `scope.${scopeType}`
if (type === 'scope.userInfo') buttonType = 'getUserInfo' buttonType = 'openSetting'
this.setData({ if (type === 'scope.userInfo') buttonType = 'getUserInfo'
buttonType this.setData({
}) buttonType
wx.getSetting({ })
success(res) { wx.getSetting({
if (!res.authSetting[type]) { success(res) {
wx.authorize({ if (!res.authSetting[type]) {
scope: type, wx.authorize({
success() { scope: type,
_this.triggerEvent('success',{ success() {
message:'授权成功' _this.triggerEvent('success', {
}) message: '授权成功'
}, })
fail() { },
_this.setData({ fail() {
openSet: true _this.triggerEvent('fail', {
}) message: '未授权'
} })
}) if (autoOpen) {
} else { _this.setData({
_this.triggerEvent('success',{ openSet: true
message:'已授权' })
}) }
}
})
} else {
_this.triggerEvent('success', {
message: '已授权'
})
}
} }
} })
}) }
},
/**授权手机号 */
getPhoneNumber({
detail
}) {
this.triggerEvent('getphonenumber', detail)
} }
},
pageLifetimes: {
show: function () {
if (this.data.isShowCheck || this.data.init) this.check()
},
hide: function () {}
} }
}) })
\ No newline at end of file \ No newline at end of file
<view class='open-seting-bg' wx:if='{{openSet}}' catchtap='cancel' catchtouchmove='noScroll'> <view class="open-seting-bg text-center" wx:if="{{openSet}}" catchtap="cancel" catchtouchmove="noScroll">
<view class='open-set-inner'> <view class="open-set-inner">
<view class='set-title'>是否打开授权设置?</view> <view class="set-title"><text>{{title}}</text></view>
<view class='btn-openset'> <view class="btn-openset">
<view catchtap='cancel' class='btn'>取消</view> <view catchtap="cancel" class="btn text-center" style="color:{{cancelColor}};">{{cancelText}}</view>
<view class='btn'> <view class="btn text-center" style="color:{{confirmColor}};">
确定 {{confirmText}}
<button open-type='{{buttonType}}' class='button-style ' catchtap='cancel'></button> <block wx:if="{{buttonType == 'getPhoneNumber'}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-style"></button>
</block>
<block wx:else>
<button open-type="{{buttonType}}" class="button-style" catchtap="cancel" data-confirm></button>
</block>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -6,48 +6,66 @@ ...@@ -6,48 +6,66 @@
top: 0; top: 0;
left: 0; left: 0;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
z-index: 9999999999; z-index: 998;
} }
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.open-set-inner { .open-set-inner {
width: 400rpx; width: 564rpx;
height: 220rpx; height: 400rpx;
position: absolute; background: #FFFFFF;
top: 50%; border-radius: 16px;
left: 50%;
transform: translate(-50%,-50%);
background: #fff;
z-index: 9999999999;
} }
.btn-openset { @keyframes show-auth-box {
display: flex; 0% {
font-size: 30rpx; opacity: 0;
height: 100rpx; transform: scale(2);
}
100% {
opacity: 1;
transform: scale(1);
}
} }
.set-title { .set-title {
font-size: 30rpx; font-size: 36rpx;
height: 120rpx; min-height: 286rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center;
flex-direction: column;
}
.btn-openset {
display: flex;
font-size: 36rpx;
height: 112rpx;
border-top: 2rpx solid #E5E5E5;
font-weight: 500;
letter-spacing: 1rpx;
} }
.btn{
.btn {
flex: 1; flex: 1;
height: 100%; height: 100%;
position: relative; position: relative;
display: flex;
align-items: center;
justify-content: center;
} }
.button-style { .button-style {
position: absolute; position: absolute;
width: 100%; width: 100% !important;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
opacity: 0; opacity: 0;
top: 0; top: 0;
left: 0; left: 0;
} }
\ No newline at end of file \ No newline at end of file
...@@ -94,7 +94,6 @@ Component({ ...@@ -94,7 +94,6 @@ Component({
} = this.data } = this.data
wx.$util.showLoading() wx.$util.showLoading()
detail.sessionId = sessionId detail.sessionId = sessionId
console.log(detail);
ssoApi.authUserPhone(detail).then(({ ssoApi.authUserPhone(detail).then(({
data, data,
code code
......
// components/Login/Login.js
import { ssoApi } from "../../api/api";
import { componentsMixin } from "../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {},
observers: {},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
// 获取手机号
getPhoneNumber({detail}) {
if (
detail.errMsg &&
// e.detail.errMsg == "getPhoneNumber:fail user deny"
detail.errMsg.indexOf('user deny') !== -1
) {
return;
} else {
wx.$util.showLoading('正在授权...')
}
// this.triggerEvent("updatePhoneNumber", '18873336682');
getApp()
.login(true)
.then(({ data }) => {
delete detail.errMsg;
if (detail.iv && detail.encryptedData) {
// wx.$util.showLoading('正在授权...')
ssoApi.authUserPhone(detail).then(({ data, code, message }) => {
wx.hideLoading()
if (code==0) {
wx.$util.setUserInfo(data);
wx.$util.setSessionId(data.sessionId);
// 其他操作
this.triggerEvent("updatePhoneNumber", data.phone);
} else {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
});
}
});
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<button class="phone-number" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
了解更多案例
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
</button>
\ No newline at end of file \ No newline at end of file
/* 手机号授权 */
.phone-number {
display: flex;
align-items: center;
justify-content: center;
margin: 16rpx 48rpx;
color: #fff;
font-size: 28rpx;
letter-spacing: 0.8rpx;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -196,7 +196,6 @@ Component({ ...@@ -196,7 +196,6 @@ Component({
x: 0, x: 0,
y: 0, y: 0,
success(res) { success(res) {
console.log(res)
let { let {
tempFilePath tempFilePath
} = res } = res
...@@ -219,7 +218,6 @@ Component({ ...@@ -219,7 +218,6 @@ Component({
} }
}, },
fail(err) { fail(err) {
console.error(err)
wx.hideLoading() wx.hideLoading()
} }
}, this) }, this)
...@@ -243,7 +241,6 @@ Component({ ...@@ -243,7 +241,6 @@ Component({
x: 0, x: 0,
y: 0, y: 0,
success(preview) { success(preview) {
console.log(preview)
_this.setData({ _this.setData({
tempFilePath tempFilePath
}) })
...@@ -254,7 +251,6 @@ Component({ ...@@ -254,7 +251,6 @@ Component({
wx.hideLoading() wx.hideLoading()
}, },
fail(err) { fail(err) {
console.error(err)
wx.hideLoading() wx.hideLoading()
} }
}, this) }, this)
......
// components/UserInfo/UserInfo.js // components/UserInfo/UserInfo.js
import { componentsMixin } from "../../mixins/index";
import util from "../../utils/util";
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
cardInfo: {
type: Object,
observer(n) {
this.setData({
cardInfo: n,
});
},
},
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
showWechant: false,
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
}
})
\ No newline at end of file \ No newline at end of file
// 添加微信
addWechat() {
this.setData({
showWechant: !this.data.showWechant,
});
},
// 保存名片
addPhone() {
let _this = this,
{ clickCount } = this.data;
const { staffName, staffPhone, operation, address, agentName } =
this.data.cardInfo;
wx.addPhoneContact({
firstName: staffName,
mobilePhoneNumber: staffPhone,
title: operation,
organization: '广联数科',
workAddressCountry: "中国",
workAddressState: "广东省",
workAddressCity: "深圳市",
workAddressStreet: "留仙大道3370号南山智园崇文园区1号楼14层",
fail({ errMsg }) {
if (clickCount)
_this.setData({
showAuth: errMsg == "addPhoneContact:fail auth deny",
});
else
_this.setData({
clickCount: 1,
});
},
});
},
/**授权通讯录成功 */
authSuccess() {
this.setData({
flag: true,
unauthorized: false,
});
this.addPhone();
},
/**授权失败 */
authFail() {
this.setData({
unauthorized: true,
flag: true,
});
},
/** 拨打电话 */
callPhone() {
const { staffPhone } = this.data.cardInfo;
if (!staffPhone) {
util.showToast("手机号不存在");
return;
}
wx.makePhoneCall({
phoneNumber: staffPhone,
});
},
},
});
<text>这里是用户信息组件</text>
\ No newline at end of file \ No newline at end of file
<view class="user-wrapper">
<view class="user-box">
<view class="user-info" data-item="{{cardInfo}}">
<block wx:if="{{!showWechant}}">
<view class="user-company">
<image class="company-logo" src="{{IMGURL}}home/logo.png"></image>
</view>
<view class="user-name">
<view class="name">{{cardInfo.staffName || ''}}</view>
<view class="position">{{cardInfo.operation || ''}}</view>
</view>
<view class="user-phone">
<image class="user-icon" webp src="{{IMGURL}}share/icon-phone.png"></image>
<view>{{cardInfo.staffPhone || ''}}</view>
</view>
<view class="user-address">
<image class="user-icon" webp src="{{IMGURL}}share/icon-address.png"></image>
<view class="address">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
</view>
<image class="user-avatar" src="{{cardInfo.image}}" lazy-load></image>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/add-wechat.png"></image>
</block>
<view class="scrm" wx:else>
<image class="srcm-img" show-menu-by-longpress src="{{cardInfo.qrCode}}" lazy-load></image>
<view class="scrm-text">长按识别二维码,免费体验嘀加SCRM</view>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/back-user.png"></image>
</view>
</view>
<image class="user-bg" webp src="{{IMGURL}}home/user-bg.png" />
</view>
<view class="btn-group">
<view class="phone-btn" bindtap="callPhone">
<image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png"></image>
<view class="phone-text">拨打电话</view>
</view>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button>
<button class="btn-primary btn" open-type="share">分享名片</button>
</view>
</view>
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}"></authorize>
\ No newline at end of file \ No newline at end of file
.user-wrapper {
padding: 24rpx 32rpx;
background-color: #fff;
z-index: -1;
margin-bottom: 20rpx;
}
.user-info {
height: 416rpx;
padding: 40rpx 52rpx;
box-shadow: 0 12rpx 32rpx 0 rgba(147, 160, 194, .35);
border-radius: 16rpx;
box-sizing: border-box;
}
.user-box {
position: relative;
z-index: 1;
}
.user-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 416rpx;
z-index: -1;
}
.user-company {
display: flex;
align-items: center;
}
.company-logo{
width: 296rpx;
height: 60rpx;
}
.user-company text {
font-size: 18rpx;
line-height: 24rpx;
color: #2d2d33;
margin-left: 16rpx;
}
.user-name {
display: flex;
align-items: baseline;
margin-top: 24rpx;
}
.user-name .name {
font-size: 44rpx;
font-weight: 700;
color: #111111;
line-height: 72rpx;
}
.user-name .position {
font-weight: 400;
font-size: 26rpx;
color: #6E6E7A;
margin-left: 20rpx;
}
.user-phone {
display: flex;
align-items: center;
font-size: 24rpx;
color: #2D2D33;
line-height: 32rpx;
margin-top: 76rpx;
}
.user-icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.user-address {
display: flex;
align-items: baseline;
font-size: 24rpx;
color: #2D2D33;
line-height: 32rpx;
margin-top: 16rpx;
}
.user-address .address {
width: 438rpx;
}
.user-avatar {
position: absolute;
width: 128rpx;
height: 128rpx;
border-radius: 8rpx;
top: 48rpx;
right: 36rpx;
}
.add-wechat {
position: absolute;
bottom: 0;
right: 0;
width: 112rpx;
height: 120rpx;
}
.scrm {
text-align: center;
z-index: 1;
}
.srcm-img {
margin-top: 44rpx;
width: 192rpx;
height: 192rpx;
}
.scrm-text {
margin-top: 32rpx;
font-size: 28rpx;
color: #2d2d33;
}
.btn-group {
margin-top: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.phone-btn {
width: 136rpx;
/* height: 88rpx; */
box-sizing: border-box;
text-align: center;
padding: 4rpx 32rpx 4rpx 24rpx;
background: #FFFFFF;
box-shadow: 8rpx 0 16rpx 0 rgba(202,211,230,0.30);
}
.icon-dial {
width: 48rpx;
height: 48rpx;
}
.phone-text {
font-size: 20rpx;
color: #6E6E7A;
}
button::after {
display: none;
}
.btn {
display: inline-flex;
align-items: center;
padding: 12rpx 56rpx;
font-size: 32rpx;
line-height: 48rpx;
border-radius: 8rpx;
float: right;
margin: 0;
height: 48rpx;
box-sizing: content-box;
}
.btn-plain {
color: #5850ff;
border: 2rpx solid #9B96FF;
background-color: #fff;
/* margin-left: 46rpx; */
}
.btn-primary {
color: #FFFFFF;
background: #5850FF;
/* margin-left: 24rpx; */
}
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-09-01 11:28:34
* @LastEditors: huyue
* @LastEditTime: 2022-09-01 17:31:43
*/
module.exports = Behavior({
lifetimes: {
attached() {
let componentTimer = setInterval(() => {
let thisPage = wx.$router.getPageInstance()
let {
IMGURL,
img_version
} = thisPage.data
if (IMGURL && img_version) {
this.setData({
IMGURL,
img_version
})
clearInterval(componentTimer)
}
}, 0.25 * 1000)
}
}
})
\ No newline at end of file \ No newline at end of file
import componentsMixin from './componentsMixin'
import menuMixin from './menuMixin'
module.exports = {
componentsMixin,
menuMixin
}
\ No newline at end of file \ No newline at end of file
import { trackData } from "../utils/data";
module.exports = Behavior({
data: {
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0,
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE]
},
methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
const curIntroduceIndex = e.currentTarget.dataset.index;
switch(curIntroduceIndex) {
case 3:
// wx.$router.go('addTransform', {notIntercept: true});
wx.showToast({
title: '敬请期待',
icon: 'none'
})
// wx.$Track.sendTrack(trackData.DIJIA)
break
default:
this.setData({
curIntroduceIndex: curIntroduceIndex,
});
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
}
},
},
});
\ No newline at end of file \ No newline at end of file
// pages/addTransform/index/index.js
import pageData from '../constant/data'
Page({
/**
* 页面的初始数据
*/
data: {
editForm: {
sales: 100,
userNum: 10000
},
actualForm: {
sales: 100,
userNum: 10000
},
IMGURL: wx.$imgUrl,
height: 'calc(100vh - 100rpx)',
tagIndex: 0,
tabList: pageData.tabList,
introduceObj: {},
cardList: [],
// 玩法介绍
introduceVisible: false,
introduceList: pageData.introduceList,
// 产品详情
detailKeyList: Object.keys(pageData.addDatailObj)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
introduceObj: this.data.tabList[this.data.tagIndex].introduce,
cardList: this.data.tabList[this.data.tagIndex].cardList
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
handleInput(e) {
const attr = e.target.dataset.attr
this.setData({
[`${attr}`]: e.detail.value
})
},
handleTabClick(e) {
let {
index,
introduce,
cardList
} = e.detail
let {
tagIndex
} = this.data
if (index == tagIndex) return
this.setData({
tagIndex: index,
introduceObj: introduce || {},
cardList: cardList || []
})
},
handleCardClick(e) {
var obj = e.detail
if(!this.data.detailKeyList.includes(obj.detailAttrName)) {
wx.$util.showToast('敬请期待')
return true
}
wx.$router.go('addTransformDetail', { proName: obj.proName, attrName: obj.detailAttrName })
},
handleIntroduceClick() {
this.handleIntroduceClose()
},
handleIntroduceClose() {
this.setData({
introduceVisible: !this.data.introduceVisible
})
},
handleConfirm() {
this.setData({
actualForm: this.data.editForm
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "D+增值转化",
"usingComponents": {
"add-tab-view": "../components/AddTabView/AddTabView",
"card": "../components/Card/Card"
},
"backgroundColor": "#F6F5F8"
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/index/index.wxml-->
<view class="layout">
<view class="head">测算您门店的基本情况</view>
<view class="form-box">
<view class="form-row flex">
<text class="form-label">门店月平均新车销量</text>
<input class="form-input" placeholder="请输入" type="number" value="{{editForm.sales}}" bindinput="handleInput" data-attr="editForm.sales" />
<!-- <text class="suffix">台</text> -->
</view>
<view class="form-row flex">
<text class="form-label">3年售后存量用户数</text>
<input class="form-input" placeholder="请输入" type="number" value="{{editForm.userNum}}" bindinput="handleInput" data-attr="editForm.userNum" />
<!-- <text class="suffix">家</text> -->
</view>
<button class="submit-btn" bindtap="handleConfirm">提交测算</button>
</view>
</view>
<view class="layout">
<view class="head">我们的产品和服务</view>
<add-tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{height}}" bindclick="handleTabClick">
<view class="tab-content-box" wx:if="{{cardList.length}}">
<view class="pos-relative" bindtap="handleIntroduceClick">
<view class="card-introduce">
<image class="introduce-img" src="{{IMGURL}}{{introduceObj.imgUrl}}?v={{img_version}}" />
<view class="introduce-content">
<view class="introduce-txt">{{introduceObj.title}}</view>
<view class="introduce-btn">查看阶段玩法</view>
</view>
</view>
</view>
<view class="card-title-box">
<view>阶段产品</view>
<view class="tips">预估收益根据您的新车销量 {{ actualForm.sales || 0 }}台 测算所得</view>
</view>
<view wx:for="{{cardList}}" wx:key="index">
<card cardForm="{{item}}" actualForm="{{actualForm}}" tagIndex="{{tagIndex}}" bindclick="handleCardClick"></card>
</view>
</view>
</add-tab-view>
</view>
<!-- 玩法介绍 -->
<view class="pos-relative">
<view class="{{introduceVisible ? 'model' : 'model-hidden'}}" catchtouchmove="noScroll" bindtap="handleIntroduceClose">
<view>
<view class="model-box">
<image class="model-img" src="{{IMGURL}}addTransform/card/deliver/model-introduce.png?v={{img_version}}" />
<view class="model-block">
<view class="model-head">
<view class="head-title">{{introduceList[tagIndex].title}}</view>
<view>{{introduceList[tagIndex].subTitle}}</view>
</view>
<view class="model-content">
<view class="content-block" wx:for="{{introduceList[tagIndex].contentList}}" wx:key="index">
<image class="content-icon" src="{{IMGURL}}addTransform/card/deliver/model-{{item.icon}}.png?v={{img_version}}" />
<view>
<view class="content-title">{{item.title}}</view>
<view class="content-row" wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex">
<view class="content-txt" wx:if="{{subItem.name}}">{{subItem.name}}</view>
<view class="content-tip">{{subItem.tip}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="model-btn">知道了</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/index/index.wxss */
page {
background-color: #F6F5F8;
}
.layout {
background: #FFFFFF;
padding-bottom: 32rpx;
margin-bottom: 16rpx;
}
.flex {
display: flex;
}
.head {
font-size: 32rpx;
font-weight: 600;
line-height: 48rpx;
padding: 32rpx 0 16rpx 0;
}
.head::before {
content: '';
display: inline-block;
width: 8rpx;
height: 28rpx;
background: #5850FF;
border-radius: 0 2rpx 2rpx 0;
margin-right: 32rpx;
}
.form-box {
margin: 0 32rpx;
font-size: 28rpx;
color: #2D2D33;
background-image: linear-gradient(179deg, rgba(123, 112, 255, 0.02) 15%, rgba(99, 92, 255, 0.10) 100%);
border-radius: 8rpx;
padding: 24rpx 32rpx;
}
.form-box .form-row {
justify-content: space-around;
align-items: center;
line-height: 72rpx;
margin-bottom: 24rpx;
}
.form-row .form-label {
padding-right: 10rpx;
flex-grow: 1;
}
.form-input {
box-sizing: border-box;
height: 72rpx;
width: 256rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
padding: 0 20rpx;
}
.suffix {
width: 28rpx;
color: #6E6E7A;
margin-left: 16rpx;
}
.submit-btn {
height: 72rpx;
line-height: 72rpx;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.tab-content-box {
margin: 16rpx 16rpx;
}
.pos-relative {
position: relative;
z-index: 1;
}
.card-introduce {
font-size: 28rpx;
width: 100%;
height: 160rpx;
color: #FFFFFF;
}
.introduce-img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.introduce-content {
padding: 32rpx 0 28rpx 32rpx;
}
.introduce-txt {
height: 44rpx;
line-height: 44rpx;
font-size: 28rpx;
margin-bottom: 16rpx;
}
.introduce-btn {
box-sizing: border-box;
width: 144rpx;
height: 40rpx;
opacity: 0.8;
font-size: 20rpx;
background: #7E78FF;
border-radius: 4rpx;
padding: 4rpx 12rpx;
}
.card-title-box {
font-size: 28rpx;
color: #2D2D2E;
margin: 32rpx 0;
}
.tips {
font-size: 24rpx;
color: #9E9EA8;
margin-top: 8rpx;
}
.model-hidden {
position: fixed;
left: -1000000;
top: -100000;
}
.model {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 99;
background: rgba(0, 0, 0, 0.7);
}
.model-box {
position: relative;
box-sizing: border-box;
width: calc(100vw - 128rpx);
height: 848rpx;
margin: 0 64rpx 48rpx;
}
.model-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.model-block {
position: absolute;
font-size: 28rpx;
width: 100%;
height: 100%;
}
.model-head {
display: flex;
width: 100%;
height: 20%;
font-size: 24rpx;
color: #5850FF;
justify-content: center;
align-items: center;
flex-direction: column;
}
.model-head .head-title {
font-size: 40rpx;
font-weight: 600;
margin-bottom: 8rpx;
}
.model-block .model-content {
width: 100%;
padding: 4% 40rpx;
}
.model-content .content-block {
display: flex;
font-size: 24rpx;
margin-bottom: 16rpx;
}
.model-content .content-icon {
width: 64rpx;
height: 64rpx;
margin-right: 16rpx;
}
.model-content .content-row {
display: flex;
margin-bottom: 8rpx;
}
.model-content .content-title {
height: 64rpx;
line-height: 64rpx;
font-size: 28rpx;
color: #2D2D33;
font-weight: 700;
}
.model-content .content-txt {
color: #2D2D33;
margin-right: 16rpx;
font-weight: 600;
}
.model-content .content-tip {
color: #6E6E7A;
}
.model-btn {
height: 88rpx;
line-height: 88rpx;
background: #5850FF;
border: 2rpx solid rgba(255, 255, 255, 0.50);
border-radius: 12rpx;
font-weight: 600;
font-size: 36rpx;
color: #FFFFFF;
text-align: center;
margin: 0 176rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/detail/detail.js
import pageData from '../constant/data'
import util from '../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: wx.$imgUrl,
attrName: '',
proName: '',
addDatailObj: pageData.addDatailObj,
detailObj: {},
hasShare: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (util.getUserInfo().phone) {
this.setData({
hasShare: true
})
}
wx.$router.getData(({
attrName,
proName
}) => {
this.setData({
proName: proName,
attrName: attrName,
detailObj: this.data.addDatailObj[attrName]
})
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "D+增值转化",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/detail/detail.wxml-->
<view>
<view class="layout">
<view class="head">
<image class="head-icon" src="{{IMGURL}}addTransform/detail/icon-name.png?v={{img_version}}" />
<text class="head-txt">{{proName}}</text>
</view>
<swiper class="m-b-32" indicator-dots="true" autoplay="true">
<block wx:for="{{detailObj.imgList}}" wx:key="*this">
<swiper-item>
<image class="swiper-img" src="{{IMGURL}}{{item.url}}?v={{img_version}}" />
</swiper-item>
</block>
</swiper>
<view class="content-txt">{{detailObj.text}}</view>
</view>
<view class="layout">
<view class="head">
<image class="head-icon" src="{{IMGURL}}addTransform/detail/icon-video.png?v={{img_version}}" />
<text class="head-txt">案例视频</text>
</view>
<video class="video" wx:for="{{detailObj.videoList}}" wx:key="index" title="案例视频:{{proName}}" src="{{IMGURL}}{{item.url}}?v={{img_version}}"></video>
</view>
<view class="fixed-btn" wx:if="{{hasShare}}">
<button class="btn-share" open-type="share">
<image class="btn-icon" src="{{IMGURL}}addTransform/detail/share.png?v={{img_version}}"/>
<text>分享此页面</text>
</button>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/detail/detail.wxss */
page {
background-color: #F6F5F8;
padding-bottom: 112rpx;
}
.layout {
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 20rpx;
}
.head {
display: flex;
align-items: center;
margin-bottom: 32rpx;
}
.head-icon {
width: 48rpx;
height: 48rpx;
}
.head-txt {
font-size: 32rpx;
color: #333333;
font-weight: 600;
margin-left: 20rpx;
}
.swiper-img {
width: 100%;
height: 100%;
}
.m-b-32 {
margin-bottom: 32rpx;
}
.content-txt {
font-size: 28rpx;
color: #111111;
line-height: 48rpx;
}
.video {
width: 100%;
height: 396rpx;
}
.fixed-btn {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #FFFFFF;
padding: 24rpx 0 16rpx;
box-shadow: 0 -4rpx 8rpx 0 rgba(196, 199, 204, 0.20);
}
.btn-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.btn-share {
display: flex;
justify-content: center;
align-items: center;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
margin: 0 48rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/components/AddTabView/AddTabView.js
Component({
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: {
type: String,
value: '100vh'
},
tagIndex: {
type: Number,
value: 0,
observer: function (n, o) {
this.setData({
count: n
})
}
},
key: {
type: String,
value: 'name'
},
showClickLoading:Boolean
},
/**
* 组件的初始数据
*/
data: {
count: 0,
scrollTop: 0,
IMGURL: wx.$imgUrl
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
item,
index
} = e.currentTarget.dataset
if(this.data.count === index) return
if(this.properties.showClickLoading) wx.$util.showLoading('')
item.index = index
this.setData({
count: index,
scrollTop: 0
})
this.triggerEvent('click', item)
wx.nextTick(()=>{
wx.hideLoading()
})
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
}
},
ready() {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/components/AddTabView/AddTabView.wxml-->
<view class='tab-box' id='tabView' style="height:{{height}}">
<scroll-view style="height:100%;" scroll-y class='tab' bindscrolltolower='tabScrollTolower'>
<view>
<block wx:for='{{tabList}}' wx:key='index'>
<view class='tab-item {{count==index?"active":""}}' bindtap="click" data-item='{{item}}' data-index='{{index}}'>
<image webp class="tab-bg" src="{{IMGURL}}addTransform/tab-{{index + 1}}.png?v={{img_version}}" />
<view wx:for="{{item[key]}}" wx:key="index" wx:for-item="subItem">{{subItem}}</view>
</view>
</block>
</view>
</scroll-view>
<view class='view'>
<scroll-view style="height:100%" scroll-y scroll-top='{{scrollTop}}' bindscrolltolower='viewScrollTolower'>
<slot></slot>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/components/AddTabView/AddTabView.wxss */
.tab {
float: left;
width: 21.34%;
box-sizing: border-box;
text-align: center;
background: #F2F2F7;
}
.view {
box-sizing: border-box;
float: left;
width: 78.66%;
height: 100%;
position: relative;
padding: 0px 16rpx;
}
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.tab-item {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 240rpx;
font-size: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #6E6E7A;
box-sizing: border-box;
padding: 0 10rpx;
}
.tab-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.active {
font-weight: 700;
background: #fff;
color: #2D2D33;
position: sticky;
top: 0;
font-size: 28rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/components/card/Card.js
Component({
/**
* 组件的属性列表
*/
properties: {
cardForm: {
type: Object,
      observer(n) {
        this.setData({
cardForm: n
        })
}
},
actualForm: {
type: Object,
observer(n) {
      this.setData({
actualForm: n
      })
this.calcProfit()
}
},
tagIndex: {
type: Number,
observer(n) {
this.calcProfit()
}
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: wx.$imgUrl,
typeObj: {
service: {
name: '服务类',
bgColor: 'rgba(255,231,205,0.80)',
color: '#EF971E'
},
membrane: {
name: '膜类',
bgColor: '#E3ECFF',
color: '#4E87FB'
},
beauty: {
name: '美容类',
bgColor: '#EAE9FF',
color: '#5851FF'
},
light: {
name: '轻改类',
bgColor: '#D7F5E5',
color: '#21AB60'
}
},
},
ready() {
},
/**
* 组件的方法列表
*/
methods: {
handleClick() {
this.triggerEvent('click', this.data.cardForm)
},
calcProfit() {
var targetItem = this.data.cardForm
let sales = +this.data.actualForm.sales || 0
let userNum = +this.data.actualForm.userNum || 0
let defaultPrice = +targetItem.priceList[0].value
if(targetItem.detailAttrName) {
switch(targetItem.detailAttrName) {
case 'digitRight':
targetItem.profit = (sales * 0.5 * defaultPrice * 12).toFixed(0) + ''
break
case 'sunMembrane':
targetItem.profit = (sales * 0.8 * 0.7 * defaultPrice * 12).toFixed(0) + ''
break
case 'paintMembrane':
targetItem.profit = (userNum * 0.15 * defaultPrice * 12).toFixed(0) + ''
break
case 'colorMembrane':
targetItem.profit = (userNum * 0.05 * defaultPrice * 12).toFixed(0) + ''
break
case 'digitBeauty':
targetItem.profit = (sales * 0.2 * defaultPrice * 12).toFixed(0) + ''
break
case 'chair':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.01).toFixed(0) + ''
break
case 'ar':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
case 'lamp':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
case 'navigation':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
default:
break
}
}
this.setData({
cardForm: targetItem
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/components/card/Card.wxml-->
<view class="card-box" bindtap="handleClick">
<image class="img" src="{{IMGURL}}{{cardForm.imgUrl}}?v={{img_version}}" />
<view class="card-block">
<view class="m-b-20">
<text class="card-type" style="color: {{typeObj[cardForm.type].color}}; background-color: {{typeObj[cardForm.type].bgColor}}">{{typeObj[cardForm.type].name}}</text>
<text class="card-title">{{cardForm.proName}}</text>
</view>
<view class="flex card-row">
<view wx:for="{{cardForm.priceList}}" wx:key="index" class="price-item">
<text class="m-r-8">{{item.name}}</text>
<text>¥{{item.value}}</text>
</view>
</view>
<view class="flex-space card-row">
<view wx:if="{{cardForm.profit}}">
<text class="m-r-8">预估收益</text>
<text class="profit-txt">¥{{cardForm.profit}}</text>
</view>
<view wx:else="">暂无预估收益,敬请期待</view>
<view class="profit-jump">产品介绍<text class="arrow"></text></view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/components/card/Card.wxss */
.card-box {
box-sizing: border-box;
height: 440rpx;
background: #FAFAFA;
box-shadow: 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.32);
border-radius: 16rpx;
margin-bottom: 40rpx;
font-size: 24rpx;
}
.flex {
display: flex;
}
.flex-space {
display: flex;
justify-content: space-between;
}
.card-block {
padding: 32rpx 24rpx 24rpx;
}
.img {
width: 100%;
height: 240rpx;
}
.card-type {
padding: 4rpx 16rpx;
border-radius: 4rpx;
margin-right: 20rpx;
}
.m-b-20 {
margin-bottom: 20rpx;
}
.m-r-8 {
margin-right: 8rpx;
}
.card-title {
font-size: 32rpx;
color: #2D2D33;
font-weight: 600;
}
.card-row {
color: #6E6E7A;
height: 40rpx;
margin-bottom: 4rpx;
}
.price-item {
margin-right: 32rpx;
}
.price-item:last-child {
margin-right: 0;
}
.profit-txt {
font-size: 28rpx;
color: #5850FF;
font-weight: 600;
}
.profit-jump {
color: #9E9EA8;
}
.arrow {
display: inline-block;
width: 12rpx;
height: 12rpx;
border: 2rpx solid #9E9EA8;
border-width: 2rpx 2rpx 0 0;
opacity: 0.7;
transform: rotate(45deg);
margin-left: 10rpx;
}
\ No newline at end of file \ No newline at end of file
var tabList = [{
name: ['新车', '交付期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '数字无忧卡权益',
detailAttrName: 'digitRight',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '2000'
}],
profit: '1200000'
}, {
proName: '汽车太阳膜',
detailAttrName: 'sunMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '合资自主品牌',
value: '1500'
}, {
name: '豪华品牌',
value: '2000'
}],
profit: '10080000'
}]
}, {
name: ['新车', '磨合期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '漆面保护膜',
detailAttrName: 'paintMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '均客单价',
value: '12000'
}],
profit: '2160000'
}, {
proName: '改色膜',
detailAttrName: 'colorMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '均客单价',
value: '5000'
}],
profit: '300000'
}]
}, {
name: ['用车', '热络期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '数字化美容',
detailAttrName: 'digitBeauty',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'beauty',
priceList: [{
name: '均客单价',
value: '300'
}],
profit: '72000'
}, {
proName: '座椅通风',
detailAttrName: 'chair',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2580'
}],
profit: '880'
}, {
proName: 'AR导航',
detailAttrName: 'ar',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '1680'
}],
profit: '880'
}, {
proName: '氛围灯',
detailAttrName: 'lamp',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2680'
}],
profit: '880'
}, {
proName: '360全景导航',
detailAttrName: 'navigation',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2880'
}],
profit: '880'
}]
}, {
name: ['用车', '流失期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '车险续保',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '2500'
}],
profit: null
}, {
proName: '金融车贷',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '20000'
}],
profit: null
}, {
proName: '数字化美容',
detailAttrName: 'digitBeauty',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'beauty',
priceList: [{
name: '均客单价',
value: '350'
}],
profit: '880'
}]
}]
var introduceList = [{
title: '新车交付期',
subTitle: '已购车/待交付车辆阶段',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '新车套餐打包 + 驻点销售升级'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店新车、展厅车销售'
}, {
name: '触达工具',
tip: '新车销售打包、太阳膜安装施工'
}, {
name: '配合岗位',
tip: '新车销售岗、精品岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '套餐毛利、流量触达'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '30%'
}, {
name: '预计单月',
tip: '6万/100台新车月销量'
}]
}]
}, {
title: '新车磨合期',
subTitle: '购车第一年(0-12个月内)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '订单膨胀、团购众筹'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店新车、展厅车销售'
}, {
name: '触达工具',
tip: '企业微信'
}, {
name: '配合岗位',
tip: '精品岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '内容种草'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '5%'
}, {
name: '预计单月',
tip: '5万'
}]
}]
}, {
title: '用车熟络期',
subTitle: '购车第二年(12-36个月内)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '众筹团购、以旧换新抵扣'
}, {
name: '',
tip: '直播展示+线下体验,秒杀活动+勾子产品'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店售后基盘'
}, {
name: '触达工具',
tip: '企业微信/个人微信'
}, {
name: '配合岗位',
tip: '全员岗位'
}, {
name: '营销频次',
tip: '轻改类每个季度、美容类每个月'
}, {
name: '转化关键',
tip: '内容种草+高性价比'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '2%'
}, {
name: '预计单月',
tip: '5万'
}]
}]
}, {
title: '用车流失期',
subTitle: '购车三年以上(36个月以上)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '权益套餐买送'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店续保流失客户'
}, {
name: '触达工具',
tip: '企业微信/个人微信'
}, {
name: '配合岗位',
tip: '续保岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '高性价比'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '10%'
}, {
name: '预计单月',
tip: '2万'
}]
}]
}]
var addDatailObj = {
digitRight: {
imgList: [{
url: 'addTransform/card/deliver/introduce.png'
}, {
url: 'addTransform/card/deliver/card-0.png'
}],
text: '产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案。',
videoList: [{
url: 'addTransform/detail/video.mp4'
}]
},
sunMembrane: {
imgList: [{
url: 'addTransform/card/deliver/introduce.png'
}, {
url: 'addTransform/card/deliver/card-0.png'
}],
text: '太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜。',
videoList: [{
url: 'addTransform/detail/video.mp4'
}]
}
}
export default {
tabList,
introduceList,
addDatailObj
}
\ No newline at end of file \ No newline at end of file
...@@ -10,8 +10,9 @@ Page({ ...@@ -10,8 +10,9 @@ Page({
accountForm: { accountForm: {
applyName: '', applyName: '',
telphone: '', telphone: '',
enterpriseName: '', concerContent: '',
concerContent: '' bussinessName: '',
province: []
} }
}, },
...@@ -19,32 +20,69 @@ Page({ ...@@ -19,32 +20,69 @@ Page({
// 表单验证规则 // 表单验证规则
initValidate() { initValidate() {
const rules = { const rules = {
applyName: {
nickName: { required: true
},
required: true, telphone: {
required: true
minlength: 2 },
bussinessName: {
} required: true
},
province: {
required: true
}
} }
const messages = { const messages = {
applyName: {
nickName: { required: '请填写申请人名称',
},
required: '请填写姓名', telphone: {
required: '请填写联系电话'
minlength: '请输入正确的名称' },
bussinessName: {
} required: '请填写企业/门店名称'
},
province: {
required: '请选择省市'
} }
}
this.WxValidate = new WxValidate(rules, messages) this.WxValidate = new WxValidate(rules, messages)
}, },
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 提交表单
submitAccount(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
},
// 选择省市
bindRegionChange(e) {
console.log(e.detail.value);
this.setData({
"accountForm.province": e.detail.value
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
<!--pages/applicationAccount/applicationAccount.wxml--> <!--pages/applicationAccount/applicationAccount.wxml-->
<view class="apply-account"> <view class="apply-account">
<view> <view class="apply-top">
top <image class="apply-background" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
</view> <view class="apply-title">免费申请体验账号</view>
<view> <button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
</view> 添加体验专员
<view class="contact-inline"> </button>
</view> </view>
<form class="apply-box" bindsubmit="submitAccount">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<picker mode="region" value="{{accountForm.province}}" bindchange="bindRegionChange">
<view class='info-list'>
<text class="info-lable">所在省市<text class="require"> *</text></text>
<block wx:if="{{!accountForm.province.length}}">
<view class="province-placeholder">请选择</view>
</block>
<block wx:else>
<view>{{accountForm.province}}</view>
</block>
</view>
</picker>
<view class='info-list'>
<text class="info-lable">企业名称<text class="require"> *</text></text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的企业/门店名称' value="{{parternerForm.bussinessName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view>
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
<view class="contact-inline">
</view>
</view> </view>
...@@ -3,6 +3,112 @@ ...@@ -3,6 +3,112 @@
position: relative; position: relative;
} }
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 128rpx;
left: 182rpx;
}
.apply-code {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
.add-btn {
width: 260rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 252rpx;
left: 244rpx;
}
.apply-box {
width: 702rpx;
height: 864rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
textarea {
width: 475rpx !important;
}
.province-placeholder {
font-size:28rpx;
color: #9E9EA8;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 40rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.contact-inline { .contact-inline {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
......
// pages/applicationPartener/applicationPartener.js // pages/applicationPartener/applicationPartener.js
import WxValidate from "../../utils/WxValidate"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
parternerForm: {
applyName: '',
telphone: '',
province: []
}
},
// 表单验证规则
initValidate() {
const rules = {
applyName: {
required: true
},
telphone: {
required: true
},
province: {
required: true
}
}
const messages = {
applyName: {
required: '请填写申请人名称',
},
telphone: {
required: '请填写联系电话'
},
province: {
required: '请选择省市'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 提交表单
submitParterner(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
// 跳转申请成功页面
wx.$router.go("applySuccess");
},
// 选择省市
bindRegionChange(e) {
console.log(e.detail.value);
this.setData({
"parternerForm.province": e.detail.value
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// 初始化验证规则函数
this.initValidate()
}, },
/** /**
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "合作申请"
} }
\ No newline at end of file \ No newline at end of file
<!--pages/applicationPartener/applicationPartener.wxml--> <!--pages/applicationPartener/applicationPartener.wxml-->
<text>pages/applicationPartener/applicationPartener.wxml</text> <view class="apply-partener">
<view class="apply-top">
<image class="apply-background" mode="widthFix" webp src="{{IMGURL}}home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
<view class="apply-title">申请城市合伙人</view>
<!-- <button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
添加合伙人专员
</button> -->
</view>
<form class="apply-box" bindsubmit="submitParterner">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<picker mode="region" name="province" value="{{parternerForm.province}}" bindchange="bindRegionChange">
<view class='info-list'>
<text class="info-lable">所在省市<text class="require"> *</text></text>
<view class="province-box">
<view>
<block wx:if="{{!parternerForm.province.length}}">
<view class="province-placeholder">请选择</view>
</block>
<block wx:else>
<view>{{parternerForm.province}}</view>
</block></view>
<view class="province-icon"></view>
</view>
</view>
</picker>
<!-- <view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view> -->
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/applicationPartener/applicationPartener.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/applicationPartener/applicationPartener.wxss */
.apply-partener {
position: relative;
}
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 160rpx;
left: 182rpx;
}
.apply-code {
width: 28rpx;
height: 28rpx;
vertical-align: middle;
}
.add-btn {
width: 284rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 512rpx;
left: 232rpx;
}
.apply-box {
width: 702rpx;
height: 640rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
.province-box {
width: 460rpx;
display: flex;
justify-content: space-between;
position: relative;
}
.province-icon {
width: 10rpx;
height: 10rpx;
transform: rotate(135deg);
border-top: 1px solid #9E9EA8;
border-left: 1px solid #9E9EA8;
position: absolute;
top: 12rpx;
right: 3rpx;
}
.province-placeholder {
font-size:28rpx;
color: #9E9EA8;
}
textarea {
width: 475rpx !important;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 160rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
// pages/applySuccess/applySuccess.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "合作申请"
}
\ No newline at end of file \ No newline at end of file
<!--pages/applySuccess/applySuccess.wxml-->
<view class="success-box">
<view>
<image class="success-img" mode="widthFix" webp src="{{IMGURL}}home/success.png" bindload="imgSuccess" data-name="logo"></image>
</view>
<view class="success-title">申请成功</view>
<view class="success-text">您的合伙人对外宣传合作案例页面已生成,</view>
<view class="success-text">点击下方按钮进入您的方案管理页面,</view>
<view class="success-text">可对具体案例页面进行分享。</view>
<button class="share-btn">
进入您的可分享页面
</button>
</view>
/* pages/applySuccess/applySuccess.wxss */
.success-box {
text-align: center;
}
.success-img {
width: 448rpx;
height: 192rpx;
margin-top: 240rpx;
}
.success-title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 56rpx;
color: #2D2D33;
margin: 32rpx 0;
}
.success-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
}
.share-btn {
width: 622rpx;
height: 80rpx;
font-size: 28rpx;
color: #ffffff;
background: #5850FF;
border-radius: 8rpx;
line-height: 80rpx;
margin-top: 160rpx;
}
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-08-30 11:26:21
* @LastEditors: huyue
* @LastEditTime: 2022-09-09 14:41:59
*/
// pages/tab/index/index.js // pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index";
import Draw from "../../../utils/Draw";
import { ssoApi, entmicroApi } from "../../../api/api";
import util from "../../../utils/util";
import { trackData } from "../../../utils/data";
Page({ Page({
behaviors: [menuMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
introduceName: "", introduceName: "",
tabList: [
{
name: "公司介绍",
icon: "icon-company",
icon1: "icon-company1",
},
{
name: "方案介绍",
icon: "icon-product",
icon1: "icon-product1",
},
{
name: "视频直播",
icon: "icon-video",
icon1: "icon-video",
},
// {
// name: "合作申请",
// icon: "icon-cooperation",
// icon1: "icon-cooperation",
// },
],
curTabIndex: 0,
// 0-员工,1-代理商
customerType: 0,
// 是否授权昵称
hasUserInfo: false,
// 是否授权手机号
hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE],
// 员工名片信息
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'
},
banner: ['company-img3.png', 'company-img31.png'],
current: 0,
clueList: ['clue-img2.webp', 'clue-img3.webp', 'clue-img4.webp', 'clue-img5.webp', 'clue-img6.webp', 'clue-img7.webp', 'clue-img8.webp', 'clue-img9.webp', 'clue-img10.webp', 'clue-img11.webp', 'clue-img12.webp', 'clue-img13.webp'],
clueCurrent: 0,
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}],
awardCurrent: 0
}, },
introduce(e) { introduce(e) {
console.log(e.target.dataset.name); const curTabIndex = e.currentTarget.dataset.index;
const name = e.target.dataset.name; // 视频直播和合作申请是跳转新页面,不需要设置激活样式
switch (name) { // 0-公司介绍 1-方案介绍 2-视频直播 3-合作申请
case "城市合伙人": switch (curTabIndex) {
wx.$router.go("applicationPartener"); case 2:
wx.openChannelsActivity({
finderUserName: 'sphPIdcy0NVpuao',
feedId: 'export/UzFfAgtgekIEAQAAAAAAOQ8BJrsjzwAAAAstQy6ubaLX4KHWvLEZgBPEmIEUOQV4c62CzNPgMJqRnrGh3TfaajoIU4mGBiio'
})
wx.$Track.sendTrack(trackData.VIDEO);
break; break;
default: default:
this.setData({ this.setData({
introduceName: name, curTabIndex: curTabIndex,
}); });
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
} }
}, },
jump() {
wx.$router.go("applicationAccount"); // 跳转咨询页面
goConsult() {
console.log("跳转到咨询页面");
wx.openCustomerServiceChat({
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcdc6d35b59631ce3c'},
corpId: 'ww2318dc9e5d23230b',
complete: r => {
console.log(r)
}
})
},
// 更新手机号
updatePhoneNumber(e) {
if (e.detail) {
this.setData({
hasPhoneNumber: true,
});
}
},
// 政府与行业资质轮播切换
changePage(e) {
let current = e.detail.current
this.setData({
current: current
})
},
// 荣誉与奖项轮播切换
changeBanner(e) {
let awardCurrent = e.detail.current
this.setData({
awardCurrent: awardCurrent
})
},
tapBanner(e) {
console.log(e)
let current = e.target.dataset.current
this.setData({
awardCurrent: current
})
}, },
// 智能线索轮播切换
clueChange(e) {
let clueCurrent = e.detail.current
this.setData({
clueCurrent: clueCurrent
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// setTimeout(() => { wx.$util.showLoading('加载中...')
// wx.$router.go('application') getApp()
// }, 2e3) .login()
.then(({ data }) => {
wx.hideLoading()
if (data && data.nickName) {
this.setData({
hasUserInfo: true,
});
} else {
this.setData({
hasUserInfo: false
})
}
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
});
}
this.getCardDetail();
});
}, },
/** /**
...@@ -39,7 +170,13 @@ Page({ ...@@ -39,7 +170,13 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() {
const options = wx.getEnterOptionsSync()
wx.$trackData = options.query
if (wx.$trackData.merchant) {
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
}
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
...@@ -64,5 +201,180 @@ Page({ ...@@ -64,5 +201,180 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {
return {
title: `您好,我向你推荐了广联数科的${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg,
};
},
setShareInfo(data = {}) {
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",
url: data.image,
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: data.staffName,
x: 18,
y: 36,
color: "#2D2D33",
fontWeight: 600,
fontSize: 14,
},
{
text: data.operation,
x: 22 + draw_function.getTextWidth(data.staffName, 14),
y: 40,
color: "#6E6E7A",
fontWeight: 400,
fontSize: 8,
},
{
text: data.staffPhone,
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();
},
// 获取用户昵称
getUserProfile(e) {
this.setData({
hasUserInfo: true,
});
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
ssoApi
.authUserInfo({
...res,
})
.then(({ code }) => {
if (code == "0") {
getApp()
.login()
.then(({ data }) => {
this.setData({
userInfo: data,
// hasUserInfo: true
});
});
}
});
},
});
},
// 获取员工名片信息
getCardDetail() {
const sessionId = util.getSessionId();
let params = {};
params.cardId = wx.$trackData.cardId
entmicroApi.getCardDetail(params).then(({data, code, message}) => {
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
this.setData({
cardInfo: data || this.data.defaultInfo
})
this.setShareInfo(this.data.cardInfo);
});
},
}); });
{ {
"usingComponents": { "usingComponents": {
"user-info": "../../../components/UserInfo/UserInfo" "user-info": "../../../components/UserInfo/UserInfo"
} },
"navigationBarTitleText": "广联数科智能名片"
} }
\ No newline at end of file \ No newline at end of file
<!--
此文件为开发者工具生成,生成时间: 2022/9/17下午3:18:38
使用方法:
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxml 引入模板
```
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}" />
```
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
-->
<template name="skeleton">
<view class="sk-container">
<view class="main-box">
<view is="components/UserInfo/UserInfo" hidden="{{cardInfo}}">
<view class="UserInfo--user-wrapper">
<view class="UserInfo--user-box">
<view class="UserInfo--user-info" data-item="[object Object]">
<view class="UserInfo--user-company">
<image class="UserInfo--company-logo sk-image"></image>
</view>
<view class="UserInfo--user-name">
<view class="UserInfo--name sk-transparent sk-text-19-4444-814 sk-text">虚拟员工</view>
<view class="UserInfo--position sk-transparent sk-text-14-2857-785 sk-text">虚拟职位</view>
</view>
<view class="UserInfo--user-phone">
<image webp="true" class="UserInfo--user-icon sk-image"></image>
<view class="sk-transparent sk-text-12-5000-404 sk-text">xxxxxxxx</view>
</view>
<view class="UserInfo--user-address">
<image webp="true" class="UserInfo--user-icon sk-image"></image>
<view class="UserInfo--address sk-transparent sk-text-12-5000-556 sk-text">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
</view>
<image lazy-load="true" class="UserInfo--user-avatar sk-image"></image>
<image webp="true" class="UserInfo--add-wechat sk-image"></image>
</view>
<image webp="true" class="UserInfo--user-bg sk-image"></image>
</view>
<view class="UserInfo--btn-group">
<view class="UserInfo--phone-btn">
<image webp="true" class="UserInfo--icon-dial sk-image"></image>
<view class="UserInfo--phone-text sk-transparent sk-text-14-2857-445 sk-text" style="background-position-x: 50%;">拨打电话</view>
</view>
<button class="UserInfo--btn-plain UserInfo--btn sk-transparent sk-button sk-pseudo sk-pseudo-circle">保存名片</button>
<button class="UserInfo--btn-primary UserInfo--btn sk-transparent sk-button sk-pseudo sk-pseudo-circle" open-type="share">分享名片</button>
</view>
</view>
<view is="components/Authorize/Authorize"></view>
</view>
<view class="main-bottom">
<view class="channel-bg">
<image webp="true" class="channel-img sk-image" data-name="logo" mode="widthFix" style="height: 71.7949px;"></image>
<view class="channel-word">
<view class="channel-title sk-transparent sk-text-17-8571-558 sk-text">面向渠道</view>
<view class="channel-text sk-transparent sk-text-16-6667-529 sk-text">助力数字化转型,实现获客增值</view>
</view>
</view>
<view class="tab-list">
<view class="tab-item" data-index="0" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-87 sk-text" style="background-position-x: 50%;">公司介绍</view>
</view>
<view class="tab-item tab-item-active sk-image" data-index="1" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-646 sk-text" style="background-position-x: 50%;">方案介绍</view>
</view>
<view class="tab-item" data-index="2" data-name="[object Object]">
<image webp="true" class="tab-img sk-image" mode="widthFix" style="height: 36px;"></image>
<view class="tab-text sk-transparent sk-text-14-2857-669 sk-text" style="background-position-x: 50%;">视频直播</view>
</view>
</view>
<view class="menu-list">
<view class="menu-item menu-active sk-transparent sk-text-34-0909-543 sk-text sk-pseudo sk-pseudo-circle" data-index="0">
企微魔方
</view>
<view class="menu-item sk-transparent sk-text-35-2273-137 sk-text" data-index="1">
数字化权益
</view>
<view class="menu-item sk-transparent sk-text-35-2273-433 sk-text" data-index="2">
智能线索
</view>
<view class="menu-item sk-transparent sk-text-35-2273-571 sk-text" data-index="3">
D+增值转化
</view>
</view>
<view class="isFullSucreen">
<view class="p-b-20">
<image webp="true" class="img sk-image" mode="widthFix" style="height: 1318.16px;"></image>
</view>
</view>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
/*
此文件为开发者工具生成,生成时间: 2022/9/17下午3:18:38
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
*/
.sk-transparent {
color: transparent !important;
}
.sk-text-19-4444-814 {
background-image: linear-gradient(transparent 19.4444%, #EEEEEE 0%, #EEEEEE 80.5556%, transparent 0%) !important;
background-size: 100% 72.0000rpx;
position: relative !important;
}
.sk-text {
background-origin: content-box !important;
background-clip: content-box !important;
background-color: transparent !important;
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-785 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-12-5000-404 {
background-image: linear-gradient(transparent 12.5000%, #EEEEEE 0%, #EEEEEE 87.5000%, transparent 0%) !important;
background-size: 100% 32.0000rpx;
position: relative !important;
}
.sk-text-12-5000-556 {
background-image: linear-gradient(transparent 12.5000%, #EEEEEE 0%, #EEEEEE 87.5000%, transparent 0%) !important;
background-size: 100% 32.0000rpx;
position: relative !important;
}
.sk-text-14-2857-445 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 28.0000rpx;
position: relative !important;
}
.sk-text-17-8571-558 {
background-image: linear-gradient(transparent 17.8571%, #EEEEEE 0%, #EEEEEE 82.1429%, transparent 0%) !important;
background-size: 100% 56.0000rpx;
position: relative !important;
}
.sk-text-16-6667-529 {
background-image: linear-gradient(transparent 16.6667%, #EEEEEE 0%, #EEEEEE 83.3333%, transparent 0%) !important;
background-size: 100% 36.0000rpx;
position: relative !important;
}
.sk-text-14-2857-87 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-14-2857-646 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-14-2857-669 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text-34-0909-543 {
background-image: linear-gradient(transparent 34.0909%, #EEEEEE 0%, #EEEEEE 65.9091%, transparent 0%) !important;
background-size: 100% 88.0000rpx;
position: relative !important;
}
.sk-text-35-2273-137 {
background-image: linear-gradient(transparent 35.2273%, #EEEEEE 0%, #EEEEEE 64.7727%, transparent 0%) !important;
background-size: 100% 88.0000rpx;
position: relative !important;
}
.sk-text-35-2273-433 {
background-image: linear-gradient(transparent 35.2273%, #EEEEEE 0%, #EEEEEE 64.7727%, transparent 0%) !important;
background-size: 100% 88.0000rpx;
position: relative !important;
}
.sk-text-35-2273-571 {
background-image: linear-gradient(transparent 35.2273%, #EEEEEE 0%, #EEEEEE 64.7727%, transparent 0%) !important;
background-size: 100% 88.0000rpx;
position: relative !important;
}
.sk-button {
color: #EFEFEF !important;
background: #EFEFEF !important;
border: none !important;
box-shadow: none !important;
}
.sk-image {
background: #EFEFEF !important;
}
.sk-pseudo::before, .sk-pseudo::after {
background: #EFEFEF !important;
background-image: none !important;
color: transparent !important;
border-color: transparent !important;
}
.sk-pseudo-rect::before, .sk-pseudo-rect::after {
border-radius: 0 !important;
}
.sk-pseudo-circle::before, .sk-pseudo-circle::after {
border-radius: 50% !important;
}
.sk-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: transparent;
}
<!--pages/tab/index/index.wxml-->
<user-info></user-info>
<view class="tab-list">
<view class="tab-item" data-name="公司介绍" bindtap="introduce">
公司介绍
</view>
<view class="tab-item" data-name="产品介绍" bindtap="introduce">
产品介绍
</view>
<view class="tab-item" data-name="视频直播" bindtap="introduce">
视频直播
</view>
<view class="tab-item" data-name="城市合伙人" bindtap="introduce">
城市合伙人
</view>
</view>
<view>{{introduceName}}</view>
<view hidden="{{introduceName != '产品介绍'}}">
产品介绍
<view class="tab-list">
<view class="tab-item">
企微魔方
</view>
<view class="tab-item">
数字化权益
</view>
<view class="tab-item">
智能线索
</view>
<view class="tab-item">
D+增值转化
</view>
</view>
</view>
<import src="../../template/demo/demo.wxml" />
<template is="demo"></template>
<button bindtap="jump">免费申请体验账号</button>
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/index/index.wxml -->
<import src="../../template/channel/channel.wxml" />
<import src="../../template/company/company.wxml" />
<import src="../../template/menu/menu.wxml" />
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="true" />
<view class="main-box" wx:if="{{cardInfo}}" >
<user-info data-skeleton-hide="cardInfo" cardInfo="{{cardInfo}}"></user-info>
<view class="main-bottom">
<!-- 面向渠道 -->
<template is="channel"></template>
<!-- tab介绍 -->
<view class="tab-list">
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{curTabIndex === index ? 'tab-item-active' : '' }} {{index === 3 ? 'tab-apply' : ''}}" data-name="{{item}}" data-index="{{index}}" bindtap="introduce">
<image wx:if="{{curTabIndex !== index}}" class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon1}}.png"></image>
<image wx:else class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon}}.png"></image>
<view class="tab-text">{{item.name}}</view>
<!-- 合作申请hot -->
<image wx:if="{{index === 3}}" class="icon-hot" webp src="{{IMGURL}}home/icon-hot.png"></image>
</view>
</block>
</view>
<!-- 公司介绍 -->
<block wx:if="{{curTabIndex === 0 }}">
<template is="company" data="{{IMGURL, banner, current, img_version, awardBanner, awardCurrent}}"></template>
</block>
<!-- 方案介绍 -->
<block wx:if="{{curTabIndex === 1 }}">
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType, hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList}}"></template>
<!-- <block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL}}"></template>
</block>
<block wx:elif="{{curIntroduceIndex === 1}}">
<template is="equity"></template>
</block>
<block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue"></template>
</block> -->
</block>
</view>
<view wx:if="{{!hasUserInfo}}" class="user-profile" bindtap="getUserProfile"></view>
<!-- 服务咨询 -->
<view bindtap="goConsult">
<image class="icon-consult" src="{{IMGURL}}home/custom.png"></image>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/index.wxss */ /* pages/tab/index/index.wxss */
@import '../../template/demo/demo.wxss'; @import '../../template/channel/channel.wxss';
@import '../../template/menu/menu.wxss';
@import '../../template/company/company.wxss';
@import '../../template/cube/cube.wxss';
@import '../../template/equity/equity.wxss';
@import '../../template/clue/clue.wxss';
@import "./index.skeleton.wxss";
page {
background-color: #F5F5F7;
}
.p-b-20 {
padding-bottom: 20rpx;
}
.image-wrapper {
text-align: center;
background-color: #505CFF;
padding: 48rpx 20rpx;
margin-top: 32rpx;
}
.relative {
position: relative;
}
.absolute {
position: absolute;
width: 100%;
}
.img {
width: 100%;
}
.tab-list { .tab-list {
display: flex; display: flex;
justify-content: space-evenly justify-content: space-evenly;
} }
.tab-item { .tab-item {
background-color: bisque; width: 220rpx;
height: 144rpx;
background: #F5F6FA;
border-radius: 8rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 24rpx;
color: #6E6D8F;
text-align: center;
margin-top: 24rpx;
position: relative;
}
.bg-img {
width: 220rpx;
height: 144rpx;
position: absolute;
top: 0;
left: 0;
}
.tab-item-active {
color: #FFFFFF;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/icon-bg.png");
background-size: 220rpx 144rpx;
}
.tab-apply {
background: #F0F0FF;
font-weight: 600;
color: #5850FF;
}
.icon-hot {
width: 56rpx;
height: 24rpx;
position: absolute;
top: 0;
right: 0;
}
.tab-img {
width: 72rpx;
height: 72rpx;
position: absolute;
top: 16rpx;
left: 50%;
transform: translateX(-50%);
}
.tab-text {
position: absolute;
top: 88rpx;
left: 50%;
transform: translateX(-50%);
}
.application {
position: fixed;
bottom: 0;
width: 100%;
}
.icon-consult {
width: 128rpx;
height: 128rpx;
position: fixed;
right: 6rpx;
bottom: 90rpx;
}
.main-box {
box-sizing: border-box;
height: 100%;
position: absolute;
width: 100%;
display: flex;
flex-direction: column;
}
.main-bottom {
background: #FFFFFF;
padding-top: 24rpx;
flex: 1;
}
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: transparent;
}
/* 手机号授权 */
.phone-number {
display: flex;
align-items: center;
justify-content: center;
margin: 16rpx 48rpx;
color: #fff;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
/* 了解更多 */
.more-box {
position: relative;
}
.more-btn {
position: absolute;
width: 100%;
bottom: 32rpx;
} }
\ No newline at end of file \ No newline at end of file
// pages/tab/introduction/introduction.js
import {menuMixin} from '../../../mixins/index'
Page({
behaviors: [menuMixin],
/**
* 页面的初始数据
*/
data: {
// 0-员工,1-代理商
customerType: 1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/introduction/introduction.wxml-->
<import src="../../template/menu/menu" />
<import src="../../template/cube/cube" />
<import src="../../template/equity/equity" />
<block>
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType}}"></template>
</block>
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube"></template>
</block>
<block wx:elif="{{curIntroduceIndex === 1}}">
<template is="equity"></template>
</block>
<button open-type="share">分享</button>
<view class="btn-bottm">
<view class="share-btn" bindtap="share">
<image class="icon-share" webp src="{{IMGURL}}home/icon-share.png"></image>
<view class="share-text">分享此页面</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/tab/introduction/introduction.wxss */
@import '../../template/menu/menu.wxss';
page {
background-color: #f5f5f6;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
.share-btn {
display: flex;
justify-content: center;
text-align: center;
padding: 16rpx 0;
width: 100%;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-share {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
\ No newline at end of file \ No newline at end of file
<template name="channel">
<view class="channel-bg">
<image class="channel-img" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/banner-bg.png" data-name="logo"></image>
<view class="channel-word">
<view class="channel-title">面向渠道</view>
<view class="channel-text">助力数字化转型,实现获客增值</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.channel-bg {
width: 700rpx;
height: 144rpx;
margin: 0 auto;
position: relative;
}
.channel-img {
width: 100%;
}
.channel-word {
position: absolute;
top: 24rpx;
left: 38rpx;
}
.channel-title {
font-family: AlibabaPuHuiTiM;
font-weight: 600;
font-size: 36rpx;
color: #2D2D33;
line-height: 56rpx;
}
.channel-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
line-height: 36rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- 智能线索 -->
<template name="clue">
<view class="p-b-20">
<view class="relative">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-img1.png?v={{img_version}}"></image>
<view class="clue-video">
<video poster="{{IMGURL}}image/clue/clue-img14.png?v={{img_version}}" src="{{IMGURL}}image/clue/clue.mp4?v={{img_version}}"></video>
</view>
</view>
<view wx:if="{{hasPhoneNumber}}">
<view class="relative m-t-64">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-bg.webp?v={{img_version}}"></image>
<view class="clue">
<!-- <image mode="widthFix" class="img" lazy-load src="{{IMGURL}}image/clue/clue-img2.webp?v={{img_version}}"></image> -->
<swiper class="clue-swiper" autoplay bindchange="clueChange" current="{{clueCurrent}}" interval="5000" circular>
<block wx:for="{{clueList}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="clue-img" lazy-load webp src="{{IMGURL}}image/clue/{{item}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{clueList}}" wx:for-index="index" wx:key="index">
<view class="{{clueCurrent == index ? 'active' : ''}}"></view>
</block>
</view>
</view>
</view>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/clue/clue-img16.webp?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.clue {
position: absolute;
top: 348rpx;
left: 50%;
transform: translateX(-50%);
}
.clue-swiper {
height: 984rpx;
width: 630rpx;
text-align: center;
}
.dots {
position: absolute;
bottom: -64rpx;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.dots view {
width: 20rpx;
height: 8rpx;
/* margin: 0 6rpx; */
background-color: #E6E7EB;
}
.dots .active {
background-color: #5850FF;
}
.clue-img {
width: 630rpx;
height: 984rpx;
}
.clue-video {
position: absolute;
width: 616rpx;
height: 344rpx;
bottom: 68rpx;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.clue-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- 公司介绍 -->
<template name="company">
<view>
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/company-img1.png?v={{img_version}}"></image>
<!-- 合同客户 -->
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image>
<view class="box2">
<swiper class="swiper" autoplay duration="5000" interval="5000" circular>
<swiper-item class="swiper-item">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img2.png?v={{img_version}}"></image>
</swiper-item>
<swiper-item class="swiper-item">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img21.png?v={{img_version}}"></image>
</swiper-item>
</swiper>
</view>
</view>
<!-- 政府与行业资质 -->
<view class="relative">
<image mode="widthFix" class="img" src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image>
<view class="box3">
<swiper class="box3-swiper" autoplay bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{banner}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="box3-img" webp src="{{IMGURL}}image/company/{{item}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="company-dots">
<block wx:for="{{banner}}" wx:for-index="index" wx:key="index">
<view class="{{current == index ? 'company-active' : ''}}"></view>
</block>
</view>
</view>
</view>
<!-- 荣誉及奖项 -->
<view class="relative box5">
<image class="box5-title" webp src="{{IMGURL}}image/company/company-img6.png?v={{img_version}}"></image>
<swiper class="box5-swiper" autoplay bindchange="changeBanner" current="{{awardCurrent}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{awardBanner}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="box5-content" webp src="{{IMGURL}}image/company/{{item.src}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="banner-dots">
<block wx:for="{{awardBanner}}" wx:for-index="index" wx:key="index">
<view bindtap="tapBanner" data-current="{{index}}" class="{{awardCurrent == index ? 'banner-active' : ''}}">{{item.name}}</view>
</block>
</view>
</view>
<!-- <image mode="widthFix" class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image> -->
<image mode="widthFix" class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.box2 {
position: absolute;
width: 716rpx;
top: 240rpx;
left: 50%;
transform: translateX(-50%);
}
.box2-content {
width: 716rpx;
height: 344rpx;
}
.box3 {
position: absolute;
top: 240rpx;
left: 50%;
transform: translateX(-50%);
}
.box3-img, .box3-swiper {
width: 704rpx;
height: 432rpx;
}
.box4 {
width: 100%;
height: 956rpx;
background-color: #fff;
}
.box4-title {
position: absolute;
width: 278rpx;
height: 112rpx;
top: 96rpx;
left: 50%;
transform: translateX(-50%);
}
.box4-content {
position: absolute;
width: 496rpx;
height: 460rpx;
top: 384rpx;
left: 50%;
transform: translateX(-50%);
}
.swiper {
height: 432rpx;
}
.company-dots {
position: absolute;
bottom: -64rpx;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.company-dots view {
width: 96rpx;
height: 8rpx;
background-color: #E6E7EB;
}
.company-dots .company-active {
background-color: #5850FF;
}
.box5 {
width: 100%;
height: 1016rpx;
background-color: #fff;
}
.box5-title {
width: 278rpx;
height: 112rpx;
position: absolute;
top: 96rpx;
left: 50%;
transform: translateX(-50%);
}
.box5-swiper {
position: absolute;
top: 384rpx;
left: 50%;
transform: translateX(-50%);
width: 496rpx;
height: 460rpx;
}
.box5-content {
width: 496rpx;
height: 460rpx;
}
.banner-dots {
position: absolute;
top: 256rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
align-items: center;
width: 656rpx;
font-size: 28rpx;
color: #6E6E7A;
font-weight: 400;
border-radius: 32rpx;
background-color: #F5F6FA;
}
.banner-dots view {
display: flex;
align-items: center;
justify-content: center;
width: 328rpx;
height: 64rpx;
}
.banner-dots .banner-active {
background-color: #fff;
box-shadow: 0 2rpx 12rpx 0 rgba(165,163,204,0.40);
border-radius: 32rpx;
color: #2D2D33;
font-weight: 500;
}
\ No newline at end of file \ No newline at end of file
<!-- 企微魔方 -->
<template name="cube">
<view class="p-b-20">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/cube/cube-img3.png?v={{img_version}}"></image>
<view wx:if="{{hasPhoneNumber}}">
<image mode="widthFix" lazy-load class="img m-t-64" src="{{IMGURL}}image/cube/cube-img1.png?v={{img_version}}"></image>
<view class="relative">
<image mode="widthFix" lazy-load class="img m-t-64" src="{{IMGURL}}image/cube/cube-img2.png?v={{img_version}}"></image>
<view class="box-video cube-video1">
<video poster="{{IMGURL}}image/cube/arrival-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/arrival.mp4?v={{img_version}}"></video>
</view>
<view class="box-video cube-video2">
<video poster="{{IMGURL}}image/cube/checkout-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/checkout.mp4?v={{img_version}}"></video>
</view>
<view class="box-video cube-video3">
<video poster="{{IMGURL}}image/cube/rescue-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/rescue.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/cube/cube-img4.png?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.m-t-64 {
margin-top: 24rpx;
}
.m-t-16 {
margin-top: 16rpx;
}
.box-video {
position: absolute;
width: 566rpx;
height: 316rpx;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.cube-video1 {
top: 654rpx;
}
.box-video video {
border-radius: 18rpx;
width: 566rpx;
height: 316rpx;
}
.cube-video2 {
bottom: 974rpx;
}
.cube-video3 {
bottom: 110rpx;
}
\ No newline at end of file \ No newline at end of file
<template name="demo">
<view class="bg">这是一个demo模板</view>
</template>
\ No newline at end of file \ No newline at end of file
.bg {
background-color: blueviolet;
}
\ No newline at end of file \ No newline at end of file
<!-- 数字化权益 -->
<template name="equity">
<view class="p-b-20">
<view class="relative">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/equity/equity-img1.webp?v={{img_version}}"></image>
<view class="box-video equity-video">
<video poster="{{IMGURL}}image/equity/equity-img7.webp?v={{img_version}}" src="{{IMGURL}}image/equity/equity.mp4?v={{img_version}}"></video>
</view>
</view>
<view wx:if="{{hasPhoneNumber}}">
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img2.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img3.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img4.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img5.webp?v={{img_version}}"></image>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/equity/equity-img6.webp?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.equity-video {
top: 1046rpx;
}
\ 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">
<view class="menu-list">
<block wx:for="{{menuList}}" wx:key="index">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}} {{customerType === 1 && index === curIntroduceIndex ? 'menu-active-agency' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
{{item}}
</view>
</block>
</view>
<view class="isFullSucreen image-wrapper">
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL, hasPhoneNumber, img_version}}"></template>
</block>
<block wx:if="{{curIntroduceIndex === 1}}">
<template is="equity" data="{{hasPhoneNumber, IMGURL, img_version}}"></template>
</block>
<block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue" data="{{hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList}}"></template>
</block>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.menu-list {
display: flex;
justify-content: space-evenly;
background-color: #fff;
margin-top: 16rpx;
}
.menu-item {
position: relative;
font-size: 26rpx;
color: #6E6E7A;
height: 88rpx;
line-height: 88rpx;
}
.menu-active {
color: #5850ff;
font-weight: 500;
font-size: 28rpx;
}
.menu-active-agency {
font-weight: 600;
font-size: 32rpx;
color: #2D2D33;
}
.menu-active::after {
content: '';
display: inline-block;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 6rpx;
background-color: #5850ff;
border-radius: 0.8rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"enhance": true, "enhance": true,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": false, "minified": true,
"newFeature": false, "newFeature": false,
"coverView": true, "coverView": true,
"nodeModules": false, "nodeModules": false,
...@@ -22,31 +22,28 @@ ...@@ -22,31 +22,28 @@
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
"useApiHostProcess": true,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"bundle": false, "useIsolateContext": false,
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"useApiHostProcess": false,
"lazyloadPlaceholderEnable": false,
"useStaticServer": true,
"showES6CompileOption": false,
"disableUseStrict": false, "disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"minifyWXML": true "ignoreUploadUnusedFiles": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.15.0", "libVersion": "2.25.4",
"appid": "wx5d1208f9c8712943", "appid": "wx5d1208f9c8712943",
"projectname": "%E5%B9%BF%E8%81%94%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E7%89%88", "projectname": "%E5%B9%BF%E8%81%94%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E7%89%88",
"simulatorType": "wechat", "simulatorType": "wechat",
......
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "ai-card", "condition": {
"setting": { "miniprogram": {
"compileHotReLoad": true "list": [
{
"name": "分享组件",
"pathName": "tabComponents/pages/share/share",
"query": "",
"scene": null
},
{
"name": "授权组件",
"pathName": "tabComponents/pages/authorize/authorize",
"query": "",
"scene": null
},
{
"name": "时间范围选择器",
"pathName": "tabComponents/pages/time-horizon/time-horizon",
"query": "",
"scene": null
},
{
"name": "cell",
"pathName": "tabComponents/pages/gl-cell/gl-cell",
"query": "",
"scene": null
},
{
"name": "日历",
"pathName": "tabComponents/pages/calendar/calendar",
"query": "",
"scene": null
},
{
"name": "",
"pathName": "pages/addTransform/addTransform/addTransform",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3100",
"launchMode": "default",
"scene": null
}
]
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
* } * }
*/ */
import api from '../api/request' import api from '../api/request'
import {trackData} from '../utils/data'
let TRACK_TIME = null, let TRACK_TIME = null,
ADDRESS_INFO = null ADDRESS_INFO = null
const track_interval_time = 60 * 1e3 const track_interval_time = 60 * 1e3
class TRACK { class TRACK {
constructor() { constructor() {
console.log('---------------- 埋点初始化 ----------------')
this.initPageProxy() this.initPageProxy()
this.sendTrack() // this.sendTrack()
// this.getAddressInfo().then(res => ADDRESS_INFO = res) // this.getAddressInfo().then(res => ADDRESS_INFO = res)
this.appHide() this.appHide()
} }
...@@ -85,7 +85,6 @@ class TRACK { ...@@ -85,7 +85,6 @@ class TRACK {
// this.sendTrack() // this.sendTrack()
wx.offAppShow() wx.offAppShow()
this.appHide() this.appHide()
console.log('---------------- 重新打开埋点 ----------------')
}) })
} }
appHide() { appHide() {
...@@ -93,7 +92,6 @@ class TRACK { ...@@ -93,7 +92,6 @@ class TRACK {
if (TRACK_TIME) clearInterval(TRACK_TIME) if (TRACK_TIME) clearInterval(TRACK_TIME)
wx.offAppHide() wx.offAppHide()
this.appShow() this.appShow()
console.log('---------------- APP隐藏 埋点停止推送 ----------------')
}) })
} }
/**设置埋点数据 */ /**设置埋点数据 */
...@@ -122,24 +120,40 @@ class TRACK { ...@@ -122,24 +120,40 @@ class TRACK {
return guest_no return guest_no
} }
/**定时发送埋点数据 */ /**定时发送埋点数据 */
sendTrack() { sendTrack(p, openId) {
TRACK_TIME = setInterval(() => { let params = {
let prepare_data = wx.getStorageSync('prepare_data') method: 'entmicro.api.business.card.cardRecord',
let data = { cardId: wx.$trackData.cardId,
method: 'entmicro.api.customercollect.reportCustomerList', merchant: wx.$trackData.merchant,
jsonList: prepare_data type: wx.$trackData.type
}
let userInfo = { }
if (wx.$util.getUserInfo()) {
const {nickName,openId, unionId, phone} = wx.$util.getUserInfo() || {}
userInfo = {
nickName,
openId,
unionId,
phone,
} }
if (prepare_data && prepare_data.length) api.reportTrack(data).then(({ } else {
code, if (openId) {
data, userInfo.openId = openId
message } else {
}) => { userInfo.openId = wx.$util.getStorageSync('openId')
if (code == 0 && data) { }
wx.setStorageSync('prepare_data', []) }
console.log('---------------- 埋点定时推送成功 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', prepare_data)
} else console.log('---------------- 埋点定时推送失败 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', message) params = Object.assign(params, userInfo, p)
}) console.log(params)
}, track_interval_time) api.reportTrack(params).then(({
code,
data,
message
}) => {
console.log('埋点设置成功')
})
} }
/**获取页面对象实例 */ /**获取页面对象实例 */
getPageInstance = (size = 1) => { getPageInstance = (size = 1) => {
...@@ -171,7 +185,7 @@ class TRACK { ...@@ -171,7 +185,7 @@ class TRACK {
model, model,
system, system,
version version
} = JSON.parse(wx.getStorageSync('srcm_shopmall_system_info')) } = JSON.parse(wx.getStorageSync('aicard_system_info'))
return { return {
SDK_version: SDKVersion, SDK_version: SDKVersion,
brand, brand,
...@@ -190,30 +204,29 @@ class TRACK { ...@@ -190,30 +204,29 @@ class TRACK {
} }
} }
/**获取用户位置信息 */ /**获取用户位置信息 */
getAddressInfo() { // getAddressInfo() {
let addressInfo = wx.getStorageSync('address_info') // let addressInfo = wx.getStorageSync('address_info')
return new Promise((resolve) => { // return new Promise((resolve) => {
if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo) // if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo)
else wx.getLocation({ // else wx.getLocation({
type: 'gcj02' // type: 'gcj02'
}).then(({ // }).then(({
latitude, // latitude,
longitude // longitude
}) => { // }) => {
if (!addressInfo) this.setTrack({}, 5) // if (!addressInfo) this.setTrack({}, 5)
console.log('---------------- 更新地理位置 ----------------') // return
return // mapApi.detailedAdrress([latitude, longitude]).then(detail => {
mapApi.detailedAdrress([latitude, longitude]).then(detail => { // let info = {
let info = { // ...detail,
...detail, // createTime: Date.now()
createTime: Date.now() // }
} // resolve(info)
resolve(info) // wx.setStorageSync('address_info', info)
wx.setStorageSync('address_info', info) // })
}) // })
}) // })
}) // }
}
/**获取游客ID */ /**获取游客ID */
setGuestNo(length = 30) { setGuestNo(length = 30) {
let name = '', let name = '',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!