Commit 2635dadb by 前端

Merge branch 'huyue_v3.3.0' into 'v3.3.0'

Huyue v3.3.0

See merge request !13
2 parents f9877dbe 18aefbaf
Showing 236 changed files with 4567 additions and 13308 deletions
.svn/ .svn/
project.config.json
project.private.config.json
sitemap.json
miniprogram_npm
node_modules
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-09 13:58:15
* @LastEditors: huyue
* @LastEditTime: 2022-12-09 15:17:35
*/
import api from './request' import api from './request'
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import wechatApi from './wechatApi' import wechatApi from './wechatApi'
import entmicroApi from './entmicroApi' import entmicroApi from './entmicroApi'
const common = 'scrm.api.carlife.common.'
module.exports = { module.exports = {
ssoApi, ssoApi,
entmicroApi, entmicroApi,
wechatApi, wechatApi,
commonApi: { commonApi: {
/**上传图片
*/
uploadImg(data) {
return api.post({
method: `${common}uploadImg`,
...data,
noSignAttr: ['file']
})
},
/**视频上传
*/
uploadVideo(data) {
return api.post({
method: `${common}uploadVideo`,
...data,
noSignAttr: ['file']
})
},
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return api.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */
search(data) {
return api.post({
method: 'scrm.api.carlife.weapp.homeSearch.search',
pageSize: 10,
...data
})
},
/** 根据sap编码获取商户详情 */
getBySapCode(data) {
return api.post({
method: `scrm.api.carlife.merchant.getBySapCode`,
...data,
}, true)
},
/**获取图片版本号 */ /**获取图片版本号 */
getMockConfig() { getMockConfig() {
return api.getMock() 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 \ No newline at end of file
...@@ -3,8 +3,7 @@ import api from "./request"; ...@@ -3,8 +3,7 @@ import api from "./request";
module.exports = { module.exports = {
// 智能名片详情 // 智能名片详情
getCardDetail(data) { getCardDetail(data) {
return api.post( return api.post({
{
method: `entmicro.api.business.card.cardDetail`, method: `entmicro.api.business.card.cardDetail`,
...data, ...data,
}, },
...@@ -16,6 +15,48 @@ module.exports = { ...@@ -16,6 +15,48 @@ module.exports = {
return api.post({ return api.post({
method: `entmicro.api.business.card.activity.apply`, method: `entmicro.api.business.card.activity.apply`,
...data, ...data,
},true) }, true)
},
// 检查登录用户是否是滴加智慧云员工
checkPhone(data) {
return api.post({
method: `entmicro.api.business.activityRecord.checkPhone`,
...data,
}, true)
},
// 获取活动记录全集
getActivityRecord(data) {
return api.post({
method: `entmicro.api.business.activityRecord.list`,
...data
}, true)
},
// 根据id查询
getActivityDetail(data) {
return api.post({
method: `entmicro.api.business.activityRecord.detail`,
...data
})
},
//获取活动配置
getActiveApi(data) {
return api.post({
method: 'scrm.api.busassistant.activity.getActivityUrl',
...data
},
true
)
},
// 是否显示门店助手、生意助手按钮
checkCooperate(data) {
return api.post({
method: 'entmicro.api.business.activityRecord.checkCooperate',
...data
})
} }
} }
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-09 13:58:15
* @LastEditors: huyue
* @LastEditTime: 2022-12-09 13:59:57
*/
const target = ["ip", "dev", "uat", "beta", "prod"]; const target = ["ip", "dev", "uat", "beta", "prod"];
/** /**
* *
...@@ -7,7 +14,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"]; ...@@ -7,7 +14,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"];
3预发布 3预发布
4生产 4生产
*/ */
const index = 4; const index = 2;
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
...@@ -48,6 +55,7 @@ const pathEnum = { ...@@ -48,6 +55,7 @@ const pathEnum = {
sso: "/rop-scrm-sso/", sso: "/rop-scrm-sso/",
wechat: "/rop-scrm-wechat/", wechat: "/rop-scrm-wechat/",
business: "/rop-scrm-entmicro/", business: "/rop-scrm-entmicro/",
busassistant: '/rop-scrm-busassistant/'
}; };
module.exports = { module.exports = {
index, index,
......
...@@ -53,7 +53,7 @@ class Request { ...@@ -53,7 +53,7 @@ class Request {
if (!wx.$authStatus) { if (!wx.$authStatus) {
if (INTERRUPT) return if (INTERRUPT) return
INTERRUPT = true INTERRUPT = true
wx.showLoading() // wx.showLoading()
getApp().login().then(() => { getApp().login().then(() => {
if (thisPage.init && thisPage.data.userInfo) thisPage.init() if (thisPage.init && thisPage.data.userInfo) thisPage.init()
if (thisPage.loginCallBack && thisPage.data.userInfo) thisPage.loginCallBack(thisPage.data.userInfo) if (thisPage.loginCallBack && thisPage.data.userInfo) thisPage.loginCallBack(thisPage.data.userInfo)
...@@ -79,7 +79,7 @@ class Request { ...@@ -79,7 +79,7 @@ class Request {
} }
}, },
fail(error) { fail(error) {
wx.hideLoading() // wx.hideLoading()
wx.showToast({ wx.showToast({
title: '系统异常', title: '系统异常',
icon: 'error' icon: 'error'
......
...@@ -13,7 +13,7 @@ import util from './utils/util.js' ...@@ -13,7 +13,7 @@ import util from './utils/util.js'
import './utils/Track' import './utils/Track'
import { ssoApi, wechatApi } from './api/api' import { ssoApi, wechatApi } from './api/api'
import { trackData } from './utils/data' import { trackData } from './utils/data'
import eventbus from './utils/evenbus' // import eventbus from './utils/evenbus'
// 实例化对象存储 // 实例化对象存储
import { Storage } from './utils/cache/storage' import { Storage } from './utils/cache/storage'
const $Storage = new Storage() const $Storage = new Storage()
...@@ -24,11 +24,12 @@ App({ ...@@ -24,11 +24,12 @@ App({
/**挂载到wx对象 */ /**挂载到wx对象 */
this.autoUpdate() this.autoUpdate()
wx.$storage = $Storage /** 挂载全局缓存方法 */ wx.$storage = $Storage /** 挂载全局缓存方法 */
wx.$eventbus = eventbus // wx.$eventbus = eventbus
wx.$util = util wx.$util = util
wx.$router = router wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId wx.$appId = wx.getAccountInfoSync().miniProgram.appId
this.clearFileSystem()
const systemInfo = wx.$storage.get('aicard_system_info') const systemInfo = wx.$storage.get('aicard_system_info')
if (!systemInfo) if (!systemInfo)
wx.getSystemInfo({ wx.getSystemInfo({
...@@ -39,8 +40,10 @@ App({ ...@@ -39,8 +40,10 @@ App({
if (options.path != 'pages/tab/index/index') { if (options.path != 'pages/tab/index/index') {
this.login() this.login()
} }
// wx.showMeasure = false
wx.showMeasure = !!(options.query && options.query.scene) wx.showMeasure = !!(options.query && options.query.scene)
wx.onMemoryWarning(function () {
console.log('onMemoryWarningReceive')
})
}, },
login(returnResponse) { login(returnResponse) {
let _this = this let _this = this
...@@ -59,7 +62,6 @@ App({ ...@@ -59,7 +62,6 @@ App({
wx.$storage.set('aicard_info', wechatInfo) wx.$storage.set('aicard_info', wechatInfo)
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
openId = wechatInfo.openId openId = wechatInfo.openId
console.log(wx.$trackData)
wx.showMeasure = !!wx.$trackData.scene wx.showMeasure = !!wx.$trackData.scene
if (wx.$trackData.scene) { if (wx.$trackData.scene) {
// 初次进入小程序默认埋首页 // 初次进入小程序默认埋首页
...@@ -72,10 +74,8 @@ App({ ...@@ -72,10 +74,8 @@ App({
cardId: res.cardId cardId: res.cardId
}) })
_this.getUserInfo(openId, returnResponse).then(result => { _this.getUserInfo(openId, returnResponse).then(result => {
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
resolve(result) resolve(result)
}) })
}) })
} else { } else {
// 其他的分享进来的页面走这里,在进页面的onshow中需对wx.$trackData先赋值 // 其他的分享进来的页面走这里,在进页面的onshow中需对wx.$trackData先赋值
...@@ -85,7 +85,7 @@ App({ ...@@ -85,7 +85,7 @@ App({
case 'SHARE_HOME': case 'SHARE_HOME':
// 名片分享在这里设置埋点 // 名片分享在这里设置埋点
wx.$storage.set('scene', wx.$trackData) wx.$storage.set('scene', wx.$trackData)
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo) // wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
break break
case 'SHARE_D': case 'SHARE_D':
wx.$storage.set('scene', wx.$trackData) wx.$storage.set('scene', wx.$trackData)
...@@ -185,5 +185,27 @@ App({ ...@@ -185,5 +185,27 @@ App({
// 新版本下载失败 // 新版本下载失败
}) })
}, },
globalData: {} // 清内存
clearFileSystem: function() {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
files.length && files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
},
globalData: {},
onPageNotFound(res) {
console.log(res, '不存在的页面')
setTimeout(() => {
wx.$router.go('/pages/tab/index/index', res.query)
}, 1000)
},
}) })
{ {
"pages": [ "pages": [
"pages/tab/index/index", "pages/tab/index/index",
"pages/applicationAccount/applicationAccount", "pages/webView/webView"
"pages/applicationPartener/applicationPartener",
"pages/applySuccess/applySuccess",
"pages/tab/introduction/introduction",
"pages/addTransform/addTransform/addTransform",
"pages/addTransform/addTransformDetail/addTransformDetail",
"pages/addValue/addValue/addValue",
"pages/productDetail/ambientLighting/ambientLighting",
"pages/productDetail/arNavigation/arNavigation",
"pages/productDetail/carBeauty/carBeauty",
"pages/productDetail/changingFilm/changingFilm",
"pages/productDetail/equity/equity",
"pages/productDetail/lossPhase/lossPhase",
"pages/productDetail/navigationArround/navigationArround",
"pages/productDetail/paintProtect/paintProtect",
"pages/productDetail/seatVentilate/seatVentilate",
"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": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -32,11 +10,28 @@ ...@@ -32,11 +10,28 @@
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"initialRenderingCache": "static" "initialRenderingCache": "static"
}, },
"subpackages": [
{
"root": "packagesList",
"name": "packagesList",
"pages": [
"pages/index/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult",
"pages/activityDetail/activityDetail",
"pages/activityApply/activityApply",
"pages/applySuccess/applySuccess",
"pages/videoDetal/videoDetal",
"pages/productDetail/productDetail",
"pages/scenarioDetail/scenarioDetail"
]
}
],
"usingComponents": { "usingComponents": {
"authorize": "components/Authorize/Authorize",
"phone-number": "components/PhoneNumber/PhoneNumber", "phone-number": "components/PhoneNumber/PhoneNumber",
"tab": "/components/Tab/Tab", "navigation-bar": "/components/NavigationBar/NavigationBar",
"navigation-bar": "/components/NavigationBar/NavigationBar" "glsx-image": "/components/image/index",
"loadding": "/components/loadding/loadding"
}, },
"resolveAlias": { "resolveAlias": {
"~/*": "/*" "~/*": "/*"
......
@import "/style/common.wxss";
page {
/* vant 样式覆盖 */
--tabs-bottom-bar-color:#5850FF;
--sidebar-selected-border-color:#5850FF;
--tree-select-nav-background-color:#f6f6f6;
}
.box-center{ .box-center{
position: absolute; position: absolute;
top: 50%; top: 50%;
......
// components/Authorize/Authorize.js // components/Authorize/Authorize.js
import {
componentsMixin
} from '../../mixins/index'
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -39,7 +35,7 @@ Component({ ...@@ -39,7 +35,7 @@ Component({
} }
}, },
observers: { observers: {
'show': function (newVal) { show: function (newVal) {
this.setData({ this.setData({
openSet: newVal openSet: newVal
}) })
...@@ -48,9 +44,7 @@ Component({ ...@@ -48,9 +44,7 @@ Component({
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {},
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
...@@ -58,15 +52,10 @@ Component({ ...@@ -58,15 +52,10 @@ Component({
/** /**
* 禁止滑动 * 禁止滑动
*/ */
noScroll: wx.$util.noScroll(), noScroll(){},
cancel(e) { cancel(e) {
let { let { confirm } = e.currentTarget.dataset
confirm let { buttonType, title } = this.data
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this let _this = this
if (buttonType == 'getUserInfo' && confirm) { if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({ wx.getUserProfile({
...@@ -87,11 +76,7 @@ Component({ ...@@ -87,11 +76,7 @@ Component({
/**检验是否已授权位置 */ /**检验是否已授权位置 */
check() { check() {
const _this = this const _this = this
let { let { buttonType, scopeType, autoOpen } = this.properties
buttonType,
scopeType,
autoOpen
} = this.properties
if (buttonType != 'getPhoneNumber') { if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}` let type = `scope.${scopeType}`
buttonType = 'openSetting' buttonType = 'openSetting'
...@@ -128,12 +113,10 @@ Component({ ...@@ -128,12 +113,10 @@ Component({
} }
}) })
} }
}, },
/**授权手机号 */ /**授权手机号 */
getPhoneNumber({ getPhoneNumber({ detail }) {
detail console.log(detail)
}) {
this.triggerEvent('getphonenumber', detail) this.triggerEvent('getphonenumber', detail)
} }
}, },
......
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
Component({
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = e && e.currentTarget && e.currentTarget.dataset.type || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
},
dateChange(e) {
let {
current
} = e.detail
this.setData({
current
})
},
choose(e) {
let {
dateType,
minDate,
maxDate
} = this.data
let {
data
} = e.currentTarget.dataset
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
done() {
let {
dateType
} = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
this.setData({
current: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
}
},
attached() {
this[CalendarFunction] = new Calendar(this)
}
})
\ No newline at end of file \ No newline at end of file
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot></slot>
</view>
<!-- 弹框模式 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar"></view>
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{isFullSucreen&&!showConfirm?"isFullSucreen":""}}' style="height:{{height}}">
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<block wx:if="{{rangeAll && dateType == 'range'}}">
<view class="calender-all" style="color:{{calenderColor}};" bindtap="chooseAll">全选</view>
</block>
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image src="../images/close.png" webp class='calender-close-image'></image>
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}'></view>
</view>
</picker>
<view class='calender-subtitle' wx:else>{{dateList[current]}}</view>
</block>
<view class='calendar-weekdays'>
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<swiper class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}'></view>
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class='calender-footer {{isFullSucreen}}' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 99;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: 34px !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 24rpx;
transform: translateY(-50%);
font-size: 20rpx;
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: rgba(0, 0, 0, .1);
text-shadow: 0 4rpx 20rpx rgba(0, 0, 0, .1);
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 999rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file \ No newline at end of file
const _CalendarObject_ = Symbol('_CalendarObject_')
const _nowDate_ = Symbol('_nowDate_')
const _separator_ = Symbol('_separator_')
class Calendar {
[_CalendarObject_] = {};
[_nowDate_] = new Date();
[_separator_] = '-';
constructor(calendarObject) {
this[_CalendarObject_] = calendarObject
this[_separator_] = calendarObject.data.separator
this.setCalenderHeight()
this.setMonthList()
let {
weekdays,
firstDayOfWeek
} = calendarObject.data
let firstDay = weekdays[firstDayOfWeek - 1]
let [last, first] = weekdays.join('').split(firstDay)
calendarObject.setData({
weekdays: [firstDay, ...first, ...last]
})
}
/**设置日历高度 */
setCalenderHeight() {
let _this = this[_CalendarObject_]
let {
data: calenderHeight
} = _this
let height = '80%'
if (typeof calenderHeight === 'number') {
wx.$util.getPhoneInfo(res => {
let {
windowHeight
} = res
if (calenderHeight > windowHeight) calenderHeight = windowHeight
if (calenderHeight < windowHeight * 0.5) calenderHeight = windowHeight * 0.5
height = `${calenderHeight}px`
})
}
if (typeof calenderHeight === 'string') {
if (calenderHeight.includes('%')) {
height = calenderHeight
let [num] = calenderHeight.split('%')
if (num < 50) height = '50%'
if (num > 100) height = '80%'
} else {
if (calenderHeight < 50) calenderHeight = '50'
if (calenderHeight > 100) calenderHeight = '80'
height = `${calenderHeight}%`
}
}
_this.setData({
isFullSucreen: wx.$util.isFullSucreen(),
height
})
}
/**设置日期高度 */
setCalenderBodyHeight() {
let _this = this[_CalendarObject_]
wx.$util.getViewInfo('.calender-header', header => {
wx.$util.getViewInfo('.calender-footer', footer => {
let headerHeight = header.height
let footerHeight = footer && footer.height || 0
_this.setData({
calenderBodyHeight: `${headerHeight + footerHeight}px`
})
}, _this)
}, _this)
}
/**设置日期列表 */
setMonthList() {
let {
separator,
previous,
minDate,
maxDate,
next
} = this[_CalendarObject_].data
if (maxDate || minDate) {
if (!minDate) {
let nowMonth = new Date().getMonth()
minDate = new Date(new Date().setMonth(nowMonth - previous)).format(`yyyy${separator}MM${separator}dd`)
}
if (!maxDate) {
maxDate = this[_nowDate_].format(`yyyy${separator}MM${separator}dd`)
}
previous = this.getMonthDifference(minDate, this[_nowDate_].format(`yyyy${separator}MM${separator}dd`))
next = this.getMonthDifference(this[_nowDate_].format(`yyyy${separator}MM${separator}dd`), maxDate)
} else {
previous = previous < 0 ? 0 : previous
next = next < 0 ? 0 : next
}
let nowMonth = this[_nowDate_].getMonth()
let now = new Date().setDate(1)
for (let i = nowMonth - previous; i <= nowMonth + next; i++) {
this.init(new Date(now).setMonth(i))
}
}
/**初始化日期 */
init(date) {
let _this = this[_CalendarObject_]
let {
firstDayOfWeek,
allowSameDay,
multipleDate,
monthList,
rangeDate,
dateList,
dateType,
current,
minDate,
maxDate,
value,
} = _this.data
let separator = this[_separator_]
let [year, month] = new Date(date).format(`yyyy${separator}MM`).split(separator)
let days = this.getDayNumber(year, Number(month))
let week = new Date(year, Number(month) - 1, 1).getDay()
let dateFormat = `yyyy${separator}MM${separator}dd`
let today = value || this[_nowDate_].format(dateFormat)
let nextDay = ''
let arr = []
dateList.push(`${year}${separator}${month}`)
if (dateType === 'range') {
nextDay = new Date(new Date().setDate(new Date(new Date(today)).getDate() + 1)).format(dateFormat)
}
let [now_year, now_month, now_day] = today.split(separator)
let [next_year, next_month, next_day] = allowSameDay ? today.split(separator) : nextDay.split(separator)
for (let i = 1; i <= days; i++) {
let todayStr = `${year}${separator}${month}${separator}${now_day}`
let dayStr = `${year}${separator}${month}${separator}${i < 10 ? `0${i}`:i}`
let obj = {
day: i,
data: dayStr,
active: now_year == year && now_month == month && i == Number(now_day)
}
if ((minDate && Date.parse(minDate) > Date.parse(dayStr)) || (maxDate && Date.parse(maxDate) < Date.parse(dayStr))) obj.disable = true
if (dateType === 'multiple') multipleDate.push(todayStr)
if (nextDay) {
if (now_year == year && now_month == month && i == Number(now_day)) {
obj.start = true
rangeDate.start = todayStr
}
if (next_year == year && next_month == month && i == Number(next_day)) {
obj.active = true
obj.end = true
rangeDate.end = `${year}${separator}${next_month}${separator}${next_day}`
}
}
firstDayOfWeek = firstDayOfWeek == 7 ? 0 : firstDayOfWeek
if (i === 1) obj.week = `week-${week - firstDayOfWeek}`
arr.push(obj)
}
monthList.push({
data: arr,
mark: Number(month)
})
if (current <= 1) {
let [nowYear, nowMonth] = today.split(separator)
current = dateList.findIndex(e => e === `${nowYear}${separator}${nowMonth}`)
}
_this.setData({
multipleDate,
date: today,
rangeDate,
monthList,
dateList,
current
})
}
/**当设置最小日期或者最大日期时 自动设置前后月份 */
getMonthDifference(date1, date2) {
let separator = this[_separator_]
//获取年,月数
let [year1, month1] = date1.split(separator)
let [year2, month2] = date2.split(separator)
let months = (parseInt(year2) - parseInt(year1)) * 12 + (parseInt(month2) - parseInt(month1))
return months
}
/**单选 */
single(e) {
let _this = this[_CalendarObject_]
let {
index,
data,
ind
} = e.currentTarget.dataset
let {
showConfirm,
monthList
} = _this.data
monthList.map(x => {
x.data.map(i => i.active = false)
})
monthList[index].data[ind].active = true
_this.setData({
monthList,
date: data
})
if (!showConfirm) this.done()
}
/**多选 */
multiple(e) {
let _this = this[_CalendarObject_]
let {
index,
ind,
} = e.currentTarget.dataset
let {
monthList
} = _this.data
let arr = []
monthList[index].data[ind].active = !monthList[index].data[ind].active
monthList.map(x => x.data.map(i => {
if (i.active) arr.push(i.data)
}))
_this.setData({
[`monthList[${index}].data`]: monthList[index].data,
multipleDate: arr
})
}
/**范围选择 */
range(e) {
const _this = this[_CalendarObject_]
let {
index,
data,
ind
} = e.currentTarget.dataset
let {
allowSameDay,
showConfirm,
monthList,
rangeDate
} = _this.data
const start = Date.parse(rangeDate.start)
if (rangeDate.end || start > Date.parse(data)) {
monthList = this.clearStatus({
monthList,
index,
ind
})
rangeDate.start = data
rangeDate.end = ''
} else {
if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return
monthList[index].data[ind].active = true
monthList[index].data[ind].end = true
rangeDate.end = data
monthList.map(x => {
x.data.map(i => {
let day = Date.parse(i.data)
i.middle = day > start && day < Date.parse(data)
})
})
}
_this.setData({
monthList,
rangeDate
})
if (!showConfirm && rangeDate.end) this.done()
}
/**点击完成 */
done() {
let _this = this[_CalendarObject_]
let {
multipleDate,
rangeDate,
dateType,
date
} = _this.data
let targer = {
'single': date,
'multiple': multipleDate,
'range': rangeDate
}
if ((dateType === 'multiple' && multipleDate.length < 1) || (dateType === 'range' && !rangeDate.end)) return
_this.triggerEvent('select', {
date: targer[dateType]
})
_this.showCalendar()
}
/**清空范围选择状态 */
clearStatus(params) {
let {
monthList,
index,
ind
} = params
monthList.map(x => x.data.map(i => {
i.active = false
i.start = false
i.end = false
i.middle = false
}))
monthList[index].data[ind].active = true
monthList[index].data[ind].start = true
return monthList
}
/**
* 获取月份天数
*/
getDayNumber(year, month) {
let days = 31
switch (month) {
case 2:
days = (year % 4 == 0 && year % 100 !== 0) || year % 400 == 0 ? 29 : 28
break;
case 4:
case 6:
case 9:
case 11:
days = 30
break;
}
return days
}
/**日期范围 点击全选 */
chooseAll() {
let _this = this[_CalendarObject_]
let {
monthList,
minDate,
maxDate
} = _this.data
monthList.map((e, index) => {
e.data.map((i, ind) => {
let obj = {
currentTarget: {
dataset: {
index,
ind,
data: i.data
}
}
}
if (i.data == minDate) this.range(obj)
if(i.data == maxDate) this.range(obj)
})
})
}
}
export default Calendar
\ No newline at end of file \ No newline at end of file
export default {
properties: {
calenderHeight: {
type: [String, Number]
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#00A479'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
type: [Number, String],
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: []
}
}
\ No newline at end of file \ No newline at end of file
// components/CooperationApply/CooperationApply.js // components/CooperationApply/CooperationApply.js
import WxValidate from "../../utils/WxValidate"; import WxValidate from "../../utils/WxValidate";
import util from "../../utils/util" import util from "../../utils/util"
import {
componentsMixin
} from "../../mixins/index";
Component({ Component({
behaviors: [componentsMixin],
options: {
// 基础库2.2.3开始支持
addGlobalClass: true
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -11,23 +19,25 @@ Component({ ...@@ -11,23 +19,25 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
tabData: [ tabData: [{
{ name: "增值转化",
name: "门店合作申请",
value: 0, value: 0,
}, },
{ {
name: "代理商合作申请", name: "系统订阅",
value: 1, value: 1,
}, },
], ],
tabIndex: 0, tabIndex: 0,
applyForm: { applyForm: {
applyType: '1',
merchantName: "", merchantName: "",
carModel: "", carModel: "",
contactName: "", contactName: "",
contactPhone: "", contactPhone: "",
}, },
foldFlag: false,
selectApply: 1
}, },
/** /**
...@@ -39,11 +49,29 @@ Component({ ...@@ -39,11 +49,29 @@ Component({
this.setData({ this.setData({
tabIndex: e.currentTarget.dataset.index, tabIndex: e.currentTarget.dataset.index,
}); });
this.selectComponent("#sceneBox").resetScene()
},
// 合作方式切换
applyChange(e) {
console.log(e.detail.value);
this.setData({
selectApply: e.detail.value,
});
// this.selectComponent("#sceneBox").resetScene()
},
// 展开收起
handleFold() {
this.setData({
foldFlag: !this.data.foldFlag
})
}, },
// 表单验证规则 // 表单验证规则
initValidate() { initValidate() {
console.log(123123); console.log(123123);
const rules = { const rules = {
applyType: {
required: true,
},
merchantName: { merchantName: {
required: true, required: true,
}, },
...@@ -97,7 +125,24 @@ Component({ ...@@ -97,7 +125,24 @@ Component({
this.showModal(error); this.showModal(error);
return false; return false;
} else { } else {
return [params, this.data.tabIndex]; // return [params, this.data.tabIndex, this.data.applyForm.applyType];
let selectScene = this.selectComponent("#sceneBox").getSceneItems();
if (selectScene && !selectScene[2]) {
wx.hideLoading();
wx.showToast({
title: "请至少选择一个产品",
icon: "none",
});
return false
}
if (selectScene) {
params.businessScenario = selectScene[0].title;
params.productItems = selectScene[1].join(",");
}
let applyType = this.data.tabIndex == 0 ? '增值转化' : '系统订阅';
let ccoperationType = this.data.selectApply == 1 ? '门店' : '代理商';
params.merchantName = params.merchantName + '(' + applyType + '-' + ccoperationType + ')'
return params
} }
}, },
...@@ -116,8 +161,8 @@ Component({ ...@@ -116,8 +161,8 @@ Component({
// 初始化验证规则函数 // 初始化验证规则函数
this.initValidate(); this.initValidate();
}, },
attached: function() { attached: function () {
if (util.getUserInfo()&& util.getUserInfo().phone) { if (util.getUserInfo() && util.getUserInfo().phone) {
this.setPhone(util.getUserInfo().phone) this.setPhone(util.getUserInfo().phone)
console.log(this.data.applyForm) console.log(this.data.applyForm)
} }
......
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"scene" : "../scene/scene"
}
} }
\ No newline at end of file \ No newline at end of file
/* components/CooperationApply/CooperationApply.wxss */ /* components/CooperationApply/CooperationApply.wxss */
.apply-main {
width: 702rpx;
background: #FFFFFF;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.40);
border-radius: 16rpx;
}
.tab-top { .tab-top {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
...@@ -16,7 +23,7 @@ ...@@ -16,7 +23,7 @@
.tab-title-active { .tab-title-active {
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 600; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #323436; color: #323436;
line-height: 110rpx; line-height: 110rpx;
...@@ -47,6 +54,10 @@ ...@@ -47,6 +54,10 @@
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }
.info-list:last-child {
border-bottom: none;
}
.info-lable { .info-lable {
width: 176rpx; width: 176rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
...@@ -58,3 +69,27 @@ ...@@ -58,3 +69,27 @@
.require { .require {
color: #EB4E4E; color: #EB4E4E;
} }
.apply-fold {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF;
text-align: center;
padding: 32rpx 0 40rpx 0;
}
.fold-icon {
width: 24rpx;
height: 24rpx;
vertical-align: middle;
margin-left: 8rpx;
}
.scene-box {
padding-bottom: 50rpx;
}
.cooperate-left {
margin-right: 70rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- components/CooperationApply/CooperationApply.wxml --> <!-- components/CooperationApply/CooperationApply.wxml -->
<view> <view class="apply-main">
<view class="tab-top"> <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}}"> <view wx:for="{{tabData}}" wx:key="index" class="tab-title {{item.value == tabIndex ? 'tab-title-active' : ''}}" bindtap="selectTab" data-index="{{item.value}}">
{{item.name}} {{item.name}}
...@@ -8,13 +8,25 @@ ...@@ -8,13 +8,25 @@
<form> <form>
<view class="apply-info"> <view class="apply-info">
<view class='info-list'> <view class='info-list'>
<text class="info-lable">门店名称<text class="require">*</text> <text class="info-lable">合作方式<text class="require">*</text>
</text>
<radio-group name="applyType" class="radio-wrap" bindchange="applyChange">
<label class="cooperate-left">
<radio value="1" checked />门店合作
</label>
<label>
<radio value="2" />代理商合作
</label>
</radio-group>
</view>
<view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '门店名称' : '企业名称'}}<text class="require">*</text>
</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> <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>
<view class='info-list'> <view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '主营品牌' : '合作品牌'}}</text> <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> <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>
<view class='info-list'> <view class='info-list'>
<text class="info-lable">联系人<text class="require">*</text> <text class="info-lable">联系人<text class="require">*</text>
...@@ -22,10 +34,21 @@ ...@@ -22,10 +34,21 @@
<input name="contactName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input> <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>
<view class='info-list'> <view class='info-list'>
<text class="info-lable">手机号<text class="require">*</text> <text class="info-lable">联系电话<text class="require">*</text>
</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> <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>
</view> </view>
</form> </form>
<!-- 展开收起 -->
<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>
<!-- 选择产品和场景 -->
<view class="scene-box">
<scene id="sceneBox" foldFlag="{{foldFlag}}" selectApply="{{tabIndex}}"></scene>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<view class='cell-box'>
<view class='cell {{border?"border":""}}' bindtap="click">
<view class='cell-label' style="width:{{labelWidth}}">
<text wx:if='{{required}}' class='required'>*</text>{{label||'标题'}}
</view>
<view class='cell-value ' style="width:calc(100% - {{labelWidth}});">
<view class='value {{valueAlign}} {{haveArrow}}'>
<view class='slot'><slot></slot></view>
<view class='details'>{{value}}</view>
</view>
<image wx:if='{{haveArrow}}' webp class='arrow' src="../images/arrow-x.png"></image>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/GlCell/GlCell.wxss */
.cell-box {
background: #fff;
font-size: 28rpx;
color: #333333;
padding-left: 40rpx;
box-sizing: border-box;
}
.cell {
width: 100%;
height: 90rpx;
box-sizing: border-box;
display: flex;
align-items: center;
}
.cell.border {
border-bottom: 2rpx solid #eee;
}
.cell-label {
width: 25%;
}
.cell-value {
width: 75%;
position: relative;
height: 100%;
}
.cell-value .false {
padding-right: 40rpx !important;
}
.value {
width: 100%;
height: 100%;
display: flex;
align-items: center;
padding-right: 70rpx;
box-sizing: border-box;
}
.required{
color: #f00;
}
.details{
display: none;
}
.slot:empty + .details{
display: block;
}
.cell-value .right {
justify-content: flex-end;
height: 100%;
box-sizing: border-box;
}
.slot{
width: 100%;
}
.slot:empty{
display: none;
}
.arrow {
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
width: 28rpx;
height: 26rpx;
}
// components/glTextarea/glTextarea.js
Component({
/**
* 组件的属性列表
*/
properties: {
maxlength: {
type: Number,
value: -1
},
placeholder: String,
showWordLimit: Boolean,
disabled: Boolean,
value: String,
filterEmoji:{
type:Boolean,
value:true
}
},
/**
* 组件的初始数据
*/
data: {
edit: true,
value: null
},
/**
* 组件的方法列表
*/
methods: {
/**
* 打开文本编辑器
*/
openTextarea() {
if (this.data.disabled) return
this.setData({
edit: false,
textareaFocus: true
})
},
setValue(value) {
if(this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
this.setData({
value
})
},
textareaInput(e) {
let {
value
} = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
},
textareaBlur(e) {
let {
value
} = e.detail
this.setData({
edit: true
})
this.setValue(value)
this.triggerEvent('blur', {
value
})
},
}
})
\ No newline at end of file \ No newline at end of file
<view class='textarea-box {{maxlength>0&&showWordLimit?"showWordLimit":""}}'>
<block wx:if='{{edit}}'>
<text class='textarea' bindtap="openTextarea" style="color:{{value?'#333':'#999'}}">{{value||placeholder||'请输入'}}</text>
</block>
<block wx:else>
<textarea class='_textarea_' maxlength="{{maxlength}}" value='{{value}}' bindinput='textareaInput' focus='{{textareaFocus}}' bindblur='textareaBlur' bindconfirm='textareaBlur' ></textarea>
</block>
<block wx:if='{{maxlength>0&&showWordLimit}}'>
<view class='wordLimit'>
{{value.length||0}} / {{maxlength}}
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
/* components/glTextarea/glTextarea.wxss */
.textarea-box {
width: 100%;
height: 100%;
position: relative;
}
.textarea-box .textarea {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow-y: scroll;
}
._textarea_ {
width: 100%;
height: calc(100% - 40rpx);
}
.textarea-box.showWordLimit .textarea {
height: calc(100% - 40rpx);
}
.wordLimit {
position: absolute;
bottom: 0;
right: 0;
color: #999;
}
// components/Login/Login.js
import {
ssoApi
} from '../../api/api'
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
content: {
type: String,
value: '您还没有登录,请您登录后查看!'
},
returnResponse: {
type: Boolean,
value: true
}
},
observers: {
'show': function (newVal, oldVal) {
let {
returnResponse
} = this.data
if (newVal) {
wx.$util.showLoading()
getApp().login(returnResponse).then(({
code,
data
}) => {
this.triggerEvent('loginInfo', {
code,
data
})
wx.hideLoading()
if (data) {
let {
sessionId
} = data
this.setData({
sessionId,
openSet: code != 0
})
this.sessionId = sessionId
if (data.isLogin == 'Y'&& code == '0') {
let thisPage = wx.$router.getPageInstance()
if (thisPage.loginCallBack) thisPage.loginCallBack(data)
if (thisPage.onRoute) thisPage.onRoute()
}
}
})
} else {
this.hide()
}
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
hide() {
this.setData({
openSet: false
})
},
cancel(flag) {
this.hide()
if (flag) this.triggerEvent('cancel')
},
noScroll: wx.$util.noScroll(),
getPhoneNumber({
detail
}) {
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') {
this.cancel(true)
return
}
delete detail.errMsg
if (detail.iv && detail.encryptedData) {
const {
sessionId
} = this.data
wx.$util.showLoading()
detail.sessionId = sessionId
ssoApi.authUserPhone(detail).then(({
data,
code
}) => {
wx.$Track.setTrack({}, 3)
wx.hideLoading()
let thisPage = wx.$router.getPageInstance()
if (code == '0') {
thisPage.setData({
showLogin: false,
userInfo: data
})
wx.$authStatus = false
this.setData({
sessionId: ''
})
wx.$util.setUserInfo(data)
// wx.$util.setSessionId(data.sessionId)
thisPage.onLoad()
thisPage.onShow()
if (thisPage.init) thisPage.init()
if (thisPage.onRoute) thisPage.onRoute()
if (thisPage.loginCallBack) thisPage.loginCallBack(data)
let customerId = wx.$storage.get('srcm_shopmall_customer_id')
let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (customerId) {
ssoApi.updataCustomerPhone({
customerId,
merchantId
}).then(() => {
wx.removeStorageSync('srcm_shopmall_customer_id')
})
}
wx.$util.customerbehavior()
wx.$eventbus.emit('EQUITY')
}
})
}
},
}
})
\ No newline at end of file \ No newline at end of file
<view class="open-seting-bg text-center" wx:if="{{openSet}}" catchtouchmove="noScroll">
<view class="bg" ></view>
<view class="open-set-inner">
<view class="set-title">
<text class="title">温馨提示</text>
<view class="content">{{content}}</view>
</view>
<view class="btn-openset">
<!-- <view bindtap="cancel" class="btn text-center cancel" >取消</view> -->
<navigator class="btn text-center cancel" target="miniProgram" open-type="exit">取消</navigator>
<view class="btn text-center">
登录
<button open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="button-style"></button>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Login/Login.wxss */
@import '../Authorize/Authorize.wxss';
.bg {
position: absolute;
left: 0;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
}
.title {
margin-bottom: 60rpx;
font-size: 36rpx;
font-weight: 500;
}
.content {
font-size: 28rpx;
color: #A3A3A3;
}
.btn {
color: #F13C3D;
}
.cancel {
color: #999;
}
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-09 13:58:15
* @LastEditors: huyue
* @LastEditTime: 2022-12-13 10:36:15
*/
// components/Login/Login.js // components/Login/Login.js
import { ssoApi } from "../../api/api"; import { ssoApi } from "../../api/api";
import { componentsMixin } from "../../mixins/index"; import { componentsMixin } from "../../mixins/index";
Component({ Component({
externalClasses: ['custom-class'],
behaviors: [componentsMixin], behaviors: [componentsMixin],
// options: {
// styleIsolation: 'isolated'
// },
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
isHidden: {
type: Boolean,
value: false
},
phoneText: { phoneText: {
type: String, type: String,
value: '了解更多案例' value: '了解更多案例'
}, },
isImage: { /**
type: Boolean, * type: 场景类型: home.首页,整行;product.详情中的查看更多和申请合作切换;scenario场景详情:转发+合作申请;video 视频详情
value: false */
type: {
type: String
}, },
showIcon: { hasPhoneNumber: {
type: Boolean, type: Boolean,
value: true observer(n) {
this.setData({
hasPhone: n
})
}
} }
}, },
observers: {},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: {}, data: {
hasPhone: false
},
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -36,30 +50,22 @@ Component({ ...@@ -36,30 +50,22 @@ Component({
methods: { methods: {
// 获取手机号 // 获取手机号
getPhoneNumber({detail}) { getPhoneNumber({detail}) {
if ( if ( detail.errMsg && detail.errMsg.indexOf('user deny') !== -1 ) {
detail.errMsg &&
// e.detail.errMsg == "getPhoneNumber:fail user deny"
detail.errMsg.indexOf('user deny') !== -1
) {
wx.hideLoading() wx.hideLoading()
return; return;
} else {
// wx.$util.showLoading('正在授权...')
} }
// this.triggerEvent("updatePhoneNumber", '18873336682');
wx.$util.showLoading('正在授权...') wx.$util.showLoading('正在授权...')
getApp()
.login(true)
.then(({ data }) => {
delete detail.errMsg; delete detail.errMsg;
if (detail.iv && detail.encryptedData) { if (detail.iv && detail.encryptedData) {
ssoApi.authUserPhone(detail).then(({ data, code, message }) => { ssoApi.authUserPhone(detail).then(({ data, code, message }) => {
wx.hideLoading() wx.hideLoading()
if (code==0) { if (code==0) {
wx.$util.setUserInfo(data); wx.$util.setUserInfo(data);
// wx.$util.setSessionId(data.sessionId);
// 其他操作 // 其他操作
this.triggerEvent("updatePhoneNumber", data.phone); this.triggerEvent("updatePhoneNumber", data.phone);
this.setData({
hasPhone: true
})
} else { } else {
wx.showToast({ wx.showToast({
title: message, title: message,
...@@ -69,7 +75,27 @@ Component({ ...@@ -69,7 +75,27 @@ Component({
} }
}); });
} }
});
}, },
jump() {
// this.triggerEvent('toApplication')
console.log(333);
wx.$router.go("/packagesList/pages/activityApply/activityApply");
},
forward() {
this.triggerEvent('toForward')
},
downVideo() {
let that = this
wx.showModal({
content: '是否下载视频',
success (res) {
if (res.confirm) {
that.triggerEvent('videodown')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
}, },
}); });
.fixBottom {
position: fixed;
display: flex;
bottom: 0;
width: 100%;
box-sizing: border-box;
background-color: #fff;
box-shadow: inset 0 2rpx 0 0 #F2F3F7;
padding: 16rpx 48rpx;
filter: blur(0);
.home-btn {
width: 100%;
}
.video-btn {
display: flex;
flex: 1;
}
.phoneNumber {
width: 100%;
color: #fff;
background-color: #5850FF;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0;
height: 72rpx;
line-height: 72rpx;
animation: scaleDrew 2.5s infinite;
}
@keyframes scaleDrew {
/* 定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称 */
0% {
transform: scale(1);
}
25% {
transform: scale(0.95);
}
50% {
transform: scale(1);
}
75% {
transform: scale(0.95);
}
}
.forward-box {
width: 136rpx;
padding: 4rpx 44rpx;
height: 88rpx;
text-align: center;
margin-right: 40rpx;
margin-top: -16rpx;
box-shadow: 8rpx 0 16rpx 0 rgba(202, 211, 230, 0.30);
.forward-text {
line-height: 32rpx;
}
.icon-forward {
width: 48rpx;
height: 48rpx;
}
}
button {
margin: 0;
line-height: 88rpx;
}
// 了解更多的样式
.phone-number {
display: flex;
width: 100%;
align-items: center;
justify-content: center;
// margin: 16rpx 48rpx;
color: #fff;
font-size: 28rpx;
letter-spacing: 0.8rpx;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
line-height: 72rpx;
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
}
.video-box {
display: inline-flex;
margin-right: 20rpx;
.btn-item {
width: 100rpx;
text-align: center;
.btn-text {
font-weight: 500;
font-size: 20rpx;
color: #5A6066;
}
}
.icon-forward {
width: 40rpx;
height: 40rpx;
}
.phoneNumber {}
}
}
// .isFullSucreen {
// width: 100%;
// }
.product_full {
flex: 1;
display: flex;
align-items: center;
}
.forward_box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0 !important;
margin: 0;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 10px;
color: #6E6E7A;
background: #fff;
box-shadow: 4px 0 8px 0 rgba(202, 211, 230, 0.30);
.icon-forward {
flex-shrink: 0;
}
}
.share_btn_item {
line-height: normal !important;
box-shadow: none;
border: 0 !important;
background-color: none !important;
}
.share_btn_item:after {
display: none;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{isImage}}"> <view class="fixBottom custom-class">
<button class="imageBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> <view wx:if="{{type == 'home'}}" class="isFullSucreen home-btn">
<!-- <view class="isFullSucreen"> -->
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
<!-- </view> -->
</view>
<view wx:if="{{type == 'product'}}" class="isFullSucreen product_full">
<block wx:if="{{hasPhone}}">
<button class="forward-box forward_box" open-type="share">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="forward-text" bindtap="forward">转发</view>
</button> </button>
</block> <button class="phoneNumber" bindtap="jump">申请合作</button>
<block wx:else> </block>
<button class="{{isHidden ? 'hidden-phone':'phone-number'}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> <block wx:else>
<image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image> <button class="phone-number" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
{{phoneText}} {{phoneText}}
<image wx:if="{{showIcon}}" class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image> <image class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
</button> </button>
</block>
\ No newline at end of file \ No newline at end of file
</block>
</view>
<view wx:if="{{type == 'scenario'}}" class="isFullSucreen product_full">
<button class="forward-box forward_box" open-type="share">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="forward-text" bindtap="forward">转发</view>
</button>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
<view wx:if="{{type == 'video'}}" class="isFullSucreen video-btn">
<view class="video-box">
<view class="btn-item" bindtap="downVideo">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-download.png"></image>
<view class="btn-text" >下载</view>
</view>
<button class="btn-item forward_box share_btn_item" bindtap="forward" open-type="share">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="btn-text">转发</view>
</button>
</view>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* 手机号授权 */
.phone-number {
display: flex;
align-items: center;
justify-content: center;
margin: 16rpx 48rpx;
color: #fff;
font-size: 28rpx;
letter-spacing: 0.8rpx;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
.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 \ No newline at end of file
// components/share/share.js
import Draw_Function from './draw_function'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
observer: function (newVal, oldVal) {
let {
wxShare
} = this.data
this.check(newVal)
if (!wxShare) {
this.setData({
_show: true
})
}
}
},
toast: {
type: String,
value: '生成中...'
},
canvasObject: Object,
hideCancel: Boolean,
diyDraw: Boolean,
hideWx: Boolean,
wxShare: Boolean
},
ready() {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
/**
* 检查
*/
check(bool) {
if (bool) {
if (this.data.tempFilePath) return
this.getImgData(res => {
this.draw(res)
})
}
},
/**
* 禁止滑动
*/
noScroll: wx.$util.noScroll(),
/**
* 取消
*/
cancel() {
this.setData({
_show: false
})
},
saveImg() {
let _this = this
wx.saveImageToPhotosAlbum({
filePath: _this.data.tempFilePath,
success(e) {
wx.$util.showToast('保存成功')
_this.triggerEvent('callBack')
}
})
},
/**保存 */
save() {
this.saveImg()
wx.nextTick(() => this.cancel())
},
/**
* 检查
*/
checkSetting() {
this.setData({
settingStatus: !this.data.settingStatus
})
},
/**
* 开始生成
*/
draw(images) {
const {
canvasObject,
wxShare
} = this.__data__
let {
height,
width
} = canvasObject
width = width || 300
height = height || 150
wx.$util.getPhoneInfo(phoneInfo => {
wx.$util.getViewInfo('.choose-list', listInfo => {
wx.$util.getViewInfo('.bg', bgInfo => {
let {
windowWidth
} = phoneInfo
let pixelRatio = windowWidth / 750
let viewTop = !wxShare ? (bgInfo.height - listInfo.height - height * pixelRatio) / 2 : 0
this.setData({
canvasStyle: `width:${width * pixelRatio}px;height:${height * pixelRatio}px;top:${viewTop}px;`,
previewStyle: `width:${width * pixelRatio}px;height:${width * pixelRatio * 0.8}px;`,
pixelRatio,
viewTop,
height,
width
})
this.ctx = wx.createCanvasContext('canvasImg', this)
this.ctx.clearRect(0, 0, width, height)
this.draw_canvas({
canvasObject,
images,
width,
height
}, canvas => {
canvas.draw(false, setTimeout(() => {
this.getCanvasImg()
}, 500))
})
})
}, this)
}, this)
},
/**画布 */
draw_canvas(params, callBack) {
const {
canvasObject,
images,
height,
width
} = params
const {
backgroundColor,
textList,
lines
} = canvasObject
const draw_function = new Draw_Function(this)
this.ctx.setFillStyle(backgroundColor || '#fff')
this.ctx.fillRect(0, 0, width, height)
this.ctx.save()
if (this.__data__.diyDraw) {
this.triggerEvent('draw', {
ctx: this.ctx,
canvasObject,
callBack,
height,
images,
width
})
} else {
images && images.length > 0 && (images.map(e => {
draw_function.drawImages(e)
}))
textList && textList.length > 0 && (textList.map(e => {
e.width = canvasObject.width
draw_function.drawText(e)
}))
lines && lines.length > 0 && (lines.map(e => {
draw_function.drawLine(e)
}))
callBack(this.ctx)
}
},
/**
* 画布生成图片
*/
getCanvasImg() {
let _this = this
let {
pixelRatio,
wxShare,
height,
width
} = _this.data
wx.canvasToTempFilePath({
canvasId: 'canvasImg',
width: width * pixelRatio,
height: height * pixelRatio,
fileType: 'jpg',
quality: 1,
x: 0,
y: 0,
success(res) {
let {
tempFilePath
} = res
if (wxShare) {
wx.hideLoading()
_this.checkSetting()
wx.showShareImageMenu({
path: tempFilePath,
success(res) {
console.log(res)
}
})
} else {
setTimeout(() => {
_this.createPreviewImg({
tempFilePath,
width
})
}, 300)
}
},
fail(err) {
wx.hideLoading()
}
}, this)
},
/**生成预览图 */
createPreviewImg(params) {
const p_ctx = wx.createCanvasContext('preview', this)
let {
tempFilePath,
width
} = params
p_ctx.drawImage(tempFilePath, 0, 0, width, width * 0.8)
let _this = this
p_ctx.draw(false, setTimeout(() => {
wx.canvasToTempFilePath({
height: width * 1.6,
width: width * 2,
canvasId: 'preview',
fileType: 'jpg',
quality: 1,
x: 0,
y: 0,
success(preview) {
_this.setData({
tempFilePath
})
_this.triggerEvent('init', {
previewImg: preview.tempFilePath,
tempFilePath
})
wx.hideLoading()
},
fail(err) {
wx.hideLoading()
}
}, this)
}, 500))
},
/**
* 批量转换图片
*/
getImgData(callBack) {
let _this = this
let {
canvasObject,
toast,
} = this.__data__
let {
imgList
} = canvasObject
wx.showLoading({
title: toast,
mask: true,
success() {
if (imgList.length > 0) {
_this.createLocalImg(imgList, 0, res => {
callBack(res)
})
} else {
callBack()
}
}
})
},
/**网络图片转成本地资源 */
createLocalImg(imgList, index = 0, callBack) {
if (index === imgList.length) return callBack(imgList)
wx.$util.promise(resolve => {
wx.getImageInfo({
src: imgList[index].url,
success(res) {
imgList[index].url = res.path
resolve()
},
fail() {
wx.$util.showToast('图片生成失败,请稍后再试')
wx.hideLoading()
console.error(`索引为:${index}的图片转换本地失败,${JSON.stringify(imgList[index].url)}`)
}
})
}).then(() => {
this.createLocalImg(imgList, index + 1, callBack)
})
}
}
})
\ No newline at end of file \ No newline at end of file
<view class='share-box' catchtouchmove='noScroll' wx:if='{{_show}}'>
<view class='bg' bindtap='cancel'></view>
<view class='info {{flag?"flag":""}}' style="top:{{viewTop}}px;" hidden="{{canvasObject.showCanvas}}">
<slot></slot>
</view>
<view class='choose-list' style="height:{{hideCancel?'auto':'298rpx'}}">
<view class='list'>
<view class='list-btn' wx:if='{{!hideWx}}'>
<image src='../images/wx.png' webp class='image'></image>
<view>微信好友</view>
<button open-type='share' bindtap='cancel' class='button'></button>
</view>
<view class='list-btn' bindtap='checkSetting'>
<image src='../images/share.png' webp class='image'></image>
<view>保存分享</view>
</view>
</view>
<view wx:if='{{!hideCancel}}' class='cancel' bindtap='cancel'>取消</view>
</view>
</view>
<view class='canvas {{wxShare?"":"showCanvas"}}' style="{{canvasStyle}}">
<canvas canvas-id='canvasImg' style='width:100%;height:100%;'></canvas>
</view>
<view class='preview' style="{{previewStyle}}">
<canvas canvas-id="preview" style='width:100%;height:100%;'></canvas>
</view>
<authorize scopeType='writePhotosAlbum' checkSetting='{{settingStatus}}' bindsuccess='save'></authorize>
\ No newline at end of file \ No newline at end of file
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.share-box {
position: fixed;
z-index: 999999;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
}
.share-box .info {
width: auto;
height: auto;
position: absolute;
left: 1000%;
transform: translateX(-50%);
overflow: hidden;
}
.share-box .info.flag{
left: 50%;
animation: showInfo .5s forwards;
}
@keyframes showInfo{
0%{
opacity: 0;
}
100%{
opacity: 1;
}
}
.share-box .bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
}
.choose-list {
width: 100%;
position: absolute;
left: 0;
background: #f6f6f6;
animation: showChoose .4s forwards;
}
@keyframes showChoose{
0%{
bottom: -100%;
}
100%{
bottom: 0%;
}
}
.choose-list .cancel {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 96rpx;
line-height: 96rpx;
text-align: center;
font-size: 28rpx;
color: #333;
background: #fff;
}
.list {
width: 100%;
height: 182rpx;
background: #fff;
display: flex;
}
.list-btn {
flex: 1;
text-align: center;
font-size: 24rpx;
color: #333;
padding-top: 40rpx;
position: relative;
}
.list-btn .image {
width: 60rpx;
height: 60rpx;
margin-bottom: 10rpx;
}
.list-btn .button {
width: 100%;
height: 100%;
position: absolute;
opacity: 0;
top: 0;
left: 0;
}
.canvas {
position: fixed;
top: -1000%;
left: -1000%;
animation: canvasShow .5s forwards;
}
.preview{
position: fixed;
top: 1000%;
left: 1000%;
z-index: 999999999;
}
@keyframes canvasShow{
0%{
opacity: 0;
}
100%{
opacity: 1;
}
}
.showCanvas{
left: 50%;
transform: translateX(-50%);
z-index: 99999999999;
}
\ No newline at end of file \ No newline at end of file
const _ctx_ = Symbol('_ctx_')
const _pixelRatio_ = Symbol('_pixelRatio_')
class Draw_Function {
[_ctx_] = null;
[_pixelRatio_] = null;
constructor(_this_) {
this[_ctx_] = _this_.ctx
this[_pixelRatio_] = _this_.data.pixelRatio || 2
}
drawImages(imageParams) {
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()
}
this[_ctx_].drawImage(url, x, y, width, height)
this[_ctx_].restore()
}
toRpx(val) {
return this[_pixelRatio_] * val
}
getTextWidth(text, fontSize) {
if (fontSize) this[_ctx_].setFontSize(fontSize)
return this[_ctx_].measureText(text).width
}
drawFill(x, y, width, height, color) {
this[_ctx_].beginPath()
this[_ctx_].setFillStyle(color || '#000')
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,
opacity,
lineNum,
width,
color,
text,
x,
y,
} = textParams
let text_width = this.getTextWidth(text)
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)
width = this.toRpx(width)
x = this.toRpx(x)
y = this.toRpx(y)
let fontX = this.getFontWidth({
textAlign,
fontSize,
text,
x,
})
if (textParams.border) {
let boxX = this.toRpx(textParams.x - 4.5),
boxY = this.toRpx(textParams.y - 0.5),
boxWidth = text_width + this.toRpx(9),
boxHeight = lineHeight + this.toRpx(4)
if (boxWidth > width - fontX - this.getTextWidth('…') - fontSize) {
boxWidth = width - boxX + this.toRpx(9)
}
this.drawFill(boxX, boxY, boxWidth, boxHeight, textParams.border)
}
if (textParams.background) {
let boxX = this.toRpx(textParams.x - 4),
boxY = this.toRpx(textParams.y),
boxWidth = text_width + this.toRpx(8),
boxHeight = lineHeight + this.toRpx(3)
if (boxWidth > width - fontX - this.getTextWidth('…') - fontSize) {
boxWidth = width - boxX + this.toRpx(8)
}
this.drawFill(boxX, boxY, boxWidth, boxHeight, textParams.background)
}
this[_ctx_].beginPath()
this[_ctx_].setGlobalAlpha(opacity)
this[_ctx_].setFontSize(fontSize)
this[_ctx_].setFillStyle(color || '#000')
this[_ctx_].setStrokeStyle(color || '#000')
this[_ctx_].setTextBaseline(textBaseline)
this[_ctx_].setTextAlign(textAlign)
this[_ctx_].setLineWidth(this.toRpx(2))
const drawOneLineText = () => {
let textArr = text.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 (checkFontWeight(fontWeight)) this[_ctx_].strokeText(newText, x, textHeight, 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 (checkFontWeight(fontWeight)) this[_ctx_].strokeText(newText, 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()
}
drawLine(lineParams) {
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_].setGlobalAlpha(typeof opacity === 'number' ? opacity : 1)
this[_ctx_].setStrokeStyle(color || '#000')
this[_ctx_].setLineWidth(width || this.toRpx(1))
this[_ctx_].moveTo(startX, startY)
this[_ctx_].lineTo(endX, endY)
this[_ctx_].stroke()
this[_ctx_].restore()
this[_ctx_].save()
}
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(params) {
let {
textAlign,
text,
x
} = params
let textWidth = this[_ctx_].measureText(text).width
let type = {
'left': x,
'center': x - textWidth / 2,
'right': x - textWidth
}
return type[textAlign]
}
drawRadiusRect(params) {
let {
borderRadius,
height,
width,
x,
y,
} = params
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))
}
}
getFontWidth(params) {
let {
textAlign,
fontSize,
text,
x
} = params
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_].setGlobalAlpha(opacity)
this[_ctx_].moveTo(lineX, lineY)
this[_ctx_].lineTo(lineX + this[_ctx_].measureText(newText).width, lineY)
}
}
const checkFontWeight = (fontWeight = '0') => {
return (fontWeight && (typeof fontWeight === 'string' || typeof fontWeight === 'number') && (fontWeight == 'bold' || fontWeight >= 700))
}
const checkTextDecoration = textDecoration => {
return (textDecoration && (textDecoration === 'underline' || textDecoration === 'overline' || textDecoration === 'line-through'))
}
export default Draw_Function
\ No newline at end of file \ No newline at end of file
Component({
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: {
type: String,
value: '100vh'
},
tagIndex: {
type: Number,
value: 0,
observer: function (n, o) {
this.setData({
count: n
})
}
},
key: {
type: String,
value: 'name'
},
showClickLoading:Boolean
},
/**
* 组件的初始数据
*/
data: {
count: 0,
scrollTop: 0
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
item,
index
} = e.currentTarget.dataset
if(this.data.count === index) return
if(this.properties.showClickLoading) wx.$util.showLoading('')
item.index = index
this.setData({
count: index,
scrollTop: 0
})
this.triggerEvent('click', item)
wx.nextTick(()=>{
wx.hideLoading()
})
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
}
},
ready() {
}
})
\ No newline at end of file \ No newline at end of file
<view class='tab-box' id='tabView' style="height:{{height}}">
<scroll-view style="height:100%;" scroll-y class='tab' bindscrolltolower='tabScrollTolower'>
<view>
<block wx:for='{{tabList}}' wx:key='index'>
<view class='tab-item {{count==index?"active":""}}' bindtap="click" data-item='{{item}}' data-index='{{index}}'>{{item[key]}}</view>
</block>
</view>
</scroll-view>
<view class='view'>
<scroll-view style="height:100%" scroll-y scroll-top='{{scrollTop}}' bindscrolltolower='viewScrollTolower'>
<slot></slot>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/tabView/tabView.wxss */
.tab {
float: left;
width: 26.67%;
box-sizing: border-box;
text-align: center;
background: #f4f4f4;
}
.view {
float: left;
width: 73.33%;
height: 100%;
position: relative;
}
.tab-item {
width: 100%;
height: 96rpx;
line-height: 96rpx;
font-size: 24rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333;
box-sizing: border-box;
padding: 0 10rpx;
}
.active {
font-weight: 700;
background: #fff;
position: sticky;
top: 0;
font-size: 28rpx;
}
// components/TimeHorizon/TimeHorizon.js
Component({
/**
* 组件的属性列表
*/
properties: {
config: {
type: Object,
observer: function (newVal, oldVal) {
let {
havehhmmss,
startData,
startTime,
startLabel,
valueAlign,
endData,
endLabel,
} = newVal
valueAlign = valueAlign || 'left'
this.setData({
havehhmmss,
startData,
startTime,
startLabel,
valueAlign,
endData,
endLabel
})
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
dateChange(e) {
let {
value
} = e.detail
let {
type
} = e.currentTarget.dataset
if (this.data.endData && type === 'start') {
this.setData({
endData: ''
})
}
let {
havehhmmss
} = this.data
if(havehhmmss)
value = havehhmmss ? type === 'start' ? `${value} 00:00:00` : `${value} 23:59:59` : value
this.setData({
[`${type}Data`]: value
})
let {
startData,
endData,
} = this.data
if (startData && endData) this.triggerEvent('change', {
startData,
endData
})
}
}
})
\ No newline at end of file \ No newline at end of file
<view class='time-box'>
<picker class='time-picker' mode="date" value="{{startData}}" start="{{startTime}}" bindchange="dateChange" data-type='start'>
<view class='time-picker-view'>
<view class='time-picker-label'>{{startLabel||'开始时间'}}</view>
<view class='time-picker-value {{!startData?"no-data":""}} {{valueAlign}}'>
{{startData||'请选择'}}
<image class='arrow' webp src="../images/arrow-x.png"></image>
</view>
</view>
</picker>
<picker class='time-picker' mode="date" value="{{endData}}" start="{{startData}}" bindchange="dateChange" data-type='end'>
<view class='time-picker-view'>
<view class='time-picker-label'>{{endLabel||'结束时间'}}</view>
<view class='time-picker-value {{!endData?"no-data":""}} {{valueAlign}}'>
{{endData||'请选择'}}
<image class='arrow' webp src="../images/arrow-x.png"></image>
</view>
</view>
</picker>
</view>
\ No newline at end of file \ No newline at end of file
/* components/TimeHorizon/TimeHorizon.wxss */
.time-box {
background: #fff;
font-size: 28rpx;
color: #333333;
}
.time-picker {
padding-left: 40rpx;
}
.time-picker-view {
display: flex;
align-items: center;
width: 100%;
height: 90rpx;
box-sizing: border-box;
border-bottom: 2rpx solid #eee;
}
.time-picker-label{
width: 25%;
box-sizing: border-box;
}
.time-picker-value{
width: 75%;
display: flex;
align-items: center;
position: relative;
}
.time-picker-value.right{
justify-content: flex-end;
padding-right: 70rpx;
}
.no-data {
color: #999;
}
.arrow {
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
width: 28rpx;
height: 26rpx;
}
// components/GlCell/GlCell.js // components/customer/customer.js
import {
componentsMixin
} from "../../mixins/index";
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
label:String, qrCode: {
labelWidth:String, type: String,
border:Boolean, }
haveArrow:Boolean,
value:String,
valueAlign:String,
required:Boolean
}, },
/** /**
...@@ -24,8 +24,10 @@ Component({ ...@@ -24,8 +24,10 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
click(e){ // 关闭客服弹框
this.triggerEvent('click') closeQR() {
console.log(333);
this.triggerEvent('closeQR')
} }
} }
}) })
/* components/customer/customer.wxss */
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
.bg-icon {
position: absolute;
top: 220rpx;
left: 0;
width: 750rpx;
height: 800rpx;
}
.qrcode-icon {
position: absolute;
top: 470rpx;
right: 190rpx;
width: 374rpx;
height: 374rpx;
}
.tip-icon {
position: absolute;
top: 500rpx;
right: 33rpx;
width: 100rpx;
height: 100rpx;
}
.close-icon {
position: absolute;
top: 940rpx;
right: 343rpx;
width: 64rpx;
height: 64rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--components/customer/customer.wxml-->
<block>
<view class="model">
<image class="bg-icon" webp src="{{IMGURL}}home/QR_code_bg.png?v={{img_version}}"></image>
<image webp class="qrcode-icon" show-menu-by-longpress src="{{qrCode}}"></image>
<!-- <image class="tip-icon" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image> -->
<image class="close-icon" bindtap="closeQR" webp src="{{IMGURL}}home/close_icon.png?v={{img_version}}"></image>
</view>
</block>
// components/image/index.js
import { IMG_URL, IMG_VERSION } from '~/utils/constantData'
Component({
externalClasses: ['custom-class', 'class'],
/**
* 组件的属性列表
*/
properties: {
src: {
type: String,
value: '',
observer: function (url, o) {
if (url) {
let isWebp = url.includes('webp')
this.setData({
isWebp,
imagePath: `${IMG_URL}${url}?v=` + IMG_VERSION()
})
}
}
},
mode: {
type: String,
value: 'scaleToFill'
},
webp: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
imagePath: '',
isWebp: false
},
// 组件生命周期
lifetimes: {
// 在组件实例进入页面节点树时执行
// attached: function () {
// let src = this.data.src
// let prefix = IMG_URL
// this.setData({
// imagePath: `${prefix}${src}?v=` + IMG_VERSION()
// })
// },
// 在组件实例被从页面节点树移除时执行
detached: function () {}
},
/**
* 组件的方法列表
*/
methods: {}
})
/* components/image/index.wxss */
\ No newline at end of file \ No newline at end of file
<!-- components/image/index.wxml -->
<image
src="{{imagePath}}"
mode="{{mode}}"
webp="{{webp||isWebp}}"
lazy-load
class="custom-class class" />
// components/shareBtn/shareBtn.js // components/loadding/loadding.js
import { componentsMixin } from "../../mixins/index";
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
/* components/loadding/loadding.wxss */
.loadding {
height: 100vh;
font-weight: 500;
font-size: 48rpx;
color: #2D2D33;
text-align: center;
margin-top: 340rpx;
&-img {
width: 432rpx;
height: 300rpx;
margin-bottom: 50rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--components/loadding/loadding.wxml-->
<view class="loadding">
<glsx-image custom-class="loadding-img" src="home/loadding.webp" />
<view>努力加载中</view>
</view>
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
const norTabList = ['项目亮点', '合作案例', '合作方式', '适配产品']
import { componentsMixin } from "../../mixins/index";
Component({
externalClasses: ['custom-class'],
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
// 场景值下标
actNum: {
type: Number,
value: -1,
observer(n) {
this.getInfo()
this.getImgHeight()
}
},
// 选中的产品
activeNavIdx: {
type: Number,
value: 0
},
cardInfo: {
type: Object,
value: {}
},
// 配置url
activeUrl: {
type: String,
value: ''
},
detailType: {
type: String,
value: 'pro'
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
productData: productData1,
proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0,
scrollTop: 0,
showCard: false,
tabList: []
},
/**
* 组件的方法列表
*/
methods: {
getInfo() {
let { activeNavIdx, actNum } = this.data
console.log(actNum)
console.log(activeNavIdx)
const spcList = [99, 4] // 订阅模块需要特殊处理
console.log(productData1, 'productData')
const senceList = productData1[actNum].filter(item => item.name != '全部')
console.log(senceList)
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
console.log(item, 'item----')
//console.log(item.productList.find(k => k.id == activeNavIdx))
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
})
console.log(this.data.productImgs, proInfo)
// console.log(this.data.prodItemVideo, 'prodItemVideo--------')
break
}
}
},
getImgHeight() {
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let imgTopArr = []
let s = 0
let top
let { scrollTop } = this.data
let _this = this
query
.selectAll('.img-item')
.boundingClientRect(react => {
react.forEach((item, index) => {
//44 tab的高度
// console.log('item',item)
s = item.top - 44 + scrollTop
imgTopArr.push(s)
})
_this.setData({
imgTopArr
})
})
.exec()
// setTimeout(() => {
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
},
// 1.3查看活动详情按钮
checkActive() {
// 跳转
// console.log('跳转')
let { activeUrl } = this.data
wx.$router.jumpH5(activeUrl);
},
onClickTab(event) {
// console.log('event: ', event);
let { index } = event.detail
// console.log('index: ', index);
this.setData({
tabAct: index
})
let { imgTopArr } = this.data
wx.pageScrollTo({
scrollTop: imgTopArr[index] + 5
})
},
pageSroll(e) {
let { imgTopArr } = this.data
wx.nextTick(() => {
let idx
if (imgTopArr[0] > e.scrollTop) {
idx = 0
} else if (imgTopArr[imgTopArr.length - 1] > e.scrollTop && imgTopArr[0] < e.scrollTop) {
idx = imgTopArr.findIndex(item => item > e.scrollTop) - 1
} else {
idx = imgTopArr.length - 1
}
this.setData({
tabAct: idx,
scrollTop: e.scrollTop
})
})
},
selectCard() {
this.setData({
showCard: !this.data.showCard
})
},
// 长按图片
handleLongPress(e) {
let { actnum, index } = e.target.dataset
// 膨胀金活动,合作方式
if (actnum == 4 && index == 4) {
wx.$router.jumpH5('https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf');
}
}
}
})
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"user-info": "../UserInfo/UserInfo"
}
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/productDetail/components/proDetail/proDetail.wxss */
page {
background-color: #fff;
}
.view-prod {
.frame {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 422rpx;
border-radius: 16rpx;
box-sizing: border-box;
}
.title-wrap {
margin-bottom: 32rpx;
margin-left: 32rpx;
margin-right: 32rpx;
display: flex;
height: 104rpx;
align-items: center;
.title {
width: 564rpx;
height: 48rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
.check {
margin-left: 30rpx;
margin-right: 6rpx;
width: 28rpx;
height: 28rpx;
}
.num {
font-size: 24rpx;
color: #5a6066;
}
}
.no-video {
margin: 16rpx auto 32rpx;
display: block;
width: 686rpx;
height: 386rpx;
border-radius: 16rpx;
}
.tab-wrap {
position: sticky;
top: 0;
margin-bottom: 20rpx;
z-index: 1;
.tabs-index--van-tabs {
top: -1px
}
.van-tab {
font-size: 28rpx;
color: #5a6066;
}
.van-tab--active {
font-weight: 600;
font-size: 28rpx;
color: #3666fe;
}
frame .van-tabs__line {
width: 112rpx !important;
height: 4rpx !important;
}
}
.prod-detail {
.occupancy {
height: 120rpx;
}
.img-item {
position: relative;
width: 100%;
}
.phone {
position: absolute;
top: 60rpx;
right: 32rpx;
font-weight: 400;
font-size: 24rpx;
color: #6C6C6C;
display: flex;
align-items: center;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 6rpx;
}
}
.check-act {
position: absolute;
bottom: 94rpx;
right: 60rpx;
font-size: 24rpx;
color: #3666FE;
text-decoration: underline;
}
.more-btn {
position: absolute;
left: 50%;
bottom: 50px;
transform: translateX(-50%);
width: 622rpx;
height: 96rpx;
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: 96rpx;
}
// .img-item0 {
// width: 100%;
// height: 2564rpx;
// }
// .img-item1 {
// width: 100%;
// height: 1812rpx;
// }
// .img-item2 {
// width: 100%;
// height: 620rpx;
// }
// .img-item3 {
// width: 100%;
// height: 2156rpx;
// }
// 流程图一
.img-item00 {
width: 100%;
height: 3308rpx;
}
.img-item01 {
width: 100%;
height: 2598rpx;
}
.img-item02 {
width: 100%;
height: 490rpx;
}
.img-item03 {
width: 100%;
height: 688rpx;
}
// // 流程图二
.img-item10 {
width: 100%;
height: 1488rpx;
}
.img-item11 {
width: 100%;
height: 2192rpx;
}
.img-item12 {
width: 100%;
height: 490rpx;
}
.img-item13 {
width: 100%;
height: 688rpx;
}
// // 流程图三
.img-item20 {
width: 100%;
height: 1488rpx;
}
.img-item21 {
width: 100%;
height: 570rpx;
}
.img-item22 {
width: 100%;
height: 490rpx;
}
.img-item23 {
width: 100%;
height: 864rpx;
}
// // 流程图四
.img-item30 {
width: 100%;
height: 5758rpx;
}
.img-item31 {
width: 100%;
height: 1812rpx;
}
.img-item32 {
width: 100%;
height: 490rpx;
}
.img-item33 {
width: 100%;
height: 2002rpx;
}
.img-item46 {
width: 100%;
height: 1684rpx;
}
.img-item47 {
width: 100%;
height: 3688rpx;
}
// .img-item48 {
// width: 100%;
// height: 4004rpx;
// }
.img-item48 {
width: 100%;
height: 472rpx;
}
.img-item49 {
width: 100%;
height: 4594rpx;
}
.img-item50 {
width: 100%;
height: 1650rpx;
}
.img-item51 {
width: 100%;
height: 552rpx;
}
.img-item52 {
width: 100%;
height: 4360rpx;
}
.img-item53 {
width: 100%;
height: 1130rpx;
}
.img-item54 {
width: 100%;
height: 428rpx;
}
.img-item40 {
height: 1564rpx;
}
.img-item41 {
height: 1224rpx;
}
.img-item42 {
height: 1148rpx;
}
.img-item43 {
height: 3504rpx;
}
.img-item44 {
height: 2220rpx;
}
.img-item45 {
height: 1092rpx;
}
}
}
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 3;
background-color: transparent;
}
.pro-head {
position: relative;
.select-card {
position: absolute;
right: 0;
top: 26rpx;
width: 142rpx;
height: 68rpx;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 rgba(175, 175, 219, 0.65);
border-radius: 34rpx 0 0 34rpx;
z-index: 2;
display: flex;
align-items: center;
padding: 12rpx;
box-sizing: border-box;
font-weight: 600;
font-size: 26rpx;
color: #57578A;
.icon-card {
width: 48rpx;
height: 48rpx;
margin-right: 8rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class">
<view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<!-- 有视频 -->
<block wx:if="{{!showCard}}">
<video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" />
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
<image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view>
</view>
</block>
<user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view>
<view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" />
<van-tab title="合作方式" />
<van-tab title="适配产品" /> -->
</van-tabs>
</view>
<view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index">
<image webp wx:if="{{ index < 3}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:if="{{ index == 0}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> -->
<!-- <glsx-image webp src="index/phone.png" class="icon" />
请联系我 -->
<view style="color:#3666fe">{{sharephone}}</view>
</view>
</block>
<!-- 查看活动那个详情 1.3才有 -->
<block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}">
<view class="check-act" bindtap="checkActive">点击查看活动页面</view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block>
<!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}">
<button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情
</button>
</block>
</image>
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" />
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
</view>
</view>
</view>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file \ No newline at end of file
// pages/activityApplication/activityApplication.js // components/scene/scene.js
// import { trackData } from "../../utils/data"; import {
import { entmicroApi } from "../../api/api"; componentsMixin
Page({ } from "../../mixins/index";
Component({
behaviors: [componentsMixin],
/** /**
* 页面的初始数据 * 组件的属性列表
*/
properties: {
foldFlag: {
type: Boolean,
value: false
},
selectApply: {
type: Number,
value: 0
}
},
/**
* 组件的初始数据
*/ */
data: { data: {
productTabList: [ productTabList: [{
{
id: "0", id: "0",
name: "scene1", name: "scene1",
title: "新车洽谈场景", title: "车损升级",
type: "1.0新车权益升级",
url: "car4", url: "car4",
}, },
{ {
id: "1", id: "1",
name: "scene2", name: "scene2",
title: "新车交付场景", title: "精品升级",
type: "1.1 新车精品升级",
url: "car1", url: "car1",
}, },
{ {
id: "2", id: "2",
name: "scene3", name: "scene3",
title: "0-6个月", title: "膨胀金活动",
type: "1.2次新车膨胀金活动",
url: "car2", url: "car2",
}, },
{ {
id: "3", id: "3",
name: "scene4", name: "scene4",
title: "6个月以上", title: "众筹活动",
type: "1.3售后直播众筹活动",
url: "car3", url: "car3",
}, },
], ],
productList: { productSubscribTabList: [{
scene1: [ id: "0",
name: "scene1",
title: "客户沉淀",
url: "car5",
},
{ {
id: "1",
name: "scene2",
title: "客户活跃",
url: "car6",
},
],
productList: {
scene1: [{
name: "equity", name: "equity",
url: "digital_icon", url: "digital_icon",
nameZh: "数字无忧权益卡", nameZh: "数字无忧权益卡",
...@@ -51,8 +74,7 @@ Page({ ...@@ -51,8 +74,7 @@ Page({
isSelect: false, isSelect: false,
}, },
], ],
scene2: [ scene2: [{
{
name: "solarFilm", name: "solarFilm",
url: "solar_icon", url: "solar_icon",
nameZh: "汽车太阳膜", nameZh: "汽车太阳膜",
...@@ -65,8 +87,7 @@ Page({ ...@@ -65,8 +87,7 @@ Page({
isSelect: false, isSelect: false,
}, },
], ],
scene3: [ scene3: [{
{
name: "paintProtect", name: "paintProtect",
url: "protect_icon", url: "protect_icon",
nameZh: "漆面保护膜", nameZh: "漆面保护膜",
...@@ -87,8 +108,7 @@ Page({ ...@@ -87,8 +108,7 @@ Page({
isSelect: false, isSelect: false,
}, },
], ],
scene4: [ scene4: [{
{
name: "carBeauty", name: "carBeauty",
url: "beauty_icon", url: "beauty_icon",
nameZh: "数字化美容", nameZh: "数字化美容",
...@@ -107,7 +127,7 @@ Page({ ...@@ -107,7 +127,7 @@ Page({
{ {
name: "arNavigation", name: "arNavigation",
url: "ar_icon", url: "ar_icon",
nameZh: "AR实景导航", nameZh: "AR导航",
isSelect: false, isSelect: false,
actNum: 3, actNum: 3,
activeNavIdx: 2, activeNavIdx: 2,
...@@ -129,113 +149,57 @@ Page({ ...@@ -129,113 +149,57 @@ Page({
activeNavIdx: 4, activeNavIdx: 4,
}, },
{ {
name: "fragrance",
url: "fragrance",
nameZh: "智能香氛系统",
isSelect: false,
actNum: 3,
activeNavIdx: 5,
},
{
nameZh: "其他", nameZh: "其他",
isSelect: false, isSelect: false,
}, },
], ],
}, },
selectItemIndex: 0, productSubscibList: {
selectItemName: "scene1", scene1: [{
// applyForm: { nameZh: "私域用户活跃代运营",
// merchantName: '', isSelect: false,
// carModel: '', actNum: 0,
// contactName: '', activeNavIdx: 0,
// contactPhone: ''
// },
foldFlag: false,
sceneNum: "",
sceneName: "",
sceneTip: {
scene1: "合作门店数2200+,单店年增量产值100万+",
scene2: "合作门店数300+,单店年增量产值60万+",
scene3: "正在直播中,目前有17万+用户正在观看",
scene4: "本月活动进行中100+门店,预估产值1000万+",
},
}, },
{
// 提交表单 nameZh: "定保/续保数字化招揽",
submitApply() { isSelect: false,
wx.$util.showLoading("提交中..."); actNum: 0,
let validFlag = this.selectComponent("#applyForm").validateForm(); activeNavIdx: 1,
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.$storage.get("scene").cardId;
params.merchant =
wx.$storage.get("scene").merchant ||
wx.$storage.get("scene").merchantId;
params.openId = wx.$storage.get("aicard_info").openId;
params.unionId = wx.$storage.get("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 // nameZh: "其他",
selectProduct(e) { // isSelect: false,
this.setData({ // },
selectItemIndex: e.currentTarget.dataset.item.id, ],
selectItemName: e.currentTarget.dataset.item.name, scene2: [{
}); nameZh: "事故车救援服务",
isSelect: false,
actNum: 1,
activeNavIdx: 0,
}, },
// {
// 跳转产品详情页 // nameZh: "其他",
goPage(e) { // isSelect: false,
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 });
}, },
sceneNum: "",
// 展开收起 sceneName: "",
handleFold() {
this.setData({
foldFlag: !this.data.foldFlag,
});
}, },
/**
* 组件的方法列表
*/
methods: {
// 选择业务场景 // 选择业务场景
selectScene(e) { selectScene(e) {
// 遍历之前业务场景下产品是否已选择,选择了的话取消选中 // 遍历之前业务场景下产品是否已选择,选择了的话取消选中
...@@ -252,7 +216,6 @@ Page({ ...@@ -252,7 +216,6 @@ Page({
[selectList]: newProductList, [selectList]: newProductList,
}); });
} }
this.setData({ this.setData({
sceneNum: e.currentTarget.dataset.item.id, sceneNum: e.currentTarget.dataset.item.id,
sceneName: e.currentTarget.dataset.item.name, sceneName: e.currentTarget.dataset.item.name,
...@@ -261,57 +224,89 @@ Page({ ...@@ -261,57 +224,89 @@ Page({
// 选择业务场景产品 // 选择业务场景产品
selectScenePro(e) { selectScenePro(e) {
console.log(e.currentTarget.dataset, this.properties.selectApply);
var index = e.currentTarget.dataset.index; var index = e.currentTarget.dataset.index;
var item = this.data.productList[this.data.sceneName][index]; var item = this.properties.selectApply == 0 ? this.data.productList[this.data.sceneName][index] : this.data.productSubscibList[this.data.sceneName][index];
item.isSelect = !item.isSelect; item.isSelect = !item.isSelect;
if (this.properties.selectApply == 0) {
// let newProductList = `productListt.${this.data.sceneName}[0]`
// console.log(newProductList, item);
this.setData({ this.setData({
productList: this.data.productList, productList: this.data.productList,
}); });
}, return
}
/** this.setData({
* 生命周期函数--监听页面加载 productSubscibList: this.data.productSubscibList,
*/
onLoad(options) {
// 禁用分享转发
wx.hideShareMenu({
menus: ["shareAppMessage", "shareTimeline"],
}); });
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
}, },
/** // 合作方式切换重置场景以及选择的产品
* 生命周期函数--监听页面隐藏 resetScene() {
*/ if (!this.data.sceneName) return
onHide() {}, console.log(this.properties.selectApply, this.data.sceneName, this.data.sceneNum);
if (this.properties.selectApply == 1) {
/** this.data.productList[this.data.sceneName].map((item) => {
* 生命周期函数--监听页面卸载 if (item.isSelect) item.isSelect = false
*/ })
onUnload() {}, console.log(this.data.productList[this.data.sceneName]);
this.setData({
/** productList: this.data.productList,
* 页面相关事件处理函数--监听用户下拉动作 })
*/ } else {
onPullDownRefresh() {}, this.data.productSubscibList[this.data.sceneName].map((item) => {
if (item.isSelect) item.isSelect = false
/** })
* 页面上拉触底事件的处理函数 console.log(this.data.productSubscibList[this.data.sceneName]);
*/ this.setData({
onReachBottom() {}, productSubscibList: this.data.productSubscibList,
})
}
this.setData({
sceneName: '',
sceneNum: ''
})
},
/** // 提交获取业务场景以及选择的产品
* 用户点击右上角分享 getSceneItems() {
*/ console.log(111);
onShareAppMessage() {}, // 如果选择了业务场景
}); if (!this.data.sceneName) return
let selectFlag = 0;
let productItems = [];
let businessItem
if (this.properties.selectApply == 0) {
this.data.productList[this.data.sceneName].forEach((item) => {
if (item.isSelect) {
selectFlag = selectFlag + 1;
productItems.push(item.nameZh);
}
});
businessItem = this.data.productTabList.find((item) => {
return item.id == this.data.sceneNum;
});
} else {
this.data.productSubscibList[this.data.sceneName].forEach((item) => {
if (item.isSelect) {
selectFlag = selectFlag + 1;
productItems.push(item.nameZh);
}
});
businessItem = this.data.productSubscribTabList.find((item) => {
return item.id == this.data.sceneNum;
});
}
// if (!selectFlag) {
// wx.hideLoading();
// wx.showToast({
// title: "请至少选择一个产品",
// icon: "none",
// });
// return false;
// }
return [businessItem, productItems, selectFlag]
}
}
})
\ No newline at end of file \ No newline at end of file
/* components/scene/scene.wxss */
.fold-title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #323436;
padding-left: 32rpx;
}
.product-tab-box {
display: flex;
margin-bottom: 38rpx;
}
.fold-box {
padding: 44rpx 16rpx;
}
.item-wrap {
position: relative;
/* width: 160rpx; */
width: calc(100%/4);
height: 152rpx;
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;
}
.fold-scene-item {
/* width: 160rpx; */
width: 100%;
height: 152rpx;
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;
}
.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: 4rpx;
}
.product-item-title-active {
color: #5850FF;
}
// .product-item-type {
// font-family: PingFangSC-Regular;
// font-weight: 500;
// font-size: 17rpx;
// color: #323436;
// letter-spacing: 0;
// text-align: center;
// line-height: 24rpx;
// }
// .product-item-type-active {
// color: #807AFF;
// }
.fold-tip {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 22rpx;
color: #6E6E7A;
}
.fold-product {
display: flex;
flex-wrap: wrap;
padding: 36rpx 16rpx 64rpx 16rpx;
}
.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-subscrib {
width: calc((100% - 24rpx)/2);
}
.item:nth-child(3n) {
margin-right: 0;
}
.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 \ No newline at end of file
<!--components/scene/scene.wxml-->
<block wx:if="{{foldFlag}}">
<!-- 业务场景 -->
<view class="fold-title">业务场景</view>
<view class="product-tab-box fold-box">
<view wx:for="{{selectApply == 0 ? productTabList : productSubscribTabList}}" 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>
</view>
</view>
<!-- 选择产品 -->
<block wx:if="{{sceneNum}}">
<view>
<text class="fold-title">选择产品</text>
<text class="fold-tip">(可多选)</text>
</view>
<view class="fold-product">
<!-- 增值转化 -->
<block wx:if="{{selectApply == 0}}">
<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>
</block>
<!-- 系统订阅 -->
<block wx:if="{{selectApply == 1}}">
<block wx:for="{{productSubscibList[sceneName]}}">
<view class="item item-subscrib {{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>
</block>
</view>
</block>
</block>
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--components/shareBtn/shareBtn.wxml-->
<button class="btn-share" open-type="share">
<image class="btn-icon" mode="widthFix" webp src="{{IMGURL}}image/productDetail/equity/share.png?v={{img_version}}" />
<text>分享此页面</text>
</button>
\ No newline at end of file \ No newline at end of file
/* components/shareBtn/shareBtn.wxss */
.btn-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.btn-share {
display: flex;
justify-content: center;
align-items: center;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
margin: 0 48rpx;
}
\ No newline at end of file \ No newline at end of file
module.exports = Behavior({
methods: {
/** 跳转门店助手 */
toStoreMiniProgram () {
wx.$util.getMockConfig().then(({storeParams, storeappId}) => {
console.log(storeParams, storeappId)
wx.navigateToMiniProgram({
appId: storeappId,
path: 'packageStoreAssistant/packageAuth/pages/authentication/loading/loading',
extraData: storeParams,
envVersion: 'trial',
success(res) {
console.log(res, storeParams)
// 打开成功
}
})
})
},
/** 跳转生意助手 */
toBusinessMiniProgram (){
wx.$util.getMockConfig().then(({businessParams, businessappId}) => {
console.log(businessParams, businessappId)
wx.navigateToMiniProgram({
appId: businessappId,
path: 'login/loading/loading',
extraData: businessParams,
envVersion: 'trial',
success(res) {
// 打开成功
}
})
})
}
}
})
\ No newline at end of file \ No newline at end of file
import componentsMixin from './componentsMixin' import componentsMixin from './componentsMixin'
import menuMixin from './menuMixin'
import shareTrackMixin from './shareTrackMixin' import shareTrackMixin from './shareTrackMixin'
import commonMixin from './commonMixin'
module.exports = { module.exports = {
componentsMixin, componentsMixin,
menuMixin, shareTrackMixin,
shareTrackMixin commonMixin
} }
\ No newline at end of file \ No newline at end of file
import { trackData } from "../utils/data";
module.exports = Behavior({
data: {
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0,
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE],
clueAutoplay: true
},
methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
clueAutoplay: false
})
switch(curIntroduceIndex) {
case 3:
wx.$router.go('scene');
// wx.$router.go('addTransform', {notIntercept: true});
// wx.showToast({
// title: '敬请期待',
// icon: 'none'
// })
wx.$Track.sendTrack(trackData.DIJIA)
break
case 2:
this.setData({
curIntroduceIndex: curIntroduceIndex,clueAutoplay: true
})
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
default:
this.setData({
curIntroduceIndex: curIntroduceIndex,
});
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
}
},
},
});
\ No newline at end of file \ No newline at end of file
{
"name": "ai-card",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@vant/weapp": {
"version": "1.10.9",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.10.9.tgz",
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.0.40",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.40.tgz",
"integrity": "sha512-ZqThscIToW/UfNWN1XYRa/+9C0P5J0UJYAuF0kiLjfyQx0ToaBEwfsXOO66EXZKxmDf9mOh+GoDEddLxcJ/6/w=="
}
}
}
{
"name": "ai-card",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.0.40"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://huyue@192.168.3.233:8090/saas/mini-program/ai-card.git"
},
"author": "",
"license": "ISC"
}
// pages/productDetail/ambientLighting/ambientLighting.js // packagesList/pages/activityApply/activityApply.js
import {
entmicroApi
} from "../../../api/api";
import util from "../../../utils/util"
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
isStaff: false
},
// 提交表单
submitApply() {
wx.$util.showLoading("提交中...");
let validFlag = this.selectComponent("#applyForm").validateForm();
console.log(validFlag);
if (!validFlag) return
let params = JSON.parse(JSON.stringify(validFlag))
params.cardId = wx.$storage.get("scene").cardId;
params.merchant =
wx.$storage.get("scene").merchant ||
wx.$storage.get("scene").merchantId;
params.openId = wx.$storage.get("aicard_info").openId;
params.unionId = wx.$storage.get("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",
});
}
});
},
toCesuan() {
wx.$router.go("measure");
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if (util.getUserInfo() && util.getUserInfo().phone) {
console.log(util.getUserInfo().phone)
let params = {
phone: util.getUserInfo().phone
}
entmicroApi.checkPhone(params).then(res => {
console.log(res);
this.setData({
isStaff: res.data
})
})
}
}, },
/** /**
...@@ -36,7 +89,7 @@ Page({ ...@@ -36,7 +89,7 @@ Page({
.login() .login()
.then(({ data }) => { .then(({ data }) => {
if (!wx.$trackData.detailShare) { if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.LIGHT) wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION);
} }
}); });
}, },
...@@ -73,11 +126,6 @@ Page({ ...@@ -73,11 +126,6 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
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 \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply" "CooperationApply" : "../../../components/CooperationApply/CooperationApply"
}, },
"navigationBarTitleText": "活动申请" "navigationBarTitleText": "活动申请"
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/activityApply/activityApply.wxss */
.apply-main {
position: relative;
}
.top-img {
width: 750rpx;
height: 320rpx;
}
.apply-box {
width: 750rpx;
// height: 664rpx;
background-image: linear-gradient(179deg, #D5DEFC 0%, #FEFEFE 100%);
display: flex;
flex-direction: column;
}
.cooperation {
align-self: center;
}
/* 选中后的背景样式*/
/*按钮的大小*/
label {
font-size: 28rpx;
}
radio .wx-radio-input {
width: 22rpx;
height: 22rpx;
border-radius: 50%;
}
radio .wx-radio-input.wx-radio-input-checked {
/* 背景颜色 */
background-color: #fff !important;
/* 边框颜色 */
border-color: #5850FF !important;
}
/* 选中后的实心样式*/
radio .wx-radio-input.wx-radio-input-checked::before {
/* 将对号去掉 */
content: '';
/*实心圆圈的大小*/
width: 18rpx;
height: 18rpx;
line-height: 18rpx;
text-align: center;
/*将圆角设置成50%才是一个圆*/
border-radius: 50%;
/*圆圈颜色*/
background-color: #5850FF;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
.submit-btn {
position: fixed;
bottom: 32rpx;
left: 48rpx;
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.caculate-box {
position: absolute;
top: 230rpx;
left: 32rpx;
display: flex;
align-items: center;
justify-content: center;
width: 228rpx;
height: 64rpx;
background: #5850FF;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.40);
border-radius: 32rpx;
.caculate-img {
width: 36rpx;
height: 36rpx;
margin-right: 16rpx;
}
.caculate-text {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/activityApply/activityApply.wxml-->
<view class="apply-main">
<image class="top-img" mode="widthFix" webp src="{{IMGURL}}application/application_top.png?v={{img_version}}"></image>
<view class="apply-box">
<view class="cooperation">
<CooperationApply id="applyForm"></CooperationApply>
</view>
</view>
<button class="submit-btn" bindtap="submitApply">提交申请</button>
<!-- 展业测算 -->
<view class="caculate-box" wx:if="{{isStaff}}" bindtap="toCesuan">
<image class="caculate-img" mode="widthFix" webp src="{{IMGURL}}application/caculate_icon.png?v={{img_version}}"></image>
<text class="caculate-text">展业测算</text>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/addTransform/index/index.js // packagesList/pages/activityDetail/activityDetail.js
import pageData from '../constant/data'
import { entmicroApi } from "../../../api/api";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
editForm: { activityInfo: {},
sales: 100, hasPhoneNumber: false,
userNum: 10000 autoplay: true
}, },
actualForm: {
sales: 100, toActivity(){
userNum: 10000 // wx.$util.getMockConfig().then(({businessParams, businessappId}) => {
}, // console.log(businessParams, businessappId)
IMGURL: wx.$imgUrl, const { activityInfo } = this.data
height: 'calc(100vh - 100rpx)', wx.navigateToMiniProgram({
tagIndex: 0, appId: 'wxe10067a63c1856ac',
tabList: pageData.tabList, path: 'pages/crowdfunding/index/index?id=' + activityInfo.crowdFundActivityId + '&merchantId=' + activityInfo.merchantNo,
introduceObj: {}, envVersion: 'trial',
cardList: [], success(res) {
// 玩法介绍 console.log(res, storeParams)
introduceVisible: false, // 打开成功
introduceList: pageData.introduceList, }
// 产品详情 })
detailKeyList: Object.keys(pageData.addDatailObj)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options)
if (options && options.id) {
wx.$trackData = options
wx.$storage.set('scene', options)
this.getActivityDetail(options.id)
this.setData({
hasPhoneNumber: true // 不需要授权
})
} else {
wx.$router.getData(res => {
console.log(res)
this.getActivityDetail(res.id)
this.setData({
hasPhoneNumber: res.hasPhoneNumber
})
})
}
},
getActivityDetail(id) {
entmicroApi.getActivityDetail({id}).then(res => {
console.log(wx.$util.iosTimeFormat(res.beginTime), new Date(wx.$util.iosTimeFormat(res.beginTime)).format('yyyy年MM月dd日'))
res.beginTime = new Date(wx.$util.iosTimeFormat(res.beginTime)).format('yyyy年MM月dd日')
res.endTime = new Date(wx.$util.iosTimeFormat(res.endTime)).format('yyyy年MM月dd日')
wx.$Track.sendTrack({
pageKey: res.crowdFundActivityId,
pageName: res.activityName
})
this.setData({ this.setData({
introduceObj: this.data.tabList[this.data.tagIndex].introduce, activityInfo: res
cardList: this.data.tabList[this.data.tagIndex].cardList })
}) })
}, },
handleplay() {
this.setData({
autoplay: false
})
},
handlepause() {
this.setData({
autoplay: true
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -83,55 +122,13 @@ Page({ ...@@ -83,55 +122,13 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const shareType = 'ACTIVITY'
}, const {id} = this.data.activityInfo
const cardId = wx.$storage.get('scene').cardId
handleInput(e) { const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const attr = e.target.dataset.attr return {
this.setData({ title: `您好,我向你分享了一个活动~`,
[`${attr}`]: e.detail.value path: `packagesList/pages/activityDetail/activityDetail?id=${id}&shareType=${shareType}&cardId=${cardId}&merchant=${merchant}`
})
},
handleTabClick(e) {
let {
index,
introduce,
cardList
} = e.detail
let {
tagIndex
} = this.data
if (index == tagIndex) return
this.setData({
tagIndex: index,
introduceObj: introduce || {},
cardList: cardList || []
})
},
handleCardClick(e) {
var obj = e.detail
if(!this.data.detailKeyList.includes(obj.detailAttrName)) {
wx.$util.showToast('敬请期待')
return true
} }
wx.$router.go('addTransformDetail', { proName: obj.proName, attrName: obj.detailAttrName })
},
handleIntroduceClick() {
this.handleIntroduceClose()
},
handleIntroduceClose() {
this.setData({
introduceVisible: !this.data.introduceVisible
})
},
handleConfirm() {
this.setData({
actualForm: this.data.editForm
})
} }
}) })
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/activityDetail/activityDetail.wxss */
.activity-detail {
background-color: #F5F5F7;
.swiper {
height: 422rpx;
}
.swiper-img {
width: 100%;
height: 422rpx;
}
}
.activity-name {
font-size: 32rpx;
font-weight: 600;
background-color: #fff;
padding: 16rpx 32rpx 32rpx;
}
.activity-introduction {
margin-top: 20rpx;
background-color: #fff;
padding: 24rpx 32rpx;
.activity-title {
font-weight: 500;
font-size: 36rpx;
color: #2D2D33;
}
.activity-content {
margin: 16rpx 0 48rpx;
font-weight: 400;
font-size: 28rpx;
color: #444444;
line-height: 52rpx;
}
.activity-info {
margin-top: 16rpx;
.activity-item {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.activity-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.text {
font-weight: 400;
font-size: 28rpx;
color: #444444;
}
}
}
.activity-btn {
margin-top: 48rpx;
margin-bottom: 136rpx;
font-weight: 500;
font-size: 32rpx;
color: #5850FF;
text-align: center;
line-height: 48rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/activityDetail/activityDetail.wxml-->
<view class="activity-detail">
<swiper class="swiper" autoplay="{{autoplay}}" circular="true" current="{{current}}" interval="5000">
<swiper-item class="swiper-item" wx:if="{{activityInfo.videoUrl}}">
<video class="swiper-img" src="{{activityInfo.videoUrl}}" bindplay="handleplay" bindpause="handlepause"></video>
</swiper-item>
<swiper-item class="swiper-item" wx:for="{{activityInfo.imageUrlArr}}" wx:key="index">
<image class="swiper-img" webp src="{{item}}"></image>
</swiper-item>
</swiper>
<view class="activity-name">{{activityInfo.activityName}}</view>
<view class="activity-introduction">
<view class="activity-title">活动介绍</view>
<view class="activity-content">
{{activityInfo.activityEvent}}
</view>
<view class="activity-title">活动举办方</view>
<view class="activity-info">
<view class="activity-item" wx:if="{{activityInfo.sponsorName}}">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-company.png"></glsx-image>
<view class="text">{{activityInfo.sponsorName}}</view>
</view>
<view class="activity-item"wx:if="{{activityInfo.address}}">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-address.png"></glsx-image>
<view class="text">{{activityInfo.address}}</view>
</view>
<view class="activity-item">
<glsx-image custom-class="activity-icon" webp src="image/activity/icon-time.png"></glsx-image>
<view class="text">{{activityInfo.beginTime + ' - ' + activityInfo.endTime}}</view>
</view>
</view>
<view class="activity-btn" bindtap="toActivity">查看活动详情页面</view>
</view>
</view>
<phone-number type="{{'scenario'}}" bindtoApplication="toApplication" bindupdatePhoneNumber="updatePhoneNumber" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
// pages/applySuccess/applySuccess.js // packagesList/pages/applySuccess/applySuccess.js
import {commonMixin} from '../../../mixins/index'
Page({ Page({
behaviors: [commonMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -7,64 +9,63 @@ Page({ ...@@ -7,64 +9,63 @@ Page({
data: { data: {
}, },
toBack() { toIndex() {
wx.navigateBack({ wx.$router.go("/pages/tab/index/index");
delta: 2,
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad(options) {
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage() {
} }
}) })
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/applySuccess/applySuccess.wxss */
.apply-box {
display: flex;
flex-direction: column;
}
.apply-icon {
width: 448rpx;
height: 192rpx;
margin: auto;
margin-top: 152rpx;
}
.apply-top {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 56rpx;
color: #2D2D33;
text-align: center;
margin-top: 40rpx;
}
.apply-tip {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #333333;
text-align: center;
line-height: 48rpx;
}
.back-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32rpx;
color: #5850FF;
text-align: center;
line-height: 48rpx;
margin-top: 32rpx;
}
.apply-info {
color: rgba(102, 102, 102, 1);
font-size: 24rpx;
font-face: PingFangSC;
font-weight: 400;
line-height: 40rpx;
letter-spacing: 0;
paragraph-spacing: 0;
text-align: center;
.info-tip {
color: rgba(51, 51, 51, 1);
font-weight: 500;
}
}
.apply-margin {
margin-top: 32rpx;
}
.jump-box {
margin: auto;
display: flex;
margin-top: 136rpx;
&-item {
width: 320rpx;
height: 152rpx;
display: flex;
justify-content: center;
align-items: center;
}
&-item:first-child {
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/application/bussi_bg.png?v=1.0.3");
background-repeat: no-repeat;
background-size: 320rpx 152rpx;
margin-right: 16rpx;
}
&-item:last-child {
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/application/store_bg.png?v=1.0.3");
background-repeat: no-repeat;
background-size: 320rpx 152rpx;
}
.bussi-icon {
width: 88rpx;
height: 88rpx;
margin-right: 20rpx;
}
.jump-title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.jump-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
background-image: linear-gradient(180deg, #65DDCE 0%, #406DFB 51%, #3666FE 100%);
-webkit-background-clip: text;
color: transparent;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/applySuccess/applySuccess.wxml-->
<view class="apply-box">
<image webp mode="widthFix" class="apply-icon" src="{{IMGURL}}application/apply-succes.png?v={{img_version}}"></image>
<view class="apply-top">申请成功</view>
<view class="apply-margin">
<view class="apply-tip">您的申请已提交,</view>
<view class="apply-tip">请耐心等待顾问专员与您联系。</view>
</view>
<view class="back-text" bindtap="toIndex">返回名片</view>
<view class="jump-box">
<view class="jump-box-item" bindtap="toBusinessMiniProgram">
<view>
<image webp mode="widthFix" class="bussi-icon" src="{{IMGURL}}application/bussi_icon.png?v={{img_version}}"></image>
</view>
<view>
<view class="jump-title">生意助手</view>
<view class="jump-text">立即前往 ></view>
</view>
<view>
</view>
</view>
<view class="jump-box-item" bindtap="toStoreMiniProgram">
<view>
<image webp mode="widthFix" class="bussi-icon" src="{{IMGURL}}application/bussi_icon.png?v={{img_version}}"></image>
</view>
<view>
<view class="jump-title">门店助手</view>
<view class="jump-text">立即前往 ></view>
</view>
</view>
</view>
<view class="apply-margin">
<view class="apply-info">自申请成功后,Demo有效期为<text class="info-tip">7</text>天</view>
<view class="apply-info">关闭此页面后,智能名片将显示两个Demo入口</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/introduction/introduction.js // packagesList/pages/index/index.js
import {menuMixin} from '../../../mixins/index'
Page({ Page({
behaviors: [menuMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
// 0-员工,1-代理商
customerType: 1
}, },
/** /**
......
/* packagesList/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/index/index.wxml-->
<text>packagesList/pages/index/index.wxml</text>
var measureList = Object.freeze([ var measureList = Object.freeze([
{ {
name: '1.0 新车权益升级', name: '新车洽谈场景',
tips: '新车洽谈场景', tips: '车损升级',
iconName: 'icon1', iconName: 'icon1',
product: [ product: [
{ {
name: '车损升级', name: '车损升级',
parentName: '1.0 新车权益升级', parentName: '新车洽谈场景',
tips: '新车洽谈场景', tips: '车损升级',
value: '0-0', value: '0-0',
typeIndex: '1.0', typeIndex: '1.0',
isCheck: false, isCheck: false,
...@@ -20,14 +20,14 @@ var measureList = Object.freeze([ ...@@ -20,14 +20,14 @@ var measureList = Object.freeze([
] ]
}, },
{ {
name: '1.1 新车精品升级', name: '新车交付场景',
tips: '新车交付场景', tips: '精品升级',
iconName: 'icon2', iconName: 'icon2',
product: [ product: [
{ {
name: '太阳膜升级', name: '太阳膜升级',
parentName: '1.1 新车精品升级', parentName: '新车交付场景',
tips: '新车交付场景', tips: '精品升级',
value: '1-0', value: '1-0',
typeIndex: '1.1', typeIndex: '1.1',
isCheck: false, isCheck: false,
...@@ -40,14 +40,14 @@ var measureList = Object.freeze([ ...@@ -40,14 +40,14 @@ var measureList = Object.freeze([
] ]
}, },
{ {
name: '1.2 次新车膨胀金活动', name: '0-6月',
iconName: 'icon3', iconName: 'icon3',
tips: '0-6个月', tips: '膨胀金活动',
product: [ product: [
{ {
name: '膨胀金活动-车衣', name: '膨胀金活动-车衣',
parentName: '1.2 次新车膨胀金活动', parentName: '0-6月',
tips: '0-6个月', tips: '膨胀金活动',
value: '2-0', value: '2-0',
typeIndex: '1.2', typeIndex: '1.2',
isCheck: false, isCheck: false,
...@@ -59,8 +59,8 @@ var measureList = Object.freeze([ ...@@ -59,8 +59,8 @@ var measureList = Object.freeze([
}, },
{ {
name: '膨胀金活动-改色膜', name: '膨胀金活动-改色膜',
parentName: '1.2 次新车膨胀金活动', parentName: '0-6月',
tips: '0-6个月', tips: '膨胀金活动',
value: '2-1', value: '2-1',
typeIndex: '1.2', typeIndex: '1.2',
isCheck: false, isCheck: false,
...@@ -73,14 +73,14 @@ var measureList = Object.freeze([ ...@@ -73,14 +73,14 @@ var measureList = Object.freeze([
] ]
}, },
{ {
name: '1.3 售后直播众筹活动', name: '6个月以上',
iconName: 'icon4', iconName: 'icon4',
tips: '6个月以上', tips: '众筹活动',
product: [ product: [
{ {
name: '360全景导航', name: '360全景导航',
parentName: '1.3 售后直播众筹活动', parentName: '6个月以上',
tips: '6个月以上', tips: '众筹活动',
typeIndex: '1.3', typeIndex: '1.3',
value: '3-0', value: '3-0',
isCheck: false, isCheck: false,
...@@ -92,8 +92,8 @@ var measureList = Object.freeze([ ...@@ -92,8 +92,8 @@ var measureList = Object.freeze([
}, },
{ {
name: 'AR导航', name: 'AR导航',
parentName: '1.3 售后直播众筹活动', parentName: '6个月以上',
tips: '6个月以上', tips: '众筹活动',
value: '3-1', value: '3-1',
typeIndex: '1.3', typeIndex: '1.3',
isCheck: false, isCheck: false,
...@@ -105,8 +105,8 @@ var measureList = Object.freeze([ ...@@ -105,8 +105,8 @@ var measureList = Object.freeze([
}, },
{ {
name: '氛围灯', name: '氛围灯',
parentName: '1.3 售后直播众筹活动', parentName: '6个月以上',
tips: '6个月以上', tips: '众筹活动',
value: '3-2', value: '3-2',
typeIndex: '1.3', typeIndex: '1.3',
isCheck: false, isCheck: false,
...@@ -118,8 +118,8 @@ var measureList = Object.freeze([ ...@@ -118,8 +118,8 @@ var measureList = Object.freeze([
}, },
{ {
name: '座椅通风', name: '座椅通风',
parentName: '1.3 售后直播众筹活动', parentName: '6个月以上',
tips: '6个月以上', tips: '众筹活动',
value: '3-3', value: '3-3',
typeIndex: '1.3', typeIndex: '1.3',
isCheck: false, isCheck: false,
...@@ -131,8 +131,8 @@ var measureList = Object.freeze([ ...@@ -131,8 +131,8 @@ var measureList = Object.freeze([
}, },
{ {
name: '智能香薰', name: '智能香薰',
parentName: '1.3 售后直播众筹活动', parentName: '6个月以上',
tips: '6个月以上', tips: '众筹活动',
value: '3-4', value: '3-4',
typeIndex: '1.3', typeIndex: '1.3',
isCheck: false, isCheck: false,
......
// pages/measure/measure.js // pages/measure/measure.js
import Util from '../../../utils/util'
import measureData from '../constant/data' import measureData from '../constant/data'
const checkMap = new Map() const checkMap = new Map()
Page({ Page({
...@@ -48,7 +47,7 @@ Page({ ...@@ -48,7 +47,7 @@ Page({
console.log(checkArray) console.log(checkArray)
const params = Object.assign({checkArray}, this.data.formData) const params = Object.assign({checkArray}, this.data.formData)
console.log(params) console.log(params)
wx.$router.go("measureResult", params); wx.$router.go("/packagesList/pages/measure/measureResult/measureResult", params);
} }
}, },
// 选择产品 // 选择产品
......
// pages/measureResult/measureResult.js // pages/measureResult/measureResult.js
import Util from '../../../utils/util' import Util from '../../../../utils/util'
import measureData from '../constant/data' import measureData from '../constant/data'
Page({ Page({
......
...@@ -199,21 +199,14 @@ function formatValue(value, hasUnit = true, onlyUnit = false) { ...@@ -199,21 +199,14 @@ function formatValue(value, hasUnit = true, onlyUnit = false) {
if (typeof value == 'number') { if (typeof value == 'number') {
val = value.toString() val = value.toString()
} }
if (val.length > 8 ) { if (val && val.length > 8 ) {
val = (val / 100000000).toFixed(0) val = (val / 100000000).toFixed(0)
unit = '亿' unit = '亿'
} else if (val.length > 5) { } else if (val && val.length > 5) {
val = (val / 10000).toFixed(0) val = (val / 10000).toFixed(0)
unit = '万' unit = '万'
} }
return onlyUnit ? unit : hasUnit ? val + unit : val return onlyUnit ? unit : hasUnit ? val + unit : val
// if (val.length > 8 ) {
// return (val / 100000000).toFixed(0) + '亿'
// } else if (val.length > 5) {
// return (val / 10000).toFixed(0) + '万'
// } else {
// return val
// }
} }
function decimalFormat(value) { function decimalFormat(value) {
return (value * 100).toFixed(2) return (value * 100).toFixed(2)
......
// packagesList/pages/productDetail/productDetail.js
import {
behavior as computedBehavior
} from '~/utils/lib/miniprogram-computed'
import {
IMG_URL
} from "~/utils/constantData.js";
import {
senceData,
productData
} from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index'
import utils from '~/utils/util'
import {entmicroApi} from "~/api/api"
import {trackData} from '../../../utils/data'
Page({
/**
* 页面的初始数据
*/
noPageAuth: true,
behaviors: [computedBehavior],
data: {
IMG_URL,
senceData,
productData,
proInfo: {},
isShare: false, //是否是分享出去的
actNum: 0,
tabAct: 0,
showLeft: false, //更多按钮显示的内容
scrollTop: 0,
img_version: '0.1.0',
// 是否授权昵称
hasUserInfo: false,
prodItemVideo: '', //选中的场景下的video的第一个
activeUrl: '', // 1.3场景才有的活动配置
sharephone: '', //主要微信用户,服务商
cardInfo: {},
hasPhoneNumber: false, // 是否有授权手机号码
pageName: '',
proName: '',
trackList: [
[trackData.EQUITYCARD],
[trackData.SOLARFILM],
[trackData.PAINTPROTECT, trackData.CHANGEFILM],
[trackData.CARBEAUTY, trackData.SEATVENTILATE, trackData.ARNAVIGATION, trackData.LIGHT, trackData.NAVIGATIONARROUND, trackData.LOSSPGASE],
[trackData.EXPANGOLD]
],
systemTrackList: [trackData.SYSUSER, trackData.SYSNUMBER, trackData.SYSCAR],
isLoadding: true
},
// 计算属性
computed: {
showLeftFlag(data) {
// 1.分享出去
// 2.点击可以改变状态
return data.isShare && !data.showLeft
},
prodItemVideo(data) {
let {
senceData,
actNum,
activeNavIdx
} = data
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
// }
// return senceData[actNum]?.videoList[activeNavIdx]
},
// 授权昵称弹框显示
authNcknameShow(data) {
return data.isShare && !data.hasUserInfo
}
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
console.log( options);
if (!options || utils.isEmptyObj(options)) return
let {
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName
} = options
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone: phone, //联系电话 (登陆的用户)
hasPhoneNumber:hasPhoneNumber,
pageName: name,
proName
})
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
} else if (name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx])
}
setTimeout(() => {
utils.setNavigationBarTitle(proName)
this.setData({
isLoadding: false
})
},100)
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log(e)
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
let proDetail = this.selectComponent("#pro-detail")
proDetail.pageSroll(e)
}, 100);
};
})(),
//获取配置url
async getActiveApiFn(){
let {code,data} = await entmicroApi.getActiveApi()
if(code == 0){
this.setData({
activeUrl: data
})
}
},
// 是否已经查看详情
isgetAuthphone(){
let authphone = wx.$storage.get("authphone");
// if(authphone){
// // 显示后面的内容
// setTimeout(() => {
// this.getImgHeight()
// },300)
// this.setData({
// showLeft: true
// })
// //触发浏览埋点
// // this.onLoad(null)
// }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
this.getActiveApiFn()
if (options && options.cardId) {
wx.$trackData = options
// wx.$trackData.cardId = options.cardId
wx.$storage.set('scene', options)
const {name, actNum, activeNavIdx, proName} = options
this.setData({
actNum: options.actNum,
activeNavIdx: options.activeNavIdx,
pageName: name,
proName
})
getApp()
.login()
.then(({ data }) => {
console.log(data, '------')
this.setData({
isLoadding: false
})
if (data && data.phone) {
this.setData({
hasPhoneNumber: true
})
}
})
this.getCardDetail()
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
} else if (name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx])
}
setTimeout(() => {
utils.setNavigationBarTitle(proName)
},100)
} else {
this.getCardDetail()
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_PRO'
console.log('cardId', cardId, 'merchant', merchant)
const {actNum, activeNavIdx, pageName, proName} = this.data
return {
title: `给你分享一个活动,戳我参与~`,
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&proName=${proName}`
}
},
// 更新手机号码
updatePhoneNumber(e) {
console.log(e.detail)
this.setData({
hasPhoneNumber: e.detail ? true : false
})
},
// 获取员工名片信息
getCardDetail() {
const scene = wx.$storage.get('scene')
let params = {
cardId: scene.cardId
}
console.log(params)
entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
const cardInfo = data || this.data.defaultInfo
console.log(data, cardInfo)
this.setData(
{
cardInfo
}
)
})
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn" "pro-detail": "../../../components/proDetail/proDetail",
}, "pro-phone-number": "../../../components/PhoneNumber/PhoneNumber"
"navigationBarTitleText": "氛围灯" }
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/productDetail/productDetail.wxss */
.card-info {
position: fixed;
top: 0;
z-index: 0;
width: 100%;
}
.max_page_height {
height: 100vh;
overflow: hidden;
}
<!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
\ No newline at end of file \ No newline at end of file
// packagesList/pages/productDetail/productDetail.js
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import { IMG_URL } from "~/utils/constantData.js";
import { senceData, productData } from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index'
import utils from '~/utils/util'
import {trackData} from '../../../utils/data'
import { entmicroApi } from '../../../api/api'
import Draw from '../../../utils/Draw'
// import {getActiveApi} from "~/api/viewprod"
Page({
/**
* 页面的初始数据
*/
noPageAuth: true,
behaviors: [computedBehavior],
data: {
IMG_URL,
senceData,
productData,
proInfo: {},
isShare:false, //是否是分享出去的
actNum: 0,
tabAct: 0,
showLeft:false, //更多按钮显示的内容
scrollTop:0,
img_version: '0.1.0',
// 是否授权昵称
hasUserInfo: false,
prodItemVideo:'', //选中的场景下的video的第一个
activeUrl:'', // 1.3场景才有的活动配置
sharephone:'', //主要微信用户,服务商
trackList: [trackData.CARDETAIL, trackData.FINEDETAIL, trackData.CUSTOMEDETAIL, trackData.CROWDDETAIL, trackData.EXPANDETAIL],
cardInfo: {},
hasPhoneNumber: false,
scenarList: ['车损升级', '精品升级', '客户线上化', '众筹活动', '膨胀金活动']
},
// 计算属性
computed: {
showLeftFlag(data) {
// 1.分享出去
// 2.点击可以改变状态
return data.isShare && !data.showLeft
},
prodItemVideo(data) {
let {senceData, actNum, activeNavIdx} = data
// if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0]
// }
// return senceData[actNum]?.videoList[activeNavIdx]
},
// 授权昵称弹框显示
authNcknameShow(data){
return data.isShare && !data.hasUserInfo
}
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
console.log(options)
if (!options || utils.isEmptyObj(options)) return
let { actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber } = options
// wx.$Track.sendTrack()
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone: phone, //联系电话 (登陆的用户)
hasPhoneNumber:hasPhoneNumber
})
wx.$Track.sendTrack(this.data.trackList[this.data.actNum])
// console.log(this.data.senceData, 'senceData-----')
const senceList = productData[this.data.actNum].filter(item => item.name != '全部')
var proInfo = {}
for(let i = 0; i< senceList.length; i++) {
let proIdList = senceList[i]?.productList.map(k => k.id)
if(proIdList.includes(activeNavIdx)) {
proInfo = senceList[i].productList.find(k => k.id == activeNavIdx)
break
}
}
this.setData({
proInfo
})
// console.log(this.data.proInfo, '---------proInfo')
// 设置转发标题
let userInfoObj = wx.$storage.get("userInfo")
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name = userInfoObj.merchantName
this.shareTitle = `${name}给你分享一个活动${proInfo.productName},戳我参与~`
//分享数据
let item = proInfo
// console.log('title2',item.productName)
setTimeout(() => {
utils.setNavigationBarTitle(this.data.scenarList[actNum])
},100)
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log(e)
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
let proDetail = this.selectComponent("#pro-detail")
proDetail.pageSroll(e)
}, 100);
};
})(),
//获取配置url
async getActiveApiFn(){
let {code,data} = await entmicroApi.getActiveApi()
if(code == 0){
this.setData({
activeUrl: data
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
this.getActiveApiFn()
if (options && options.cardId) {
wx.$trackData = options
wx.$storage.set('scene', options)
this.setData({
actNum: options.actNum
})
wx.$Track.sendTrack(this.data.trackList[options.actNum])
setTimeout(() => {
utils.setNavigationBarTitle(this.data.scenarList[options.actNum])
},100)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_SCEN'
const {actNum} = this.data
console.log('cardId', cardId, 'merchant', merchant)
return {
title: `给你分享一个合作场景介绍,戳我了解~`,
path: `packagesList/pages/scenarioDetail/scenarioDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}`
}
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn" "pro-detail": "../../../components/proDetail/proDetail",
}, "phone-number": "../../../components/PhoneNumber/PhoneNumber"
"navigationBarTitleText": "AR导航" }
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/scenarioDetail/scenarioDetail.wxss */
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml-->
<pro-detail id="pro-detail" detailType="{{'scen'}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}" cardInfo="{{cardInfo}}"></pro-detail>
<phone-number custom-class="pro_phone_number" type="scenario" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
// packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data'
import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
videoItem: {
index: 0,
videoList: [],
videoUrl: '',
hasPhoneNumber: false
},
trackList: [
[trackData.EQUITYVIDEO0, trackData.EQUITYVIDEO1, trackData.EQUITYVIDEO2, trackData.EQUITYVIDEO3],
[trackData.SOLARFILMVIDEO],
[],
[trackData.CROWDVIDEO0, trackData.CROWDVIDEO1, trackData.CROWDVIDEO2, trackData.CROWDVIDEO3, trackData.CROWDVIDEO4, trackData.CROWDVIDEO5],
[trackData.EXPANGOLDVIDEO1]
],
systemTrackList: [
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2],
[trackData.SYSNUMBERVIDEO1],
[trackData.SYSUSERVIDEO1, trackData.SYSUSERVIDEO2, trackData.SYSNUMBERVIDEO1]
],
isLoadding: true,
showAuth: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
if (options && options.cardId) {
wx.$trackData = options
wx.$storage.set('scene', options)
console.log(productData[+options.scenIndex])
const spcList = [99]
const {videoIndex, scenIndex, name, leftMenuIndex, videoName } = options
console.logscenIndex
const res = {
index: videoIndex,
scenIndex: scenIndex,
name: name,
videoName,
leftMenuIndex: leftMenuIndex,
videoList: spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList : productData[scenIndex][0].videoList,
videoUrl: spcList.includes(+scenIndex) ? subscriptionSystemData[leftMenuIndex].videoList[+videoIndex].videoUrl : productData[scenIndex][0].videoList[+videoIndex].videoUrl
}
console.log(res)
this.setData({
videoItem: res
})
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[scenIndex][videoIndex])
} else if (name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[leftMenuIndex][videoIndex])
}
setTimeout(() => {
utils.setNavigationBarTitle(videoName)
},100)
getApp()
.login()
.then(({ data }) => {
console.log(data)
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
isLoadding: false
})
}
})
// wx.$Track.sendTrack(this.data.trackList[scenIndex][res.index])
} else {
wx.$router.getData(res => {
console.log(res)
this.setData({
videoItem: res,
isLoadding: false
})
if (res.name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[res.scenIndex][res.index])
} else if (res.name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[res.leftMenuIndex][res.index])
}
setTimeout(() => {
utils.setNavigationBarTitle(this.data.videoItem.videoName)
},100)
})
}
},
// 下载视频
downVideo() {
const _this = this
let {videoItem: {videoUrl}} = this.data
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
_this.setData({
showAuth: true
})
}else{
wx.$util.showToast('正在下载视频...')
wx.downloadFile({
url: videoUrl,
success(res) {
if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success(res) {
setTimeout(() => {
wx.$util.showToast('下载成功!')
}, 2000)
},
fail({ errMsg }) {
_this.setData({
showAuth: errMsg == "saveVideoToPhotosAlbum:fail auth deny",
})
}
})
}
}
})
}
}
})
},
chooseVideo(e) {
console.log(e)
const {index, info: {name}} = e.detail
const {videoItem} = this.data
console.log(videoItem)
if (videoItem.name == '系统订阅') {
this.setData({
'videoItem.index': index
})
console.log(this.data.videoItem)
wx.$Track.sendTrack(this.data.systemTrackList[videoItem.leftMenuIndex][index])
} else if (videoItem.name == '增值转化') {
this.setData({
'videoItem.index': index
})
console.log(this.data.videoItem)
wx.$Track.sendTrack(this.data.trackList[videoItem.scenIndex][index])
}
setTimeout(() => {
utils.setNavigationBarTitle(name)
},100)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_VIDEO'
console.log('cardId', cardId, 'merchant', merchant)
const {index, scenIndex, videoUrl, name, leftMenuIndex, videoName} = this.data.videoItem
console.log(this.data.videoItem)
return {
title: `您好,我向你分享了一个视频`,
path: `packagesList/pages/videoDetal/videoDetal?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&scenIndex=${scenIndex}&videoIndex=${index}&name=${name}&leftMenuIndex=${leftMenuIndex}&videoName=${videoName}`
}
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn" "gl-video-detail": "glsx-applet-component/video-detail/index",
}, "authorize": "/components/Authorize/Authorize"
"navigationBarTitleText": "数字化美容" }
} }
\ No newline at end of file \ No newline at end of file
/* packagesList/pages/videoDetal/videoDetal.wxss */
\ No newline at end of file \ No newline at end of file
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<gl-video-detail list="{{videoItem.videoList}}" index="{{videoItem.index}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block>
</view>
\ No newline at end of file \ No newline at end of file
<!-- 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 \ 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: 500;
font-size: 17rpx;
color: #323436;
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 \ No newline at end of file
{
"navigationBarTitleText": "D+增值转化",
"usingComponents": {
"add-tab-view": "../components/AddTabView/AddTabView",
"card": "../components/Card/Card"
},
"backgroundColor": "#F6F5F8"
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/index/index.wxml-->
<view class="layout">
<view class="head">测算您门店的基本情况</view>
<view class="form-box">
<view class="form-row flex">
<text class="form-label">门店月平均新车销量</text>
<input class="form-input" placeholder="请输入" type="number" value="{{editForm.sales}}" bindinput="handleInput" data-attr="editForm.sales" />
<!-- <text class="suffix">台</text> -->
</view>
<view class="form-row flex">
<text class="form-label">3年售后存量用户数</text>
<input class="form-input" placeholder="请输入" type="number" value="{{editForm.userNum}}" bindinput="handleInput" data-attr="editForm.userNum" />
<!-- <text class="suffix">家</text> -->
</view>
<button class="submit-btn" bindtap="handleConfirm">提交测算</button>
</view>
</view>
<view class="layout">
<view class="head">我们的产品和服务</view>
<add-tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{height}}" bindclick="handleTabClick">
<view class="tab-content-box" wx:if="{{cardList.length}}">
<view class="pos-relative" bindtap="handleIntroduceClick">
<view class="card-introduce">
<image class="introduce-img" webp src="{{IMGURL}}{{introduceObj.imgUrl}}?v={{img_version}}" />
<view class="introduce-content">
<view class="introduce-txt">{{introduceObj.title}}</view>
<view class="introduce-btn">查看阶段玩法</view>
</view>
</view>
</view>
<view class="card-title-box">
<view>阶段产品</view>
<view class="tips">预估收益根据您的新车销量 {{ actualForm.sales || 0 }}台 测算所得</view>
</view>
<view wx:for="{{cardList}}" wx:key="index">
<card cardForm="{{item}}" actualForm="{{actualForm}}" tagIndex="{{tagIndex}}" bindclick="handleCardClick"></card>
</view>
</view>
</add-tab-view>
</view>
<!-- 玩法介绍 -->
<view class="pos-relative">
<view class="{{introduceVisible ? 'model' : 'model-hidden'}}" catchtouchmove="noScroll" bindtap="handleIntroduceClose">
<view>
<view class="model-box">
<image class="model-img" webp src="{{IMGURL}}addTransform/card/deliver/model-introduce.png?v={{img_version}}" />
<view class="model-block">
<view class="model-head">
<view class="head-title">{{introduceList[tagIndex].title}}</view>
<view>{{introduceList[tagIndex].subTitle}}</view>
</view>
<view class="model-content">
<view class="content-block" wx:for="{{introduceList[tagIndex].contentList}}" wx:key="index">
<image class="content-icon" src="{{IMGURL}}addTransform/card/deliver/model-{{item.icon}}.png?v={{img_version}}" />
<view>
<view class="content-title">{{item.title}}</view>
<view class="content-row" wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex">
<view class="content-txt" wx:if="{{subItem.name}}">{{subItem.name}}</view>
<view class="content-tip">{{subItem.tip}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="model-btn">知道了</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/index/index.wxss */
page {
background-color: #F6F5F8;
}
.layout {
background: #FFFFFF;
padding-bottom: 32rpx;
margin-bottom: 16rpx;
}
.flex {
display: flex;
}
.head {
font-size: 32rpx;
font-weight: 600;
line-height: 48rpx;
padding: 32rpx 0 16rpx 0;
}
.head::before {
content: '';
display: inline-block;
width: 8rpx;
height: 28rpx;
background: #5850FF;
border-radius: 0 2rpx 2rpx 0;
margin-right: 32rpx;
}
.form-box {
margin: 0 32rpx;
font-size: 28rpx;
color: #2D2D33;
background-image: linear-gradient(179deg, rgba(123, 112, 255, 0.02) 15%, rgba(99, 92, 255, 0.10) 100%);
border-radius: 8rpx;
padding: 24rpx 32rpx;
}
.form-box .form-row {
justify-content: space-around;
align-items: center;
line-height: 72rpx;
margin-bottom: 24rpx;
}
.form-row .form-label {
padding-right: 10rpx;
flex-grow: 1;
}
.form-input {
box-sizing: border-box;
height: 72rpx;
width: 256rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
padding: 0 20rpx;
}
.suffix {
width: 28rpx;
color: #6E6E7A;
margin-left: 16rpx;
}
.submit-btn {
height: 72rpx;
line-height: 72rpx;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.tab-content-box {
margin: 16rpx 16rpx;
}
.pos-relative {
position: relative;
z-index: 1;
}
.card-introduce {
font-size: 28rpx;
width: 100%;
height: 160rpx;
color: #FFFFFF;
}
.introduce-img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.introduce-content {
padding: 32rpx 0 28rpx 32rpx;
}
.introduce-txt {
height: 44rpx;
line-height: 44rpx;
font-size: 28rpx;
margin-bottom: 16rpx;
}
.introduce-btn {
box-sizing: border-box;
width: 144rpx;
height: 40rpx;
opacity: 0.8;
font-size: 20rpx;
background: #7E78FF;
border-radius: 4rpx;
padding: 4rpx 12rpx;
}
.card-title-box {
font-size: 28rpx;
color: #2D2D2E;
margin: 32rpx 0;
}
.tips {
font-size: 24rpx;
color: #9E9EA8;
margin-top: 8rpx;
}
.model-hidden {
position: fixed;
left: -1000000;
top: -100000;
}
.model {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 99;
background: rgba(0, 0, 0, 0.7);
}
.model-box {
position: relative;
box-sizing: border-box;
width: calc(100vw - 128rpx);
height: 848rpx;
margin: 0 64rpx 48rpx;
}
.model-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.model-block {
position: absolute;
font-size: 28rpx;
width: 100%;
height: 100%;
}
.model-head {
display: flex;
width: 100%;
height: 20%;
font-size: 24rpx;
color: #5850FF;
justify-content: center;
align-items: center;
flex-direction: column;
}
.model-head .head-title {
font-size: 40rpx;
font-weight: 600;
margin-bottom: 8rpx;
}
.model-block .model-content {
width: 100%;
padding: 4% 40rpx;
}
.model-content .content-block {
display: flex;
font-size: 24rpx;
margin-bottom: 16rpx;
}
.model-content .content-icon {
width: 64rpx;
height: 64rpx;
margin-right: 16rpx;
}
.model-content .content-row {
display: flex;
margin-bottom: 8rpx;
}
.model-content .content-title {
height: 64rpx;
line-height: 64rpx;
font-size: 28rpx;
color: #2D2D33;
font-weight: 700;
}
.model-content .content-txt {
color: #2D2D33;
margin-right: 16rpx;
font-weight: 600;
}
.model-content .content-tip {
color: #6E6E7A;
}
.model-btn {
height: 88rpx;
line-height: 88rpx;
background: #5850FF;
border: 2rpx solid rgba(255, 255, 255, 0.50);
border-radius: 12rpx;
font-weight: 600;
font-size: 36rpx;
color: #FFFFFF;
text-align: center;
margin: 0 176rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/detail/detail.js
import pageData from '../constant/data'
import util from '../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL: wx.$imgUrl,
attrName: '',
proName: '',
addDatailObj: pageData.addDatailObj,
detailObj: {},
hasShare: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (util.getUserInfo().phone) {
this.setData({
hasShare: true
})
}
wx.$router.getData(({
attrName,
proName
}) => {
this.setData({
proName: proName,
attrName: attrName,
detailObj: this.data.addDatailObj[attrName]
})
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "D+增值转化",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/detail/detail.wxml-->
<view>
<view class="layout">
<view class="head">
<image class="head-icon" src="{{IMGURL}}addTransform/detail/icon-name.png?v={{img_version}}" />
<text class="head-txt">{{proName}}</text>
</view>
<swiper class="m-b-32" indicator-dots="true" autoplay="true">
<block wx:for="{{detailObj.imgList}}" wx:key="*this">
<swiper-item>
<image class="swiper-img" src="{{IMGURL}}{{item.url}}?v={{img_version}}" />
</swiper-item>
</block>
</swiper>
<view class="content-txt">{{detailObj.text}}</view>
</view>
<view class="layout">
<view class="head">
<image class="head-icon" webp src="{{IMGURL}}addTransform/detail/icon-video.png?v={{img_version}}" />
<text class="head-txt">案例视频</text>
</view>
<video class="video" wx:for="{{detailObj.videoList}}" wx:key="index" title="案例视频:{{proName}}" src="{{IMGURL}}{{item.url}}?v={{img_version}}"></video>
</view>
<view class="fixed-btn" wx:if="{{hasShare}}">
<button class="btn-share" open-type="share">
<image class="btn-icon" webp src="{{IMGURL}}addTransform/detail/share.png?v={{img_version}}"/>
<text>分享此页面</text>
</button>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/detail/detail.wxss */
page {
background-color: #F6F5F8;
padding-bottom: 112rpx;
}
.layout {
background: #FFFFFF;
padding: 32rpx;
margin-bottom: 20rpx;
}
.head {
display: flex;
align-items: center;
margin-bottom: 32rpx;
}
.head-icon {
width: 48rpx;
height: 48rpx;
}
.head-txt {
font-size: 32rpx;
color: #333333;
font-weight: 600;
margin-left: 20rpx;
}
.swiper-img {
width: 100%;
height: 100%;
}
.m-b-32 {
margin-bottom: 32rpx;
}
.content-txt {
font-size: 28rpx;
color: #111111;
line-height: 48rpx;
}
.video {
width: 100%;
height: 396rpx;
}
.fixed-btn {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #FFFFFF;
padding: 24rpx 0 16rpx;
box-shadow: 0 -4rpx 8rpx 0 rgba(196, 199, 204, 0.20);
}
.btn-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.btn-share {
display: flex;
justify-content: center;
align-items: center;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
margin: 0 48rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/components/AddTabView/AddTabView.js
Component({
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: {
type: String,
value: '100vh'
},
tagIndex: {
type: Number,
value: 0,
observer: function (n, o) {
this.setData({
count: n
})
}
},
key: {
type: String,
value: 'name'
},
showClickLoading:Boolean
},
/**
* 组件的初始数据
*/
data: {
count: 0,
scrollTop: 0,
IMGURL: wx.$imgUrl
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
item,
index
} = e.currentTarget.dataset
if(this.data.count === index) return
if(this.properties.showClickLoading) wx.$util.showLoading('')
item.index = index
this.setData({
count: index,
scrollTop: 0
})
this.triggerEvent('click', item)
wx.nextTick(()=>{
wx.hideLoading()
})
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
}
},
ready() {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/components/AddTabView/AddTabView.wxml-->
<view class='tab-box' id='tabView' style="height:{{height}}">
<scroll-view style="height:100%;" scroll-y class='tab' bindscrolltolower='tabScrollTolower'>
<view>
<block wx:for='{{tabList}}' wx:key='index'>
<view class='tab-item {{count==index?"active":""}}' bindtap="click" data-item='{{item}}' data-index='{{index}}'>
<image webp class="tab-bg" src="{{IMGURL}}addTransform/tab-{{index + 1}}.png?v={{img_version}}" />
<view wx:for="{{item[key]}}" wx:key="index" wx:for-item="subItem">{{subItem}}</view>
</view>
</block>
</view>
</scroll-view>
<view class='view'>
<scroll-view style="height:100%" scroll-y scroll-top='{{scrollTop}}' bindscrolltolower='viewScrollTolower'>
<slot></slot>
</scroll-view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/components/AddTabView/AddTabView.wxss */
.tab {
float: left;
width: 21.34%;
box-sizing: border-box;
text-align: center;
background: #F2F2F7;
}
.view {
box-sizing: border-box;
float: left;
width: 78.66%;
height: 100%;
position: relative;
padding: 0px 16rpx;
}
::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.tab-item {
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 240rpx;
font-size: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #6E6E7A;
box-sizing: border-box;
padding: 0 10rpx;
}
.tab-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.active {
font-weight: 700;
background: #fff;
color: #2D2D33;
position: sticky;
top: 0;
font-size: 28rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/addTransform/components/card/Card.js
Component({
/**
* 组件的属性列表
*/
properties: {
cardForm: {
type: Object,
      observer(n) {
        this.setData({
cardForm: n
        })
}
},
actualForm: {
type: Object,
observer(n) {
      this.setData({
actualForm: n
      })
this.calcProfit()
}
},
tagIndex: {
type: Number,
observer(n) {
this.calcProfit()
}
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: wx.$imgUrl,
typeObj: {
service: {
name: '服务类',
bgColor: 'rgba(255,231,205,0.80)',
color: '#EF971E'
},
membrane: {
name: '膜类',
bgColor: '#E3ECFF',
color: '#4E87FB'
},
beauty: {
name: '美容类',
bgColor: '#EAE9FF',
color: '#5851FF'
},
light: {
name: '轻改类',
bgColor: '#D7F5E5',
color: '#21AB60'
}
},
},
ready() {
},
/**
* 组件的方法列表
*/
methods: {
handleClick() {
this.triggerEvent('click', this.data.cardForm)
},
calcProfit() {
var targetItem = this.data.cardForm
let sales = +this.data.actualForm.sales || 0
let userNum = +this.data.actualForm.userNum || 0
let defaultPrice = +targetItem.priceList[0].value
if(targetItem.detailAttrName) {
switch(targetItem.detailAttrName) {
case 'digitRight':
targetItem.profit = (sales * 0.5 * defaultPrice * 12).toFixed(0) + ''
break
case 'sunMembrane':
targetItem.profit = (sales * 0.8 * 0.7 * defaultPrice * 12).toFixed(0) + ''
break
case 'paintMembrane':
targetItem.profit = (userNum * 0.15 * defaultPrice * 12).toFixed(0) + ''
break
case 'colorMembrane':
targetItem.profit = (userNum * 0.05 * defaultPrice * 12).toFixed(0) + ''
break
case 'digitBeauty':
targetItem.profit = (sales * 0.2 * defaultPrice * 12).toFixed(0) + ''
break
case 'chair':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.01).toFixed(0) + ''
break
case 'ar':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
case 'lamp':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
case 'navigation':
targetItem.profit = (userNum * defaultPrice * 0.9 * 0.15).toFixed(0) + ''
break
default:
break
}
}
this.setData({
cardForm: targetItem
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/addTransform/components/card/Card.wxml-->
<view class="card-box" bindtap="handleClick">
<image class="img" webp src="{{IMGURL}}{{cardForm.imgUrl}}?v={{img_version}}" />
<view class="card-block">
<view class="m-b-20">
<text class="card-type" style="color: {{typeObj[cardForm.type].color}}; background-color: {{typeObj[cardForm.type].bgColor}}">{{typeObj[cardForm.type].name}}</text>
<text class="card-title">{{cardForm.proName}}</text>
</view>
<view class="flex card-row">
<view wx:for="{{cardForm.priceList}}" wx:key="index" class="price-item">
<text class="m-r-8">{{item.name}}</text>
<text>¥{{item.value}}</text>
</view>
</view>
<view class="flex-space card-row">
<view wx:if="{{cardForm.profit}}">
<text class="m-r-8">预估收益</text>
<text class="profit-txt">¥{{cardForm.profit}}</text>
</view>
<view wx:else="">暂无预估收益,敬请期待</view>
<view class="profit-jump">产品介绍<text class="arrow"></text></view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/addTransform/components/card/Card.wxss */
.card-box {
box-sizing: border-box;
height: 440rpx;
background: #FAFAFA;
box-shadow: 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.32);
border-radius: 16rpx;
margin-bottom: 40rpx;
font-size: 24rpx;
}
.flex {
display: flex;
}
.flex-space {
display: flex;
justify-content: space-between;
}
.card-block {
padding: 32rpx 24rpx 24rpx;
}
.img {
width: 100%;
height: 240rpx;
}
.card-type {
padding: 4rpx 16rpx;
border-radius: 4rpx;
margin-right: 20rpx;
}
.m-b-20 {
margin-bottom: 20rpx;
}
.m-r-8 {
margin-right: 8rpx;
}
.card-title {
font-size: 32rpx;
color: #2D2D33;
font-weight: 600;
}
.card-row {
color: #6E6E7A;
height: 40rpx;
margin-bottom: 4rpx;
}
.price-item {
margin-right: 32rpx;
}
.price-item:last-child {
margin-right: 0;
}
.profit-txt {
font-size: 28rpx;
color: #5850FF;
font-weight: 600;
}
.profit-jump {
color: #9E9EA8;
}
.arrow {
display: inline-block;
width: 12rpx;
height: 12rpx;
border: 2rpx solid #9E9EA8;
border-width: 2rpx 2rpx 0 0;
opacity: 0.7;
transform: rotate(45deg);
margin-left: 10rpx;
}
\ No newline at end of file \ No newline at end of file
var tabList = [{
name: ['新车', '交付期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '数字无忧卡权益',
detailAttrName: 'digitRight',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '2000'
}],
profit: '1200000'
}, {
proName: '汽车太阳膜',
detailAttrName: 'sunMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '合资自主品牌',
value: '1500'
}, {
name: '豪华品牌',
value: '2000'
}],
profit: '10080000'
}]
}, {
name: ['新车', '磨合期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '漆面保护膜',
detailAttrName: 'paintMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '均客单价',
value: '12000'
}],
profit: '2160000'
}, {
proName: '改色膜',
detailAttrName: 'colorMembrane',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'membrane',
priceList: [{
name: '均客单价',
value: '5000'
}],
profit: '300000'
}]
}, {
name: ['用车', '热络期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '数字化美容',
detailAttrName: 'digitBeauty',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'beauty',
priceList: [{
name: '均客单价',
value: '300'
}],
profit: '72000'
}, {
proName: '座椅通风',
detailAttrName: 'chair',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2580'
}],
profit: '880'
}, {
proName: 'AR导航',
detailAttrName: 'ar',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '1680'
}],
profit: '880'
}, {
proName: '氛围灯',
detailAttrName: 'lamp',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2680'
}],
profit: '880'
}, {
proName: '360全景导航',
detailAttrName: 'navigation',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'light',
priceList: [{
name: '均客单价',
value: '2880'
}],
profit: '880'
}]
}, {
name: ['用车', '流失期'],
introduce: {
title: '车主处于“已购车待交付车辆”阶段?',
imgUrl: 'addTransform/card/deliver/introduce.png'
},
cardList: [{
proName: '车险续保',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '2500'
}],
profit: null
}, {
proName: '金融车贷',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'service',
priceList: [{
name: '均客单价',
value: '20000'
}],
profit: null
}, {
proName: '数字化美容',
detailAttrName: 'digitBeauty',
imgUrl: 'addTransform/card/deliver/card-0.png',
type: 'beauty',
priceList: [{
name: '均客单价',
value: '350'
}],
profit: '880'
}]
}]
var introduceList = [{
title: '新车交付期',
subTitle: '已购车/待交付车辆阶段',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '新车套餐打包 + 驻点销售升级'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店新车、展厅车销售'
}, {
name: '触达工具',
tip: '新车销售打包、太阳膜安装施工'
}, {
name: '配合岗位',
tip: '新车销售岗、精品岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '套餐毛利、流量触达'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '30%'
}, {
name: '预计单月',
tip: '6万/100台新车月销量'
}]
}]
}, {
title: '新车磨合期',
subTitle: '购车第一年(0-12个月内)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '订单膨胀、团购众筹'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店新车、展厅车销售'
}, {
name: '触达工具',
tip: '企业微信'
}, {
name: '配合岗位',
tip: '精品岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '内容种草'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '5%'
}, {
name: '预计单月',
tip: '5万'
}]
}]
}, {
title: '用车熟络期',
subTitle: '购车第二年(12-36个月内)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '众筹团购、以旧换新抵扣'
}, {
name: '',
tip: '直播展示+线下体验,秒杀活动+勾子产品'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店售后基盘'
}, {
name: '触达工具',
tip: '企业微信/个人微信'
}, {
name: '配合岗位',
tip: '全员岗位'
}, {
name: '营销频次',
tip: '轻改类每个季度、美容类每个月'
}, {
name: '转化关键',
tip: '内容种草+高性价比'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '2%'
}, {
name: '预计单月',
tip: '5万'
}]
}]
}, {
title: '用车流失期',
subTitle: '购车三年以上(36个月以上)',
contentList: [{
icon: 'play',
title: '销售玩法',
list: [{
name: '',
tip: '权益套餐买送'
}, {
name: '',
tip: '产品升级 + 线下体验'
}]
}, {
icon: 'crux',
title: '营销关键',
list: [{
name: '流量来源',
tip: '4S店续保流失客户'
}, {
name: '触达工具',
tip: '企业微信/个人微信'
}, {
name: '配合岗位',
tip: '续保岗'
}, {
name: '营销频次',
tip: '每月'
}, {
name: '转化关键',
tip: '高性价比'
}]
}, {
icon: 'income',
title: '增量收入',
list: [{
name: '转化率/渗透率',
tip: '10%'
}, {
name: '预计单月',
tip: '2万'
}]
}]
}]
var addDatailObj = {
digitRight: {
imgList: [{
url: 'addTransform/card/deliver/introduce.png'
}, {
url: 'addTransform/card/deliver/card-0.png'
}],
text: '产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案产品介绍文案。',
videoList: [{
url: 'addTransform/detail/video.mp4'
}]
},
sunMembrane: {
imgList: [{
url: 'addTransform/card/deliver/introduce.png'
}, {
url: 'addTransform/card/deliver/card-0.png'
}],
text: '太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜。',
videoList: [{
url: 'addTransform/detail/video.mp4'
}]
}
}
export default {
tabList,
introduceList,
addDatailObj
}
\ No newline at end of file \ No newline at end of file
// pages/addValue/addValue/addValue.js
import Util from "../../../utils/util";
import pageData from "../constant/data";
Page({
/**
* 页面的初始数据
*/
data: {
visible: false,
tabList: pageData.tabList,
tabActive: 0,
typeObj: {
service: {
name: "服务类",
class: "service-color",
},
membrane: {
name: "膜类",
class: "membrane-color",
},
beauty: {
name: "美容类",
class: "beauty-color",
},
light: {
name: "轻改类",
class: "light-color",
},
},
formData: {
sales: 100,
flow: 10000,
},
productList: [],
isReset: false,
hasPhoneNumber: false,
lastFormData: {
sales: 100,
flow: 10000,
},
isFirst: true
},
// tab切换
tabChange(e) {
console.log(e);
const index = e.currentTarget.dataset.index;
this.setData({
tabActive: index,
showPlay: false
})
this.showCase()
},
// 提交测算
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
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.setData({
visible: false
});
this.showCase()
if (!this.data.isFirst) {
wx.showToast({
title: '测算结果已在页面内同步展示',
icon: 'none',
duration: 2000
})
} else {
this.setData({
isFirst: false
})
}
},
// 计算公式,参数: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 = (flow * 0.15 * 12000 * 12).toFixed(0);
break;
case "colorMembrane":
// 改色膜
profit = (flow * 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 > 8) {
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;
},
// 显示测算弹窗
showCalculate() {
this.setData({
visible: !this.data.visible,
isReset: false
});
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 352) {
this.setData({
visible: false,
isReset: false,
formData: this.data.lastFormData
});
}
},
// 跳转产品详情
goDetail(e) {
console.log(e.currentTarget.dataset.item, "===");
wx.$router.go(e.currentTarget.dataset.item);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.submit()
this.showCase()
},
showCase() {
console.log(Util.getUserInfo())
if (Util.getUserInfo() && Util.getUserInfo().phone) {
this.setData({
hasPhoneNumber: true,
productList: this.data.tabList[this.data.tabActive].productList,
});
} else {
this.setData({
productList: this.data.tabList[this.data.tabActive].productList.slice(
0,
2
),
});
}
},
// 更新手机号
updatePhoneNumber(e) {
if (e.detail) {
this.setData({
hasPhoneNumber: true,
productList: this.data.tabList[this.data.tabActive].productList,
});
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});
<!--pages/addValue/addValue/addValue.wxml-->
<page-meta page-style="overflow: {{visible ? 'hidden' : 'visible'}}" />
<view class="wrapper-banner">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/dijia/banner.png?v={{img_version}}"></image>
<view class="banner-title">我们的产品和服务</view>
<view class="banner-after"></view>
</view>
<view class="tab-list">
<block wx:for="{{tabList}}" wx:key="index" class="">
<view class="tab-item {{tabActive == index ? 'tab-active' : ''}}" data-index="{{index}}" bindtap="tabChange">
<image class="tab-img" webp src="{{IMGURL}}image/dijia/{{tabActive == index ? item.active : item.img}}.png?v={{img_version}}"></image>
<view class="tab-name {{tabActive == index ? 'name-active' : ''}}">{{item.name}}</view>
</view>
</block>
</view>
<!-- 阶段玩法 -->
<view class="tab-play">
<image mode="widthFix" class="default-img" lazy-load webp src="{{IMGURL}}image/dijia/{{tabList[tabActive].playImg}}.png?v={{img_version}}"></image>
<image class="play-img play-img1" lazy-load webp src="{{IMGURL}}image/dijia/{{tabList[tabActive].playImg}}-text1.png?v={{img_version}}"></image>
<image class="play-img play-img2" lazy-load webp src="{{IMGURL}}image/dijia/{{tabList[tabActive].playImg}}-text2.png?v={{img_version}}"></image>
<image class="play-img play-img3" lazy-load webp src="{{IMGURL}}image/dijia/{{tabList[tabActive].playImg}}-text3.png?v={{img_version}}"></image>
</view>
<!-- 特色产品 -->
<view class="product-box">
<view class="product-title">特色产品</view>
<view class="product-tips">一站式解决用户全生命周期各类产品需求</view>
<view class="product-list">
<block wx:for="{{productList}}" wx:key="ind">
<view class="product-item" bindtap="goDetail" data-item="{{item.path}}">
<image webp src="{{IMGURL}}image/dijia/{{item.img}}.png?v={{img_version}}"></image>
<view class="product-content">
<view class="product-type {{typeObj[item.type].class}}">{{typeObj[item.type].name}}</view>
<view class="product-name">{{item.proName}}</view>
<view class="product-price" wx:if="{{item.profit}}">
<view class="product-label">预估收益</view>
<view class="product-value price">¥{{item.profit}}</view>
</view>
<view class="product-price" wx:else>
<view class="product-disabled">暂无预估收益</view>
</view>
<view class="product-introduce">
{{item.profit ? '产品介绍' : '敬请期待'}}
<image wx:if="{{item.profit}}" class="icon-arrow" webp src="{{IMGURL}}image/dijia/icon-arrow.png?v={{img_version}}"></image>
</view>
</view>
</view>
</block>
</view>
<view wx:if="{{!hasPhoneNumber}}" class="understand-more">
<phone-number class="more-btn" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
<!-- 案例视频 -->
<block wx:if="{{hasPhoneNumber}}">
<view class="video-bg" wx:if="{{tabList[tabActive].videoList.length}}">
<view class="video-title">案例视频</view>
<view class="video-list">
<block wx:for="{{tabList[tabActive].videoList}}" wx:key="i">
<view class="video-item">
<!-- -->
<video poster="{{IMGURL}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{IMGURL}}video/{{item.videoUrl}}.mp4?v={{img_version}}"></video>
<view class="video-text">{{item.name}}</view>
</view>
</block>
<view class="video-tips">- 如需开通请咨询客服 -</view>
</view>
</view>
</block>
<!-- 测算按钮 -->
<view class="calculate" bindtap="showCalculate">
<image class="icon-calculate" webp src="{{IMGURL}}image/dijia/icon-calculate.png?v={{img_version}}"></image>
</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>
<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>
\ No newline at end of file \ No newline at end of file
/* pages/addValue/addValue/addValue.wxss */
/* tab样式 */
.img {
width: 100%;
}
.wrapper-banner {
position: relative;
}
.banner-title {
position: absolute;
top: 64rpx;
text-align: center;
width: 100%;
font-size: 48rpx;
color: #ffffff;
line-height: 64rpx;
}
.banner-after {
position: absolute;
top: 152rpx;
left: 50%;
transform: translateX(-50%);
background-color: #D8D8D8;
width: 48rpx;
height: 4rpx;
}
.tab-list {
display: flex;
font-size: 0;
}
.tab-item {
width: 25%;
text-align: center;
padding: 20rpx 0;
font-size: 0;
height: 144rpx;
box-sizing: border-box;
}
.tab-active {
position: relative;
}
.tab-active {
background-color: #5850FF;
}
.tab-active::after {
content: '';
display: inline-block;
width: 0;
height: 0;
position: absolute;
top: 144rpx;
left: 50%;
transform: translateX(-50%);
border: 16rpx solid;
border-color: #5850FF transparent transparent transparent;
z-index: 1;
}
.tab-img {
width: 56rpx;
height: 56rpx;
}
.tab-name {
font-size: 28rpx;
color: #6E6E7A;
line-height: 44rpx;
margin-top: 4rpx;
}
.name-active {
color: #fff;
font-weight: 500;
}
/* 阶段玩法样式 */
.tab-play {
position: relative;
padding: 44rpx 24rpx 112rpx;
width: clac(100% - 48rpx);
height: 1236rpx;
background: #2D28A8;
background-image: linear-gradient(180deg, #2D28A8 0%, #201F38 100%);
}
.play-img {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 606rpx
}
.play-img1 {
height: 240rpx;
top: 292rpx;
}
.play-img2 {
height: 424rpx;
top: 548rpx;
}
.play-img3 {
height: 244rpx;
top: 988rpx;
}
/* 特色产品 */
.product-box {
position: relative;
width: 100%;
background-color: #fff;
/* height: 500rpx; */
}
.product-title {
position: relative;
font-size: 48rpx;
color: #2D2D33;
line-height: 64rpx;
text-align: center;
letter-spacing: 0;
padding: 96rpx 0 28rpx;
font-weight: 900;
}
.product-title::after {
content: '';
display: block;
width: 48rpx;
height: 4rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: #5850FF;
}
.product-tips {
margin-top: 32rpx;
text-align: center;
font-size: 28rpx;
color: #9E9EA8;
}
.product-list {
display: flex;
flex-wrap: wrap;
padding: 64rpx 32rpx 128rpx;
width: 100%;
box-sizing: border-box;
}
.product-item {
width: calc(50% - 12rpx);
/* height: 536rpx; */
background-color: #FAFAFA;
box-shadow: 0 8rpx 20rpx 0 rgba(180,186,204,0.32);
border-radius: 16rpx;
margin-bottom: 32rpx;
box-sizing: border-box;
}
.product-item:nth-child(even) {
margin-left: 22rpx;
}
.product-item image {
width: 100%;
height: 200rpx;
}
.product-content {
padding: 32rpx 24rpx;
}
.product-type {
display: inline-block;
/* background-color: #EAE9FF; */
border-radius: 4rpx;
font-weight: 500;
font-size: 24rpx;
/* color: #5851FF; */
padding: 4rpx 16rpx;
}
.beauty-color {
background-color: #EAE9FF;
color: #5851FF;
}
.light-color {
background-color: #D7F5E5;
color: #21AB60;
}
.service-color {
background-color: #FFE7CD;
color: #EF971E;
}
.membrane-color {
background-color: #E3ECFF;
color: #4E87FB;
}
.product-name {
font-weight: 500;
font-size: 32rpx;
color: #2D2D33;
line-height: 40rpx;
margin-top: 24rpx;
margin-bottom: 32rpx;
}
.product-price {
display: flex;
font-size: 24rpx;
color: #6E6E7A;
line-height: 40rpx;
}
.product-price:first-child {
margin-top: 8rpx;
}
.product-value {
color: #333333;
margin-left: 16rpx;
flex: 1;
}
.product-label {
width: 96rpx;
}
.price {
font-weight: Bold;
font-size: 28rpx;
color: #5850FF;
}
.product-introduce {
display: flex;
align-items: center;
margin-top: 24rpx;
font-size: 24rpx;
color: #9E9EA8;
line-height: 40rpx;
}
.product-introduce .icon-arrow {
width: 32rpx;
height: 32rpx;
}
.product-disabled {
color: #9E9EA8;
font-size: 24rpx;
}
/* 案例视频 */
.video-bg {
width: 100%;
/* height: 500rpx; */
background-color: #201F38;
}
.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: 80rpx 32rpx;
font-size: 0;
}
.video-item {
width: calc(50% - 12rpx);
margin-bottom: 80rpx;
}
.video-item video {
width: 100%;
height: 588rpx;
}
.video-item:nth-child(even) {
margin-left: 22rpx;
}
.video-text {
font-size: 32rpx;
color: #FFFFFF;
line-height: 48rpx;
margin-top: 24rpx;
}
.video-tips {
width: 100%;
text-align: center;
font-size: 28rpx;
color: rgba(255,255,255,.6);
padding: 16rpx 0 92rpx;
}
/* 测算 */
.calculate {
position: fixed;
right: 16rpx;
bottom: 160rpx;
}
.icon-calculate {
width: 216rpx;
height: 228rpx;
}
/* 测算弹窗 */
.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: 744rpx;
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;
background-image: linear-gradient(179deg, rgba(123,112,255,0.02) 15%, rgba(99,92,255,0.10) 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: #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;
}
/* 了解更多 */
.understand-more {
position: absolute;
bottom: 0;
width: 100%;
height: 700rpx;
background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, #FFFFFF 68%);
border-radius: 0 0 12rpx 12rpx;
}
.understand-more .more-btn {
width: 100%;
position: absolute;
bottom: 104rpx;
}
var tabList = [
{
name: '新车销售期',
img: 'icon-car1',
active: 'icon-car11',
playImg: 'img1',
productList: [
{
img: 'product-img1',
proName: '数字无忧权益卡',
price: '1500',
// profit: '92.4万',
profit: '9,999,999',
type: 'service',
productType: 'benefitCard',
path: 'equity'
},
{
img: 'product-img2',
proName: '汽车太阳膜',
price: '1500',
profit: '1008万',
type: 'membrane',
productType: 'sunMembrane',
path: 'solarFilm'
}
],
videoList: [
{
videoUrl: 'digital_card_30s',
posterUrl: 'digital_card_30s_bitmap',
name: '数字无忧卡服务30秒'
},
{
videoUrl: 'digital_card',
posterUrl: 'digital_card_bitmap',
name: '数字无忧卡服务'
},
{
videoUrl: 'digital_card_money3',
posterUrl: 'digital_card_money3_bitmap',
name: '数字无忧卡3道钱'
},
{
videoUrl: 'digital_card_reason6',
posterUrl: 'digital_card_reason6_bitmap',
name: '数字无忧卡6大理由'
},
{
videoUrl: 'solar',
posterUrl: 'solar_bitmap',
name: '太阳膜转化售中案例'
}
]
},
{
name: '0-12个月',
img: 'icon-car2',
active: 'icon-car21',
playImg: 'img2',
productList: [
{
img: 'product-img3',
proName: '漆面保护膜',
price: '12000',
profit: '216万',
type: 'membrane',
productType: 'protectMembrane',
path: 'paintProtect'
},
{
img: 'product-img4',
proName: '改色膜',
price: '5000',
profit: '30万',
type: 'membrane',
productType: 'colorMembrane',
path: 'changingFilm'
}
]
},
{
name: '12-36个月',
img: 'icon-car3',
active: 'icon-car31',
playImg: 'img3',
productList: [
{
img: 'product-img5',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty',
path: 'carBeauty'
},
{
img: 'product-img6',
proName: '座椅通风',
price: '1500',
profit: '1008万',
type: 'light',
productType: 'chair',
path: 'seatVentilate'
},
{
img: 'product-img7',
proName: 'AR导航',
price: '1680',
profit: '22.68万',
type: 'light',
productType: 'ar',
path: 'arNavigation'
},
{
img: 'product-img8',
proName: '氛围灯',
price: '2680',
profit: '36.18万',
type: 'light',
productType: 'lamp',
path: 'ambientLighting'
},
{
img: 'product-img9',
proName: '360全景导航',
price: '2880',
profit: '38.88万',
type: 'service',
productType: 'navigation',
path: 'navigationArround'
}
],
videoList: [
{
videoUrl: 'seat',
posterUrl: 'seat_bitmap',
name: '座椅通风系统'
},
{
videoUrl: 'AR',
posterUrl: 'AR_bitmap',
name: '单品AR导航'
},
{
videoUrl: 'light',
posterUrl: 'light_bitmap',
name: '单品类氛围灯'
},
{
videoUrl: '360_AR',
posterUrl: '360_AR_bitmap',
name: '360全景导航'
}
]
},
{
name: '36个月以上',
img: 'icon-car4',
active: 'icon-car41',
playImg: 'img4',
productList: [
{
img: 'product-img10',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty',
path: 'lossPhase'
},
{
img: 'product-img11',
proName: '车险续保',
price: '2500',
profit: '',
type: 'service'
},
{
img: 'product-img12',
proName: '金融车贷',
price: '200000',
profit: '',
type: 'service'
}
]
}
]
var tabList1 = [
{
name: '新车交付',
img: 'icon-car1',
active: 'icon-car11',
playImg: 'img1',
productList: [
{
img: 'product-img1',
proName: '数字无忧权益卡',
price: '1500',
// profit: '92.4万',
profit: '99999999万',
type: 'service',
productType: 'benefitCard'
},
{
img: 'product-img2',
proName: '汽车太阳膜',
price: '1500',
profit: '1008万',
type: 'membrane',
productType: 'sunMembrane'
}
]
},
{
name: '0-12个月',
img: 'icon-car2',
active: 'icon-car21',
playImg: 'img2',
productList: [
{
img: 'product-img3',
proName: '漆面保护膜',
price: '12000',
profit: '216万',
type: 'membrane',
productType: 'protectMembrane'
},
{
img: 'product-img4',
proName: '改色膜',
price: '5000',
profit: '30万',
type: 'membrane',
productType: 'colorMembrane'
}
]
},
{
name: '12-36个月',
img: 'icon-car3',
active: 'icon-car31',
playImg: 'img3',
productList: [
{
img: 'product-img5',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty'
},
{
img: 'product-img6',
proName: '座椅通风',
price: '1500',
profit: '1008万',
type: 'light',
productType: 'chair'
}
]
},
{
name: '36个月以上',
img: 'icon-car4',
active: 'icon-car41',
playImg: 'img4',
productList: [
{
img: 'product-img10',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty'
},
{
img: 'product-img11',
proName: '车险续保',
price: '2500',
profit: '',
type: 'service'
}
]
}
]
export default {
tabList
}
\ No newline at end of file \ No newline at end of file
import WxValidate from "../../utils/WxValidate"
// pages/applicationAccount/applicationAccount.js
Page({
/**
* 页面的初始数据
*/
data: {
accountForm: {
applyName: '',
telphone: '',
concerContent: '',
bussinessName: '',
province: []
}
},
// 表单验证规则
initValidate() {
const rules = {
applyName: {
required: true
},
telphone: {
required: true
},
bussinessName: {
required: true
},
province: {
required: true
}
}
const messages = {
applyName: {
required: '请填写申请人名称',
},
telphone: {
required: '请填写联系电话'
},
bussinessName: {
required: '请填写企业/门店名称'
},
province: {
required: '请选择省市'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showToast({
title: error.msg,
icon: 'none',
})
},
// 提交表单
submitAccount(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
},
// 选择省市
bindRegionChange(e) {
console.log(e.detail.value);
this.setData({
"accountForm.province": e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 初始化验证规则函数
this.initValidate()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file \ No newline at end of file
<!--pages/applicationAccount/applicationAccount.wxml-->
<view class="apply-account">
<view class="apply-top">
<image class="apply-background" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
<view class="apply-title">免费申请体验账号</view>
<button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
添加体验专员
</button>
</view>
<form class="apply-box" bindsubmit="submitAccount">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<picker mode="region" value="{{accountForm.province}}" bindchange="bindRegionChange">
<view class='info-list'>
<text class="info-lable">所在省市<text class="require"> *</text></text>
<block wx:if="{{!accountForm.province.length}}">
<view class="province-placeholder">请选择</view>
</block>
<block wx:else>
<view>{{accountForm.province}}</view>
</block>
</view>
</picker>
<view class='info-list'>
<text class="info-lable">企业名称<text class="require"> *</text></text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的企业/门店名称' value="{{parternerForm.bussinessName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view>
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
<view class="contact-inline">
</view>
</view>
/* pages/applicationAccount/applicationAccount.wxss */
.apply-account {
position: relative;
}
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 128rpx;
left: 182rpx;
}
.apply-code {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
.add-btn {
width: 260rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 252rpx;
left: 244rpx;
}
.apply-box {
width: 702rpx;
height: 864rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
textarea {
width: 475rpx !important;
}
.province-placeholder {
font-size:28rpx;
color: #9E9EA8;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 40rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.contact-inline {
width: 50rpx;
height: 50rpx;
background-color: aqua;
position: absolute;
right: 10rpx;
top: 930rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/applicationPartener/applicationPartener.js
import WxValidate from "../../utils/WxValidate"
Page({
/**
* 页面的初始数据
*/
data: {
parternerForm: {
applyName: '',
telphone: '',
province: []
}
},
// 表单验证规则
initValidate() {
const rules = {
applyName: {
required: true
},
telphone: {
required: true
},
province: {
required: true
}
}
const messages = {
applyName: {
required: '请填写申请人名称',
},
telphone: {
required: '请填写联系电话'
},
province: {
required: '请选择省市'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 提交表单
submitParterner(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
// 跳转申请成功页面
wx.$router.go("applySuccess");
},
// 选择省市
bindRegionChange(e) {
console.log(e.detail.value);
this.setData({
"parternerForm.province": e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 初始化验证规则函数
this.initValidate()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "合作申请"
}
\ No newline at end of file \ No newline at end of file
<!--pages/applicationPartener/applicationPartener.wxml-->
<view class="apply-partener">
<view class="apply-top">
<image class="apply-background" mode="widthFix" webp src="{{IMGURL}}home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
<view class="apply-title">申请城市合伙人</view>
<!-- <button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
添加合伙人专员
</button> -->
</view>
<form class="apply-box" bindsubmit="submitParterner">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<picker mode="region" name="province" value="{{parternerForm.province}}" bindchange="bindRegionChange">
<view class='info-list'>
<text class="info-lable">所在省市<text class="require"> *</text></text>
<view class="province-box">
<view>
<block wx:if="{{!parternerForm.province.length}}">
<view class="province-placeholder">请选择</view>
</block>
<block wx:else>
<view>{{parternerForm.province}}</view>
</block></view>
<view class="province-icon"></view>
</view>
</view>
</picker>
<!-- <view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view> -->
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/applicationPartener/applicationPartener.wxss */
.apply-partener {
position: relative;
}
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 160rpx;
left: 182rpx;
}
.apply-code {
width: 28rpx;
height: 28rpx;
vertical-align: middle;
}
.add-btn {
width: 284rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 512rpx;
left: 232rpx;
}
.apply-box {
width: 702rpx;
height: 640rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
.province-box {
width: 460rpx;
display: flex;
justify-content: space-between;
position: relative;
}
.province-icon {
width: 10rpx;
height: 10rpx;
transform: rotate(135deg);
border-top: 1px solid #9E9EA8;
border-left: 1px solid #9E9EA8;
position: absolute;
top: 12rpx;
right: 3rpx;
}
.province-placeholder {
font-size:28rpx;
color: #9E9EA8;
}
textarea {
width: 475rpx !important;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 160rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
<!--pages/applySuccess/applySuccess.wxml-->
<view class="success-box">
<view>
<image class="success-img" mode="widthFix" webp src="{{IMGURL}}home/success.png" bindload="imgSuccess" data-name="logo"></image>
</view>
<view class="success-title">申请成功</view>
<view class="success-text">您的申请已提交,</view>
<view class="success-text">请耐心等待顾问专员与您联系。</view>
<button class="share-btn" bindtap="toBack">
返回首页
</button>
</view>
/* pages/applySuccess/applySuccess.wxss */
.success-box {
text-align: center;
}
.success-img {
width: 448rpx;
height: 192rpx;
margin-top: 192rpx;
}
.success-title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 56rpx;
color: #2D2D33;
margin: 80rpx 0 32rpx;
}
.success-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #333333;
line-height: 48rpx;
}
.share-btn {
width: 622rpx;
height: 80rpx;
font-size: 28rpx;
color: #5850FF;
border-radius: 8rpx;
line-height: 80rpx;
margin-top: 208rpx;
border: 2rpx solid #9B96FF;
background-color: #fff;
}
\ No newline at end of file \ 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 = wx.$storage.get("scene").merchant
const cardId = wx.$storage.get('scene').cardId
console.log('product: ', product);
return {
// title: `给你分享一个活动${product},戳我参与~`,
title: `给你分享一个活动,戳我参与~`,
path:`/pages/checkProduct/checkProduct?actNum=${actNum}&activeNavIdx=${activeNavIdx}&isShare=${isShare}&cardId=${cardId}&merchant=${merchant}&shareType=SHARE_D`
}
},
/**
* 浏览埋点
*/
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 \ 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.$storage.get("scene").cardId
params.merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
params.openId = wx.$storage.get('aicard_info').openId
params.unionId = wx.$storage.get('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 \ No newline at end of file
{
"usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply",
"phone-number": "../../components/PhoneNumber/PhoneNumber"
},
"navigationBarTitleText": "数字化+新能源汽车"
}
\ No newline at end of file \ 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 \ 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 \ No newline at end of file
<!--氛围灯-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative bg_img">
<image mode="widthFix" class="img bg_img" webp src="{{IMGURL}}image/productDetail/ambientLighting/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/ambientLighting/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/ambientLighting/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/ambientLighting/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/ambientLighting/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/ambientLighting/lighe_product.png?v={{img_version}}"></image>
<view class="box-video light-video1">
<video poster="{{IMGURL}}video/light_bitmap.png?v={{img_version}}" title="单品类氛围灯" custom-cache="{{false}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/ambientLighting/ambientLighting.wxss */
.img {
width: 702rpx;
}
.bg_img {
width: 702rpx;
height: 1632rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 1092rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 1092rpx;
border-radius: 16rpx;
}
.light-video1 {
top: 204rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/arNavigation/arNavigation.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.ARNAVIGATION)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
<!--AR导航-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative bg_img">
<image mode="widthFix" class="bg_img" webp src="{{IMGURL}}image/productDetail/AR-navigation/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/AR-navigation/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/AR-navigation/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/AR-navigation/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/AR-navigation/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/AR-navigation/AR_product.png?v={{img_version}}"></image>
<view class="box-video navigation-video1">
<video poster="{{IMGURL}}video/AR_bitmap.png?v={{img_version}}" title="单品AR导航" custom-cache="{{false}}" src="{{IMGURL}}video/AR.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/arNavigation/arNavigation.wxss */
.img {
width: 702rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img {
width: 702rpx;
height: 1632rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 1092rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 1092rpx;
border-radius: 16rpx;
}
.navigation-video1 {
top: 212rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/carBeauty/carBeauty.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.CARBEAUTY);
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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
// };
},
});
<!--数字化美容-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative bg_img">
<image mode="widthFix" class="bg_img" webp src="{{IMGURL}}image/productDetail/carBeauty/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/carBeauty/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/carBeauty/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/carBeauty/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/carBeauty/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/carBeauty/beauty_product.png?v={{img_version}}"></image>
<view class="box-video beauty-video1">
<!-- <image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/carBeauty/beauty_bitmap.png?v={{img_version}}"></image> -->
<!-- <video poster="{{IMGURL}}image/productDetail/carBeauty/beauty_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/carBeauty/carBeauty.wxss */
.img {
width: 702rpx;
}
.bg_img {
width: 702rpx;
height: 1672rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 344rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.video_img {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.beauty-video1 {
top: 214rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/changingFilm/changingFilm.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.CHANGEFILM)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "改色膜"
}
\ No newline at end of file \ No newline at end of file
<!--改色膜-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="play_bg" webp src="{{IMGURL}}image/productDetail/changingFilm/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/changingFilm/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/changingFilm/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/changingFilm/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/changingFilm/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view>
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_product.png?v={{img_version}}"></image>
<view class="box-video beauty-video1">
<!-- <image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}"></image>
<video poster="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/changingFilm/changingFilm.wxss */
.img {
width: 702rpx;
}
.play_bg {
width: 702rpx;
height: 1672rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 344rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.video_img {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.beauty-video1 {
top: 232rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/equity/equity.js
import {
trackData
} from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
console.log(options, 'onshow')
getApp()
.login()
.then(({ data }) => {
console.log(data)
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.EQUITYCARD)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "数字无忧权益卡"
}
\ No newline at end of file \ No newline at end of file
<!-- 无忧权益卡 -->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/equity/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/equity/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/equity/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/equity/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/equity/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/equity/product_instra.png?v={{img_version}}"></image>
<view class="box-video equity-video1">
<view class="video-product">
<video poster="{{IMGURL}}video/digital_card_30s_bitmap.png?v={{img_version}}" title="数字无忧卡服务30秒" custom-cache="{{false}}" src="{{IMGURL}}video/digital_card_30s.mp4?v={{img_version}}"></video>
</view>
<view class="video-product">
<video poster="{{IMGURL}}video/digital_card_money3_bitmap.png?v={{img_version}}" title="数字无忧卡3道钱" custom-cache="{{false}}" src="{{IMGURL}}video/digital_card_money3.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/equity/income_caculate.png?v={{img_version}}"></image>
<!-- 产品特色 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/equity/product_feature.png?v={{img_version}}"></image>
<view class="box-video equity-video1">
<view class="video-product">
<video poster="{{IMGURL}}video/digital_card_bitmap.png?v={{img_version}}" title="数字无忧卡服务" custom-cache="{{false}}" src="{{IMGURL}}video/digital_card.mp4?v={{img_version}}"></video>
</view>
<view class="video-product">
<video poster="{{IMGURL}}video/digital_card_reason6_bitmap.png?v={{img_version}}" title="数字无忧卡6大理由" custom-cache="{{false}}" src="{{IMGURL}}video/digital_card_reason6.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
<!-- 服务流程 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/equity/service_process.png?v={{img_version}}"></image>
<!-- 产品内容 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/equity/product_content.png?v={{img_version}}"></image>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/equity/equity.wxss */
.img {
width: 710rpx;
}
.play_bg {
width: 702rpx;
height: 1632rpx;
}
.box-content image {
margin-bottom: 56rpx;
}
.box-content image:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 198rpx;
}
.bg_img2 {
top: 454rpx;
}
.bg_img3 {
top: 894rpx;
}
.bg_img4 {
top: 1154rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 620rpx;
display: flex;
justify-content: space-between;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.video-product {
width: 297rpx;
height: 525rpx;
border-radius: 16rpx;
}
.video-product video {
width: 296rpx;
height: 524rpx;
border-radius: 16rpx;
}
.equity-video1 {
top: 240rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/lossPhase/lossPhase.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.LOSSPGASE)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "流失期-数字化美容"
}
\ No newline at end of file \ No newline at end of file
<!--流失期-数字化美容-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/lossPhase/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/lossPhase/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/lossPhase/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/lossPhase/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/lossPhase/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/lossPhase/loss_product.png?v={{img_version}}"></image>
<view class="box-video beauty-video1">
<image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/lossPhase/loss_bitmap.png?v={{img_version}}"></image>
<!-- <video poster="{{IMGURL}}image/productDetail/lossPhase/loss_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/lossPhase/lossPhase.wxss */
.img {
width: 702rpx;
}
.play_bg {
width: 702rpx;
height: 1672rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 344rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.video_img {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.beauty-video1 {
top: 154rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/navigationArround/navigationArround.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.NAVIGATIONARROUND)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "360全景导航"
}
\ No newline at end of file \ No newline at end of file
<!--360全景导航-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/navigation-360/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/navigation-360/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/navigation-360/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/navigation-360/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/navigation-360/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/navigation-360/product_introduce.png?v={{img_version}}"></image>
<view class="box-video navigation-video1">
<video poster="{{IMGURL}}video/360_AR_bitmap.png?v={{img_version}}" title="360全景导航" custom-cache="{{false}}" src="{{IMGURL}}video/360_AR.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/navigationArround/navigationArround.wxss */
.img {
width: 702rpx;
}
.play_bg {
width: 702rpx;
height: 1632rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 1092rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 1092rpx;
border-radius: 16rpx;
}
.navigation-video1 {
top: 204rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/paintProtect/paintProtect.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.PAINTPROTECT)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "漆面保护膜"
}
\ No newline at end of file \ No newline at end of file
<!--漆面保护膜-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/paintProtect/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/paintProtect/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/paintProtect/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/paintProtect/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/paintProtect/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/paintProtect/paint_product.png?v={{img_version}}"></image>
<view class="box-video beauty-video1">
<!-- <image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/paintProtect/paint_bitmap.png?v={{img_version}}"></image> -->
<!-- <video poster="{{IMGURL}}image/productDetail/paintProtect/paint_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/paintProtect/paintProtect.wxss */
.img {
width: 702rpx;
}
.play_bg {
width: 702rpx;
height: 1672rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 344rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.video_img {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.beauty-video1 {
top: 204rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/seatVentilate/seatVentilate.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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.SEATVENTILATE)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "座椅通风系统"
}
\ No newline at end of file \ No newline at end of file
<!--座椅通风-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/seatVentilate/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/seatVentilate/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/seatVentilate/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/seatVentilate/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/seatVentilate/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/seatVentilate/seat_product.png?v={{img_version}}"></image>
<view class="box-video seat-video1">
<video poster="{{IMGURL}}video/seat_bitmap.png?v={{img_version}}" title="座椅通风系统" custom-cache="{{false}}" src="{{IMGURL}}video/seat.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/seatVentilate/seatVentilate.wxss */
.img {
width: 702rpx;
}
.play_bg {
width: 702rpx;
height: 1632rpx;
}
.box-content view {
margin-bottom: 56rpx;
}
.box-content view:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 1092rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 1092rpx;
border-radius: 16rpx;
}
.seat-video1 {
top: 204rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ No newline at end of file
// pages/productDetail/solarFilm/solarFilm.js
import { trackData } from "../../../utils/data";
import {shareTrackMixin} from "../../../mixins/index";
Page({
behaviors: [shareTrackMixin],
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
console.log(options, 'onshow')
getApp()
.login()
.then(({ data }) => {
console.log(data)
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.SOLARFILM)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
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 \ No newline at end of file
{
"usingComponents": {
"share-btn": "../../../components/shareBtn/shareBtn"
},
"navigationBarTitleText": "汽车太阳膜"
}
\ No newline at end of file \ No newline at end of file
<!--汽车太阳膜-->
<view class="box-bg box-relative">
<view class="box-content">
<!-- 阶段玩法 -->
<view class="box-relative play_bg">
<image mode="widthFix" class="img play_bg" webp src="{{IMGURL}}image/productDetail/solarFilm/play_bg.png?v={{img_version}}"></image>
<view class="bg_img1">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/solarFilm/play1.png?v={{img_version}}"></image>
</view>
<view class="bg_img2">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/solarFilm/play2.png?v={{img_version}}"></image>
</view>
<view class="bg_img3">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/solarFilm/play3.png?v={{img_version}}"></image>
</view>
<view class="bg_img4">
<image mode="widthFix" webp src="{{IMGURL}}image/productDetail/solarFilm/play4.png?v={{img_version}}"></image>
</view>
</view>
<!-- 产品介绍 -->
<view class="box-relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/solarFilm/solar_product.png?v={{img_version}}"></image>
<view class="box-video solar-video1">
<video poster="{{IMGURL}}video/solar_bitmap.png?v={{img_version}}" title="太阳膜转化售中案例" custom-cache="{{false}}" src="{{IMGURL}}video/solar.mp4?v={{img_version}}"></video>
</view>
</view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/solarFilm/solar_case.png?v={{img_version}}"></image>
</view>
</view>
<view class="btn-bottm">
<share-btn></share-btn>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/productDetail/solarFilm/solarFilm.wxss */
.img {
width: 702rpx;
}
.box-content image {
margin-bottom: 56rpx;
}
.box-content image:last-child {
margin-bottom: 110rpx;
}
.bg_img1,
.bg_img2,
.bg_img3,
.bg_img4 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.bg_img1 {
top: 248rpx;
}
.bg_img2 {
top: 504rpx;
}
.bg_img3 {
top: 944rpx;
}
.bg_img4 {
top: 1204rpx;
}
.box-relative {
position: relative;
}
.box-video {
width: 616rpx;
height: 344rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.box-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
.solar-video1 {
top: 240rpx;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
\ No newline at end of file \ 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
});
},
},
});
// 特色产品
.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 \ 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 webp src="{{IMGURL}}discovery_prod1.png" /> -->
<image webp 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 webp 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 webp 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 webp 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";
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-6个月',
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: '6个月以上',
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 \ 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,
wrapactiveNavIdx:0
});
},
// 头部看线索,产品切换
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: 500;
font-size: 18rpx;
color: #323436;
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 \ 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 \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-13 14:26:56
* @LastEditors: huyue
* @LastEditTime: 2022-12-13 19:15:12
*/
// pages/tab/index/components/activity/activity.js
import { componentsMixin } from "../../../../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
hasPhoneNumber: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
current: 0,
activityList:[{
id: 1,
status: 1,
activityText: '售后直播众筹活动,本月活动进行中100+门店'
},
{
id: 2,
status: 2,
activityText: '众筹活动1234'
}]
},
/**
* 组件的方法列表
*/
methods: {
toActivity(e) {
console.log(this.data.current, e.target.dataset)
const {activityId} = e.target.dataset
wx.$router.go('/packagesList/pages/activityDetail/activityDetail',{hasPhoneNumber: this.properties.hasPhoneNumber})
}
}
})
/* pages/tab/index/components/activity/activity.wxss */
.activity-scroll {
display: flex;
justify-items: center;
background: #FFF4D8;
border-radius: 8rpx;
margin: 12rpx 20rpx 26rpx;
font-weight: 400;
font-size: 26rpx;
color: #F68B0C;
letter-spacing: 0;
// line-height: 32rpx;
padding: 11rpx 12rpx;
height: 36rpx;
.swiper-item {
display: flex;
align-items: center;
}
.bg-activity {
position: relative;
width: 126rpx;
height: 36rpx;
margin-right: 12rpx;
image {
width: 100%;
height: 100%;
}
.activity-status {
position: absolute;
width: 126rpx;
// height: 36rpx;
font-weight: 500;
font-size: 20rpx;
color: #FFFFFF;
letter-spacing: 0;
text-align: center;
line-height: 32rpx;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/activity/activity.wxml-->
<swiper class="activity-scroll" vertical="true" circular="true" autoplay current="{{current}}" interval="3000">
<block wx:for="{{activityList}}" wx:key="index">
<swiper-item class="swiper-item" bindtap="toActivity" data-activityId="{{item.id}}">
<view class="bg-activity">
<image webp src="{{IMGURL}}home/bg-activity.png?v={{img_version}}"></image>
<view class="activity-status">{{item.status == 1 ? '活动进行中' : '活动已结束'}}</view>
</view>
{{item.activityText}}
</swiper-item>
</block>
</swiper>
// pages/tab/index/components/companyIntroduce/companyIntroduce.js
import { componentsMixin } from "../../../../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
autoplay: {
type: Boolean,
observer(n) {
this.setData({
autoplay: n,
});
},
}
},
/**
* 组件的初始数据
*/
data: {
current: 0,
banner: ['company-img3.png', 'company-img31.png'],
awardCurrent: 0,
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}]
},
/**
* 组件的方法列表
*/
methods: {
// 政府与行业资质轮播切换
changePage(e) {
let current = e.detail.current
this.setData({
current: current
})
},
// 荣誉与奖项轮播切换
changeBanner(e) {
let awardCurrent = e.detail.current
this.setData({
awardCurrent: awardCurrent
})
},
tapBanner(e) {
console.log(e)
let current = e.target.dataset.current
this.setData({
awardCurrent: current
})
},
}
})
/* pages/tab/index/components/companyIntroduce/companyIntroduce.wxss */
.img {
width: 100%;
}
.relative {
position: relative;
}
.box2 { .box2 {
position: absolute; position: absolute;
width: 716rpx; width: 716rpx;
top: 240rpx; top: 240rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} &-content {
.box2-content {
width: 716rpx; width: 716rpx;
height: 344rpx; height: 344rpx;
}
} }
.box3 { .box3 {
position: absolute; position: absolute;
top: 240rpx; top: 240rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} &-img, &-swiper {
.box3-img, .box3-swiper {
width: 704rpx; width: 704rpx;
height: 432rpx; height: 432rpx;
}
} }
// .box3-img, .box3-swiper {
// }
.box4 { .box4 {
width: 100%; width: 100%;
height: 956rpx; height: 956rpx;
......
<!-- 公司介绍 --> <!--pages/tab/index/components/companyIntroduce/companyIntroduce.wxml-->
<template name="company"> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/company-img1.png?v={{img_version}}"></image>
<view> <!-- 合同客户 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/company-img1.png?v={{img_version}}"></image> <view class="relative">
<!-- 合同客户 -->
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image>
<view class="box2"> <view class="box2">
<swiper class="swiper" autoplay="{{autoplay}}" duration="5000" interval="5000" circular> <swiper class="swiper" autoplay="{{autoplay}}" duration="5000" interval="5000" circular>
...@@ -15,9 +13,9 @@ ...@@ -15,9 +13,9 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
</view> </view>
<!-- 政府与行业资质 --> <!-- 政府与行业资质 -->
<view class="relative"> <view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image>
<view class="box3"> <view class="box3">
<swiper class="box3-swiper" autoplay="{{autoplay}}" bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular> <swiper class="box3-swiper" autoplay="{{autoplay}}" bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
...@@ -33,9 +31,9 @@ ...@@ -33,9 +31,9 @@
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<!-- 荣誉及奖项 --> <!-- 荣誉及奖项 -->
<view class="relative box5"> <view class="relative box5">
<image class="box5-title" webp src="{{IMGURL}}image/company/company-img6.png?v={{img_version}}"></image> <image class="box5-title" webp src="{{IMGURL}}image/company/company-img6.png?v={{img_version}}"></image>
<swiper class="box5-swiper" autoplay bindchange="changeBanner" current="{{awardCurrent}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular> <swiper class="box5-swiper" autoplay bindchange="changeBanner" current="{{awardCurrent}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{awardBanner}}" wx:key="ind"> <block wx:for="{{awardBanner}}" wx:key="ind">
...@@ -51,8 +49,6 @@ ...@@ -51,8 +49,6 @@
</view> </view>
</view>
<!-- <image mode="widthFix" class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image> -->
<image mode="widthFix" webp class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image>
</view>
</template>
\ No newline at end of file \ No newline at end of file
</view>
<!-- <image mode="widthFix" class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image> -->
<image mode="widthFix" webp class="img" src="{{IMGURL}}image/company/company-img5.png?v={{img_version}}"></image>
// pages/tab/index/components/scenario/scenario.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多 slot 支持
},
/**
* 组件的属性列表
*/
properties: {
senceData: {
type: Object
},
productData: {
type: Object,
observer(n) {
console.log(n)
}
},
hasPhoneNumber: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
currentScen: 0,
discoverIndex: 1
},
/**
* 组件的方法列表
*/
methods: {
selectScenario(e) {
console.log(e)
const { index } = e.target.dataset
this.setData({
currentScen: index,
discoverIndex: 0
})
this.triggerEvent('currentScen', this.data.currentScen)
},
clickTest() {
wx.$router.go('/packagesList/pages/productDetail/productDetail')
},
videoClick(e) {
console.log(e)
const { index, info: {videoUrl} } = e.detail
const {currentScen, productData} = this.data
const videoList = productData[currentScen][0].videoList
console.log(videoList)
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', {
index,
videoList,
videoUrl: videoUrl,
hasPhoneNumber: this.properties.hasPhoneNumber
})
}
}
})
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"tab": "../../../../components/Tab/Tab" "gl-scene": "glsx-applet-component/scene/index",
"glsx-discover": "glsx-applet-component/discover/index"
} }
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/scenario/scenario.wxss */
.scenario-menu {
width: 100%;
height: 88rpx;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
&::-webkit-scrollbar {
display:none;
width:0;
height:0;
color:transparent;
}
.menu-list {
padding: 0 20rpx;
display: inline-block;
white-space: nowrap;
.menu-item {
display: inline-block;
width: 170rpx;
text-align: center;
line-height: 80rpx;
font-weight: 400;
font-size: 28rpx;
color: #323436;
&.menu-active {
position: relative;
font-weight: 600;
font-size: 36rpx;
color: #323436;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 40rpx;
height: 8rpx;
background-color: #5850FF;
border-radius: 4rpx;
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/components/scenario/scenario.wxml-->
<view class="scenario-menu">
<view class="menu-list">
<view wx:for="{{senceData}}" wx:key="index" class="menu-item {{index == currentScen ? 'menu-active' : ''}}" bindtap="selectScenario" data-index="{{index}}">{{item.tabname}}</view>
</view>
</view>
{{discoverIndex}}
<gl-scene src="{{senceData[currentScen].banner}}"></gl-scene>
<slot name="swiper"></slot>
<glsx-discover index="{{discoverIndex}}" list="{{productData[currentScen]}}" bind:proclick="clickTest" bind:videoClick="videoClick"></glsx-discover>
\ No newline at end of file \ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-14 17:41:25
* @LastEditors: huyue
* @LastEditTime: 2022-12-15 11:47:39
*/
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
const videoBaseUrl = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
import { subscriptionSystemData } from './systemData'
/**
* 属性说明:
* sceneImgs:场景详情下的图片
* productImgs: 产品详情下的图片,同个场景下产品下面的内容相同
* videoList:案例视频
* posterList:营销海报
* noVideoPicture: 场景下的产品无视频,显示的图片
*/
// 车损升级
const sceneImgs0 = [`${IMG_URL}index/scene/scene00.png`, `${IMG_URL}index/scene/scene01.png`, `${IMG_URL}index/scene/scene02.png`, `${IMG_URL}index/scene/scene03.png`]
const productImgs0 = [`${IMG_URL}index/productImgs/product00.webp`, `${IMG_URL}index/productImgs/product01.webp`, `${IMG_URL}index/productImgs/product02.webp`, `${IMG_URL}index/productImgs/product03.webp`]
const videoList0 = [
{
videoUrl: `${videoBaseUrl}video/digital_card_30s.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_30s_bitmap.png`,
name: '数字无忧卡服务30秒',
manufacturer: '嘀加智慧',
view: 1004
},
{
videoUrl: `${videoBaseUrl}video/digital_card_money3.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_money3_bitmap.png`,
name: '数字无忧卡3道钱',
manufacturer: '嘀加智慧',
view: 1563
},
{
videoUrl: `${videoBaseUrl}video/digital_card.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_bitmap.png`,
name: '数字无忧卡服务',
manufacturer: '嘀加智慧',
view: 1320
},
{
videoUrl: `${videoBaseUrl}video/digital_card_reason6.mp4`,
posterUrl: `${IMG_URL}index/poster/digital_card_reason6_bitmap.png`,
name: '数字无忧卡6大理由',
manufacturer: '嘀加智慧',
view: 1485
}
]
const posterList0 = [
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
const scenario_0 = [
{
name: '服务类',
//场景详情图片
sceneImgs: sceneImgs0,
// 产品详情图片
productImgs: productImgs0,
"sceneCode":"SC001",
productList: [
{
id: 0,
img: 'product-img1',
proName: '数字无忧权益卡',
price: '100',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC001',
productName: '数字无忧权益卡',
category: '服务类',
prodImg: `${IMG_URL}index/prod2/prod0-0.png`
}
],
videoList: videoList0,
posterList: posterList0
}
]
// 精品升级
const sceneImgs1 = [`${IMG_URL}index/scene/scene10.png`, `${IMG_URL}index/scene/scene11.png`, `${IMG_URL}index/scene/scene12.png`, `${IMG_URL}index/scene/scene13.png`]
const productImgs1 = [`${IMG_URL}index/productImgs/product10.webp`, `${IMG_URL}index/productImgs/product11.webp`, `${IMG_URL}index/productImgs/product12.webp`, `${IMG_URL}index/productImgs/product13.webp`]
const videoList1 = [
{
videoUrl: `${videoBaseUrl}video/solar.mp4`,
posterUrl: `${IMG_URL}index/poster/solar_bitmap.png`,
name: '太阳膜转化售中案例-门店新增产值12w每月',
manufacturer: '嘀加智慧',
view: 1178
}
]
const posterList1 = [
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
const scenario_1 = [
{
name: '膜类',
sceneImgs: sceneImgs1,
productImgs: productImgs1,
"sceneCode":"SC002",
productList: [
{
id: 0,
img: 'product-img2',
proName: '汽车太阳膜',
price: '100',
profit: '1008000',
type: 'membrane',
productType: 'sunMembrane',
path: 'solarFilm',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC002',
productName: '汽车太阳膜',
category: '膜类',
prodImg: `${IMG_URL}index/prod2/prod1-0.png`
}
],
videoList: videoList1,
posterList: posterList1
}
]
// 客户线上化
const sceneImgs2 = [`${IMG_URL}index/scene/scene20.png`, `${IMG_URL}index/scene/scene21.png`, `${IMG_URL}index/scene/scene22.png`, `${IMG_URL}index/scene/scene23.png`]
const productImgs2 = [`${IMG_URL}index/productImgs/product20.webp`, `${IMG_URL}index/productImgs/product21.webp`, `${IMG_URL}index/productImgs/product22.webp`, `${IMG_URL}index/productImgs/product23.webp`]
const posterList2 = [
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
const videoList2 = []
const scenario_2 = [
{
name: '膜类',
sceneImgs: sceneImgs2,
productImgs: productImgs2,
"sceneCode":"SC003",
productList: [
{
id: 0,
img: 'product-img3',
proName: '漆面保护膜',
price: '100',
profit: '180000',
type: 'membrane',
productType: 'protectMembrane',
path: 'paintProtect',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC003',
productName: '漆面保护膜',
category: '膜类',
prodImg: `${IMG_URL}index/prod2/prod2-0.png`
},
{
id: 1,
img: 'product-img4',
proName: '改色膜',
price: '100',
profit: '300000',
type: 'membrane',
productType: 'colorMembrane',
path: 'changingFilm',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC004',
productName: '改色膜',
category: '膜类',
prodImg: `${IMG_URL}index/prod2/prod2-1.png`
}
],
//无视频时显示的图片
noVideoPicture: [
{
posterUrl: `${IMG_URL}index/poster/no-video.png`,
name: '0-6 个月次新车-线上销售轻改精品'
}
],
videoList: videoList2,
posterList: posterList2
}
]
// 众筹活动
const sceneImgs3 = [`${IMG_URL}index/scene/scene30.png`, `${IMG_URL}index/scene/scene31.png`, `${IMG_URL}index/scene/scene32.png`, `${IMG_URL}index/scene/scene33.png`]
const productImgs3 = [`${IMG_URL}index/productImgs/product30.webp`, `${IMG_URL}index/productImgs/product31.webp`, `${IMG_URL}index/productImgs/product32.webp`, `${IMG_URL}index/productImgs/product33.webp`]
const videoList3 = [
{
videoUrl: `${videoBaseUrl}video/car_beauty.mp4`,
posterUrl: `${IMG_URL}index/poster/car_beauty.png`,
name: '数字化美容-新增产值20w+',
manufacturer: '嘀加智慧',
view: 2561
},
{
videoUrl: `${videoBaseUrl}video/seat.mp4`,
posterUrl: `${IMG_URL}index/poster/seat_bitmap.png`,
name: '座椅通风系统-新增产值20w',
manufacturer: '嘀加智慧',
view: 1365
},
{
videoUrl: `${videoBaseUrl}video/AR.mp4`,
posterUrl: `${IMG_URL}index/poster/AR_bitmap.png`,
name: '单品AR导航-新增产值20w+',
manufacturer: '嘀加智慧',
view: 1172
},
{
videoUrl: `${videoBaseUrl}video/light.mp4`,
posterUrl: `${IMG_URL}index/poster/light_bitmap.png`,
name: '单品类氛围灯-新增产值27w',
manufacturer: '嘀加智慧',
view: 1006
},
{
videoUrl: `${videoBaseUrl}video/360_AR.mp4`,
posterUrl: `${IMG_URL}index/poster/360_AR_bitmap.png`,
name: '360全景导航-新增产值57w+',
manufacturer: '嘀加智慧',
view: 1891
},
{
videoUrl: `${videoBaseUrl}video/fragrance.mp4`,
posterUrl: `${IMG_URL}index/poster/fragrance.png`,
name: '智能香氛系统-新增产值57w+',
manufacturer: '嘀加智慧',
view: 3101
}
]
const posterList3 = [
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
name: '劲爆来袭'
},
{
src: `${IMG_URL}index/poster/poster3-1.webp`,
name: '疯狂让利'
},
{
src: `${IMG_URL}index/poster/poster3-2.webp`,
name: '娱乐系统'
},
{
src: `${IMG_URL}index/poster/poster3-3.webp`,
name: 'AR实景导航'
}
]
const scenario_3 = [
{
name: '美容类',
"sceneCode":"SC004",
productList: [
{
id: 0,
img: 'product-img5',
proName: '数字化美容',
price: '100',
profit: '72000',
type: 'beauty',
productType: 'digitBeauty',
path: 'carBeauty',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC005',
productName: '数字化美容',
category: '美容类',
prodImg: `${IMG_URL}index/prod2/prod3-4.png`
}
],
sceneImgs: sceneImgs3,
productImgs: productImgs3,
videoList: videoList3,
posterList: posterList3
},
{
name: '轻改类',
productList: [
{
id: 1,
img: 'product-img6',
proName: '座椅通风',
price: '10000',
profit: '232200',
type: 'light',
productType: 'chair',
path: 'seatVentilate',
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC006',
productName: '座椅通风',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-3.png`
},
{
id: 2,
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: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-0.png`
},
{
id: 3,
img: 'product-img8',
proName: '氛围灯',
price: '10000',
profit: '361800',
type: 'light',
productType: 'lamp',
path: 'ambientLighting',
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC008',
productName: '氛围灯',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-2.png`
},
{
id: 4,
img: 'product-img9',
proName: '360全景导航',
price: '10000',
profit: '388800',
type: 'light',
productType: 'navigation',
path: 'navigationArround',
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC009',
productName: '360全景导航',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-1.png`
},
{
id: 5,
img: 'product-img9',
proName: '智能香氛系统',
price: '10000',
profit: '388800',
type: 'light',
productType: 'navigation',
path: 'navigationArround',
sale: 10000, //销量
varType: 1,
flow: 10000,
productCode: 'PC009',
productName: '智能香氛系统',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-5.png`
}
],
sceneImgs: sceneImgs3,
productImgs: productImgs3,
videoList: videoList3,
posterList: posterList3
}
]
// 膨胀金
const sceneImgs4 = [`${IMG_URL}index/productImgs/product60.webp`, `${IMG_URL}index/productImgs/product61.webp`, `${IMG_URL}index/productImgs/product62.webp`, `${IMG_URL}index/productImgs/product63.webp`, `${IMG_URL}index/productImgs/product64.webp`, `${IMG_URL}index/productImgs/product65.webp`]
const productImgs4 = [`${IMG_URL}index/productImgs/product60.webp`, `${IMG_URL}index/productImgs/product61.webp`, `${IMG_URL}index/productImgs/product62.webp`, `${IMG_URL}index/productImgs/product63.webp`, `${IMG_URL}index/productImgs/product64.webp`, `${IMG_URL}index/productImgs/product65.webp`]
const videoList4 = [
{
videoUrl: `${videoBaseUrl}video/expansive_activity.mp4`,
posterUrl: `${IMG_URL}index/poster/expansive_activity.png`,
name: '如何利用膨胀金服务帮助门店锁客返厂',
manufacturer: '嘀加智慧',
view: 188
}
]
const scenario_4 = [
{
name: '服务类',
productList: [
{
id: 0,
currentIndex: 0,
proName: '膨胀金',
prodImg: `${IMG_URL}index/prod2/prod4-0.png`,
tabList: ['项目介绍', '活动方案', '销售场景', '合作案例', '合作说明', 'FAQ'],
sceneImgs: sceneImgs4
}
],
productImgs: productImgs4,
videoList: videoList4,
sceneImgs: sceneImgs4
}
]
const senceData = [
{
id: 0,
tabname: '车损升级',
banner: `${IMG_URL}index/banner/banner0.png`,
sceneImgs: sceneImgs0
},
{
id: 1,
tabname: '精品升级',
banner: `${IMG_URL}index/banner/banner1.png`,
sceneImgs: sceneImgs1
},
{
id: 2,
tabname: '客户线上化',
banner: `${IMG_URL}index/banner/banner2.png`,
sceneImgs: sceneImgs2
},
{
id: 3,
tabname: '众筹活动',
banner: `${IMG_URL}index/banner/banner3.png`,
sceneImgs: sceneImgs3
},
{
id: 4,
tabname: '膨胀金活动',
banner: `${IMG_URL}index/banner/banner6.png`,
sceneImgs: sceneImgs4
}
]
const productData = {
0: scenario_0,
1: scenario_1,
2: scenario_2,
3: scenario_3,
4: scenario_4,
// 99: subscriptionSystemData
}
const productData1 = {
0: scenario_0,
1: scenario_1,
2: scenario_2,
3: scenario_3,
4: scenario_4,
99: subscriptionSystemData
}
module.exports = {
senceData,
productData,
productData1
}
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
const subscriptionIMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/subscription/'
const IMG_URL2 = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
const subscriptionBannerUrl = IMG_URL2 + 'banner/banner4.webp'
const productImgs0 = [`${IMG_URL}index/productImgs/product00.webp`, `${IMG_URL}index/productImgs/product01.webp`, `${IMG_URL}index/productImgs/product02.webp`, `${IMG_URL}index/productImgs/product03.webp`]
// 车损升级
const tabList = ['项目亮点', '合作案例', '合作方式']
const sceneImgs5 = [`${IMG_URL}index/productImgs/scene00.png`, `${IMG_URL}index/productImgs/scene01.png`, `${IMG_URL}index/productImgs/scene02.png`, `${IMG_URL}index/productImgs/scene03.png`]
const videoList0 = [
{
videoUrl: `${IMG_URL2}video/customer_auto.mp4`,
posterUrl: `${IMG_URL}index/poster/customer_auto.png`,
name: '门店企微福利官实现客户活跃自动化',
manufacturer: '嘀加智慧',
view: 188
},
{
videoUrl: `${IMG_URL2}video/fix_insurance.mp4`,
posterUrl: `${IMG_URL}index/poster/fix_insurance.png`,
name: '定保数字化招揽,助力定保招揽返厂率提升10%',
manufacturer: '嘀加智慧云',
view: 188
}
]
const videoList1 = [
{
videoUrl: `${IMG_URL2}video/car_rescue.mp4`,
posterUrl: `${IMG_URL}index/poster/car_rescue.png`,
name: '车主返厂维修利器--事故车救援订阅',
manufacturer: '嘀加智慧',
view: 1320
}
]
const subscriptionSystemData = [
{
name: '客户沉淀',
//场景详情图片
// sceneImgs: sceneImgs5,
// 产品详情图片
productImgs: productImgs0,
productList: [
{
id: 0,
currentIndex: 0,
img: 'product-img1',
proName: '私域用户活跃代运营',
price: '100',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC011',
productName: '私域用户活跃代运营',
category: '代运营',
prodImg: `${IMG_URL2}/prod2/prod4-0.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product46.webp`,
className: 'img-item46'
},
{
url: `${IMG_URL}index/productImgs/product47.webp`,
className: 'img-item47'
},
{
url: `${IMG_URL}index/productImgs/product48.webp`,
className: 'img-item48'
}
],
tabList
},
{
id: 1,
currentIndex: 1,
img: 'product-img1',
proName: '定保/续保数字化招揽',
price: '100',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC012',
productName: '定保/续保数字化招揽',
category: '招揽',
prodImg: `${IMG_URL}index/prod2/prod4-1.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product49.webp`,
className: 'img-item49'
},
{
url: `${IMG_URL}index/productImgs/product50.webp`,
className: 'img-item50'
},
{
url: `${IMG_URL}index/productImgs/product51.webp`,
className: 'img-item51'
}
],
tabList
}
],
videoList: videoList0
// posterList: posterList0
},
{
name: '客户活跃',
//场景详情图片
sceneImgs: sceneImgs5,
// 产品详情图片
productImgs: productImgs0,
productList: [
{
id: 2,
currentIndex: 0,
img: 'product-img1',
proName: '事故车救援服务',
price: '100',
profit: '1200000',
type: 'service',
productType: 'benefitCard',
path: 'equity',
sale: 100, //销量
varType: 0,
flow: 10000,
productCode: 'PC001',
productName: '事故车救援服务',
category: '救援',
prodImg: `${IMG_URL}index/prod2/prod4-2.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product52.webp`,
className: 'img-item52'
},
{
url: `${IMG_URL}index/productImgs/product53.webp`,
className: 'img-item53'
},
{
url: `${IMG_URL}index/productImgs/product54.webp`,
className: 'img-item54'
}
],
tabList
}
],
videoList: videoList1
// posterList: posterList0
},
{
name: '数字化转型案例',
videoList: videoList0.concat(videoList1)
}
]
module.exports = {
// systemData,
subscriptionBannerUrl,
subscriptionSystemData
}
...@@ -3,53 +3,46 @@ ...@@ -3,53 +3,46 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-08-30 11:26:21 * @Date: 2022-08-30 11:26:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-10-28 10:51:40 * @LastEditTime: 2022-12-20 11:13:44
*/ */
// pages/tab/index/index.js // pages/tab/index/index.js
import { menuMixin } from "../../../mixins/index"; import Draw from '../../../utils/Draw'
import Draw from "../../../utils/Draw"; import { entmicroApi } from '../../../api/api'
import { ssoApi, entmicroApi } from "../../../api/api"; import { commonMixin } from '../../../mixins/index'
import util from "../../../utils/util"; import { trackData } from '../../../utils/data'
import { trackData } from "../../../utils/data"; import { senceData, productData } from './constant/senceData'
import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData'
let leftMenuIndex = 0
Page({ Page({
behaviors: [menuMixin], behaviors: [commonMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
introduceName: "",
tabList: [ tabList: [
{ {
name: "公司介绍", name: '增值转化',
icon: "icon-company", icon: 'icon-product',
icon1: "icon-company1", icon1: 'icon-product1'
isShow: true
}, },
{ {
name: "方案介绍", name: '系统订阅',
icon: "icon-product", icon: 'icon-measure',
icon1: "icon-product1", icon1: 'icon-measure'
isShow: true
}, },
{ {
name: "视频直播", name: '公司介绍',
icon: "icon-video", icon: 'icon-company',
icon1: "icon-video", icon1: 'icon-company1'
isShow: true
}, },
{ {
name: "展业测算", name: '视频直播',
icon: "icon-measure", icon: 'icon-video',
icon1: "icon-measure", icon1: 'icon-video'
isShow: false }
},
], ],
curTabIndex: 0, curTabIndex: 0,
// 0-员工,1-代理商
customerType: 0,
// 是否授权手机号
hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE],
// 员工名片信息 // 员工名片信息
cardInfo: null, cardInfo: null,
defaultInfo: { defaultInfo: {
...@@ -59,129 +52,153 @@ Page({ ...@@ -59,129 +52,153 @@ Page({
image: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg', image: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg',
qrCode: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg' qrCode: 'https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg'
}, },
banner: ['company-img3.png', 'company-img31.png'], // 是否授权手机号
current: 0, hasPhoneNumber: false,
clueList: ['clue-img2.webp', 'clue-img3.webp', 'clue-img4.webp', 'clue-img5.webp', 'clue-img6.webp', 'clue-img7.webp', 'clue-img8.webp', 'clue-img9.webp', 'clue-img10.webp', 'clue-img11.webp', 'clue-img12.webp', 'clue-img13.webp'], curTab: [trackData.HOME, trackData.SYSTEM_SUB, trackData.COMPANY, trackData.VIDEO],
clueCurrent: 0, secondTab: [trackData.CARDAMAGE, trackData.FINE, trackData.CUSTOMERSONLINE, trackData.CROWDFUNDING, trackData.EXPANSIONGOLD],
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}],
awardCurrent: 0,
shareDisabled: true, shareDisabled: true,
autoplay: true autoplay: true,
// 增值转化模块
senceData,
productData,
activityList: [],
subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
subscriptionSystemData: Object.freeze(subscriptionSystemData),
showCooperate: false
// bannerUrl:'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'
}, },
// 一级菜单
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index
this.setData({ this.setData({
autoplay: false autoplay: false
}) })
// 视频直播和合作申请是跳转新页面,不需要设置激活样式 // 视频直播是跳转新页面,不需要设置激活样式
// 0-公司介绍 1-方案介绍 2-视频直播 3-合作申请 // 0-增值转化 1-系统订阅 2-公司介绍 3-视频直播
switch (curTabIndex) { switch (curTabIndex) {
case 0: case 2:
this.setData({ this.setData({
curTabIndex: curTabIndex, curTabIndex: curTabIndex,
autoplay: true autoplay: true
}) })
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]); wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
break break
case 2: case 3:
wx.openChannelsUserProfile({ wx.openChannelsUserProfile({
finderUserName: 'sphPIdcy0NVpuao', finderUserName: 'sphPIdcy0NVpuao'
// feedId: 'export/UzFfAgtgekIEAQAAAAAAOQ8BJrsjzwAAAAstQy6ubaLX4KHWvLEZgBPEmIEUOQV4c62CzNPgMJqRnrGh3TfaajoIU4mGBiio'
}) })
wx.$Track.sendTrack(trackData.VIDEO); wx.$Track.sendTrack(trackData.VIDEO)
break;
case 3:
wx.$router.go("measure");
break break
default: default:
this.setData({ this.setData({
curTabIndex: curTabIndex, curTabIndex: curTabIndex
});
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
}
},
// 跳转其他内容
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: 'packageStoreAssistant/packageAuth/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 wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
} }
}, },
// 咨询
handleOpen(e) {},
// 更新手机号 // 更新手机号
updatePhoneNumber(e) { updatePhoneNumber(e) {
if (e.detail) { if (e.detail) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true
}); })
this.checkCooperate()
} }
}, },
// 获取跳转门店助手、生意助手判断
// 政府与行业资质轮播切换 checkCooperate() {
changePage(e) { const userInfo = wx.$storage.get('aicard_user_info')
let current = e.detail.current if (userInfo) {
const {openId} = userInfo
entmicroApi.checkCooperate({openId}).then(res => {
this.setData({ this.setData({
current: current showCooperate: res
}) })
}, })
// 荣誉与奖项轮播切换 } else {
changeBanner(e) {
let awardCurrent = e.detail.current
this.setData({ this.setData({
awardCurrent: awardCurrent showCooperate: false
}) })
}
},
// 获取二级菜单下标
getCurrentScen(e) {
const index = e.detail
wx.$Track.sendTrack(this.data.secondTab[index])
},
proClick(e) {
const { name } = e.target.dataset
let { detail } = e
console.log(detail)
let obj = {
name,
actNum: isNaN(detail.scenIndex) ? 99 : detail.scenIndex, //选中的场景 没有就是订阅系统的
activeNavIdx: detail.id, //选中的产品,
hasPhoneNumber: this.data.hasPhoneNumber,
proName: detail.proName
}
wx.$router.go('/packagesList/pages/productDetail/productDetail', obj)
}, },
tapBanner(e) { // 跳转视频详情
videoClick(e) {
console.log(e) console.log(e)
let current = e.target.dataset.current const { name } = e.target.dataset
this.setData({ const {
awardCurrent: current index,
}) info: { videoUrl },
scenIndex,
list
} = e.detail
const videoList = list
console.log(scenIndex)
const obj = {
index,
videoList,
videoUrl: videoUrl,
videoName: e.detail.info.name,
hasPhoneNumber: this.data.hasPhoneNumber,
scenIndex: isNaN(scenIndex) ? 99 : scenIndex,
name
}
if (name == '系统订阅') {
obj.leftMenuIndex = leftMenuIndex
}
wx.$router.go('/packagesList/pages/videoDetal/videoDetal', obj)
}, },
// 智能线索轮播切换
clueChange(e) { // 跳转活动页
let clueCurrent = e.detail.current activityClick(e) {
const { hasPhoneNumber } = this.data
const id = e.detail
wx.$router.go('/packagesList/pages/activityDetail/activityDetail', { hasPhoneNumber, id })
},
// 场景跳转
senceClick(e) {
const { hasPhoneNumber } = this.data
const { scenIndex } = e.detail
wx.$router.go('/packagesList/pages/scenarioDetail/scenarioDetail', { hasPhoneNumber, actNum: scenIndex })
},
// 获取全部活动列表
getActivityRecord() {
entmicroApi.getActivityRecord({}).then(({ data, code, message }) => {
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
this.setData({ this.setData({
clueCurrent: clueCurrent activityList: data
})
}) })
}, },
...@@ -189,20 +206,58 @@ Page({ ...@@ -189,20 +206,58 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$util.showLoading('加载中...')
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
if (data && data.phone) { if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true
}); })
this.checkCooperate()
} }
this.getCardDetail(); this.getCardDetail()
}); this.getActivityRecord()
})
wx.hideShareMenu({ wx.hideShareMenu({
menus: ['shareAppMessage'] menus: ['shareAppMessage']
}) })
this.setData({
productData: this.addAll(this.data.productData)
})
},
addAll(data) {
for (let i in data) {
let arr = [],
m = [],
n = []
data[i].map(item => {
arr = arr.concat(item.productList)
m = item.videoList
n = item.posterList
})
const allData = {
name: '全部',
productList: arr,
videoList: m,
posterList: n
}
data[i].unshift(allData)
}
return data
},
// 咨询
handleOpen() {
this.setData({
showCustomer: true
})
},
closeQR() {
this.setData({
showCustomer: false
})
}, },
/** /**
...@@ -214,13 +269,18 @@ Page({ ...@@ -214,13 +269,18 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const userInfo = wx.$util.getUserInfo()
this.setData({ this.setData({
hasPhoneNumber: util.getUserInfo() && util.getUserInfo().phone hasPhoneNumber: !!(userInfo && userInfo.phone)
}) })
this.checkCooperate()
const options = wx.getEnterOptionsSync() const options = wx.getEnterOptionsSync()
wx.$trackData = options.query wx.$trackData = options.query
if (wx.$trackData.merchant) { if (wx.$trackData.merchant) {
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]) wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
if (this.data.curTabIndex == 0) {
wx.$Track.sendTrack(this.data.secondTab[0])
}
} }
}, },
...@@ -248,47 +308,46 @@ Page({ ...@@ -248,47 +308,46 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = wx.$storage.get("scene").cardId const cardId = wx.$storage.get('scene').cardId
// merchantId 兼容旧链接 // merchantId 兼容旧链接
const merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_HOME' const shareType = 'SHARE_HOME'
console.log('cardId', cardId, 'merchant', merchant)
return { return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`, title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg, imageUrl: this.data.shareImg,
path: `pages/tab/index/index?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}` path: `pages/tab/index/index?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}`
}; }
}, },
setShareInfo(data = {}) { setShareInfo(data = {}) {
const canvasWidth = 208, const canvasWidth = 208,
canvasHeight = 166, canvasHeight = 166,
textBaseline = "top"; textBaseline = 'top'
const draw_function = new Draw(this, { const draw_function = new Draw(this, {
width: canvasWidth, width: canvasWidth,
height: canvasHeight, height: canvasHeight
// pixelRatio: 2, // pixelRatio: 2,
// backgroundColor: '#096' // backgroundColor: '#096'
}); })
const drawCard = (callBack) => { const drawCard = callBack => {
let index = 0; let index = 0
const iconWidth = 9, const iconWidth = 9,
iconHeight = 9, iconHeight = 9,
iconX = 18, iconX = 18,
iconY = 79, iconY = 79,
imgList = [ imgList = [
{ {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png", url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png',
x: 0, x: 0,
y: 0, y: 0,
width: canvasWidth, width: canvasWidth,
height: 124, height: 124
}, },
{ {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png", url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png',
x: 15, x: 15,
y: 18, y: 18,
width: 152, width: 152,
height: 10, height: 10
}, },
// 头像的 // 头像的
{ {
...@@ -297,125 +356,109 @@ Page({ ...@@ -297,125 +356,109 @@ Page({
x: 154, x: 154,
y: 36, y: 36,
width: 36, width: 36,
height: 36, height: 36
}, },
{ {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png", url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png',
x: iconX, x: iconX,
y: iconY, y: iconY,
width: iconWidth, width: iconWidth,
height: iconHeight, height: iconHeight
}, },
{ {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png", url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png',
x: iconX, x: iconX,
y: iconY + 13, y: iconY + 13,
width: iconWidth, width: iconWidth,
height: iconHeight, height: iconHeight
}, },
{ {
url: "https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png", url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png',
x: 64, x: 64,
y: 138, y: 138,
width: 80, width: 80,
height: 24, height: 24
}, }
], ],
textList = [ textList = [
{ {
text: data.staffName, text: data.staffName,
x: 18, x: 18,
y: 40, y: 40,
color: "#2D2D33", color: '#2D2D33',
fontWeight: 600, fontWeight: 600,
fontSize: 14, fontSize: 14
}, },
{ {
text: data.operation, text: data.operation,
x: 22 + draw_function.getTextWidth(data.staffName, 14), x: 22 + draw_function.getTextWidth(data.staffName, 14),
y: 44, y: 44,
color: "#6E6E7A", color: '#6E6E7A',
fontWeight: 400, fontWeight: 400,
fontSize: 8, fontSize: 8
}, },
{ {
text: data.staffPhone, text: data.staffPhone,
x: 30, x: 30,
y: 80, y: 80,
color: "#6E6E7A", color: '#6E6E7A',
fontSize: 7, fontSize: 7
}, },
{ {
text: "深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层", text: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层',
x: 30, x: 30,
y: 94, y: 94,
color: "#6E6E7A", color: '#6E6E7A',
fontSize: 7, fontSize: 7,
lineNum: 2, lineNum: 2,
width: 185, width: 185,
lineHeight: 9, lineHeight: 9
}, }
]; ]
const drawImages = (callBack) => { const drawImages = callBack => {
draw_function.drawImages(imgList[index], () => { draw_function.drawImages(imgList[index], () => {
index += 1; index += 1
if (index != imgList.length) drawImages(callBack); if (index != imgList.length) drawImages(callBack)
else callBack(); else callBack()
}); })
}; }
drawImages(() => { drawImages(() => {
try { try {
textList.map((e, ind) => { textList.map((e, ind) => {
e.textBaseline = textBaseline; e.textBaseline = textBaseline
draw_function.drawText(e); draw_function.drawText(e)
if (ind == textList.length - 1) throw true; if (ind == textList.length - 1) throw true
}); })
} catch (error) { } catch (error) {
draw_function.toDataURL(({ path }) => { draw_function.toDataURL(({ path }) => {
this.setData({ this.setData(
{
shareImg: path, shareImg: path,
shareDisabled: false shareDisabled: false
}, () => { },
() => {
wx.showShareMenu({ wx.showShareMenu({
menus: ['shareAppMessage'] menus: ['shareAppMessage']
}) })
}
)
}) })
});
} }
}); })
};
drawCard();
},
// 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
} }
drawCard()
}, },
// 获取员工名片信息 // 获取员工名片信息
getCardDetail() { getCardDetail() {
console.log(wx.showMeasure)
this.setData({ this.setData({
'tabList[3].isShow': wx.showMeasure 'tabList[3].isShow': wx.showMeasure
}) })
console.log(wx.$storage.get('scene'), wx.$trackData.cardId) const scene = wx.$storage.get('scene')
const scene = wx.$storage.get('scene');
let params = { let params = {
cardId: wx.$trackData.cardId || scene.cardId cardId: wx.$trackData.cardId || scene.cardId
}; }
entmicroApi.getCardDetail(params).then(({data, code, message}) => { entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
wx.hideLoading() wx.hideLoading()
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
...@@ -425,12 +468,22 @@ Page({ ...@@ -425,12 +468,22 @@ Page({
}) })
} }
const cardInfo = data || this.data.defaultInfo const cardInfo = data || this.data.defaultInfo
console.log(data, cardInfo) this.setData(
this.setData({ {
cardInfo cardInfo
},()=>{ },
this.setShareInfo(cardInfo); () => {
this.setShareInfo(cardInfo)
}
)
}) })
});
}, },
});
/** 系统订阅 */
sysMenuClick(e) {
console.log(e)
const {id} = e.detail
leftMenuIndex = id
console.log(1111, leftMenuIndex)
}
})
{ {
"usingComponents": { "usingComponents": {
"user-info": "../../../components/UserInfo/UserInfo" "user-info": "../../../components/UserInfo/UserInfo",
"company-introduce": "./components/companyIntroduce/companyIntroduce",
"customer": "../../../components/customer/customer",
"gl-scenario": "glsx-applet-component/scenario/index",
"gl-subscription": "glsx-applet-component/subscription/index"
}, },
"navigationBarTitleText": "广联数科智能名片" "navigationBarTitleText": "广联数科智能名片"
} }
/* pages/tab/index/index.wxss */
@import '../../template/channel/channel.wxss';
@import '../../template/menu/menu.wxss';
@import '../../template/company/company.wxss';
@import '../../template/cube/cube.wxss';
@import '../../template/equity/equity.wxss';
@import '../../template/clue/clue.wxss';
@import "./index.skeleton.wxss";
page { page {
background-color: #F5F5F7; background-color: #F5F5F7;
} }
.p-b-20 {
padding-bottom: 20rpx; .main-box {
} box-sizing: border-box;
.image-wrapper { height: 100%;
text-align: center;
background-color: #505CFF;
padding: 48rpx 20rpx;
margin-top: 32rpx;
}
.relative {
position: relative;
}
.absolute {
position: absolute; position: absolute;
width: 100%; width: 100%;
display: flex;
flex-direction: column;
.main-bottom {
background: #FFFFFF;
padding-top: 24rpx;
flex: 1;
}
} }
.img { .main-content {
width: 100%; padding-bottom: 110rpx;
} }
/** 菜单tab样式开始 */
.tab-list { .tab-list {
display: flex; display: flex;
margin: 0 32rpx; margin: 0 32rpx;
}
.tab-item { .tab-item {
width: 220rpx; width: 220rpx;
height: 144rpx; height: 144rpx;
background: #F5F6FA; background: #F5F6FA;
...@@ -47,90 +38,63 @@ page { ...@@ -47,90 +38,63 @@ page {
margin-top: 24rpx; margin-top: 24rpx;
position: relative; position: relative;
margin-right: 16rpx; margin-right: 16rpx;
}
.tab-item:last-child {
margin-right: 0;
}
.bg-img { &:last-child {
width: 220rpx; margin-right: 0;
height: 144rpx; }
position: absolute;
top: 0;
left: 0;
}
.tab-item-active { &-active {
color: #FFFFFF; color: #FFFFFF;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/icon-bg.png"); background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/icon-bg.png");
background-size: 220rpx 144rpx; background-size: 220rpx 144rpx;
} }
.tab-apply {
background: #F0F0FF;
font-weight: 600;
color: #5850FF;
}
.icon-hot {
width: 56rpx;
height: 24rpx;
position: absolute;
top: 0;
right: 0;
}
.tab-img { .tab-img {
width: 72rpx; width: 72rpx;
height: 72rpx; height: 72rpx;
position: absolute; position: absolute;
top: 16rpx; top: 16rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.tab-text { .tab-text {
position: absolute; position: absolute;
top: 88rpx; top: 88rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
width: 100%; width: 100%;
}
}
} }
/** 菜单tab样式结束 */
.main-box {
box-sizing: border-box;
height: 100%;
position: absolute;
width: 100%;
display: flex;
flex-direction: column;
}
.main-bottom {
background: #FFFFFF;
padding-top: 24rpx;
flex: 1;
}
/* 了解更多 */
.more-box {
position: relative;
}
.more-btn {
position: absolute;
width: 100%;
bottom: 32rpx;
}
/* 右下角图标 */ /* 右下角图标 */
.floating-box { .floating-box {
position: fixed; position: fixed;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
right: 6rpx; right: 6rpx;
bottom: 90rpx; bottom: 180rpx;
} }
.floating-icon { .floating-icon {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
} }
/** end */
.loadding {
height: 100vh;
font-weight: 500;
font-size: 48rpx;
color: #2D2D33;
text-align: center;
margin-top: 340rpx;
&-img {
width: 432rpx;
height: 300rpx;
margin-bottom: 50rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!--
此文件为开发者工具生成,生成时间: 2022/10/21下午2:19:20
使用方法:
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxml 引入模板
```
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}" />
```
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
-->
<template name="skeleton">
<view class="sk-container">
<view class="sk-container"></view>
<view class="main-box">
<view is="components/UserInfo/UserInfo" hidden="{{cardInfo}}">
<view class="UserInfo--user-wrapper">
<view class="UserInfo--user-box">
<view class="UserInfo--user-info" data-item="[object Object]">
<view class="UserInfo--user-company">
<image class="UserInfo--company-logo sk-image"></image>
</view>
<view class="UserInfo--user-name">
<view class="UserInfo--name sk-transparent sk-text-19-4444-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-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-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>
</view>
<image webp="true" class="UserInfo--user-bg sk-image"></image>
</view>
<view class="UserInfo--btn-group">
<view class="UserInfo--phone-btn">
<image webp="true" class="UserInfo--icon-dial sk-image"></image>
<view class="UserInfo--phone-text sk-transparent sk-text-14-2857-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>
</view>
</view>
<view is="components/Authorize/Authorize"></view>
</view>
<view class="main-bottom">
<view class="channel-bg">
<image webp="true" class="channel-img sk-image" data-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 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-411 sk-text" style="background-position-x: 50%;">公司介绍</view>
</view>
<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-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-642 sk-text" style="background-position-x: 50%;">视频直播</view>
</view>
</view>
<view>
<image webp="true" class="img sk-image" mode="widthFix" style="height: 1030.51px;"></image>
</view>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
/*
此文件为开发者工具生成,生成时间: 2022/10/21下午2:19:20
在 D:\workCode\2022-09\ai-card\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
*/
.sk-transparent {
color: transparent !important;
}
.sk-text-19-4444-883 {
background-image: linear-gradient(transparent 19.4444%, #EEEEEE 0%, #EEEEEE 80.5556%, transparent 0%) !important;
background-size: 100% 72.0000rpx;
position: relative !important;
}
.sk-text {
background-origin: content-box !important;
background-clip: content-box !important;
background-color: transparent !important;
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-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-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-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-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-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-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-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-button {
color: #EFEFEF !important;
background: #EFEFEF !important;
border: none !important;
box-shadow: none !important;
}
.sk-image {
background: #EFEFEF !important;
}
.sk-pseudo::before, .sk-pseudo::after {
background: #EFEFEF !important;
background-image: none !important;
color: transparent !important;
border-color: transparent !important;
}
.sk-pseudo-rect::before, .sk-pseudo-rect::after {
border-radius: 0 !important;
}
.sk-pseudo-circle::before, .sk-pseudo-circle::after {
border-radius: 50% !important;
}
.sk-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: transparent;
}
<!-- pages/tab/index/index.wxml --> <!-- pages/tab/index/index.wxml -->
<import src="../../template/channel/channel.wxml" /> <!-- <view class="loadding" wx:if="{{!cardInfo}}">
<import src="../../template/company/company.wxml" /> <glsx-image custom-class="loadding-img" src="home/loadding.webp" />
<import src="../../template/menu/menu.wxml" /> <view>努力加载中</view>
<import src="index.skeleton.wxml"/> </view> -->
<template is="skeleton" wx:if="true" /> <loadding wx:if="{{!cardInfo}}"></loadding>
<view class="main-box" wx:if="{{cardInfo}}" > <block wx:if="{{!!cardInfo}}">
<user-info data-skeleton-hide="cardInfo" shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}"></user-info> <view class="main-box">
<user-info shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}" />
<view class="main-bottom"> <view class="main-bottom">
<!-- 面向渠道 -->
<template is="channel" data="{{IMGURL, img_version, hasPhoneNumber}}"></template>
<!-- tab介绍 --> <!-- tab介绍 -->
<view class="tab-list"> <view class="tab-list">
<block wx:for="{{tabList}}" wx:key="index"> <block wx:for="{{tabList}}" wx:key="index">
<view wx:if="{{item.isShow}}" class="tab-item {{curTabIndex === index ? 'tab-item-active' : '' }}" data-name="{{item}}" data-index="{{index}}" bindtap="introduce"> <view 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:if="{{curTabIndex !== index}}" class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon1}}.png?v={{img_version}}" />
<image wx:else class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon}}.png?v={{img_version}}"></image> <image wx:else class="tab-img" mode="widthFix" webp src="{{IMGURL}}home/{{item.icon}}.png?v={{img_version}}" />
<view class="tab-text">{{item.name}}</view> <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> -->
</view> </view>
</block> </block>
</view> </view>
<!-- 公司介绍 --> <view class="main-content">
<block wx:if="{{curTabIndex === 0 }}"> <block wx:if="{{curTabIndex == 0}}">
<template is="company" data="{{IMGURL, banner, current, img_version, awardBanner, awardCurrent, autoplay}}"></template> <!-- 增值转化 -->
<gl-scenario currentScenIndex="{{3}}" productData="{{productData}}" senceData="{{senceData}}" activityList="{{activityList}}" data-name="增值转化" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" />
</block> </block>
<!-- 方案介绍 --> <block wx:if="{{curTabIndex == 1}}">
<block wx:if="{{curTabIndex === 1 }}"> <gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="系统订阅" bind:videoClick="videoClick" />
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType, hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList, autoplay, clueAutoplay}}"></template>
</block> </block>
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}" />
</block>
</view>
</view>
<!-- 服务咨询 -->
<!-- <view class="floating-box">
<image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="toStoreMiniProgram" src="{{IMGURL}}home/icon-store.png?v={{img_version}}" />
<image class="floating-icon" bindtap="toBusinessMiniProgram" webp src="{{IMGURL}}home/icon-business.png?v={{img_version}}" />
<image class="floating-icon" bindtap="handleOpen" webp src="{{IMGURL}}home/custom.png?v={{img_version}}" />
</view> -->
</view> </view>
<!-- 服务咨询 --> <!-- 服务咨询 -->
<view class="floating-box"> <view class="floating-box">
<image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="handleOpen" data-name="store" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image> <image wx:if="{{showCooperate}}" class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="toStoreMiniProgram" src="{{IMGURL}}home/icon-store.png?v={{img_version}}" />
<image class="floating-icon" bindtap="handleOpen" data-name="business" webp src="{{IMGURL}}home/icon-business.png?v={{img_version}}"></image> <image wx:if="{{showCooperate}}" class="floating-icon" bindtap="toBusinessMiniProgram" webp src="{{IMGURL}}home/icon-business.png?v={{img_version}}" />
<image class="floating-icon" bindtap="handleOpen" data-name="custom" webp src="{{IMGURL}}home/custom.png?v={{img_version}}"></image> <image class="floating-icon" bindtap="handleOpen" webp src="{{IMGURL}}home/custom.png?v={{img_version}}" />
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
<phone-number type="{{'home'}}" bindtoApplication="toApplication" hasPhoneNumber="{{hasPhoneNumber}}" />
<!-- 客服咨询 -->
<customer wx:if="{{showCustomer}}" qrCode="{{cardInfo.qrCode}}" bindcloseQR="closeQR" />
</block>
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--pages/tab/introduction/introduction.wxml-->
<import src="../../template/menu/menu" />
<import src="../../template/cube/cube" />
<import src="../../template/equity/equity" />
<block>
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType}}"></template>
</block>
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube"></template>
</block>
<block wx:elif="{{curIntroduceIndex === 1}}">
<template is="equity"></template>
</block>
<button open-type="share">分享</button>
<view class="btn-bottm">
<view class="share-btn" bindtap="share">
<image class="icon-share" webp src="{{IMGURL}}home/icon-share.png"></image>
<view class="share-text">分享此页面</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* pages/tab/introduction/introduction.wxss */
@import '../../template/menu/menu.wxss';
page {
background-color: #f5f5f6;
}
.btn-bottm {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
background-color: #ffffff;
padding: 24rpx 48rpx 12rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #FFFFFF;
}
.share-btn {
display: flex;
justify-content: center;
text-align: center;
padding: 16rpx 0;
width: 100%;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-share {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
\ No newline at end of file \ No newline at end of file
<template name="channel">
<view class="channel-bg">
<!-- <image class="channel-img" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/banner-bg.png" data-name="logo"></image>
<view class="channel-word">
<view class="channel-title">面向渠道</view>
<view class="channel-text">助力数字化转型,实现获客增值</view>
</view> -->
<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>
</template>
\ No newline at end of file \ No newline at end of file
.channel-bg {
/* 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;
}
.channel-title {
font-family: AlibabaPuHuiTiM;
font-weight: 600;
font-size: 36rpx;
color: #2D2D33;
line-height: 56rpx;
}
.channel-text {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
line-height: 36rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- 智能线索 -->
<template name="clue">
<view class="p-b-20">
<view class="relative">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-img1.png?v={{img_version}}"></image>
<view class="clue-video">
<video poster="{{IMGURL}}image/clue/clue-img14.png?v={{img_version}}" src="{{IMGURL}}image/clue/clue.mp4?v={{img_version}}"></video>
</view>
</view>
<view wx:if="{{hasPhoneNumber}}">
<view class="relative m-t-64">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-bg.webp?v={{img_version}}"></image>
<view class="clue">
<!-- <image mode="widthFix" class="img" lazy-load src="{{IMGURL}}image/clue/clue-img2.webp?v={{img_version}}"></image> -->
<swiper class="clue-swiper" autoplay="{{clueAutoplay}}" bindchange="clueChange" current="{{clueCurrent}}" interval="5000" circular>
<block wx:for="{{clueList}}" wx:key="ind">
<swiper-item class="swiper-item">
<image class="clue-img" lazy-load webp src="{{IMGURL}}image/clue/{{item}}?v={{img_version}}"></image>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{clueList}}" wx:for-index="index" wx:key="index">
<view class="{{clueCurrent == index ? 'active' : ''}}"></view>
</block>
</view>
</view>
</view>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/clue/clue-img16.webp?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.clue {
position: absolute;
top: 348rpx;
left: 50%;
transform: translateX(-50%);
}
.clue-swiper {
height: 984rpx;
width: 630rpx;
text-align: center;
}
.dots {
position: absolute;
bottom: -64rpx;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.dots view {
width: 20rpx;
height: 8rpx;
/* margin: 0 6rpx; */
background-color: #E6E7EB;
}
.dots .active {
background-color: #5850FF;
}
.clue-img {
width: 630rpx;
height: 984rpx;
}
.clue-video {
position: absolute;
width: 616rpx;
height: 344rpx;
bottom: 68rpx;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.clue-video video {
width: 616rpx;
height: 344rpx;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- 企微魔方 -->
<template name="cube">
<view class="p-b-20">
<view class="cube-img1-box">
<image class="img cube-img1" webp src="{{IMGURL}}image/cube/cube-img3.png?v={{img_version}}"></image>
<image class="cute-text cute-text1" webp src="{{IMGURL}}image/cube/cute-text1.png?v={{img_version}}"></image>
<image class="cute-text cute-text2" webp src="{{IMGURL}}image/cube/cute-text2.png?v={{img_version}}"></image>
<image class="cute-text cute-text3" webp src="{{IMGURL}}image/cube/cute-text3.png?v={{img_version}}"></image>
<image class="cute-text cute-text4" webp src="{{IMGURL}}image/cube/cute-text4.png?v={{img_version}}"></image>
<image class="cute-text cute-text5" webp src="{{IMGURL}}image/cube/cute-text5.png?v={{img_version}}"></image>
</view>
<view wx:if="{{hasPhoneNumber}}">
<image mode="widthFix" lazy-load class="img m-t-64" webp src="{{IMGURL}}image/cube/cube-img1.png?v={{img_version}}"></image>
<view class="relative" style="height: 2772rpx;">
<image class="img m-t-64" style="height: 2772rpx;" webp src="{{IMGURL}}image/cube/cube-img2.png?v={{img_version}}"></image>
<image class="img2-text img2-text1" webp src="{{IMGURL}}image/cube/img2-text1.png?v={{img_version}}"></image>
<image class="img2-text img2-text2" webp src="{{IMGURL}}image/cube/img2-text2.png?v={{img_version}}"></image>
<image class="img2-text img2-text3" webp src="{{IMGURL}}image/cube/img2-text3.png?v={{img_version}}"></image>
<view class="box-video cube-video1">
<video poster="{{IMGURL}}image/cube/arrival-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/arrival.mp4?v={{img_version}}"></video>
</view>
<view class="box-video cube-video2">
<video poster="{{IMGURL}}image/cube/checkout-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/checkout.mp4?v={{img_version}}"></video>
</view>
<view class="box-video cube-video3">
<video poster="{{IMGURL}}image/cube/rescue-img.png?v={{img_version}}" src="{{IMGURL}}image/cube/rescue.mp4?v={{img_version}}"></video>
</view>
</view>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/cube/cube-img4.png?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.m-t-64 {
margin-top: 24rpx;
}
.m-t-16 {
margin-top: 16rpx;
}
.box-video {
position: absolute;
width: 566rpx;
height: 316rpx;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
}
.cube-video1 {
top: 610rpx;
}
.cube-img1 {
width: 710rpx;
height: 2700rpx;
}
.cube-img1-box {
position: relative;
width: 710rpx;
height: 2700rpx;
}
.cute-text {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 614rpx;
}
.cute-text1 {
width: 606rpx;
height: 284rpx;
top: 128rpx;
}
.cute-text2 {
height: 260rpx;
top: 452rpx;
}
.cute-text3 {
height: 216rpx;
top: 736rpx;
}
.cute-text4 {
height: 216rpx;
top: 976rpx;
}
.cute-text5 {
height: 1380rpx;
top: 1272rpx;
}
.box-video video {
border-radius: 18rpx;
width: 566rpx;
height: 316rpx;
}
.cube-video2 {
bottom: 1026rpx;
}
.cube-video3 {
bottom: 138rpx;
}
.img2-text {
position: absolute;
width: 670rpx;
left: 50%;
transform: translateX(-50%);
}
.img2-text1 {
height: 852rpx;
top: 136rpx;
}
.img2-text2 {
height: 788rpx;
top: 1028rpx;
}
.img2-text3 {
height: 852rpx;
top: 1856rpx;
}
\ No newline at end of file \ No newline at end of file
<!-- 数字化权益 -->
<template name="equity">
<view class="p-b-20">
<view class="relative">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/equity/equity-img1.webp?v={{img_version}}"></image>
<view class="box-video equity-video">
<video poster="{{IMGURL}}image/equity/equity-img7.webp?v={{img_version}}" src="{{IMGURL}}image/equity/equity.mp4?v={{img_version}}"></video>
</view>
</view>
<view wx:if="{{hasPhoneNumber}}">
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img2.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img3.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img4.webp?v={{img_version}}"></image>
<image mode="widthFix" class="img m-t-64" lazy-load webp src="{{IMGURL}}image/equity/equity-img5.webp?v={{img_version}}"></image>
</view>
<view class="more-box" wx:else>
<image mode="widthFix" class="img m-t-16" lazy-load webp src="{{IMGURL}}image/equity/equity-img6.webp?v={{img_version}}"></image>
<view class="more-btn">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
</view>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.equity-video {
top: 1046rpx;
}
\ No newline at end of file \ No newline at end of file
<import src="../cube/cube" />
<import src="../equity/equity" />
<import src="../clue/clue" />
<template name="menu">
<view class="menu-list">
<block wx:for="{{menuList}}" wx:key="index">
<view class="menu-item {{index === curIntroduceIndex ? 'menu-active' : ''}} {{customerType === 1 && index === curIntroduceIndex ? 'menu-active-agency' : ''}}" bindtap="selectIntroduce" data-index="{{index}}">
{{item}}
</view>
</block>
</view>
<view class="isFullSucreen image-wrapper">
<block wx:if="{{curIntroduceIndex === 0}}">
<template is="cube" data="{{IMGURL, hasPhoneNumber, img_version}}"></template>
</block>
<block wx:if="{{curIntroduceIndex === 1}}">
<template is="equity" data="{{hasPhoneNumber, IMGURL, img_version}}"></template>
</block>
<block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue" data="{{hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList, clueAutoplay}}"></template>
</block>
</view>
</template>
\ No newline at end of file \ No newline at end of file
.menu-list {
display: flex;
justify-content: space-evenly;
background-color: #fff;
margin-top: 16rpx;
}
.menu-item {
position: relative;
font-size: 26rpx;
color: #6E6E7A;
height: 88rpx;
line-height: 88rpx;
}
.menu-active {
color: #5850ff;
font-weight: 500;
font-size: 28rpx;
}
.menu-active-agency {
font-weight: 600;
font-size: 32rpx;
color: #2D2D33;
}
.menu-active::after {
content: '';
display: inline-block;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 6rpx;
background-color: #5850ff;
border-radius: 0.8rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -35,141 +35,43 @@ ...@@ -35,141 +35,43 @@
}, },
{ {
"name": "", "name": "",
"pathName": "pages/addTransform/addTransform/addTransform",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3996",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/addValue/addValue/addValue",
"query": "scene=sceneId%3D3102",
"launchMode": "default",
"scene": null
},
{
"name": "数字无忧权益卡",
"pathName": "pages/productDetail/equity/equity",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "氛围灯",
"pathName": "pages/productDetail/ambientLighting/ambientLighting",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "AR导航",
"pathName": "pages/productDetail/arNavigation/arNavigation",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "数字化美容",
"pathName": "pages/productDetail/carBeauty/carBeauty",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "改色膜",
"pathName": "pages/productDetail/changingFilm/changingFilm",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "流失期",
"pathName": "pages/productDetail/lossPhase/lossPhase",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "360导航",
"pathName": "pages/productDetail/navigationArround/navigationArround",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "漆面保护",
"pathName": "pages/productDetail/paintProtect/paintProtect",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "座椅通风",
"pathName": "pages/productDetail/seatVentilate/seatVentilate",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "太阳膜",
"pathName": "pages/productDetail/solarFilm/solarFilm",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/tab/index/index", "pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3275", "query": "scene=sceneId%3D3275",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "活动详情",
"pathName": "pages/newEnergy/newEnergy", "pathName": "packagesList/pages/activityDetail/activityDetail",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/applySuccess/applySuccess", "pathName": "packagesList/pages/videoDetal/videoDetal",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "活动申请",
"pathName": "pages/activityApplication/activityApplication",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "展业测算", "name": "",
"pathName": "pages/measure/measure/measure", "pathName": "packagesList/pages/productDetail/productDetail",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "测算结果", "name": "",
"pathName": "pages/measure/measureResult/measureResult", "pathName": "pages/tab/index/index",
"query": "", "query": "scene=sceneId%3D3856",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/scene/scene", "pathName": "pages/productDetail/changingFilm/changingFilm",
"query": "", "query": "cardId=38&merchant=44210895",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
} }
......
const _routeHooks = Symbol("_routeHooks"); const _routeHooks = Symbol('_routeHooks')
const _query = Symbol("_query"); const _query = Symbol('_query')
const _routerList = Symbol("_routerList"); const _routerList = Symbol('_routerList')
import util from "../utils/util.js"; import util from '../utils/util.js'
const generateRoutList = (routerList) => { const generateRoutList = routerList => {
let _routerList = routerList; let _routerList = routerList
const tabBarList = __wxConfig?.tabBar?.list || [] const tabBarList = __wxConfig?.tabBar?.list || []
try { try {
_routerList = routerList.map((item) => { _routerList = routerList.map(item => {
let obj = {}; let obj = {}
if (item.parent != "__plugin__") { if (item.parent != '__plugin__') {
obj = { obj = {
...item, ...item,
isTab: tabBarList.some(({ pagePath }) => isTab: tabBarList.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', '')))
item.url.includes(pagePath.replace(".html", "")) }
), if (item.parent !== 'pages') {
}; let parentList = item.url.split(`/`)
if (item.parent !== "pages") {
let parentList = item.url.split(`/`);
if (parentList.length > 5) { if (parentList.length > 5) {
item.url = item.url.replace(/\/__plugin__\/[a-z0-9A-Z]+/, ""); item.url = item.url.replace(/\/__plugin__\/[a-z0-9A-Z]+/, '')
obj.subPages = item.url obj.subPages = item.url.split(`/${item.parent}/pages/`)[1].split('/')[0]
.split(`/${item.parent}/pages/`)[1]
.split("/")[0];
} }
} }
} }
return obj; return obj
}); })
} catch (err) {} } catch (err) {}
return _routerList; return _routerList
}; }
class Router { class Router {
[_query] = {}; [_query] = {};
[_routeHooks] = []; [_routeHooks] = [];
[_routerList] = []; [_routerList] = []
constructor(router) { constructor(router) {
this[_routerList] = generateRoutList(router); this[_routerList] = generateRoutList(router)
wx.onAppRoute && wx.onAppRoute &&
wx.onAppRoute((e) => { wx.onAppRoute(e => {
let thisPage = this.getPageInstance(); let thisPage = this.getPageInstance()
if (thisPage) { if (thisPage) {
if (!wx.$version) if (!wx.$version)
util.getMockConfig().then(({ version }) => { util.getMockConfig().then(({ version }) => {
wx.$version = version || "1.0.0"; wx.$version = version || '1.0.0'
thisPage.setData({ thisPage.setData({
img_version: wx.$version, img_version: wx.$version
}); })
}); })
else{ else {
thisPage.setData({ thisPage.setData({
img_version: wx.$version, img_version: wx.$version
}); })
} }
thisPage.setData({ thisPage.setData({
IMGURL: wx.$imgUrl, IMGURL: wx.$imgUrl
}); })
wx.hideHomeButton() wx.hideHomeButton()
this.setNavigationBarTitleText(thisPage); this.setNavigationBarTitleText(thisPage)
let onRoute = thisPage.onRoute; let onRoute = thisPage.onRoute
thisPage.$query = this[_query]; thisPage.$query = this[_query]
typeof onRoute === "function" && onRoute(this[_query]); typeof onRoute === 'function' && onRoute(this[_query])
let userInfo = util.getUserInfo(); let userInfo = util.getUserInfo()
if (userInfo && userInfo.phone) { if (userInfo && userInfo.phone) {
if (wx.$authStatus) { if (wx.$authStatus) {
thisPage.setData({ thisPage.setData({
userInfo: null, userInfo: null
}); })
} else { } else {
thisPage.setData({ thisPage.setData({
userInfo, userInfo
}); })
if (thisPage.init) thisPage.init(userInfo); if (thisPage.init) thisPage.init(userInfo)
} }
} }
} }
this[_routeHooks].forEach((fn) => { this[_routeHooks].forEach(fn => {
try { try {
typeof fn === "function" && fn(e, this[_query], this[_routerList]); typeof fn === 'function' && fn(e, this[_query], this[_routerList])
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}); })
this[_query] = {}; this[_query] = {}
}); })
} }
/**设置标题栏 */ /**设置标题栏 */
setNavigationBarTitleText(thisPage) { setNavigationBarTitleText(thisPage) {
let title = wx.$util.getNavigationBarTitleText(); let title = wx.$util.getNavigationBarTitleText()
if (wx.$util.getUserInfo()) title = wx.$util.getUserInfo().merchantName; if (wx.$util.getUserInfo()) title = wx.$util.getUserInfo().merchantName
const router = `${thisPage.__route__}.html`; const router = `${thisPage.__route__}.html`
if (__wxConfig && __wxConfig.page && __wxConfig.page[router]) { if (__wxConfig && __wxConfig.page && __wxConfig.page[router]) {
let { navigationBarTitleText, navigationStyle } = __wxConfig.page[ let { navigationBarTitleText, navigationStyle } = __wxConfig.page[router].window
router if (!title) title = ''
].window;
if (!title) title = "";
if (!navigationBarTitleText && !navigationStyle) if (!navigationBarTitleText && !navigationStyle)
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title, title
}); })
} }
} }
/**获取页面对象实例 */ /**获取页面对象实例 */
getPageInstance = (size = 1) => { getPageInstance = (size = 1) => {
const pages = getCurrentPages(); const pages = getCurrentPages()
return pages[pages.length - size]; return pages[pages.length - size]
}; }
checkRouter(route, events) { checkRouter(route, events) {
this[_query] = events || {}; this[_query] = events || {}
const [_parent, _name, last_name] = route.split("."); const [_parent, _name, last_name] = route.split('.')
let name = route; let name = route
let [parent] = this.getPageInstance().__route__.split("/"); let [parent] = this.getPageInstance().__route__.split('/')
let query = ""; let query = ''
if (route.includes("?")) { if (route.includes('?')) {
let [_name_, _query_] = route.split("?"); let [_name_, _query_] = route.split('?')
query = `?${_query_}`; query = `?${_query_}`
name = _name_; name = _name_
} }
if (_parent && _name) { if (_parent && _name) {
name = _name.split("?")[0]; name = _name.split('?')[0]
parent = _parent; parent = _parent
} }
/**只传页面名 默认跳转当前包下的页面,相同名称默认第一个 */ /**只传页面名 默认跳转当前包下的页面,相同名称默认第一个 */
if (!_name && !last_name) { if (!_name && !last_name) name = _parent
name = _parent; const routerMapItem = this[_routerList].find(item => {
parent = parent; if (route.includes('/')) return item.url === route
} else {
const routerMapItem = this[_routerList].find((item) => {
if (last_name) { if (last_name) {
return ( return item.parent === parent && item.name === last_name && item.subPages === name
item.parent === parent &&
item.name === last_name &&
item.subPages === name
);
} else { } else {
return item.parent === parent && item.name === name; return item.parent === parent && item.name === name
}
} }
}); })
if (!routerMapItem) { if (!routerMapItem) {
console.error("找不到路由"); console.error('找不到路由')
return; return
} }
return { return {
routerMapItem, routerMapItem,
query, query
}; }
} }
/**跳转至H5 */ /**跳转至H5 */
jumpH5(url) { jumpH5(url) {
wx.navigateTo({ wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(url)}`, url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
}); })
} }
/**页面跳转 /**页面跳转
* *
*/ */
jump(e) { jump(e) {
const item = e.currentTarget.dataset; const item = e.currentTarget.dataset
this.go(item.url, item); this.go(item.url, item)
} }
/** /**
* 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 || * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 ||
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层 * 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层
*/ */
go(route, events) { go(route, events) {
console.log(route, events) // console.log(route, events)
let { routerMapItem, query } = this.checkRouter(route, events); let { routerMapItem, query } = this.checkRouter(route, events)
console.log(routerMapItem) // console.log(routerMapItem)
if (routerMapItem.isTab) { if (routerMapItem.isTab) {
wx.switchTab({ wx.switchTab({
url: routerMapItem.url, url: routerMapItem.url
}); })
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `${routerMapItem.url}${query}`, url: `${routerMapItem.url}${query}`,
success: (res) => events && res.eventChannel.emit("getData", events), success: res => events && res.eventChannel.emit('getData', events)
}); })
} }
} }
/**关闭所有页面,打开到应用内的某个页面 */ /**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) { reLaunch(route, events) {
let { routerMapItem, query } = this.checkRouter(route, events); let { routerMapItem, query } = this.checkRouter(route, events)
wx.reLaunch({ wx.reLaunch({
url: `${routerMapItem.url}${query}`, url: `${routerMapItem.url}${query}`
}); })
} }
/**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */ /**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */
redirectTo(route, events) { redirectTo(route, events) {
let { routerMapItem, query } = this.checkRouter(route, events); let { routerMapItem, query } = this.checkRouter(route, events)
wx.redirectTo({ wx.redirectTo({
url: `${routerMapItem.url}${query}`, url: `${routerMapItem.url}${query}`
}); })
} }
/**prevPageSize = 1 /**prevPageSize = 1
* 返回上prevPageSize页 * 返回上prevPageSize页
* callBack返回上prevPageSize页对象 */ * callBack返回上prevPageSize页对象 */
back(callBack, prevPageSize = 1) { back(callBack, prevPageSize = 1) {
let prevPage = this.getPageInstance(Number(prevPageSize) + 1); let prevPage = this.getPageInstance(Number(prevPageSize) + 1)
if (callBack && "function" === typeof callBack) callBack(prevPage); if (callBack && 'function' === typeof callBack) callBack(prevPage)
wx.navigateBack({ wx.navigateBack({
delta: prevPageSize, delta: prevPageSize
}).catch((err) => { }).catch(err => {
this.goHome(); this.goHome()
}); })
} }
goHome() { goHome() {
let [index] = this[_routerList]; let [index] = this[_routerList]
wx.switchTab({ wx.switchTab({
url: index.url, url: index.url
}); })
} }
/**获取上一个页面传的数据 */ /**获取上一个页面传的数据 */
getData(callBack) { getData(callBack) {
const data = this.getPageInstance().getOpenerEventChannel(); const data = this.getPageInstance().getOpenerEventChannel()
if (Object.keys(data).length !== 0) if (Object.keys(data).length !== 0) data.on('getData', res => callBack(res))
data.on("getData", (res) => callBack(res));
} }
onRoute(fn) { onRoute(fn) {
this[_routeHooks].push(fn); this[_routeHooks].push(fn)
return () => { return () => {
const i = list.indexOf(fn); const i = list.indexOf(fn)
if (i > -1) list.splice(i, 1); if (i > -1) list.splice(i, 1)
}; }
} }
async intercept() { async intercept() {
const isAuth = !!wx.$authStatus; const isAuth = !!wx.$authStatus
this.getPageInstance().setData({ this.getPageInstance().setData({
showLogin: isAuth, showLogin: isAuth
}); })
return isAuth; return isAuth
} }
} }
export default Router; export default Router
...@@ -17,24 +17,17 @@ ...@@ -17,24 +17,17 @@
*/ */
import api from '../api/request' import api from '../api/request'
import {trackData} from '../utils/data' import {trackData} from '../utils/data'
let TRACK_TIME = null, let TRACK_TIME = null
ADDRESS_INFO = null
const track_interval_time = 60 * 1e3
class TRACK { class TRACK {
constructor() { constructor() {
this.initPageProxy() this.initPageProxy()
// this.sendTrack()
// this.getAddressInfo().then(res => ADDRESS_INFO = res)
this.appHide() this.appHide()
} }
/**监听页面 */ /**监听页面 */
pageLeaveProxy(thisPage) { pageLeaveProxy(thisPage) {
let _this = this, let _this = this,
onHide = thisPage.onHide,
onUnload = thisPage.onUnload,
onLoad = thisPage.onLoad, onLoad = thisPage.onLoad,
onShow = thisPage.onShow,
onTabItemTap = thisPage.onTabItemTap onTabItemTap = thisPage.onTabItemTap
thisPage.onTabItemTap = function (options) { thisPage.onTabItemTap = function (options) {
onTabItemTap && onTabItemTap.apply(this, arguments), onTabItemTap && onTabItemTap.apply(this, arguments),
...@@ -42,30 +35,8 @@ class TRACK { ...@@ -42,30 +35,8 @@ class TRACK {
} }
thisPage.onLoad = function () { thisPage.onLoad = function () {
onLoad && onLoad.apply(this, arguments) onLoad && onLoad.apply(this, arguments)
//, _this.setTrack({ // , _this.setTrack()
// enterTime: new Date().format('yyyy-MM-dd hh:mm:ss')
// })
}
thisPage.onShow = function () {
onShow && onShow.apply(this, arguments), _this.getPageInstance().page_show_time = Date.now()
}
thisPage.onHide = function () {
let {
page_show_time
} = _this.getPageInstance()
onHide && onHide.apply(this, arguments), _this.setTrack({
duration: getDuration(page_show_time)
}, 2)
}
thisPage.onUnload = function () {
let {
page_show_time
} = _this.getPageInstance()
onUnload && onUnload.apply(this, arguments), _this.setTrack({
duration: getDuration(page_show_time)
}, 2)
} }
const getDuration = (page_show_time) => (Date.now() - page_show_time) / 1e3
} }
/**全局注册事件 */ /**全局注册事件 */
initPageProxy() { initPageProxy() {
...@@ -95,31 +66,16 @@ class TRACK { ...@@ -95,31 +66,16 @@ class TRACK {
}) })
} }
/**设置埋点数据 */ /**设置埋点数据 */
setTrack(e, act_id = 1) { setTrack(params, act_id = 1) {
// console.log('---------------- 获取小程序启动时的参数 ----------------', wx.getLaunchOptionsSync()) console.log('---------------- 获取小程序启动时的参数 ----------------', wx.getLaunchOptionsSync())
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$storage.get('aicard_user_info')
// wx.setStorageSync('track_last_time', now) console.log(this.getPageTitle(), userInfo)
let data = {} // if (this.getPageTitle() == '广联数科智能名片') {
if (userInfo) { // console.log()
/**用户信息 */ // this.sendTrack(trackData.HOME)
if (userInfo.openId) data.open_id = userInfo.openId // }
if (userInfo.unionId) data.union_id = userInfo.unionId
if (userInfo.phone) data.customer_phone = userInfo.phone
}
console.log('---------------- 触发了埋点 ----------------', data)
// if (!prepare_data) prepare_data = []
// prepare_data.push(JSON.stringify(data))
// wx.setStorageSync('prepare_data', prepare_data)
}
getGuestNo() {
let guest_no = wx.$storage.get('guest_no')
if (!guest_no) {
guest_no = this.setGuestNo()
wx.setStorageSync('guest_no', guest_no)
}
return guest_no
} }
/**定时发送埋点数据 */ /**发送埋点数据 */
sendTrack(p, info) { sendTrack(p, info) {
console.log(info) console.log(info)
console.log(wx.$trackData); console.log(wx.$trackData);
...@@ -131,7 +87,6 @@ class TRACK { ...@@ -131,7 +87,6 @@ class TRACK {
type: systemInfo.environment ? 2 : 1 type: systemInfo.environment ? 2 : 1
} }
let userInfo = { } let userInfo = { }
if (wx.$util.getUserInfo()) { if (wx.$util.getUserInfo()) {
const {nickName, openId, phone} = wx.$util.getUserInfo() || {} const {nickName, openId, phone} = wx.$util.getUserInfo() || {}
userInfo = { userInfo = {
...@@ -141,12 +96,6 @@ class TRACK { ...@@ -141,12 +96,6 @@ class TRACK {
phone, phone,
} }
} else { } else {
// if (info.openId) {
// userInfo.openId = info.openId
// } else {
// // userInfo.openId = wx.$storage.get('openId')
// userInfo.openId = wx.$storage.get('aicard_info').openId
// }
userInfo.openId = info && info.openId ? info.openId : wx.$storage.get('aicard_info').openId userInfo.openId = info && info.openId ? info.openId : wx.$storage.get('aicard_info').openId
userInfo.unionId = info && info.unionId ? info.unionId : wx.$storage.get('aicard_info').unionId userInfo.unionId = info && info.unionId ? info.unionId : wx.$storage.get('aicard_info').unionId
} }
...@@ -185,128 +134,6 @@ class TRACK { ...@@ -185,128 +134,6 @@ class TRACK {
if (!title) title = '广汇车生活' if (!title) title = '广汇车生活'
return title return title
} }
/**获取设备信息 */
getSystemInfo() {
let {
SDKVersion,
brand,
model,
system,
version
} = JSON.parse(wx.$storage.get('aicard_system_info'))
return {
SDK_version: SDKVersion,
brand,
model,
system,
version
}
}
/**获取门店信息 */
getMerchantInfo() {
let {
merchantId
} = wx.$storage.get('merchant_info')
return {
merchant_id: merchantId
}
}
/**获取用户位置信息 */
// getAddressInfo() {
// let addressInfo = wx.$storage.get('address_info')
// return new Promise((resolve) => {
// if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo)
// else wx.getLocation({
// type: 'gcj02'
// }).then(({
// latitude,
// longitude
// }) => {
// if (!addressInfo) this.setTrack({}, 5)
// return
// mapApi.detailedAdrress([latitude, longitude]).then(detail => {
// let info = {
// ...detail,
// createTime: Date.now()
// }
// resolve(info)
// wx.setStorageSync('address_info', info)
// })
// })
// })
// }
/**获取游客ID */
setGuestNo(length = 30) {
let name = '',
n = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'
]
for (let i = 0; i < Number(length); i++) {
name += n[Math.round(Math.random() * (n.length - 1))]
}
return `GH_${name}_${Date.now()}`
}
} }
wx.$Track = new TRACK() wx.$Track = new TRACK()
\ No newline at end of file \ No newline at end of file
...@@ -89,7 +89,7 @@ class WxValidate { ...@@ -89,7 +89,7 @@ class WxValidate {
* 验证手机格式 * 验证手机格式
*/ */
tel(value) { tel(value) {
return that.optional(value) || /^1[34578]\d{9}$/.test(value) return that.optional(value) || /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/.test(value)
}, },
/** /**
* 验证URL格式 * 验证URL格式
......
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
// 缓存get方法为空的默认指定值 // 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo'] export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
......
const trackData = { const trackData = {
HOME: {
pageKey: 18,
pageName: "增值转化"
},
SYSTEM_SUB: {
pageKey: 19,
pageName: "系统订阅"
},
COMPANY: { COMPANY: {
pageKey: 0, pageKey: 0,
pageName: "公司介绍", pageName: "公司介绍"
}, },
VIDEO: { VIDEO: {
pageKey: 1, pageKey: 1,
...@@ -23,46 +31,6 @@ const trackData = { ...@@ -23,46 +31,6 @@ const trackData = {
pageKey: 5, pageKey: 5,
pageName: "D+增值转化", 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: { EQUITYCARD: {
pageKey: 6, pageKey: 6,
pageName: "数字无忧权益卡", pageName: "数字无忧权益卡",
...@@ -101,7 +69,7 @@ const trackData = { ...@@ -101,7 +69,7 @@ const trackData = {
}, },
LOSSPGASE: { LOSSPGASE: {
pageKey: 15, pageKey: 15,
pageName: "新能源0元换购", pageName: "智能香薰系统",
}, },
NEWENERGY: { NEWENERGY: {
pageKey: 16, pageKey: 16,
...@@ -110,8 +78,123 @@ const trackData = { ...@@ -110,8 +78,123 @@ const trackData = {
ACTIVITYAPPLICATION: { ACTIVITYAPPLICATION: {
pageKey: 17, pageKey: 17,
pageName: "活动申请" pageName: "活动申请"
},
CARDAMAGE: {
pageKey: 20,
pageName: "车损升级"
},
FINE: {
pageKey: 21,
pageName: "精品升级"
},
CUSTOMERSONLINE: {
pageKey: 22,
pageName: "客户线上化"
},
CROWDFUNDING: {
pageKey: 23,
pageName: "众筹活动"
},
EXPANSIONGOLD: {
pageKey: 24,
pageName: "膨胀金活动"
},
CARDETAIL: {
pageKey: 25,
pageName: "车损升级场景详情页"
},
FINEDETAIL: {
pageKey: 26,
pageName: "精品升级场景详情页"
},
CUSTOMEDETAIL: {
pageKey: 27,
pageName: "客户线上化场景详情页"
},
CROWDDETAIL: {
pageKey: 28,
pageName: "众筹活动场景详情页"
},
EXPANDETAIL: {
pageKey: 29,
pageName: "膨胀金活动场景详情页"
},
EQUITYVIDEO0: {
pageKey: 30,
pageName: "数字无忧卡服务30秒"
},
EQUITYVIDEO1: {
pageKey: 31,
pageName: "数字无忧卡3道线"
},
EQUITYVIDEO2: {
pageKey: 32,
pageName: "数字无忧卡服务"
},
EQUITYVIDEO3: {
pageKey: 33,
pageName: "数字无忧卡6大理由"
},
SOLARFILMVIDEO: {
pageKey: 35,
pageName: "太阳膜转化售中案例-门店新增产值12w每月"
},
CROWDVIDEO0: {
pageKey: 36,
pageName: "数字化美容-新增产值20w+"
},
CROWDVIDEO1: {
pageKey: 37,
pageName: "座椅通风系统-新增产值20w"
},
CROWDVIDEO2: {
pageKey: 38,
pageName: "单品AR导航-新增产值20w+"
},
CROWDVIDEO3: {
pageKey: 39,
pageName: "单品类氛围灯-新增产值27w"
},
CROWDVIDEO4: {
pageKey: 40,
pageName: "360全景导航-新增产值57w+"
},
CROWDVIDEO5: {
pageKey: 41,
pageName: "智能香氛系统-新增产值57w+"
},
SYSUSER: {
pageKey: 42,
pageName: "私域用户活跃代运营"
},
SYSNUMBER: {
pageKey: 43,
pageName: "定保/续保数字化招揽"
},
SYSCAR: {
pageKey: 44,
pageName: "事故车救援服务"
},
EXPANGOLD: {
pageKey: 45,
pageName: "膨胀金"
},
SYSUSERVIDEO1: {
pageKey: 46,
pageName: "门店企微福利官实现客户活跃自动化"
},
SYSUSERVIDEO2: {
pageKey: 47,
pageName: "定保数字化招揽,助力定保招揽返厂率提升10"
},
SYSNUMBERVIDEO1: {
pageKey: 48,
pageName: "车主返厂维修利器--事故车救援订阅"
},
EXPANGOLDVIDEO1: {
pageKey: 49,
pageName: "如何利用膨胀金服务帮助门店锁客返厂"
} }
}; };
const productTrack = [ const productTrack = [
......
var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var S=_((le,M)=>{"use strict";M.exports=N;function y(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function N(t){if(t=t||{},t.circles)return Q(t);return t.proto?s:a;function e(f,i){for(var r=Object.keys(f),n=new Array(r.length),u=0;u<r.length;u++){var o=r[u],p=f[o];typeof p!="object"||p===null?n[o]=p:p instanceof Date?n[o]=new Date(p):ArrayBuffer.isView(p)?n[o]=y(p):n[o]=i(p)}return n}function a(f){if(typeof f!="object"||f===null)return f;if(f instanceof Date)return new Date(f);if(Array.isArray(f))return e(f,a);if(f instanceof Map)return new Map(e(Array.from(f),a));if(f instanceof Set)return new Set(e(Array.from(f),a));var i={};for(var r in f)if(Object.hasOwnProperty.call(f,r)!==!1){var n=f[r];typeof n!="object"||n===null?i[r]=n:n instanceof Date?i[r]=new Date(n):n instanceof Map?i[r]=new Map(e(Array.from(n),a)):n instanceof Set?i[r]=new Set(e(Array.from(n),a)):ArrayBuffer.isView(n)?i[r]=y(n):i[r]=a(n)}return i}function s(f){if(typeof f!="object"||f===null)return f;if(f instanceof Date)return new Date(f);if(Array.isArray(f))return e(f,s);if(f instanceof Map)return new Map(e(Array.from(f),s));if(f instanceof Set)return new Set(e(Array.from(f),s));var i={};for(var r in f){var n=f[r];typeof n!="object"||n===null?i[r]=n:n instanceof Date?i[r]=new Date(n):n instanceof Map?i[r]=new Map(e(Array.from(n),s)):n instanceof Set?i[r]=new Set(e(Array.from(n),s)):ArrayBuffer.isView(n)?i[r]=y(n):i[r]=s(n)}return i}}function Q(t){var e=[],a=[];return t.proto?i:f;function s(r,n){for(var u=Object.keys(r),o=new Array(u.length),p=0;p<u.length;p++){var c=u[p],l=r[c];if(typeof l!="object"||l===null)o[c]=l;else if(l instanceof Date)o[c]=new Date(l);else if(ArrayBuffer.isView(l))o[c]=y(l);else{var h=e.indexOf(l);h!==-1?o[c]=a[h]:o[c]=n(l)}}return o}function f(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return s(r,f);if(r instanceof Map)return new Map(s(Array.from(r),f));if(r instanceof Set)return new Set(s(Array.from(r),f));var n={};e.push(r),a.push(n);for(var u in r)if(Object.hasOwnProperty.call(r,u)!==!1){var o=r[u];if(typeof o!="object"||o===null)n[u]=o;else if(o instanceof Date)n[u]=new Date(o);else if(o instanceof Map)n[u]=new Map(s(Array.from(o),f));else if(o instanceof Set)n[u]=new Set(s(Array.from(o),f));else if(ArrayBuffer.isView(o))n[u]=y(o);else{var p=e.indexOf(o);p!==-1?n[u]=a[p]:n[u]=f(o)}}return e.pop(),a.pop(),n}function i(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return s(r,i);if(r instanceof Map)return new Map(s(Array.from(r),i));if(r instanceof Set)return new Set(s(Array.from(r),i));var n={};e.push(r),a.push(n);for(var u in r){var o=r[u];if(typeof o!="object"||o===null)n[u]=o;else if(o instanceof Date)n[u]=new Date(o);else if(o instanceof Map)n[u]=new Map(s(Array.from(o),i));else if(o instanceof Set)n[u]=new Set(s(Array.from(o),i));else if(ArrayBuffer.isView(o))n[u]=y(o);else{var p=e.indexOf(o);p!==-1?n[u]=a[p]:n[u]=i(o)}}return e.pop(),a.pop(),n}}});var V=_((ce,I)=>{"use strict";var C=Array.isArray,W=Object.keys,Z=Object.prototype.hasOwnProperty;I.exports=function t(e,a){if(e===a)return!0;if(e&&a&&typeof e=="object"&&typeof a=="object"){var s=C(e),f=C(a),i,r,n;if(s&&f){if(r=e.length,r!=a.length)return!1;for(i=r;i--!=0;)if(!t(e[i],a[i]))return!1;return!0}if(s!=f)return!1;var u=e instanceof Date,o=a instanceof Date;if(u!=o)return!1;if(u&&o)return e.getTime()==a.getTime();var p=e instanceof RegExp,c=a instanceof RegExp;if(p!=c)return!1;if(p&&c)return e.toString()==a.toString();var l=W(e);if(r=l.length,r!==W(a).length)return!1;for(i=r;i--!=0;)if(!Z.call(a,l[i]))return!1;for(i=r;i--!=0;)if(n=l[i],!t(e[n],a[n]))return!1;return!0}return e!==e&&a!==a}});var q=_(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0}),A.parseMultiDataPaths=ee,A.getDataOnPath=void 0;var E=/^\s/,b=function(t,e){throw new Error('Parsing data path "'+t+'" failed at char "'+t[e]+'" (index '+e+")")},L=function(t,e){for(var a=e.index;e.index<e.length;){var s=t[e.index];if(/^[0-9]/.test(s)){e.index++;continue}break}return a===e.index&&b(t,e.index),parseInt(t.slice(a,e.index),10)},R=function(t,e){var a=e.index,s=t[a];if(/^[_a-zA-Z$]/.test(s))for(e.index++;e.index<e.length;){var f=t[e.index];if(/^[_a-zA-Z0-9$]/.test(f)){e.index++;continue}break}else b(t,e.index);return t.slice(a,e.index)},B=function(t,e){for(var a=[R(t,e)],s={deepCmp:!1};e.index<e.length;){var f=t[e.index];if(f==="[")e.index++,a.push(L(t,e)),t[e.index]!=="]"&&b(t,e.index),e.index++;else if(f==="."){if(e.index++,t[e.index]==="*"){if(e.index++,t[e.index]==="*"){e.index++,s.deepCmp=!0;break}b(t,e.index)}a.push(R(t,e))}else break}return{path:a,options:s}},X=function(t,e){for(;E.test(t[e.index]);)e.index++;for(var a=[B(t,e)],s=!1;e.index<e.length;){var f=t[e.index];E.test(f)?e.index++:f===","?(s=!0,e.index++):s?(s=!1,a.push(B(t,e))):b(t,e.index)}return a},k=function(t,e){e.index<e.length&&b(t,e.index)};function ee(t){var e={length:t.length,index:0},a=X(t,e);return k(t,e),a}var te=function(t,e){var a=t;return e.forEach(function(s){a=typeof a!="object"||a===null?void 0:a[s]}),a};A.getDataOnPath=te});var H=_(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0}),m.create=re,m.unwrap=ne;var z=function(t,e,a){if(typeof t!="object"||t===null)return t;var s={get:function(f,i){if(i==="__rawObject__")return t;var r=a.concat(i),n=t[i];return e.push({path:r,value:n}),z(n,e,r)}};return new Proxy(t,s)};function re(t,e){return z(t,e,[])}function ne(t){return typeof t!="object"||t===null||typeof t.__rawObject__!="object"?t:t.__rawObject__}});var K=_(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0}),x.behavior=void 0;var $,ae=G(S()),ie=G(V()),w=U(q()),j=U(H());function F(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function G(t){return t&&t.__esModule?t:{default:t}}function U(t){if(t&&t.__esModule)return t;var e={};if(t!=null){for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,a):{};s.get||s.set?Object.defineProperty(e,a,s):e[a]=t[a]}}return e.default=t,e}var T=ae.default({proto:!0}),fe=0,oe=Behavior({lifetimes:{attached:function(){this.setData({_computedWatchInit:"attached"})},created:function(){this.setData({_computedWatchInit:"created"})}},definitionFilter:function(t){var e=t.computed,a=t.watch,s=[],f=fe++;s.push({fields:"_computedWatchInit",observer:function(){var i=this.data._computedWatchInit;if(i==="created"){var r={computedUpdaters:[],computedRelatedPathValues:{},watchCurVal:{}};this._computedWatchInfo||(this._computedWatchInfo={}),this._computedWatchInfo[f]=r,a&&Object.keys(a).forEach(function(u){var o=w.parseMultiDataPaths(u).map(function(p){var c=p.path,l=p.options,h=w.getDataOnPath(this.data,c);return l.deepCmp?T(h):h}.bind(this));r.watchCurVal[u]=o}.bind(this))}else if(i==="attached"){var n=this._computedWatchInfo[f];e&&Object.keys(e).forEach(function(u){var o=e[u],p=[],c=o(j.create(this.data,p)),l=p.map(function(d){var v=d.path;return{path:v,value:w.getDataOnPath(this.data,v)}}.bind(this));this.setData(F({},u,j.unwrap(c))),n.computedRelatedPathValues[u]=l;var h=function(){for(var d=n.computedRelatedPathValues[u],v=!1,D=0;D<d.length;D++){var P=d[D],Y=P.path;if(P.value!==w.getDataOnPath(this.data,Y)){v=!0;break}}if(!v)return!1;var g=[],J=o(j.create(this.data,g));return this.setData(F({},u,j.unwrap(J))),n.computedRelatedPathValues[u]=g,!0}.bind(this);n.computedUpdaters.push(h)}.bind(this))}}}),e&&s.push({fields:"**",observer:function(){if(this._computedWatchInfo){var i,r=this._computedWatchInfo[f];if(r)do i=r.computedUpdaters.some(function(n){return n.call(this)}.bind(this));while(i)}}}),a&&Object.keys(a).forEach(function(i){var r=w.parseMultiDataPaths(i);s.push({fields:i,observer:function(){if(this._computedWatchInfo){var n=this._computedWatchInfo[f];if(n){var u=n.watchCurVal[i],o=r.map(function(h){var d=h.path,v=h.options;return{val:w.getDataOnPath(this.data,d),options:v}}.bind(this)),p=o.map(function(h){var d=h.val;return h.options.deepCmp?T(d):d});n.watchCurVal[i]=p;for(var c=!1,l=0;l<p.length;l++)if(r[l].options.deepCmp?!ie.default(u[l],p[l]):u[l]!==p[l]){c=!0;break}c&&a[i].apply(this,o.map(function(h){return h.val}))}}}})}),typeof t.observers!="object"&&(t.observers={}),Array.isArray(t.observers)?($=t.observers).push.apply($,s):s.forEach(function(i){var r=t.observers[i.fields];r?t.observers[i.fields]=function(){i.observer.call(this),r.call(this)}:t.observers[i.fields]=i.observer})}});x.behavior=oe});"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"behavior",{enumerable:!0,get:function(){return O.behavior}}),exports.ComponentWithComputed=se,exports.BehaviorWithComputed=ue;var O=K();function se(t){return Array.isArray(t.behaviors)||(t.behaviors=[]),t.behaviors.unshift(O.behavior),Component(t)}function ue(t){return Array.isArray(t.behaviors)||(t.behaviors=[]),t.behaviors.unshift(O.behavior),Behavior(t)}
...@@ -447,6 +447,38 @@ const deepClone = (target) => { ...@@ -447,6 +447,38 @@ const deepClone = (target) => {
return clone(target) return clone(target)
} }
//设置标题
const setNavigationBarTitle = (title) =>{
wx.getSystemInfo({
success: (res) => {
// console.log('++++++++++++++', res);
// console.log('title length',title.length)
let width = res.safeArea.width / res.fontSizeSetting;
// console.log('width: ', width);
let space = '';
// for (let i = 0; i <= width+4; i++) {
// space = space + ' ';
// }
width = width-(title.length)/2
for (let i = 0; i < width; i++) {
space = space + ' ';
}
if (res.system.includes('iOS') === false) {
wx.setNavigationBarTitle({
title: space + title
});
} else {
wx.setNavigationBarTitle({
title: title
});
}
}
});
}
/** /**
* 判断是否是空对象 * 判断是否是空对象
* @param {*} obj 传进来的对象 * @param {*} obj 传进来的对象
...@@ -507,6 +539,7 @@ const Util = { ...@@ -507,6 +539,7 @@ const Util = {
decimal, decimal,
timeago, timeago,
deepClone, deepClone,
setNavigationBarTitle,
isEmptyObj, isEmptyObj,
parseString, parseString,
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!