Commit 5d38142b by 前端

Merge branch 'develop' into 'master'

saas+v4.16.0上线后,代码合并。

See merge request !25
2 parents 67d62d92 3eecc66b
Showing 80 changed files with 1823 additions and 910 deletions
import api from '~/utils/request/request'
const common = 'scrm.api.carlife.common.'
import { mockUrl } from '~/utils/request/http'
/** mock */
function getMockApi() {
const url = mockUrl
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
module.exports = {
commonApi: {
/**上传图片
......@@ -20,5 +40,17 @@ module.exports = {
noSignAttr: ['file']
})
},
/** mock */
getMock: getMockApi
},
/** 获取MOCK数据 */
getMockData: async function() {
let mock_data = wx.$storage.get('mock_data')
if (!mock_data) {
const data = await getMockApi()
wx.$storage.set('mock_data', data)
return data
} else return mock_data
}
}
......@@ -77,6 +77,14 @@ class outputApi {
})
}
/** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) {
return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics',
...data
})
}
/** 店面汇总-下载海报 */
getPosterUrl(data) {
return api.post({
......
......@@ -32,7 +32,7 @@ page {
image {
width: 100%;
height: 100%;
/* height: 100%; */
vertical-align: top;
}
......
// pages/tab/output/components/sceneBox/sceneBox.js
import { IMG_URL } from '~/utils/constantData'
import { scenceList } from '~/pages/tab/index/constant/data'
Component({
/**
* 组件的属性列表
......@@ -12,6 +13,10 @@ Component({
type: Number,
value: -1
},
sceneCodeActive: {
type: String,
value: ''
},
hasOpenIcon: {
type: Boolean,
value: true
......@@ -20,9 +25,14 @@ Component({
type: Boolean,
value: true
},
formData: {
sceneInfo: {
type: Object,
value: () => {}
value: () => {},
observer(n) {
if(n.hasOwnProperty('sceneList')) {
this.findIsOpen()
}
}
},
scenePriceList: {
type: Array,
......@@ -36,33 +46,51 @@ Component({
data: {
IMGURL: IMG_URL,
openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [
{
title: '新车洽谈场景',
subTitle: '1.0新车权益升级'
},
{
title: '新车交付场景',
subTitle: '1.1新车精品升级'
},
{
title: '0-6个月',
subTitle: '1.2次新车膨胀金活动'
},
{
title: '6个月以上',
subTitle: '1.3售后直播众筹活动'
}
]
scenceList
// custSceneList: [
// {
// title: '新车洽谈场景',
// subTitle: '1.0新车权益升级'
// },
// {
// title: '新车交付场景',
// subTitle: '1.1新车精品升级'
// },
// {
// title: '0-6个月',
// subTitle: '1.2次新车膨胀金活动'
// },
// {
// title: '6个月以上',
// subTitle: '1.3售后直播众筹活动'
// }
// ]
},
lifetimes: {
attached() {
// console.log(this.data.sceneInfo, 'sceneInfo--')
// console.log(this.data.scenceList, 'scenceList--')
}
},
/**
* 组件的方法列表
*/
methods: {
findIsOpen() {
let list = JSON.parse(JSON.stringify(this.data.scenceList))
list.forEach(item => {
let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {}
item.isOpen = obj.flag || false
})
this.setData({
scenceList: list
})
},
handleClick(e) {
let { idx } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx })
let { idx, scenecode } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode })
}
}
})
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="/pages/tab/output/index.wxs" module="filter" />
<view class="flex scene">
<view class="scene-item {{ (formData['scene' + (index + 1)] && hasOpenIcon) ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}" wx:for="{{custSceneList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<view class="scene-item {{ (item.isOpen && hasOpenIcon) ? 'open' : ''}} {{sceneCodeActive && (sceneCodeActive == item.sceneCode) ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}" data-scenecode="{{item.sceneCode}}">
<view wx:if="{{hasOpenIcon && item.isOpen}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:if="{{item.isOpen}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img">
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
<view class="title-box">
<view class="scene-title {{item.isOpen ? '' : 'on-open'}}">{{item.name}}</view>
</view>
<view>{{item.subTitle}}</view>
<!-- <view>{{item.subTitle}}</view> -->
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{filter.money_three_for_two_thousands(scenePriceList[index].total || 0.00)}}
¥ {{filter.money_three_for_two_thousands(item.isOpen ? (scenePriceList[index].total || 0.00) : 0.00)}}
</view>
</view>
</view>
\ No newline at end of file
......@@ -30,11 +30,15 @@
}
.scene-title {
width: 100rpx;
font-size: 24rpx;
height: 44rpx;
line-height: 44rpx;
margin: 10rpx 0 4rpx;
font-weight: 600;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 已开通 - start */
......@@ -62,6 +66,10 @@
padding: 4rpx; */
}
.open-icon image {
height: 100%;
}
/* 已开通 - end */
/* 选中 - start */
......@@ -88,9 +96,12 @@
}
/* 选中 - end */
.scene-title {
color: #323436;
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title.on-open {
......@@ -115,7 +126,7 @@
height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
font-size: 24rpx;
font-size: 20rpx;
color: #3666FE;
/* font-weight: 600; */
font-family: 'number';
......
// components/Service/Service.js
import { IMG_URL } from '~/utils/constantData'
// const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
Component({
/**
* 组件的属性列表
*/
properties: {
isFixed: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
isShow: false
},
/**
* 组件的方法列表
*/
methods: {
handleShow() {
this.setData({
isShow: !this.data.isShow
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Service/Service.wxss */
.service {
position: fixed;
right: 0rpx;
top: 73%;
z-index: 120;
}
.icon {
width: 64px;
height: 64px;
}
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.poster {
width: 750rpx !important;
height: 720rpx !important;
border-radius: 0;
}
.close {
margin-top: 60rpx;
width: 64rpx;
height: 64rpx;
}
}
\ No newline at end of file
<!--components/Service/Service.wxml-->
<div class="{{isFixed ? 'service' : '' }}">
<image src="{{IMG_URL}}index/service.png" class="icon" bindtap="handleShow"></image>
<view wx:if="{{isShow}}" class="layout">
<view class="bg" bindtap="handleShow" />
<image class="poster" src="{{IMG_URL}}index/service-detail.png" show-menu-by-longpress="{{true}}"></image>
<image src="{{IMG_URL}}index/close.png" class="close" bindtap="handleShow"></image>
</view>
</div>
\ No newline at end of file
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData } from '~/pages/tab/index/constant/senceData'
const norTabList = ['项目亮点', '合作案例', '合作方式', '适配产品']
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
Component({
externalClasses: ['custom-class'],
/**
......@@ -13,7 +13,9 @@ Component({
value: -1,
observer(n) {
this.getInfo()
this.getImgHeight()
if (n == 3) {
this.setVideoCtx()
}
}
},
// 选中的产品
......@@ -45,25 +47,45 @@ Component({
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/',
productData,
proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0,
scrollTop: 0,
showCard: false,
tabList: []
tabList: [],
imgTopArr: []
},
lifetimes: {
attached() {
wx.showLoading()
setTimeout(() => {
wx.hideLoading()
this.getImgHeight()
}, 800)
},
},
/**
* 组件的方法列表
*/
methods: {
setVideoCtx() {
this.setData({
videoCtx: wx.createVideoContext('video', this),
crowdVideoCtx: wx.createVideoContext('crowd-video', this)
})
},
handleVideoPlay(e) {
let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause()
},
getInfo() {
let { activeNavIdx, actNum } = this.data
//console.log(actNum)
//console.log(activeNavIdx)
const spcList = [99] // 订阅模块需要特殊处理
const senceList = productData[actNum].filter(item => item.name != '全部')
const senceList = this.data.productData[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
......@@ -71,9 +93,9 @@ Component({
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ? item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
})
break
}
......@@ -93,7 +115,6 @@ Component({
.boundingClientRect(react => {
react.forEach((item, index) => {
//44 tab的高度
// console.log('item',item)
s = item.top - 44 + scrollTop
imgTopArr.push(s)
})
......@@ -106,6 +127,12 @@ Component({
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
},
// 1.3查看活动详情按钮
checkActive() {
let { activeUrl } = this.data
wx.$router.jumpH5(activeUrl);
},
onClickTab(event) {
// console.log('event: ', event);
let { index } = event.detail
......
......@@ -105,14 +105,26 @@ page {
}
.check-act {
width: 100%;
text-align: center;
position: absolute;
bottom: 94rpx;
right: 60rpx;
font-size: 24rpx;
bottom: 64rpx;
right: 0;
font-weight: 600;
font-size: 28rpx;
color: #3666FE;
text-decoration: underline;
}
.crowd-video {
width: calc(100% - 64rpx);
height: 386rpx;
position: absolute;
top: 264rpx;
margin: 0 32rpx;
border-radius: 16rpx;
}
.more-btn {
position: absolute;
left: 50%;
......
......@@ -2,7 +2,7 @@
<view class="view-prod custom-class">
<view class="pro-head">
<!-- 有视频 -->
<video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" />
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/>
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
......@@ -20,7 +20,7 @@
</view>
<view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index">
<image webp wx:if="{{ index < 3}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<image webp wx:if="{{ index < 3}}" webp mode="widthFix" class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:if="{{ index == 0}}">
<!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{sharephone}}">
......@@ -31,9 +31,8 @@
</view>
</block>
<!-- 查看活动那个详情 1.3才有 -->
<block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}">
<block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}">
<view class="check-act" bindtap="checkActive">点击查看活动页面</view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block>
<!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}">
......@@ -42,7 +41,12 @@
</button>
</block>
</image>
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" />
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-item {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
</block>
</image>
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
......
......@@ -19,6 +19,7 @@
image {
display: none;
height: 100%;
}
}
......
......@@ -7,10 +7,11 @@ const setRouteData = targetPath => {
let [url, query] = targetPath.split('?'),
obj = {}
if (query) {
const [key, val] = query.split('=')
obj = {
[key]: val
}
var list = query.split('&') || []
list.forEach(item => {
const [key, val] = item.split('=')
obj[key] = val
})
}
return {
url,
......
......@@ -2,6 +2,8 @@ import { checkLoginUserInfo, setRouteData, setLoginInfo, loginModal } from '../l
import { getSessionId } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
import md5 from '~/utils/lib/md5'
import { sceneByIdApi } from '~/api/checkProduct.js'
Page({
/**
* 页面的初始数据
......@@ -13,12 +15,12 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onLoad(options) { },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
onReady() { },
/**
* 生命周期函数--监听页面显示
......@@ -31,28 +33,63 @@ Page({
if (extraData && Object.keys(extraData).length) this.phoneSmsLogin(extraData)
else this.init()
} else this.init()
} else if ([1047, 1048, 1049].includes(appEnter.scene)) {
if (!this.options.scene) {
this.init()
return
}
sceneByIdApi({
id: decodeURIComponent(appEnter.query.scene).split('=')[1]
}).then(res => {
const url = res.scene
const obj = this.arrToObj(url.split('&'))
if (obj.hasOwnProperty('userName') && obj.hasOwnProperty('password')) {
wx.$storage.rm("sessionId")
wx.$storage.rm("userInfo")
wx.$storage.rm("auto_login_object")
wx.$storage.rm("posterId")
wx.$storage.rm("mock_data")
wx.$storage.set("firstLogin", "firstLogin")
wx.$storage.set("disLikeRecordFlag", true)
this.accountLogin(obj)
} else this.init()
}).catch(() => {
this.init()
})
} else this.init()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
onReachBottom() { },
arrToObj(list) {
if (!Array.isArray(list)) {
return {}
}
var obj = {}
list.forEach(item => {
let temp = item.split('=')
obj[temp[0]] = temp[1]
})
return obj
},
init() {
wx.nextTick(() => {
const sessionId = getSessionId(),
......@@ -102,7 +139,6 @@ Page({
} else wx.$router.reLaunch('login.index', obj)
},
phoneSmsLogin(extraData) {
console.log(extraData)
USERAPI.phoneSmsLogin({
mobile: extraData.phone,
code: extraData.smscode
......@@ -122,5 +158,44 @@ Page({
wx.$router.reLaunch('login.index')
}, 1e3)
})
},
accountLogin(obj) {
const params = {
userName: obj.userName,
password: md5(obj.password)
}
USERAPI.accountLogin(params).then(({ code, data, message }) => {
if (code == '0') {
const { sessionId, loginUserInfoList } = data
var routeParams = {}
var list = []
if (obj.url == '/packagesList/packageOutput/pages/summary') {
routeParams = {
merchantId: obj.merchantId,
merchantName: obj.merchantName,
pMerchantId: loginUserInfoList[0].subLoginUser.merchantId,
pMerchantName: loginUserInfoList[0].subLoginUser.merchantName,
isSuper: loginUserInfoList[0].isSuper,
fixScenceCode: obj.sceneCode
}
Object.keys(routeParams).forEach((item) => {
list.push(item + "=" + routeParams[item])
})
this.options.targetPath = obj.url + "?" + list.join("&")
}
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
wx.$api.showToast(message || '系统异常')
setTimeout(() => {
wx.$router.reLaunch('login.index')
}, 1e3)
}
})
.catch(err => {
wx.$api.showToast('系统异常')
setTimeout(() => {
wx.$router.reLaunch('login.index')
}, 1e3)
})
}
})
......@@ -10,9 +10,9 @@
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
},
"glsx-applet-component": {
"version": "1.0.37",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.37.tgz",
"integrity": "sha512-Imu/2+0R9Vru6o73rwzTPqB+hNh5dXeWHj78SV15C0QcK6RhLry5tcrjvv1+B2M16/ajeljEBSFY5WXppD9gCg=="
"version": "1.0.47",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.47.tgz",
"integrity": "sha512-KzdhJD35vbW1NPMhABsTTe+IosDUH1dlPO0pLUCug+JXLCU2/WbhNvIGAq5+y6Dj9xYy98HDAB9fGsQZ677YLw=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.0.38"
"glsx-applet-component": "^1.0.50"
},
"devDependencies": {},
"scripts": {
......
// packagesList/apply/components/ApplyBusiness/ApplyBusiness.js
import { scenceList } from '~/pages/tab/index/constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
scenceList,
carObj: {
name: '',
model: '',
selNum: '',
contact: '',
phone: ''
},
actNum:0, //选中的场景
selectProdArr:[] //选中的产品数组
},
/**
* 组件的方法列表
*/
methods: {
selectCar(e) {
// console.log('e: ', e);
let {num} = e.currentTarget.dataset
this.setData({
actNum:num
})
},
selectProd(e){
console.log('e: ', e);
let item = e.currentTarget.dataset.item
let productName = item.productName
let {selectProdArr} = this.data;
let searchIndex = selectProdArr.findIndex((item)=>item.productName == productName)
if(searchIndex != -1){
// 找到item、删除
selectProdArr.splice(searchIndex, 1)
}else{
selectProdArr.push(item)
}
this.setData({
selectProdArr
})
console.log(this.data.selectProdArr, 'selectProdArr--')
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name
let content = e.detail.value
this.setData({
[`carObj.${name}`]: content
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/apply/components/ApplyBusiness/ApplyBusiness.wxss */
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 600;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip {
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 8rpx;
}
.name {
width: 100rpx;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.item-wrap:nth-child(2) .name {
width: 120rpx;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select {
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item {
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act {
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img {
display: block;
}
}
.act-img {
display: none;
position: absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
\ No newline at end of file
<!--packagesList/apply/components/ApplyBusiness/ApplyBusiness.wxml-->
<wxs module="filter" src="./ApplyBusiness.wxs"></wxs>
<view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
开店名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="营业执照上的公司名称" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="主营品牌/车型" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">新车销量/基盘客户</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入数字" type="number"/>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" maxlength="{{50}}" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">手机号</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" maxlength="{{11}}" placeholder="请输入手机号" type="number"/>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">业务场景</view>
<view class="content-product">
<view class="scene">
<scroll-view scroll-x="{{true}}">
<view class="scene-wrap">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" data-scenestatus="{{item.sceneStatus}}" bindtap="selectCar" wx:for="{{scenceList}}" wx:key="name">
<view class="item">
<image webp class="img" src="{{item.src}}" />
<view class="name-box">
<view class="name">{{item.name}}</view>
</view>
<!-- <view class="msg">{{item.msg}}</view> -->
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">
业务场景
<view class="tip" hover-class="none" hover-stop-propagation="false">(可多选)</view>
</view>
<view class="scene-select">
<view class="scene-item {{filter.hasProdAct(item,selectProdArr)?'act':''}}" wx:for="{{scenceList[actNum]['productList']}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="selectProd">
<glsx-image webp class="act-img" src="index/act-img.png"></glsx-image>
{{item.productName}}
</view>
</view>
</view>
\ No newline at end of file
// packagesList/apply/components/ApplyProduct/ApplyProduct.js
import { getMerchantListApi } from '~/api/applyProd.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
behaviors: [computedBehavior],
data: {
prodName: '',
storeShow: false,
selectStoreItem: {},
scene: 3 //场景值
},
computed: {
selectStoreValue(data) {
return data.selectStoreItem.name || '请选择合作门店'
}
},
lifetimes: {
attached() {
this.getMerchantListFn()
}
},
/**
* 组件的方法列表
*/
methods: {
//获取门店
async getMerchantListFn() {
let { scene } = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
// scene,
serviceMerchantId: userInfo.merchantId
}
let { code, data } = await getMerchantListApi(params)
if (code == 0 && data.length != 0) {
data = data.map(item => {
item.name = item.merchantName
return item
})
// console.log('data: ', data);
this.setData({
actions: data
})
}
},
// 选择门店
selectStore() {
this.setData({ storeShow: true });
},
onStoreClose() {
this.setData({ storeShow: false });
},
onStoreSelect(event) {
console.log(event.detail);
let selectStoreItem = event.detail
this.setData({ selectStoreItem })
this.onStoreClose()
},
}
})
{
"component": true,
"usingComponents": {
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-cell": "@vant/weapp/cell/index"
},
"styleIsolation": "shared"
}
\ No newline at end of file
/* packagesList/apply/components/ApplyProduct/ApplyProduct.wxss */
.apply-product {
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 600;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
.out-van-cell {
flex: 1;
.inp-van-cell {
&.van-cell {
height: 112rpx;
line-height: 112rpx;
padding: 0;
flex: 1;
.point {
color: #f35251;
}
// line-height: 1;
}
&:after {
display: none;
}
.van-cell__title {
flex: none;
width: 184rpx;
}
.van-cell-text {
font-weight: 600;
}
.van-cell__value {
text-align: left;
font-family: UICTFontTextStyleBody;
min-height: 1.4rem;
overflow: hidden;
text-overflow: clip;
white-space: nowrap;
}
.van-cell__right-icon-wrap {
margin-right: 32rpx;
height: 112rpx;
line-height: 112rpx;
}
}
}
}
}
.list-sheet-wrap {
max-height: 60vh;
overflow-y: auto;
}
\ No newline at end of file
<!--packagesList/apply/components/ApplyProduct/ApplyProduct.wxml-->
<view class="apply-product">
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
您的产品名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" model:value="{{prodName}}" maxlength="{{10}}" placeholder="请输入产品名称" />
</view>
<view class="inp-wrap">
<view class="out-van-cell">
<van-cell custom-class="inp-van-cell" value="{{selectStoreValue}}" is-link bind:click="selectStore">
<view slot="title">
<view class="van-cell-text">
合作门店
<text class="point">*</text>
</view>
</view>
</van-cell>
</view>
</view>
</view>
<view>
<van-action-sheet show="{{ storeShow }}" cancel-text="取消" actions="{{ actions }}" list-class="list-sheet-wrap" bind:cancel="onStoreClose" bind:close="onStoreClose" bind:select="onStoreSelect" />
</view>
\ No newline at end of file
......@@ -2,10 +2,11 @@
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import applyApi from '~/api/applyApi/index'
import { addCoProductApi } from '~/api/applyProd.js'
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = '../../images/'
import { senceData } from '~/pages/tab/index/constant/data'
import utils from '~/utils/util.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
Page({
......@@ -14,18 +15,17 @@ Page({
*/
behaviors: [computedBehavior],
data: {
senceData,
// navStyle,
IMG_URL,
carObj: {
name: '',
model: '',
selNum: '',
contact: '',
phone: ''
},
actNum:0, //选中的场景
selectProdArr:[] //选中的产品数组
tabActive: 1,
tabList: [{
title: '申请业务',
name: 1
}, {
title: '申请产品',
name: 2
}],
isLoading: false
},
// computed: {
// hasProdAct(data) {
......@@ -40,34 +40,19 @@ Page({
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
selectCar(e) {
// console.log('e: ', e);
let {num} = e.currentTarget.dataset
onTabChange(e) {
const { name } = e.detail
this.setData({
actNum:num
tabActive: name
})
},
selectProd(e){
console.log('e: ', e);
let item = e.currentTarget.dataset.item
let productName = item.productName
let {selectProdArr} = this.data;
let searchIndex = selectProdArr.findIndex((item)=>item.productName == productName)
if(searchIndex != -1){
// 找到item、删除
selectProdArr.splice(searchIndex, 1)
}else{
selectProdArr.push(item)
// 申请业务
applyBusiness() {
if (this.data.isLoading) {
return
}
this.setData({
selectProdArr
})
},
// 提交信息
applyFn() {
let { name } = this.data.carObj
const subCompData = this.selectComponent('#apply-business').data
let { name } = subCompData.carObj
// console.log('name: ', name)
if (!name) {
wx.pro.showToast({
......@@ -76,13 +61,13 @@ Page({
})
return
}
this.submitForm()
// console.log(123)
this.submitBusinessForm(subCompData)
},
submitForm() {
let { carObj, clueId,selectProdArr } = this.data
submitBusinessForm(subCompData) {
let { carObj, selectProdArr } = subCompData
let { clueId } = this.data
let selectProdArrStr = ''
selectProdArr.forEach((item,index)=>{selectProdArrStr+=`${item.productName}${selectProdArr.length-1 == index?'':';'}`})
selectProdArr.forEach((item, index) => { selectProdArrStr += `${item.productName}${selectProdArr.length - 1 == index ? '' : ';'}` })
let { userInfo } = wx.$storage.get()
let MerchantInfo = userInfo.subLoginUser
......@@ -96,9 +81,11 @@ Page({
carType: carObj.model,
baseCustomer: carObj.selNum,
clueId,
intentProducts:selectProdArrStr
intentProducts: selectProdArrStr
}
this.setData({
isLoading: true
})
// return wx.$api.showToast('申请成功')
applyApi
.merchantApply(params)
......@@ -108,26 +95,70 @@ Page({
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
let node = page.selectComponent('#indexclue')
node && node.getClueInit()
page && page.getClueInit && page.getClueInit()
})
}, 1000)
}
})
.catch(err => {})
.catch(err => {
this.setData({
isLoading: false
})
})
},
// 申请产品
applyProduct() {
if (this.data.isLoading) {
return
}
const subCompData = this.selectComponent('#apply-product').data
let { prodName, selectStoreItem } = subCompData
if (!prodName) {
wx.pro.showToast({
title: '请输入产品名称',
icon: 'error'
})
return
}
if (utils.isEmptyObj(selectStoreItem)) {
wx.pro.showToast({
title: '请选择合作门店',
icon: 'error'
})
return
}
this.submitProductForm(subCompData)
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name
let content = e.detail.value
async submitProductForm(subCompData) {
let { prodName, selectStoreItem } = subCompData
let userInfo = wx.$storage.get('userInfo')
let params = {
...selectStoreItem,
serviceMerchantId: userInfo.merchantId,
serviceMerchantName: userInfo.merchantName,
coProduct: prodName
}
this.setData({
[`carObj.${name}`]: content
isLoading: true
})
let { code } = await addCoProductApi(params)
if (code == 0) {
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back()
}, 1000)
} else {
this.setData({
isLoading: false
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onLoad(options) { },
onRoute(params) {
// 线索id
this.setData({
......@@ -139,35 +170,35 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
onReady() { },
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
onReachBottom() { },
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
onShareAppMessage() { }
})
{
"usingComponents": {},
"usingComponents": {
"apply-business": "../components/ApplyBusiness/ApplyBusiness",
"apply-product": "../components/ApplyProduct/ApplyProduct",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
......
......@@ -29,12 +29,8 @@ page {
}
.top {
margin-bottom: 32rpx;
display: flex;
align-items: center;
.line {
// width: 3px;
// height: 14px;
// background:var(--btnColor);
width: 6rpx;
height: 36rpx;
background: #3666fe;
......@@ -48,193 +44,13 @@ page {
// line-height: 48rpx;
}
}
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 500;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip{
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name {
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select{
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item{
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act{
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img{
display: block;
}
}
.act-img{
display: none;
position:absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
}
.btn-box {
position: fixed;
bottom: 64rpx;
left: 0;
width: 100%;
background-color: #FFFFFF;
}
.btn {
margin: 64rpx auto 0;
......
<!-- pages/apply/apply.wxml -->
<wxs module="filter" src="./apply.wxs"></wxs>
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务
申请业务
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
开店名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="营业执照上的公司名称" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="主营品牌/车型" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面新车销量/基盘客户</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入数字" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">门店联系人</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人手机号</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" placeholder="请输入手机号" />
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">业务场景</view>
<view class="content-product">
<view class="scene">
<!-- wx:if="{{item.sceneStatus == 1}}" -->
<scroll-view scroll-x="{{true}}">
<view class="scene-wrap">
<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="open-img" wx:if="{{item.sceneStatus == 1}}" src="{{IMG_URL}}/output/openedIcon.png" /> -->
<image webp class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
<view class="msg">{{item.msg}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">
业务场景
<view class="tip" hover-class="none" hover-stop-propagation="false">(可多选)</view>
</view>
<view class="scene-select">
<view class="scene-item {{filter.hasProdAct(item,selectProdArr)?'act':''}}" wx:for="{{senceData[actNum]['productList']}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="selectProd">
<glsx-image webp class="act-img" src="index/act-img.png"></glsx-image>
{{item.productName}}
</view>
</view>
</view>
</view>
<button class="btn" bindtap="applyFn">提交开店信息</button>
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<!-- <view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view> -->
<van-tabs active="{{ tabActive }}" bind:change="onTabChange">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.title}}" name="{{item.name}}">
</van-tab>
</van-tabs>
</view>
<apply-business id="apply-business" wx:if="{{tabActive == 1}}"></apply-business>
<apply-product id="apply-product" wx:if="{{tabActive == 2}}"></apply-product>
</view>
</view>
<button wx:if="{{tabActive == 1}}" class="btn" bindtap="applyBusiness">提交开店信息</button>
<view wx:if="{{tabActive == 2}}" class="isFullSucreen btn-box" bindtap="applyProduct">
<button class="btn">申请合作</button>
</view>
<!-- <button class="btn" bindtap="applyFn">申请合作产品</button> -->
</view>
\ No newline at end of file
......@@ -4,7 +4,6 @@ import { IMG_URL } from '~/utils/constantData.js'
import {getMerchantListApi,addCoProductApi} from '~/api/applyProd.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import utils from '~/utils/util.js'
Page({
/**
* 页面的初始数据
......@@ -49,7 +48,6 @@ Page({
onStoreClose() {
this.setData({ storeShow: false });
},
onStoreSelect(event) {
console.log(event.detail);
let selectStoreItem = event.detail
......@@ -74,7 +72,6 @@ Page({
})
return
}
this.submitForm()
// console.log(123)
},
......@@ -87,7 +84,6 @@ Page({
serviceMerchantName:userInfo.merchantName,
coProduct:prodName
}
let {code} = await addCoProductApi(params)
// console.log('res: ', res);
if(code == 0){
......@@ -99,10 +95,6 @@ Page({
})
}, 1000)
}
// // return wx.$api.showToast('申请成功')
// applyApi
// .merchantApply(params)
......@@ -120,7 +112,6 @@ Page({
// })
// .catch(err => {})
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -159,34 +150,28 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
})
\ No newline at end of file
......@@ -42,6 +42,19 @@ Page({
selectIndex: 2
}
],
levelTagObj: {
1: {
label: '初步了解'
},
2: {
label: '深入了解',
class: 'tag-red'
},
3: {
label: '签约成交',
class: 'tag-blue'
}
},
clueList: [],
// 看线索部分
unreadClueCount: 0,
......@@ -273,21 +286,21 @@ Page({
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 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
// console.log("type,item: ", type, item);
......@@ -298,7 +311,7 @@ Page({
merchantId: item.visitList[0].merchantId,
merchantName: item.visitList[0].merchantName
},
sceneActive,
// sceneActive,
clueId: item.clueId
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
}
......
......@@ -105,6 +105,24 @@
width: 20px;
height: 20px;
}
.level-tag {
width: 96rpx;
height: 32rpx;
line-height: 32rpx;
font-size: 20rpx;
color: #FFFFFF;
background: #48D241;
border-radius: 6rpx;
margin-left: 24rpx;
text-align: center;
}
.tag-red {
background: #FD6C59;
}
.tag-blue {
background: #557CF7;
}
}
.line {
......
......@@ -64,6 +64,7 @@
<view class="name" hover-class="none" hover-stop-propagation="false">
{{item.nickName}}
<image webp class="avatar" src="{{IMG_URL}}index/avatar.png" wx:if="{{item.clueType != 3}}" />
<view wx:if="{{item.levelTag}}" class="level-tag {{levelTagObj[item.levelTag] ? levelTagObj[item.levelTag].class : ''}}">{{levelTagObj[item.levelTag] ? levelTagObj[item.levelTag].label : ''}}</view>
</view>
<view class="line" hover-class="none" hover-stop-propagation="false" />
<!-- {{item.getMoreFlag?'height':'auto'}} -->
......
......@@ -13,10 +13,14 @@ Component({
properties: {
orderObj: {
type: Object,
value: () => {},
value: () => { },
observer(n) {
n && this.dealStaffList()
}
},
hasReport: {
type: Boolean,
value: true
}
},
......@@ -164,7 +168,7 @@ Component({
path: obj.path
})
},
fail() {}
fail() { }
})
})
},
......@@ -174,6 +178,15 @@ Component({
},
async download(e) {
const { item } = e.currentTarget.dataset
if (item.mockPoster) {
item.posterUrl = item.mockPoster
this.setData({
crowdPosterItem: item,
isShowTip: false
})
return
}
// posterObj = this.selectComponent('#crowdPoster'),
// { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
......@@ -213,7 +226,7 @@ Component({
this.triggerEvent('posterTrack')
},
/**长按战报/喜报 */
async handlePosterTouch(e) {},
async handlePosterTouch(e) { },
/**战报 */
handleReport(e) {
const { item, idx } = e.currentTarget.dataset
......
......@@ -5,7 +5,8 @@
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
<text wx:if="{{item.name == 'totalAmount'}}">{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}</text>
<text wx:else>{{orderObj[item.name]}}</text>
</view>
<view class="order-label">{{item.label}}</view>
</view>
......@@ -79,7 +80,7 @@
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="new-report" wx:if="{{item.activityStatus != 1 && hasReport}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
</view>
......
const formList = [{
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '体验量',
name: 'experienceCount'
}, {
label: '成交订单',
name: 'upgradeCount'
}, {
label: '营业额',
name: 'totalSubOrderOrderMoney',
prefix: '¥'
}, {
label: '客单价',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验率',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: 'calTransform',
suffix: '%'
}
]
const formObj = {
SC001: [{
label: '总单量',
name: 'totalCount'
}, {
label: '总产值',
name: 'totalAmount',
prefix: '¥'
}, {
label: '当月单量',
name: 'monthCount'
}, {
label: '当月产值',
name: 'monthAmount',
prefix: '¥'
}, {
label: '转化率',
name: 'conversionRate'
}, {
label: '单价',
name: 'price',
prefix: '¥'
}],
SC002: formList,
SC003: formList
}
module.exports = {
formObj
}
\ No newline at end of file
// packageOutput/pages/summary/components/outputTransform/outputTransform.js
import { IMG_URL } from '~/utils/constantData'
import { formObj } from './constant/data'
const defaultSceneCode = 'SC002'
Component({
/**
* 组件的属性列表
......@@ -8,6 +10,19 @@ Component({
formData: {
type: Object,
value: () => { }
},
sceneCode: {
type: String,
value: 'SC002',
observer(n) {
this.setData({
formDataList: formObj[n || 'defaultSceneCode']
})
}
},
hasNavigate: {
type: Boolean,
value: true
}
},
......@@ -16,31 +31,7 @@ Component({
*/
data: {
IMGURL: IMG_URL,
formDataList: [{
label: '到店贴膜量',
name: 'toShopCount'
}, {
label: '体验量',
name: 'experienceCount'
}, {
label: '成交订单',
name: 'upgradeCount'
}, {
label: '营业额',
name: 'totalSubOrderOrderMoney'
}, {
label: '客单价',
name: 'calCustomerUnitPrice',
prefix: '¥'
}, {
label: '引流体验率',
name: 'calExperience',
suffix: '%'
}, {
label: '体验转化率',
name: 'calTransform',
suffix: '%'
}]
formDataList: formObj[defaultSceneCode]
},
/**
......
......@@ -11,7 +11,7 @@
<view class="label">{{item.label}}</view>
</view>
</view>
<navigator version="trial" class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">
<navigator wx:if="{{hasNavigate}}" version="trial" class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">
<view class="link-btn">
<image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}" />
查看订单详情
......
......@@ -10,23 +10,39 @@ Page({
merchantInfo: {},
sceneCodeList: [],
// 场景业务
formData: {
scene1: true,
scene2: true,
scene3: true,
scene4: true
sceneInfo: {
sceneList: [{
sceneCode: 'SC001',
flag: true
}, {
sceneCode: 'SC002',
flag: true
}, {
sceneCode: 'SC003',
flag: true
}, {
sceneCode: 'SC004',
flag: true
}]
},
sceneActive: 1,
sceneCodeActive: 'SC002',
isLoading: false,
// 活动内容
activityList: [],
sceneActivityObj: {
scene0: [],
scene1: [],
scene2: [],
scene3: [],
scene4: []
scene3: []
}
},
// 查找当前高亮场景的idx
findSceneIdx(sceneCode = this.data.sceneCodeActive) {
return this.data.sceneCodeList.findIndex(item => item == sceneCode)
},
getSceneProStatus(sceneCode) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
......@@ -36,7 +52,7 @@ Page({
outputApi.getSceneProStatus(params).then(res => {
var proList = res.find(item => item.sceneCode == sceneCode)
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList
['sceneActivityObj.scene' + this.findSceneIdx()]: proList.productList
})
this.setCurActivity()
})
......@@ -44,12 +60,13 @@ Page({
// 场景切换
handleSceneChange(e) {
var idx = e.detail.sceneIdx
// var idx = e.detail.sceneIdx
var sceneCode = e.detail.sceneCode
this.setData({
sceneActive: idx
sceneCodeActive: sceneCode,
})
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) {
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
if (!this.data.sceneActivityObj['scene' + this.findSceneIdx()].length) {
this.getSceneProStatus(this.data.sceneCodeList[this.findSceneIdx()])
return true
}
this.setCurActivity()
......@@ -58,7 +75,7 @@ Page({
setCurActivity() {
this.setData({
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.data.sceneActive]))
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.findSceneIdx()]))
})
},
......@@ -87,12 +104,15 @@ Page({
},
handleConfirm() {
if(this.data.isLoading) {
return
}
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
serviceMerchantName: this.data.merchantInfo.pMerchantName,
merchantId: this.data.merchantInfo.merchantId,
merchantName: this.data.merchantInfo.merchantName,
sceneCode: this.data.sceneCodeList[this.data.sceneActive - 1],
sceneCode: this.data.sceneCodeList[this.findSceneIdx()],
productCodes: this.data.activityList.filter(item => item.checked == true).map(item => item.productCode),
clueId: this.data.clueId
}
......@@ -100,6 +120,9 @@ Page({
wx.$api.showToast('请选产品/活动')
return true
}
this.setData({
isLoading: true
})
outputApi.applyActivity(params).then(res => {
wx.showToast({
title: '提交成功',
......@@ -110,6 +133,10 @@ Page({
this.handleJump()
}
})
}).catch(() => {
this.setData({
isLoading: false
})
})
},
......@@ -120,11 +147,12 @@ Page({
wx.$router.getData(obj => {
this.setData({
merchantInfo: obj.merchantInfo,
sceneActive: obj.sceneActive,
sceneCodeList: obj.sceneCodeList || ['SC001', 'SC002', 'SC003', 'SC004'],
// sceneActive: obj.sceneActive,
sceneCodeList: obj.sceneCodeList || ['SC002', 'SC003', 'SC004', 'SC001'],
sceneCodeActive: obj.sceneCodeActive || 'SC002',
clueId: obj.clueId
})
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
this.getSceneProStatus(this.data.sceneCodeList[this.findSceneIdx()])
})
},
......
......@@ -75,6 +75,7 @@ page {
font-size: 28rpx;
margin: 0 20rpx 16rpx 0;
border-radius: 4rpx;
border: 2rpx solid #F2F3F7;
.icon-mark {
position: absolute;
......@@ -92,9 +93,25 @@ page {
.activity-item .active {
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
color: #3666FE;
}
.act {
.act-img {
display: block;
}
}
.act-img {
display: none;
position: absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
.item-disabled {
color: #CCCED1;
}
......
......@@ -10,26 +10,29 @@
<!-- 场景活动 -->
<view class="box">
<view class="box-title">业务场景</view>
<scene-box formData="{{formData}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" hasOpenIcon="{{false}}" bindhandleSceneChange="handleSceneChange"></scene-box>
<scene-box sceneInfo="{{sceneInfo}}" scenePriceList="{{scenePriceList}}" sceneCodeActive="{{sceneCodeActive}}" hasOpenIcon="{{false}}" bindhandleSceneChange="handleSceneChange"></scene-box>
</view>
<!-- 活动 -->
<view class="box">
<view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view>
<view class="activity-box" wx:if="{{sceneActive != 1}}">
<view class="activity-box">
<view wx:for="{{activityList}}" wx:key="index" class="activity-item">
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<view wx:if="{{item.openFlag != 0 && item.productStatus == 2}}">
<glsx-image wx:if="{{sceneActive == 4}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneActive == 2 || sceneActive == 3}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneCodeActive == 'SC004'}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003'}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
</view>
<view wx:if="{{item.openFlag == 0 && sceneCodeActive != 'SC001'}}" class="act text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">
<glsx-image wx:if="{{item.checked}}" webp class="act-img" src="index/act-img.png"></glsx-image>
{{item.productName}}
</view>
<view wx:if="{{item.openFlag == 0}}" class="text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</view>
<view class="text-hide item-disabled" wx:else>{{item.productName}}</view>
</view>
</view>
</view>
</view>
<view class="isFullSucreen btn">
<view wx:if="{{sceneActive != 1}}" class="btn-blue" bindtap="handleConfirm">申请开通</view>
<view wx:if="{{sceneCodeActive != 'SC001'}}" class="btn-blue" bindtap="handleConfirm">申请开通</view>
<view wx:else class="btn-disabled">申请开通</view>
</view>
</view>
\ No newline at end of file
......@@ -3,6 +3,7 @@
"usingComponents": {
"scene-box": "../../../components/SceneBox/SceneBox",
"output-transform": "../components//outputTransform/outputTransform",
"output-crowdfund": "../components/outputCrowdfund/outputCrowdfund"
"output-crowdfund": "../components/outputCrowdfund/outputCrowdfund",
"service": "../../../components/Service/Service"
}
}
<!-- packageOutput/pages/summary/summary.wxml -->
<view class="summary">
<view class="layout {{ (sceneActive != 1 && isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'm-rl-20' : ''}}">
<view class="layout {{ (isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (isShowData) ? 'm-rl-20' : ''}}">
<view class="title bg-white">
选产品/活动
<view class="title-open" bindtap="handleJump">
......@@ -11,7 +11,7 @@
</view>
</view>
<view class="scene-box bg-white">
<scene-box formData="{{sceneObj}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" bindhandleSceneChange="handleSceneChange" />
<scene-box sceneInfo="{{sceneInfo}}" scenePriceList="{{scenePriceList}}" sceneCodeActive="{{sceneCodeActive}}" bindhandleSceneChange="handleSceneChange" />
</view>
</view>
</view>
......@@ -26,44 +26,47 @@
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content {{ (sceneActive != 1 && isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData && sceneActive != 1}}">
<view class="activity-content {{ (isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData}}">
<view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
<view wx:if="{{sceneActive == 2 || sceneActive == 3}}" class="select-txt">
{{baseData.timeList[sceneActive == 2 ? searchForm.scene2Idx : searchForm.scene3Idx]}}
<view wx:if="{{sceneCodeActive != 'SC001'}}" class="select" bindtap="handleSearch">
<view wx:if="{{(sceneCodeActive == 'SC002' || sceneCodeActive == 'SC003') && !isMock.SC002}}" class="select-txt">
{{baseData.timeList[sceneCodeActive == 'SC002' ? searchForm.sceneSC002 : searchForm.sceneSC003]}}
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
<view wx:if="{{sceneActive == 4}}" class="select-txt">
{{baseData.actStatusList[searchForm.scene4Idx]}}
<view wx:if="{{sceneCodeActive == 'SC004' && !isMock.SC004}}" class="select-txt">
{{baseData.actStatusList[searchForm.sceneSC004]}}
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack"/>
<output-transform wx:if="{{sceneCodeActive != 'SC004'}}" formData="{{activityList[activityActive].orderTotal}}" hasNavigate="{{sceneCodeActive != 'SC001' && !isMock.SC002}}" sceneCode="{{sceneCodeActive}}" />
<output-crowdfund wx:if="{{sceneCodeActive == 'SC004'}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack" hasReport="{{!isMock.SC004}}" />
</view>
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
</view>
</view>
</view>
<view wx:if="{{sceneActive != 1 && activityList.length}}">
<view wx:if="{{activityList.length}}">
<view class="isFullSucreen btn-box" wx:if="{{ !isShowData && !merchantInfo.isSuper}}">
<view class="btn">
<view class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
</view>
</view>
<view wx:if="{{sceneActive == 1}}" class="isFullSucreen btn-box">
<view wx:if="{{sceneCodeActive == 'SC001' && !isShowData}}" class="isFullSucreen btn-box">
<view class="btn">
<view class="btn-disabled">点击开通</view>
</view>
</view>
<view wx:if="{{sceneActive == 4 && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare">
<view wx:if="{{sceneCodeActive == 'SC004' && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare">
<view class="btn">
<view class="btn-share">活动进行中,分享母链海报开展活动</view>
</view>
</view>
</view>
<!-- 加微 -->
<service wx:if="{{isShowService}}"></service>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{true}}" bindlongtouch="longtouch" />
\ No newline at end of file
// pages/viewProd/index.js
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import { IMG_URL } from "~/utils/constantData.js";
import { scenceList } from '~/pages/tab/index/constant/data'
import { senceData, productData } from '~/pages/tab/index/constant/senceData'
import USERAPI from '~/api/usersApi/index'
import utils from '~/utils/util.js'
......@@ -14,11 +15,10 @@ Page({
behaviors: [computedBehavior],
data: {
IMG_URL,
senceData,
productData,
proInfo: {},
isShare:false, //是否是分享出去的
actNum: 0,
actNum: -1,
activeNavIdx: 0,
tabAct: 0,
showLeft:false, //更多按钮显示的内容
scrollTop:0,
......@@ -61,13 +61,21 @@ Page({
this.isgetAuthphone()
if (!options || utils.isEmptyObj(options)) return
let { actNum, activeNavIdx, isShare,sharephone } = options
let { actNum, activeNavIdx, isShare,sharephone, sceneCode } = options
if(isShare){
wx.hideHomeButton()
}
let sceneObj = {}
if(actNum != 99) {
sceneObj = scenceList.find(item => item.sceneid == actNum)
} else {
sceneObj = productData[99].find(item => item.sceneCode == sceneCode)
}
let proInfo = sceneObj?.productList.find(item => item.id == activeNavIdx)
this.setData({
actNum, //选中的场景下标
actNum, //选中的场景下标/sceneid
activeNavIdx, //选中的产品
isShare,
sharephone
......@@ -76,75 +84,51 @@ Page({
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
//分享数据
const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(+activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
sceneCode: item.sceneCode || ''
})
break
}
}
// let senceItem = senceData[actNum]
// let item = senceData[actNum]?.productList[activeNavIdx]
let item = this.data.proInfo || {}
setTimeout(() => {
utils.setNavigationBarTitle(item?.productName)
utils.setNavigationBarTitle(proInfo?.productName)
},100)
this.shareQuery = `sceneCode=${this.data.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}`
this.shareQuery = `sceneCode=${sceneObj.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}`
console.log(this.shareQuery, 'onload----')
this.shareTrackData = {
sceneCode: this.data.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
sceneCode: sceneObj.sceneCode,
productCode: proInfo?.productCode,
productName: proInfo?.productName,
category: proInfo?.category,
productDesc: proInfo?.productName,
shareOpenId: shareOpenId
// actNum,
// activeNavIdx,
}
console.log(this.shareTrackData, 'onload----shareTrackData')
},
//接受跳转的路由参数(小程序页面跳转)
onRoute(options) {
if (!options || utils.isEmptyObj(options)) return
let { actNum = 0, activeNavIdx = 0,phone=123 } = options;
let { actNum = 0, activeNavIdx = 0,phone=123, sceneid99=0 } = options;
let data = actNum != 99 ? scenceList : productData[actNum]
let value = actNum != 99 ? actNum : sceneid99
let sceneObj = data.find(item => item.sceneid == value)
let proInfo = sceneObj?.productList.find(item => item.id == activeNavIdx)
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
sharephone:phone //联系电话 (登陆的用户)
});
const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = senceList[i]?.productList.map(k => k.id)
if (proIdList.includes(+activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
sceneCode: item.sceneCode || ''
})
break
}
}
// 设置转发标题
let userInfoObj = wx.$storage.get("userInfo");
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name = userInfoObj.merchantName;
this.shareTitle = `${name}给你分享一个活动${this.data.proInfo?.productName},戳我参与~`;
this.shareTitle = `${name}给你分享一个活动${proInfo?.productName},戳我参与~`;
//分享数据
let item = this.data.proInfo || {}
// let item = this.data.proInfo || {}
setTimeout(() => {
utils.setNavigationBarTitle(item.productName)
utils.setNavigationBarTitle(proInfo?.productName)
},100)
//分享人openId
......@@ -152,18 +136,20 @@ Page({
shareOpenId = wx_user_info.openId || ''
// &shareOpenId=${shareOpenId}
this.shareQuery = `sceneCode=${this.data.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
this.shareQuery = `sceneCode=${sceneObj?.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
console.log(this.shareQuery, 'onrouter----')
this.shareTrackData = {
sceneCode: this.data.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
sceneCode: sceneObj?.sceneCode,
productCode: proInfo?.productCode,
productName: proInfo?.productName,
category: proInfo?.category,
productDesc: proInfo?.productName,
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
// apiData,
}
console.log(this.shareTrackData, 'onrouter----shareTrackData')
},
//获取配置url
......
// 场景详情
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed";
import { IMG_URL } from "~/utils/constantData.js";
import { senceData, productData } from '~/pages/tab/index/constant/senceData'
// import { senceData, productData } from '~/pages/tab/index/constant/senceData'
import { scenceList } from '~/pages/tab/index/constant/data'
import USERAPI from "~/api/usersApi/index";
import utils from "~/utils/util.js";
import { getActiveApi } from "~/api/viewprod";
......@@ -14,8 +15,8 @@ Page({
behaviors: [computedBehavior],
data: {
IMG_URL,
senceData,
productData,
// senceData,
// productData,
proInfo: {},
isShare: false, //是否是分享出去的
actNum: 0,
......@@ -63,53 +64,55 @@ Page({
wx.hideHomeButton();
}
let sceneObj = scenceList.find(item => item.sceneid == actNum)
let proInfo = sceneObj?.productList[activeNavIdx]
console.log(sceneObj, 'sceneObj---')
console.log(proInfo, 'proInfo---')
this.setData({
actNum,
activeNavIdx,
actNum, //选中的场景下标/sceneid
activeNavIdx, //选中的产品
isShare,
phone,
phone //联系电话
});
//分享数据
const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = senceList[i]?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
sceneCode: item.sceneCode || ''
})
break
}
}
// const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
// for (let i = 0; i < senceList.length; i++) {
// let item = senceList[i]
// let proIdList = senceList[i]?.productList.map(k => k.id)
// if (proIdList.includes(activeNavIdx)) {
// let proInfo = item.productList.find(k => k.id == activeNavIdx)
// this.setData({
// proInfo,
// sceneCode: item.sceneCode || ''
// })
// break
// }
// }
// 分享描述
this.shareTitle = `给你分享一个${senceData[actNum]?.tabname},戳我参与~`;
this.shareTitle = `给你分享一个${sceneObj?.name},戳我参与~`;
//分享数据
let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx];
console.log("title", item.productName);
// let item = sceneObj?.productList[activeNavIdx];
// console.log("title", item.productName);
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: item.productName,
// });
utils.setNavigationBarTitle(senceData[actNum].tabname);
utils.setNavigationBarTitle(sceneObj.name);
}, 100);
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${
item?.productCode
}&isShare=${true}&productDesc=${item?.productName}&category=${
item?.category
this.shareQuery = `sceneCode=${sceneObj?.sceneCode}&productCode=${
proInfo?.productCode
}&isShare=${true}&productDesc=${proInfo?.productName}&category=${
proInfo?.category
}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&phone=${phone}`;
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
sceneCode: sceneObj?.sceneCode,
productCode: proInfo?.productCode,
productName: proInfo?.productName,
category: proInfo?.category,
productDesc: proInfo?.productName,
// actNum,
// activeNavIdx,
};
......@@ -119,43 +122,61 @@ Page({
if (!options || utils.isEmptyObj(options)) return;
let { actNum = 0, activeNavIdx = 0, phone = 123 } = options;
let sceneObj = scenceList.find(item => item.sceneid == actNum)
let proInfo = sceneObj?.productList[activeNavIdx]
console.log(sceneObj, 'sceneObj---')
console.log(proInfo, 'proInfo---')
this.setData({
actNum, //选中的场景下标
actNum, //选中的场景下标/sceneid
activeNavIdx, //选中的产品
phone, //联系电话
});
// const senceList = this.data.productData[this.data.actNum].filter(item => item.name != '全部')
// for (let i = 0; i < senceList.length; i++) {
// let item = senceList[i]
// console.log(item)
// let proIdList = senceList[i]?.productList.map(k => k.id)
// if (proIdList.includes(+activeNavIdx)) {
// let proInfo = item.productList.find(k => k.id == activeNavIdx)
// this.setData({
// proInfo,
// sceneCode: item.sceneCode || ''
// })
// break
// }
// }
// 设置转发标题
let userInfoObj = wx.$storage.get("userInfo");
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name = userInfoObj.merchantName;
this.shareTitle = `${name}给你分享一个${senceData[actNum]?.tabname},戳我参与~`;
this.shareTitle = `${name}给你分享一个${sceneObj?.name},戳我参与~`;
//分享数据
let item = senceData[actNum]?.productList[activeNavIdx];
console.log("title2", item.productName);
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: item.productName,
// });
utils.setNavigationBarTitle(senceData[actNum].tabname);
utils.setNavigationBarTitle(sceneObj?.name);
}, 100);
this.shareQuery = `sceneCode=${senceData[actNum].sceneCode}&productCode=${
item?.productCode
}&isShare=${true}&productDesc=${item?.productName}&category=${
item?.category
this.shareQuery = `sceneCode=${sceneObj.sceneCode}&productCode=${
proInfo?.productCode
}&isShare=${true}&productDesc=${proInfo?.productName}&category=${
proInfo?.category
}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&phone=${phone}`;
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
sceneCode: sceneObj?.sceneCode,
productCode: proInfo?.productCode,
productName: proInfo?.productName,
category: proInfo?.category,
productDesc: proInfo?.productName,
// actNum,
// activeNavIdx,
// apiData,
};
console.log(this.shareQuery, 'shareQuery')
console.log(this.shareTrackData, 'this.shareTrackData-----------')
},
onClickTab(event) {
// console.log('event: ', event);s
......@@ -181,30 +202,11 @@ Page({
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
let { imgTopArr } = this.data;
// console.log("滚动结束",imgTopArr,e.scrollTop);
// wx.$eventbus.emit('evt_page_scroll', { scrollTop: e.scrollTop })
wx.nextTick(() => {
let idx;
if (imgTopArr[0] > e.scrollTop) {
idx = 0;
} else if (
imgTopArr[imgTopArr.length - 1] > e.scrollTop &&
imgTopArr[0] < e.scrollTop
) {
idx = imgTopArr.findIndex((item) => item > e.scrollTop) - 1;
} else {
idx = imgTopArr.length - 1;
}
this.setData({
tabAct: idx,
scrollTop: e.scrollTop,
});
});
let proDetail = this.selectComponent("#pro-detail")
proDetail.pageSroll(e)
}, 100);
};
})(),
......@@ -242,10 +244,10 @@ Page({
// // console.log('imgTopArr',this.data.imgTopArr)
// // },500)
// },
phoneCall(e) {
let { phone } = e.currentTarget.dataset;
wx.$api.phoneCall(phone);
},
// phoneCall(e) {
// let { phone } = e.currentTarget.dataset;
// wx.$api.phoneCall(phone);
// },
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin();
......
{
"usingComponents": {
"pro-detail": "../../../components/proDetail/proDetail"
"pro-detail": "../../../components/proDetail/proDetail",
"apply-button": "../../../pages/viewVideo/components/apply-button/index"
}
}
\ No newline at end of file
<!--packagesList/pages/scenarioDetail/scenarioDetail.wxml-->
<pro-detail id="pro-detail" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}"></pro-detail>
<pro-detail id="pro-detail" showLeftFlag="{{showLeftFlag}}" sharephone="{{phone}}" actNum="{{actNum}}" activeNavIdx="{{activeNavIdx}}" activeUrl="{{activeUrl}}" bind:getUserInfo="getUserInfo"></pro-detail>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button>
<!-- 授权昵称 -->
<view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view>
\ No newline at end of file
var measureList = Object.freeze([
{
name: '新车洽谈场景',
tips: '车损升级',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '新车洽谈场景',
tips: '车损升级',
value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
{
name: '新车交付场景',
tips: '精品升级',
// name: '新车交付场景',
name: '精品升级',
// tips: '精品升级',
iconName: 'icon2',
product: [
{
name: '太阳膜升级',
parentName: '新车交付场景',
tips: '精品升级',
value: '1-0',
parentName: '精品升级',
// tips: '精品升级',
// value: '1-0',
typeIndex: '1.1',
isCheck: false,
rate: '0.55',
......@@ -40,15 +21,15 @@ var measureList = Object.freeze([
]
},
{
name: '0-6月',
name: '次新车转化',
iconName: 'icon3',
tips: '膨胀金活动',
// tips: '膨胀金活动',
product: [
{
name: '膨胀金活动-车衣',
parentName: '0-6月',
tips: '膨胀金活动',
value: '2-0',
parentName: '次新车转化',
// tips: '膨胀金活动',
// value: '2-0',
typeIndex: '1.2',
isCheck: false,
rate: '0.09',
......@@ -59,9 +40,9 @@ var measureList = Object.freeze([
},
{
name: '膨胀金活动-改色膜',
parentName: '0-6月',
tips: '膨胀金活动',
value: '2-1',
parentName: '次新车转化',
// tips: '膨胀金活动',
// value: '2-1',
typeIndex: '1.2',
isCheck: false,
rate: '0.06',
......@@ -73,16 +54,16 @@ var measureList = Object.freeze([
]
},
{
name: '6个月以上',
name: '售后众筹',
iconName: 'icon4',
tips: '众筹活动',
// tips: '众筹活动',
product: [
{
name: '360全景导航',
parentName: '6个月以上',
tips: '众筹活动',
parentName: '售后众筹',
// tips: '众筹活动',
typeIndex: '1.3',
value: '3-0',
// value: '3-0',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
......@@ -92,9 +73,9 @@ var measureList = Object.freeze([
},
{
name: 'AR导航',
parentName: '6个月以上',
tips: '众筹活动',
value: '3-1',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-1',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
......@@ -105,9 +86,9 @@ var measureList = Object.freeze([
},
{
name: '氛围灯',
parentName: '6个月以上',
tips: '众筹活动',
value: '3-2',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-2',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
......@@ -118,9 +99,9 @@ var measureList = Object.freeze([
},
{
name: '座椅通风',
parentName: '6个月以上',
tips: '众筹活动',
value: '3-3',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-3',
typeIndex: '1.3',
isCheck: false,
rate: '0.01',
......@@ -131,9 +112,9 @@ var measureList = Object.freeze([
},
{
name: '智能香薰',
parentName: '6个月以上',
tips: '众筹活动',
value: '3-4',
parentName: '售后众筹',
// tips: '众筹活动',
// value: '3-4',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
......@@ -143,7 +124,27 @@ var measureList = Object.freeze([
serviceDividendRatio: '0.24'
}
]
}
},
{
name: '会员权益/升级',
// tips: '车损升级',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '会员权益/升级',
// tips: '车损升级',
// value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
])
export default {
......
......@@ -38,7 +38,7 @@ Page({
// }
// }
if (!this.data.isDisabled) {
console.log(this.data.checkArray)
// console.log(this.data.checkArray)
let checkArray = []
this.data.measureList.forEach(item => {
item.product.forEach(i => {
......@@ -47,27 +47,26 @@ Page({
}
})
})
console.log(checkArray)
// console.log(checkArray)
const params = Object.assign({checkArray}, this.data.formData)
console.log(params)
// console.log(params)
wx.$router.go("measureResult", params);
}
},
// 选择产品
checkProduct(e) {
const value = e.target.dataset.value
const index = +value.split('-')[0]
const productIndex = +value.split('-')[1]
const name = `measureList[${index}].product[${productIndex}].isCheck`
const val = this.data.measureList[index].product[productIndex].isCheck
const { pidx, idx } = e.currentTarget.dataset
const value = pidx + '-' + idx
const name = `measureList[${pidx}].product[${idx}].isCheck`
const val = this.data.measureList[pidx].product[idx].isCheck
!val ? checkMap.set(value, !val) : checkMap.delete(value)
console.log(checkMap)
// console.log(checkMap)
this.setData({
[name]: !val,
checkArray: [...checkMap.keys()]
})
this.validForm()
console.log(this.data.checkArray)
// console.log(this.data.checkArray)
},
// 必填校验
......@@ -83,7 +82,7 @@ Page({
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = this.validateNumber(e.detail.value)
console.log(val)
// console.log(val)
const form = `formData.${name}`
this.setData({
[form]: val
......@@ -93,7 +92,7 @@ Page({
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
// console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
......@@ -101,7 +100,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
......
......@@ -16,10 +16,10 @@
<view class="scenario">
<image class="icon" webp src="{{IMGURL}}measure/{{i.iconName}}.png?v={{img_version}}"></image>
{{i.name}}
<view wx:if="{{i.tips}}" class="title-tip">{{i.tips}}</view>
<!-- <view wx:if="{{i.tips}}" class="title-tip">{{i.tips}}</view> -->
</view>
<view class="product-list">
<view class="product-item {{j.isCheck ? 'active':''}}" wx:for="{{i.product}}" wx:for-item="j" wx:key="index" data-value="{{j.value}}" bindtap="checkProduct">
<view class="product-item {{j.isCheck ? 'active':''}}" wx:for="{{i.product}}" wx:for-item="j" wx:for-index="jIdx" wx:key="index" data-pidx="{{index}}" data-idx="{{jIdx}}" data-value="{{j.value}}" bindtap="checkProduct">
<image hidden="{{!j.isCheck}}" class="iconCheck" webp src="{{IMGURL}}measure/icon-check.png?v={{img_version}}"></image>
{{j.name}}</view>
</view>
......
......@@ -19,7 +19,7 @@ import { subscriptionSystemData } from './systemData'
*/
// 车损升级
const sceneImgs0 = [`${IMG_URL}index/scene/scene00.png`, `${IMG_URL}index/scene/scene01.png`, `${IMG_URL}index/scene/scene02.png`, `${IMG_URL}index/scene/scene03.png`]
const productImgs0 = [`${IMG_URL}index/productImgs/product00.webp`, `${IMG_URL}index/productImgs/product01.webp`, `${IMG_URL}index/productImgs/product02.webp`, `${IMG_URL}index/productImgs/product03.webp`]
const productImgs0 = [`${IMG_URL}index/newProImgs/pro00.webp`, `${IMG_URL}index/newProImgs/pro01.webp`, `${IMG_URL}index/newProImgs/pro02.webp`, `${IMG_URL}index/newProImgs/pro03.webp`]
const videoList0 = [
{
videoUrl: `${videoBaseUrl}video/digital_card_30s.mp4`,
......@@ -102,7 +102,7 @@ const scenario_0 = [
// 精品升级
const sceneImgs1 = [`${IMG_URL}index/scene/scene10.png`, `${IMG_URL}index/scene/scene11.png`, `${IMG_URL}index/scene/scene12.png`, `${IMG_URL}index/scene/scene13.png`]
const productImgs1 = [`${IMG_URL}index/productImgs/product10.webp`, `${IMG_URL}index/productImgs/product11.webp`, `${IMG_URL}index/productImgs/product12.webp`, `${IMG_URL}index/productImgs/product13.webp`]
const productImgs1 = [`${IMG_URL}index/newProImgs/pro10.webp`, `${IMG_URL}index/newProImgs/pro11.webp`, `${IMG_URL}index/newProImgs/pro12.webp`, `${IMG_URL}index/newProImgs/pro13.webp`]
const videoList1 = [
{
videoUrl: `${videoBaseUrl}video/solar.mp4`,
......@@ -136,6 +136,7 @@ const scenario_1 = [
sceneImgs: sceneImgs1,
productImgs: productImgs1,
"sceneCode":"SC002",
sceneid: 1,
productList: [
{
id: 0,
......@@ -162,7 +163,7 @@ const scenario_1 = [
// 客户线上化
const sceneImgs2 = [`${IMG_URL}index/scene/scene20.png`, `${IMG_URL}index/scene/scene21.png`, `${IMG_URL}index/scene/scene22.png`, `${IMG_URL}index/scene/scene23.png`]
const productImgs2 = [`${IMG_URL}index/productImgs/product20.webp`, `${IMG_URL}index/productImgs/product21.webp`, `${IMG_URL}index/productImgs/product22.webp`, `${IMG_URL}index/productImgs/product23.webp`]
const productImgs2 = [`${IMG_URL}index/newProImgs/pro20.webp`, `${IMG_URL}index/newProImgs/pro21.webp`, `${IMG_URL}index/newProImgs/pro22.webp`, `${IMG_URL}index/newProImgs/pro23.webp`]
const posterList2 = [
{
src: `${IMG_URL}index/poster/poster3-0.webp`,
......@@ -188,6 +189,7 @@ const scenario_2 = [
sceneImgs: sceneImgs2,
productImgs: productImgs2,
"sceneCode":"SC003",
sceneid: 2,
productList: [
{
id: 0,
......@@ -238,7 +240,7 @@ const scenario_2 = [
// 众筹活动
const sceneImgs3 = [`${IMG_URL}index/scene/scene30.png`, `${IMG_URL}index/scene/scene31.png`, `${IMG_URL}index/scene/scene32.png`, `${IMG_URL}index/scene/scene33.png`]
const productImgs3 = [`${IMG_URL}index/productImgs/product30.webp`, `${IMG_URL}index/productImgs/product31.webp`, `${IMG_URL}index/productImgs/product32.webp`, `${IMG_URL}index/productImgs/product33.webp`]
const productImgs3 = [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
const videoList3 = [
{
videoUrl: `${videoBaseUrl}video/car_beauty.mp4`,
......@@ -305,6 +307,7 @@ const scenario_3 = [
{
name: '美容类',
"sceneCode":"SC004",
sceneid: 3,
productList: [
{
id: 0,
......@@ -331,6 +334,8 @@ const scenario_3 = [
},
{
name: '轻改类',
"sceneCode":"SC004",
sceneid: 0,
productList: [
{
id: 1,
......@@ -347,7 +352,8 @@ const scenario_3 = [
productCode: 'PC006',
productName: '座椅通风',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-3.png`
prodImg: `${IMG_URL}index/prod2/prod3-3.png`,
productImgs: [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32-car.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
},
{
id: 2,
......@@ -364,7 +370,8 @@ const scenario_3 = [
productCode: 'PC007',
productName: 'AR导航',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-0.png`
prodImg: `${IMG_URL}index/prod2/prod3-0.png`,
productImgs: [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32-AR.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
},
{
id: 3,
......@@ -381,7 +388,8 @@ const scenario_3 = [
productCode: 'PC008',
productName: '氛围灯',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-2.png`
prodImg: `${IMG_URL}index/prod2/prod3-2.png`,
productImgs: [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32-lamp.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
},
{
id: 4,
......@@ -398,7 +406,8 @@ const scenario_3 = [
productCode: 'PC009',
productName: '360全景导航',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-1.png`
prodImg: `${IMG_URL}index/prod2/prod3-1.png`,
productImgs: [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32-360.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
},
{
id: 5,
......@@ -415,7 +424,8 @@ const scenario_3 = [
productCode: 'PC009',
productName: '智能香氛系统',
category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-5.png`
prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
productImgs: [`${IMG_URL}index/newProImgs/pro30.webp`, `${IMG_URL}index/newProImgs/pro31.webp`, `${IMG_URL}index/newProImgs/pro32-xt.webp`, `${IMG_URL}index/newProImgs/pro33.webp`]
}
],
sceneImgs: sceneImgs3,
......@@ -424,6 +434,39 @@ const scenario_3 = [
posterList: posterList3
}
]
// 膨胀金
const sceneImgs4 = [`${IMG_URL}index/productImgs/product70.webp`, `${IMG_URL}index/productImgs/product71.webp`, `${IMG_URL}index/productImgs/product72.webp`, `${IMG_URL}index/productImgs/product73.webp`, `${IMG_URL}index/productImgs/product74.webp`, `${IMG_URL}index/productImgs/product75.webp`]
const productImgs4 = [`${IMG_URL}index/productImgs/product70.webp`, `${IMG_URL}index/productImgs/product71.webp`, `${IMG_URL}index/productImgs/product72.webp`, `${IMG_URL}index/productImgs/product73.webp`, `${IMG_URL}index/productImgs/product74.webp`, `${IMG_URL}index/productImgs/product75.webp`]
const videoList4 = [
{
videoUrl: `${videoBaseUrl}video/expansive.mp4`,
posterUrl: `${IMG_URL}index/poster/expansive_activity.png`,
name: '数字化营销增值服务-膨胀金活动',
manufacturer: '嘀加智慧',
view: 3298
}
]
const scenario_4 = [
{
name: '服务类',
"sceneCode":"SC005",
productList: [
{
id: 0,
currentIndex: 0,
proName: '膨胀金',
prodImg: `${IMG_URL}index/prod2/prod4-0.png`,
tabList: ['项目介绍', '活动方案', '销售场景', '合作案例', '合作说明', 'FAQ'],
sceneImgs: sceneImgs4
}
],
productImgs: productImgs4,
videoList: videoList4,
sceneImgs: sceneImgs4
}
]
const senceData = [
{
id: 0,
......@@ -452,7 +495,8 @@ const senceData = [
{
id: 4,
tabname: '膨胀金活动',
banner: `${IMG_URL}index/banner/banner4.png`
banner: `${IMG_URL}index/banner/banner6.png`,
sceneImgs: sceneImgs4
}
]
const productData = {
......@@ -460,10 +504,20 @@ const productData = {
1: scenario_1,
2: scenario_2,
3: scenario_3,
4: scenario_4,
99: subscriptionSystemData
}
const productData1 = {
0: scenario_0,
1: scenario_1,
2: scenario_2,
3: scenario_3,
4: scenario_4,
99: subscriptionSystemData
}
module.exports = {
senceData,
productData
productData,
productData1
}
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
const videoBaseUrl = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
const subscriptionIMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/subscription/'
const IMG_URL2 = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
const subscriptionBannerUrl = IMG_URL2 + 'banner/banner4.webp'
......@@ -32,20 +33,35 @@ const videoList1 = [
view: 1320
}
]
// 膨胀金
const sceneImgs4 = [`${IMG_URL}index/productImgs/product70.webp`, `${IMG_URL}index/productImgs/product71.webp`, `${IMG_URL}index/productImgs/product72.webp`, `${IMG_URL}index/productImgs/product73.webp`, `${IMG_URL}index/productImgs/product74.webp`, `${IMG_URL}index/productImgs/product75.webp`]
const productImgs4 = [`${IMG_URL}index/productImgs/product70.webp`, `${IMG_URL}index/productImgs/product71.webp`, `${IMG_URL}index/productImgs/product72.webp`, `${IMG_URL}index/productImgs/product73.webp`, `${IMG_URL}index/productImgs/product74.webp`, `${IMG_URL}index/productImgs/product75.webp`]
const videoList4 = [
{
videoUrl: `${videoBaseUrl}video/expansive.mp4`,
posterUrl: `${IMG_URL}index/poster/expansive_activity.png`,
name: '数字化营销增值服务-续保膨胀金',
manufacturer: '嘀加智慧',
view: 3298
}
]
const subscriptionSystemData = [
{
name: '客户沉淀',
name: '客户线上化',
//场景详情图片
// sceneImgs: sceneImgs5,
// 产品详情图片
productImgs: productImgs0,
"sceneCode":"SC005",
"sceneCode":"SC008",
sceneid: 0,
productList: [
{
id: 0,
sceneid: 0,
currentIndex: 0,
img: 'product-img1',
proName: '客户活跃代运营',
proName: '私域用户代运营',
price: '100',
profit: '1200000',
type: 'service',
......@@ -55,7 +71,7 @@ const subscriptionSystemData = [
varType: 0,
flow: 10000,
productCode: 'PC011',
productName: '客户活跃代运营',
productName: '私域用户代运营',
category: '代运营',
prodImg: `${IMG_URL2}/prod2/prod4-0.webp`,
sceneImgs: [
......@@ -76,6 +92,7 @@ const subscriptionSystemData = [
},
{
id: 1,
sceneid: 0,
currentIndex: 1,
img: 'product-img1',
proName: '定保数字化招揽',
......@@ -116,11 +133,13 @@ const subscriptionSystemData = [
//场景详情图片
sceneImgs: sceneImgs5,
"sceneCode":"SC006",
sceneid: 1,
// 产品详情图片
productImgs: productImgs0,
productList: [
{
id: 2,
sceneid: 1,
currentIndex: 0,
img: 'product-img1',
proName: '事故车救援服务',
......@@ -157,10 +176,44 @@ const subscriptionSystemData = [
// posterList: posterList0
},
{
name: '续保膨胀金',
"sceneCode":"SC005",
sceneid: 2,
//场景详情图片
sceneImgs: sceneImgs4,
// 产品详情图片
productImgs: productImgs4,
productList: [
{
id: 3,
sceneid: 2,
currentIndex: 0,
proName: '膨胀金',
price: '100',
profit: '180000',
type: 'service',
productType: 'protectMembrane',
path: 'paintProtect',
sale:100, //销量
varType: 0,
flow:10000,
productCode:'PC010',
productName:'膨胀金',
category:'服务类',
prodImg: `${IMG_URL}index/prod2/prod4-0.png`,
tabList: ['项目介绍', '活动方案', '销售场景', '合作案例', '合作说明', 'FAQ'],
sceneImgs: sceneImgs4
}
],
videoList: videoList4
// posterList: posterList0
},
{
name: '数字化转型案例',
"sceneCode":"SC007",
sceneid: 3,
productList: [],
videoList: videoList0.concat(videoList1)
videoList: videoList0.concat(videoList1).concat(videoList4)
}
]
......
......@@ -3,7 +3,9 @@
"vas-toast": "./components/likeToast/likeToast",
"indexProduct": "./components/indexProduct/indexProduct",
"indexClue": "./components/indexClue/indexClue",
"gl-subscription": "glsx-applet-component/subscription/index"
"gl-subscription": "glsx-applet-component/subscription/index",
"gl-scenario": "glsx-applet-component/scenario/index",
"service": "../../../components/Service/Service"
},
"navigationStyle": "custom",
"onReachBottomDistance": 50
......
......@@ -112,33 +112,19 @@ page {
}
}
.chat {
.fixed-btns {
position: fixed;
right: -4px;
top: 52%;
width: 64px;
height: 64px;
border-radius: 50%;
z-index: 2;
z-index: 100;
}
.bus-pro {
position: fixed;
right: -4px;
top: 60%;
width: 128rpx;
height: 143rpx;
z-index: 2;
}
.output-value {
position: fixed;
right: -2px;
top: 70%;
.fixed-btns image {
width: 64px;
height: 64px;
// border-radius: 50%;
z-index: 2;
border-radius: 50%;
margin-top: -20rpx;
}
/* 测算弹窗 */
......
<wxs src="./index.wxs" module="filterUtils" />
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
<tab
tab="{{navList}}"
itemWidth="{{'35%'}}"
index="{{tabIndx}}"
tabHeight
unreadClueCount="{{unreadClueCount}}"
bindclick="changeTabIndx"
class="tabContainer" />
<tab tab="{{navList}}" itemWidth="{{'38%'}}" index="{{tabIndx}}" tabHeight unreadClueCount="{{unreadClueCount}}" bindclick="changeTabIndx" class="tabContainer" />
</navigation-bar>
<view class="reclaim">
<!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('{{IMG_URL}}index/head.png')">
<!-- <view class="header"> -->
<!-- <view class="right" data-type="shop" bindtap="gotoApply">
<!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}px; background-image: url('{{IMG_URL}}index/head.png')">
<!-- <view class="header"> -->
<!-- <view class="right" data-type="shop" bindtap="gotoApply">
<image webp class="img" src="{{IMG_URL}}index/apply.png" />
<view class="apply">申请业务</view>
</view> -->
<!-- </view> -->
<!-- </view> -->
</view>
<!-- 托客户内容 -->
<indexProduct
</view>
<!-- 托客户内容 -->
<!-- <indexProduct
wx:if="{{tabIndx == 0 }}"
bindselectCar="selectCar"
senceData="{{senceData}}"
actNum="{{actNum}}"
img_version="{{img_version}}"
headerHeight="{{headerHeight}}"
bindrefresherrefresh="refresherrefresh" />
<!-- 看线索内容 -->
<!-- <indexClue
bindrefresherrefresh="refresherrefresh" /> -->
<block wx:if="{{tabIndx == 0}}">
<gl-scenario currentScenIndex="{{3}}" discoverIndex="{{2}}" list="{{scenceList}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" bindleftClick="leftClick"></gl-scenario>
</block>
<!-- 看线索内容 -->
<!-- <indexClue
id="indexclue"
wx:if="{{tabIndx == 1 }}"
headerHeight="{{headerHeight}}"
disLikeRecordFlag="{{disLikeRecordFlag}}"
bindshowToggleToast="showToggleToast" /> -->
<!-- <view wx:if="{{tabIndx == 1}}">系统订阅</view> -->
<block wx:if="{{tabIndx == 1}}">
<gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" data-name="系统订阅"/>
</block>
<!-- <view wx:if="{{tabIndx == 1}}">客户数字化</view> -->
<block wx:if="{{tabIndx == 1}}">
<gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" bind:videoClick="videoClick" bindcurrentScen="getCurrentScen" data-name="客户数字化" />
</block>
</view>
<!-- 收藏、取消提示框 -->
<vas-toast id='toast' />
<!-- 引导图 -->
<view class="guide" wx:if="{{guideShow}}" style="overflow-y:hidden;">
<image
webp
bindtap="guideFn"
class="guide-img"
src="{{IMG_URL}}index/guide{{guideSrcIndex}}.png?v={{img_version}}" />
<image webp bindtap="guideFn" class="guide-img" src="{{IMG_URL}}index/newGuide/guide{{guideSrcIndex}}.png?v={{img_version}}" />
</view>
<view class="fixed-btns">
<view wx:for="{{btnList}}" wx:key="index">
<image webp wx:if="{{!item.isHide}}" src="{{IMG_URL}}index/{{item.imgSrc}}.png" bindtap="{{item.bindtap}}" />
</view>
<!-- 加微 -->
<service wx:if="{{isShowService}}" isFixed="{{false}}"></service>
</view>
<!-- 在线客服 -->
<image
webp
class="chat"
src="{{IMG_URL}}index/contact.png"
bindtap="goConsult" />
<!-- 申请业务 -->
<image
webp
class="bus-pro"
src="{{IMG_URL}}index/bus-pro.png"
bindtap="openBus" />
<!-- 预估产值 -->
<image
webp
class="output-value"
bindtap="showCalculate"
src="{{IMG_URL}}index/valuation.png"
wx:if="{{tabIndx == 0}}" />
<!-- 预估产值弹框 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<!-- <view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
......@@ -93,7 +73,6 @@
cursor-spacing="10"
value="{{formData.sales}}"
type="number" />
<!-- <view class="form-unit">台</view> -->
</view>
<view class="form-item">
<view class="form-label">3年内售后存量用户</view>
......@@ -105,17 +84,14 @@
type="number"
cursor-spacing="10"
value="{{formData.flow}}" />
<!-- <view class="form-unit">人</view> -->
</view>
<button class="dialog-btn" form-type="submit">提交测算</button>
</view>
</view>
</form>
</view>
</view>
</view> -->
<!-- -->
<crowdfund-poster wx:if="{{!guideShow}}" item="{{posterItem}}" />
<!-- 全屏视频组件 -->
<!-- <FullscreenVideo id="videocomp" src="{{videoSrc}}" title="{{videoTitle}}" /> -->
<!-- <FullscreenVideo id="videocomp" src="{{videoSrc}}" title="{{videoTitle}}" /> -->
\ No newline at end of file
......@@ -9,6 +9,7 @@ const IMAGES = Object.freeze({
userAvatarUrl: `/personal/userAvatarUrl.png`
})
import { unreadApi, readApi } from '~/api/index.js'
import { getMockData } from '~/api/api'
Page({
/**
* 页面的初始数据
......@@ -31,12 +32,13 @@ Page({
path: 'packagesList.clue',
hasRedPot: true,
isRead: false
}]
}],
isShowService: false,
},
navGO(e) {
let { path, item } = e.currentTarget.dataset
console.log(item)
if(item.name == "看线索") {
if (item.name == "看线索") {
this.clueRead()
}
wx.$router.go(path)
......@@ -69,6 +71,7 @@ Page({
wx.$storage.rm('userInfo')
wx.$storage.rm('auto_login_object')
wx.$storage.rm('posterId')
wx.$storage.rm("mock_data")
wx.$router.reLaunch('login.index')
})
}
......@@ -84,6 +87,7 @@ Page({
},
messageBoxPageIsRead() {
let { serviceMerchantId } = this.data
console.log(serviceMerchantId,'serviceMerchantId');
const idx = this.data.boxItemList.findIndex(item => item.name == '消息盒子')
mineApi
.messageBoxPageIsRead({
......@@ -120,7 +124,7 @@ Page({
sessionId
}
readApi(param).then(res => {
let { code } = res
let { code, data } = res
if (code == 0) {
this.setData({
['boxItemList[' + idx + ']isRead']: !data.unreadClueCount
......@@ -132,13 +136,20 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: async function (options) {
let { userInfo } = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser.merchantId
//解决因为使用await 异步导致数据没同步已经开始调用onshow方法
this.setData({
serviceMerchantId,
userInfo: userInfo.subLoginUser
})
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
this.setData({
isShowService: serviceMerchatList.includes(userInfo.merchantId + '')
})
console.log(serviceMerchantId)
},
/**
......
{
"navigationStyle": "custom"
"navigationStyle": "custom",
"usingComponents": {
"service": "../../../components/Service/Service"
}
}
......@@ -38,4 +38,6 @@
<button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
退出登录
</button>
</view>
\ No newline at end of file
</view>
<!-- 加微 -->
<service wx:if="{{isShowService}}"></service>
\ No newline at end of file
......@@ -34,20 +34,20 @@ Component({
openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [
{
title: '新车洽谈场景',
subTitle: '1.0新车权益升级'
title: '精品升级',
// subTitle: '1.0新车权益升级'
},
{
title: '新车交付场景',
subTitle: '1.1新车精品升级'
title: '次新车转化',
// subTitle: '1.1新车精品升级'
},
{
title: '0-6个月',
subTitle: '1.2次新车膨胀金活动'
title: '售后众筹',
// subTitle: '1.2次新车膨胀金活动'
},
{
title: '6个月以上',
subTitle: '1.3售后直播众筹活动'
title: '会员权益/升级',
// subTitle: '1.3售后直播众筹活动'
}
]
},
......
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="flex scene">
<view
class="scene-item {{ formData['scene' + (index + 1)] ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}"
wx:for="{{custSceneList}}"
wx:key="index"
bindtap="handleClick"
data-idx="{{index + 1}}">
<view wx:if="{{formData['showList'][index]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image wx:if="{{formData['showList'][index]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}" />
<image wx:else class="lock-img " src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}" />
<view class="scene-title {{formData['showList'][index]?'':'notOpened'}}">{{item.title}}</view>
<view class="scene-label">{{item.subTitle}}</view>
<!-- wx:if="{{scenePriceList.length}}" -->
<view class="total-price">¥ {{filter.money_three_for_two_thousands(formData['showList'][index].totalMoney||0)}}</view>
</view>
</view>
<view class="scene-item {{ formData['scene' + (index + 1)] ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}" wx:for="{{custSceneList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}">
<view wx:if="{{formData['showList'][index]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image wx:if="{{formData['showList'][index]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 1}}.png?v={{img_version}}" />
<image wx:else class="lock-img " src="{{IMGURL}}output/carlock0{{index + 1}}.png?v={{img_version}}" />
<view class="title-box">
<view class="scene-title {{formData['showList'][index]?'':'notOpened'}}">{{item.title}}</view>
</view>
<view class="scene-label">{{item.subTitle}}</view>
<!-- wx:if="{{scenePriceList.length}}" -->
<view class="total-price">¥ {{filter.money_three_for_two_thousands(formData['showList'][index].totalMoney||0)}}</view>
</view>
</view>
\ No newline at end of file
......@@ -7,7 +7,6 @@
text-align: center;
width: 100%;
}
.scene-item {
box-sizing: border-box;
height: 248rpx;
......@@ -30,11 +29,24 @@
margin-right: 0;
}
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title {
width: 100rpx;
font-weight: 600;
font-size: 24rpx;
height: 44rpx;
line-height: 44rpx;
margin: 10rpx 0 4rpx;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 已开通 - start */
......@@ -52,6 +64,10 @@
height: 78rpx;
}
.open-icon image {
height: 100%;
}
/* 已开通 - end */
/* 选中 - start */
......@@ -80,15 +96,9 @@
/* 选中 - end */
.scene-title {
color: #323436;
/* font-weight: 600; */
}
.scene-img {
width: 92rpx;
height: 64rpx;
}
/* .notOpened {
......@@ -102,8 +112,8 @@
.total-price {
height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
font-size: 24rpx;
margin-top: 36rpx;
font-size: 22rpx;
color: #3666FE;
/* font-weight: 600; */
font-family: "number";
......
......@@ -149,11 +149,12 @@ Component({
var params = {
merchantId: currentItem.merchantId,
merchantName: currentItem.merchantName,
scene1: currentItem.scene1,
scene2: currentItem.scene2,
scene3: currentItem.scene3,
scene4: currentItem.scene4,
sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
// scene1: currentItem.scene1,
// scene2: currentItem.scene2,
// scene3: currentItem.scene3,
// scene4: currentItem.scene4,
// sceneList: currentItem.sceneList,
// sceneCodeList: currentItem.sceneList.map(item => item.sceneCode),
pMerchantId: this.data.pMerchantId,
pMerchantName: this.data.pMerchantInfo.subLoginUser.merchantName,
isSuper: this.data.pMerchantInfo.isSuper
......
......@@ -15,7 +15,7 @@
</view>
<!-- 场景内容 -->
<view class="box-content">
<scene-box formData="{{item}}" hasLockIcon="{{false}}" />
<scene-box sceneInfo="{{item}}" hasLockIcon="{{false}}" />
<!-- 通知 -->
<view class="box-bottom">
<view wx:if="{{item.msgList.length}}" class="flex">
......
......@@ -221,10 +221,13 @@ Component({
obj.totalOrder = dataList[index]?.totalOrder || 0
obj.merchantName = dataList[index]?.merchantName
obj.merchantId = item
obj.startInd =
let topObj = dataList[index]?.sceneList.shift()
dataList[index]?.sceneList.push(topObj)
const startInd =
dataList[index]?.sceneList.findIndex(item => {
return item != null
}) || -1
})
obj.startInd = typeof startInd === 'number'?startInd:-1
obj.showNothingSceneCon = item.startInd == -1
obj.showList = dataList[index]?.sceneList || []
// obj.norList = type?obj.
......@@ -242,10 +245,9 @@ Component({
let index = list[current].startInd
// console.log(index)
// 动态计算swiper 高度
if ([0, -1].includes(index)) {
if ([3, -1].includes(index)) {
swiperHeight = 483
} else if ([1, 2].includes(index)) {
console.log(list[current])
} else if ([0, 1].includes(index)) {
if (list[current]['showList'][index]['diagnoseList']) {
swiperHeight = 600
} else {
......@@ -275,18 +277,14 @@ Component({
console.log(e)
let { list } = this.data
let { index, item } = e.currentTarget.dataset
console.log(item)
let { sceneIdx } = e.detail
sceneIdx = sceneIdx - 1
console.log(sceneIdx)
console.log(index)
let swiperHeight
// 动态计算swiper 高度
console.log(item.startInd)
// 最后要判断 sceneIdx 为空也能切换的兼容问题
if (sceneIdx == 0 || item.startInd == -1 || item['showList'][sceneIdx] == null) {
swiperHeight = 483
} else if ([1, 2].includes(sceneIdx)) {
} else if ([0, 1].includes(sceneIdx)) {
// console.log(item['diagnoseList'])
// item['showList'][index]['diagnoseList']
if (item['showList'][sceneIdx]?.diagnoseList) {
......@@ -325,20 +323,20 @@ Component({
})
},
setMerchantObj(index, item, selectName, oldItem) {
console.log(item)
item = item[0]
let obj = {}
obj.selectName = selectName || oldItem.selectName
obj.selectName = selectName || oldItem?.selectName
obj.totalMoney = setPrice(item?.totalMoney || 0)
obj.totalOrder = item?.totalOrder || 0
obj.merchantName = item?.merchantName
// obj.merchantId = item
obj.startInd =
oldItem?.startInd ||
item?.sceneList.findIndex(item => {
return item != null
}) ||
-1
let topObj = item?.sceneList.shift()
item?.sceneList.push(topObj)
const startInd =
dataList[index]?.sceneList.findIndex(item => {
return item != null
})
obj.startInd = typeof startInd === 'number' ?startInd:-1
obj.showNothingSceneCon = obj.startInd == -1
obj.showList = item?.sceneList || []
// obj.norList = type?obj.
......@@ -347,9 +345,7 @@ Component({
let { list } = this.data
// item.list[index] = list[index]
// console.log('listObj', listObj)
console.log(obj.selectName)
let listObj = `list[${index}]`
console.log('sceneIndx', obj.startInd)
this.setData({
[listObj]: Object.assign(list[index], obj)
})
......@@ -358,12 +354,11 @@ Component({
console.log(e)
let { list, userInfo } = this.data
let { current } = e.detail
console.log(list[current].startInd)
let swiperHeight
// 动态计算swiper 高度
if (list[current].startInd == 0 || list[current].startInd == -1) {
if (list[current].startInd == 3 || list[current].startInd == -1) {
swiperHeight = 483
} else if ([1, 2].includes(list[current].startInd)) {
} else if ([0, 1].includes(list[current].startInd)) {
let subscript = list[current]['startInd']
let item = list[current]['showList']
if (item[subscript]?.diagnoseList) {
......@@ -374,7 +369,6 @@ Component({
} else {
swiperHeight = 485
}
// console.log(swiperHeight)
this.setData({
totalMoney: list[current].totalMoney || 0,
totalOrder: list[current].totalOrder || 0,
......@@ -385,7 +379,6 @@ Component({
// list[current].startInd == 0? ''
// 692
console.log('swiper', list[current].startInd)
// list
if (current >= 1 && list[current + 1] && list[current + 1].startInd == -1) {
// 请求
......
......@@ -107,7 +107,7 @@
.bg-image {
// width: 100%;
width: 440rpx;
// height: 100%;
height: 100%;
position: absolute;
left: 50%;
transform: translateX(-50%);
......
......@@ -38,9 +38,9 @@
<view class="title">产值图</view>
<view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiper-item ">
<view class="fluuelCon {{item.startInd!=3?'longHeight':'shortHeight'}}">
<image class="bg-image " src="{{item.startInd!=3?IMAGES.funnelNew :IMAGES.funnelNewSm}}" />
<block wx:for="{{item.startInd!=3? funnelList['start']: funnelList['end']}}" wx:key="*this" wx:for-index="ind" wx:for-item="funneItem">
<view class="fluuelCon {{item.startInd!=2?'longHeight':'shortHeight'}}">
<image class="bg-image " src="{{item.startInd!=2?IMAGES.funnelNew :IMAGES.funnelNewSm}}" />
<block wx:for="{{item.startInd!=2? funnelList['start']: funnelList['end']}}" wx:key="*this" wx:for-index="ind" wx:for-item="funneItem">
<view class="funneItem">
<view class="label">{{funneItem['label']}}</view>
<view class="num font-number">
......@@ -50,7 +50,7 @@
</block>
</view>
<!-- <block wx:for="{{items}}"></block> hidden="{{item.startInd ==3}}" -->
<view class="statisticsCon" hidden="{{item.startInd ==3}}">
<view class="statisticsCon" hidden="{{item.startInd ==2}}">
<!-- 统计 -->
<view class="merchantCount">
<view class="turnover">
......@@ -86,7 +86,7 @@
查看订单详情
</navigator>
</view>
<view class="statisticsCon" hidden="{{item.startInd !=3}}">
<view class="statisticsCon" hidden="{{item.startInd !=2}}">
<!-- 统计 -->
<view class="merchantCount crowdFundingTotal">
<view class="turnover">
......
......@@ -2,6 +2,7 @@
import { getSessionId, setSessionId } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
import { getMockData } from '~/api/api'
Page({
/**
* 页面的初始数据
......@@ -12,7 +13,8 @@ Page({
loginType: 0,
agree: true,
tabIndx: 0,
tabList: ['我的客户', '我的门店', '我的员工'],
// tabList: ['我的客户', '我的门店', '我的员工'],
tabList: ['我的客户', '我的员工'],
popupShow: false,
subIndex: -1,
merchantList: [
......@@ -26,7 +28,8 @@ Page({
merchantName: 'test',
show: true
}
]
],
isShowService: false,
},
// 切换园区
tapPicker() {
......@@ -52,6 +55,7 @@ Page({
init() {
this.setUserInfo()
this.getMerchantRange()
this.getMockInfo()
},
setUserInfo() {
let { userInfo } = wx.$storage.get()
......@@ -61,6 +65,12 @@ Page({
isSuper: userInfo.isSuper
})
},
async getMockInfo() {
let { serviceMerchatList } = await getMockData() || { serviceMerchatList: [] }
this.setData({
isShowService: serviceMerchatList.includes(this.data.userInfo.merchantId + '')
})
},
getMerchantRange(e) {
// 重新刷新
// let { detail } = e || null
......@@ -98,7 +108,7 @@ Page({
subIndex
})
})
.catch(err => {})
.catch(err => { })
} else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
console.log('merchantRange', merchantRange)
......@@ -134,30 +144,30 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() { },
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
onHide() { },
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
onUnload() { },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
onPullDownRefresh() { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
onReachBottom() { },
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
onShareAppMessage() { }
})
......@@ -6,7 +6,8 @@
"merchant": "./components/merchant/mrechant",
"staff": "./components/staff/staff",
"search-input": "../../../components/SearchInput/SearchInput",
"accountSwitchingPop": "./components/accountSwitchingPop/accountSwitchingPop"
"accountSwitchingPop": "./components/accountSwitchingPop/accountSwitchingPop",
"service": "../../../components/Service/Service"
},
"navigationStyle": "custom"
}
<!-- pages/tab/output/output.wxml -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<!-- <picker
<!-- <picker
range="{{merchantRange}}"
value="{{subIndex}}"
range-key="merchantName"
......@@ -8,41 +8,33 @@
bindtap="tapPicker"
bindcancel="tapPicker"
disabled="{{merchantRange.length < 2}}"> -->
<view class="navigation-title" bindtap="tapPicker">
<view class="navigation-title-text text-hide">
{{merchantRange[subIndex].merchantName||userInfo.merchantName}}
</view>
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{merchantRange.length > 1}}">
<image src="{{IMG_URL}}/output/arrow.png" />
</view>
</view>
<!-- </picker> height:calc(100vh - {{tabBarStyle}}px) -->
<view class="navigation-title" bindtap="tapPicker">
<view class="navigation-title-text text-hide">
{{merchantRange[subIndex].merchantName||userInfo.merchantName}}
</view>
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{merchantRange.length > 1}}">
<image src="{{IMG_URL}}/output/arrow.png" />
</view>
</view>
<!-- </picker> height:calc(100vh - {{tabBarStyle}}px) -->
</navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;">
<tab
tab="{{tabList}}"
itemWidth="{{'27%'}}"
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<!-- 我的客户 -->
<view class="comCom" hidden="{{tabIndx != 0}}">
<client id="client" />
</view>
<!-- 我的门店 -->
<view class="comCom" hidden="{{tabIndx != 1}}">
<tab tab="{{tabList}}" itemWidth="{{'27%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<!-- 我的客户 -->
<view class="comCom" hidden="{{tabIndx != 0}}">
<client id="client" />
</view>
<!-- 我的门店 -->
<!-- <view class="comCom" hidden="{{tabIndx != 1}}">
<merchant id="merchant" />
</view>
<!-- 我的员工 -->
<view class="comCom" hidden="{{tabIndx != 2}}">
<staff id="staff" />
</view>
</view> -->
<!-- 我的员工 -->
<view class="comCom" hidden="{{tabIndx != 1}}">
<staff id="staff" />
</view>
</view>
<accountSwitchingPop
wx:if="{{popupShow}}"
bind:hidePopup="tapPicker"
bind:changeAccount="getMerchantRange"
popShow="{{popupShow}}"
merchantRange="{{merchantRange}}" />
<accountSwitchingPop wx:if="{{popupShow}}" bind:hidePopup="tapPicker" bind:changeAccount="getMerchantRange" popShow="{{popupShow}}" merchantRange="{{merchantRange}}" />
<!-- 加微 -->
<service wx:if="{{isShowService}}"></service>
\ No newline at end of file
......@@ -10,5 +10,5 @@
<view class="name">转发</view>
</button>
</view>
<view class="apply" bindtap="apply">合作申请</view>
<view class="apply" bindtap="apply">申请合作</view>
</view>
\ No newline at end of file
......@@ -73,6 +73,20 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "申请业务+产品",
"pathName": "packagesList/apply/pages/apply",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/loading/loading",
"query": "scene=sceneId%3D22402",
"launchMode": "default",
"scene": 1047
}
]
}
......
......@@ -17,7 +17,8 @@ export const STORAGE_OBJECTkEY = {
authphone: 'authphone',
disLikeRecordFlag: 'disLikeRecordFlag',
fileList: 'fileList',
posterId: 'posterId'
posterId: 'posterId',
mock_data: 'mock_data'
}
export const IMG_VERSION = () => {
......
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
const mockObj = {
test: 'https://oss-config.dev.glsx.com.cn/mock/63fd6c2034c4d918e2f4df4d/config',
product: 'https://oss-config.test.glsx.com.cn/mock/63ff0b507dc47c4edc786e82/config'
}
/**
*
......@@ -112,10 +116,19 @@ const defaultMerchantId = {
preRelease: '44184606',
prod: '44189923'
}[target[index]]
let mockUrl = {
ip: mockObj.test,
dev: mockObj.test,
uat: mockObj.test,
preRelease: mockObj.product,
prod: mockObj.product
}[target[index]]
module.exports = {
index,
domain,
pathEnum,
secretKey,
defaultMerchantId
defaultMerchantId,
mockUrl
}
......@@ -256,6 +256,38 @@ const setNavigationBarTitle = (title) =>{
});
}
/** 钱转化千分 */
const moneyThreeForTwoThousands = num => {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
const Util = {
getImgVersion,
......@@ -267,6 +299,7 @@ const Util = {
parseString,
getCurrentPageUrl,
deepClone,
setNavigationBarTitle
setNavigationBarTitle,
moneyThreeForTwoThousands
};
export default Util;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!