Commit a5bc8eba by luyt

feat:调整门店开通

1 parent 191c9a3d
...@@ -4,7 +4,7 @@ const navStyle = "background-color: #fff"; ...@@ -4,7 +4,7 @@ const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/index/constant/data"; import { senceData } from "~/pages/tab/index/constant/data";
import { IMG_URL } from "~/utils/constantData.js"; import { IMG_URL } from "~/utils/constantData.js";
import Draw from "~/utils/Draw.js"; import Draw from "~/utils/Draw.js";
import {createQrCodeApi} from '~/api/checkProduct.js' import { createQrCodeApi } from "~/api/checkProduct.js";
Page({ Page({
/** /**
...@@ -41,7 +41,7 @@ Page({ ...@@ -41,7 +41,7 @@ Page({
posterUrl: "", //海报url posterUrl: "", //海报url
noVideoimgList: [], noVideoimgList: [],
//分享相关 //分享相关
isShare:false, isShare: false,
}, },
observers: { observers: {
actNum: function (actNum) { actNum: function (actNum) {
...@@ -90,11 +90,20 @@ Page({ ...@@ -90,11 +90,20 @@ Page({
onRoute(options) { onRoute(options) {
// console.log("options: ", options); // console.log("options: ", options);
//选中场景的index,和产品的index //选中场景的index,和产品的index
let { actNum, activeNavIdx } = options; let { actNum, activeNavIdx, apiData } = options;
this.setData({ this.setData({
actNum, actNum,
activeNavIdx, activeNavIdx,
apiData,
}); });
let item = apiData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${apiData[actNum].sceneCode}&productCode=${item?.productCode}&productName=${item?.productName}&category=${item?.category}`;
this.shareTrackData = {
sceneCode: apiData[actNum].sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
};
}, },
// 分享按钮 // 分享按钮
handleClick(e) { handleClick(e) {
...@@ -115,10 +124,12 @@ Page({ ...@@ -115,10 +124,12 @@ Page({
}, },
// 下载海报 // 下载海报
async download() { async download() {
let { actNum, activeNavIdx ,imgHeightArr} = this.data; let { actNum, activeNavIdx, imgHeightArr } = this.data;
let res = await createQrCodeApi({ let res = await createQrCodeApi({
actNum, activeNavIdx,isShare:true actNum,
}) activeNavIdx,
isShare: true,
});
// let { actNum, imgHeightArr } = this.data; // let { actNum, imgHeightArr } = this.data;
//所有的长度 //所有的长度
...@@ -160,7 +171,7 @@ Page({ ...@@ -160,7 +171,7 @@ Page({
// }, // },
// ]; // ];
let arr = [456,222,0,496] let arr = [456, 222, 0, 496];
let imgList = [ let imgList = [
{ {
x: 0, x: 0,
...@@ -176,8 +187,8 @@ Page({ ...@@ -176,8 +187,8 @@ Page({
// y: erCodeHeight + 30, // y: erCodeHeight + 30,
// width: 120 * 2, // width: 120 * 2,
// height: 120 * 2, // height: 120 * 2,
x: this.data.imgWidth-64, x: this.data.imgWidth - 64,
y:this.data.imgHeight-arr[actNum]-64, y: this.data.imgHeight - arr[actNum] - 64,
width: 64, width: 64,
height: 64, height: 64,
url: res.data, //二维码 url: res.data, //二维码
...@@ -207,32 +218,50 @@ Page({ ...@@ -207,32 +218,50 @@ Page({
// }, // },
// 图片加载事件 // 图片加载事件
onloadFn(event) { onloadFn(event) {
console.log('event.detail',event.detail) console.log("event.detail", event.detail);
wx.hideLoading() wx.hideLoading();
// this.setData({ // this.setData({
// imgHeight: (event.detail.height * 0.2).toFixed(0), // imgHeight: (event.detail.height * 0.2).toFixed(0),
// }); // });
this.setData({ this.setData({
imgHeight:event.detail.height/5, imgHeight: event.detail.height / 5,
imgWidth:event.detail.width/5 imgWidth: event.detail.width / 5,
}) });
}, },
// 分享获取懂得用户数 // 分享获取懂得用户数
authorizedFn(e){ authorizedFn(e) {
let res = e.detail let res = e.detail;
this.setData({ this.setData({
isShare:res.isShare, isShare: res.isShare,
phone: res.phone, phone: res.phone,
}) });
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载 ()
*/ */
onLoad(options) { onLoad(options) {
// actNum,activeNavIdx isShare // actNum,activeNavIdx isShare
// 扫码进来
let { actNum, activeNavIdx, isShare } = options;
if (isShare) {
this.setData({
isShow: false,
});
} else {
wx.showLoading({ wx.showLoading({
title: "加载图片中", title: "加载图片中",
}); });
}
// 发请求
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${item?.productCode}&productName=${item?.productName}&category=${item?.category}`;
this.shareTrackData = {
sceneCode: senceItem.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
};
}, },
/** /**
...@@ -272,5 +301,6 @@ Page({ ...@@ -272,5 +301,6 @@ Page({
/** /**
* 浏览埋点 * 浏览埋点
*/ */
onViewTrack:true onShareTimeline() {},
onViewTrack: true,
}); });
...@@ -223,10 +223,11 @@ Component({ ...@@ -223,10 +223,11 @@ Component({
onShareFn() { onShareFn() {
// this.triggerEvent('sharehandle') // this.triggerEvent('sharehandle')
// wx.$router.go('apply',1235) // wx.$router.go('apply',1235)
let { actNum, activeNavIdx } = this.data; let { actNum, activeNavIdx ,apiData} = this.data;
wx.$router.go("checkProduct", { wx.$router.go("checkProduct", {
actNum, actNum,
activeNavIdx, activeNavIdx,
apiData
}); });
}, },
}, },
......
...@@ -9,6 +9,7 @@ var senceData = [ ...@@ -9,6 +9,7 @@ var senceData = [
src: `${IMG_URL}index/car1.png`, src: `${IMG_URL}index/car1.png`,
// name: "新车洽谈场景", // name: "新车洽谈场景",
msg: "1.0 新车权益销售", msg: "1.0 新车权益销售",
"sceneCode":"SC001",
productList: [ productList: [
{ {
img: 'product-img1', img: 'product-img1',
...@@ -20,7 +21,10 @@ var senceData = [ ...@@ -20,7 +21,10 @@ var senceData = [
productType: 'benefitCard', productType: 'benefitCard',
path: 'equity', path: 'equity',
sale:100 ,//销量 sale:100 ,//销量
varType: 0 varType: 0,
"productCode":"PC001",
"productName":"数字无忧权益卡",
"category":"服务类",
} }
], ],
videoList: [ videoList: [
...@@ -54,6 +58,7 @@ var senceData = [ ...@@ -54,6 +58,7 @@ var senceData = [
src: `${IMG_URL}index/car2.png`, src: `${IMG_URL}index/car2.png`,
// name: "新车交付场景", // name: "新车交付场景",
msg: "1.1 新车精品升级", msg: "1.1 新车精品升级",
"sceneCode":"SC002",
productList: [ productList: [
{ {
img: 'product-img2', img: 'product-img2',
...@@ -64,7 +69,10 @@ var senceData = [ ...@@ -64,7 +69,10 @@ var senceData = [
productType: 'sunMembrane', productType: 'sunMembrane',
path: 'solarFilm', path: 'solarFilm',
sale:100, //销量 sale:100, //销量
varType: 0 varType: 0,
"productCode":"PC002",
"productName":"汽车太阳膜",
"category":"膜类",
} }
], ],
videoList:[ videoList:[
...@@ -83,6 +91,7 @@ var senceData = [ ...@@ -83,6 +91,7 @@ var senceData = [
src: `${IMG_URL}index/car3.png`, src: `${IMG_URL}index/car3.png`,
// name: "0-12个月", // name: "0-12个月",
msg: "1.2 新车线上转化", msg: "1.2 新车线上转化",
"sceneCode":"SC003",
productList: [ productList: [
{ {
img: 'product-img3', img: 'product-img3',
...@@ -93,7 +102,10 @@ var senceData = [ ...@@ -93,7 +102,10 @@ var senceData = [
productType: 'protectMembrane', productType: 'protectMembrane',
path: 'paintProtect', path: 'paintProtect',
sale:100, //销量 sale:100, //销量
varType: 1 varType: 1,
"productCode":"PC003",
"productName":"漆面保护膜(车衣)",
"category":"膜类",
}, },
{ {
img: 'product-img4', img: 'product-img4',
...@@ -104,7 +116,10 @@ var senceData = [ ...@@ -104,7 +116,10 @@ var senceData = [
productType: 'colorMembrane', productType: 'colorMembrane',
path: 'changingFilm', path: 'changingFilm',
sale:100, //销量 sale:100, //销量
varType: 1 varType: 1,
"productCode":"PC004",
"productName":"改色膜",
"category":"膜类",
} }
] ]
}, },
...@@ -116,6 +131,7 @@ var senceData = [ ...@@ -116,6 +131,7 @@ var senceData = [
src: `${IMG_URL}index/car4.png`, src: `${IMG_URL}index/car4.png`,
// name: "12个月以上", // name: "12个月以上",
msg: "1.3 存量用户众筹", msg: "1.3 存量用户众筹",
"sceneCode":"SC004",
productList: [ productList: [
{ {
img: 'product-img5', img: 'product-img5',
...@@ -126,7 +142,10 @@ var senceData = [ ...@@ -126,7 +142,10 @@ var senceData = [
productType: 'digitBeauty', productType: 'digitBeauty',
path: 'carBeauty', path: 'carBeauty',
sale:100, //销量 sale:100, //销量
varType: 0 varType: 0,
"productCode":"PC005",
"productName":"数字化美容",
"category":"美容类",
}, },
{ {
img: 'product-img6', img: 'product-img6',
...@@ -137,7 +156,10 @@ var senceData = [ ...@@ -137,7 +156,10 @@ var senceData = [
productType: 'chair', productType: 'chair',
path: 'seatVentilate', path: 'seatVentilate',
sale:10000, //销量 sale:10000, //销量
varType: 1 varType: 1,
"productCode":"PC006",
"productName":"座椅通风",
"category":"轻改类",
}, },
{ {
img: 'product-img7', img: 'product-img7',
...@@ -148,7 +170,10 @@ var senceData = [ ...@@ -148,7 +170,10 @@ var senceData = [
productType: 'ar', productType: 'ar',
path: 'arNavigation', path: 'arNavigation',
sale:10000, //销量 sale:10000, //销量
varType: 1 varType: 1,
"productCode":"PC007",
"productName":"AR导航",
"category":"轻改类",
}, },
{ {
img: 'product-img8', img: 'product-img8',
...@@ -159,7 +184,10 @@ var senceData = [ ...@@ -159,7 +184,10 @@ var senceData = [
productType: 'lamp', productType: 'lamp',
path: 'ambientLighting', path: 'ambientLighting',
sale:10000, //销量 sale:10000, //销量
varType: 1 varType: 1,
"productCode":"PC008",
"productName":"氛围灯",
"category":"轻改类",
}, },
{ {
img: 'product-img9', img: 'product-img9',
...@@ -170,7 +198,10 @@ var senceData = [ ...@@ -170,7 +198,10 @@ var senceData = [
productType: 'navigation', productType: 'navigation',
path: 'navigationArround', path: 'navigationArround',
sale:10000, //销量 sale:10000, //销量
varType: 1 varType: 1,
"productCode":"PC009",
"productName":"360全景导航",
"category":"轻改类",
} }
], ],
videoList: [ videoList: [
......
...@@ -233,8 +233,10 @@ Page({ ...@@ -233,8 +233,10 @@ Page({
} }
}, },
gotoApply(e) { gotoApply(e) {
let { type } = e.currentTarget.dataset;
if (type == "active") {
let { userInfo } = wx.$storage.get(); let { userInfo } = wx.$storage.get();
let pMerchantName = userInfo.subLoginUser.merchantName let pMerchantName = userInfo.subLoginUser.merchantName;
let pMerchantId = userInfo.subLoginUser.merchantId; let pMerchantId = userInfo.subLoginUser.merchantId;
let sceneActive; let sceneActive;
switch (this.data.actNum) { switch (this.data.actNum) {
...@@ -253,7 +255,7 @@ Page({ ...@@ -253,7 +255,7 @@ Page({
} }
// let pMerchantId = userInfo.subLoginUser.merchantId // let pMerchantId = userInfo.subLoginUser.merchantId
let { type, item } = e.currentTarget.dataset; let { item } = e.currentTarget.dataset;
// console.log("type,item: ", type, item); // console.log("type,item: ", type, item);
const params = { const params = {
merchantInfo: { merchantInfo: {
...@@ -265,7 +267,6 @@ Page({ ...@@ -265,7 +267,6 @@ Page({
sceneActive, sceneActive,
// sceneCodeList: ['SC001', 'SC002','SC003','SC004'] // sceneCodeList: ['SC001', 'SC002','SC003','SC004']
}; };
if (type == "active") {
//申请活动 //申请活动
wx.$router.go("packageOutput.openBusiness", params); wx.$router.go("packageOutput.openBusiness", params);
} else { } else {
...@@ -490,14 +491,13 @@ Page({ ...@@ -490,14 +491,13 @@ Page({
// 看线索 // 看线索
this.getClueInit(); this.getClueInit();
//第一次进来储缓存,以后不再用引导图 //第一次进来储缓存,以后不再用引导图
let firstLogin = wx.$storage.get("firstLogin") let firstLogin = wx.$storage.get("firstLogin");
if(!firstLogin){ if (!firstLogin) {
this.setData({ this.setData({
guideShow:true guideShow: true,
}) });
wx.$storage.set("firstLogin", 'firstLogin'); wx.$storage.set("firstLogin", "firstLogin");
} }
}, },
//接口数据,本地数据对接 //接口数据,本地数据对接
compositionData(localData, apiData) { compositionData(localData, apiData) {
......
...@@ -323,7 +323,7 @@ page { ...@@ -323,7 +323,7 @@ page {
top: 70%; top: 70%;
width: 40px; width: 40px;
height: 50px; height: 50px;
border-radius: 50%; // border-radius: 50%;
z-index: 1; z-index: 1;
} }
/* 测算弹窗 */ /* 测算弹窗 */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')"> <view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')">
<view class="header"> <view class="header">
<tab tab="{{navList}}" itemWidth="{{'35%'}}" index="{{tabIndx}}" unreadClueCount="{{unreadClueCount}}" bindclick="changeTabIndx" class="tabContainer" /> <tab tab="{{navList}}" itemWidth="{{'35%'}}" index="{{tabIndx}}" unreadClueCount="{{unreadClueCount}}" bindclick="changeTabIndx" class="tabContainer" />
<view class="right" bindtap="gotoApply"> <view class="right" data-type="shop" bindtap="gotoApply">
<image class="img" src="{{IMG_URL}}index/apply.png" /> <image class="img" src="{{IMG_URL}}index/apply.png" />
<view class="apply">申请业务</view> <view class="apply">申请业务</view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!