Commit c67c6b01 by zhangquan

bug修复

1 parent b1110cf7
...@@ -66,9 +66,9 @@ class ActivityApi { ...@@ -66,9 +66,9 @@ class ActivityApi {
...data ...data
}) })
} }
getActivityVisitorList(data) { getOpenSceneList(data) {
return api.post({ return api.post({
method: `scrm.api.stoassistant.user.activity.visitor.list`, method: 'scrm.api.busassistant.activity.SceneOpenStatus.stoAss',
...data ...data
}) })
} }
......
...@@ -31,7 +31,6 @@ Page({ ...@@ -31,7 +31,6 @@ Page({
}, },
onRoute(options){ onRoute(options){
console.log(options,111)
this.setData({ this.setData({
dataFromOptions: options, dataFromOptions: options,
staffName: options.staffName staffName: options.staffName
...@@ -85,7 +84,6 @@ Page({ ...@@ -85,7 +84,6 @@ Page({
}) })
}, },
onConfirm(e){ onConfirm(e){
console.log(e)
const {value} = e.detail const {value} = e.detail
this.setData({ this.setData({
department: value department: value
...@@ -99,7 +97,6 @@ Page({ ...@@ -99,7 +97,6 @@ Page({
}) })
}, },
handleRegister({detail}){ handleRegister({detail}){
console.log(detail,'detaildetaildetail')
const { merchantId, merchantFileRequest } = this.data.dataFromOptions const { merchantId, merchantFileRequest } = this.data.dataFromOptions
let params = { let params = {
merchantId, merchantId,
...@@ -112,7 +109,6 @@ Page({ ...@@ -112,7 +109,6 @@ Page({
weChatNickName: merchantFileRequest.fileName, weChatNickName: merchantFileRequest.fileName,
weChatAvatarUrl: merchantFileRequest.fileUrl weChatAvatarUrl: merchantFileRequest.fileUrl
} }
console.log(params,'ddd')
USERAPI.register(params).then((res) => { USERAPI.register(params).then((res) => {
if (res.code == '0'){ if (res.code == '0'){
this.toLogin() this.toLogin()
...@@ -146,7 +142,6 @@ Page({ ...@@ -146,7 +142,6 @@ Page({
sessionId sessionId
}) { }) {
/**多个账号 */ /**多个账号 */
console.log(loginUserInfoList,'loginUserInfoList')
if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', { if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', {
sessionId, sessionId,
......
...@@ -2,7 +2,6 @@ const navStyle = "background-color: #fff"; ...@@ -2,7 +2,6 @@ const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/discovery/constant/data"; import { senceData } from "~/pages/tab/discovery/constant/data";
import Draw from "~/utils/Draw.js"; import Draw from "~/utils/Draw.js";
import { IMG_URL } from "~/utils/constantData.js"; import { IMG_URL } from "~/utils/constantData.js";
import ActivityApi from '~/api/activityApi/index'
import { import {
commonApi commonApi
} from '~/api/api.js' } from '~/api/api.js'
...@@ -89,7 +88,6 @@ Page({ ...@@ -89,7 +88,6 @@ Page({
path: 'pages/checkProduct/checkProduct' path: 'pages/checkProduct/checkProduct'
} }
commonApi.createQrcode(params).then(response => { commonApi.createQrcode(params).then(response => {
console.log(response,'responseresponse')
let qrcode = response?.data let qrcode = response?.data
this.setData({ this.setData({
imgH: (imgH/imgW)*450 imgH: (imgH/imgW)*450
...@@ -114,7 +112,6 @@ Page({ ...@@ -114,7 +112,6 @@ Page({
drawFun.begin({ drawFun.begin({
imageList: imgList, imageList: imgList,
}).then(resp => { }).then(resp => {
console.log('posterUrl.path',resp)
this.setData({ this.setData({
posterUrl: resp.path, posterUrl: resp.path,
}); });
...@@ -148,7 +145,6 @@ Page({ ...@@ -148,7 +145,6 @@ Page({
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: this.data.posterUrl, //仅为示例,并非真实的资源 filePath: this.data.posterUrl, //仅为示例,并非真实的资源
success (res) { success (res) {
console.log('res: ', res);
wx.$api.showToast('下载成功!') wx.$api.showToast('下载成功!')
} }
}) })
...@@ -169,9 +165,8 @@ Page({ ...@@ -169,9 +165,8 @@ Page({
}, },
onRoute(options) { onRoute(options) {
wx.nextTick(()=>{ wx.nextTick(()=>{
console.log(" this.options: ", this.options);
let { actNum, activeNavIdx, scene } = this.options let { actNum, activeNavIdx, scene } = this.options
this.shareTitle = senceData[actNum].productList[activeNavIdx].proName this.shareTitle = `给你分享一个${senceData[actNum].productList[activeNavIdx].proName}~`
this.shareQuery = `actNum=${actNum}&activeNavIdx=${activeNavIdx}` this.shareQuery = `actNum=${actNum}&activeNavIdx=${activeNavIdx}`
if(scene){ if(scene){
let qrcodeQuery = decodeURIComponent(scene) let qrcodeQuery = decodeURIComponent(scene)
...@@ -179,7 +174,6 @@ Page({ ...@@ -179,7 +174,6 @@ Page({
let paramsObj = {} let paramsObj = {}
if(id){ if(id){
commonApi.getQrcodeParams({id}).then(res => { commonApi.getQrcodeParams({id}).then(res => {
console.log(res?.data?.scene,'responseresponse12233')
if(res.code=='0'){ if(res.code=='0'){
let paramsArr = res?.data?.scene?.split('&'); let paramsArr = res?.data?.scene?.split('&');
paramsArr.forEach(item => { paramsArr.forEach(item => {
...@@ -202,7 +196,6 @@ Page({ ...@@ -202,7 +196,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options,'onLoad')
}, },
/** /**
......
...@@ -86,6 +86,21 @@ Component({ ...@@ -86,6 +86,21 @@ Component({
curTabIdx: idx curTabIdx: idx
}) })
}, },
download() {
wx.downloadFile({
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/video/digital_card_30s.mp4',
success (res) {
if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success (res) {
wx.$api.showToast('保存成功!')
}
})
}
}
})
},
getImgHeight(){ getImgHeight(){
let query = wx.createSelectorQuery().in(this) let query = wx.createSelectorQuery().in(this)
let heightArr = [] let heightArr = []
...@@ -96,7 +111,6 @@ Component({ ...@@ -96,7 +111,6 @@ Component({
heightArr.push(s) heightArr.push(s)
}) })
this.data.heightArr = heightArr this.data.heightArr = heightArr
console.log( this.data.heightArr)
}).exec() }).exec()
}, },
getImgHeight() { getImgHeight() {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
width: 188rpx; width: 188rpx;
height: 64rpx; height: 64rpx;
border-radius: 12rpx; border-radius: 12rpx;
font-weight: 500; font-weight: 600;
font-size: 24rpx; font-size: 24rpx;
letter-spacing: 0; letter-spacing: 0;
text-align: center; text-align: center;
......
...@@ -4,6 +4,8 @@ var senceData = [ ...@@ -4,6 +4,8 @@ var senceData = [
img: 'scene_talk.png', img: 'scene_talk.png',
active: 'icon-car11', active: 'icon-car11',
playImg: 'img1', playImg: 'img1',
sceneCode: 'SC001',
show: 0,
productList: [ productList: [
{ {
img: 'product-img1', img: 'product-img1',
...@@ -45,6 +47,8 @@ var senceData = [ ...@@ -45,6 +47,8 @@ var senceData = [
img: 'scene_delivery.png', img: 'scene_delivery.png',
active: 'icon-car21', active: 'icon-car21',
playImg: 'img2', playImg: 'img2',
sceneCode: 'SC002',
show: 0,
productList: [ productList: [
{ {
img: 'product-img2', img: 'product-img2',
...@@ -71,27 +75,29 @@ var senceData = [ ...@@ -71,27 +75,29 @@ var senceData = [
img: 'scene_within_12mth.png', img: 'scene_within_12mth.png',
active: 'icon-car21', active: 'icon-car21',
playImg: 'img2', playImg: 'img2',
sceneCode: 'SC003',
show: 0,
productList: [ productList: [
{ {
img: 'product-img3', img: 'product-img3',
proName: '漆面保护膜', proName: '漆面保护膜',
price: '12000', price: '12000',
profit: '21600万', profit: '180000',
type: 'membrane', type: 'membrane',
productType: 'protectMembrane', productType: 'protectMembrane',
path: 'paintProtect', path: 'paintProtect',
sale:10000, //销量 sale:100, //销量
varType: 1 varType: 1
}, },
{ {
img: 'product-img4', img: 'product-img4',
proName: '改色膜', proName: '改色膜',
price: '5000', price: '5000',
profit: '30000000', profit: '300000',
type: 'membrane', type: 'membrane',
productType: 'colorMembrane', productType: 'colorMembrane',
path: 'changingFilm', path: 'changingFilm',
sale:10000, //销量 sale:100, //销量
varType: 1 varType: 1
} }
] ]
...@@ -101,6 +107,8 @@ var senceData = [ ...@@ -101,6 +107,8 @@ var senceData = [
img: 'scene_more_12mth.png', img: 'scene_more_12mth.png',
active: 'icon-car31', active: 'icon-car31',
playImg: 'img3', playImg: 'img3',
sceneCode: 'SC004',
show: 0,
productList: [ productList: [
{ {
img: 'product-img5', img: 'product-img5',
......
// pages/tab/output/output.js // pages/tab/output/output.js
const navStyle = "background-color: transparent;"; const navStyle = "background-color: transparent;";
import {senceData} from "./constant/data"; import {senceData} from "./constant/data";
import ActivityApi from '~/api/activityApi/index'
Page({ Page({
/** /**
...@@ -9,7 +10,7 @@ Page({ ...@@ -9,7 +10,7 @@ Page({
data: { data: {
senceData, senceData,
headerHeight: 0, headerHeight: 0,
actNum: 0, actNum: 3,
navStyle, navStyle,
// 预估弹框 // 预估弹框
visible: false, visible: false,
...@@ -24,6 +25,66 @@ Page({ ...@@ -24,6 +25,66 @@ Page({
}, },
isFirst: true, isFirst: true,
changeSale: 0, changeSale: 0,
sceneCodeList:[],
currentId: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { merchantId } = wx.$storage.get('userInfo')
ActivityApi.getOpenSceneList({
merchantId
}).then(res => {
if(res?.length>0){
let sceneCodeList = []
let senceData = [...this.data.senceData]
// let resp = [
// {
// sceneCode: 'SC001',
// status: 1
// },
// {
// sceneCode: 'SC002',
// status: 1
// },
// {
// sceneCode: 'SC003',
// status: 1
// },
// {
// sceneCode: 'SC004',
// status: 1
// }
// ]
res.forEach((item,index) => {
if(item.status==1) {
let sceneTarget = senceData.find(sitem => sitem.sceneCode == item.sceneCode)
sceneTarget.show = 1
}
})
senceData.forEach((item,index) => {
if(item.show==1) {
sceneCodeList.push(item.sceneCode)
}
})
let idx = sceneCodeList.findIndex(item => item=='SC004')
let actNum = 0,currentId = 0;
if(idx>-1){
actNum = 3
currentId = idx
}else{
actNum = senceData.findIndex(item => item.sceneCode== sceneCodeList[0])
}
this.setData({
sceneCodeList,
senceData,
actNum,
currentId
})
}
})
}, },
navbarReady(e) { navbarReady(e) {
let { let {
...@@ -45,7 +106,7 @@ Page({ ...@@ -45,7 +106,7 @@ Page({
changeSwiper(e){ changeSwiper(e){
this.setData({ this.setData({
actNum:e.detail.current, actNum:e.detail.currentItemId,
}); });
}, },
...@@ -72,7 +133,6 @@ Page({ ...@@ -72,7 +133,6 @@ Page({
}); });
}, },
clickDialog(e) { clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 352) { if (e.changedTouches[0].clientY < 352) {
this.setData({ this.setData({
visible: false, visible: false,
...@@ -90,7 +150,6 @@ Page({ ...@@ -90,7 +150,6 @@ Page({
}); });
}, },
clickDialog(e) { clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 352) { if (e.changedTouches[0].clientY < 352) {
this.setData({ this.setData({
visible: false, visible: false,
...@@ -101,11 +160,9 @@ Page({ ...@@ -101,11 +160,9 @@ Page({
}, },
// 提交测算 // 提交测算
submit(e) { submit(e) {
console.log(e);
let sales = e ? +e.detail.value.sales : this.data.formData.sales; let sales = e ? +e.detail.value.sales : this.data.formData.sales;
let flow = e ? +e.detail.value.flow : this.data.formData.flow; let flow = e ? +e.detail.value.flow : this.data.formData.flow;
const reg = /^[1-9]\d*$/; const reg = /^[1-9]\d*$/;
console.log(reg.test(sales), flow, "---");
if (!reg.test(sales)) { if (!reg.test(sales)) {
wx.showToast({ wx.showToast({
title: "门店月平均新车销量应为正整数", title: "门店月平均新车销量应为正整数",
...@@ -127,19 +184,6 @@ Page({ ...@@ -127,19 +184,6 @@ Page({
"lastFormData.flow": flow, "lastFormData.flow": flow,
}); });
const _this = this; 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) => { this.data.senceData.forEach((item, index) => {
item.productList.forEach((i, lastIndex) => { item.productList.forEach((i, lastIndex) => {
if (i.profit) { if (i.profit) {
...@@ -148,7 +192,6 @@ Page({ ...@@ -148,7 +192,6 @@ Page({
let name = `senceData[${index}].productList[${lastIndex}].profit`; let name = `senceData[${index}].productList[${lastIndex}].profit`;
// let changeSale = `senceData[${index}].productList[${lastIndex}].changeSale`; // let changeSale = `senceData[${index}].productList[${lastIndex}].changeSale`;
let profit = _this.formula(i.productType, sales, flow); let profit = _this.formula(i.productType, sales, flow);
console.log(name, profit);
this.setData({ this.setData({
[name]: profit, [name]: profit,
[sale]:sales [sale]:sales
...@@ -158,13 +201,6 @@ Page({ ...@@ -158,13 +201,6 @@ Page({
}); });
}); });
// 触发自定义事件 利润 数量
// this.triggerEvent('countProfit', profit, sales)
// let type = this.getProductType(sceneIndex, tabIndex);
// let profit = this.formula(type, sales, flow);
// console.log('profit: ', profit);
this.setData({ this.setData({
visible: false, visible: false,
}); });
...@@ -181,17 +217,7 @@ Page({ ...@@ -181,17 +217,7 @@ Page({
}); });
} }
}, },
// // 获取场景下的产品类型
// 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) { formula(productType, sales, flow) {
let profit = 0; let profit = 0;
switch (productType) { switch (productType) {
...@@ -205,11 +231,11 @@ Page({ ...@@ -205,11 +231,11 @@ Page({
break; break;
case "protectMembrane": case "protectMembrane":
// 漆面保护膜 // 漆面保护膜
profit = (flow * 0.15 * 12000 * 12).toFixed(0); profit = (sales * 0.05 * 3000 * 12).toFixed(0);
break; break;
case "colorMembrane": case "colorMembrane":
// 改色膜 // 改色膜
profit = (flow * 0.05 * 5000 * 12).toFixed(0); profit = (sales * 0.05 * 5000 * 12).toFixed(0);
break; break;
case "digitBeauty": case "digitBeauty":
// 数字化美容 // 数字化美容
...@@ -232,8 +258,6 @@ Page({ ...@@ -232,8 +258,6 @@ Page({
profit = (flow * 2880 * 0.9 * 0.015).toFixed(0); profit = (flow * 2880 * 0.9 * 0.015).toFixed(0);
break; break;
} }
console.log(profit.length);
console.log(productType, sales, flow, profit);
if (profit.length > 9) { if (profit.length > 9) {
return (profit / 10000).toFixed(0) + "万"; return (profit / 10000).toFixed(0) + "万";
} else { } else {
...@@ -255,12 +279,7 @@ Page({ ...@@ -255,12 +279,7 @@ Page({
}); });
return false; return false;
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
methods:{ methods:{
}, },
/** /**
......
/* pages/tab/output/output.wxss */ /* pages/tab/output/output.wxss */
page{
background-color: #fff;
}
.container{ .container{
position: relative; position: relative;
.scene-wrap { .scene-wrap {
...@@ -153,3 +155,14 @@ ...@@ -153,3 +155,14 @@
} }
} }
.emptyData{
width: 100%;
text-align: center;
.tip{
margin-top: 16rpx;
font-size: 28rpx;
color: #7A8299;
text-align: center;
}
}
<view style="background:#fff;" class="container"> <view class="container">
<image style="height: {{headerHeight+45}}px;" src="{{IMGURL}}discovery_center_bg.png" class="bg-img"></image> <image wx:if="{{sceneCodeList.length>0}}" style="height: {{headerHeight+45}}px;" src="{{IMGURL}}discovery_center_bg.png" class="bg-img"></image>
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现"> <navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text> <text>发现</text>
</navigation-bar> </navigation-bar>
<view style="padding-top: {{headerHeight}}px;"> <block wx:if="{{sceneCodeList.length>0}}">
<view class="header"> <view style="padding-top: {{headerHeight}}px;">
<swiper bindchange="changeSwiper" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx"> <view class="header">
<block wx:for="{{senceData}}" wx:key="index"> <swiper bindchange="changeSwiper" current="{{currentId}}" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<swiper-item> <block wx:for="{{senceData}}" wx:key="index">
<image class="scene-img" src="{{IMGURL}}{{item.img}}"></image> <swiper-item item-id="{{index}}" wx:if="{{item.show}}">
</swiper-item> <image class="scene-img" src="{{IMGURL}}{{item.img}}"></image>
</block> </swiper-item>
</swiper> </block>
</swiper>
</view>
<product senceData="{{senceData}}" actNum="{{actNum}}" headerHeight="{{headerHeight}}"></product>
</view> </view>
<product senceData="{{senceData}}" actNum="{{actNum}}" headerHeight="{{headerHeight}}"></product>
</view>
</view>
<!-- 在线客服 --> <!-- 申请活动 -->
<image class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" /> <image class="applyAct" src="{{IMGURL}}application_activity.png" bindtap="applyActivity" />
<!-- 在线客服 --> <!-- 测算按钮 -->
<image class="applyAct" src="{{IMGURL}}application_activity.png" bindtap="applyActivity" /> <view class="calculate" bindtap="showCalculate">
<image class="icon-calculate" webp src="{{IMGURL}}calc.png"></image>
<!-- 测算按钮 --> </view>
<view class="calculate" bindtap="showCalculate"> <!-- 测算弹窗 -->
<image class="icon-calculate" webp src="{{IMGURL}}calc.png"></image> <view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
</view> <view class="dialog-box">
<!-- 测算弹窗 --> <form bindsubmit="submit">
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}"> <view class="dialog-header">
<view class="dialog-box"> <view hidden="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<form bindsubmit="submit"> <view hidden="{{!isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<view class="dialog-header"> <button class="header-btn btn-primary" form-type="submit">确定</button>
<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>
<view class="form-item"> <view class="dialog-content">
<view class="form-label">3年内售后存量用户</view> <view class="dialog-title">输入您门店的基本情况</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="flow" type="number" value="{{formData.flow}}" /> <view class="dialog-form">
<!-- <view class="form-unit">人</view> --> <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> </view>
<button class="dialog-btn" form-type="submit">提交测算</button> </form>
</view>
</view> </view>
</form>
</view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
</block>
<block wx:else>
<view class="emptyData" style="margin-top: {{headerHeight+32}}px;">
<image src="{{IMGURL}}toLink.png" style="height: 400rpx;width: 400rpx;"></image>
<view class="tip">
<view>您的门店尚未开通业务场景,</view>
<view>请联系在线客服进行咨询,谢谢。</view>
</view>
</view>
</block>
</view>
<!-- 在线客服 -->
<image class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" />
...@@ -99,6 +99,7 @@ Page({ ...@@ -99,6 +99,7 @@ Page({
bussinessId: id, bussinessId: id,
...storage ...storage
} }
wx.$storage.set('staff_name', staffName)
return USERINFO return USERINFO
}, },
onLoad: function (options) { onLoad: function (options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!