Commit a0f92b13 by luyt

feat:看产品接口

1 parent 53dc6d7f
......@@ -5,7 +5,7 @@ import api from '~/utils/request/request'
// const common = 'scrm.api.carlife.common.'
const serverApi = {
// 拓客户
productByscene:'scrm.api.busassistant.activity.productByscene'
productByscene:'scrm.api.busassistant.activity.findSceneProductStatus'
}
......
......@@ -38,8 +38,14 @@ Page({
isShow: true,
});
},
onRouter(options) {
console.log("options: ", options);
onRoute(options) {
// console.log("options: ", options);
//选中场景的index,和产品的index
let {actNum,activeNavIdx} = options
this.setData({
actNum,
activeNavIdx
})
},
/**
* 生命周期函数--监听页面加载
......
......@@ -41,7 +41,7 @@ Component({
[678, 1266, 1398, 830, 490, 1666],
],
posterUrl: "", //海报url
// imgList
noVideoimgList:[]
// imgList:[
// {
// src:`${IMG_URL}index/scene${actNum}1.png`,
......@@ -57,6 +57,9 @@ Component({
`${IMG_URL}index/scene${actNum + 1}4.png`,
`${IMG_URL}index/scene${actNum + 1}5.png`,
];
this.setData({
noVideoimgList:imgList
});
if (actNum != 2) {
imgList.push(`${IMG_URL}index/scene${actNum + 1}6.png`);
}
......
......@@ -13,14 +13,15 @@
top: 20%;
left: 50%;
transform: translateX(-50%);
width: 225px;
// width: 225px;
width: 60%;
height: 311px;
// background-color: red;
overflow: auto;
.img {
width: 100%;
// height: auto;
height: 60%;
// height: 60%;
background-color: #fff;
}
}
......
<!-- pages/tab/index/components/shareModel/shareModel.wxml -->
<view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<image class="img" style="height:{{imgHeight}}px" src="{{IMG_URL}}/longpic{{actNum+1}}.png" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<image class="img" src="{{item}}"/>
</block> -->
<!-- <image class="img" style="height:{{imgHeight}}px" src="{{IMG_URL}}/longpic{{actNum+1}}.png" bindload="onloadFn" /> -->
<block wx:for="{{imgList}}" wx:key="*this">
<image mode="widthFix" class="img" src="{{item}}"/>
</block>
</view>
<button></button>
<view class="btns">
......
import { IMG_URL } from "~/utils/constantData.js";
var senceData = [
{
name: '新车洽谈场景',
img: 'scene_talk.png',
active: 'icon-car11',
playImg: 'img1',
src: `${IMG_URL}index/car1.png`,
// name: "新车洽谈场景",
msg: "1.0 新车权益销售",
productList: [
{
img: 'product-img1',
......@@ -46,6 +51,9 @@ var senceData = [
img: 'scene_delivery.png',
active: 'icon-car21',
playImg: 'img2',
src: `${IMG_URL}index/car2.png`,
// name: "新车交付场景",
msg: "1.1 新车精品升级",
productList: [
{
img: 'product-img2',
......@@ -72,6 +80,9 @@ var senceData = [
img: 'scene_within_12mth.png',
active: 'icon-car21',
playImg: 'img2',
src: `${IMG_URL}index/car3.png`,
// name: "0-12个月",
msg: "1.2 新车线上转化",
productList: [
{
img: 'product-img3',
......@@ -102,6 +113,9 @@ var senceData = [
img: 'scene_more_12mth.png',
active: 'icon-car31',
playImg: 'img3',
src: `${IMG_URL}index/car4.png`,
// name: "12个月以上",
msg: "1.3 存量用户众筹",
productList: [
{
img: 'product-img5',
......
const navStyle = "background-color: transparent;";
import { IMG_URL } from "~/utils/constantData.js";
import {senceData} from "./constant/data";
import { senceData } from "./constant/data";
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = "../../../images/";
import {productBysceneApi} from '~/api/index.js';
import { productBysceneApi } from "~/api/index.js";
Page({
// behaviors: [kfMixin],
......@@ -41,6 +41,7 @@ Page({
msg: "1.3 存量用户众筹",
},
],
apiData: [],
actNum: 0, //car 场景选择
tabIndx: 1,
navList: ["看线索", "看产品"],
......@@ -162,7 +163,7 @@ Page({
// tabList: pageData.tabList,
// 定义数据
senceData,
isShow:false,
isShow: false,
},
//引导图
......@@ -300,7 +301,7 @@ Page({
console.log(name, profit);
this.setData({
[name]: profit,
[sale]:sales
[sale]: sales,
});
}
});
......@@ -409,17 +410,52 @@ Page({
*/
onLoad: function (options) {
// console.log('options: ', options);
let {sessionId} = wx.$storage.get()
console.log('sessionId: ', sessionId);
let { sessionId } = wx.$storage.get();
// console.log("sessionId: ", sessionId);
let param = {
sessionId
}
// productBysceneApi(param).then((res) => {
// console.log('res: ', res);
sessionId,
};
productBysceneApi(param).then((res) => {
let { code, data } = res;
// })
if (code == 0) {
this.setData({
apiData: data,
});
this.compositionData(senceData,this.data.apiData)
this.getFirstSenceIndex()
}
});
},
//接口数据,本地数据对接
compositionData(localData, apiData) {
localData.forEach((item, index) => {
apiData.forEach((inner,idx)=>{
if(item.name == inner.stage){
item.sceneStatus = inner.sceneStatus
item.productList.forEach((outChild,outIndex)=>{
inner.productList.forEach((innerChild,innerIndex)=>{
if(outChild.proName == innerChild.productName){
outChild.productStatus = innerChild.productStatus
}
})
})
}
})
})
// console.log('localData, apiData: ', localData);
this.setData({
senceData:localData
})
},
getFirstSenceIndex(){
let actTndex = this.data.apiData.findIndex(item =>item.sceneStatus == 1)
// console.log('actTndex: ', actTndex);
this.setData({
actNum:actTndex
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
......@@ -535,5 +571,5 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
onShareTimeline:function () {},
onShareTimeline: function () {},
});
......@@ -237,13 +237,13 @@ page {
.scene {
margin: 0 10px 16px;
display: flex;
justify-content: space-between;
// justify-content: space-between;
.item-wrap {
margin-right: 4px;
position: relative;
width: 86px;
height: 90px;
border-radius:10px;
}
.item {
// padding-top: 10px;
......
......@@ -14,7 +14,7 @@
<!-- 托客户内容 -->
<view class="content" wx:if="{{tabIndx == 1 }}" hover-class="none" hover-stop-propagation="false">
<view class="scene">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" bindtap="selectCar" wx:for="{{dataArr}}" wx:key="name">
<view class="item-wrap {{actNum== index ? 'act':''}}" wx:if="{{item.sceneStatus == 1}}" data-num="{{index}}" bindtap="selectCar" wx:for="{{senceData}}" wx:key="name">
<view class="item">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!