Commit 3499f242 by 前端

Merge branch 'v2.10.5' into 'master'

V2.10.5

See merge request !6
2 parents 327d2a67 19b2f366
Showing 95 changed files with 8029 additions and 361 deletions
......@@ -46,7 +46,7 @@ module.exports = {
}, true)
},
/**获取图片版本号 */
getImgVersion() {
getMockConfig() {
return api.getMock()
},
}
......
import api from "./request";
const serverApi = {
//生成二维码
createQrCode: "scrm.api.wechat.miniprogram.createQrcode",
// 解析二维码参数
sceneById:'scrm.api.wechat.get.scene.by.id'
};
export const createQrCodeApi = (data) => {
return api.post(
{
method: serverApi.createQrCode,
...data,
},
true
);
};
export const sceneByIdApi = (data) => {
return api.post(
{
method: serverApi.sceneById,
...data,
}
);
};
\ No newline at end of file
......@@ -11,4 +11,11 @@ module.exports = {
true
);
},
// 智能名片活动申请
activityApply(data) {
return api.post({
method: `entmicro.api.business.card.activity.apply`,
...data,
},true)
}
}
\ No newline at end of file
......@@ -4,9 +4,10 @@ const target = ["ip", "dev", "uat", "beta", "prod"];
0本地
1开发
2测试
3生产
3预发布
4生产
*/
const index = 3;
const index = 4;
const secretKey = {
ip: {},
dev: {
......
//app.js
import * as Sentry from './utils/lib/sentry-miniapp'
const accountInfo = wx.getAccountInfoSync()
//测试和生产才开发sentry
const env = ['trial', 'release']
env.includes(accountInfo.miniProgram.envVersion) &&
Sentry.init({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn: 'https://e440585f391e46278c3c72ddabb1d17f@sentry.glsx.com.cn/31'
})
import router from './router/index.js'
import util from './utils/util.js'
import './utils/Track'
import {
ssoApi,
wechatApi
} from './api/api'
import {trackData} from './utils/data'
import { ssoApi, wechatApi } from './api/api'
import { trackData } from './utils/data'
import eventbus from './utils/evenbus'
// 实例化对象存储
import { Storage } from './utils/cache/storage'
const $Storage = new Storage()
App({
onLaunch: function (options) {
console.log(options)
/**挂载到wx对象 */
this.autoUpdate()
wx.$storage = $Storage /** 挂载全局缓存方法 */
wx.$eventbus = eventbus
wx.$util = util
wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId
const systemInfo = wx.getStorageSync('aicard_system_info')
if (!systemInfo) wx.getSystemInfo({
success(res) {
util.setStorageSync('aicard_system_info', res)
}
})
if (!systemInfo)
wx.getSystemInfo({
success(res) {
util.setStorageSync('aicard_system_info', res)
}
})
if (options.path != 'pages/tab/index/index') {
this.login()
}
// wx.showMeasure = false
wx.showMeasure = !!options.query.scene
},
login(returnResponse) {
let _this = this
let openId = null
let wechatInfo = null
return new Promise((resolve, reject) => {
wx.login({
success({
code
}) {
ssoApi.jsCodeLogin({
code,
appId: wx.$appId
}).then(res => {
wx.$authStatus = res.code != 0
util.setSessionId(res.data.sessionId)
openId = res.data.openId
util.setStorageSync('openId', openId)
console.log(wx.$trackData)
if (wx.$trackData.scene) {
// 初次进入小程序默认埋首页
_this.getScene(wx.$trackData.scene).then(res => {
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
console.log('wx.$trackData.cardId', wx.$trackData.cardId)
util.setStorageSync('scene', res)
success({ code }) {
ssoApi
.jsCodeLogin({
code,
appId: wx.$appId
})
.then(res => {
wechatInfo = res.data
util.setStorageSync('aicard_info', wechatInfo)
wx.$authStatus = res.code != 0
util.setSessionId(wechatInfo.sessionId)
openId = wechatInfo.openId
// util.setStorageSync('openId', openId)
console.log(wx.$trackData)
wx.showMeasure = !!wx.$trackData.scene
if (wx.$trackData.scene) {
// 初次进入小程序默认埋首页
_this.getScene(wx.$trackData.scene).then(res => {
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
console.log('wx.$trackData.cardId', wx.$trackData.cardId)
util.setStorageSync('scene', res)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
})
} else if (wx.$trackData.detailShare) {
// d+产品分享在这里设置埋点
const detailShare = wx.$trackData.detailShare
console.log(1211)
for (let i in trackData) {
console.log(i)
if (trackData[i].pageName == detailShare) {
console.log(trackData[i])
wx.$Track.sendTrack(trackData[i], wechatInfo)
break
}
}
} else if (wx.$trackData.isShare) {
util.setStorageSync('scene', wx.$trackData)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId)
})
} else if(wx.$trackData.detailShare) {
// d+产品分享在这里设置埋点
const detailShare = wx.$trackData.detailShare
console.log(1211)
for(let i in trackData) {
console.log(i)
if (trackData[i].pageName == detailShare) {
console.log(trackData[i])
wx.$Track.sendTrack(trackData[i], openId)
break
}
}
} else if (!wx.$trackData.detailShare && wx.$trackData.cardId) {
// 名片分享在这里设置埋点
util.setStorageSync('scene', wx.$trackData)
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 {
util.showToast(result.message || '网络异常')
}
resolve(result)
} else if (!wx.$trackData.detailShare && wx.$trackData.cardId) {
// 名片分享在这里设置埋点
util.setStorageSync('scene', wx.$trackData)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
}
ssoApi
.getUserInfo({
openId
})
.then(result => {
if (returnResponse) {
resolve(result)
} else {
if (result.code == 0) {
util.setUserInfo(result.data)
} else {
util.showToast(result.message || '网络异常')
}
resolve(result)
}
})
})
.catch(() => {
wx.$authStatus = true
reject()
})
}).catch(() => {
wx.$authStatus = true
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
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)
})
resolve(op)
})
})
},
/**
/**
* 下载小程序新版本并重启应用
*/
autoUpdate: function () {
......@@ -173,6 +201,5 @@ App({
})
}
},
globalData: {
}
})
\ No newline at end of file
globalData: {}
})
......@@ -17,17 +17,29 @@
"pages/productDetail/navigationArround/navigationArround",
"pages/productDetail/paintProtect/paintProtect",
"pages/productDetail/seatVentilate/seatVentilate",
"pages/productDetail/solarFilm/solarFilm"
"pages/productDetail/solarFilm/solarFilm",
"pages/activityApplication/activityApplication",
"pages/newEnergy/newEnergy",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult",
"pages/scene/scene",
"pages/checkProduct/checkProduct"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "广联数科智能名片",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"initialRenderingCache": "static"
},
"usingComponents": {
"authorize": "components/Authorize/Authorize",
"phone-number": "components/PhoneNumber/PhoneNumber"
"phone-number": "components/PhoneNumber/PhoneNumber",
"tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
......
.box-center{
position: absolute;
top: 50%;
......
// components/CooperationApply/CooperationApply.js
import WxValidate from "../../utils/WxValidate";
import util from "../../utils/util"
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
tabData: [
{
name: "门店合作申请",
value: 0,
},
{
name: "代理商合作申请",
value: 1,
},
],
tabIndex: 0,
applyForm: {
merchantName: "",
carModel: "",
contactName: "",
contactPhone: "",
},
},
/**
* 组件的方法列表
*/
methods: {
selectTab(e) {
console.log(e.currentTarget.dataset.index);
this.setData({
tabIndex: e.currentTarget.dataset.index,
});
},
// 表单验证规则
initValidate() {
console.log(123123);
const rules = {
merchantName: {
required: true,
},
contactName: {
required: true,
},
contactPhone: {
required: true,
tel: true,
},
};
const messages = {
merchantName: {
required: "请填写门店名称",
},
contactName: {
required: "请填写联系人",
},
contactPhone: {
required: "请填写手机号",
},
};
this.WxValidate = new WxValidate(rules, messages);
},
//报错
showModal(error) {
wx.showToast({
title: error.msg,
icon: "none",
});
},
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name;
let val = e.detail.value;
const form = `applyForm.${name}`;
this.setData({
[form]: val,
});
},
// 校验表单
validateForm() {
let params = this.data.applyForm;
// 校验表单
if (!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0];
wx.hideLoading();
this.showModal(error);
return false;
} else {
return [params, this.data.tabIndex];
}
},
// 设置手机号
setPhone(phone) {
this.setData({
['applyForm.contactPhone']: phone,
});
},
},
// 组件页面生周期
lifetimes: {
created: function () {
// 在组件实例刚刚被创建时执行
// 初始化验证规则函数
this.initValidate();
},
attached: function() {
if (util.getUserInfo()&& util.getUserInfo().phone) {
this.setPhone(util.getUserInfo().phone)
console.log(this.data.applyForm)
}
}
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- components/CooperationApply/CooperationApply.wxml -->
<view>
<view class="tab-top">
<view wx:for="{{tabData}}" wx:key="index" class="tab-title {{item.value == tabIndex ? 'tab-title-active' : ''}}" bindtap="selectTab" data-index="{{item.value}}">
{{item.name}}
</view>
</view>
<form>
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">门店名称<text class="require">*</text>
</text>
<input name="merchantName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '主营品牌' : '合作品牌'}}</text>
<input name="carModel" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder="{{tabIndex == 0 ? '请输入主营品牌' : '请输入合作品牌'}}"value="{{applyForm.carModel}}" bindinput="handleInput" data-name="carModel" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系人<text class="require">*</text>
</text>
<input name="contactName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">手机号<text class="require">*</text>
</text>
<input name="contactPhone" type='text' maxlength="11" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
</view>
</view>
</form>
</view>
\ No newline at end of file
/* components/CooperationApply/CooperationApply.wxss */
.tab-top {
display: flex;
justify-content: space-around;
height: 110rpx;
}
.tab-title {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32rpx;
color: #323436;
text-align: center;
line-height: 110rpx;
}
.tab-title-active {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 32rpx;
color: #323436;
line-height: 110rpx;
position: relative;
}
.tab-title-active::after {
content: '';
width: 80rpx;
height: 6rpx;
position: absolute;
bottom: 5rpx;
left: 50%;
transform: translateX(-50%);
background: #5850FF;
border-radius: 8rpx 8rpx 0 0;
}
.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;
}
\ No newline at end of file
// components/navigationBar/navigationBar.js
Component({
/**
* 组件的属性列表
*/
properties: {
navStyle: String,
custom: Boolean,
showBack: Boolean,
pageTitle: {
type: String,
value: '',
observer(n) {
if (n) {
this.title = n
this.setPageTitle()
}
}
}
},
title: '',
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
setPageTitle() {
let thisPage = wx.$router.getPageInstance()
if (thisPage) thisPage.navigationBarTitleText = this.title
},
init() {
/**
* 获取自定义导航栏信息
*/
wx.getSystemInfo().then(res => {
let {
fontSizeSetting,
statusBarHeight,
screenWidth
} = res
const {
height,
right,
width,
top
} = wx.getMenuButtonBoundingClientRect(),
currentPages = getCurrentPages(), {
showBack
} = this.data
if (showBack && currentPages.length > 1) this.setData({
SHOWBACK: true
})
let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4
let navigationBarPadding = screenWidth - right
let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width
this.setData({
statusBarHeight,
navigationBarHeight,
navigationBarStyle: `font-size:${fontSizeSetting}px;`,
navigationBarTextWidth: `width:${navigationBarWidth}px;padding:0 ${navigationBarPadding}px;`
})
this.emit({
navigationBarHeight,
statusBarHeight
})
})
},
emit({
navigationBarHeight,
statusBarHeight
}) {
let navHeight = navigationBarHeight + statusBarHeight
const thisPage = wx.$router.getPageInstance()
this.triggerEvent('navbarReady', {
height: navHeight,
statusBarHeight
})
this.setData({
showNavBar: true
})
thisPage.setData({
navHeight,
statusBarHeight
})
},
back() {
wx.$router.back()
}
},
lifetimes: {
attached() {
this.init()
this.setPageTitle()
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="navigation-bar" id="navigation-bar" style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<block wx:if="{{SHOWBACK}}">
<view class="back " bindtap="back">
<image class="img" src="./images/icon-back.png" />
</view>
</block>
<view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}">
<slot/>
</view>
</view>
</block>
<block wx:else>
<slot/>
</block>
</view>
/* components/navigationBar/navigationBar.wxss */
.navigation-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99;
background-color: #fff;
transition: all .15s;
}
.navigation-bar-box {
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.navigation-bar-titleText {
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
box-sizing: border-box;
text-align: center;
letter-spacing: 1rpx;
}
.back-box {
width: 76rpx;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.back {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 100rpx;
/* height: 34rpx; */
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.back .img {
width: 16rpx;
height: 34rpx;
}
\ No newline at end of file
......@@ -6,7 +6,24 @@ Component({
/**
* 组件的属性列表
*/
properties: {},
properties: {
isHidden: {
type: Boolean,
value: false
},
phoneText: {
type: String,
value: '了解更多案例'
},
isImage: {
type: Boolean,
value: false
},
showIcon: {
type: Boolean,
value: true
}
},
observers: {},
/**
* 组件的初始数据
......@@ -24,17 +41,18 @@ Component({
// e.detail.errMsg == "getPhoneNumber:fail user deny"
detail.errMsg.indexOf('user deny') !== -1
) {
wx.hideLoading()
return;
} else {
// wx.$util.showLoading('正在授权...')
}
// this.triggerEvent("updatePhoneNumber", '18873336682');
wx.$util.showLoading('正在授权...')
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) {
......
<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
<block wx:if="{{isImage}}">
<button class="imageBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
</button>
</block>
<block wx:else>
<button class="{{isHidden ? 'hidden-phone':'phone-number'}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image wx:if="{{showIcon}}" class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
{{phoneText}}
<image wx:if="{{showIcon}}" class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
</button>
</block>
\ No newline at end of file
......@@ -20,4 +20,24 @@
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
.hidden-phone {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: transparent;
color: transparent;
}
.imageBtn {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: transparent;
}
\ No newline at end of file
// components/Tab/Tab.js
// behaviors: [LocationBehavior],
// import { imgUrlMixin } from '~/mixins/index'
Component({
// behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
outClassName:String,
tab: Array,
openScroll: Boolean,
tabHeight: {
type: Boolean,
value: false
},
productHeight: {
type: Boolean,
value: false
},
index: {
type: Number,
observer: function (n) {
this.setData({
count: n,
to: `to-${n}`
})
}
},
itemWidth: String,
align: {
type: String,
value: ''
},
// 是否有红点
unreadClueCount: {
type: Number,
value: 0
},
},
/**
* 组件的初始数据
*/
data: {
count: 0,
to: '',
// IMGURL:
},
// lifetimes:{
// attached: function() {
// console.log('unreadClueCount',this.data.unreadClueCount)
// }
// },
/**
* 组件的方法列表
*/
methods: {
click(e) {
let { count } = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`,
unreadClueCount:0
})
this.triggerEvent('click', count)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs src="./Tab.wxs" module="filterUtils" />
<block wx:if="{{openScroll}}">
<scroll-view
class="tab-box {{align}} {{outClassName}}"
style="{{productHeight ? 'height: 72rpx;' : ''}}"
scroll-x
enable-flex
scroll-with-animation
scroll-into-view="{{to}}"
enhanced="{{true}}"
show-scrollbar="{{false}}">
<block wx:for="{{tab}}" wx:key="index">
<view
class="tab {{index==count?'active':''}}"
bindtap="click"
data-count="{{index}}"
id="to-{{index}}"
>
<view class="text" style="{{productHeight ? 'height: 60rpx;' : ''}}">{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line" style="{{productHeight ? 'height: 4rpx;' : ''}}" />
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="tab-box flex" style="{{tabHeight ? 'height: 60rpx;' : ''}}">
<block wx:for="{{tab}}" wx:key="index">
<view
class="tab {{index==count?'active':''}}"
style="width:{{itemWidth}}; {{index == 0 ? 'margin-left: 32rpx;' : ''}}"
bindtap="click"
data-count="{{index}}"
>
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">
{{item}}
</view>
<view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<!-- -->
<view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" />
</view>
</block>
</view>
</block>
var hasRedpoint = function (unreadClueCount) {
// console.log('unreadClueCount: ', unreadClueCount);
if(unreadClueCount>0){
return true
}else{
return false;
}
};
module.exports = {
hasRedpoint: hasRedpoint,
};
/* components/Tab/Tab.wxss */
.tab-box {
display: flex;
/* display: grid; */
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left {
padding-left: 32rpx;
}
.left .tab {
padding-right: 40rpx;
}
/* .flex .tab {
flex: 1;
} */
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
color: #A9A9A9;
justify-content: center;
}
.left .text {
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab.active .text {
/* font-weight: 500; */
font-weight: 600;
font-size: 44rpx;
transition: all .25s;
color: #2C2C2C;
font-family: PingFangSC-S0pxibold;
}
.tab .line {
width: 48rpx;
height: var(--borderRadius);
background: var(--btnColor);
border-radius: 2rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.active .redpoint{
display: none;
}
.redpoint {
position: absolute;
top: 10px;
right: 5px;
/* top: 8px;
right: 10px; */
width: 10px;
height: 10px;
background: #EB4E4E;
border-radius: 50%;
}
/* 外部出进来的自定义样式 */
.project-tab{
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line{
width:auto;
}
import componentsMixin from './componentsMixin'
import menuMixin from './menuMixin'
import shareTrackMixin from './shareTrackMixin'
module.exports = {
componentsMixin,
menuMixin
menuMixin,
shareTrackMixin
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ module.exports = Behavior({
const curIntroduceIndex = e.currentTarget.dataset.index;
switch(curIntroduceIndex) {
case 3:
wx.$router.go('addValue');
wx.$router.go('scene');
// wx.$router.go('addTransform', {notIntercept: true});
// wx.showToast({
// title: '敬请期待',
......
import util from '../utils/util'
module.exports = Behavior({
methods: {
shareTrack(name, type) {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
let pathName = `pages/productDetail/${type}/${type}?cardId=`+util.getStorageSync('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName`
return {
title: trackData[name].pageName,
path: pathName
}
}
}
})
\ No newline at end of file
// pages/activityApplication/activityApplication.js
// import { trackData } from "../../utils/data";
import { entmicroApi } from "../../api/api";
Page({
/**
* 页面的初始数据
*/
data: {
productTabList: [
{
id: "0",
name: "scene1",
title: "新车洽谈场景",
type: "1.0 新车权益销售",
url: "car4",
},
{
id: "1",
name: "scene2",
title: "新车交付场景",
type: "1.1 新车精品升级",
url: "car1",
},
{
id: "2",
name: "scene3",
title: "0-12个月",
type: "1.2 新车线上转化",
url: "car2",
},
{
id: "3",
name: "scene4",
title: "12个月以上",
type: "1.3 存量用户众筹",
url: "car3",
},
],
productList: {
scene1: [
{
name: "equity",
url: "digital_icon",
nameZh: "数字无忧权益卡",
isSelect: false,
actNum: 0,
activeNavIdx: 0,
},
{
nameZh: "其他",
isSelect: false,
},
],
scene2: [
{
name: "solarFilm",
url: "solar_icon",
nameZh: "汽车太阳膜",
isSelect: false,
actNum: 1,
activeNavIdx: 0,
},
{
nameZh: "其他",
isSelect: false,
},
],
scene3: [
{
name: "paintProtect",
url: "protect_icon",
nameZh: "漆面保护膜",
isSelect: false,
actNum: 2,
activeNavIdx: 0,
},
{
name: "changingFilm",
url: "change_icon",
nameZh: "改色膜",
isSelect: false,
actNum: 2,
activeNavIdx: 1,
},
{
nameZh: "其他",
isSelect: false,
},
],
scene4: [
{
name: "carBeauty",
url: "beauty_icon",
nameZh: "数字化美容",
isSelect: false,
actNum: 3,
activeNavIdx: 0,
},
{
name: "seatVentilate",
url: "seat_icon",
nameZh: "座椅通风",
isSelect: false,
actNum: 3,
activeNavIdx: 1,
},
{
name: "arNavigation",
url: "ar_icon",
nameZh: "AR实景导航",
isSelect: false,
actNum: 3,
activeNavIdx: 2,
},
{
name: "ambientLighting",
url: "light_icon",
nameZh: "氛围灯",
isSelect: false,
actNum: 3,
activeNavIdx: 3,
},
{
name: "navigationArround",
url: "arround_icon",
nameZh: "360全景导航",
isSelect: false,
actNum: 3,
activeNavIdx: 4,
},
{
nameZh: "其他",
isSelect: false,
},
],
},
selectItemIndex: 0,
selectItemName: "scene1",
// applyForm: {
// merchantName: '',
// carModel: '',
// contactName: '',
// contactPhone: ''
// },
foldFlag: false,
sceneNum: "",
sceneName: "",
sceneTip: {
scene1: "合作门店数2200+,单店年增量产值100万+",
scene2: "合作门店数300+,单店年增量产值60万+",
scene3: "正在直播中,目前有17万+用户正在观看",
scene4: "本月活动进行中100+门店,预估产值1000万+",
},
},
// 提交表单
submitApply() {
wx.$util.showLoading("提交中...");
let validFlag = this.selectComponent("#applyForm").validateForm();
if (!validFlag[0]) return;
let params = JSON.parse(JSON.stringify(validFlag[0]));
let applyType = validFlag[1];
// 区分代理商和门店
params.merchantName =
applyType == 0
? params.merchantName + "(活动-门店)"
: params.merchantName + "(活动-代理商)";
// 如果选择了业务场景
if (this.data.sceneName) {
let selectFlag = 0;
let productItems = [];
this.data.productList[this.data.sceneName].forEach((item) => {
if (item.isSelect) {
selectFlag = selectFlag + 1;
productItems.push(item.nameZh);
}
});
if (!selectFlag) {
wx.hideLoading();
wx.showToast({
title: "请至少选择一个产品",
icon: "none",
});
return;
}
let businessItem = this.data.productTabList.find((item) => {
return item.id == this.data.sceneNum;
});
params.businessScenario = businessItem.title;
params.productItems = productItems.join(",");
}
params.cardId = wx.$util.getStorageSync("scene").cardId;
params.merchant =
wx.$util.getStorageSync("scene").merchant ||
wx.$util.getStorageSync("scene").merchantId;
params.openId = wx.$util.getStorageSync("aicard_info").openId;
params.unionId = wx.$util.getStorageSync("aicard_info").unionId;
console.log(params);
entmicroApi.activityApply(params).then(({ data, code, message }) => {
if (code == 0) {
wx.hideLoading();
wx.showToast({
msg: "提交成功",
});
wx.$router.go("applySuccess");
} else {
wx.hideLoading();
wx.showToast({
title: message,
icon: "none",
});
}
});
},
// 选择活动tab
selectProduct(e) {
this.setData({
selectItemIndex: e.currentTarget.dataset.item.id,
selectItemName: e.currentTarget.dataset.item.name,
});
},
// 跳转产品详情页
goPage(e) {
let actNum = e.currentTarget.dataset.item.actNum;
let activeNavIdx = e.currentTarget.dataset.item.activeNavIdx;
console.log(actNum, activeNavIdx, "000");
wx.$router.go("scene", { actNum, activeNavIdx });
},
// 展开收起
handleFold() {
this.setData({
foldFlag: !this.data.foldFlag,
});
},
// 选择业务场景
selectScene(e) {
// 遍历之前业务场景下产品是否已选择,选择了的话取消选中
if (this.data.sceneName) {
let newProductList;
newProductList = this.data.productList[this.data.sceneName].map(
(item) => {
if (item.isSelect) item.isSelect = false;
return item;
}
);
let selectList = `productList.${this.data.sceneName}`;
this.setData({
[selectList]: newProductList,
});
}
this.setData({
sceneNum: e.currentTarget.dataset.item.id,
sceneName: e.currentTarget.dataset.item.name,
});
},
// 选择业务场景产品
selectScenePro(e) {
var index = e.currentTarget.dataset.index;
var item = this.data.productList[this.data.sceneName][index];
item.isSelect = !item.isSelect;
this.setData({
productList: this.data.productList,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 禁用分享转发
wx.hideShareMenu({
menus: ["shareAppMessage", "shareTimeline"],
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// const options = wx.getEnterOptionsSync();
// if (options.query.cardId) {
// wx.$trackData = options.query;
// }
// getApp()
// .login()
// .then(({ data }) => {
// if (!wx.$trackData.detailShare) {
// wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION);
// }
// });
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});
{
"usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply"
},
"navigationBarTitleText": "活动申请"
}
<!-- pages/activityApplication/activityApplication.wxml -->
<view class="apply-content">
<image class="apply-background" mode="widthFix" webp src="{{IMGURL}}application/application_top.png?v={{img_version}}"></image>
<view class="box-background">
<!-- 产品展示 -->
<view class="product-box">
<!-- 产品选择tab -->
<view class="product-tab-box">
<!-- tab栏 -->
<block wx:for="{{productTabList}}" wx:key="index">
<view class="product-item {{item.id == selectItemIndex ? 'product-item-active' : ''}}" bindtap="selectProduct" data-item="{{item}}">
<view class="product-item-title {{item.id == selectItemIndex ? 'product-item-title-active' : ''}}">
{{item.title}}
</view>
<view class="product-item-type {{item.id == selectItemIndex ? 'product-item-type-active' : ''}}">
{{item.type}}
</view>
<view wx:if="{{item.id == selectItemIndex}}" class="selected-item">
<view class="selected-item-top"></view>
<view class="selected-item-bottom"></view>
</view>
</view>
</block>
</view>
<view class="product-tip">
<image class="tip-icon" wx:if="{{selectItemName == 'scene3'}}" mode="widthFix" webp src="{{IMGURL}}application/tip_icon.png?v={{img_version}}"></image>
<image class="tip-icon" wx:else="" mode="widthFix" webp src="{{IMGURL}}application/tip_icon2.png?v={{img_version}}"></image>
<text class="tip-text">{{sceneTip[selectItemName]}}</text>
</view>
<block wx:for="{{productList[selectItemName]}}" wx:key="index">
<image wx:if="{{item.name}}" class="product-img" mode="widthFix" webp src="{{IMGURL}}application/{{item.url}}.png?v={{img_version}}" bindtap="goPage" data-item="{{item}}"></image>
</block>
</view>
</view>
<!-- 申请表单 -->
<view class="apply-box">
<!-- 表单 -->
<apply-content id="applyForm"></apply-content>
<!-- 展开收起 -->
<view class="apply-fold" bindtap="handleFold">
<text wx:if="{{!foldFlag}}">选择业务场景</text>
<text wx:else>收起</text>
<image wx:if="{{!foldFlag}}" class="fold-icon" mode="widthFix" webp src="{{IMGURL}}application/down_icon.png?v={{img_version}}"></image>
<image wx:else class="fold-icon" mode="widthFix" webp src="{{IMGURL}}application/up_icon.png?v={{img_version}}"></image>
</view>
<block wx:if="{{foldFlag}}">
<!-- 业务场景 -->
<view class="fold-title">业务场景</view>
<view class="product-tab-box fold-box">
<view wx:for="{{productTabList}}" wx:key="index" class="item-wrap {{item.id == sceneNum ? 'act':''}}" bindtap="selectScene" data-item="{{item}}">
<view class="fold-scene-item {{item.id == sceneNum ? 'fold-scene-item-active':''}}">
<image class="fold-img" mode="widthFix" webp src="{{IMGURL}}application/{{item.url}}.png?v={{img_version}}"></image>
<view class="product-item-title {{item.id == sceneNum ? 'product-item-title-active':''}}">
{{item.title}}
</view>
<view class="product-item-type {{item.id == sceneNum ? 'product-item-type-active':''}}">
{{item.type}}
</view>
</view>
</view>
</view>
<!-- 选择产品 -->
<block wx:if="{{sceneNum}}">
<view>
<text class="fold-title">选择产品</text>
<text class="fold-tip">(可多选)</text>
</view>
<view class="fold-product">
<block wx:for="{{productList[sceneName]}}">
<view class="item {{item.isSelect ? 'item-selected': ''}}" bindtap="selectScenePro" data-index="{{index}}">
<view>{{item.nameZh}}</view>
<image wx:if="{{item.isSelect}}" class="selected-img" mode="widthFix" webp src="{{IMGURL}}application/selected_icon.png?v={{img_version}}"></image>
</view>
</block>
</view>
</block>
</block>
</view>
<view class="btn-box">
<button class="submit-btn" bindtap="submitApply">提交申请</button>
</view>
</view>
\ No newline at end of file
/* pages/activityApplication/activityApplication.wxss */
.apply-content {
/* overflow: auto; */
}
.apply-background {
width: 100%;
}
.box-background {
background-image: linear-gradient(179deg, #E3E8FF 0%, #FEFEFE 100%);
}
.product-tab-box {
display: flex;
margin-bottom: 38rpx;
}
.product-item {
/* width: 166rpx; */
width: calc(100%/4);
height: 120rpx;
margin-right: 12rpx;
background: #F5F5FC;
border-radius: 8rpx;
}
.product-item:last-child {
margin-right: 0;
}
.product-item-active {
background: #FFFFFF;
}
.product-item-title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #323436;
letter-spacing: 0;
text-align: center;
line-height: 44rpx;
margin-top: 24rpx;
}
.product-item-title-active {
color: #5850FF;
}
.product-item-type {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 18rpx;
color: #8A8C90;
letter-spacing: 0;
text-align: center;
line-height: 24rpx;
}
.product-item-type-active {
color: #807AFF;
}
.selected-item {
margin-top: 27rpx;
/* width: 166rpx; */
position: relative;
}
.selected-item-top {
/* width: 166rpx; */
height: 4rpx;
border-bottom-left-radius: 4rpx;
border-bottom-right-radius: 4rpx;
background: #5850FF;
}
.selected-item-bottom {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 0px;
height: 0px;
border: 12rpx solid #5850FF;
border-bottom-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
}
.product-img {
width: calc((100% - 32rpx)/3);
height: 216rpx;
margin-right: 16rpx;
margin-bottom: 20rpx;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.40);
}
.product-img:nth-child(3n+2) {
margin-right: 0;
}
.product-box {
margin-bottom: 56rpx;
padding: 0 26rpx;
background-image: linear-gradient(179deg, #DBE3FF 0%, #FEFEFE 100%);
}
.product-tip {
display: flex;
align-items: center;
width: 704rpx;
height: 44rpx;
background-image: linear-gradient(133deg, rgba(0, 51, 255, 0.08) 0%, #FFFFFF 100%);
border-radius: 24rpx;
margin-bottom: 32rpx;
}
.tip-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.tip-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
color: #5850FF;
line-height: 36rpx;
}
.apply-box {
width: 702rpx;
/* height: 680rpx; */
background: #FFFFFF;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.40);
border-radius: 12rpx;
margin: 0 24rpx;
margin-bottom: 30rpx;
/* position: absolute;
top: 420rpx;
left: 24rpx; */
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 60rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.btn-box {
padding-bottom: 60rpx;
}
.apply-fold {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF;
text-align: center;
padding: 76rpx 0 40rpx 0;
}
.fold-icon {
width: 24rpx;
height: 24rpx;
vertical-align: middle;
margin-left: 8rpx;
}
.fold-title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #323436;
padding-left: 32rpx;
}
.fold-tip {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 22rpx;
color: #6E6E7A;
}
.fold-box {
padding: 44rpx 16rpx;
}
.fold-scene-item {
/* width: 160rpx; */
width: 100%;
height: 180rpx;
background: #F7F7FC;
border-radius: 12rpx;
text-align: center;
}
.fold-scene-item-active {
background-image: linear-gradient(145deg, #E6E6FF 0%, #FFFFFF 73%);
}
.fold-img {
width: 56rpx;
height: 56rpx;
margin-top: 20rpx;
}
.item-wrap {
position: relative;
/* width: 160rpx; */
width: calc(100%/4);
height: 180rpx;
border-radius: 12rpx;
margin-right: 12rpx;
}
.item-wrap:last-child {
margin-right: 0
}
.act {
border: 2rpx solid #5850FF;
}
.act::after {
position: absolute;
left: 50%;
bottom: -15rpx;
display: block;
content: "";
width: 14rpx;
height: 14rpx;
border-bottom: 2rpx solid #5850FF;
border-right: 2rpx solid #5850FF;
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
.item {
/* width: 216rpx; */
width: calc((100% - 24rpx)/3);
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
text-align: center;
margin-right: 12rpx;
margin-bottom: 20rpx;
position: relative;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.item:nth-child(3n) {
margin-right: 0;
}
.fold-product {
display: flex;
flex-wrap: wrap;
padding: 36rpx 16rpx 64rpx 16rpx;
}
.item-selected {
color: #5850FF;
font-weight: 600;
border: 2rpx solid #9B96FF;
}
.selected-img {
width: 30rpx;
height: 22rpx;
position: absolute;
top: -1rpx;
right: -1rpx;
}
\ No newline at end of file
......@@ -54,9 +54,9 @@ Page({
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
wx.showToast({
title: error.msg,
icon: 'none',
})
},
......
......@@ -7,7 +7,11 @@ Page({
data: {
},
toBack() {
wx.navigateBack({
delta: 2,
})
},
/**
* 生命周期函数--监听页面加载
*/
......
{
"usingComponents": {},
"navigationBarTitleText": "合作申请"
"navigationBarTitleText": "活动申请"
}
\ No newline at end of file
......@@ -4,10 +4,9 @@
<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">
进入您的可分享页面
<view class="success-text">您的申请已提交,</view>
<view class="success-text">请耐心等待顾问专员与您联系。</view>
<button class="share-btn" bindtap="toBack">
返回首页
</button>
</view>
......@@ -6,7 +6,7 @@
.success-img {
width: 448rpx;
height: 192rpx;
margin-top: 240rpx;
margin-top: 192rpx;
}
.success-title {
......@@ -14,7 +14,7 @@
font-weight: 500;
font-size: 56rpx;
color: #2D2D33;
margin: 32rpx 0;
margin: 80rpx 0 32rpx;
}
.success-text {
......@@ -29,9 +29,10 @@
width: 622rpx;
height: 80rpx;
font-size: 28rpx;
color: #ffffff;
background: #5850FF;
color: #5850FF;
border-radius: 8rpx;
line-height: 80rpx;
margin-top: 160rpx;
margin-top: 208rpx;
border: 2rpx solid #9B96FF;
background-color: #fff;
}
\ No newline at end of file
// pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;";
const navStyle = "background-color: #fff";
import { senceData } from "~/pages/scene/constant/data.js";
// import { IMG_URL } from "~/utils/constantData.js";
// import { productBysceneApi } from '~/api/index.js'
import Draw from "~/utils/Draw_new.js";
import { createQrCodeApi, sceneByIdApi } from "~/api/checkProduct.js";
import utils from "~/utils/util.js";
import {trackData, productTrack} from '../../utils/data'
let IMG_URL = wx.$imgUrl
Page({
/**
* 页面的初始数据
*/
noPageAuth: true,
data: {
navStyle,
headerHeight: 0,
senceData,
// 模态框
isShow: false,
// IMG_URL: `${IMG_URL}index`,
btnList: [
{
src: `${IMG_URL}index/down.png`,
name: "下载海报",
},
{
src: `${IMG_URL}index/wechat.png`,
name: "转发给好友",
},
// {
// src: `${IMG_URL}index/moments.png`,
// name: "朋友圈分享",
// },
],
// 4种场景下图片所有的高 (单位 rpx)
imgHeightArr: [
[1110, 1290, 596, 744, 490, 1532],
[2168, 1290, 596, 830, 490, 752],
[1110, 1290, 596, 984, 490],
[678, 1266, 1398, 830, 490, 1666],
],
posterUrl: "", //海报url
noVideoimgList: [],
//分享相关
isShare: false,
// 是否授权昵称
hasUserInfo: false,
phone: "", //授权手机号
userInfo: "",
isAuthphone: true, //授权昵称弹窗显示,更多按钮显示
},
observers: {
actNum: function (actNum) {
let imgList = [
`${IMG_URL}index/scene${actNum + 1}1.png`,
`${IMG_URL}index/scene${actNum + 1}2.png`,
`${IMG_URL}index/scene${actNum + 1}3.png`,
`${IMG_URL}index/scene${actNum + 1}4.png`,
`${IMG_URL}index/scene${actNum + 1}5.png`,
];
this.setData({
noVideoimgList: imgList,
});
if (actNum != 2) {
imgList.push(`${IMG_URL}index/scene${actNum + 1}6.png`);
}
this.setData({
imgList,
});
},
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail;
this.setData({
headerHeight: height / 2 + statusBarHeight,
// headerHeight: height / 2 + statusBarHeight,
// headerHeight: height / 2 + statusBarHeight + 88 * 2,
});
// console.log(e)
// console.log(this.data.headerHeight)
},
// 分项弹框关闭
modelcloseFn(e) {
this.setData({
isShow: false,
});
},
// 分享按钮
sharehandle() {
this.setData({
isShow: true,
});
},
//如果是直接查看页面,获取合成apiData
getData() {
console.log(123456)
// 看产品
this.compositionData(senceData, [])
// productBysceneApi().then(res => {
// let { code, data } = res
// if (code == 0 && data) {
// // this.setData({
// // apiData: data
// // })
// this.compositionData(senceData, data)
// // this.getFirstSenceIndex();
// }
// })
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner, idx) => {
if (item.name == inner.stage) {
item.sceneStatus = inner.sceneStatus
item.productList.forEach((outChild, outIndex) => {
inner.productList.forEach((innerChild, innerIndex) => {
if (outChild.proName == innerChild.productName) {
outChild.productStatus = innerChild.productStatus
}
})
})
}
})
})
// console.log('localData, apiData: ', localData);
this.setData({
senceData: localData
})
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
console.log("分享options: ", options);
if (!options || utils.isEmptyObj(options)) return;
// if(!Object.keys(options).includes('actNum'))return
let {senceData} = this.data
//选中场景的index,和产品的index
let {
actNum,
activeNavIdx,
// apiData,
outshowVideo,
isShow
// origin //跳转来源 home
} = options;
// if(actNum&&activeNavIdx)return
// 设置标题
let userInfoObj = wx.$storage.get('userInfo')
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name
if (userInfoObj.name) {
name = userInfoObj.name
}else if(userInfoObj.merchantName){
name = userInfoObj.merchantName
}else if(userInfoObj.merchantName){
//全称
name = userInfoObj.merchantName
}
this.shareTitle = `${name}给你分享一个活动${senceData[actNum]?.productList[activeNavIdx].proName},戳我参与~`;
// this.getImgInfo(actNum)
this.setData({
actNum,
activeNavIdx,
// apiData,
outshowVideo,
isShow
// origin
// isShare
});
// let apiDataJson = JSON.stringify(apiData);
let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${senceData[actNum].sceneCode}&productCode=${
item?.productCode
}&isShare=${true}&productDesc=${item?.productName}&category=${
item?.category
}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`;
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
// actNum,
// activeNavIdx,
// apiData,
};
},
// 分享按钮
handleClick(e) {
let { index } = e.currentTarget.dataset;
let _this = this
switch (index) {
case 0:
wx.showModal({
content: '确认下载海报?',
success: async (res) => {
if(res.confirm){
// let hasAuth = await _this.toSetting()
// if(hasAuth){
_this.download()
// }
}
},
fail: (res) => {},
complete: (res) => {},
})
// this.download();
break;
case 1:
this.wechatFn();
break;
}
},
//授权添加相册
toSetting(){
return new Promise((resolve,reject)=>{
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']){
resolve(true)
}else{
wx.openSetting({
success :(resp)=> {
if(resp.authSetting['scope.writePhotosAlbum']){
resolve(true)
}else{
wx.showToast({
title: "下载海报前需要您授权'添加到相册'权限",
icon: "none",
duration: 2500,
});
}
}
})
}
}
})
})
},
// 微信转发
wechatFn() {
// this.data.onShareAppMessage()
// this.modelcloseFn();
},
// 下载海报
async download() {
let { actNum, activeNavIdx, imgHeightArr ,imgPath} = this.data;
const { appId } = wx.getAccountInfoSync().miniProgram
let { userInfo } = wx.$storage.get()
// let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info.appId);
wx.showLoading({
title: "海报生成中...",
});
let params = {
actNum,
activeNavIdx,
isShare: true,
};
// console.log(' wx_user_info.appId', wx_user_info)
let res = await createQrCodeApi({
appId: appId,
// appId:'wx2c28337db96364d2',
path: "pages/checkProduct/checkProduct",
scene: JSON.stringify(params),
});
let _this = this;
wx.getImageInfo({
src: imgPath,
success: async (respp) => {
let imgW = respp.width/4, imgH =respp.height/4;
let pradH = 288*imgW/1029, qrcodeH = 100;
let drawFun = new Draw({
width: imgW ,
height: imgH + pradH
});
console.log('actNum',actNum)
let qrcodeY = actNum== 2 ? 20 : 0
let arr = [456, 222, 0, 496];
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: pradH,
url: `${IMG_URL}index/canvas/${senceData[actNum].productList[activeNavIdx].img}.png`,
},
{
x: 0,
y: pradH,
width: imgW,
height: imgH,
url: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
actNum + 1
}.png`,
},
{
// x: 245 * 2,
// y: erCodeHeight + 30,
// width: 120 * 2,
// height: 120 * 2,
x: imgW-qrcodeH,
y: imgH + pradH -qrcodeH -20,
width: qrcodeH,
height: qrcodeH,
url: res.data, //二维码
},
];
let telephone = userInfo.phone?userInfo.phone:''
let textList = [
{
x: 22,
y: imgH + pradH - 25,
text: `联系我:${telephone}`,
color: '#323436',
fontSize: 10
}
]
// console.log(imgList)
let posterUrl = await drawFun.begin({
imageList: imgList,
textList
});
_this.setData({
posterUrl: posterUrl.path,
});
console.log("posterUrl.path", posterUrl.path);
if (_this.data.posterUrl) {
wx.saveImageToPhotosAlbum({
filePath: _this.data.posterUrl, //仅为示例,并非真实的资源
success(res) {
console.log("res: ", res);
wx.showToast("下载成功!");
},
});
}
// _this.modelcloseFn();
wx.hideLoading()
},
});
},
// //模态框关闭
// modelClose() {
// this.triggerEvent("modelclose", false);
// },
// 图片加载事件
// onloadFn(event) {
// // console.log("event.detail", event.detail);
// this.setData({
// imgHeight: event.detail.height / 5,
// imgWidth: event.detail.width / 5,
// });
// },
// 图片视频加载回调拿到url
getImgInfo(actNum){
wx.showLoading({
title: "加载中",
});
let _this = this;
wx.getImageInfo({
src: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
actNum + 1
}.png`,
success: async (res) => {
console.log('res: ', res)
wx.hideLoading()
wx.nextTick(() => {
_this.setData({
// isShow: true,
imgPath:res.path
})
})
}
})
},
// 分享获取懂得用户数
authorizedFn(e) {
let res = e.detail;
this.onLoad(null);
wx.nextTick(() => {
//储存手机号
// console.log("储存手机号",res.phone)
wx.$storage.set("authphone", res.phone);
this.setData({
// isShare: res.isShare,
phone: res.phone,
});
});
},
/**
* 生命周期函数--监听页面加载 (扫码,分享链接)
*/
async onLoad(options) {
console.log(wx.getEnterOptionsSync())
await this.getData()
console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return;
// this.analysisOption();
// 解析二维码参数
if (options.scene) {
this.setData({
isShare: true,
});
let ercodeParams = await this.analysisQRcode(options.scene);
options = JSON.parse(ercodeParams.scene)
}
let {senceData} = this.data
// 扫码进来
let { actNum, activeNavIdx, isShare } = options;
// const { query: {cardId, merchant} } = wx.getEnterOptionsSync()
const { query, query: {cardId, merchant} } = wx.getEnterOptionsSync()
console.log('actNum, activeNavIdx, isShare: ', actNum, activeNavIdx, isShare);
if (isShare) {
this.setData({
isShow: false,
});
if (cardId) {
wx.$trackData = query
getApp()
.login()
.then(({ data }) => {
const trackName = productTrack[actNum][activeNavIdx]
wx.$Track.sendTrack(trackData[trackName]);
});
}
} else {
wx.showLoading({
title: "加载图片中",
});
}
this.setData({
actNum,
activeNavIdx,
isShare: true,
outshowVideo: false, //显示视频列表
});
// 发请求
console.log()
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${
item?.productCode
}&isShare=${true}&productDesc=${item?.productName}&category=${
item?.category
}&actNum=${actNum}&activeNavIdx=${activeNavIdx}`;
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
// actNum,
// activeNavIdx,
};
// 有手机号就不用再一次授权昵称,手机号
let phone = wx.$storage.get("authphone");
console.log("储存手机号", phone);
if (phone) {
this.setData({
isAuthphone: false,
outshowVideo: true,
isShare:false,
});
}
},
// 解析二维码回调
// async analysisOption() {},
// 解析扫码进来参数
async analysisQRcode(str) {
let id = str.split("%3D")[1];
let res = await sceneByIdApi({
id,
});
// console.log('res: ', res);
return res;
},
// 获取用户昵称
getUserProfile(e) {
this.setData({
hasUserInfo: true,
});
let _this = this;
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
// console.log('res: ', res.userInfo.nickName);
// userInfo.nickName
this.setData({
userInfo: res.userInfo,
});
let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info);
let obj = {
...wx_user_info,
nickName: res.userInfo.nickName,
avatarUrl: res.userInfo.avatarUrl,
};
// console.log('obj',obj)
wx.$storage.set("wx_user_info", obj);
_this.onLoad(null);
},
});
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit('evt_page_scroll',{scrollTop:e.scrollTop})
}, 500);
};
})(),
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow(options) {
// wx.nextTick(()=>{
// let {senceData ,actNum, activeNavIdx} = this.data
// console.log('senceData: ', senceData,actNum,activeNavIdx);
// let item = senceData[actNum]?.productList[activeNavIdx].proName;
// console.log('item: ', item);
// wx.setNavigationBarTitle({
// title: item.proName,
// })
// })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
let {senceData,actNum,activeNavIdx,isShare} = this.data
let product = senceData[actNum]?.productList[activeNavIdx].proName
let merchant = utils.getStorageSync("scene").merchant || utils.getStorageSync("scene").merchantId
const cardId = utils.getStorageSync('scene').cardId
console.log('product: ', product);
return {
// title: `给你分享一个活动${product},戳我参与~`,
title: `给你分享一个活动,戳我参与~`,
path:`/pages/checkProduct/checkProduct?actNum=${actNum}&activeNavIdx=${activeNavIdx}&isShare=${isShare}&cardId=${cardId}&merchant=${merchant}`
}
},
/**
* 浏览埋点
*/
onShareTimeline() {},
onViewTrack: true,
});
{
"usingComponents": {
"product": "../scene/components/product/product"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
/* pages/checkProduct/checkProduct.wxss */
@import "../../style/common.wxss";
page {
background-color: #F7F7F7;
color: #282829;
font-size: 28rpx;
--themeColor: #F13C3D;
--btnColor: #3666FE;
--borderRadius: 8rpx;
--margin: 32rpx;
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
transform: translateY(7rpx);
}
.productCon {
box-sizing: border-box;
padding-top: 88px;
display: block;
}
// 分享模态框
.share-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2;
.img-wrap {
position: absolute;
top: 15%;
left: 50%;
transform: translateX(-50%);
// width: 225px;
width: 60%;
height: 54%;
// background-color: red;
overflow: auto;
border-radius: 16rpx;
.prod-item {
background-color: #f5f7fb;
.prod-item {
padding: 0 32rpx 32rpx;
margin: 16rpx auto 0;
// background-color: #f5f7fb;
// border-radius: 48rpx 48rpx 0 0;
}
.prod-card {
display: flex;
height: 120rpx;
background-image: linear-gradient(1deg, #ffffff 10%, #fdfcff 100%);
border: 2rpx solid #ffffff;
// box-shadow: 0 8rpx 20rpx 0 rgba(197, 205, 235, 0.35);
border-radius: 20rpx;
padding: 0 24rpx;
// box-sizing: border-box;
position: relative;
}
.prod-card .card-img {
padding-top: 10rpx;
width: 100rpx;
height: 100rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc {
position: absolute;
width: 104rpx;
height: 40rpx;
line-height: 40rpx;
background: #d7f5eb;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #24b38c;
letter-spacing: 0;
text-align: center;
}
.prod-info {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info > text {
display: block;
white-space: nowrap;
// height: 40rpx;
// line-height: 40rpx;
}
.prod-info .title {
font-weight: 500;
font-size: 16rpx;
color: #323436;
}
.prod-info .sale,
.prod-info .earnings {
font-size: 16rpx;
color: #7a8299;
}
.prod-info .sale-num {
font-size: 14rpx;
color: #323436;
}
.prod-info .earnings-num {
font-size: 14rpx;
font-weight: Bold;
color: #f35251;
}
}
.img {
width: 100%;
// height: auto;
// height: 60%;
background-color: #fff;
}
}
}
.btns-wrap {
padding-bottom: 84rpx;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 120rpx;
background: #ffffff;
z-index: 1;
// border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
// .name {
// font-size: 12px;
// color: #323436;
// text-align: center;
// }
.name0{
width: 256rpx;
height: 88rpx;
border: 1px solid #EEEEEE;
border-radius: 8rpx;
font-size: 28rpx;
color: #8A8C90;
text-align: center;
line-height:88rpx;
}
.name1{
width: 414rpx;
height: 88rpx;
background: #3666FE;
border-radius: 8rpx;
font-size: 28rpx;
color: #FFFFFF;
line-height:88rpx;
}
.btn-wechat {
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
}
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
text-align: center;
}
}
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 3;
background-color: transparent;
}
<!-- pages/checkProduct/checkProduct.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
{{senceData[actNum].productList[activeNavIdx].proName}}
</navigation-bar>
<!-- <view style="height:{{headerHeight}}px">
</view> -->
<!-- style="padding-top:{{headerHeight}}px" -->
<product stickyTop="{{headerHeight}}" class="productCon" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" isShow="{{isShow}}" bindauthorized="authorizedFn" />
<!-- 分享弹框 -->
<!-- <view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<image src="{{IMG_URL}}index/prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
<view class="prod-info">
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<text class="sale" decode="{{true}}">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;
<text class="sale-num">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}
</text>
</text>
<text class="earnings" decode="{{true}}">
预估收益&nbsp;
<text class="earnings-num">
{{senceData[actNum]['productList'][activeNavIdx].profit}}
</text>
</text>
</view>
</view>
</view>
</view>
<button></button>
</view> -->
<!-- 用于图片加载事件 -->
<!-- <image class="img" src="{{IMG_URL}}index/longpic{{actNum+1}}.png" bindload="onloadFn" /> -->
<!-- <view class="btns-wrap" wx:if="{{isShow}}">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 1}}">
<button open-type="share" class="btn-wechat">
<view class="name{{index}}">{{item.name}}</view>
</button>
</block>
<block wx:else>
<view class="name{{index}}">{{item.name}}</view>
</block>
</view>
</view>
</view> -->
<!-- 授权昵称 -->
<!-- !hasUserInfo && !isShow -->
<!-- <view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file
var measureList = Object.freeze([
{
name: '新车1.0',
iconName: 'icon1',
product: [
{
name: '车损险升级',
parentName: '新车1.0',
value: '0-0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
{
name: '新车1.1',
iconName: 'icon2',
product: [
{
name: '太阳膜升级',
parentName: '新车1.1',
value: '1-0',
isCheck: false,
rate: '0.55',
averagePrice: 1400,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.65'
}
]
},
{
name: '新车1.2',
iconName: 'icon3',
tips: '0-6个月',
product: [
{
name: '膨胀金活动-车衣',
parentName: '新车1.2',
tips: '0-6个月',
value: '2-0',
isCheck: false,
rate: '0.09',
averagePrice: 5000,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.85'
},
{
name: '膨胀金活动-改色膜',
parentName: '新车1.2',
tips: '0-6个月',
value: '2-1',
isCheck: false,
rate: '0.06',
averagePrice: 2999,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.74'
}
]
},
{
name: '新车1.3',
iconName: 'icon4',
tips: '售后活动',
product: [
{
name: '360全景导航',
parentName: '新车1.3',
tips: '售后活动',
value: '3-0',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.16'
},
{
name: 'AR导航',
parentName: '新车1.3',
tips: '售后活动',
value: '3-1',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
},
{
name: '氛围灯',
parentName: '新车1.3',
tips: '售后活动',
value: '3-2',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.22'
},
{
name: '座椅通风',
parentName: '新车1.3',
tips: '售后活动',
value: '3-3',
isCheck: false,
rate: '0.01',
averagePrice: 2580,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.21'
},
{
name: '智能香氛',
parentName: '新车1.3',
tips: '售后活动',
value: '3-4',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
}
]
}
])
export default {
measureList
}
\ No newline at end of file
// pages/measure/measure.js
import Util from '../../../utils/util'
import measureData from '../constant/data'
const checkMap = new Map()
Page({
/**
* 页面的初始数据
*/
data: {
measureList: measureData.measureList,
isDisabled: true,
checkArray: [],
formData: {
storeNumber: '',
carNumber: '',
customNumber: ''
}
},
// 提交
submit() {
const reg = /^[1-9]\d*$/
// for(let i in this.data.formData) {
// if (!reg.test(this.data.formData[i])) {
// wx.showToast({
// title: '请输入正整数',
// icon: 'none',
// duration: 1000
// })
// this.setData({
// isDisabled: true
// })
// return
// }
// }
if (!this.data.isDisabled) {
console.log(this.data.checkArray)
let checkArray = []
this.data.measureList.forEach(item => {
item.product.forEach(i => {
if (i.isCheck) {
checkArray.push(i)
}
})
})
console.log(checkArray)
const params = Object.assign({checkArray}, this.data.formData)
console.log(params)
wx.$router.go("measureResult", params);
}
},
// 选择产品
checkProduct(e) {
const value = e.target.dataset.value
const index = +value.split('-')[0]
const productIndex = +value.split('-')[1]
const name = `measureList[${index}].product[${productIndex}].isCheck`
const val = this.data.measureList[index].product[productIndex].isCheck
!val ? checkMap.set(value, !val) : checkMap.delete(value)
console.log(checkMap)
this.setData({
[name]: !val,
checkArray: [...checkMap.keys()]
})
this.validForm()
console.log(this.data.checkArray)
},
// 必填校验
validForm() {
const flag = this.data.formData.storeNumber && this.data.formData.carNumber && this.data.formData.customNumber && this.data.checkArray.length
this.setData({
isDisabled: !flag
})
return flag
},
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = this.validateNumber(e.detail.value)
console.log(val)
const form = `formData.${name}`
this.setData({
[form]: val
})
this.validForm()
},
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "展业测算"
}
\ No newline at end of file
<!--pages/measure/measure.wxml-->
<view class="wrapper-measure">
<image class="header-bg" webp src="{{IMGURL}}measure/header-bg.png?v={{img_version}}"></image>
<view class="form first-form">
<view class="form-title">请输入门店基本信息</view>
<view class="form-label">您的门店数</view>
<input class="form-value" value="{{formData.storeNumber}}" bindinput="handleInput" data-name="storeNumber" maxlength="4" type="number" placeholder="请输入门店数"/>
<view class="form-label">单店每月平均新车数</view>
<input class="form-value" value="{{formData.carNumber}}" bindinput="handleInput" data-name="carNumber" maxlength="4" type="number" placeholder="请输入单店每月平均新车数"/>
<view class="form-label">单店3年以上存量客户数</view>
<input class="form-value" value="{{formData.customNumber}}" bindinput="handleInput" data-name="customNumber" maxlength="6" type="number" placeholder="请输入您的单店3年以上存量客户数"/>
</view>
<view class="form second-form">
<view class="form-title">请选择场景/产品</view>
<block wx:for="{{measureList}}" wx:for-item="i" wx:key="index">
<view class="scenario">
<image class="icon" webp src="{{IMGURL}}measure/{{i.iconName}}.png?v={{img_version}}"></image>
{{i.name}}
<view wx:if="{{i.tips}}" class="title-tip">({{i.tips}})</view>
</view>
<view class="product-list">
<view class="product-item {{j.isCheck ? 'active':''}}" wx:for="{{i.product}}" wx:for-item="j" wx:key="index" data-value="{{j.value}}" bindtap="checkProduct">
<image hidden="{{!j.isCheck}}" class="iconCheck" webp src="{{IMGURL}}measure/icon-check.png?v={{img_version}}"></image>
{{j.name}}</view>
</view>
</block>
</view>
<view class="submit {{isDisabled ? 'disabled' : ''}}" bindtap="submit">开始测算</view>
</view>
/* pages/measure/measure.wxss */
.wrapper-measure {
position: relative;
padding: 0 24rpx 90rpx;
}
.header-bg {
position: absolute;
top: -224rpx;
left: 0;
width: 100%;
z-index: -1;
}
.form {
width: 100%;
box-sizing: border-box;
background: #fff;
box-shadow: 0 4rpx 32rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
padding: 32rpx 40rpx;
}
.form-title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
}
.first-form {
margin-top: 224rpx;
}
.second-form {
margin-top: 48rpx;
}
.form-label {
font-size: 28rpx;
margin-top: 32rpx;
}
.form-value {
margin-top: 16rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
padding: 0 20rpx;
box-sizing: border-box;
font-size: 28rpx;
font-size: 28rpx;
line-height: 48rpx;
}
.scenario {
display: flex;
align-items: center;
width: 100%;
padding: 10rpx 24rpx;
background: #F5F5FA;
border-radius: 8rpx;
margin-top: 48rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
line-height: 44rpx;
box-sizing: border-box;
}
.scenario .icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.title-tip {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
letter-spacing: 0;
line-height: 44rpx;
}
.product-list {
/* display: flex; */
width: 100%;
}
.product-item {
position: relative;
display: inline-block;
width: calc(50% - 42rpx);
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 8rpx;
text-align: center;
padding: 14rpx;
margin-top: 18rpx;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
text-align: center;
line-height: 44rpx;
}
.product-item.active {
background-image: linear-gradient(0deg, #E8E8FF 14%, #FAFAFF 89%);
border: 2rpx solid #9994FF;
}
.product-item:nth-child(even) {
margin-left: 18rpx;
}
.iconCheck {
position: absolute;
width: 30rpx;
height: 22rpx;
top: -2rpx;
right: -2rpx;
}
.submit {
margin: 48rpx 32rpx;
padding: 24rpx 245rpx;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
}
.submit.disabled {
background: #D3D3DB;
}
\ No newline at end of file
// pages/measureResult/measureResult.js
import Util from '../../../utils/util'
import measureData from '../constant/data'
Page({
/**
* 页面的初始数据
*/
data: {
visible: false,
measureList: null,
formData: {
storeNumber: 1,
carNumber: 1,
customNumber: 1,
checkArray: []
},
checkList: [],
singleList: ['baseCustomersNumber', 'valueAddNumber', 'storeIncomeNumber', 'serviceIncomeNumber', 'singleValueAddNumber', 'singleStoreIncomeNumber', 'singleServiceIncomeNumber'],
countList: ['valueAddCount', 'storeIncomeCount', 'serviceIncomeCount', 'singleValueAddCount', 'singleStoreIncomeCount', 'singleServiceIncomeCount'],
countData: {},
dialogData: {
rate: '',
averagePrice: ''
}
},
// 计算公式
formula(name, item, list) {
console.log(name, item)
const {storeNumber, carNumber, customNumber} = this.data.formData
const {rate, averagePrice, flowCost, serviceDividendRatio, parentName} = item
console.log(storeNumber, carNumber, customNumber)
let value = 0
switch(name) {
// 增值产量(总)
case 'valueAddCount':
list.forEach(i => {
value = value + (+i.valueAddNumber)
})
break
// 4s店收入/年
case 'storeIncomeCount':
list.forEach(i => {
value = value + (+i.storeIncomeNumber)
})
break
// 服务商收入/年
case 'serviceIncomeCount':
list.forEach(i => {
value = value + (+i.serviceIncomeNumber)
})
break
// 单店均值
case 'singleValueAddCount':
let val = 0
list.forEach(i => {
val = val + (+i.valueAddNumber)
})
value = (val / storeNumber).toFixed(0)
break
// 单店均值
case 'singleStoreIncomeCount':
let val1 = 0
list.forEach(i => {
val1 = val1 + (+i.storeIncomeNumber)
})
value = (val1 / storeNumber).toFixed(0)
break
// 单店均值
case 'singleServiceIncomeCount':
let val2 = 0
list.forEach(i => {
val2 = val2 + (+i.serviceIncomeNumber)
})
value = (val2 / storeNumber).toFixed(0)
break
// 基盘客户数
case 'baseCustomersNumber':
if (parentName == '新车1.3') {
value = customNumber * storeNumber
} else {
value = carNumber * 12 * storeNumber
}
break
// 增量产值/年(单个产品)总
case 'valueAddNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice).toFixed(0)
}
break
// 单店产值
case 'singleValueAddNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice / storeNumber).toFixed(0)
}
break
// 4s店收入/年
case 'storeIncomeNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost).toFixed(0)
}
break
// 服务商收入/年
case 'serviceIncomeNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio).toFixed(0)
}
break
// 4s店收入/年,单店
case 'singleStoreIncomeNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost / storeNumber).toFixed(0)
}
break
// 服务商收入/年,单店
case 'singleServiceIncomeNumber':
if (parentName == '新车1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
}
break
}
return value;
},
// 开始计算
getCalculate(checkArray, isCount = false) {
const checkList = checkArray
if (!isCount) {
const singleList = this.data.singleList
checkList.forEach(item => {
singleList.forEach(i => {
const value = this.formula(i, item)
item[i] = value
})
})
return checkList
} else {
const {countList} = this.data
const countData = {}
console.log(checkList)
checkList.forEach(i => {
countList.forEach(j => {
const value = this.formula(j, i, checkList)
countData[j] = value
})
})
return countData
}
},
// 编辑
toEdit(e) {
console.log(e)
const {item, index} = e.currentTarget.dataset
console.log(item)
this.setData({
visible: true,
'dialogData.rate': (item.rate * 10000 / 100).toFixed(2),
'dialogData.averagePrice': item.averagePrice,
'dialogData.index': index
});
},
showCalculate() {
this.setData({
visible: false
})
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 451) {
this.setData({
visible: false
});
}
},
submit(e) {
console.log(e, this.data.dialogData)
const {rate, averagePrice, index} = this.data.dialogData
console.log(index)
// const reg = /^[1-9]\d*$/
// const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
if (!rate) {
wx.showToast({
title: '请输入转化率',
icon: 'none',
duration: 2000
})
return
}
if (!averagePrice) {
wx.showToast({
title: '请输入客均单价',
icon: 'none',
duration: 2000
})
return
}
this.setData({
[`checkList[${index}].rate`]: rate / 100,
[`checkList[${index}].averagePrice`]: averagePrice,
visible: false
})
console.log(this.data)
const checkList = this.getCalculate(this.data.checkList)
const countData = this.getCalculate(this.data.checkList, true)
console.log(checkList, countData)
this.setData({
checkList,
countData
})
},
// 输入框输入
handleInput(e) {
console.log(e)
let value = e.detail.value
const name = e.target.dataset.name
const reg = /^[1-9]\d*$/
const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
console.log(value <100 && value > 0, (reg.test(value) || reg1.test(value)))
if (name == 'rate') {
if (value <= 0) {
value = null
} else if (value > 100) {
value = value.slice(0,2)
} else if (value > 0 && value < 100) {
const valueArr = value.split('.')
if (valueArr.length == 2) {
const decimal = value.split('.')[1].slice(0,2)
const integer = value.split('.')[0]
value = integer + '.' + decimal
}
} else {
console.log(value)
value = value.slice(0, value.length - 1)
}
} else {
value = this.validateNumber(value)
}
console.log(value)
const form = `dialogData.${name}`
this.setData({
[form]: value
})
// this.setData({
// 'dialogData.rate': value
// })
},
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(res => {
console.log(res)
const list = Util.deepClone(res)
this.setData({
formData: list
})
const checkList = this.getCalculate(list.checkArray)
const countData = this.getCalculate(list.checkArray, true)
console.log(checkList)
this.setData({
checkList,
countData,
})
console.log(countData)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
measureList: measureData.measureList
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "测算结果"
}
\ No newline at end of file
<!--pages/measureResult/measureResult.wxml-->
<view class="wrapper">
<image class="header-bg {{formData.storeNumber > 1 ? '':'banner1'}}" webp src="{{IMGURL}}measure/{{formData.storeNumber > 1 ? 'banner2':'banner1'}}.png?v={{img_version}}"></image>
<view class="wrapper-header">
<view class="store-number">门店数量:{{formData.storeNumber}}</view>
<view class="header-box">
<view class="card-item">
<view class="card-label m-b-8">增量产值/年</view>
<view class="card-value">{{filter.formatValue(countData.valueAddCount)}}</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">4S店收入/年</view>
<view class="card-value">{{filter.formatValue(countData.storeIncomeCount)}}</view>
</view>
<view class="card-item">
<view class="card-label m-b-8">服务商收入/年</view>
<view class="card-value">{{filter.formatValue(countData.serviceIncomeCount)}}</view>
</view>
<view class="m-b-24" wx:if="{{formData.storeNumber > 1}}">
<view class="card-item ">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleValueAddCount)}}</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleStoreIncomeCount)}}</view>
</view>
<view class="card-item">
<view class="card-label m-b-8 gray">单店均值</view>
<view class="card-value card-single-value">{{filter.formatValue(countData.singleServiceIncomeCount)}}</view>
</view>
</view>
</view>
</view>
<block wx:if="{{formData.storeNumber == 1}}">
<view class="card-box" wx:for="{{checkList}}" wx:for-item="m" wx:key="i" wx:for-index="i">
<view class="card-title">
<view class="card-left">
{{m.parentName}}
<view class="card-product"> {{m.tips}} {{m.name}}</view>
</view>
<view class="card-edit" data-item="{{m}}" data-index="{{i}}" bindtap="toEdit">
<image class="icon-edit" webp src="{{IMGURL}}measure/icon-edit.png?v={{img_version}}"></image>
编辑
</view>
</view>
<view class="card-content">
<view class="card-item">
<view class="card-label gray m-b-4">基盘客户数</view>
<view class="card-value gray value-number">{{filter.formatValue(m.baseCustomersNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">转化率</view>
<view class="card-value color value-number">{{filter.decimalFormat(m.rate)}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">客单均价</view>
<view class="card-value color value-number">{{m.averagePrice}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">增量产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(m.valueAddNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">流量成本</view>
<view class="card-value normal value-number">{{m.flowCost * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">4S店收入/年</view>
<view class="card-value normal value-number">{{filter.formatValue(m.storeIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商分润比例</view>
<view class="card-value normal">{{m.serviceDividendRatio * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-4">服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(m.serviceIncomeNumber)}}</view>
</view>
</view>
</view>
</block>
<block wx:else>
<view class="card-box" wx:for="{{checkList}}" wx:for-item="n" wx:key="j" wx:for-index="j">
<view class="card-title">
<view class="card-left">
{{n.parentName}}
<view class="card-product"> {{n.tips}} {{n.name}}</view>
</view>
<view class="card-edit" data-item="{{n}}" data-index="{{j}}" bindtap="toEdit">
<image class="icon-edit" webp src="{{IMGURL}}measure/icon-edit.png?v={{img_version}}"></image>
编辑
</view>
</view>
<view class="card-content">
<view class="card-item">
<view class="card-label gray m-b-8">基盘客户数</view>
<view class="card-value gray value-number">{{filter.formatValue(n.baseCustomersNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">转化率</view>
<view class="card-value color value-number">{{filter.decimalFormat(n.rate)}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">客单均价</view>
<view class="card-value color value-number">{{n.averagePrice}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">增量产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(n.valueAddNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店产值/年</view>
<view class="card-value normal value-number">{{filter.formatValue(n.singleValueAddNumber)}}</view>
</view>
<view>
<view class="card-item">
<view class="card-label gray m-b-8">流量成本</view>
<view class="card-value normal value-number">{{n.flowCost * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">4S店收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.storeIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.singleStoreIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商分润比例</view>
<view class="card-value normal value-number">{{n.serviceDividendRatio * 100}}%</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.serviceIncomeNumber)}}</view>
</view>
<view class="card-item">
<view class="card-label gray m-b-8">单店服务商收入/年</view>
<view class="card-value normal">{{filter.formatValue(n.singleServiceIncomeNumber)}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<!-- 测算弹窗 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view hidden="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view hidden="{{!isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
<!-- <view class="dialog-title">输入您门店的基本情况</view> -->
<view class="dialog-form">
<view class="form-item">
<view class="form-label">转化率</view>
<view class="input-box">
<input class="form-input" bindfocus="focus" bindinput="handleInput" maxlength="8" data-name="rate" value="{{dialogData.rate}}" type="number" />
<view class="form-unit">%</view>
</view>
</view>
<view class="form-item">
<view class="form-label">客均单价</view>
<view class="input-box">
<input class="form-input" bindfocus="focus" maxlength="6" data-name="averagePrice" bindinput="handleInput" type="number" value="{{dialogData.averagePrice}}" />
<view class="form-unit">元</view>
</view>
</view>
</view>
</view>
</form>
</view>
</view>
<wxs module="filter">
function formatValue(value) {
var val = value
if (typeof value == 'number') {
val = value.toString()
}
if (val.length > 8 ) {
return (val / 100000000).toFixed(0) + '亿'
} else if (val.length > 7) {
return (val / 10000).toFixed(0) + '万'
} else {
return val
}
// console.log(value, typeof value, value.toString().length, value.toString().length >= 8 ? (value / 10000).toFixed(0) + '万' : value)
// return value.toString().length >= 8 ? (value / 10000).toFixed(0) + '万' : value
}
function decimalFormat(value) {
return (value * 100).toFixed(2)
}
module.exports.formatValue = formatValue
module.exports.decimalFormat = decimalFormat
</wxs>
\ No newline at end of file
/* pages/measureResult/measureResult.wxss */
.wrapper {
padding-bottom: 90rpx;
}
.header-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
.banner1 {
height: 400rpx;
}
.wrapper-header {
padding: 48rpx 32rpx;
}
.store-number {
position: relative;
font-weight: 600;
font-size: 34rpx;
color: #2D2D2E;
}
.store-number::after {
content: '';
display: inline-block;
position: absolute;
left: 0;
bottom: -24rpx;
width: 48rpx;
height: 6rpx;
background-color: #F5A623;
}
.header-box {
margin-top: 62rpx;
}
.card-item {
display: inline-block;
width: calc(100%/3);
}
.card-label {
font-weight: 400;
font-size: 24rpx;
color: #2D2D33;
line-height: 36rpx;
}
.card-value {
font-weight: 700;
font-size: 40rpx;
color: #FFA034;
line-height: 48rpx;
}
.m-b-8 {
margin-bottom: 8rpx;
}
.m-b-4 {
margin-bottom: 4rpx;
}
.m-b-24 {
margin-top: 24rpx;
}
.card-box {
background: #FFFFFF;
box-shadow: 0 4rpx 24rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
margin: 0 24rpx 20rpx;
}
.card-title {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
line-height: 48rpx;
padding: 24rpx 32rpx;
border-bottom: 1rpx solid #F0F1F5;
}
.card-product {
display: inline-block;
font-weight: 400;
font-size: 28rpx;
color: #333333;
margin-left: 15rpx;
}
.card-edit {
display: flex;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #5850FF;
}
.icon-edit {
width: 28rpx;
height: 28rpx;
}
.card-content {
padding: 23rpx 32rpx 32rpx;
}
.value-number {
margin-bottom: 32rpx;
}
.card-label.gray {
color: #6E6E7A;
font-weight: 400;
}
.card-value.gray {
font-size: 32rpx;
color: #6E6E7A;
font-weight: 400;
}
.card-value.card-single-value {
font-size: 32rpx;
color: #1B233D;
font-weight: 400;
}
.card-value.color {
color: #5850FF;
font-weight: 400;
font-size: 32rpx;
}
.card-value.normal {
color: #2D2D33;
font-weight: 400;
font-size: 32rpx;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(45,45,51,0.50);
}
.dialog-box {
position: fixed;
bottom: 0;
width: 100%;
height: 540rpx;
background-color: #fff;
box-shadow: 0 -8rpx 20rpx 0 rgba(180,186,204,0.32);
border-radius: 32rpx 32rpx 0 0;
}
.dialog-header {
display: flex;
justify-content: space-between;
padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee;
}
.header-btn {
display: inline-block;
font-size: 32rpx;
line-height: 48rpx;
}
.btn-gray {
color: #6C737A;
}
.btn-primary {
background-color: #fff;
border: none;
margin: 0;
padding: 0;
font-weight: 500;
color: #5850FF;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
margin-bottom: 24rpx;
}
.dialog-form {
width: 100%;
/* height: 384rpx; */
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 100%;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
}
.input-box {
position: relative;
/* margin-left: 64rpx; */
margin-right: 16rpx;
width: 446rpx;
}
.form-unit {
position: absolute;
right: -10rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #9E9EA8;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
line-height: 48rpx;
margin-top: 40rpx;
}
\ No newline at end of file
// pages/newEnergy/newEnergy.js
// import {
// trackData
// } from "../../utils/data";
import {
entmicroApi
} from "../../api/api"
import Util from "../../utils/util";
Page({
/**
* 页面的初始数据
*/
data: {
applyShow: false,
hasPhoneNumber: false
},
toSuccess() {
wx.$router.go("applySuccess");
},
// 展开申请
toApply() {
this.setData({
applyShow: !this.data.applyShow
})
this.selectComponent('#applyForm').setPhone(Util.getUserInfo().phone)
this.goBottom()
},
// 授权手机号
updatePhoneNumber(e) {
console.log(e);
if (e.detail) {
this.setData({
applyShow: !this.data.applyShow,
});
this.selectComponent('#applyForm').setPhone(e.detail)
}
},
// 提交申请
submitApply() {
wx.$util.showLoading('提交中...')
let validFlag = this.selectComponent('#applyForm').validateForm()
if (!validFlag[0]) return
let params = JSON.parse(JSON.stringify(validFlag[0]))
let applyType = validFlag[1]
// 区分代理商和门店
params.merchantName = applyType == 0 ? params.merchantName + '(新能源-门店)' : params.merchantName + '(新能源-代理商)'
params.cardId = wx.$util.getStorageSync("scene").cardId
params.merchant = wx.$util.getStorageSync("scene").merchant || wx.$util.getStorageSync("scene").merchantId
params.openId = wx.$util.getStorageSync('aicard_info').openId
params.unionId = wx.$util.getStorageSync('aicard_info').unionId
console.log(params);
entmicroApi.activityApply(params).then(({
data,
code,
message
}) => {
if (code == 0) {
wx.hideLoading()
wx.showToast({
msg: '提交成功'
})
wx.$router.go("applySuccess");
} else {
wx.hideLoading()
wx.showToast({
title: message,
icon: 'none',
})
}
})
},
getPhone() {
console.log(Util.getUserInfo())
if (Util.getUserInfo() && Util.getUserInfo().phone) {
this.setData({
hasPhoneNumber: true
});
}
},
// 跳到页面底部
goBottom() {
console.log(111);
wx.createSelectorQuery().select('#wrapperBox').boundingClientRect(function(rect){
console.log('rectheight',rect.height);
/* 将页面移动到最底部(用xxx的height定位) */
wx.pageScrollTo({
scrollTop: rect.height
})
}).exec()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getPhone()
wx.hideShareMenu({
menus: ['shareAppMessage', 'shareTimeline']
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// const options = wx.getEnterOptionsSync()
// if (options.query.cardId) {
// wx.$trackData = options.query
// }
// getApp()
// .login()
// .then(({
// data
// }) => {
// if (!wx.$trackData.detailShare) {
// wx.$Track.sendTrack(trackData.NEWENERGY);
// }
// });
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
\ No newline at end of file
{
"usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply",
"phone-number": "../../components/PhoneNumber/PhoneNumber"
},
"navigationBarTitleText": "数字化+新能源汽车"
}
\ No newline at end of file
<!-- pages/newEnergy/newEnergy.wxml -->
<view id="wrapperBox" class="wrapper-bg">
<image class="newenergy-img newenergy-img1" mode="widthFix" webp src="{{IMGURL}}home/newenergy1.png?v={{img_version}}"></image>
<image class="newenergy-img newenergy-img2" mode="widthFix" webp src="{{IMGURL}}home/newenergy2.png?v={{img_version}}"></image>
<image class="newenergy-img newenergy-img3" mode="widthFix" webp src="{{IMGURL}}home/newenergy3.png?v={{img_version}}"></image>
<!-- 申请表单 -->
<view class="apply-box" wx:if="{{applyShow}}">
<image class="apply-bg" mode="widthFix" webp src="{{IMGURL}}home/apply_bg.png?v={{img_version}}"></image>
<view>
<apply-content id="applyForm" class="apply-content"></apply-content>
<button class="btn-apply submit-btn" bindtap="submitApply">提交申请</button>
</view>
</view>
</view>
<view class="btn-box" wx:if="{{!applyShow}}">
<phone-number wx:if="{{!hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber" showIcon="{{false}}" phoneText="合作申请"></phone-number>
<button wx:else class="btn-apply" bindtap="toApply">合作申请</button>
</view>
\ No newline at end of file
/* pages/newEnergy/newEnergy.wxss */
.wrapper-bg {
background-color: #505CFF;
padding-bottom: 110rpx;
}
.newenergy-img {
width: 100%;
margin-top: 24rpx;
}
.newenergy-img1 {
height: 816rpx;
}
.newenergy-img2 {
height: 1696rpx;
}
.newenergy-img3 {
height: 1092rpx;
}
.btn-box {
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
background: #FFFFFF;
box-shadow: 0 -4rpx 8rpx 0 rgba(196,199,204,0.20);
}
.btn-apply {
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: 15rpx 48rpx;
}
.apply-box {
position: relative;
}
.apply-bg {
width: 100%;
height: 844rpx;
}
.apply-content {
position: absolute;
top: 112rpx;
left: 27rpx;
width: 700rpx;
}
.submit-btn {
position: absolute;
bottom: 48rpx;
width: 654rpx;
}
\ No newline at end of file
// pages/productDetail/ambientLighting/ambientLighting.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -14,7 +14,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.LIGHT.pageName,
path: 'pages/productDetail/ambientLighting/ambientLighting?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.LIGHT.pageName
}
this.shareTrack('LIGHT', 'ambientLighting')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.LIGHT.pageName,
// path: 'pages/productDetail/ambientLighting/ambientLighting?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.LIGHT.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/arNavigation/arNavigation.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.ARNAVIGATION.pageName,
path: 'pages/productDetail/arNavigation/arNavigation?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.ARNAVIGATION.pageName
}
this.shareTrack('ARNAVIGATION', 'arNavigation')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.ARNAVIGATION.pageName,
// path: 'pages/productDetail/arNavigation/arNavigation?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.ARNAVIGATION.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/carBeauty/carBeauty.js
import { trackData } from "../../../utils/data";
import util from "../../../utils/util";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -58,11 +59,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.CARBEAUTY.pageName,
path:
"pages/productDetail/carBeauty/carBeauty?cardId=" +
util.getStorageSync("scene").cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.CARBEAUTY.pageName
};
this.shareTrack('CARBEAUTY', 'carBeauty')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.CARBEAUTY.pageName,
// path:
// "pages/productDetail/carBeauty/carBeauty?cardId=" +
// util.getStorageSync("scene").cardId+"&merchant="+merchant+'&detailShare=' +trackData.CARBEAUTY.pageName
// };
},
});
// pages/productDetail/changingFilm/changingFilm.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.CHANGEFILM.pageName,
path: 'pages/productDetail/changingFilm/changingFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.CHANGEFILM.pageName
}
this.shareTrack('CHANGEFILM', 'changingFilm')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.CHANGEFILM.pageName,
// path: 'pages/productDetail/changingFilm/changingFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.CHANGEFILM.pageName
// }
}
})
\ No newline at end of file
......@@ -2,9 +2,9 @@
import {
trackData
} from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -29,6 +29,7 @@ Page({
*/
onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
......@@ -75,9 +76,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.EQUITYCARD.pageName,
path: 'pages/productDetail/equity/equity?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.EQUITYCARD.pageName
}
this.shareTrack('EQUITYCARD', 'equity')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.EQUITYCARD.pageName,
// path: 'pages/productDetail/equity/equity?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.EQUITYCARD.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/lossPhase/lossPhase.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.LOSSPGASE.pageName,
path: 'pages/productDetail/lossPhase/lossPhase?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.LOSSPGASE.pageName
}
this.shareTrack('LOSSPGASE', 'lossPhase')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.LOSSPGASE.pageName,
// path: 'pages/productDetail/lossPhase/lossPhase?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.LOSSPGASE.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/navigationArround/navigationArround.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.NAVIGATIONARROUND.pageName,
path: 'pages/productDetail/navigationArround/navigationArround?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.NAVIGATIONARROUND.pageName
}
this.shareTrack('NAVIGATIONARROUND', 'navigationArround')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.NAVIGATIONARROUND.pageName,
// path: 'pages/productDetail/navigationArround/navigationArround?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.NAVIGATIONARROUND.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/paintProtect/paintProtect.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.PAINTPROTECT.pageName,
path: 'pages/productDetail/paintProtect/paintProtect?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.PAINTPROTECT.pageName
}
this.shareTrack('PAINTPROTECT', 'paintProtect')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.PAINTPROTECT.pageName,
// path: 'pages/productDetail/paintProtect/paintProtect?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.PAINTPROTECT.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/seatVentilate/seatVentilate.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -73,9 +73,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: trackData.SEATVENTILATE.pageName,
path: 'pages/productDetail/seatVentilate/seatVentilate?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.SEATVENTILATE.pageName
}
this.shareTrack('SEATVENTILATE', 'seatVentilate')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.SEATVENTILATE.pageName,
// path: 'pages/productDetail/seatVentilate/seatVentilate?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.SEATVENTILATE.pageName
// }
}
})
\ No newline at end of file
// pages/productDetail/solarFilm/solarFilm.js
import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
......@@ -75,10 +75,11 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
console.log(util.getStorageSync('scene'))
return {
title: trackData.SOLARFILM.pageName,
path: 'pages/productDetail/solarFilm/solarFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.SOLARFILM.pageName
}
this.shareTrack('SOLARFILM', 'solarFilm')
// let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
// return {
// title: trackData.SOLARFILM.pageName,
// path: 'pages/productDetail/solarFilm/solarFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.SOLARFILM.pageName
// }
}
})
\ No newline at end of file
// pages/tab/discovery/components/product/product.js
// import {imgUrlMixin} from '~/mixins/index'
// import { IMG_URL } from "~/utils/constantData.js";
// import USERAPI from "~/api/usersApi/index";
const videoBaseUrl =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/";
let IMG_URL = wx.$imgUrl
import { trackData } from "../../../../utils/data";
Component({
// behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
properties: {
stickyTop: Number,
actNum: Number,
wrapactiveNavIdx: Number,
senceData: Object, //本地数据
apiData: Object, //后端接口数据
isShare: {
type: Boolean,
value: false,
},
origin: String, //来源
outshowVideo: {
type: Boolean,
value: true,
}, //显示视频列表
isAuthphone: Boolean,
isShow: {
type: Boolean,
// value: false,
},
},
/**
* 组件的初始数据
*/
data: {
navList: ["360全景导航", "AR实景导航", "座椅通风", "氛围灯", "数字化美容"],
activeNavIdx: 0,
tab: [
"场景说明",
"营销链路",
"项目亮点",
"转化漏斗",
"合作流程",
// "案例视频",
],
heightArr: [],
allHeight: 0,
curTabIdx: 0,
intoViewId: "to-0",
IMGURL: `${IMG_URL}index/`,
videoBaseUrl,
getMoreBtn: false,
showVideo: true, //显示视频列表
imgTopArr: [],
trackList: [
['EQUITYCARD'],
['SOLARFILM'],
['PAINTPROTECT', 'CHANGEFILM'],
['CARBEAUTY', 'SEATVENTILATE', 'ARNAVIGATION', 'LIGHT', 'NAVIGATIONARROUND'],
['LOSSPGASE']
]
},
lifetimes: {
ready: function () {
this.init();
this.getImgHeight();
console.log("ready");
// //获取当前路径
// let currentUrl = this.getCurrentPageUrl()
// // console.log('currentUrl: ', currentUrl);
// if(currentUrl == '/pages/tab/index/index'){
// this.setData({
// currentUrl:false
// })
// }else{
// let {isShare} = this.data
// console.log(isShare,'isShare')
// if(isShare){
// this.setData({
// currentUrl:false
// })
// }else{
// this.setData({
// currentUrl:true
// })
// }
// }
//监听页面滚动的距离
wx.$eventbus.on("evt_page_scroll", async (e) => {
// console.log(e)
// let heightTop = this.data.stickyTop// 90 场景高度,8 场景margin-bottom
// let prodArr = await this.getHeight('.prod-wrap')
// // console.log('prodArr: ', prodArr);
// heightTop += prodArr[0].height
// let imgArr = await this.getHeight('.img-item')
// // console.log('imgArr: ', imgArr);
// let imgHeightArr = []
// imgArr.reduce((pre,cur,index)=>{
// imgHeightArr.push(pre+cur.height)
// return pre+cur.height
// },heightTop)
let imgTopArr = this.data.imgTopArr;
// console.log('imgTopArr: ', imgTopArr);
if (imgTopArr.length == 0) return;
wx.nextTick(() => {
let idx = imgTopArr.findIndex((item) => item > e.scrollTop);
if (idx > -1) {
this.setData({
curTabIdx: idx,
});
}
});
});
if (!this.data.outshowVideo) {
this.setData({
showVideo: false,
});
}
//如果不是分享,初始化的时候调用函数
if (!this.data.isShare) {
// console.log(131546)
this.getMoreFn();
}
},
},
observers: {
actNum: function (newval, oldval) {
let navList;
let tab = [
"场景说明",
"营销链路",
"项目亮点",
"转化漏斗",
"合作流程",
// "案例视频",
];
let num = this.data.actNum;
console.log(num)
switch (num) {
case 0:
navList = ["数字无忧权益卡"];
break;
case 1:
navList = ["汽车太阳膜"];
break;
case 2:
navList = ["漆面保护膜", "改色膜"];
break;
case 3:
navList = [
"数字化美容",
"座椅通风",
"AR导航",
"氛围灯",
"360全景导航",
];
break;
case 4:
navList = ["新能源0元换购"];
break;
}
this.setData({
navList,
tab,
intoViewId: `to-0`,
activeNavIdx: 0,
});
// 每次切换场景,重新获取流程图高度
this.getImgHeight();
this.getMoreFn();
// this
if (this.data.wrapactiveNavIdx) {
this.setData({
activeNavIdx: this.data.wrapactiveNavIdx,
});
}
},
// isShow: function (newval) {
// let { isShare } = this.data;
// if (newval && !isShare) {
// this.setData({
// currentUrl: true,
// });
// }
// },
},
/**
* 组件的方法列表
*/
methods: {
getCurrentPageUrl() {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const url = `/${currentPage.route}`;
return url;
},
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin();
if (code == "0") {
this.loginToken = data;
}
wx.hideLoading();
} catch ({ errMsg }) {
console.error(errMsg);
// this.reLogin();
}
},
/**获取loginToken */
// reLogin(message) {
// wx.showModal({
// content: message || "获取loginToken失败",
// confirmText: "重试",
// confirmColor: "#3666FE",
// }).then(({ confirm }) => {
// if (confirm) this.init();
// });
// },
// 视频下载
downVideo(e) {
let { url } = e.target.dataset;
console.log(url);
wx.showToast({
title:"正在下载视频..."
});
wx.downloadFile({
url: url,
success(res) {
// console.log(res,111)
if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success(res) {
setTimeout(() => {
wx.showToast({
title:"下载成功!"
});
}, 2000);
},
});
}
},
});
},
saleTextChange(e) {},
changeTab(e) {
let idx = e.detail;
let { imgTopArr, stickyTop } = this.data;
console.log("idx: ", imgTopArr[idx], stickyTop);
// this.setData({
// intoViewId: `to-${idx}`,
// });
// wx.$eventbus.emit('evt_page_index',idx)
//判断当前路径
// let currentUrl = this.getCurrentPageUrl();
// console.log('currentUrl: ', currentUrl);
// if (currentUrl == "/pages/tab/index/index") {
// console.log(123546)
// wx.pageScrollTo({ scrollTop: imgTopArr[idx] - stickyTop + 88 + 34 });
// // wx.pageScrollTo({ scrollTop: imgTopArr[idx] - stickyTop });
// } else {
// -10 处理兼容
wx.pageScrollTo({ scrollTop: imgTopArr[idx]- stickyTop/2 - 36 - 10 });
// }
},
// async changeTab(e){
// let idx = e.detail
// this.setData({
// intoViewId: `to-${idx}`
// })
// let heightTop = this.data.headerHeight + 90 - 16 - 46 // 90 场景高度,16 可能是误差 , 46 tab高度
// let prodArr = await this.getHeight('.prod-wrap')
// heightTop += prodArr[0].height
// let imgArr = await this.getHeight('.img-item')
// for(let i=0;i<idx;i++){
// heightTop += imgArr[i].height
// }
// wx.pageScrollTo({
// scrollTop: heightTop,
// duration: 0
// })
// },
getHeight(cla) {
return new Promise((resolve, reject) => {
let query = wx.createSelectorQuery().in(this);
query
.selectAll(cla)
.boundingClientRect((rect) => {
resolve(rect);
})
.exec();
});
},
changeNav(event) {
const index = event.target.dataset.index
this.setData({
activeNavIdx: index,
});
const trackName = this.data.trackList[this.data.actNum][index]
console.log(trackName)
wx.$Track.sendTrack(trackData[trackName]);
},
// scrolltoupper(event) {
// console.log(event.detail.scrollHeight,event.detail.scrollTop)
// const idx = this.data.heightArr.findIndex(
// (item) => item > event.detail.scrollHeight
// );
// console.log('idx',idx)
// this.setData({
// curTabIdx: idx,
// });
// // console.log(this.data.curTabIdx1)
// },
getImgHeight() {
let query = wx.createSelectorQuery().in(this);
let heightArr = [];
let imgTopArr = [];
let s = 0;
let top;
let _this = this;
query
.selectAll(".img-item")
.boundingClientRect((react) => {
react.forEach((item, index) => {
// console.log('item: ', item);
// if(index == 0){
// console.log('item top: ', item);
// top = item.top
// }
// s = s +item.height;
s = item.top;
// heightArr.push(s);
imgTopArr.push(s);
});
// heightArr = heightArr.map((item)=>{
// item += top
// return item
// })
// this.data.heightArr = heightArr;
// // console.log(heightArr[heightArr.length-1])
// this.data.allHeight = heightArr[heightArr.length - 1];
// console.log('imgTopArr',imgTopArr)
_this.setData({
imgTopArr,
});
})
.exec();
},
// 获取用户信息
getUserInfo({ detail }) {
// console.log(detail);
if (!detail.code) return;
// this.setBtnLoading()
USERAPI.getUserProfile(this.loginToken, detail)
.then((result) => {
// console.log(result)
let userInfo = wx.$storage.get("wx_user_info");
// console.log('userInfo: ', userInfo);
let { phone } = result;
// console.log('phone: ', phone);
wx.$storage.set("wx_user_info", { ...userInfo, phone });
// }
setTimeout(() => {
this.triggerEvent("authorized", {
phone,
// isShare: false,
});
}, 1e3);
//隐藏更多按钮,显示视频列表
this.setData({
getMoreBtn: true,
isShare: false,
outshowVideo: true,
});
this.getMoreFn();
})
.catch(({ errMsg }) => {
wx.showToast({
title:errMsg || "系统异常"
});
// this.setBtnLoading(false)
});
},
// 图片流程5 点击往下获取更多
// 没登陆用户(登陆后解锁全部)
getMoreFn() {
let { actNum } = this.data;
// console.log("inactNumdex: ", actNum);
let tab = [
"场景说明",
"营销链路",
"项目亮点",
"转化漏斗",
"合作流程",
// "案例视频",
];
switch (actNum) {
case 0:
tab.push("案例视频");
break;
case 1:
tab.push("案例视频");
break;
case 2:
break;
case 3:
tab.push("案例视频");
break;
}
this.setData({
tab,
});
},
onShareFn() {
// this.triggerEvent('sharehandle')
// wx.$router.go('apply',1235)
let { actNum, activeNavIdx, apiData } = this.data;
console.log(123456)
wx.$router.go("checkProduct", {
actNum,
activeNavIdx,
apiData,
outshowVideo: true,
isShow:true
// origin:'home' //跟首页类似情况
// isShare: true
});
},
},
});
{
"component": true,
"usingComponents": {
"tab": "../../../../components/Tab/Tab"
}
}
\ No newline at end of file
// 特色产品
.prod-wrap {
background-color: #f8fafb;
border-radius: 20rpx 20rpx 0 0;
}
.prod-wrap .big-title {
margin-left: 32rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 32rpx;
color: #323436;
padding-top: 32rpx;
}
.prod-wrap .nav-wrap {
white-space: nowrap;
box-sizing: border-box;
margin-top: 28rpx;
margin-bottom: 16rpx;
padding-left: 32rpx;
padding-right: 32rpx;
}
.prod-wrap .nav-wrap .nav {
display: inline-block;
height: 64rpx;
border-radius: 4rpx;
font-size: 24rpx;
letter-spacing: 0;
text-align: center;
font-family: PingFangSC-Regular;
line-height: 64rpx;
margin-right: 16rpx;
background: #ffffff;
border: 2rpx solid #DDE3F0;
color: #323436;
padding: 0 16rpx;
}
.prod-wrap .nav-wrap .active-nav {
color: #ffffff;
font-weight: 500;
// background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%);
background-color: var(--btnColor);
border: 0rpx solid;
// border: 2rpx solid rgba(68,97,240,0.50);
// box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35);
}
.prod-wrap .nav-wrap .nav:last-child {
margin-right: 0;
}
.prod-item {
padding: 0 32rpx 32rpx;
margin: 16rpx auto 0;
background-color: #f5f7fb;
border-radius: 48rpx 48rpx 0 0;
}
.prod-card {
display: flex;
height: 208rpx;
background-image: linear-gradient(1deg, #ffffff 10%, #fdfcff 100%);
border: 2rpx solid #ffffff;
box-shadow: 0 8rpx 20rpx 0 rgba(197, 205, 235, 0.35);
border-radius: 8rpx;
padding: 20rpx 24rpx;
box-sizing: border-box;
position: relative;
}
.prod-card .card-img {
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc {
position: absolute;
width: 104rpx;
height: 40rpx;
line-height: 40rpx;
background: #d7f5eb;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #24b38c;
letter-spacing: 0;
text-align: center;
}
.prod-info {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info>text {
display: block;
white-space: nowrap;
height: 40rpx;
line-height: 40rpx;
}
.prod-info .title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #323436;
}
.prod-info .sale,
.prod-info .earnings {
font-size: 26rpx;
color: #7a8299;
}
.prod-info .sale-num {
font-size: 26rpx;
color: #323436;
}
.prod-info .earnings-num {
font-size: 28rpx;
// font-family: DINAlternate-Bold;
font-weight: Bold;
color: #f35251;
}
.share-btn {
height: 56rpx;
line-height: 56rpx;
width: 124rpx;
background: #3666FE;
border-radius: 28rpx;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
}
.share-btn .icon {
width: 32rpx;
height: 32rpx;
margin-right: 2rpx;
}
.project-wrap {
background-color: #f5f7fb;
}
.project-img {
// height: 1600rpx;
// white-space: nowrap;
.img-item {
position: relative;
}
.more-btn {
position: absolute;
left: 50%;
bottom: 50px;
transform: translateX(-50%);
width: 311px;
height: 48px;
background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/btn.png");
background-size: 100% 100%;
font-weight: 500;
font-size: 16px;
color: #ffffff;
text-align: center;
line-height: 64rpx;
}
}
.stickyTab {
position: sticky;
z-index: 2;
background-color: #f5f7fb;
}
// .out-tab{
// .out-text {
// // color: red !important;
// }
// .out-text{
// color:red;
// }
// .out-line{
// }
// }
// 流程图一
.img-item11 {
width: 100%;
height: 1110rpx;
}
.img-item12 {
width: 100%;
height: 1290rpx;
}
.img-item13 {
width: 100%;
height: 596rpx;
}
.img-item14 {
width: 100%;
height: 744rpx;
}
.img-item15 {
width: 100%;
height: 490rpx;
}
.img-item16 {
width: 100%;
height: 1532rpx;
}
// 流程图二
.img-item21 {
width: 100%;
height: 2168rpx;
}
.img-item22 {
width: 100%;
height: 1290rpx;
}
.img-item23 {
width: 100%;
height: 596rpx;
}
.img-item24 {
width: 100%;
height: 830rpx;
}
.img-item25 {
width: 100%;
height: 490rpx;
}
.img-item26 {
height: 752rpx;
.video-item {
width: 100%;
video {
border-radius: 16rpx;
height: 348rpx;
}
}
}
// 流程图三
.img-item31 {
width: 100%;
height: 1110rpx;
}
.img-item32 {
width: 100%;
height: 1290rpx;
}
.img-item33 {
width: 100%;
height: 596rpx;
}
.img-item34 {
width: 100%;
height: 984rpx;
}
.img-item35 {
width: 100%;
height: 490rpx;
}
// .img-item26 {
// width: 100%;
// height: 752rpx;
// }
// 流程图四
.img-item41 {
width: 100%;
height: 678rpx;
}
.img-item42 {
width: 100%;
height: 1266rpx;
}
.img-item43 {
width: 100%;
height: 1398rpx;
}
.img-item44 {
width: 100%;
height: 830rpx;
}
.img-item45 {
width: 100%;
height: 490rpx;
}
.img-item46 {
width: 100%;
height: 1666rpx;
}
// 流程图5
.img-item51 {
width: 100%;
height: 814rpx;
}
.img-item52 {
width: 100%;
height: 998rpx;
}
.img-item53 {
width: 100%;
height: 596rpx;
}
.img-item54 {
width: 100%;
height: 984rpx;
}
.img-item55 {
width: 100%;
height: 490rpx;
}
/* 案例视频 */
.video-bg {
width: 100%;
position: absolute;
top: 280rpx;
}
.video-title {
position: relative;
padding: 96rpx 0 24rpx;
text-align: center;
font-size: 48rpx;
font-weight: 900;
color: #FFFFFF;
letter-spacing: 0;
line-height: 64rpx;
}
.video-title::after {
content: '';
display: block;
width: 48rpx;
height: 4rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: #ffffff;
}
.video-list {
display: flex;
flex-wrap: wrap;
padding: 0rpx 32rpx;
font-size: 0;
}
.check-prod .img-item {
&:last-child{
margin-bottom: 148rpx;
}
}
.video-item {
position: relative;
width: calc(50% - 12rpx);
margin-bottom: 32rpx;
}
.video-item video {
width: 100%;
height: 590rpx;
// border: 1rpx dashed #AFB0B2;
}
.video-item .download {
position: absolute;
top: 0;
right: 2px;
font-size: 26rpx;
color: #666;
z-index: 1;
}
.video-item:nth-child(even) {
margin-left: 22rpx;
}
.video-text {
margin-top: 16rpx;
font-size: 24rpx;
font-weight: 500;
font-size: 24rpx;
color: #343456;
}
.video-tips {
width: 100%;
text-align: center;
font-size: 28rpx;
color: rgba(255, 255, 255, .6);
padding: 16rpx 0 92rpx;
}
\ No newline at end of file
<!-- pages/tab/discovery/components/product/product.wxml -->
<view class="prod-wrap" >
<view class="big-title">特色产品</view>
<scroll-view class="nav-wrap" scroll-x="{{true}}" wx:if="{{!isShare && origin =='home'}}">
<block wx:for="{{navList}}" wx:key="index">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
</block>
</scroll-view>
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<!-- <text class="img-desc">轻改类</text>
<image src="{{IMGURL}}discovery_prod1.png" /> -->
<image src="{{IMGURL}}prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
<view class="prod-info">
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<!-- senceData[actNum]['productList'][activeNavIdx].changeSale || -->
<text class="sale" wx:if="{{ actNum!=4}}" decode="{{true}}">{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;<text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}</text>
</text>
<text class="earnings" wx:if="{{ actNum!=4}}" decode="{{true}}">预估收益&nbsp;<text class="earnings-num">¥{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text>
</view>
<view class="share-btn" wx:if="{{!isShare && origin =='home' && actNum!=4}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text>
</view>
</view>
</view>
</view>
<view class="project-wrap">
<!-- stickyTop+88 -->
<view class="stickyTab" style="top:{{isShare ? stickyTop : stickyTop}}rpx">
<tab
outClassName="project-tab"
openScroll="{{true}}"
tab="{{tab}}"
index="{{curTabIdx}}"
bindclick="changeTab"
productHeight
/>
</view>
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<!-- <scroll-view
class="project-img"
scroll-into-view="{{intoViewId}}"
> -->
<view class="project-img" hover-class="none" hover-stop-propagation="false">
<block wx:for="{{tab}}" wx:key="index">
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index != 5}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item">
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<view class="video-text">{{item.name}}</view>
</view>
</block>
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
</view>
</view>
<!-- wx:if="{{ actNum != 2 && index == 4}}" -->
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<!-- <button
wx:if="{{ isShare && isAuthphone && !getMoreBtn && actNum != 2 && index == 4}}"
class="more-btn"
data-index="{{index}}"
bindgetphonenumber="getUserInfo"
open-type="getPhoneNumber"
>
点击查看更多详情
</button> -->
</view>
<!-- wx:if="{{index == 5 && outshowVideo}}" -->
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index == 5}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<!-- wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}" -->
<view class="video-bg">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item">
<view class="download" bindtap="downVideo" data-url="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}">视频下载</view>
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<view class="video-text">{{item.name}}</view>
</view>
</block>
</view>
</view>
</view>
</block>
</view>
<!-- </scroll-view> -->
</view>
// 1.视频默认进来是true,显示,
// 2.扫码,分享链接进来,不显示
// 3.点击更多详情,隐藏更多按钮,显示视频
// 4.视频的位置最后一个 下标5
// var showVideo = function(index){
// if(index == 5){
// a
// }
// };
// module.exports = {
// showVideo:showVideo
// }
// import { IMG_URL } from "~/utils/constantData.js";
let IMG_URL = wx.$imgUrl
var senceData = [
{
name: '新车洽谈场景',
img: 'scene_talk.png',
active: 'icon-car11',
playImg: 'img1',
src: `${IMG_URL}index/car1.png`,
// name: "新车洽谈场景",
msg: "1.0 新车权益销售",
"sceneCode":"SC001",
productList: [
{
img: 'product-img1',
proName: '数字无忧权益卡',
price: '100',
// profit: '92.4万',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale:100 ,//销量
varType: 0,
flow:10000,
"productCode":"PC001",
"productName":"数字无忧权益卡",
"category":"服务类",
}
],
videoList: [
{
videoUrl: 'digital_card_30s',
posterUrl: 'digital_card_30s_bitmap',
name: '数字无忧卡服务30秒'
},
{
videoUrl: 'digital_card_money3',
posterUrl: 'digital_card_money3_bitmap',
name: '数字无忧卡3道钱'
},
{
videoUrl: 'digital_card',
posterUrl: 'digital_card_bitmap',
name: '数字无忧卡服务'
},
{
videoUrl: 'digital_card_reason6',
posterUrl: 'digital_card_reason6_bitmap',
name: '数字无忧卡6大理由'
}
]
},
{
name: '新车交付场景',
img: 'scene_delivery.png',
active: 'icon-car21',
playImg: 'img2',
src: `${IMG_URL}index/car2.png`,
// name: "新车交付场景",
msg: "1.1 新车精品升级",
"sceneCode":"SC002",
productList: [
{
img: 'product-img2',
proName: '汽车太阳膜',
price: '100',
profit: '1008000',
type: 'membrane',
productType: 'sunMembrane',
path: 'solarFilm',
sale:100, //销量
varType: 0,
flow:10000,
"productCode":"PC002",
"productName":"汽车太阳膜",
"category":"膜类",
}
],
videoList:[
{
videoUrl: 'solar',
posterUrl: 'solar_bitmap',
name: '太阳膜转化售中案例-门店新增产值12w每月'
}
]
},
{
name: '0-12个月',
img: 'scene_within_12mth.png',
active: 'icon-car21',
playImg: 'img2',
src: `${IMG_URL}index/car3.png`,
// name: "0-12个月",
msg: "1.2 新车线上转化",
"sceneCode":"SC003",
productList: [
{
img: 'product-img3',
proName: '漆面保护膜',
price: '100',
profit: '180000',
type: 'membrane',
productType: 'protectMembrane',
path: 'paintProtect',
sale:100, //销量
varType: 0,
flow:10000,
"productCode":"PC003",
"productName":"漆面保护膜(车衣)",
"category":"膜类",
},
{
img: 'product-img4',
proName: '改色膜',
price: '100',
profit: '300000',
type: 'membrane',
productType: 'colorMembrane',
path: 'changingFilm',
sale:100, //销量
varType: 0,
flow:10000,
"productCode":"PC004",
"productName":"改色膜",
"category":"膜类",
}
]
},
{
name: '12个月以上',
img: 'scene_more_12mth.png',
active: 'icon-car31',
playImg: 'img3',
src: `${IMG_URL}index/car4.png`,
// name: "12个月以上",
msg: "1.3 存量用户众筹",
"sceneCode":"SC004",
productList: [
{
img: 'product-img5',
proName: '数字化美容',
price: '100',
profit: '72000',
type: 'beauty',
productType: 'digitBeauty',
path: 'carBeauty',
sale:100, //销量
varType: 0,
flow:10000,
"productCode":"PC005",
"productName":"数字化美容",
"category":"美容类",
},
{
img: 'product-img6',
proName: '座椅通风',
price: '10000',
profit: '232200',
type: 'light',
productType: 'chair',
path: 'seatVentilate',
sale:10000, //销量
varType: 1,
flow:10000,
"productCode":"PC006",
"productName":"座椅通风",
"category":"轻改类",
},
{
img: 'product-img7',
proName: 'AR导航',
price: '10000',
profit: '226800',
type: 'light',
productType: 'ar',
path: 'arNavigation',
sale:10000, //销量
varType: 1,
flow:10000,
"productCode":"PC007",
"productName":"AR导航",
"category":"轻改类",
},
{
img: 'product-img8',
proName: '氛围灯',
price: '10000',
profit: '361800',
type: 'light',
productType: 'lamp',
path: 'ambientLighting',
sale:10000, //销量
varType: 1,
flow:10000,
"productCode":"PC008",
"productName":"氛围灯",
"category":"轻改类",
},
{
img: 'product-img9',
proName: '360全景导航',
price: '10000',
profit: '388800',
type: 'service',
productType: 'navigation',
path: 'navigationArround',
sale:10000, //销量
varType: 1,
flow:10000,
"productCode":"PC009",
"productName":"360全景导航",
"category":"轻改类",
}
],
videoList: [
{
videoUrl: 'seat',
posterUrl: 'seat_bitmap',
name: '座椅通风系统-新增产值20w'
},
{
videoUrl: 'AR',
posterUrl: 'AR_bitmap',
name: '单品AR导航-新增产值20w+'
},
{
videoUrl: 'light',
posterUrl: 'light_bitmap',
name: '单品类氛围灯-新增产值27w'
},
{
videoUrl: '360_AR',
posterUrl: '360_AR_bitmap',
name: '360全景导航-新增产值57w+'
}
]
},
{
name: '3年以上',
img: 'scene_talk.png',
active: 'icon-car11',
playImg: 'img1',
src: `${IMG_URL}index/car1.png`,
// name: "新车洽谈场景",
msg: "3.1新能源0元购",
"sceneCode":"SC001",
productList: [
{
img: 'product-img9',
proName: '新能源0元换购',
price: '100',
// profit: '92.4万',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale:100 ,//销量
varType: 0,
flow:10000,
"productCode" : "PC010",
"productName" : "新能源0元换购",
"category":"置换类",
}
]
},
]
module.exports = {
senceData
}
\ No newline at end of file
const navStyle = "background-color: transparent;";
import util from "../../utils/util";
import { trackData } from "../../utils/data";
// import { IMG_URL } from '~/utils/constantData.js'
// wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
import { senceData } from "./constant/data";
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = "../../../images/";
// import { productBysceneApi, unreadApi, pageApi, readApi, tagApi } from '~/api/index.js'
let IMG_URL = wx.$imgUrl;
Page({
// behaviors: [kfMixin],
/**
* 页面的初始数据
*/
data: {
navStyle,
// IMGURL: wx.$imgUrl,
IMG_URL,
// IMG_URLLocal,
actClass: "right",
guideSrcIndex: 1,
guideShow: false,
dataArr: [
{
src: `${IMG_URL}index/car1.png`,
name: "新车洽谈场景",
msg: "1.0 新车权益销售",
},
{
src: `${IMG_URL}index/car2.png`,
name: "新车交付场景",
msg: "1.1 新车精品升级",
},
{
src: `${IMG_URL}index/car3.png`,
name: "0-12个月",
msg: "1.2 新车线上转化",
},
{
src: `${IMG_URL}index/car4.png`,
name: "12个月以上",
msg: "1.3 存量用户众筹",
},
],
apiData: [],
actNum: 3, //car 场景选择
wrapactiveNavIdx: 0, // 产品选择
tabIndx: 1,
navList: ["看线索", "看产品"],
typeList: [
{
0: "无电话",
1: "有电话",
2: "联系电话",
selectIndex: 2,
key: "hasPhone",
},
{
0: "非意向客户",
1: "是意向客户",
2: "意向客户",
selectIndex: 2,
key: "starTag",
},
{
0: "来自访客",
1: "来自门店",
2: "线索来源",
selectIndex: 2,
key: "clueSource",
},
{
2: "重置",
selectIndex: 2,
},
],
clueList: [],
// 预估弹框
visible: false,
isReset: false,
formData: {
sales: 100,
flow: 10000,
},
lastFormData: {
sales: 100,
flow: 10000,
},
isFirst: true,
// tabList: pageData.tabList,
// 定义数据
senceData,
isShow: false,
// 看线索部分
unreadClueCount: 0,
cluePageSize: 10,
clueCurrentPage: 1,
hasPhoneNumber: false,
trackList: [
['EQUITYCARD'],
['SOLARFILM'],
['PAINTPROTECT', 'CHANGEFILM'],
['CARBEAUTY', 'SEATVENTILATE', 'ARNAVIGATION', 'LIGHT', 'NAVIGATIONARROUND'],
['LOSSPGASE']
]
},
//引导图
guideFn() {
if (this.data.guideSrcIndex === 5) {
this.setData({
guideShow: false,
});
return;
}
this.setData({
guideSrcIndex: ++this.data.guideSrcIndex,
});
// console.log('guideSrcIndex',this.data.guideSrcIndex)
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail;
this.setData({
// tabBarStyle: height / 2 + statusBarHeight,
headerHeight: height / 2 + statusBarHeight + 88,
// headerHeight: height / 2 + statusBarHeight + 88 * 2
});
// console.log(e)
// console.log(this.data.headerHeight)
},
// headTabFn(e){
// // console.log("name",e.currentTarget.dataset.name)
// let name = e.currentTarget.dataset.name
// this.setData({
// actClass:name
// })
// },
// 选车场景切换
selectCar(e) {
console.log("e: ", e);
let { num, scenestatus } = e.currentTarget.dataset;
// console.log('actNum: ', actNum);
// if(scenestatus == 1){
// }
// 场景切换默认埋点第一个产品
const trackName = this.data.trackList[num][0]
wx.$Track.sendTrack(trackData[trackName]);
this.setData({
actNum: num,
});
},
// 头部看线索,产品切换
changeTabIndx(e) {
console.log("e.detail: ", e.detail);
let { sessionId } = wx.$storage.get();
// console.log("sessionId: ", sessionId);
let param = {
sessionId,
};
let first = true;
this.setData({
tabIndx: e.detail,
});
//标记线索已读
if (e.detail == 0 && first) {
first = false;
readApi(param);
}
},
gotoApply(e) {
let { type, item } = e.currentTarget.dataset;
// let { } = e.currentTarget.dataset
if (type == "active") {
let { userInfo } = wx.$storage.get();
let pMerchantName = userInfo.subLoginUser.merchantName;
let pMerchantId = userInfo.subLoginUser.merchantId;
let sceneActive;
switch (this.data.actNum) {
case 0:
sceneActive = 1;
break;
case 1:
sceneActive = 2;
break;
case 2:
sceneActive = 3;
break;
case 3:
sceneActive = 4;
break;
}
// let pMerchantId = userInfo.subLoginUser.merchantId
// console.log("type,item: ", type, item);
const params = {
merchantInfo: {
pMerchantId,
pMerchantName,
merchantId: item.visitList[0].merchantId,
merchantName: item.visitList[0].merchantName,
},
sceneActive,
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
};
//申请活动
wx.$router.go("packageOutput.openBusiness", params);
} else {
//申请门店
// let { type, item } = e.currentTarget.dataset
wx.$router.go("apply", item?.clueId || "");
}
// wx.$router.go('apply',1235)
},
getMore(e) {
console.log("显示更多数据");
let index = e.currentTarget.dataset.outidx;
console.log("index: ", index);
let completeStatus = `clueList[${index}].getMoreFlag`;
this.setData({
[completeStatus]: !this.data.clueList[index].getMoreFlag,
});
},
// 跳转咨询页面
goConsult() {
console.log("跳转到咨询页面");
wx.pro.openCustomerServiceChat({
extInfo: { url: "https://work.weixin.qq.com/kfid/kfcf7b721472201345e" },
corpId: "ww047bdc0f1e76cc13",
complete: (r) => {
console.log(r);
},
});
},
// 预估弹框
showCalculate() {
this.setData({
visible: !this.data.visible,
isReset: false,
});
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 471) {
this.setData({
visible: false,
isReset: false,
formData: this.data.lastFormData,
});
}
},
// 提交测算
submit(e) {
console.log(e);
let sales = e ? +e.detail.value.sales : this.data.formData.sales;
let flow = e ? +e.detail.value.flow : this.data.formData.flow;
console.log("flow", sales, flow);
const reg = /^[1-9]\d*$/;
console.log(reg.test(sales), flow, "---");
if (!reg.test(sales)) {
wx.showToast({
title: "门店月平均新车销量应为正整数",
icon: "none",
duration: 2000,
});
return;
}
if (!reg.test(flow)) {
wx.showToast({
title: "3年内售后存量用户应为正整数",
icon: "none",
duration: 2000,
});
return;
}
this.setData({
"lastFormData.sales": sales,
"lastFormData.flow": flow,
});
const _this = this;
// this.data.tabList.forEach((item, index) => {
// item.productList.forEach((i, lastIndex) => {
// if (i.profit) {
// let name = `tabList[${index}].productList[${lastIndex}].profit`;
// let profit = _this.formula(i.productType, sales, flow);
// console.log(name, profit);
// this.setData({
// [name]: profit,
// });
// }
// });
// });
this.data.senceData.forEach((item, index) => {
item.productList.forEach((i, lastIndex) => {
if (i.profit) {
let sale = `senceData[${index}].productList[${lastIndex}].sale`;
let name = `senceData[${index}].productList[${lastIndex}].profit`;
let flowKey = `senceData[${index}].productList[${lastIndex}].flow`;
let profit = _this.formula(i.productType, sales, flow);
console.log(name, profit);
this.setData({
[name]: profit,
[sale]: sales,
[flowKey]: flow,
});
}
});
});
// 触发自定义事件 利润 数量
// this.triggerEvent('countProfit', profit, sales)
// let type = this.getProductType(sceneIndex, tabIndex);
// let profit = this.formula(type, sales, flow);
// console.log('profit: ', profit);
this.setData({
visible: false,
});
// this.showCase();
// if (!this.data.isFirst) {
wx.showToast({
title: "测算结果已在页面内同步展示",
icon: "none",
duration: 2000,
});
// } else {
// this.setData({
// isFirst: false
// })
// }
},
// // 获取场景下的产品类型
// getProductType(sceneIndex, tabIndex) {
// let typeArray = [
// ["benefitCard"], //数字无忧权益卡
// ["sunMembrane"], //汽车太阳膜
// ["protectMembrane", "colorMembrane"], //'漆面保护膜','改色膜'
// ["digitBeauty", "chair", "ar", "lamp", "navigation"], //'数字化美容','座椅通风','AR导航','氛围灯','360全景导航'
// ];
// return typeArray[sceneIndex][tabIndex];
// },
// 计算公式,参数:productType
formula(productType, sales, flow) {
let profit = 0;
switch (productType) {
case "benefitCard":
// 数字无忧权益卡
profit = (sales * 0.5 * 2000 * 12).toFixed(0);
break;
case "sunMembrane":
// 汽车太阳膜
profit = (sales * 0.8 * 0.7 * 1500 * 12).toFixed(0);
break;
case "protectMembrane":
// 漆面保护膜
profit = (sales * 0.05 * 3000 * 12).toFixed(0);
break;
case "colorMembrane":
// 改色膜
profit = (sales * 0.05 * 5000 * 12).toFixed(0);
break;
case "digitBeauty":
// 数字化美容
profit = (sales * 0.2 * 300 * 12).toFixed(0);
break;
case "chair":
// 座椅通风
profit = (flow * 2580 * 0.9 * 0.01).toFixed(0);
break;
case "ar":
// AR导航
profit = (flow * 1680 * 0.9 * 0.015).toFixed(0);
break;
case "lamp":
// 氛围灯
profit = (flow * 2680 * 0.9 * 0.015).toFixed(0);
break;
case "navigation":
// 360全景导航
profit = (flow * 2880 * 0.9 * 0.015).toFixed(0);
break;
}
console.log(profit.length);
console.log(productType, sales, flow, profit);
if (profit.length > 9) {
return (profit / 10000).toFixed(0) + "万";
} else {
return profit;
}
},
reset() {
this.setData({
isReset: false,
formData: {
sales: 100,
flow: 10000,
},
});
},
focus() {
this.setData({
isReset: true,
});
return false;
},
// 更新手机号
updatePhoneNumber(e) {
if (e.detail) {
this.setData({
hasPhoneNumber: true,
});
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.hideShareMenu({
menus: ['shareAppMessage', 'shareTimeline']
})
// console.log('options: ', options);
// let { sessionId } = wx.$storage.get()
// // console.log("sessionId: ", sessionId);
// let param = {
// sessionId
// }
// 看产品
this.compositionData(senceData, []);
// productBysceneApi(param).then(res => {
// let { code, data } = res
// if (code == 0) {
// this.setData({
// apiData: data
// })
// this.compositionData(senceData, this.data.apiData)
// // this.getFirstSenceIndex();
// }
// })
// 看线索
// this.getClueInit()
//第一次进来储缓存,以后不再用引导图
let firstLogin = wx.$storage.get("firstLogin");
if (!firstLogin) {
this.setData({
guideShow: true,
});
wx.$storage.set("firstLogin", "firstLogin");
}
if (util.getUserInfo().phone) {
this.setData({
hasPhoneNumber: true,
});
}
},
onRoute(options) {
console.log(options, "options");
if (options.actNum) {
const trackName = this.data.trackList[options.actNum][options.activeNavIdx]
console.log(trackName)
wx.$Track.sendTrack(trackData[trackName]);
} else {
// 无参数默认埋点
wx.$Track.sendTrack(trackData.CARBEAUTY);
}
this.setData({
actNum: options.actNum,
wrapactiveNavIdx: options.activeNavIdx,
});
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner, idx) => {
if (item.name == inner.stage) {
item.sceneStatus = inner.sceneStatus;
item.productList.forEach((outChild, outIndex) => {
inner.productList.forEach((innerChild, innerIndex) => {
if (outChild.proName == innerChild.productName) {
outChild.productStatus = innerChild.productStatus;
}
});
});
}
});
});
// console.log('localData, apiData: ', localData);
this.setData({
senceData: localData,
});
},
getFirstSenceIndex(param) {
let actTndex = this.data.apiData.findIndex((item) => item.sceneStatus == 1);
// console.log('actTndex: ', actTndex);
this.setData({
actNum: actTndex,
});
},
// 看线索相关
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.prompt = this.selectComponent("#toast");
},
showToast: function (e) {
let { type, item } = e.currentTarget.dataset;
console.log("type,item: ", type, item);
let tipObj = {};
if (item.starTag == 1) {
tipObj = {
type: "fail",
title: "取消标记为意向客户",
};
} else {
tipObj = {
type: "success",
title: "成功标记为意向客户",
};
}
this.prompt.showToast({
type: tipObj.type,
title: tipObj.title,
duration: 1000,
compelete: function () {
console.log("toast框隐藏之后,会调用该函数");
//例如:跳转页面wx.navigateTo({ url: 'xxx' });
},
});
//切换收藏标记
let index = e.currentTarget.dataset.outidx;
let completeStatus = `clueList[${index}].like`;
this.setData({
[completeStatus]: !this.data.clueList[index].like,
});
//发请求
let { sessionId } = wx.$storage.get();
let params = {
clueId: item.clueId,
sessionId,
};
this.getTagApi(params);
},
filterTypeFn(e) {
let { typeList } = this.data;
let index = e.currentTarget.dataset.index;
// console.log('index: ', index);
// let itemList = []
// let params = {
// clueSource: '',
// hasPhone: '',
// starTag: ''
// }
// console.log('index: ', index)
// 重置筛选
if (index == 3) {
typeList.forEach((item) => {
item.selectIndex = 2;
});
this.setData({
typeList,
});
return this.getPageApi();
}
let itemList = Object.values(typeList[index]).slice(0, 2);
itemList.push("全部");
let _this = this;
wx.pro.showActionSheet({
itemList,
success(res) {
// 选中全部
let selectIndex = res.tapIndex;
// console.log('selectIndex: ', selectIndex);
typeList[index].selectIndex = selectIndex;
let params = typeList.reduce((obj, item, index) => {
console.log(" item: ", item);
if (item["key"]) {
// selectIndex = index == 2 ? selectIndex + 1 : selectIndex
// console.log('selectIndex: ', selectIndex);
let itemIndx = item.selectIndex;
// console.log('itemIndx: ', itemIndx);
// key: 'clueSource'
if (item["key"] == "clueSource") {
itemIndx += 1;
}
obj[item["key"]] = itemIndx == 2 || itemIndx == 3 ? "" : itemIndx;
}
return obj;
}, {});
console.log(params);
// let num
// if (index == 2) {
// num = res.tapIndex + 1
// } else {
// num = res.tapIndex
// }
// switch (index) {
// case 0:
// params.hasPhone = num
// break
// case 1:
// params.starTag = num
// break
// case 2:
// params.clueSource = num
// break
// }
_this.setData({ typeList });
_this.getPageApi(params);
},
fail(res) {
console.log(res.errMsg);
},
});
},
// // 打电话
// phoneCallFn(e) {
// let { phone } = e.currentTarget.dataset
// console.log('phone: ', phone)
// wx.phoneCall(phone)
// },
// // 复制号码
// setCopyDataFn(e) {
// let { phone } = e.currentTarget.dataset
// wx.setCopyData(phone)
// },
getClueInit(param) {
// console.log(22222)
this.getUnreadApi(param);
this.getPageApi(param);
},
//未读消息
async getUnreadApi(param) {
let { code, data } = await unreadApi(param);
if (code == 0) {
this.setData({
unreadClueCount: data.unreadClueCount,
});
}
},
//获取浏览线索数据列表
async getPageApi(param) {
let { cluePageSize, clueCurrentPage } = this.data;
let params = {
...param,
pageSize: 1000,
currentPage: clueCurrentPage,
};
let { code, data } = await pageApi(params);
if (code == 0) {
let arr = data.list.map((item) => {
if (item.visitList.length > 5) {
item.getMoreFlag = true;
}
return item;
});
this.setData({
clueList: arr,
});
}
},
//喜欢收藏功能
async getTagApi(param) {
let res = await tagApi(param);
console.log("res: ", res);
this.getPageApi(param);
},
onReachBottom() {
console.log("滑到底部了");
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// setTimeout(()=>{
// console.log('this.data.tabBarStyle',this.data.tabBarStyle,this.data.headerHeight)
// })
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit("evt_page_scroll", { scrollTop: e.scrollTop });
}, 500);
};
})(),
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
onShareTimeline: function () {},
});
{
"usingComponents": {
"product": "./components/product/product"
},
"navigationStyle": "custom",
"onReachBottomDistance":50
}
@import "../../style/common.wxss";
page {
background-color: #F7F7F7;
color: #282829;
font-size: 28rpx;
--themeColor: #F13C3D;
--btnColor: #3666FE;
--borderRadius: 8rpx;
--margin: 32rpx;
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
transform: translateY(7rpx);
}
page {
height: 100vh;
width: 100vw;
background-color: #F2F3F7 !important;
}
.reclaim {
.header-wrap {
position: sticky;
top: 0;
width: 100%;
background-size: 100% 100%;
// margin-bottom: 32rpx;
z-index: 2;
.header {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 88rpx;
display: flex;
justify-content: space-between;
align-items: center;
.tabContainer {
width: 60%;
}
.left {
display: flex;
align-items: center;
.clue {
position: relative;
margin-left: 24px;
margin-right: 24px;
font-weight: 400;
font-size: 14px;
color: #8a8c90;
}
.product {
position: relative;
}
.act {
font-weight: 600;
font-size: 22px;
color: #323436;
&::after {
position: absolute;
left: 50%;
bottom: -6px;
transform: translateX(-50%);
display: block;
content: "";
width: 20px;
height: 4px;
background: var(--btnColor);
border-radius: 2px;
}
}
}
.right {
display: flex;
align-items: center;
.img {
width: 40rpx;
height: 40rpx;
}
.apply {
margin-left: 4px;
margin-right: 16px;
font-weight: 400;
font-size: 28rpx;
color: var(--btnColor);
}
}
}
}
// .content{
// position: relative;
// }
.clue {
padding: 0px 10px 0;
background-color: #f2f3f7;
// margin-top: -16rpx;
.types {
// margin-bottom: 8px;
box-sizing: border-box;
padding: 16rpx 0;
display: flex;
align-items: center;
position: sticky;
top: 280rpx;
z-index: 2;
background-color: #f2f3f7;
margin-top: -32rpx;
.type {
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
padding: 0 16rpx;
height: 24px;
line-height: 24px;
background: #ffffff;
border-radius: 14px;
font-size: 12px;
color: #8a8c90;
.point {
margin-left: 2px;
width: 12px;
height: 12px;
}
}
.active {
color: #3964fe;
}
}
.list {
box-sizing: border-box;
// padding-bottom: 8rpx;
.msg {
padding: 10px 16px 16px;
margin-bottom: 8px;
position: relative;
background-color: #fff;
border-radius: 4px;
}
.like {
position: absolute;
right: 12px;
top: 0;
width: 23px;
height: 23px;
}
.name {
display: flex;
align-items: center;
// font-weight: 400;
font-size: 14px;
color: #323436;
.avatar {
margin-left: 2px;
width: 20px;
height: 20px;
}
}
.line {
margin-top: 10px;
margin-bottom: 10px;
height: 0;
border-bottom: #eeeeee 1px dashed;
}
.want-more {
overflow: hidden;
}
.want-btn {
margin-top: 10px;
font-size: 12px;
color: var(--btnColor);
}
.record {
margin-top: 4px;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
align-items: center;
.action-wrap {
display: flex;
align-items: center;
font-size: 12px;
color: #393b3e;
}
// .action{
// }
// .detail{
// }
.time {
font-size: 12px;
color: #8a8c90;
}
}
.info {
margin-top: 10px;
display: flex;
justify-content: space-between;
.phone-wrap {
display: flex;
align-items: center;
}
.phone {
font-size: 12px;
color: #3666fe;
}
.phone-img {
margin-left: 12px;
margin-right: 8px;
width: 20px;
height: 20px;
border-radius: 50%;
}
.copy {
width: 20px;
height: 20px;
border-radius: 50%;
}
.btn {
width: 85px;
height: 24px;
background: var(--btnColor);
border-radius: 12px;
font-size: 12px;
color: #ffffff;
text-align: center;
line-height: 24px;
}
}
.noDataImg {
width: 512rpx;
height: 512rpx;
margin-left: 100rpx;
position: relative;
.noDataTxt {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #CCCED1;
position: absolute;
bottom: 32rpx;
left: 50%;
transform: translateX(-50%);
}
}
.shop {
.name-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.source {
font-size: 10px;
color: #8a8c90;
}
.btn {
border: 1px solid var(--btnColor);
border-radius: 12px;
background-color: #fff;
font-size: 12px;
color: var(--btnColor);
}
.shop-action-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.shop-record {
width: 100%;
}
.shop-source {
margin-top: 4px;
width: 100%;
font-size: 12px;
color: #393b3e;
}
}
.bottomTips {
text-align: center;
color: #393b3e;
font-size: 26rpx;
height: 60rpx;
line-height: 40rpx;
}
}
}
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 32rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 16rpx;
margin-bottom: 40rpx;
position: relative;
width: 172rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
// padding-top: 10px;
width: 172rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #F0F7FF 0%, #FFFFFF 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32), 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.40);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name {
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg {
font-weight: 400;
font-size: 9px;
color: #8a8c90;
text-align: center;
}
}
}
.guide {
width: 100%;
height: 100%;
.guide-img {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 3;
}
}
.chat {
position: fixed;
right: -4px;
top: 60%;
width: 64px;
height: 64px;
border-radius: 50%;
z-index: 2;
}
.output-value {
position: fixed;
right: -2px;
top: 70%;
width: 64px;
height: 64px;
// border-radius: 50%;
z-index: 2;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(45, 45, 51, 0.50);
z-index: 2;
.dialog-box {
position: fixed;
bottom: 0;
width: 100%;
background-color: #fff;
box-shadow: 0 -8rpx 20rpx 0 rgba(180, 186, 204, 0.32);
border-radius: 32rpx 32rpx 0 0;
}
.dialog-header {
display: flex;
justify-content: space-between;
padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee;
}
.header-btn {
display: inline-block;
font-size: 32rpx;
line-height: 48rpx;
}
.btn-gray {
color: #6C737A;
}
.btn-primary {
background-color: #fff;
border: none;
margin: 0;
padding: 0;
font-weight: 500;
color: #3666FE;
width: auto;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
margin-bottom: 24rpx;
}
.dialog-form {
width: 100%;
height: 384rpx;
background-image: linear-gradient(179deg, rgba(240, 247, 255, 0.30) 15%, #F0F7FF 100%);
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 216rpx;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
margin-left: 64rpx;
margin-right: 16rpx;
}
.form-unit {
font-size: 28rpx;
color: #6E6E7A;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
background: #3666FE;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
line-height: 48rpx;
margin-top: 40rpx;
}
}
// .clue {
// flex: 1;
// overflow: hidden;
// }
\ No newline at end of file
<page-meta page-style="overflow: {{hasPhoneNumber ? 'visible' : 'hidden'}}" />
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
D+增值转化
</navigation-bar>
<view class="reclaim" style="{{tabIndx == 1 ? 'background: #fff;' : ''}}">
<!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')">
<view class="header">
<!-- <tab
tab="{{navList}}"
itemWidth="{{'35%'}}"
index="{{tabIndx}}"
tabHeight
unreadClueCount="{{unreadClueCount}}"
bindclick="changeTabIndx"
class="tabContainer"
/>
<view class="right" data-type="shop" bindtap="gotoApply">
<image class="img" src="{{IMG_URL}}index/apply.png" />
<view class="apply">申请业务</view>
</view> -->
</view>
</view>
<!-- 托客户内容 -->
<view class="content" wx:if="{{tabIndx == 1 }}" hover-class="none" hover-stop-propagation="false">
<view class="scene">
<!-- wx:if="{{item.sceneStatus == 1}}" -->
<scroll-view scroll-x="{{true}}">
<view class="scene-wrap">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" data-scenestatus="{{item.sceneStatus}}" bindtap="selectCar" wx:for="{{senceData}}" wx:key="name">
<view class="item">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
<view class="msg">{{item.msg}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
<product isShow="{{false}}" stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" origin="home" bindsharehandle="sharehandle" wrapactiveNavIdx="{{wrapactiveNavIdx}}" />
</view>
</view>
<!-- 收藏、取消提示框 -->
<!-- <vas-toast isShow="{{true}}" id='toast' /> -->
<!-- 引导图 -->
<!-- <view class="guide" wx:if="{{guideShow}}" style="overflow-y:hidden;">
<image
webp
bindtap="guideFn"
class="guide-img"
src="{{IMG_URL}}index/guide{{guideSrcIndex}}.png"
/>
</view> -->
<!-- 在线客服 -->
<!-- <image class="chat" src="{{IMG_URL}}index/contact.png" bindtap="goConsult" /> -->
<!-- 预估产值 -->
<image class="output-value" bindtap="showCalculate" src="{{IMG_URL}}index/valuation.png" wx:if="{{tabIndx == 1}}" />
<!-- 预估产值弹框 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view wx:if="{{!isReset}}" class="header-btn btn-gray" bindtap="showCalculate">
取消
</view>
<view wx:if="{{isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
<view class="dialog-title">输入您门店的基本情况</view>
<view class="dialog-form">
<view class="form-item">
<view class="form-label">门店月平均新车销量</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="sales" value="{{formData.sales}}" type="number" />
<!-- <view class="form-unit">台</view> -->
</view>
<view class="form-item">
<view class="form-label">3年内售后存量用户</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="flow" type="number" value="{{formData.flow}}" />
<!-- <view class="form-unit">人</view> -->
</view>
<button class="dialog-btn" form-type="submit">提交测算</button>
</view>
</view>
</form>
</view>
</view>
<block wx:if="{{!hasPhoneNumber}}">
<phone-number isHidden="{{true}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</block>
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-08-30 11:26:21
* @LastEditors: huyue
* @LastEditTime: 2022-09-09 14:41:59
* @LastEditTime: 2022-10-28 10:51:40
*/
// pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index";
......@@ -23,22 +23,26 @@ Page({
name: "公司介绍",
icon: "icon-company",
icon1: "icon-company1",
isShow: true
},
{
name: "方案介绍",
icon: "icon-product",
icon1: "icon-product1",
isShow: true
},
{
name: "视频直播",
icon: "icon-video",
icon1: "icon-video",
isShow: true
},
{
name: "展业测算",
icon: "icon-measure",
icon1: "icon-measure",
isShow: false
},
// {
// name: "合作申请",
// icon: "icon-cooperation",
// icon1: "icon-cooperation",
// },
],
curTabIndex: 0,
// 0-员工,1-代理商
......@@ -77,6 +81,9 @@ Page({
})
wx.$Track.sendTrack(trackData.VIDEO);
break;
case 3:
wx.$router.go("measure");
break
default:
this.setData({
curTabIndex: curTabIndex,
......@@ -85,16 +92,50 @@ Page({
}
},
// 跳转咨询页面
goConsult() {
console.log("跳转到咨询页面");
wx.openCustomerServiceChat({
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcf7b721472201345e'},
corpId: 'ww047bdc0f1e76cc13',
complete: r => {
console.log(r)
}
})
// 跳转其他内容
handleOpen(e) {
console.log(e)
const name = e.target.dataset.name
switch(name) {
case 'store':
util.getMockConfig().then(({storeParams, storeappId}) => {
console.log(storeParams, storeappId)
wx.navigateToMiniProgram({
appId: storeappId,
path: 'pages/authentication/loading/loading',
extraData: storeParams,
envVersion: 'trial',
success(res) {
console.log(res, storeParams)
// 打开成功
}
})
})
break
case 'business':
util.getMockConfig().then(({businessParams, businessappId}) => {
console.log(businessParams, businessappId)
wx.navigateToMiniProgram({
appId: businessappId,
path: 'login/loading/loading',
extraData: businessParams,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
})
break
case 'custom':
wx.openCustomerServiceChat({
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcf7b721472201345e'},
corpId: 'ww047bdc0f1e76cc13',
complete: r => {
console.log(r)
}
})
break
}
},
// 更新手机号
......@@ -174,6 +215,9 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
hasPhoneNumber: util.getUserInfo() && util.getUserInfo().phone
})
const options = wx.getEnterOptionsSync()
wx.$trackData = options.query
if (wx.$trackData.merchant) {
......@@ -281,7 +325,7 @@ Page({
{
text: data.staffName,
x: 18,
y: 36,
y: 40,
color: "#2D2D33",
fontWeight: 600,
fontSize: 14,
......@@ -289,7 +333,7 @@ Page({
{
text: data.operation,
x: 22 + draw_function.getTextWidth(data.staffName, 14),
y: 40,
y: 44,
color: "#6E6E7A",
fontWeight: 400,
fontSize: 8,
......@@ -372,8 +416,29 @@ Page({
},
});
},
// banner跳转
jumpBanner(e) {
console.log(e)
const path = e.target.dataset.path
switch(path) {
case 'left':
console.log('数字化+新能源汽车')
wx.$router.go("newEnergy");
wx.$Track.sendTrack(trackData.NEWENERGY);
break
case 'right':
console.log('众筹活动助力')
wx.$router.go("activityApplication");
wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION);
break
}
},
// 获取员工名片信息
getCardDetail() {
console.log(wx.showMeasure)
this.setData({
'tabList[3].isShow': wx.showMeasure
})
console.log(util.getStorageSync('scene'), wx.$trackData.cardId)
const scene = util.getStorageSync('scene');
let params = {
......@@ -389,6 +454,7 @@ Page({
})
}
const cardInfo = data || this.data.defaultInfo
console.log(data, cardInfo)
this.setData({
cardInfo
},()=>{
......
<!--
此文件为开发者工具生成,生成时间: 2022/9/17下午3:18:38
此文件为开发者工具生成,生成时间: 2022/10/21下午2:19:20
使用方法:
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxml 引入模板
......@@ -17,6 +17,7 @@
-->
<template name="skeleton">
<view class="sk-container">
<view class="sk-container"></view>
<view class="main-box">
<view is="components/UserInfo/UserInfo" hidden="{{cardInfo}}">
<view class="UserInfo--user-wrapper">
......@@ -26,16 +27,16 @@
<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 class="UserInfo--name sk-transparent sk-text-19-4444-883 sk-text">梁懿</view>
<view class="UserInfo--position sk-transparent sk-text-14-2857-261 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 class="sk-transparent sk-text-12-5000-996 sk-text">15814019200</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 class="UserInfo--address sk-transparent sk-text-12-5000-291 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>
......@@ -45,7 +46,7 @@
<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 class="UserInfo--phone-text sk-transparent sk-text-14-2857-847 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>
......@@ -55,44 +56,25 @@
</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>
<image webp="true" class="channel-img sk-image" data-path="left" mode="widthFix" style="height: 86.8063px;"></image>
<image webp="true" class="channel-img sk-image" data-path="right" mode="widthFix" style="height: 85.7969px;"></image>
</view>
<view class="tab-list">
<view class="tab-item" data-index="0" data-name="[object Object]">
<view class="tab-item tab-item-active sk-image" 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 class="tab-text sk-transparent sk-text-14-2857-411 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]">
<view class="tab-item" 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 class="tab-text sk-transparent sk-text-14-2857-670 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 class="tab-text sk-transparent sk-text-14-2857-642 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>
<image webp="true" class="img sk-image" mode="widthFix" style="height: 1030.51px;"></image>
</view>
</view>
</view>
......
/*
此文件为开发者工具生成,生成时间: 2022/9/17下午3:18:38
此文件为开发者工具生成,生成时间: 2022/10/21下午2:19:20
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
......@@ -11,7 +11,7 @@
.sk-transparent {
color: transparent !important;
}
.sk-text-19-4444-814 {
.sk-text-19-4444-883 {
background-image: linear-gradient(transparent 19.4444%, #EEEEEE 0%, #EEEEEE 80.5556%, transparent 0%) !important;
background-size: 100% 72.0000rpx;
position: relative !important;
......@@ -23,71 +23,41 @@
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-785 {
.sk-text-14-2857-261 {
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 {
.sk-text-12-5000-996 {
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 {
.sk-text-12-5000-291 {
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 {
.sk-text-14-2857-847 {
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 {
.sk-text-14-2857-411 {
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 {
.sk-text-14-2857-670 {
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 {
.sk-text-14-2857-642 {
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;
......
......@@ -8,16 +8,20 @@
<user-info data-skeleton-hide="cardInfo" shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}"></user-info>
<view class="main-bottom">
<!-- 面向渠道 -->
<template is="channel"></template>
<template is="channel" data="{{IMGURL, img_version, hasPhoneNumber}}"></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">
<view wx:if="{{item.isShow}}" class="tab-item {{curTabIndex === index ? 'tab-item-active' : '' }}" 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?v={{img_version}}"></image>
<image wx:else class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon}}.png?v={{img_version}}"></image>
<view class="tab-text">{{item.name}}</view>
<!-- <view class="tab-item {{curTabIndex === index ? 'tab-item-active' : '' }} {{index === 3 ? 'tab-apply' : ''}}" style="width: {{100 / tabList.length + '%'}}" 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?v={{img_version}}"></image>
<image wx:else class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon}}.png?v={{img_version}}"></image>
<view class="tab-text">{{item.name}}</view> -->
<!-- 合作申请hot -->
<image wx:if="{{index === 3}}" class="icon-hot" webp src="{{IMGURL}}home/icon-hot.png?v={{img_version}}"></image>
<!-- <image wx:if="{{index === 3}}" class="icon-hot" webp src="{{IMGURL}}home/icon-hot.png?v={{img_version}}"></image> -->
</view>
</block>
</view>
......@@ -28,21 +32,14 @@
<!-- 方案介绍 -->
<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?v={{img_version}}"></image>
<view class="floating-box">
<image class="floating-icon" style="margin-bottom: 10rpx;" bindtap="handleOpen" data-name="store" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image>
<image class="floating-icon" bindtap="handleOpen" data-name="business" src="{{IMGURL}}home/icon-business.png?v={{img_version}}"></image>
<image class="floating-icon" bindtap="handleOpen" data-name="custom" src="{{IMGURL}}home/custom.png?v={{img_version}}"></image>
</view>
</view>
\ No newline at end of file
......@@ -31,7 +31,7 @@ page {
}
.tab-list {
display: flex;
justify-content: space-evenly;
margin: 0 32rpx;
}
.tab-item {
......@@ -46,6 +46,10 @@ page {
text-align: center;
margin-top: 24rpx;
position: relative;
margin-right: 16rpx;
}
.tab-item:last-child {
margin-right: 0;
}
.bg-img {
......@@ -90,6 +94,7 @@ page {
top: 88rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
}
......@@ -99,13 +104,7 @@ page {
width: 100%;
}
.icon-consult {
width: 128rpx;
height: 128rpx;
position: fixed;
right: 6rpx;
bottom: 90rpx;
}
.main-box {
box-sizing: border-box;
......@@ -160,4 +159,16 @@ page {
position: absolute;
width: 100%;
bottom: 32rpx;
}
/* 右下角图标 */
.floating-box {
position: fixed;
display: flex;
flex-direction: column;
right: 6rpx;
bottom: 90rpx;
}
.floating-icon {
width: 128rpx;
height: 128rpx;
}
\ 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 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> -->
<image class="channel-img" mode="widthFix" webp src="{{IMGURL}}home/banner-left.png?v={{img_version}}" bindtap="jumpBanner" data-path="left"></image>
<view class="channel-img channel-phone">
<image class="channel-image" mode="widthFix" webp src="{{IMGURL}}home/banner-right.png?v={{img_version}}" bindtap="jumpBanner" data-path="right"></image>
<phone-number wx:if="{{!hasPhoneNumber}}" class="channel-image" bind:updatePhoneNumber="updatePhoneNumber" isImage="true"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file
.channel-bg {
width: 700rpx;
height: 144rpx;
margin: 0 auto;
position: relative;
/* width: 700rpx;
height: 144rpx; */
margin: 0 28rpx;
position: relative;
}
.channel-img {
display: inline-block;
width: calc(50% - 10rpx);
height: 168rpx;
}
.channel-img:first-child {
margin-right: 16rpx;
}
.channel-image {
width: 100%;
}
.channel-phone {
position: relative;
}
.channel-word {
position: absolute;
top: 24rpx;
left: 38rpx;
position: absolute;
top: 24rpx;
left: 38rpx;
}
.channel-title {
......
......@@ -39,12 +39,14 @@
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": false
"ignoreUploadUnusedFiles": false,
"useCompilerPlugins": [
"sass"
]
},
"compileType": "miniprogram",
"libVersion": "2.25.4",
"appid": "wx5d1208f9c8712943",
"appid": "wx1bd947039419e6ce",
"projectname": "%E5%B9%BF%E8%81%94%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%A8%A1%E7%89%88",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
......
......@@ -43,7 +43,7 @@
{
"name": "",
"pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3233",
"query": "scene=sceneId%3D3275",
"launchMode": "default",
"scene": null
},
......@@ -123,12 +123,63 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3275",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/newEnergy/newEnergy",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/applySuccess/applySuccess",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "活动申请",
"pathName": "pages/activityApplication/activityApplication",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "展业测算",
"pathName": "pages/measure/measure/measure",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "测算结果",
"pathName": "pages/measure/measureResult/measureResult",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/scene/scene",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
},
"setting": {
"urlCheck": false
"urlCheck": false,
"compileHotReLoad": false
},
"libVersion": "2.26.1"
"libVersion": "2.26.1",
"projectname": "ai-card"
}
\ No newline at end of file
......@@ -41,7 +41,7 @@ class Router {
let thisPage = this.getPageInstance();
if (thisPage) {
if (!wx.$version)
util.getImgVersion().then(({ version }) => {
util.getMockConfig().then(({ version }) => {
wx.$version = version || "1.0.0";
thisPage.setData({
img_version: wx.$version,
......@@ -147,11 +147,8 @@ class Router {
}
/**跳转至H5 */
jumpH5(url) {
this.intercept().then((response) => {
if (response) return;
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`,
});
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`,
});
}
/**页面跳转
......@@ -166,47 +163,32 @@ class Router {
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层
*/
go(route, events) {
console.log(route, events)
let { routerMapItem, query } = this.checkRouter(route, events);
console.log(routerMapItem)
if (routerMapItem.isTab) {
wx.switchTab({
url: routerMapItem.url,
});
} else {
if (events && events.notIntercept) {
wx.navigateTo({
url: `${routerMapItem.url}${query}`,
success: (res) => events && res.eventChannel.emit("getData", events),
});
} else {
this.intercept().then((response) => {
if (response) return;
wx.navigateTo({
url: `${routerMapItem.url}${query}`,
success: (res) =>
events && res.eventChannel.emit("getData", events),
});
});
}
wx.navigateTo({
url: `${routerMapItem.url}${query}`,
success: (res) => events && res.eventChannel.emit("getData", events),
});
}
}
/**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) {
let { routerMapItem, query } = this.checkRouter(route, events);
this.intercept().then((response) => {
if (response) return;
wx.reLaunch({
url: `${routerMapItem.url}${query}`,
});
wx.reLaunch({
url: `${routerMapItem.url}${query}`,
});
}
/**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */
redirectTo(route, events) {
let { routerMapItem, query } = this.checkRouter(route, events);
this.intercept().then((response) => {
if (response) return;
wx.redirectTo({
url: `${routerMapItem.url}${query}`,
});
wx.redirectTo({
url: `${routerMapItem.url}${query}`,
});
}
/**prevPageSize = 1
......
/**app.wxss**/
/*每个页面公共css */
.sticky {
position: sticky;
top: 0;
left: 0;
z-index: 2;
background-color: #fff;
}
.flex-center {
display: flex;
align-items: center;
justify-content: start;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen-bottom {
bottom: constant(safe-area-inset-bottom) !important;
bottom: env(safe-area-inset-bottom) !important;
}
.c-blue {
color: #3666FE;
}
.c-white {
color: #fff;
}
.bgc-blue {
background-color: #3666FE;
}
\ No newline at end of file
No preview for this file type
const _ctx_ = Symbol('_ctx_')
const _pixelRatio_ = Symbol('_pixelRatio_')
const _canvasObject_ = Symbol('_canvasObject_')
const _canvas_ = Symbol('_canvas_')
class Draw {
[_ctx_] = null;
[_pixelRatio_] = null;
[_canvasObject_] = null;
[_canvas_] = null
constructor(canvasObject, isCompInst) {
this[_canvasObject_] = canvasObject
this[_pixelRatio_] = canvasObject.pixelRatio || 2
const height = this.toRpx(canvasObject.height),
width = this.toRpx(canvasObject.width),
canvas = wx.createOffscreenCanvas({
type: '2d',
width,
height,
compInst: isCompInst
}),
ctx = canvas.getContext('2d')
this[_canvas_] = canvas
this[_ctx_] = ctx
this[_ctx_].clearRect(0, 0, width, height)
this.drawFill({
x: 0,
y: 0,
width,
height,
color: canvasObject.backgroundColor || 'rgb(255, 255, 255)'
})
this[_ctx_].save()
}
async drawImages(imageParams, callback) {
this[_ctx_].beginPath()
this[_ctx_].save()
let {
borderRadius,
height,
width,
url,
x,
y
} = imageParams
height = this.toRpx(height)
width = this.toRpx(width)
x = this.toRpx(x)
y = this.toRpx(y)
if (borderRadius) {
this.drawRadiusRect({
borderRadius,
height,
width,
x,
y
})
this[_ctx_].clip()
}
let image = this[_canvas_].createImage()
image.src = `${url}?v=${Date.now()}`
return new Promise(resolve => {
image.onload = () => {
this[_ctx_].drawImage(image, x, y, width, height)
this[_ctx_].restore()
if (callback) callback()
resolve(imageParams)
}
image.onerror = err => {
wx.hideLoading()
wx.showToast({
title: '图片加载失败',
icon: 'error'
})
}
})
}
toRpx(val) {
return this[_pixelRatio_] * val
}
getTextWidth(text, fontSize) {
let font = this[_ctx_].font.split('px')[1]
if (fontSize) this[_ctx_].font = `${fontSize}px${font}`
return this[_ctx_].measureText(text).width
}
drawFill({
x,
y,
width,
height,
color
}) {
height = this.toRpx(height)
width = this.toRpx(width)
x = this.toRpx(x)
y = this.toRpx(y)
this[_ctx_].beginPath()
this[_ctx_].fillStyle = color
this[_ctx_].fillRect(x, y, width, height)
this[_ctx_].stroke()
this[_ctx_].restore()
this[_ctx_].save()
}
drawText(textParams) {
let {
textDecoration,
textBaseline,
lineHeight,
fontWeight,
textAlign,
textWidth,
maxWidth,
fontSize,
lastFont,
opacity,
lineNum,
width,
color,
text,
x,
y
} = textParams,
font = this[_ctx_].font.split('px')[1]
textAlign = textAlign || 'left'
textBaseline = textBaseline || 'normal'
opacity = typeof opacity === 'number' ? opacity : 1
lineHeight = this.toRpx(lineHeight || fontSize || 12)
textWidth = this.toRpx(textWidth || 0)
fontSize = this.toRpx(fontSize || 12)
maxWidth = this.toRpx(maxWidth || width || this[_canvasObject_].width)
width = this.toRpx(width || this[_canvasObject_].width)
x = this.toRpx(x)
y = this.toRpx(y)
let fontX = this.getFontWidth({
textAlign,
fontSize,
text,
x
})
this[_ctx_].beginPath()
this[_ctx_].globalAlpha = opacity
this[_ctx_].font = `${fontWeight || 400} ${fontSize}px${font}`
this[_ctx_].fillStyle = color || '#000'
this[_ctx_].strokeStyle = color || '#000'
this[_ctx_].textBaseline = textBaseline
this[_ctx_].textAlign = textAlign
this[_ctx_].lineWidth = this.toRpx(2)
let text_width = this.getTextWidth(text)
if (textParams.border) this.drawBorder({
text,
x: textParams.x,
y: textParams.y,
fontSize: textParams.fontSize || 12,
...textParams.border
})
const drawOneLineText = () => {
let textArr = text.toString().split(''),
newText = '',
ellipsis = false
try {
textArr.map(e => {
newText += e
if (this.getTextWidth(newText) > width - fontX) throw true
})
} catch (error) {
ellipsis = error
}
if (ellipsis) newText += '…'
if (lastFont) newText += lastFont
this[_ctx_].fillText(newText, x, y, maxWidth)
if (checkTextDecoration(textDecoration)) {
this.drawDecoration({
textDecoration,
textBaseline,
textAlign,
fontSize,
newText,
opacity,
text,
y,
x
})
}
}
if (lineNum > 1) {
let textArr = text.split(''),
textRowArr = [],
currentText = '',
viewWidth = width - fontX
if (text_width > viewWidth) {
textArr.map(e => {
currentText += e
if (this.getTextWidth(currentText) >= viewWidth && textRowArr.length < lineNum - 1) {
textRowArr.push(currentText)
currentText = ''
}
})
if (currentText.length) textRowArr.push(currentText)
textRowArr.map((e, index) => {
if (this.getTextWidth(e) > viewWidth && index == lineNum - 1) {
try {
let lastText = '',
lastArr = e.split('')
lastArr.map(i => {
lastText += i
if (this.getTextWidth(lastText) > width - fontX - this.getTextWidth('…')) throw lastText
})
} catch (error) {
if (lastFont) e = `${error.substring(0, error.length - lastFont.length)}…${lastFont}`
else e = `${error}…`
}
}
if (lastFont && e.indexOf(lastFont) == -1 && textRowArr.length < 2) e = `${e.substring(0, e.length - lastFont.length)}…${lastFont}`
let textHeight = y + index * (lineHeight || fontSize)
this[_ctx_].fillText(e, x, textHeight, maxWidth)
if (checkTextDecoration(textDecoration)) {
this.drawDecoration({
y: textHeight,
textDecoration,
textBaseline,
textAlign,
fontSize,
newText: e,
opacity,
text,
x
})
}
})
} else {
drawOneLineText()
}
} else drawOneLineText()
this[_ctx_].stroke()
}
drawBorder(params) {
let {
x,
y,
text,
color,
width,
radius,
opacity,
padding,
fontSize
} = params
console.log(params)
let topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY, paddingX, paddingY
// if(padding && padding.length>1)
if (radius) {
}
}
drawLine(lineParams, callback) {
this[_ctx_].beginPath()
let {
opacity,
startX,
startY,
width,
color,
endX,
endY
} = lineParams
startX = this.toRpx(startX)
startY = this.toRpx(startY)
width = this.toRpx(width)
endX = this.toRpx(endX)
endY = this.toRpx(endY)
this[_ctx_].globalAlpha = typeof opacity === 'number' ? opacity : 1
this[_ctx_].strokeStyle = color || '#000'
this[_ctx_].lineWidth = width || this.toRpx(1)
this[_ctx_].moveTo(startX, startY)
this[_ctx_].lineTo(endX, endY)
this[_ctx_].stroke()
this[_ctx_].restore()
this[_ctx_].save()
if (callback) callback()
}
setLineY = params => {
let {
textDecoration,
textBaseline,
fontSize,
y
} = params
let type = {
underline: {
top: y + fontSize,
middle: y + fontSize / 2,
bottom: y,
normal: y
},
overline: {
top: y,
middle: y - fontSize / 2,
bottom: y - fontSize,
normal: y
},
'line-through': {
top: y + fontSize / 2,
middle: y - fontSize / 2,
bottom: y,
normal: y
}
}
return type[textDecoration][textBaseline]
}
setLineX({
textAlign,
text,
x
}) {
let textWidth = this.getTextWidth(text)
let type = {
left: x,
center: x - textWidth / 2,
right: x - textWidth
}
return type[textAlign]
}
drawRadiusRect({
borderRadius,
height,
width,
x,
y
}, callBack) {
let radius = typeof borderRadius === 'string' ? ((Number(borderRadius.split('%')[0]) / 100) * width) / 2 : borderRadius / 2
radius = radius || 0
this[_ctx_].beginPath()
for (let i = 1; i < 5; i++) {
let arcX = i === 1 || i === 4 ? x + width - radius : x + radius
let arcY = i === 1 || i === 2 ? y + height - radius : y + radius
this[_ctx_].arc(arcX, arcY, radius, 2 * Math.PI * ((i - 1) / 4), 2 * Math.PI * (i / 4))
}
if (callBack) callBack()
}
getFontWidth({
textAlign,
fontSize,
text,
x
}) {
let type = {
left: x,
center: x - (fontSize * text.length) / 2,
right: x - fontSize * text.length
}
return type[textAlign] < 0 ? 0 : type[textAlign]
}
drawDecoration(params) {
let {
newText,
opacity,
y,
x
} = params
let lineX = x
let lineY = y
lineX = this.setLineX(params)
lineY = this.setLineY(params)
this[_ctx_].globalAlpha = opacity
this[_ctx_].moveTo(lineX, lineY)
this[_ctx_].lineTo(lineX + this.getTextWidth(newText), lineY)
}
toDataURL(callBack) {
let url = this[_canvas_].toDataURL('image/png')
const base64src = function (base64data) {
return new Promise((resolve, reject) => {
const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || []
if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData)
wx.getFileSystemManager().writeFile({
filePath,
data: buffer,
encoding: 'binary',
success() {
resolve(filePath)
},
fail() {
reject(new Error('ERROR_BASE64SRC_WRITE'))
}
})
})
}
base64src(url).then(img => {
createLocalImg(img, callBack)
})
}
async begin(data = {}) {
return new Promise(async (resolve, reject) => {
const drawFun = () => {
data.textList && data.textList.length && data.textList.map(e => {
this.drawText(e)
})
data.lineList && data.lineList.length && data.lineList.map(e => {
this.drawLine(e)
})
wx.nextTick(() => {
this.toDataURL(res => resolve(res))
})
}
if (data.imageList && data.imageList.length) {
await this.drawImages(data.imageList[0])
if (data.imageList.length > 1)
for (let index = 1; index < data.imageList.length; index++) {
await this.drawImages(data.imageList[index])
if (index == data.imageList.length - 1) drawFun()
}
else drawFun()
}
})
}
}
const checkTextDecoration = textDecoration => {
return textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through')
}
/**网络图片转成本地资源 */
const createLocalImg = (url, callBack) => {
wx.getImageInfo({
src: url,
success(res) {
callBack(res)
},
fail() {
wx.showToast({
title: '图片生成失败,请稍后再试',
icon: 'none'
})
wx.hideLoading()
console.error(`图片转换本地失败,${url}`)
}
})
}
export default Draw
\ No newline at end of file
......@@ -120,29 +120,34 @@ class TRACK {
return guest_no
}
/**定时发送埋点数据 */
sendTrack(p, openId) {
sendTrack(p, info) {
console.log(info)
console.log(wx.$trackData);
let params = {
method: 'entmicro.api.business.card.cardRecord',
cardId: wx.$trackData.cardId,
merchant: wx.$trackData.merchant || wx.$trackData.merchantId,
merchant: wx.$trackData.merchant || wx.$trackData.merchantId || wx.$util.getStorageSync("scene").merchant,
type: wx.$trackData.type
}
let userInfo = { }
if (wx.$util.getUserInfo()) {
const {nickName,openId, unionId, phone} = wx.$util.getUserInfo() || {}
const {nickName, openId, phone} = wx.$util.getUserInfo() || {}
userInfo = {
nickName,
unionId: wx.$util.getStorageSync('aicard_info').unionId,
openId,
unionId,
phone,
}
} else {
if (openId) {
userInfo.openId = openId
} else {
userInfo.openId = wx.$util.getStorageSync('openId')
}
// if (info.openId) {
// userInfo.openId = info.openId
// } else {
// // userInfo.openId = wx.$util.getStorageSync('openId')
// userInfo.openId = wx.$util.getStorageSync('aicard_info').openId
// }
userInfo.openId = info && info.openId ? info.openId : wx.$util.getStorageSync('aicard_info').openId
userInfo.unionId = info && info.unionId ? info.unionId : wx.$util.getStorageSync('aicard_info').unionId
}
params = Object.assign(params, userInfo, p)
......
/**
* 微信小程序标准版:统一封装的 storage 操作类
*/
import { DEFAULT_GET_STORAGEKEY, STORAGE_OBJECTkEY } from '../constantData'
class Storage {
types = {
1: 'get', // get
2: 'set', // set
3: 'rm' // rm
}
envVersion = {
develop: '开发版',
trial: '体验版',
release: '正式版'
}
// defaultGetStorageKey = DEFAULT_GET_STORAGEKEY
/** 构造函数 */
constructor() {
/** 获取当前小程序环境变量 */
const accountInfo = wx.getAccountInfoSync()
this.environment = accountInfo?.miniProgram.envVersion || 'release'
}
/**
*
* @param {*} key | 要操作的键值
* @param {*} type | 类型,是 get set rm
* @param {*} emptyFlag | 是否判断为空情况,默认判断 true,false 为不判断
*/
checkKeyType(key, type, emptyFlag = true) {
if (typeof key != 'string') {
throw new Error(`Storage ${this.types[type]} func: key must be string`)
return false
}
if (emptyFlag) {
let tmpKey = key.TrimStr()
if (tmpKey == '') {
throw new Error(`Storage ${this.types[type]} func: key can not be empty`)
return false
}
// if STORAGE_OBJECTkEY[key]
return tmpKey
}
return key
}
/**
*
* @param {*} key | 要操作的键值
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/
get = (key, syncFlag = true) => {
// 有值默认取key值
if (key) {
// 判断值是否是指定的对象值
let tmpKey = this.checkKeyType(key, 1)
let isObjectKey = STORAGE_OBJECTkEY[tmpKey]
// console.log(key)
// console.log(isObjectKey)
if (isObjectKey) {
return this.getObjectKeyValue(isObjectKey)
} else {
throw new Error(`Storage ${this.types[1]} ${key}: key must be register`)
}
} else {
return this.getObjectKeyValue(DEFAULT_GET_STORAGEKEY)
}
}
/**
*
* @param {*} 空key返回默认定义数组的值
*/
getObjectKeyValue(key) {
// ObjectList
if (typeof key == 'string') {
key = this.addEvnToKey(key)
let res = wx.getStorageSync(key)
if (res) {
return JSON.parse(res)
} else {
// reject(errMsg)
return ''
}
} else {
let Obj = {}
key.forEach(key => {
let defaultKey = this.addEvnToKey(key)
let res = wx.getStorageSync(defaultKey)
Obj[key] = res ? JSON.parse(res) : ''
})
return Obj
}
}
/**
*
* @param {*} key | 要操作的键值
* @param {*} data | 要存储的值,会转换为 JSON 串进行存储
* @param {*} syncFlag | 同步状态,默认为同步 false (异步),true 为同步
*/
set = (key, data, syncFlag = true) => {
let tmpKey = this.checkKeyType(key, 2)
if (tmpKey) {
tmpKey = this.addEvnToKey(tmpKey)
const sucMsg = 'Storage set: set data successfully'
const errMsg = 'Storage set: failed to set data'
return new Promise((resolve, reject) => {
let tmpData = JSON.stringify(data)
if (syncFlag) {
try {
wx.setStorageSync(tmpKey, tmpData)
resolve(sucMsg)
} catch (err) {
console.log(err)
reject(errMsg)
}
} else {
wx.setStorage({
data: tmpData,
key: tmpKey,
success: () => {
resolve(sucMsg)
},
fail: err => {
console.log(err)
reject(errMsg)
}
})
}
})
}
}
/**
*
* @param {*} key | 要操作的键值,为空则清空所有,有值则清空指定的值
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/
rm = (key = '', syncFlag = false) => {
let tmpKey = this.checkKeyType(key, 3, false)
tmpKey = tmpKey.TrimStr()
const sucMsg = 'Storage rm: rm data successfully'
const errMsg = 'Storage rm: failed to rm data'
return new Promise((resolve, reject) => {
if (tmpKey == '') {
if (syncFlag) {
try {
wx.clearStorageSync()
resolve(sucMsg)
} catch (err) {
console.log(err)
reject(errMsg)
}
} else {
wx.clearStorage({
success: res => {
resolve(sucMsg)
},
fail: err => {
console.log(err)
reject(errMsg)
}
})
}
} else {
tmpKey = this.addEvnToKey(tmpKey)
if (syncFlag) {
try {
wx.removeStorageSync(tmpKey)
resolve(sucMsg)
} catch (err) {
console.log(err)
reject(errMsg)
}
} else {
wx.removeStorage({
key: tmpKey,
success: () => {
resolve(sucMsg)
},
fail: err => {
console.log(err)
reject(errMsg)
}
})
}
}
})
}
/**
* @description: key 拼接小程序环境变量
* @param {*} key | 要操作的键值,
* @returns {String} 拼接后的值
*/
addEvnToKey = key => {
// return // console.log(this.environment)
return `${this.environment}_${key}`
}
}
/** 去除前导空格和后导空格 */
String.prototype.TrimStr = function () {
return this.replace(/(^\s*)|(\s*$)/g, '')
}
export { Storage }
// 实例化对象存储
import { Storage } from './storage'
const $Storage = new Storage()
// console.log($Storage)
/** */
export function getSessionId() {
return $Storage.get('sessionId')
}
export function setSessionId(sessionId) {
$Storage.set('sessionId', sessionId)
}
export function getUserInfo() {
return $Storage.get('userInfo')
}
export function setUserInfo(data) {
console.log(data)
$Storage.set('userInfo', data)
}
export function removeSystemStorage() {
// $Storage.rm('srcm_shopmall_user_info')
// $Storage.rm('scrm_shopmall_sessionId')
// $Storage.rm('guest_no')
// $Storage.rm('equity_info')
// $Storage.rm('packageList')
// $Storage.rm('isVIP')
// $Storage.rm('bizjiaUrl')
// $Storage.rm('vip_card_info')
}
export function setStorageSync(key, data) {
$Storage.set(key, JSON.stringify(data))
}
export function getStorageSync(key) {
return $Storage.get(key) || null
// JSON.parse(data)
}
/**设置标题栏 */
export function setNavigationBarTitleText(title) {
$Storage.set('app_title', title)
}
/**获取app标题 */
export function getNavigationBarTitleText() {
return $Storage.get('app_title')
}
/** 存储设备信息 */
export function setSystem_info(that) {
let info = $Storage.get('system_info')
!info &&
wx.getSystemInfo({
success(res) {
// console.log(res)
$Storage.set('system_info', res)
}
})
}
/**获取用户信息 */
export function getUserInfo() {
let user = wx.$storage.get('userInfo') || null
return user
}
/**设置用户信息 */
export function setUserInfo(userInfo) {
wx.$storage.set('userInfo', userInfo)
}
export function isMember(isNeedToHttp, callBack) {
if (isNeedToHttp) {
equityApi.checkOpenMember().then(res => {
let flag = false
if (res.code == 0 && res.data) {
flag = true
}
wx.$storage.set('isVIP', flag)
callBack && callBack(flag, res.data)
})
return
}
return wx.$storage.get('isVIP') || false
}
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
// 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
// 缓存get方法key的对应才映射值
export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
sessionId: 'sessionId',
userInfo: 'userInfo',
system_info: 'systemInfo',
app_title: 'appTitle',
auto_login_object: 'auto_login_object',
wx_user_info: 'wx_user_info',
userPhone: 'userPhone',
firstLogin:'firstLogin',
authphone:'authphone'
}
export const IMG_VERSION = () =>{
const accountInfo = wx.getAccountInfoSync()
return accountInfo.miniProgram.version || '1.0.0'
}
\ No newline at end of file
......@@ -23,45 +23,103 @@ const trackData = {
pageKey: 5,
pageName: "D+增值转化",
},
// EQUITYCARD: {
// pageKey: 6,
// pageName: "数字无忧权益卡",
// },
// SOLARFILM: {
// pageKey: 7,
// pageName: "汽车太阳膜",
// },
// CHANGEFILM: {
// pageKey: 8,
// pageName: "改色膜",
// },
// PAINTPROTECT: {
// pageKey: 9,
// pageName: "漆面保护膜",
// },
// CARBEAUTY: {
// pageKey: 10,
// pageName: "热络期-数字化美容",
// },
// SEATVENTILATE: {
// pageKey: 11,
// pageName: "座椅通风系统",
// },
// ARNAVIGATION: {
// pageKey: 12,
// pageName: "AR导航",
// },
// LIGHT: {
// pageKey: 13,
// pageName: "氛围灯",
// },
// NAVIGATIONARROUND: {
// pageKey: 14,
// pageName: "360全景导航",
// },
// LOSSPGASE: {
// pageKey: 15,
// pageName: "流失期-数字化美容",
// },
EQUITYCARD: {
pageKey: 6,
pageName: "数字无忧权益卡",
pageName: "新车洽谈场景-数字无忧权益卡",
},
SOLARFILM: {
pageKey: 7,
pageName: "汽车太阳膜",
pageName: "新车交付场景-汽车太阳膜",
},
CHANGEFILM: {
pageKey: 8,
pageName: "改色膜",
pageName: "0-12个月-改色膜",
},
PAINTPROTECT: {
pageKey: 9,
pageName: "漆面保护膜",
pageName: "0-12个月-漆面保护膜",
},
CARBEAUTY: {
pageKey: 10,
pageName: "热络期-数字化美容",
pageName: "12个月以上-数字化美容",
},
SEATVENTILATE: {
pageKey: 11,
pageName: "座椅通风系统",
pageName: "12个月以上-座椅通风",
},
ARNAVIGATION: {
pageKey: 12,
pageName: "AR导航",
pageName: "12个月以上-AR导航",
},
LIGHT: {
pageKey: 13,
pageName: "氛围灯",
pageName: "12个月以上-氛围灯",
},
NAVIGATIONARROUND: {
pageKey: 14,
pageName: "360全景导航",
pageName: "12个月以上-360全景导航",
},
LOSSPGASE: {
pageKey: 15,
pageName: "流失期-数字化美容",
pageName: "3年以上-新能源0元换购",
},
NEWENERGY: {
pageKey: 16,
pageName: "数字化+新能源汽车"
},
ACTIVITYAPPLICATION: {
pageKey: 17,
pageName: "活动申请"
}
};
export { trackData };
const productTrack = [
['EQUITYCARD'],
['SOLARFILM'],
['PAINTPROTECT', 'CHANGEFILM'],
['CARBEAUTY', 'SEATVENTILATE', 'ARNAVIGATION', 'LIGHT', 'NAVIGATIONARROUND'],
['LOSSPGASE']
]
export { trackData, productTrack };
class Bus {
constructor() {
this.events = {}
}
on(Event, cb) {
if(this.events[Event]) {
this.events[Event].push(cb);
} else {
this.events[Event] = [cb];
}
// 如果是匿名函数就给用户个警告
if(!cb.name) {
console.warn('on 接口的 handler 参数推荐使用具名函数。具名函数可以使用 off 接口取消订阅,匿名函数无法取消订阅。')
}
}
emit(Event, obj) {
if(!this.events[Event]) return
this.events[Event].forEach(cb => {
cb(obj)
})
}
off(Event,cb) {
if(!this.events[Event]) return
const index = this.events[Event].findIndex(item => item === cb);
if (index === -1) {
// console.error(new Error('该 handle 没有订阅者,取消订阅失败'));
return;
}
this.events[Event].splice(index, 1);
}
// 给这个类加一个静态方法,用来判断这个类之前有没有生成过对象
static getInstance() {
if (!Bus.instance) {
Bus.instance = new Bus()
}
return Bus.instance;
}
}
// 导出这里返回 Bus 类静态 getInstance 的执行结果
export default Bus.getInstance();
\ No newline at end of file
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return f})),n.d(e,"__generator",(function(){return d})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return l})),n.d(e,"__values",(function(){return h})),n.d(e,"__read",(function(){return _})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return y})),n.d(e,"__asyncDelegator",(function(){return m})),n.d(e,"__asyncValues",(function(){return O})),n.d(e,"__makeTemplateObject",(function(){return j})),n.d(e,"__importStar",(function(){return E})),n.d(e,"__importDefault",(function(){return S})),n.d(e,"__classPrivateFieldGet",(function(){return w})),n.d(e,"__classPrivateFieldSet",(function(){return x}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function d(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function p(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function l(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function y(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof b?Promise.resolve(n.value.v).then(u,c):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function f(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function m(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function O(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function j(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}function w(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u})),n.d(e,"l",(function(){return c})),n.d(e,"j",(function(){return f})),n.d(e,"i",(function(){return d})),n.d(e,"f",(function(){return p})),n.d(e,"c",(function(){return l})),n.d(e,"k",(function(){return h})),n.d(e,"n",(function(){return _})),n.d(e,"m",(function(){return v})),n.d(e,"h",(function(){return g})),n.d(e,"g",(function(){return b}));var r=Object.prototype.toString;function i(t){switch(r.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b(t,Error)}}function o(t,e){return r.call(t)==="[object "+e+"]"}function a(t){return o(t,"ErrorEvent")}function s(t){return o(t,"DOMError")}function u(t){return o(t,"DOMException")}function c(t){return o(t,"String")}function f(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function d(t){return o(t,"Object")}function p(t){return"undefined"!=typeof Event&&b(t,Event)}function l(t){return"undefined"!=typeof Element&&b(t,Element)}function h(t){return o(t,"RegExp")}function _(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function v(t){return d(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function g(t){return"number"==typeof t&&t!=t}function b(t,e){try{return t instanceof e}catch(t){return!1}}},function(t,e,n){"use strict";function r(t){t.then(null,(function(t){console.error(t)}))}n.r(e),n.d(e,"forget",(function(){return r})),n.d(e,"htmlTreeAsString",(function(){return i.b})),n.d(e,"getLocationHref",(function(){return i.a})),n.d(e,"dsnToString",(function(){return o.a})),n.d(e,"makeDsn",(function(){return o.b})),n.d(e,"SeverityLevels",(function(){return a})),n.d(e,"SentryError",(function(){return s.a})),n.d(e,"getGlobalObject",(function(){return u.a})),n.d(e,"getGlobalSingleton",(function(){return u.b})),n.d(e,"addInstrumentationHandler",(function(){return P})),n.d(e,"isError",(function(){return d.d})),n.d(e,"isErrorEvent",(function(){return d.e})),n.d(e,"isDOMError",(function(){return d.a})),n.d(e,"isDOMException",(function(){return d.b})),n.d(e,"isString",(function(){return d.l})),n.d(e,"isPrimitive",(function(){return d.j})),n.d(e,"isPlainObject",(function(){return d.i})),n.d(e,"isEvent",(function(){return d.f})),n.d(e,"isElement",(function(){return d.c})),n.d(e,"isRegExp",(function(){return d.k})),n.d(e,"isThenable",(function(){return d.n})),n.d(e,"isSyntheticEvent",(function(){return d.m})),n.d(e,"isNaN",(function(){return d.h})),n.d(e,"isInstanceOf",(function(){return d.g})),n.d(e,"CONSOLE_LEVELS",(function(){return p.a})),n.d(e,"consoleSandbox",(function(){return p.b})),n.d(e,"logger",(function(){return p.c})),n.d(e,"memoBuilder",(function(){return F.a})),n.d(e,"uuid4",(function(){return L.i})),n.d(e,"parseUrl",(function(){return L.g})),n.d(e,"getEventDescription",(function(){return L.e})),n.d(e,"addExceptionTypeValue",(function(){return L.c})),n.d(e,"addExceptionMechanism",(function(){return L.b})),n.d(e,"parseSemver",(function(){return L.f})),n.d(e,"addContextToFrame",(function(){return L.a})),n.d(e,"stripUrlQueryAndFragment",(function(){return L.h})),n.d(e,"checkOrSetAlreadyCaught",(function(){return L.d})),n.d(e,"isNodeEnv",(function(){return U.b})),n.d(e,"dynamicRequire",(function(){return U.a})),n.d(e,"loadModule",(function(){return U.c})),n.d(e,"normalize",(function(){return B.a})),n.d(e,"normalizeToSize",(function(){return B.b})),n.d(e,"walk",(function(){return B.c})),n.d(e,"fill",(function(){return l.e})),n.d(e,"addNonEnumerableProperty",(function(){return l.a})),n.d(e,"markFunctionWrapped",(function(){return l.g})),n.d(e,"getOriginalFunction",(function(){return l.f})),n.d(e,"urlEncode",(function(){return l.i})),n.d(e,"convertToPlainObject",(function(){return l.b})),n.d(e,"extractExceptionKeysForMessage",(function(){return l.d})),n.d(e,"dropUndefinedKeys",(function(){return l.c})),n.d(e,"objectify",(function(){return l.h})),n.d(e,"resolve",(function(){return W})),n.d(e,"relative",(function(){return Y})),n.d(e,"normalizePath",(function(){return V})),n.d(e,"isAbsolute",(function(){return J})),n.d(e,"join",(function(){return $})),n.d(e,"dirname",(function(){return X})),n.d(e,"basename",(function(){return Z})),n.d(e,"makePromiseBuffer",(function(){return Q.a})),n.d(e,"severityFromString",(function(){return et})),n.d(e,"createStackParser",(function(){return h.a})),n.d(e,"stripSentryFramesAndReverse",(function(){return h.c})),n.d(e,"getFunctionName",(function(){return h.b})),n.d(e,"eventStatusFromHttpCode",(function(){return nt.a})),n.d(e,"truncate",(function(){return rt.e})),n.d(e,"snipLine",(function(){return rt.d})),n.d(e,"safeJoin",(function(){return rt.c})),n.d(e,"isMatchingPattern",(function(){return rt.b})),n.d(e,"escapeStringForRegex",(function(){return rt.a})),n.d(e,"supportsErrorEvent",(function(){return _})),n.d(e,"supportsDOMError",(function(){return v})),n.d(e,"supportsDOMException",(function(){return g})),n.d(e,"supportsFetch",(function(){return b})),n.d(e,"isNativeFetch",(function(){return y})),n.d(e,"supportsNativeFetch",(function(){return m})),n.d(e,"supportsReportingObserver",(function(){return O})),n.d(e,"supportsReferrerPolicy",(function(){return j})),n.d(e,"supportsHistory",(function(){return E})),n.d(e,"resolvedSyncPromise",(function(){return it.c})),n.d(e,"rejectedSyncPromise",(function(){return it.b})),n.d(e,"SyncPromise",(function(){return it.a})),n.d(e,"dateTimestampInSeconds",(function(){return ot.c})),n.d(e,"timestampInSeconds",(function(){return ot.d})),n.d(e,"timestampWithMs",(function(){return ot.e})),n.d(e,"usingPerformanceAPI",(function(){return ot.f})),n.d(e,"_browserPerformanceTimeOriginMode",(function(){return ot.a})),n.d(e,"browserPerformanceTimeOrigin",(function(){return ot.b})),n.d(e,"TRACEPARENT_REGEXP",(function(){return at})),n.d(e,"extractTraceparentData",(function(){return st})),n.d(e,"isBrowserBundle",(function(){return ut.a})),n.d(e,"createEnvelope",(function(){return ct.b})),n.d(e,"addItemToEnvelope",(function(){return ct.a})),n.d(e,"getEnvelopeType",(function(){return ct.c})),n.d(e,"serializeEnvelope",(function(){return ct.d})),n.d(e,"createClientReportEnvelope",(function(){return ft})),n.d(e,"DEFAULT_RETRY_AFTER",(function(){return dt.a})),n.d(e,"parseRetryAfterHeader",(function(){return dt.d})),n.d(e,"disabledUntil",(function(){return dt.b})),n.d(e,"isRateLimited",(function(){return dt.c})),n.d(e,"updateRateLimits",(function(){return dt.e}));var i=n(18),o=n(26),a=["fatal","error","warning","log","info","debug","critical"],s=n(7),u=n(3),c=n(0),f=n(6),d=n(1),p=n(9),l=n(4),h=n(11);function _(){try{return new ErrorEvent(""),!0}catch(t){return!1}}function v(){try{return new DOMError(""),!0}catch(t){return!1}}function g(){try{return new DOMException(""),!0}catch(t){return!1}}function b(){if(!("fetch"in Object(u.a)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function y(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function m(){if(!b())return!1;var t=Object(u.a)();if(y(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=y(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){f.a&&p.c.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}function O(){return"ReportingObserver"in Object(u.a)()}function j(){if(!b())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}function E(){var t=Object(u.a)(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}var S,w=Object(u.a)(),x={},k={};function T(t){if(!k[t])switch(k[t]=!0,t){case"console":!function(){if(!("console"in w))return;p.a.forEach((function(t){t in w.console&&Object(l.e)(w.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];M("console",{args:n,level:t}),e&&e.apply(w.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in w))return;var t=M.bind(null,"dom"),e=C(t,!0);w.document.addEventListener("click",e,!1),w.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var n=w[e]&&w[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(l.e)(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){var s=C(t);a.handler=s,e.call(this,n,s,i)}a.refCount+=1}catch(t){}return e.call(this,n,r,i)}})),Object(l.e)(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{var i=this.__sentry_instrumentation_handlers__||{},o=i[e];o&&(o.refCount-=1,o.refCount<=0&&(t.call(this,e,o.handler,r),o.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete this.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in w))return;var t=XMLHttpRequest.prototype;Object(l.e)(t,"open",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this,i=e[1],o=r.__sentry_xhr__={method:Object(d.l)(e[0])?e[0].toUpperCase():e[0],url:e[1]};Object(d.l)(i)&&"POST"===o.method&&i.match(/sentry_key/)&&(r.__sentry_own_request__=!0);var a=function(){if(4===r.readyState){try{o.status_code=r.status}catch(t){}M("xhr",{args:e,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:r})}};return"onreadystatechange"in r&&"function"==typeof r.onreadystatechange?Object(l.e)(r,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a(),t.apply(r,e)}})):r.addEventListener("readystatechange",a),t.apply(r,e)}})),Object(l.e)(t,"send",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.__sentry_xhr__&&void 0!==e[0]&&(this.__sentry_xhr__.body=e[0]),M("xhr",{args:e,startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}}))}();break;case"fetch":!function(){if(!m())return;Object(l.e)(w,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:I(e),url:N(e)},startTimestamp:Date.now()};return M("fetch",Object(c.__assign)({},r)),t.apply(w,e).then((function(t){return M("fetch",Object(c.__assign)(Object(c.__assign)({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw M("fetch",Object(c.__assign)(Object(c.__assign)({},r),{endTimestamp:Date.now(),error:t})),t}))}}))}();break;case"history":!function(){if(!E())return;var t=w.onpopstate;function e(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var i=S,o=String(r);S=o,M("history",{from:i,to:o})}return t.apply(this,e)}}w.onpopstate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=w.location.href,i=S;if(S=r,M("history",{from:i,to:r}),t)try{return t.apply(this,e)}catch(t){}},Object(l.e)(w.history,"pushState",e),Object(l.e)(w.history,"replaceState",e)}();break;case"error":A=w.onerror,w.onerror=function(t,e,n,r,i){return M("error",{column:r,error:i,line:n,msg:t,url:e}),!!A&&A.apply(this,arguments)};break;case"unhandledrejection":H=w.onunhandledrejection,w.onunhandledrejection=function(t){return M("unhandledrejection",t),!H||H.apply(this,arguments)};break;default:return void(f.a&&p.c.warn("unknown instrumentation type:",t))}}function P(t,e){x[t]=x[t]||[],x[t].push(e),T(t)}function M(t,e){var n,r;if(t&&x[t])try{for(var i=Object(c.__values)(x[t]||[]),o=i.next();!o.done;o=i.next()){var a=o.value;try{a(e)}catch(e){f.a&&p.c.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+Object(h.b)(a)+"\nError:",e)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function I(t){return void 0===t&&(t=[]),"Request"in w&&Object(d.g)(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function N(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in w&&Object(d.g)(t[0],Request)?t[0].url:String(t[0])}var R,D;function C(t,e){return void 0===e&&(e=!1),function(n){if(n&&D!==n&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===R||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(D,n))&&(t({event:n,name:r,global:e}),D=n),clearTimeout(R),R=w.setTimeout((function(){R=void 0}),1e3)}}}var A=null;var H=null;var F=n(19),L=n(25),U=n(10),B=n(27);function q(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var G=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;function z(t){var e=G.exec(t);return e?e.slice(1):[]}function W(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",r=!1,i=t.length-1;i>=-1&&!r;i--){var o=i>=0?t[i]:"/";o&&(n=o+"/"+n,r="/"===o.charAt(0))}return(r?"/":"")+(n=q(n.split("/").filter((function(t){return!!t})),!r).join("/"))||"."}function K(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}function Y(t,e){t=W(t).substr(1),e=W(e).substr(1);for(var n=K(t.split("/")),r=K(e.split("/")),i=Math.min(n.length,r.length),o=i,a=0;a<i;a++)if(n[a]!==r[a]){o=a;break}var s=[];for(a=o;a<n.length;a++)s.push("..");return(s=s.concat(r.slice(o))).join("/")}function V(t){var e=J(t),n="/"===t.substr(-1),r=q(t.split("/").filter((function(t){return!!t})),!e).join("/");return r||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r}function J(t){return"/"===t.charAt(0)}function $(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t.join("/"))}function X(t){var e=z(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function Z(t,e){var n=z(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n}var Q=n(28),tt=n(14);function et(t){return"warn"===t?tt.a.Warning:function(t){return-1!==a.indexOf(t)}(t)?t:tt.a.Log}var nt=n(30),rt=n(8),it=n(12),ot=n(16),at=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function st(t){var e=t.match(at);if(e){var n=void 0;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}}var ut=n(17),ct=n(20);function ft(t,e,n){var r=[{type:"client_report"},{timestamp:n||Object(ot.c)(),discarded_events:t}];return Object(ct.b)(e?{dsn:e}:{},[r])}var dt=n(29)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(10),i={};function o(){return Object(r.b)()?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(t,e,n){var r=n||o(),i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}}).call(this,n(24))},function(t,e,n){"use strict";n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"f",(function(){return f})),n.d(e,"i",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"d",(function(){return _})),n.d(e,"c",(function(){return v})),n.d(e,"h",(function(){return g}));var r=n(0),i=n(18),o=n(1),a=n(8);function s(t,e,n){if(e in t){var r=t[e],i=n(r);if("function"==typeof i)try{c(i,r)}catch(t){}t[e]=i}}function u(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function c(t,e){var n=e.prototype||{};t.prototype=e.prototype=n,u(t,"__sentry_original__",e)}function f(t){return t.__sentry_original__}function d(t){return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")}function p(t){var e=t;if(Object(o.d)(t))e=Object(r.__assign)({message:t.message,name:t.name,stack:t.stack},h(t));else if(Object(o.f)(t)){var n=t;e=Object(r.__assign)({type:n.type,target:l(n.target),currentTarget:l(n.currentTarget)},h(n)),"undefined"!=typeof CustomEvent&&Object(o.g)(t,CustomEvent)&&(e.detail=n.detail)}return e}function l(t){try{return Object(o.c)(t)?Object(i.b)(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}}function h(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function _(t,e){void 0===e&&(e=40);var n=Object.keys(p(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Object(a.e)(n[0],e);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:Object(a.e)(i,e)}return""}function v(t){var e,n;if(Object(o.i)(t)){var i={};try{for(var a=Object(r.__values)(Object.keys(t)),s=a.next();!s.done;s=a.next()){var u=s.value;void 0!==t[u]&&(i[u]=v(t[u]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i}return Array.isArray(t)?t.map(v):t}function g(t){var e;switch(!0){case null==t:e=new String(t);break;case"symbol"==typeof t||"bigint"==typeof t:e=Object(t);break;case Object(o.j)(t):e=new t.constructor(t);break;default:e=t}return e}},function(t,e,n){"use strict";n.r(e),n.d(e,"addBreadcrumb",(function(){return M})),n.d(e,"captureException",(function(){return x})),n.d(e,"captureEvent",(function(){return T})),n.d(e,"captureMessage",(function(){return k})),n.d(e,"configureScope",(function(){return P})),n.d(e,"startTransaction",(function(){return F})),n.d(e,"setContext",(function(){return I})),n.d(e,"setExtra",(function(){return D})),n.d(e,"setExtras",(function(){return N})),n.d(e,"setTag",(function(){return C})),n.d(e,"setTags",(function(){return R})),n.d(e,"setUser",(function(){return A})),n.d(e,"withScope",(function(){return H})),n.d(e,"addGlobalEventProcessor",(function(){return _})),n.d(e,"getCurrentHub",(function(){return O})),n.d(e,"getHubFromCarrier",(function(){return E})),n.d(e,"Hub",(function(){return b})),n.d(e,"makeMain",(function(){return m})),n.d(e,"Scope",(function(){return l})),n.d(e,"Session",(function(){return g})),n.d(e,"API",(function(){return U})),n.d(e,"getEnvelopeEndpointWithUrlEncodedAuth",(function(){return Y})),n.d(e,"getStoreEndpointWithUrlEncodedAuth",(function(){return K})),n.d(e,"getRequestHeaders",(function(){return V})),n.d(e,"initAPIDetails",(function(){return B})),n.d(e,"getReportDialogEndpoint",(function(){return J})),n.d(e,"BaseClient",(function(){return it})),n.d(e,"BaseBackend",(function(){return pt})),n.d(e,"eventToSentryRequest",(function(){return ft})),n.d(e,"sessionToSentryRequest",(function(){return ct})),n.d(e,"initAndBind",(function(){return lt})),n.d(e,"NoopTransport",(function(){return dt})),n.d(e,"createTransport",(function(){return gt})),n.d(e,"SDK_VERSION",(function(){return mt})),n.d(e,"Integrations",(function(){return r}));var r={};n.r(r),n.d(r,"FunctionToString",(function(){return Ot})),n.d(r,"InboundFilters",(function(){return Et}));var i=n(0),o=n(25),a=n(16),s=n(9),u=n(3),c=n(10),f="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,d=n(1),p=n(12),l=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return t.clone=function(e){var n=new t;return e&&(n._breadcrumbs=Object(i.__spread)(e._breadcrumbs),n._tags=Object(i.__assign)({},e._tags),n._extra=Object(i.__assign)({},e._extra),n._contexts=Object(i.__assign)({},e._contexts),n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=Object(i.__spread)(e._eventProcessors),n._requestSession=e._requestSession),n},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.getRequestSession=function(){return this._requestSession},t.prototype.setRequestSession=function(t){return this._requestSession=t,this},t.prototype.setTags=function(t){return this._tags=Object(i.__assign)(Object(i.__assign)({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var n;return this._tags=Object(i.__assign)(Object(i.__assign)({},this._tags),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=Object(i.__assign)(Object(i.__assign)({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var n;return this._extra=Object(i.__assign)(Object(i.__assign)({},this._extra),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this._contexts[t]:this._contexts=Object(i.__assign)(Object(i.__assign)({},this._contexts),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t=this.getSpan();return t&&t.transaction},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags=Object(i.__assign)(Object(i.__assign)({},this._tags),e._tags),this._extra=Object(i.__assign)(Object(i.__assign)({},this._extra),e._extra),this._contexts=Object(i.__assign)(Object(i.__assign)({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):Object(d.i)(e)&&(e=e,this._tags=Object(i.__assign)(Object(i.__assign)({},this._tags),e.tags),this._extra=Object(i.__assign)(Object(i.__assign)({},this._extra),e.extra),this._contexts=Object(i.__assign)(Object(i.__assign)({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var n="number"==typeof e?Math.min(e,100):100;if(n<=0)return this;var r=Object(i.__assign)({timestamp:Object(a.c)()},t);return this._breadcrumbs=Object(i.__spread)(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){if(this._extra&&Object.keys(this._extra).length&&(t.extra=Object(i.__assign)(Object(i.__assign)({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=Object(i.__assign)(Object(i.__assign)({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=Object(i.__assign)(Object(i.__assign)({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=Object(i.__assign)(Object(i.__assign)({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=Object(i.__assign)({trace:this._span.getTraceContext()},t.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(t.tags=Object(i.__assign)({transaction:n},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=Object(i.__spread)(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(Object(i.__spread)(h(),this._eventProcessors),t,e)},t.prototype.setSDKProcessingMetadata=function(t){return this._sdkProcessingMetadata=Object(i.__assign)(Object(i.__assign)({},this._sdkProcessingMetadata),t),this},t.prototype._notifyEventProcessors=function(t,e,n,r){var o=this;return void 0===r&&(r=0),new p.a((function(a,s){var u=t[r];if(null===e||"function"!=typeof u)a(e);else{var c=u(Object(i.__assign)({},e),n);Object(d.n)(c)?c.then((function(e){return o._notifyEventProcessors(t,e,n,r+1).then(a)})).then(null,s):o._notifyEventProcessors(t,c,n,r+1).then(a).then(null,s)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function h(){return Object(u.b)("globalEventProcessors",(function(){return[]}))}function _(t){h().push(t)}var v=n(4),g=function(){function t(t){this.errors=0,this.sid=Object(o.i)(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var e=Object(a.d)();this.timestamp=e,this.started=e,t&&this.update(t)}return t.prototype.update=function(t){if(void 0===t&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Object(a.d)(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:Object(o.i)()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{var e=this.timestamp-this.started;this.duration=e>=0?e:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):"ok"===this.status?this.update({status:"exited"}):this.update()},t.prototype.toJSON=function(){return Object(v.c)({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},t}(),b=function(){function t(t,e,n){void 0===e&&(e=new l),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=l.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var n=this._lastEventId=e&&e.event_id?e.event_id:Object(o.i)(),r=e;if(!e){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(t){a=t}r={originalException:t,syntheticException:a}}return this._invokeClient("captureException",t,Object(i.__assign)(Object(i.__assign)({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this._lastEventId=n&&n.event_id?n.event_id:Object(o.i)(),a=n;if(!n){var s=void 0;try{throw new Error(t)}catch(t){s=t}a={originalException:t,syntheticException:s}}return this._invokeClient("captureMessage",t,e,Object(i.__assign)(Object(i.__assign)({},a),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=e&&e.event_id?e.event_id:Object(o.i)();return"transaction"!==t.type&&(this._lastEventId=n),this._invokeClient("captureEvent",t,Object(i.__assign)(Object(i.__assign)({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var u=o.getOptions&&o.getOptions()||{},c=u.beforeBreadcrumb,f=void 0===c?null:c,d=u.maxBreadcrumbs,p=void 0===d?100:d;if(!(p<=0)){var l=Object(a.c)(),h=Object(i.__assign)({timestamp:l},t),_=f?Object(s.b)((function(){return f(h,e)})):h;null!==_&&r.addBreadcrumb(_,p)}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=m(this);try{t(this)}finally{m(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return f&&s.c.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},t.prototype.endSession=function(){var t=this.getStackTop(),e=t&&t.scope,n=e&&e.getSession();n&&n.close(),this._sendSessionUpdate(),e&&e.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),n=e.scope,r=e.client,o=r&&r.getOptions()||{},a=o.release,s=o.environment,c=(Object(u.a)().navigator||{}).userAgent,f=new g(Object(i.__assign)(Object(i.__assign)(Object(i.__assign)({release:a,environment:s},n&&{user:n.getUser()}),c&&{userAgent:c}),t));if(n){var d=n.getSession&&n.getSession();d&&"ok"===d.status&&d.update({status:"exited"}),this.endSession(),n.setSession(f)}return f},t.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},t.prototype._invokeClient=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),a=o.scope,s=o.client;s&&s[t]&&(e=s)[t].apply(e,Object(i.__spread)(n,[a]))},t.prototype._callExtensionMethod=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=y(),i=r.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[t])return i.extensions[t].apply(this,e);f&&s.c.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function y(){var t=Object(u.a)();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function m(t){var e=y(),n=E(e);return S(e,t),n}function O(){var t=y();return j(t)&&!E(t).isOlderThan(4)||S(t,new b),Object(c.b)()?function(t){try{var e=y().__SENTRY__,n=e&&e.extensions&&e.extensions.domain&&e.extensions.domain.active;if(!n)return E(t);if(!j(n)||E(n).isOlderThan(4)){var r=E(t).getStackTop();S(n,new b(r.client,l.clone(r.scope)))}return E(n)}catch(e){return E(t)}}(t):E(t)}function j(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function E(t){return Object(u.b)("hub",(function(){return new b}),t)}function S(t,e){return!!t&&((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0)}function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=O();if(r&&r[t])return r[t].apply(r,Object(i.__spread)(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function x(t,e){return w("captureException",t,{captureContext:e,originalException:t,syntheticException:new Error("Sentry syntheticException")})}function k(t,e){var n=new Error(t),r="string"!=typeof e?{captureContext:e}:void 0;return w("captureMessage",t,"string"==typeof e?e:void 0,Object(i.__assign)({originalException:t,syntheticException:n},r))}function T(t){return w("captureEvent",t)}function P(t){w("configureScope",t)}function M(t){w("addBreadcrumb",t)}function I(t,e){w("setContext",t,e)}function N(t){w("setExtras",t)}function R(t){w("setTags",t)}function D(t,e){w("setExtra",t,e)}function C(t,e){w("setTag",t,e)}function A(t){w("setUser",t)}function H(t){w("withScope",t)}function F(t,e){return w("startTransaction",Object(i.__assign)({},t),e)}var L=n(26),U=function(){function t(t,e,n){void 0===e&&(e={}),this.dsn=t,this._dsnObject=Object(L.b)(t),this.metadata=e,this._tunnel=n}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.forceEnvelope=function(){return!!this._tunnel},t.prototype.getBaseApiEndpoint=function(){return q(this._dsnObject)},t.prototype.getStoreEndpoint=function(){return W(this._dsnObject)},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return K(this._dsnObject)},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return Y(this._dsnObject,this._tunnel)},t}();function B(t,e,n){return{initDsn:t,metadata:e||{},dsn:Object(L.b)(t),tunnel:n}}function q(t){var e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"}function G(t,e){return""+q(t)+t.projectId+"/"+e+"/"}function z(t){return Object(v.i)({sentry_key:t.publicKey,sentry_version:"7"})}function W(t){return G(t,"store")}function K(t){return W(t)+"?"+z(t)}function Y(t,e){return e||function(t){return G(t,"envelope")}(t)+"?"+z(t)}function V(t,e,n){var r=["Sentry sentry_version=7"];return r.push("sentry_client="+e+"/"+n),r.push("sentry_key="+t.publicKey),t.pass&&r.push("sentry_secret="+t.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}}function J(t,e){var n=Object(L.b)(t),r=q(n)+"embed/error-page/",i="dsn="+Object(L.a)(n);for(var o in e)if("dsn"!==o)if("user"===o){if(!e.user)continue;e.user.name&&(i+="&name="+encodeURIComponent(e.user.name)),e.user.email&&(i+="&email="+encodeURIComponent(e.user.email))}else i+="&"+encodeURIComponent(o)+"="+encodeURIComponent(e[o]);return r+"?"+i}var $=n(27),X=n(8),Z=n(7),Q="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,tt=[];function et(t){return t.reduce((function(t,e){return t.every((function(t){return e.name!==t.name}))&&t.push(e),t}),[])}function nt(t){var e={};return function(t){var e=t.defaultIntegrations&&Object(i.__spread)(t.defaultIntegrations)||[],n=t.integrations,r=Object(i.__spread)(et(e));Array.isArray(n)?r=Object(i.__spread)(r.filter((function(t){return n.every((function(e){return e.name!==t.name}))})),et(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(t){return t.name}));return-1!==o.indexOf("Debug")&&r.push.apply(r,Object(i.__spread)(r.splice(o.indexOf("Debug"),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===tt.indexOf(t.name)&&(t.setupOnce(_,O),tt.push(t.name),Q&&s.c.log("Integration installed: "+t.name))}(t)})),Object(v.a)(e,"initialized",!0),e}var rt="Not capturing exception because it's already been captured.",it=function(){function t(t,e){this._integrations={},this._numProcessing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=Object(L.b)(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this;if(!Object(o.d)(t)){var i=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return r._captureEvent(t,e,n)})).then((function(t){i=t}))),i}Q&&s.c.log(rt)},t.prototype.captureMessage=function(t,e,n,r){var i=this,o=n&&n.event_id,a=Object(d.j)(t)?this._getBackend().eventFromMessage(String(t),e,n):this._getBackend().eventFromException(t,n);return this._process(a.then((function(t){return i._captureEvent(t,n,r)})).then((function(t){o=t}))),o},t.prototype.captureEvent=function(t,e,n){if(!(e&&e.originalException&&Object(o.d)(e.originalException))){var r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((function(t){r=t}))),r}Q&&s.c.log(rt)},t.prototype.captureSession=function(t){this._isEnabled()?"string"!=typeof t.release?Q&&s.c.warn("Discarded session because of missing or non-string release"):(this._sendSession(t),t.update({init:!1})):Q&&s.c.warn("SDK not enabled, will not capture session.")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.getTransport=function(){return this._getBackend().getTransport()},t.prototype.flush=function(t){var e=this;return this._isClientDoneProcessing(t).then((function(n){return e.getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=nt(this._options))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return Q&&s.c.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var n,r,o=!1,a=!1,s=e.exception&&e.exception.values;if(s){a=!0;try{for(var u=Object(i.__values)(s),c=u.next();!c.done;c=u.next()){var f=c.value.mechanism;if(f&&!1===f.handled){o=!0;break}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}var d="ok"===t.status;(d&&0===t.errors||d&&o)&&(t.update(Object(i.__assign)(Object(i.__assign)({},o&&{status:"crashed"}),{errors:t.errors||Number(a||o)})),this.captureSession(t))},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientDoneProcessing=function(t){var e=this;return new p.a((function(n){var r=0,i=setInterval((function(){0==e._numProcessing?(clearInterval(i),n(!0)):(r+=1,t&&r>=t&&(clearInterval(i),n(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,n){var r=this,s=this.getOptions(),u=s.normalizeDepth,c=void 0===u?3:u,f=s.normalizeMaxBreadth,d=void 0===f?1e3:f,h=Object(i.__assign)(Object(i.__assign)({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:Object(o.i)()),timestamp:t.timestamp||Object(a.c)()});this._applyClientOptions(h),this._applyIntegrationsMetadata(h);var _=e;n&&n.captureContext&&(_=l.clone(_).update(n.captureContext));var v=Object(p.c)(h);return _&&(v=_.applyToEvent(h,n)),v.then((function(t){return t&&(t.sdkProcessingMetadata=Object(i.__assign)(Object(i.__assign)({},t.sdkProcessingMetadata),{normalizeDepth:Object($.a)(c)+" ("+typeof c+")"})),"number"==typeof c&&c>0?r._normalizeEvent(t,c,d):t}))},t.prototype._normalizeEvent=function(t,e,n){if(!t)return null;var r=Object(i.__assign)(Object(i.__assign)(Object(i.__assign)(Object(i.__assign)(Object(i.__assign)({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return Object(i.__assign)(Object(i.__assign)({},t),t.data&&{data:Object($.a)(t.data,e,n)})}))}),t.user&&{user:Object($.a)(t.user,e,n)}),t.contexts&&{contexts:Object($.a)(t.contexts,e,n)}),t.extra&&{extra:Object($.a)(t.extra,e,n)});return t.contexts&&t.contexts.trace&&(r.contexts.trace=t.contexts.trace),r.sdkProcessingMetadata=Object(i.__assign)(Object(i.__assign)({},r.sdkProcessingMetadata),{baseClientNormalized:!0}),r},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),n=e.environment,r=e.release,i=e.dist,o=e.maxValueLength,a=void 0===o?250:o;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=Object(X.e)(t.message,a));var s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=Object(X.e)(s.value,a));var u=t.request;u&&u.url&&(u.url=Object(X.e)(u.url,a))},t.prototype._applyIntegrationsMetadata=function(t){var e=Object.keys(this._integrations);e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=Object(i.__spread)(t.sdk.integrations||[],e))},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,n){return this._processEvent(t,e,n).then((function(t){return t.event_id}),(function(t){Q&&s.c.error(t)}))},t.prototype._processEvent=function(t,e,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate,s=this.getTransport();function u(t,e){s.recordLostEvent&&s.recordLostEvent(t,e)}if(!this._isEnabled())return Object(p.b)(new Z.a("SDK not enabled, will not capture event."));var c="transaction"===t.type;return!c&&"number"==typeof a&&Math.random()>a?(u("sample_rate","event"),Object(p.b)(new Z.a("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(t,n,e).then((function(n){if(null===n)throw u("event_processor",t.type||"event"),new Z.a("An event processor returned null, will not send event.");return e&&e.data&&!0===e.data.__sentry__||c||!o?n:function(t){var e="`beforeSend` method has to return `null` or a valid event.";if(Object(d.n)(t))return t.then((function(t){if(!Object(d.i)(t)&&null!==t)throw new Z.a(e);return t}),(function(t){throw new Z.a("beforeSend rejected with "+t)}));if(!Object(d.i)(t)&&null!==t)throw new Z.a(e);return t}(o(n,e))})).then((function(e){if(null===e)throw u("before_send",t.type||"event"),new Z.a("`beforeSend` returned `null`, will not send event.");var i=n&&n.getSession&&n.getSession();return!c&&i&&r._updateSessionFromEvent(i,e),r._sendEvent(e),e})).then(null,(function(t){if(t instanceof Z.a)throw t;throw r.captureException(t,{data:{__sentry__:!0},originalException:t}),new Z.a("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._numProcessing+=1,t.then((function(t){return e._numProcessing-=1,t}),(function(t){return e._numProcessing-=1,t}))},t}();var ot=n(20);function at(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function st(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=Object(i.__spread)(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=Object(i.__spread)(t.sdk.packages||[],e.packages||[]),t):t}function ut(t,e){var n=at(e),r=Object(i.__assign)(Object(i.__assign)({sent_at:(new Date).toISOString()},n&&{sdk:n}),!!e.tunnel&&{dsn:Object(L.a)(e.dsn)}),o="aggregates"in t?"sessions":"session",a=[{type:o},t];return[Object(ot.b)(r,[a]),o]}function ct(t,e){var n=Object(i.__read)(ut(t,e),2),r=n[0],o=n[1];return{body:Object(ot.d)(r),type:o,url:Y(e.dsn,e.tunnel)}}function ft(t,e){var n,r=at(e),o=t.type||"event",a="transaction"===o||!!e.tunnel,s=(t.sdkProcessingMetadata||{}).transactionSampling||{},u=s.method,c=s.rate;st(t,e.metadata.sdk),t.tags=t.tags||{},t.extra=t.extra||{},t.sdkProcessingMetadata&&t.sdkProcessingMetadata.baseClientNormalized||(t.tags.skippedNormalization=!0,t.extra.normalizeDepth=t.sdkProcessingMetadata?t.sdkProcessingMetadata.normalizeDepth:"unset"),delete t.sdkProcessingMetadata;try{n=JSON.stringify(t)}catch(e){t.tags.JSONStringifyError=!0,t.extra.JSONStringifyError=e;try{n=JSON.stringify(Object($.a)(t))}catch(t){var f=t;n=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:f.message,stack:f.stack}})}}var d={body:n,type:o,url:a?Y(e.dsn,e.tunnel):K(e.dsn)};if(a){var p=Object(i.__assign)(Object(i.__assign)({event_id:t.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!e.tunnel&&{dsn:Object(L.a)(e.dsn)}),l=[{type:o,sample_rates:[{id:u,rate:c}]},d.body],h=Object(ot.b)(p,[l]);d.body=Object(ot.d)(h)}return d}var dt=function(){function t(){}return t.prototype.sendEvent=function(t){return Object(p.c)({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},t.prototype.close=function(t){return Object(p.c)(!0)},t}(),pt=function(){function t(t){this._options=t,this._options.dsn||Q&&s.c.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new Z.a("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new Z.a("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var e=function(t,e){var n=at(e),r=t.type||"event",o=(t.sdkProcessingMetadata||{}).transactionSampling||{},a=o.method,s=o.rate;st(t,e.metadata.sdk),t.tags=t.tags||{},t.extra=t.extra||{},t.sdkProcessingMetadata&&t.sdkProcessingMetadata.baseClientNormalized||(t.tags.skippedNormalization=!0,t.extra.normalizeDepth=t.sdkProcessingMetadata?t.sdkProcessingMetadata.normalizeDepth:"unset"),delete t.sdkProcessingMetadata;var u=Object(i.__assign)(Object(i.__assign)({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),!!e.tunnel&&{dsn:Object(L.a)(e.dsn)}),c=[{type:r,sample_rates:[{id:a,rate:s}]},t];return Object(ot.b)(u,[c])}(t,B(this._options.dsn,this._options._metadata,this._options.tunnel));this._newTransport.send(e).then(null,(function(t){Q&&s.c.error("Error while sending event:",t)}))}else this._transport.sendEvent(t).then(null,(function(t){Q&&s.c.error("Error while sending event:",t)}))},t.prototype.sendSession=function(t){if(this._transport.sendSession)if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var e=B(this._options.dsn,this._options._metadata,this._options.tunnel),n=Object(i.__read)(ut(t,e),1)[0];this._newTransport.send(n).then(null,(function(t){Q&&s.c.error("Error while sending session:",t)}))}else this._transport.sendSession(t).then(null,(function(t){Q&&s.c.error("Error while sending session:",t)}));else Q&&s.c.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new dt},t}();function lt(t,e){!0===e.debug&&(Q?s.c.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=O(),r=n.getScope();r&&r.update(e.initialScope);var i=new t(e);n.bindClient(i)}var ht=n(28),_t=n(29),vt=n(30);function gt(t,e,n){void 0===n&&(n=Object(ht.a)(t.bufferSize||30));var r={};return{send:function(t){var i=Object(ot.c)(t),o="event"===i?"error":i,a={category:o,body:Object(ot.d)(t)};return Object(_t.c)(r,o)?Object(p.b)({status:"rate_limit",reason:bt(r,o)}):n.add((function(){return e(a).then((function(t){var e=t.body,n=t.headers,i=t.reason,a=t.statusCode,s=Object(vt.a)(a);return n&&(r=Object(_t.e)(r,n)),"success"===s?Object(p.c)({status:s,reason:i}):Object(p.b)({status:s,reason:i||e||("rate_limit"===s?bt(r,o):"Unknown transport error")})}))}))},flush:function(t){return n.drain(t)}}}function bt(t,e){return"Too many "+e+" requests, backing off until: "+new Date(Object(_t.b)(t,e)).toISOString()}var yt,mt="6.19.7",Ot=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){yt=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object(v.f)(this)||this;return yt.apply(n,t)}},t.id="FunctionToString",t}(),jt=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Et=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(e,n){e((function(e){var r=n();if(r){var a=r.getIntegration(t);if(a){var u=r.getClient(),c=u?u.getOptions():{};return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return Q&&s.c.warn("Event dropped due to being internal Sentry Error.\nEvent: "+Object(o.e)(t)),!0;if(function(t,e){if(!e||!e.length)return!1;return function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,i=e.value,a=void 0===i?"":i;return[""+a,r+": "+a]}catch(e){return Q&&s.c.error("Cannot extract message for event "+Object(o.e)(t)),[]}return[]}(t).some((function(t){return e.some((function(e){return Object(X.b)(t,e)}))}))}(t,e.ignoreErrors))return Q&&s.c.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+Object(o.e)(t)),!0;if(function(t,e){if(!e||!e.length)return!1;var n=wt(t);return!!n&&e.some((function(t){return Object(X.b)(n,t)}))}(t,e.denyUrls))return Q&&s.c.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+Object(o.e)(t)+".\nUrl: "+wt(t)),!0;if(!function(t,e){if(!e||!e.length)return!0;var n=wt(t);return!n||e.some((function(t){return Object(X.b)(n,t)}))}(t,e.allowUrls))return Q&&s.c.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+Object(o.e)(t)+".\nUrl: "+wt(t)),!0;return!1}(e,function(t,e){void 0===t&&(t={});void 0===e&&(e={});return{allowUrls:Object(i.__spread)(t.whitelistUrls||[],t.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:Object(i.__spread)(t.blacklistUrls||[],t.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:Object(i.__spread)(t.ignoreErrors||[],e.ignoreErrors||[],jt),ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(a._options,c))?null:e}}return e}))},t.id="InboundFilters",t}();function St(t){void 0===t&&(t=[]);for(var e=t.length-1;e>=0;e--){var n=t[e];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}function wt(t){try{if(t.stacktrace)return St(t.stacktrace.frames);var e;try{e=t.exception.values[0].stacktrace.frames}catch(t){}return e?St(e):null}catch(e){return Q&&s.c.error("Cannot extract url for event "+Object(o.e)(t)),null}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);return t});var o=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,i(r,n.prototype),r}return Object(r.__extends)(e,t),e}(Error)},function(t,e,n){"use strict";n.d(e,"e",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(1);function i(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function o(t,e){var n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);var i=Math.max(e-60,0);i<5&&(i=0);var o=Math.min(i+140,r);return o>r-5&&(o=r),o===r&&(i=Math.max(o-140,0)),n=n.slice(i,o),i>0&&(n="'{snip} "+n),o<r&&(n+=" {snip}"),n}function a(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var i=t[r];try{n.push(String(i))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function s(t,e){return!!Object(r.l)(t)&&(Object(r.k)(e)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e))}function u(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return r}));var r,i=n(0),o=n(6),a=n(3),s=Object(a.a)(),u=["debug","info","warn","error","log","assert"];function c(t){var e=Object(a.a)();if(!("console"in e))return t();var n=e.console,r={};u.forEach((function(t){var i=n[t]&&n[t].__sentry_original__;t in e.console&&i&&(r[t]=n[t],n[t]=i)}));try{return t()}finally{Object.keys(r).forEach((function(t){n[t]=r[t]}))}}function f(){var t=!1,e={enable:function(){t=!0},disable:function(){t=!1}};return o.a?u.forEach((function(n){e[n]=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t&&c((function(){var t;(t=s.console)[n].apply(t,Object(i.__spread)(["Sentry Logger ["+n+"]:"],e))}))}})):u.forEach((function(t){e[t]=function(){}})),e}r=o.a?Object(a.b)("logger",f):f()},function(t,e,n){"use strict";(function(t,r){n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s}));var i=n(17);function o(){return!Object(i.a)()&&"[object process]"===Object.prototype.toString.call(void 0!==t?t:0)}function a(t,e){return t.require(e)}function s(t){var e;try{e=a(r,t)}catch(t){}try{var n=a(r,"process").cwd;e=a(r,n()+"/node_modules/"+t)}catch(t){}return e}}).call(this,n(39),n(23)(t))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(0);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.sort((function(t,e){return t[0]-e[0]})).map((function(t){return t[1]}));return function(t,e){var i,a,s,u;void 0===e&&(e=0);var c=[];try{for(var f=Object(r.__values)(t.split("\n").slice(e)),d=f.next();!d.done;d=f.next()){var p=d.value;try{for(var l=(s=void 0,Object(r.__values)(n)),h=l.next();!h.done;h=l.next()){var _=(0,h.value)(p);if(_){c.push(_);break}}}catch(t){s={error:t}}finally{try{h&&!h.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}}}catch(t){i={error:t}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return o(c)}}function o(t){if(!t.length)return[];var e=t,n=e[0].function||"",i=e[e.length-1].function||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==i.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return Object(r.__assign)(Object(r.__assign)({},t),{filename:t.filename||e[0].filename,function:t.function||"?"})})).reverse()}function a(t){try{return t&&"function"==typeof t&&t.name||"<anonymous>"}catch(t){return"<anonymous>"}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(1);function i(t){return new a((function(e){e(t)}))}function o(t){return new a((function(e,n){n(t)}))}var a=function(){function t(t){var e=this;this._state=0,this._handlers=[],this._resolve=function(t){e._setResult(1,t)},this._reject=function(t){e._setResult(2,t)},this._setResult=function(t,n){0===e._state&&(Object(r.n)(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._executeHandlers=function(){if(0!==e._state){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t[0]||(1===e._state&&t[1](e._value),2===e._state&&t[2](e._value),t[0]=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.prototype.then=function(e,n){var r=this;return new t((function(t,i){r._handlers.push([!1,function(n){if(e)try{t(e(n))}catch(t){i(t)}else t(n)},function(e){if(n)try{t(n(e))}catch(t){i(t)}else i(e)}]),r._executeHandlers()}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var i,o;return n.then((function(t){o=!1,i=t,e&&e()}),(function(t){o=!0,i=t,e&&e()})).then((function(){o?r(i):t(i)}))}))},t}()},,function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(r||(r={}));var i=["fatal","error","warning","log","info","debug","critical"]},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.appName=e.sdk=void 0;var n=function(){var t={request:function(){},httpRequest:function(){},getSystemInfoSync:function(){}};if("object"==typeof wx)t=wx;else if("object"==typeof my)t=my;else if("object"==typeof tt)t=tt;else if("object"==typeof dd)t=dd;else if("object"==typeof qq)t=qq;else{if("object"!=typeof swan)throw new Error("sentry-miniapp 暂不支持此平台");t=swan}return t}();e.sdk=n;var r,i=(r="unknown","object"==typeof wx?r="wechat":"object"==typeof my?r="alipay":"object"==typeof tt?r="bytedance":"object"==typeof dd?r="dingtalk":"object"==typeof qq?r="qq":"object"==typeof swan&&(r="swan"),r);e.appName=i},function(t,e,n){"use strict";(function(t){n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return f})),n.d(e,"e",(function(){return d})),n.d(e,"f",(function(){return p})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return l}));var r=n(3),i=n(10),o={nowSeconds:function(){return Date.now()/1e3}};var a,s=Object(i.b)()?function(){try{return Object(i.a)(t,"perf_hooks").performance}catch(t){return}}():function(){var t=Object(r.a)().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),u=void 0===s?o:{nowSeconds:function(){return(s.timeOrigin+s.now())/1e3}},c=o.nowSeconds.bind(o),f=u.nowSeconds.bind(u),d=f,p=void 0!==s,l=function(){var t=Object(r.a)().performance;if(t&&t.now){var e=t.now(),n=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+e-n):36e5,o=i<36e5,s=t.timing&&t.timing.navigationStart,u="number"==typeof s?Math.abs(s+e-n):36e5;return o||u<36e5?i<=u?(a="timeOrigin",t.timeOrigin):(a="navigationStart",s):(a="dateNow",n)}a="none"}()}).call(this,n(23)(t))},function(t,e,n){"use strict";function r(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var r=n(3),i=n(1);function o(t,e){try{for(var n=t,r=[],i=0,o=0,s=" > ".length,u=void 0;n&&i++<5&&!("html"===(u=a(n,e))||i>1&&o+r.length*s+u.length>=80);)r.push(u),o+=u.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}function a(t,e){var n,r,o,a,s,u=t,c=[];if(!u||!u.tagName)return"";c.push(u.tagName.toLowerCase());var f=e&&e.length?e.filter((function(t){return u.getAttribute(t)})).map((function(t){return[t,u.getAttribute(t)]})):null;if(f&&f.length)f.forEach((function(t){c.push("["+t[0]+'="'+t[1]+'"]')}));else if(u.id&&c.push("#"+u.id),(n=u.className)&&Object(i.l)(n))for(r=n.split(/\s+/),s=0;s<r.length;s++)c.push("."+r[s]);var d=["type","name","title","alt"];for(s=0;s<d.length;s++)o=d[s],(a=u.getAttribute(o))&&c.push("["+o+'="'+a+'"]');return c.join("")}function s(){var t=Object(r.a)();try{return t.document.location.href}catch(t){return""}}},function(t,e,n){"use strict";function r(){var t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(var r=0;r<e.length;r++){if(e[r]===n)return!0}return e.push(n),!1},function(n){if(t)e.delete(n);else for(var r=0;r<e.length;r++)if(e[r]===n){e.splice(r,1);break}}]}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return u}));var r=n(0),i=n(1);function o(t,e){return void 0===e&&(e=[]),[t,e]}function a(t,e){var n=Object(r.__read)(t,2),i=n[0],o=n[1];return[i,Object(r.__spread)(o,[e])]}function s(t){var e=Object(r.__read)(t,2),n=Object(r.__read)(e[1],1);return Object(r.__read)(n[0],1)[0].type}function u(t){var e=Object(r.__read)(t,2),n=e[0],o=e[1],a=JSON.stringify(n);return o.reduce((function(t,e){var n=Object(r.__read)(e,2),o=n[0],a=n[1],s=Object(i.j)(a)?String(a):JSON.stringify(a);return t+"\n"+JSON.stringify(o)+"\n"+s}),a)}},function(t,e,n){"use strict";n.r(e);var r=n(14);n.d(e,"Severity",(function(){return r.a})),n.d(e,"SeverityLevels",(function(){return r.b}))},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.computeStackTrace=void 0;var r=n(0),i=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[-a-z]+:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,u=/\((\S*)(?::(\d+))(?::(\d+))\)/,c=/^\s*at (\w.*) \((\w*.js):(\d*):(\d*)/i;function f(t,e){try{return r.__assign(r.__assign({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function d(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}e.computeStackTrace=function(t){var e=null,n=t&&t.framesToPop;try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=t.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),a=[],s=0;s<o.length;s+=2){var u=null;(e=r.exec(o[s]))?u={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=i.exec(o[s]))&&(u={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),u&&(!u.func&&u.line&&(u.func="?"),a.push(u))}if(!a.length)return null;return{message:d(t),name:t.name,stack:a}}(t))return f(e,n)}catch(t){}try{if(e=function(t){if(!t||!t.stack)return null;for(var e,n,r,f=[],p=t.stack.split("\n"),l=0;l<p.length;++l){if(n=i.exec(p[l])){var h=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(e=u.exec(n[2]))&&(n[2]=e[1],n[3]=e[2],n[4]=e[3]),r={url:n[2],func:n[1]||"?",args:h?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=a.exec(p[l]))r={url:n[2],func:n[1]||"?",args:[],line:+n[3],column:n[4]?+n[4]:null};else if(n=o.exec(p[l]))n[3]&&n[3].indexOf(" > eval")>-1&&(e=s.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=e[1],n[4]=e[2],n[5]=""):0!==l||n[5]||void 0===t.columnNumber||(f[0].column=t.columnNumber+1),r={url:n[3],func:n[1]||"?",args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null};else{if(!(n=c.exec(p[l])))continue;r={url:n[2],func:n[1]||"?",args:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}!r.func&&r.line&&(r.func="?"),f.push(r)}if(!f.length)return null;return{message:d(t),name:t.name,stack:f}}(t))return f(e,n)}catch(t){}return{message:d(t),name:t&&t.name,stack:[],failed:!0}}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.d(e,"i",(function(){return s})),n.d(e,"g",(function(){return u})),n.d(e,"e",(function(){return f})),n.d(e,"c",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"f",(function(){return h})),n.d(e,"a",(function(){return _})),n.d(e,"h",(function(){return v})),n.d(e,"d",(function(){return g}));var r=n(0),i=n(3),o=n(4),a=n(8);function s(){var t=Object(i.a)(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function u(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function c(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function f(t){var e=t.message,n=t.event_id;if(e)return e;var r=c(t);return r?r.type&&r.value?r.type+": "+r.value:r.type||r.value||n||"<unknown>":n||"<unknown>"}function d(t,e,n){var r=t.exception=t.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=e||""),o.type||(o.type=n||"Error")}function p(t,e){var n=c(t);if(n){var i=n.mechanism;if(n.mechanism=Object(r.__assign)(Object(r.__assign)(Object(r.__assign)({},{type:"generic",handled:!0}),i),e),e&&"data"in e){var o=Object(r.__assign)(Object(r.__assign)({},i&&i.data),e.data);n.mechanism.data=o}}}var l=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function h(t){var e=t.match(l)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:e[4]}}function _(t,e,n){void 0===n&&(n=5);var r=e.lineno||0,i=t.length,o=Math.max(Math.min(i,r-1),0);e.pre_context=t.slice(Math.max(0,o-n),o).map((function(t){return Object(a.d)(t,0)})),e.context_line=Object(a.d)(t[Math.min(i-1,o)],e.colno||0),e.post_context=t.slice(Math.min(o+1,i),o+1+n).map((function(t){return Object(a.d)(t,0)}))}function v(t){return t.split(/[\?#]/,1)[0]}function g(t){if(t&&t.__sentry_captured__)return!0;try{Object(o.a)(t,"__sentry_captured__",!0)}catch(t){}return!1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c}));var r=n(0),i=n(7),o=n(6),a=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function s(t,e){void 0===e&&(e=!1);var n=t.host,r=t.path,i=t.pass,o=t.port,a=t.projectId;return t.protocol+"://"+t.publicKey+(e&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+a}function u(t){return"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),{user:t.publicKey||"",protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function c(t){var e="string"==typeof t?function(t){var e=a.exec(t);if(!e)throw new i.a("Invalid Sentry Dsn: "+t);var n=Object(r.__read)(e.slice(1),6),o=n[0],s=n[1],c=n[2],f=void 0===c?"":c,d=n[3],p=n[4],l=void 0===p?"":p,h="",_=n[5],v=_.split("/");if(v.length>1&&(h=v.slice(0,-1).join("/"),_=v.pop()),_){var g=_.match(/^\d+/);g&&(_=g[0])}return u({host:d,pass:f,path:h,projectId:_,port:l,protocol:o,publicKey:s})}(t):u(t);return function(t){if(o.a){var e=t.port,n=t.projectId,r=t.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new i.a("Invalid Sentry Dsn: "+e+" missing")})),!n.match(/^\d+$/))throw new i.a("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(t){return"http"===t||"https"===t}(r))throw new i.a("Invalid Sentry Dsn: Invalid protocol "+r);if(e&&isNaN(parseInt(e,10)))throw new i.a("Invalid Sentry Dsn: Invalid port "+e)}}(e),e}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return f}));var r=n(0),i=n(1),o=n(19),a=n(4),s=n(11);function u(t,e,n){void 0===e&&(e=1/0),void 0===n&&(n=1/0);try{return f("",t,e,n)}catch(t){return{ERROR:"**non-serializable** ("+t+")"}}}function c(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r,i=u(t,e);return r=i,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(r))>n?c(t,e-1,n):i}function f(e,n,u,c,d){void 0===u&&(u=1/0),void 0===c&&(c=1/0),void 0===d&&(d=Object(o.a)());var p=Object(r.__read)(d,2),l=p[0],h=p[1],_=n;if(_&&"function"==typeof _.toJSON)try{return _.toJSON()}catch(t){}if(null===n||["number","boolean","string"].includes(typeof n)&&!Object(i.h)(n))return n;var v=function(e,n){try{return"domain"===e&&n&&"object"==typeof n&&n._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==t&&n===t?"[Global]":"undefined"!=typeof window&&n===window?"[Window]":"undefined"!=typeof document&&n===document?"[Document]":Object(i.m)(n)?"[SyntheticEvent]":"number"==typeof n&&n!=n?"[NaN]":void 0===n?"[undefined]":"function"==typeof n?"[Function: "+Object(s.b)(n)+"]":"symbol"==typeof n?"["+String(n)+"]":"bigint"==typeof n?"[BigInt: "+String(n)+"]":"[object "+Object.getPrototypeOf(n).constructor.name+"]"}catch(t){return"**non-serializable** ("+t+")"}}(e,n);if(!v.startsWith("[object "))return v;if(0===u)return v.replace("object ","");if(l(n))return"[Circular ~]";var g=Array.isArray(n)?[]:{},b=0,y=Object(i.d)(n)||Object(i.f)(n)?Object(a.b)(n):n;for(var m in y)if(Object.prototype.hasOwnProperty.call(y,m)){if(b>=c){g[m]="[MaxProperties ~]";break}var O=y[m];g[m]=f(m,O,u-1,c,d),b+=1}return h(n),g}}).call(this,n(24))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(7),i=n(12);function o(t){var e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(o){if(!(void 0===t||e.length<t))return Object(i.b)(new r.a("Not adding Promise due to buffer limit reached."));var a=o();return-1===e.indexOf(a)&&e.push(a),a.then((function(){return n(a)})).then(null,(function(){return n(a).then(null,(function(){}))})),a},drain:function(t){return new i.a((function(n,r){var o=e.length;if(!o)return n(!0);var a=setTimeout((function(){t&&t>0&&n(!1)}),t);e.forEach((function(t){Object(i.c)(t).then((function(){--o||(clearTimeout(a),n(!0))}),r)}))}))}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return u}));var r=n(0),i=6e4;function o(t,e){void 0===e&&(e=Date.now());var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?i:r-e}function a(t,e){return t[e]||t.all||0}function s(t,e,n){return void 0===n&&(n=Date.now()),a(t,e)>n}function u(t,e,n){var i,a,s,u;void 0===n&&(n=Date.now());var c=Object(r.__assign)({},t),f=e["x-sentry-rate-limits"],d=e["retry-after"];if(f)try{for(var p=Object(r.__values)(f.trim().split(",")),l=p.next();!l.done;l=p.next()){var h=l.value.split(":",2),_=parseInt(h[0],10),v=1e3*(isNaN(_)?60:_);if(h[1])try{for(var g=(s=void 0,Object(r.__values)(h[1].split(";"))),b=g.next();!b.done;b=g.next()){c[b.value]=n+v}}catch(t){s={error:t}}finally{try{b&&!b.done&&(u=g.return)&&u.call(g)}finally{if(s)throw s.error}}else c.all=n+v}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}else d&&(c.all=n+o(d,n));return c}},function(t,e,n){"use strict";function r(t){return t>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown"}n.d(e,"a",(function(){return r}))},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.SDK_VERSION=e.SDK_NAME=void 0,e.SDK_NAME="sentry.javascript.miniapp",e.SDK_VERSION="0.12.0"},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.MiniappClient=void 0;var r=n(0),i=n(5),o=n(41),a=n(31),s=function(t){function e(e){return void 0===e&&(e={}),t.call(this,o.MiniappBackend,e)||this}return r.__extends(e,t),e.prototype._prepareEvent=function(e,n,i){return e.platform=e.platform||"javascript",e.sdk=r.__assign(r.__assign({},e.sdk),{name:a.SDK_NAME,packages:r.__spread(e.sdk&&e.sdk.packages||[],[{name:"npm:@sentry/miniapp",version:a.SDK_VERSION}]),version:a.SDK_VERSION}),t.prototype._prepareEvent.call(this,e,n,i)},e.prototype.showReportDialog=function(t){void 0===t&&(t={}),console.log("sentry-miniapp 暂未实现该方法",t)},e}(i.BaseClient);e.MiniappClient=s},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.prepareFramesForEvent=e.eventFromStacktrace=e.eventFromPlainObject=e.exceptionFromStacktrace=void 0;var r=n(2),i=n(22);function o(t){var e=a(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function a(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).slice(0,100).reverse()}e.exceptionFromStacktrace=o,e.eventFromPlainObject=function(t,e,n){var o={exception:{values:[{type:r.isEvent(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+r.extractExceptionKeysForMessage(t)}]},extra:{__serialized__:r.normalizeToSize(t)}};if(e){var s=a(i.computeStackTrace(e).stack);o.stacktrace={frames:s}}return o},e.eventFromStacktrace=function(t){return{exception:{values:[o(t)]}}},e.prepareFramesForEvent=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n(35);Object.defineProperty(e,"BaseTransport",{enumerable:!0,get:function(){return r.BaseTransport}});var i=n(43);Object.defineProperty(e,"XHRTransport",{enumerable:!0,get:function(){return i.XHRTransport}})},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTransport=void 0;var r=n(5),i=n(2),o=function(){function t(t){this.options=t,this._buffer=i.makePromiseBuffer(30),this.url=new r.API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return t.prototype.sendEvent=function(t){throw new i.SentryError("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t}();e.BaseTransport=o},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.keypressEventHandler=e.breadcrumbEventHandler=e.wrap=e.ignoreNextOnError=e.shouldIgnoreOnError=void 0;var r,i,o=n(0),a=n(5),s=n(2),u=0;function c(){u+=1,setTimeout((function(){u-=1}))}e.shouldIgnoreOnError=function(){return u>0},e.ignoreNextOnError=c,e.wrap=function t(e,n,r){if(void 0===n&&(n={}),"function"!=typeof e)return e;try{if(e.__sentry__)return e;if(e.__sentry_wrapped__)return e.__sentry_wrapped__}catch(t){return e}var i=function(){r&&"function"==typeof r&&r.apply(this,arguments);var i=Array.prototype.slice.call(arguments);try{var u=i.map((function(e){return t(e,n)}));return e.handleEvent?e.handleEvent.apply(this,u):e.apply(this,u)}catch(t){throw c(),a.withScope((function(e){e.addEventProcessor((function(t){var e=o.__assign({},t);return n.mechanism&&(s.addExceptionTypeValue(e,void 0,void 0),s.addExceptionMechanism(e,n.mechanism)),e.extra=o.__assign(o.__assign({},e.extra),{arguments:s.normalize(i,3)}),e})),a.captureException(t)})),t}};try{for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&(i[u]=e[u])}catch(t){}e.prototype=e.prototype||{},i.prototype=e.prototype,Object.defineProperty(e,"__sentry_wrapped__",{enumerable:!1,value:i}),Object.defineProperties(i,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:function(){return e.name}})}catch(t){}return i};var f=0;function d(t,e){return void 0===e&&(e=!1),function(n){if(r=void 0,n&&i!==n){i=n;var o=function(){var e;try{e=n.target?s.htmlTreeAsString(n.target):s.htmlTreeAsString(n)}catch(t){e="<unknown>"}0!==e.length&&a.getCurrentHub().addBreadcrumb({category:"ui."+t,message:e},{event:n,name:t})};f&&clearTimeout(f),e?f=setTimeout(o):o()}}}e.breadcrumbEventHandler=d,e.keypressEventHandler=function(){return function(t){var e;try{e=t.target}catch(t){return}var n=e&&e.tagName;n&&("INPUT"===n||"TEXTAREA"===n||e.isContentEditable)&&(r||d("input")(t),clearTimeout(r),r=setTimeout((function(){r=void 0}),1e3))}}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n(44);Object.defineProperty(e,"GlobalHandlers",{enumerable:!0,get:function(){return r.GlobalHandlers}});var i=n(45);Object.defineProperty(e,"TryCatch",{enumerable:!0,get:function(){return i.TryCatch}});var o=n(46);Object.defineProperty(e,"LinkedErrors",{enumerable:!0,get:function(){return o.LinkedErrors}});var a=n(47);Object.defineProperty(e,"System",{enumerable:!0,get:function(){return a.System}});var s=n(48);Object.defineProperty(e,"Router",{enumerable:!0,get:function(){return s.Router}});var u=n(49);Object.defineProperty(e,"IgnoreMpcrawlerErrors",{enumerable:!0,get:function(){return u.IgnoreMpcrawlerErrors}})},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Transports=e.Integrations=void 0;var r=n(21);Object.defineProperty(e,"Severity",{enumerable:!0,get:function(){return r.Severity}});var i=n(5);Object.defineProperty(e,"addGlobalEventProcessor",{enumerable:!0,get:function(){return i.addGlobalEventProcessor}}),Object.defineProperty(e,"addBreadcrumb",{enumerable:!0,get:function(){return i.addBreadcrumb}}),Object.defineProperty(e,"captureException",{enumerable:!0,get:function(){return i.captureException}}),Object.defineProperty(e,"captureEvent",{enumerable:!0,get:function(){return i.captureEvent}}),Object.defineProperty(e,"captureMessage",{enumerable:!0,get:function(){return i.captureMessage}}),Object.defineProperty(e,"configureScope",{enumerable:!0,get:function(){return i.configureScope}}),Object.defineProperty(e,"getHubFromCarrier",{enumerable:!0,get:function(){return i.getHubFromCarrier}}),Object.defineProperty(e,"getCurrentHub",{enumerable:!0,get:function(){return i.getCurrentHub}}),Object.defineProperty(e,"Hub",{enumerable:!0,get:function(){return i.Hub}}),Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"setContext",{enumerable:!0,get:function(){return i.setContext}}),Object.defineProperty(e,"setExtra",{enumerable:!0,get:function(){return i.setExtra}}),Object.defineProperty(e,"setExtras",{enumerable:!0,get:function(){return i.setExtras}}),Object.defineProperty(e,"setTag",{enumerable:!0,get:function(){return i.setTag}}),Object.defineProperty(e,"setTags",{enumerable:!0,get:function(){return i.setTags}}),Object.defineProperty(e,"setUser",{enumerable:!0,get:function(){return i.setUser}}),Object.defineProperty(e,"withScope",{enumerable:!0,get:function(){return i.withScope}});var o=n(31);Object.defineProperty(e,"SDK_NAME",{enumerable:!0,get:function(){return o.SDK_NAME}}),Object.defineProperty(e,"SDK_VERSION",{enumerable:!0,get:function(){return o.SDK_VERSION}});var a=n(40);Object.defineProperty(e,"defaultIntegrations",{enumerable:!0,get:function(){return a.defaultIntegrations}}),Object.defineProperty(e,"init",{enumerable:!0,get:function(){return a.init}}),Object.defineProperty(e,"lastEventId",{enumerable:!0,get:function(){return a.lastEventId}}),Object.defineProperty(e,"showReportDialog",{enumerable:!0,get:function(){return a.showReportDialog}}),Object.defineProperty(e,"flush",{enumerable:!0,get:function(){return a.flush}}),Object.defineProperty(e,"close",{enumerable:!0,get:function(){return a.close}}),Object.defineProperty(e,"wrap",{enumerable:!0,get:function(){return a.wrap}});var s=n(32);Object.defineProperty(e,"MiniappClient",{enumerable:!0,get:function(){return s.MiniappClient}});var u=n(37);e.Integrations=u;var c=n(34);e.Transports=c},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],f=!1,d=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&l())}function l(){if(!f){var t=s(p);f=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function _(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||f||s(l)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.wrap=e.close=e.flush=e.lastEventId=e.showReportDialog=e.init=e.defaultIntegrations=void 0;var r=n(5),i=n(2),o=n(32),a=n(36),s=n(37);e.defaultIntegrations=[new r.Integrations.InboundFilters,new r.Integrations.FunctionToString,new s.TryCatch,new s.GlobalHandlers,new s.LinkedErrors,new s.System,new s.Router,new s.IgnoreMpcrawlerErrors],e.init=function(t){void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=e.defaultIntegrations),t.normalizeDepth=t.normalizeDepth||5,r.initAndBind(o.MiniappClient,t)},e.showReportDialog=function(t){void 0===t&&(t={}),t.eventId||(t.eventId=r.getCurrentHub().lastEventId());var e=r.getCurrentHub().getClient();e&&e.showReportDialog(t)},e.lastEventId=function(){return r.getCurrentHub().lastEventId()},e.flush=function(t){var e=r.getCurrentHub().getClient();return e?e.flush(t):i.resolvedSyncPromise(!1)},e.close=function(t){var e=r.getCurrentHub().getClient();return e?e.close(t):i.resolvedSyncPromise(!1)},e.wrap=function(t){return a.wrap(t)()}},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.MiniappBackend=void 0;var r=n(0),i=n(5),o=n(21),a=n(2),s=n(42),u=n(34),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=r.__assign(r.__assign({},this._options.transportOptions),{dsn:this._options.dsn});return this._options.transport?new this._options.transport(e):new u.XHRTransport(e)},e.prototype.eventFromException=function(t,e){var n=e&&e.syntheticException||void 0,r=s.eventFromUnknownInput(t,n,{attachStacktrace:this._options.attachStacktrace});return a.addExceptionMechanism(r,{handled:!0,type:"generic"}),r.level=o.Severity.Error,e&&e.event_id&&(r.event_id=e.event_id),a.resolvedSyncPromise(r)},e.prototype.eventFromMessage=function(t,e,n){void 0===e&&(e=o.Severity.Info);var r=n&&n.syntheticException||void 0,i=s.eventFromString(t,r,{attachStacktrace:this._options.attachStacktrace});return i.level=e,n&&n.event_id&&(i.event_id=n.event_id),a.resolvedSyncPromise(i)},e}(i.BaseBackend);e.MiniappBackend=c},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.eventFromString=e.eventFromUnknownInput=void 0;var r=n(2),i=n(33),o=n(22);function a(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var a=o.computeStackTrace(e),s=i.prepareFramesForEvent(a.stack);r.stacktrace={frames:s}}return r}e.eventFromUnknownInput=function(t,e,n){var s;if(void 0===n&&(n={}),r.isErrorEvent(t)&&t.error)return t=t.error,s=i.eventFromStacktrace(o.computeStackTrace(t));if(r.isDOMError(t)||r.isDOMException(t)){var u=t,c=u.name||(r.isDOMError(u)?"DOMError":"DOMException"),f=u.message?c+": "+u.message:c;return s=a(f,e,n),r.addExceptionTypeValue(s,f),s}if(r.isError(t))return s=i.eventFromStacktrace(o.computeStackTrace(t));if(r.isPlainObject(t)||r.isEvent(t)){var d=t;return s=i.eventFromPlainObject(d,e,n.rejection),r.addExceptionMechanism(s,{synthetic:!0}),s}return s=a(t,e,n),r.addExceptionTypeValue(s,""+t,void 0),r.addExceptionMechanism(s,{synthetic:!0}),s},e.eventFromString=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.XHRTransport=void 0;var r=n(0),i=n(2),o=n(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.sendEvent=function(t){var e=this,n=o.sdk.request||o.sdk.httpRequest;return this._buffer.add((function(){return new Promise((function(r,o){n({url:e.url,method:"POST",data:JSON.stringify(t),header:{"content-type":"application/json"},success:function(t){r({status:i.eventStatusFromHttpCode(t.statusCode)})},fail:function(t){o(t)}})}))}))},e}(n(35).BaseTransport);e.XHRTransport=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalHandlers=void 0;var r=n(0),i=n(5),o=n(2),a=n(15),s=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._onPageNotFoundHandlerInstalled=!1,this._onMemoryWarningHandlerInstalled=!1,this._options=r.__assign({onerror:!0,onunhandledrejection:!0,onpagenotfound:!0,onmemorywarning:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(o.logger.log("Global Handler attached: onError"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(o.logger.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler()),this._options.onpagenotfound&&(o.logger.log("Global Handler attached: onPageNotFound"),this._installGlobalOnPageNotFoundHandler()),this._options.onmemorywarning&&(o.logger.log("Global Handler attached: onMemoryWarning"),this._installGlobalOnMemoryWarningHandler())},t.prototype._installGlobalOnErrorHandler=function(){if(!this._onErrorHandlerInstalled){if(a.sdk.onError){var t=i.getCurrentHub();a.sdk.onError((function(e){var n="string"==typeof e?new Error(e):e;t.captureException(n)}))}this._onErrorHandlerInstalled=!0}},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){if(!this._onUnhandledRejectionHandlerInstalled){if(a.sdk.onUnhandledRejection){var t=i.getCurrentHub();a.sdk.onUnhandledRejection((function(e){var n=e.reason,r=e.promise,i="string"==typeof n?new Error(n):n;t.captureException(i,{data:r})}))}this._onUnhandledRejectionHandlerInstalled=!0}},t.prototype._installGlobalOnPageNotFoundHandler=function(){if(!this._onPageNotFoundHandlerInstalled){if(a.sdk.onPageNotFound){var t=i.getCurrentHub();a.sdk.onPageNotFound((function(e){var n=e.path.split("?")[0];t.setTag("pagenotfound",n),t.setExtra("message",JSON.stringify(e)),t.captureMessage("页面无法找到: "+n)}))}this._onPageNotFoundHandlerInstalled=!0}},t.prototype._installGlobalOnMemoryWarningHandler=function(){if(!this._onMemoryWarningHandlerInstalled){if(a.sdk.onMemoryWarning){var t=i.getCurrentHub();a.sdk.onMemoryWarning((function(e){var n=e.level,r=void 0===n?-1:n,i="没有获取到告警级别信息";switch(r){case 5:i="TRIM_MEMORY_RUNNING_MODERATE";break;case 10:i="TRIM_MEMORY_RUNNING_LOW";break;case 15:i="TRIM_MEMORY_RUNNING_CRITICAL";break;default:return}t.setTag("memory-warning",String(r)),t.setExtra("message",i),t.captureMessage("内存不足告警")}))}this._onMemoryWarningHandlerInstalled=!0}},t.id="GlobalHandlers",t}();e.GlobalHandlers=s},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TryCatch=void 0;var r=n(2),i=n(36),o=function(){function t(){this._ignoreOnError=0,this.name=t.id}return t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=i.wrap(r,{mechanism:{data:{function:a(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t(i.wrap(e,{mechanism:{data:{function:"requestAnimationFrame",handler:a(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=r.getGlobalObject(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(r.fill(n,"addEventListener",(function(e){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=i.wrap(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:a(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,i.wrap(r,{mechanism:{data:{function:"addEventListener",handler:a(r),target:t},handled:!0,type:"instrument"}}),o)}})),r.fill(n,"removeEventListener",(function(t){return function(e,n,r){var i=n;try{i=i&&(i.__sentry_wrapped__||i)}catch(t){}return t.call(this,e,i,r)}})))},t.prototype.setupOnce=function(){this._ignoreOnError=this._ignoreOnError;var t=r.getGlobalObject();r.fill(t,"setTimeout",this._wrapTimeFunction.bind(this)),r.fill(t,"setInterval",this._wrapTimeFunction.bind(this)),r.fill(t,"requestAnimationFrame",this._wrapRAF.bind(this)),["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"].forEach(this._wrapEventTarget.bind(this))},t.id="TryCatch",t}();function a(t){try{return t&&t.name||"<anonymous>"}catch(t){return"<anonymous>"}}e.TryCatch=o},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedErrors=void 0;var r=n(0),i=n(5),o=n(33),a=n(22),s=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){i.addGlobalEventProcessor((function(e,n){var r=i.getCurrentHub().getIntegration(t);return r?r._handler(e,n):e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&e.originalException instanceof Error))return t;var n=this._walkErrorTree(e.originalException,this._key);return t.exception.values=r.__spread(n,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,n){if(void 0===n&&(n=[]),!(t[e]instanceof Error)||n.length+1>=this._limit)return n;var i=a.computeStackTrace(t[e]),s=o.exceptionFromStacktrace(i);return this._walkErrorTree(t[e],e,r.__spread([s],n))},t.id="LinkedErrors",t}();e.LinkedErrors=s},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.System=void 0;var r=n(0),i=n(5),o=n(15),a=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){i.addGlobalEventProcessor((function(e){if(i.getCurrentHub().getIntegration(t))try{var n=o.sdk.getSystemInfoSync(),a=n.SDKVersion,s=void 0===a?"0.0.0":a,u=n.batteryLevel,c=n.currentBattery,f=n.battery,d=n.brand,p=n.language,l=n.model,h=n.pixelRatio,_=n.platform,v=n.screenHeight,g=n.screenWidth,b=n.statusBarHeight,y=n.system,m=n.version,O=n.windowHeight,j=n.windowWidth,E=n.app,S=n.appName,w=n.fontSizeSetting,x=r.__read(y.split(" "),2),k=x[0],T=x[1];return r.__assign(r.__assign({},e),{contexts:r.__assign(r.__assign({},e.contexts),{device:{brand:d,battery_level:u||c||f,model:l,screen_dpi:h},os:{name:k||y,version:T||y},extra:r.__assign({SDKVersion:s,language:p,platform:_,screenHeight:v,screenWidth:g,statusBarHeight:b,version:m,windowHeight:O,windowWidth:j,fontSizeSetting:w,app:E||S||o.appName},n)})})}catch(t){console.warn("sentry-miniapp get system info fail: "+t)}return e}))},t.id="System",t}();e.System=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Router=void 0;var r=n(0),i=n(5),o=function(){function t(e){this.name=t.id,this._options=r.__assign({enable:!0},e)}return t.prototype.setupOnce=function(){var e=this;i.addGlobalEventProcessor((function(n){if(i.getCurrentHub().getIntegration(t)&&e._options.enable)try{var o=getCurrentPages().map((function(t){return{route:t.route,options:t.options}}));return r.__assign(r.__assign({},n),{extra:r.__assign(r.__assign({},n.extra),{routers:o})})}catch(t){console.warn("sentry-miniapp get router info fail: "+t)}return n}))},t.id="Router",t}();e.Router=o},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.IgnoreMpcrawlerErrors=void 0;var r=n(5),i=n(15),o=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){r.addGlobalEventProcessor((function(e){if(r.getCurrentHub().getIntegration(t)&&"wechat"===i.appName&&i.sdk.getLaunchOptionsSync&&1129===i.sdk.getLaunchOptionsSync().scene)return null;return e}))},t.id="IgnoreMpcrawlerErrors",t}();e.IgnoreMpcrawlerErrors=o}]);
//# sourceMappingURL=sentry-miniapp.wx.min.js.map
\ No newline at end of file
......@@ -8,8 +8,8 @@ const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss') //log 2020-07-31 10:00:00
*/
const getImgVersion = () => {
return commonApi.getImgVersion()
const getMockConfig = () => {
return commonApi.getMockConfig()
}
Date.prototype.format = function (fmt) {
let o = {
......@@ -383,6 +383,97 @@ const getScopeTime = (inputTime, curTime) => {
}
return obj.text
}
const deepClone = (target) => {
const map = new WeakMap()
function isObject(target) {
return (typeof target === 'object' && target ) || typeof target === 'function'
}
function clone(data) {
if (!isObject(data)) {
return data
}
if ([Date, RegExp].includes(data.constructor)) {
return new data.constructor(data)
}
if (typeof data === 'function') {
return new Function('return ' + data.toString())()
}
const exist = map.get(data)
if (exist) {
return exist
}
if (data instanceof Map) {
const result = new Map()
map.set(data, result)
data.forEach((val, key) => {
if (isObject(val)) {
result.set(key, clone(val))
} else {
result.set(key, val)
}
})
return result
}
if (data instanceof Set) {
const result = new Set()
map.set(data, result)
data.forEach(val => {
if (isObject(val)) {
result.add(clone(val))
} else {
result.add(val)
}
})
return result
}
const keys = Reflect.ownKeys(data)
const allDesc = Object.getOwnPropertyDescriptors(data)
const result = Object.create(Object.getPrototypeOf(data), allDesc)
map.set(data, result)
keys.forEach(key => {
const val = data[key]
if (isObject(val)) {
result[key] = clone(val)
} else {
result[key] = val
}
})
return result
}
return clone(target)
}
/**
* 判断是否是空对象
* @param {*} obj 传进来的对象
* @returns
*/
const isEmptyObj = (obj) => {
return JSON.stringify(obj) === "{}";
};
// 解析参数成对象 "actNum=1&activeNavIdx=0&isShare=true"
const parseString = (str) => {
// console.log('str: ', str);
if (!str) return;
let obj = {};
let strArr = str.split("&");
// console.log('strArr: ', strArr);
strArr.forEach((item) => {
// console.log("item: ", item);
let keyArr = item.split("=");
obj[keyArr[0]] = keyArr[1];
});
return obj;
};
const Util = {
setNavigationBarTitleText,
getNavigationBarTitleText,
......@@ -404,7 +495,7 @@ const Util = {
setUserInfo,
showLoading,
hideLoading,
getImgVersion,
getMockConfig,
getViewInfo,
setCopyData,
getSceneId,
......@@ -415,5 +506,8 @@ const Util = {
throttle,
decimal,
timeago,
deepClone,
isEmptyObj,
parseString,
}
export default Util
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!