Commit bdc33e69 by 前端

申请活动

1 parent c314a6d9
// components/CooperationApply/CooperationApply.js
import WxValidate from "../../utils/WxValidate"
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
tabData: [{
name: '门店合作申请',
value: 0
},
{
name: '代理商合作申请',
value: 1
}
],
tabIndex: 0,
applyForm: {
merchantName: '',
carModel: '',
contactName: '',
contactPhone: ''
},
},
/**
* 组件的方法列表
*/
methods: {
selectTab(e) {
console.log(e.currentTarget.dataset.index);
this.setData({
tabIndex: e.currentTarget.dataset.index
})
},
// 表单验证规则
initValidate() {
console.log(123123);
const rules = {
merchantName: {
required: true
},
contactName: {
required: true
},
contactPhone: {
required: true,
tel: true
}
}
const messages = {
merchantName: {
required: '请填写门店名称',
},
contactName: {
required: '请填写联系人'
},
contactPhone: {
required: '请填写手机号'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = e.detail.value
const form = `applyForm.${name}`
this.setData({
[form]: val
})
},
// 校验表单
validateForm() {
let params = this.data.applyForm
// 校验表单
if (!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
wx.hideLoading()
return false
} else {
return [params, this.data.tabIndex]
}
}
},
// 组件页面生周期
lifetimes: {
created: function () {
// 在组件实例刚刚被创建时执行
// 初始化验证规则函数
console.log('created');
this.initValidate()
},
}
})
\ 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/CooperationApply/CooperationApply.wxml-->
<view>
<view class="tab-top">
<view wx:for="{{tabData}}" class="tab-title {{item.value == tabIndex ? 'tab-title-active' : ''}}" bindtap="selectTab" data-index="{{item.value}}">{{item.name}}</view>
</view>
<form>
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">门店名称<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '主营品牌' : '合作品牌'}}</text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入主营车型' value="{{applyForm.carModel}}" bindinput="handleInput" data-name="carModel" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系人<text class="require"> *</text></text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">手机号<text class="require"> *</text></text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
</view>
</view>
</form>
</view>
/* components/CooperationApply/CooperationApply.wxss */
.tab-top {
display: flex;
justify-content: space-around;
height: 110rpx;
}
.tab-title {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32rpx;
color: #323436;
text-align: center;
line-height: 110rpx;
}
.tab-title-active {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 32rpx;
color: #323436;
line-height: 110rpx;
position: relative;
}
.tab-title-active::after {
content: '';
width: 80rpx;
height: 6rpx;
position: absolute;
bottom: 5rpx;
left: 50%;
transform: translateX(-50%);
background: #5850FF;
border-radius: 8rpx 8rpx 0 0;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
/* background: #fff; */
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
\ No newline at end of file \ No newline at end of file
import util from '../utils/util'
module.exports = Behavior({ module.exports = Behavior({
methods:{ methods: {
shareTrack() { shareTrack(name, type) {
console.log(77777); let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
} let pathName = `pages/productDetail/${type}/${type}?cardId=`+util.getStorageSync('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName`
return {
title: trackData[name].pageName,
path: pathName
}
}
} }
}) })
\ No newline at end of file \ No newline at end of file
// pages/activityApplication/activityApplication.js // pages/activityApplication/activityApplication.js
import { // import { trackData } from "../../utils/data";
trackData import { entmicroApi } from "../../api/api";
} from "../../utils/data";
import WxValidate from "../../utils/WxValidate"
import {
entmicroApi
} from "../../api/api";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
productTabList: [{ productTabList: [
id: '0', {
name: 'scene1', id: "0",
title: '新车洽谈场景', name: "scene1",
type: '1.0 新车权益销售', title: "新车洽谈场景",
url: 'car4' type: "1.0 新车权益销售",
url: "car4",
}, },
{ {
id: '1', id: "1",
name: 'scene2', name: "scene2",
title: '新车交付场景', title: "新车交付场景",
type: '1.1 新车精品升级', type: "1.1 新车精品升级",
url: 'car1' url: "car1",
}, },
{ {
id: '2', id: "2",
name: 'scene3', name: "scene3",
title: '0-12个月', title: "0-12个月",
type: '1.2 新车线上转化', type: "1.2 新车线上转化",
url: 'car2' url: "car2",
}, },
{ {
id: '3', id: "3",
name: 'scene4', name: "scene4",
title: '12个月以上', title: "12个月以上",
type: '1.3 存量用户众筹', type: "1.3 存量用户众筹",
url: 'car3' url: "car3",
} },
], ],
productList: { productList: {
scene1: [{ scene1: [
name: 'equity', {
url: 'digital_icon', name: "equity",
nameZh: '数字无忧权益卡', url: "digital_icon",
isSelect: false nameZh: "数字无忧权益卡",
}], isSelect: false,
scene2: [{
name: 'solarFilm',
url: 'solar_icon',
nameZh: '汽车太阳膜',
isSelect: false
}],
scene3: [{
name: 'paintProtect',
url: 'protect_icon',
nameZh: '漆面保护膜',
isSelect: false
}, },
{ {
name: 'changingFilm', nameZh: "其他",
url: 'change_icon', isSelect: false,
nameZh: '改色膜',
isSelect: false
} }
], ],
scene4: [{ scene2: [
name: 'carBeauty',
url: 'beauty_icon',
nameZh: '数字化美容',
isSelect: false
},
{ {
name: 'seatVentilate', name: "solarFilm",
url: 'seat_icon', url: "solar_icon",
nameZh: '座椅通风', nameZh: "汽车太阳膜",
isSelect: false isSelect: false,
}, },
{ {
name: 'arNavigation', nameZh: "其他",
url: 'ar_icon', isSelect: false,
nameZh: 'AR实景导航', }
isSelect: false ],
scene3: [
{
name: "paintProtect",
url: "protect_icon",
nameZh: "漆面保护膜",
isSelect: false,
}, },
{ {
name: 'ambientLighting', name: "changingFilm",
url: 'light_icon', url: "change_icon",
nameZh: '氛围灯', nameZh: "改色膜",
isSelect: false isSelect: false,
}, },
{ {
name: 'navigationArround', nameZh: "其他",
url: 'arround_icon', isSelect: false,
nameZh: '360全景导航',
isSelect: false
} }
] ],
}, scene4: [
selectItemIndex: 0, {
selectItemName: 'scene1', name: "carBeauty",
applyForm: { url: "beauty_icon",
merchantName: '', nameZh: "数字化美容",
carModel: '', isSelect: false,
contactName: '',
contactPhone: ''
},
foldFlag: false,
sceneNum: '',
sceneName: ''
}, },
{
// 表单验证规则 name: "seatVentilate",
initValidate() { url: "seat_icon",
const rules = { nameZh: "座椅通风",
merchantName: { isSelect: false,
required: true
}, },
contactName: { {
required: true name: "arNavigation",
url: "ar_icon",
nameZh: "AR实景导航",
isSelect: false,
}, },
contactPhone: { {
required: true, name: "ambientLighting",
tel: true url: "light_icon",
} nameZh: "氛围灯",
} isSelect: false,
const messages = {
merchantName: {
required: '请填写门店名称',
}, },
contactName: { {
required: '请填写联系人' name: "navigationArround",
url: "arround_icon",
nameZh: "360全景导航",
isSelect: false,
}, },
contactPhone: { {
required: '请填写手机号' nameZh: "其他",
} isSelect: false,
} }
this.WxValidate = new WxValidate(rules, messages) ],
}, },
selectItemIndex: 0,
//报错 selectItemName: "scene1",
showModal(error) { // applyForm: {
wx.showModal({ // merchantName: '',
content: error.msg, // carModel: '',
showCancel: false, // contactName: '',
}) // contactPhone: ''
// },
foldFlag: false,
sceneNum: "",
sceneName: "",
sceneTip: {
scene1: "合作门店数2200+,单店年增量产值100万+",
scene2: "合作门店数300+,单店年增量产值60万+",
scene3: "正在直播中,目前有17万+用户正在观看",
scene4: "本月活动进行中100+门店,预估产值1000万+",
}, },
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = e.detail.value
const form = `applyForm.${name}`
this.setData({
[form]: val
})
}, },
// 提交表单 // 提交表单
submitApply() { submitApply() {
wx.$util.showLoading('提交中...') wx.$util.showLoading("提交中...");
let params = this.data.applyForm let validFlag = this.selectComponent("#applyForm").validateForm();
// 校验表单 if (!validFlag[0]) return;
if (!this.WxValidate.checkForm(params)) { let params = JSON.parse(JSON.stringify(validFlag[0]));
const error = this.WxValidate.errorList[0] let applyType = validFlag[1];
this.showModal(error) // 区分代理商和门店
wx.hideLoading() params.merchantName =
return false applyType == 0
} ? params.merchantName + "(活动-门店)"
: params.merchantName + "(活动-代理商)";
// 如果选择了业务场景 // 如果选择了业务场景
if (this.data.sceneName) { if (this.data.sceneName) {
let selectFlag = 0 let selectFlag = 0;
let productItems = [] let productItems = [];
this.data.productList[this.data.sceneName].forEach(item => { this.data.productList[this.data.sceneName].forEach((item) => {
if (item.isSelect) { if (item.isSelect) {
selectFlag = selectFlag + 1 selectFlag = selectFlag + 1;
productItems.push(item.nameZh) productItems.push(item.nameZh);
} }
}) });
if (!selectFlag) { if (!selectFlag) {
wx.showModal({ wx.showModal({
content: '请至少选择一个产品', content: "请至少选择一个产品",
showCancel: false, showCancel: false,
}) });
return wx.hideLoading();
return;
} }
let businessItem = this.data.productTabList.find(item => { let businessItem = this.data.productTabList.find((item) => {
return item.id == this.data.sceneNum return item.id == this.data.sceneNum;
}) });
params.businessScenario = businessItem.title params.businessScenario = businessItem.title;
params.productItems = productItems.join(',') params.productItems = productItems.join(",");
} }
params.cardId = wx.$util.getStorageSync("scene").cardId params.cardId = wx.$util.getStorageSync("scene").cardId;
params.merchant = wx.$util.getStorageSync("scene").merchant params.merchant = wx.$util.getStorageSync("scene").merchant;
params.openId = wx.$util.getStorageSync('aicard_info').openId params.openId = wx.$util.getStorageSync("aicard_info").openId;
params.unionId = wx.$util.getStorageSync('aicard_info').unionId params.unionId = wx.$util.getStorageSync("aicard_info").unionId;
entmicroApi.activityApply(params).then(({ console.log(params);
data, entmicroApi.activityApply(params).then(({ data, code, message }) => {
code,
message
}) => {
if (code == 0) { if (code == 0) {
wx.hideLoading() wx.hideLoading();
wx.showToast({ wx.showToast({
msg: '提交成功' msg: "提交成功",
}) });
wx.$router.go("applySuccess"); wx.$router.go("applySuccess");
} else { } else {
wx.hideLoading() wx.hideLoading();
wx.showModal({ wx.showModal({
content: message, content: message,
showCancel: false, showCancel: false,
}) });
} }
}) });
}, },
// 选择活动tab // 选择活动tab
selectProduct(e) { selectProduct(e) {
this.setData({ this.setData({
selectItemIndex: e.currentTarget.dataset.item.id, selectItemIndex: e.currentTarget.dataset.item.id,
selectItemName: e.currentTarget.dataset.item.name selectItemName: e.currentTarget.dataset.item.name,
}) });
}, },
// 跳转产品详情页 // 跳转产品详情页
...@@ -233,36 +209,38 @@ Page({ ...@@ -233,36 +209,38 @@ Page({
// 展开收起 // 展开收起
handleFold() { handleFold() {
this.setData({ this.setData({
foldFlag: !this.data.foldFlag foldFlag: !this.data.foldFlag,
}) });
}, },
// 选择业务场景 // 选择业务场景
selectScene(e) { selectScene(e) {
// 遍历之前业务场景下产品是否已选择,选择了的话取消选中 // 遍历之前业务场景下产品是否已选择,选择了的话取消选中
if (this.data.sceneName) { if (this.data.sceneName) {
let newProductList let newProductList;
newProductList = this.data.productList[this.data.sceneName].map(item => { newProductList = this.data.productList[this.data.sceneName].map(
if (item.isSelect) item.isSelect = false (item) => {
return item if (item.isSelect) item.isSelect = false;
}) return item;
let selectList = `productList.${this.data.sceneName}` }
);
let selectList = `productList.${this.data.sceneName}`;
this.setData({ this.setData({
[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,
}) });
}, },
// 选择业务场景产品 // 选择业务场景产品
selectScenePro(e) { selectScenePro(e) {
var index = e.currentTarget.dataset.index; var index = e.currentTarget.dataset.index;
var item = this.data.productList[this.data.sceneName][index]; var item = this.data.productList[this.data.sceneName][index];
item.isSelect = !item.isSelect item.isSelect = !item.isSelect;
this.setData({ this.setData({
productList: this.data.productList, productList: this.data.productList,
}); });
...@@ -273,71 +251,57 @@ Page({ ...@@ -273,71 +251,57 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
// 初始化验证规则函数 // 初始化验证规则函数
this.initValidate() this.initValidate();
// 禁用分享转发 // 禁用分享转发
wx.hideShareMenu({ wx.hideShareMenu({
menus: ['shareAppMessage', 'shareTimeline'] menus: ["shareAppMessage", "shareTimeline"],
}) });
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync() // const options = wx.getEnterOptionsSync();
if (options.query.cardId) { // if (options.query.cardId) {
wx.$trackData = options.query // wx.$trackData = options.query;
} // }
getApp() // getApp()
.login() // .login()
.then(({ // .then(({ data }) => {
data // if (!wx.$trackData.detailShare) {
}) => { // wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION);
if (!wx.$trackData.detailShare) { // }
wx.$Track.sendTrack(trackData.ACTIVITYAPPLICATION); // });
}
});
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
onShareAppMessage() {},
});
{ {
"usingComponents": {}, "usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply"
},
"navigationBarTitleText": "活动申请" "navigationBarTitleText": "活动申请"
} }
<!--pages/activityApplication/activityApplication.wxml--> <!-- pages/activityApplication/activityApplication.wxml -->
<view class="apply-content"> <view class="apply-content">
<image class="apply-background" mode="widthFix" webp src="{{IMGURL}}application/application_top.png?v={{img_version}}"></image> <image class="apply-background" mode="widthFix" webp src="{{IMGURL}}application/application_top.png?v={{img_version}}"></image>
<view class="box-background"> <view class="box-background">
...@@ -7,50 +7,34 @@ ...@@ -7,50 +7,34 @@
<!-- tab栏 --> <!-- tab栏 -->
<block wx:for="{{productTabList}}"> <block wx:for="{{productTabList}}">
<view class="product-item {{item.id == selectItemIndex ? 'product-item-active' : ''}}" bindtap="selectProduct" data-item="{{item}}"> <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-title {{item.id == selectItemIndex ? 'product-item-title-active' : ''}}">
<view class="product-item-type {{item.id == selectItemIndex ? 'product-item-type-active' : ''}}">{{item.type}}</view> {{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 wx:if="{{item.id == selectItemIndex}}" class="selected-item">
<view class="selected-item-top"></view> <view class="selected-item-top"></view>
<view class="selected-item-bottom"></view> <view class="selected-item-bottom"></view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<!-- 产品展示 --> <!-- 产品展示 -->
<view class="product-box"> <view class="product-box">
<view class="product-tip">
<image class="tip-icon" mode="widthFix" webp src="{{IMGURL}}application/tip_icon.png?v={{img_version}}"></image>
<text class="tip-text">{{sceneTip[selectItemName]}}</text>
</view>
<block wx:for="{{productList[selectItemName]}}"> <block wx:for="{{productList[selectItemName]}}">
<image class="product-img" mode="widthFix" webp src="{{IMGURL}}application/{{item.url}}.png?v={{img_version}}" bindtap="goPage" data-item="{{item.name}}"></image> <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.name}}"></image>
</block> </block>
</view> </view>
</view> </view>
<!-- 申请表单 --> <!-- 申请表单 -->
<view class="apply-box"> <view class="apply-box">
<view class="apply-top"> <!-- 表单 -->
<view class="apply-top-icon"></view> <apply-content id="applyForm"></apply-content>
<view class="apply-top-title">申请信息</view>
</view>
<form>
<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="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName"></input>
</view>
<view class='info-list'>
<text class="info-lable">主营车型</text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入主营车型' value="{{applyForm.carModel}}" bindinput="handleInput" data-name="carModel"></input>
</view>
<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="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName"></input>
</view>
<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="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
</view>
</view>
</form>
<!-- 展开收起 --> <!-- 展开收起 -->
<view class="apply-fold" bindtap="handleFold"> <view class="apply-fold" bindtap="handleFold">
<text wx:if="{{!foldFlag}}">选择业务场景</text> <text wx:if="{{!foldFlag}}">选择业务场景</text>
...@@ -65,14 +49,21 @@ ...@@ -65,14 +49,21 @@
<view wx:for="{{productTabList}}" class="item-wrap {{item.id == sceneNum ? 'act':''}}" bindtap="selectScene" data-item="{{item}}"> <view wx:for="{{productTabList}}" class="item-wrap {{item.id == sceneNum ? 'act':''}}" bindtap="selectScene" data-item="{{item}}">
<view class="fold-scene-item {{item.id == sceneNum ? 'fold-scene-item-active':''}}"> <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> <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-title {{item.id == sceneNum ? 'product-item-title-active':''}}">
<view class="product-item-type {{item.id == sceneNum ? 'product-item-type-active':''}}">{{item.type}}</view> {{item.title}}
</view>
<view class="product-item-type {{item.id == sceneNum ? 'product-item-type-active':''}}">
{{item.type}}
</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 选择产品 --> <!-- 选择产品 -->
<block wx:if="{{sceneNum}}"> <block wx:if="{{sceneNum}}">
<view><text class="fold-title">选择产品</text><text class="fold-tip">(可多选)</text></view> <view>
<text class="fold-title">选择产品</text>
<text class="fold-tip">(可多选)</text>
</view>
<view class="fold-product"> <view class="fold-product">
<block wx:for="{{productList[sceneName]}}"> <block wx:for="{{productList[sceneName]}}">
<view class="item {{item.isSelect ? 'item-selected': ''}}" bindtap="selectScenePro" data-index="{{index}}"> <view class="item {{item.isSelect ? 'item-selected': ''}}" bindtap="selectScenePro" data-index="{{index}}">
...@@ -85,7 +76,6 @@ ...@@ -85,7 +76,6 @@
</block> </block>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<button class="submit-btn" bindtap="submitApply"> <button class="submit-btn" bindtap="submitApply">提交申请</button>
提交申请 </view>
</button></view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
height: 216rpx; height: 216rpx;
margin-right: 16rpx; margin-right: 16rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
box-shadow: 0 6rpx 24rpx 0 rgba(175,181,219,0.40); box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.40);
} }
.product-img:nth-child(3n) { .product-img:nth-child(3n) {
...@@ -104,10 +104,32 @@ ...@@ -104,10 +104,32 @@
} }
.product-box { .product-box {
margin: 36rpx 0 63rpx 0; margin: 36rpx 0 56rpx 0;
padding: 0 26rpx; padding: 0 26rpx;
} }
.product-tip {
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 { .apply-box {
width: 702rpx; width: 702rpx;
/* height: 680rpx; */ /* height: 680rpx; */
...@@ -121,51 +143,6 @@ ...@@ -121,51 +143,6 @@
left: 24rpx; */ left: 24rpx; */
} }
.apply-top {
display: flex;
padding: 32rpx;
}
.apply-top-icon {
width: 10rpx;
height: 38rpx;
background: #5850FF;
border-radius: 0 8rpx 8rpx 0;
margin-right: 18rpx;
margin-top: 2rpx;
}
.apply-top-title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32rpx;
color: #323436;
}
.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;
}
.submit-btn { .submit-btn {
width: 622rpx; width: 622rpx;
height: 80rpx; height: 80rpx;
......
// pages/newEnergy/newEnergy.js // pages/newEnergy/newEnergy.js
import { trackData } from "../../utils/data"; // import {
import util from "../../utils/util"; // trackData
// } from "../../utils/data";
import {
entmicroApi
} from "../../api/api"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
applyShow: false
}, },
toSuccess() { toSuccess() {
wx.$router.go("applySuccess"); wx.$router.go("applySuccess");
}, },
// 展开申请
toApply() {
this.setData({
applyShow: !this.data.applyShow
})
},
// 提交申请
submitApply() {
wx.$util.showLoading('提交中...')
let validFlag = this.selectComponent('#applyForm').validateForm()
if (!validFlag[0]) return
let params = JSON.parse(JSON.stringify(validFlag[0]))
let applyType = validFlag[1]
// 区分代理商和门店
params.merchantName = applyType == 0 ? params.merchantName + '(新能源-门店)' : params.merchantName + '(新能源-代理商)'
params.cardId = wx.$util.getStorageSync("scene").cardId
params.merchant = wx.$util.getStorageSync("scene").merchant
params.openId = wx.$util.getStorageSync('aicard_info').openId
params.unionId = wx.$util.getStorageSync('aicard_info').unionId
console.log(params);
entmicroApi.activityApply(params).then(({
data,
code,
message
}) => {
if (code == 0) {
wx.hideLoading()
wx.showToast({
msg: '提交成功'
})
wx.$router.go("applySuccess");
} else {
wx.hideLoading()
wx.showModal({
content: message,
showCancel: false,
})
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -34,17 +78,19 @@ Page({ ...@@ -34,17 +78,19 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync() // const options = wx.getEnterOptionsSync()
if (options.query.cardId) { // if (options.query.cardId) {
wx.$trackData = options.query // wx.$trackData = options.query
} // }
getApp() // getApp()
.login() // .login()
.then(({ data }) => { // .then(({
if (!wx.$trackData.detailShare) { // data
wx.$Track.sendTrack(trackData.NEWENERGY); // }) => {
} // if (!wx.$trackData.detailShare) {
}); // wx.$Track.sendTrack(trackData.NEWENERGY);
// }
// });
}, },
/** /**
...@@ -78,6 +124,5 @@ Page({ ...@@ -78,6 +124,5 @@ Page({
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {}
}
}) })
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"apply-content": "../../components/CooperationApply/CooperationApply"
},
"navigationBarTitleText": "数字化+新能源汽车" "navigationBarTitleText": "数字化+新能源汽车"
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,5 +3,14 @@ ...@@ -3,5 +3,14 @@
<image class="newenergy-img newenergy-img1" mode="widthFix" webp src="{{IMGURL}}home/newenergy1.png?v={{img_version}}"></image> <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-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> <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>
<!-- <button bindtap="toSuccess">提交</button> -->
\ No newline at end of file \ No newline at end of file
<view class="btn-box" wx:if="{{!applyShow}}">
<button class="btn-apply" bindtap="toApply">合作申请</button></view>
\ No newline at end of file \ No newline at end of file
/* pages/newEnergy/newEnergy.wxss */ /* pages/newEnergy/newEnergy.wxss */
.wrapper-bg { .wrapper-bg {
background-color: #505CFF; background-color: #505CFF;
padding-bottom: 74rpx; padding-bottom: 110rpx;
} }
.newenergy-img { .newenergy-img {
width: 100%; width: 100%;
...@@ -16,3 +16,44 @@ ...@@ -16,3 +16,44 @@
.newenergy-img3 { .newenergy-img3 {
height: 1092rpx; height: 1092rpx;
} }
.btn-box {
position: fixed;
bottom: 0;
width: 100%;
height: 112rpx;
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: 24rpx 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
// pages/productDetail/ambientLighting/ambientLighting.js // pages/productDetail/ambientLighting/ambientLighting.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
import shareTrackMixin from "../../../mixins/index";
Page({ Page({
behavior: [shareTrackMixin], behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -29,8 +28,6 @@ Page({ ...@@ -29,8 +28,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
console.log(333);
this.shareTrack()
const options = wx.getEnterOptionsSync() const options = wx.getEnterOptionsSync()
if (options.query.cardId) { if (options.query.cardId) {
wx.$trackData = options.query wx.$trackData = options.query
...@@ -76,10 +73,11 @@ console.log(333); ...@@ -76,10 +73,11 @@ console.log(333);
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('LIGHT', 'ambientLighting')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.LIGHT.pageName, // return {
path: 'pages/productDetail/ambientLighting/ambientLighting?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.LIGHT.pageName // 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
// pages/productDetail/arNavigation/arNavigation.js // pages/productDetail/arNavigation/arNavigation.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('ARNAVIGATION', 'arNavigation')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.ARNAVIGATION.pageName, // return {
path: 'pages/productDetail/arNavigation/arNavigation?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.ARNAVIGATION.pageName // 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
// pages/productDetail/carBeauty/carBeauty.js // pages/productDetail/carBeauty/carBeauty.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from "../../../utils/util"; import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -58,12 +59,13 @@ Page({ ...@@ -58,12 +59,13 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('CARBEAUTY', 'carBeauty')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.CARBEAUTY.pageName, // return {
path: // title: trackData.CARBEAUTY.pageName,
"pages/productDetail/carBeauty/carBeauty?cardId=" + // path:
util.getStorageSync("scene").cardId+"&merchant="+merchant+'&detailShare=' +trackData.CARBEAUTY.pageName // "pages/productDetail/carBeauty/carBeauty?cardId=" +
}; // util.getStorageSync("scene").cardId+"&merchant="+merchant+'&detailShare=' +trackData.CARBEAUTY.pageName
// };
}, },
}); });
// pages/productDetail/changingFilm/changingFilm.js // pages/productDetail/changingFilm/changingFilm.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('CHANGEFILM', 'changingFilm')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.CHANGEFILM.pageName, // return {
path: 'pages/productDetail/changingFilm/changingFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.CHANGEFILM.pageName // 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
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import { import {
trackData trackData
} from "../../../utils/data"; } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -76,10 +76,11 @@ Page({ ...@@ -76,10 +76,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('EQUITYCARD', 'equity')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.EQUITYCARD.pageName, // return {
path: 'pages/productDetail/equity/equity?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.EQUITYCARD.pageName // 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
// pages/productDetail/lossPhase/lossPhase.js // pages/productDetail/lossPhase/lossPhase.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('LOSSPGASE', 'lossPhase')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.LOSSPGASE.pageName, // return {
path: 'pages/productDetail/lossPhase/lossPhase?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.LOSSPGASE.pageName // 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
// pages/productDetail/navigationArround/navigationArround.js // pages/productDetail/navigationArround/navigationArround.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('NAVIGATIONARROUND', 'navigationArround')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.NAVIGATIONARROUND.pageName, // return {
path: 'pages/productDetail/navigationArround/navigationArround?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.NAVIGATIONARROUND.pageName // 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
// pages/productDetail/paintProtect/paintProtect.js // pages/productDetail/paintProtect/paintProtect.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('PAINTPROTECT', 'paintProtect')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.PAINTPROTECT.pageName, // return {
path: 'pages/productDetail/paintProtect/paintProtect?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.PAINTPROTECT.pageName // 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
// pages/productDetail/seatVentilate/seatVentilate.js // pages/productDetail/seatVentilate/seatVentilate.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -73,10 +73,11 @@ Page({ ...@@ -73,10 +73,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('SEATVENTILATE', 'seatVentilate')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.SEATVENTILATE.pageName, // return {
path: 'pages/productDetail/seatVentilate/seatVentilate?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.SEATVENTILATE.pageName // 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
// pages/productDetail/solarFilm/solarFilm.js // pages/productDetail/solarFilm/solarFilm.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util' import {shareTrackMixin} from "../../../mixins/index";
Page({ Page({
behaviors: [shareTrackMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -75,10 +75,11 @@ Page({ ...@@ -75,10 +75,11 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId this.shareTrack('SOLARFILM', 'solarFilm')
return { // let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
title: trackData.SOLARFILM.pageName, // return {
path: 'pages/productDetail/solarFilm/solarFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+merchant+'&detailShare=' +trackData.SOLARFILM.pageName // 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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!