Commit a5bc8eba by luyt

feat:调整门店开通

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