Commit 394a95fb by 张立顺

Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop

2 parents 5587dda0 0ff35766
......@@ -99,9 +99,38 @@ Component({
handleCopy(e) {
var { idx } = e.currentTarget.dataset
var currentItem = this.data.orderObj.activityList[idx]
console.log(currentItem)
// console.log(wxqrcode)
wxqrcode.createQrCodeImg(currentItem.activityUrl)
var qr = wxqrcode.createQrCodeImg(currentItem.activityUrl)
const base64src = function (base64data) {
return new Promise((resolve, reject) => {
const [a, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || []
if (!format) reject(new Error('ERROR_BASE64SRC_PARSE'))
const filePath = `${wx.env.USER_DATA_PATH}/tmp_base64src.${format}`
const buffer = wx.base64ToArrayBuffer(bodyData)
wx.getFileSystemManager().writeFile({
filePath,
data: buffer,
encoding: 'binary',
success() {
resolve(filePath)
},
fail() {
reject(new Error('ERROR_BASE64SRC_WRITE'))
}
})
})
}
base64src(qr).then(res => {
wx.getImageInfo({
src: res,
success(obj) {
wx.showShareImageMenu({
path: obj.path
})
},
fail() {
}
})
})
}
}
})
......@@ -13,9 +13,9 @@ Page({
scene1: null,
scene2: null,
scene3: null,
scene4: true
scene4: null
},
sceneActive: 4,
sceneActive: 1,
scenePriceList: [{
total: 0
}, {
......
......@@ -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: [
......
......@@ -207,11 +207,16 @@ Page({
// },
// 选车场景切换
selectCar(e) {
let actNum = e.currentTarget.dataset.num;
console.log('e: ', e);
let {num,scenestatus} = e.currentTarget.dataset;
// console.log('actNum: ', actNum);
this.setData({
actNum,
});
if(scenestatus == 1){
this.setData({
actNum:num,
});
}
},
// 头部看线索,产品切换
changeTabIndx(e) {
......@@ -233,39 +238,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;
break;
case 1:
sceneActive = 2;
break;
case 2:
sceneActive = 3;
break;
case 3:
sceneActive = 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 +496,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>
......@@ -14,7 +14,8 @@
<!-- 托客户内容 -->
<view class="content" wx:if="{{tabIndx == 1 }}" hover-class="none" hover-stop-propagation="false">
<view class="scene">
<view class="item-wrap {{actNum== index ? 'act':''}}" wx:if="{{item.sceneStatus == 1}}" data-num="{{index}}" bindtap="selectCar" wx:for="{{senceData}}" wx:key="name">
<!-- wx:if="{{item.sceneStatus == 1}}" -->
<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>
......
/* pages/tab/output/components/client/client.wxss */
.client {
box-sizing: border-box;
height: calc(100vh - 170rpx);
height: 100%;
color: #323436;
padding: 16rpx 0 60rpx;
background-color: #F2F3F7;
......
......@@ -25,7 +25,7 @@
class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<!-- 我的客户 -->
<view hidden="{{tabIndx != 0}}">
<view class="comCom" hidden="{{tabIndx != 0}}">
<client id="client" />
</view>
<!-- 我的门店 -->
......
......@@ -1578,7 +1578,7 @@ var createImgTag = function(width, height, getPixel, alt) {
base64.flush();
var img = '';
img += 'data:image/gif;base64,';
img += 'data:image/png;base64,';
img += base64;
return img;
......
......@@ -68,7 +68,7 @@ class Request {
if (code == '0') {
resolve(data.data)
} else {
console.log(data)
console.trace(data)
wx.showToast({
title: message || '系统异常',
icon: 'none'
......@@ -78,7 +78,7 @@ class Request {
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:`, error)
console.log(`接口异常:`, error)
wx.showToast({
title: '系统异常',
icon: 'error'
......
......@@ -52,7 +52,7 @@ class Share {
if (sharePath) path = `/${sharePath}`
path += that.setCommonShareQuery()
if (shareQuery) path += `&${shareQuery}`
console.log(path)
console.log('::', path)
if (!noPageAuth) path = `/login/loading/loading?url=${encodeURIComponent(path)}`
if (shareFun) shareFun()
if (shareTrackData) that.reportShareData(shareTrackData)
......@@ -123,16 +123,17 @@ class Share {
const {
WXUSERINFO,
USERINFO
} = this.getCommonData()
} = this.getCommonData(),
thisPage = wx.$router.getPageInstance()
reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: USERINFO.phone || '',
merchantId: USERINFO.merchantId || '',
shareOpenId: WXUSERINFO.openId || '',
sharePhone: USERINFO.phone || '',
merchantId: thisPage.merchantId || USERINFO.merchantId || '',
shareOpenId: thisPage.shareOpenId || WXUSERINFO.openId || '',
sharePhone: thisPage.sharePhone || USERINFO.phone || '',
...shareTrackData
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!