Commit 47436b83 by 张立顺

看产值功能开发

1 parent fe159e51
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
import { imgUrlMixin } from '~/mixins/index' import { imgUrlMixin } from '~/mixins/index'
Component({ Component({
behaviors: [imgUrlMixin], behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
...@@ -9,7 +9,8 @@ Component({ ...@@ -9,7 +9,8 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
tabIndx: 1 tabIndx: 1,
noProduct: false
}, },
/** /**
......
{ {
"component": true, "component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
"usingComponents": {
"merchantDataStatistics": "../merchantDataStatistics/merchantDataStatistics"
}
}
/* pages/tab/output/components/merchant/mrechant.wxss */
\ No newline at end of file \ No newline at end of file
/* pages/tab/output/components/merchant/mrechant.wxss */
.con {
box-sizing: border-box;
padding: 16rpx 16rpx 0;
background-color: #F2F3F7;
.statistics {
box-sizing: border-box;
display: flex;
// width: 360rpx;
width: 100%;
height: 140rpx;
padding: 32rpx;
background-color: #fff;
border-radius: 8rpx;
.box {
flex: 1;
.num {
color: #323436;
font-family: MiSans-S0rpxibold;
font-weight: 600;
font-size: 26rpx;
margin-bottom: 10rpx;
}
.label {
font-size: 24rpx;
color: #8A8C90;
}
// display: flex;
// flex-direction: column;
}
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/merchant/mrechant.wxml --> <!-- pages/tab/output/components/merchant/mrechant.wxml -->
<!-- <text>pages/tab/output/components/merchant/mrechant.wxml</text> --> <!-- <text>pages/tab/output/components/merchant/mrechant.wxml</text> -->
<text>商户产值</text> <view class="con">
<!-- --> <view class="statistics">
<!-- 无门店 --> <view class="totalOutputValue box">
<view> <view class="num">¥300000.00</view>
<view class="label">总产值</view>
</view>
<view class="totalOrder box">
<view class="num">500</view>
<view class="label">订单数/笔</view>
</view>
</view>
<!-- -->
<!-- 无门店 -->
<merchantDataStatistics/>
</view>
<view wx:if="{{noProduct}}">
<!-- <img src="" alt=""> --> <!-- <img src="" alt=""> -->
<view> <view>
暂未开通,去 暂未开通,去
<text>了解产品</text> <text>了解产品</text>
开通门店 开通门店
</view> </view>
<!-- <view >查看订单明细</view> -->
</view> </view>
// pages/tab/output/components/senceSelect/senceSelect.js // pages/tab/output/components/merchantDataStatistics/merchantDataStatistics.js
import { IMG_URL } from '~/utils/constantData'
// import { } from "module";
// ;('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/')
const IMAGES = {
arrow: `${IMG_URL}/output/arrow.png`
}
Component({ Component({
// behaviors: [imgUrlMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {},
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMAGES,
isAct: true
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {}
}
}) })
{
"component": true,
"usingComponents": {
"scene-select": "../sceneSelect/sceneSelect"
}
}
/* pages/tab/output/components/merchantDataStatistics/merchantDataStatistics.wxss */
.merchantDataStatistics-con {
margin-top: 16rpx;
border-radius: 8rpx;
background: #FFFFFF;
.contitle {
box-sizing: border-box;
height: 75rpx;
// border-bottom: 1;
padding: 16rpx 24rpx;
border-bottom: 2rpx dashed #CCCED1;
display: flex;
justify-content: space-between;
.name {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32rpx;
color: #323436;
}
.select {
display: flex;
align-items: center;
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #323436;
.arrow {
width: 24rpx;
height: 24rpx;
margin-left: 10rpx;
transition: all .3 ease;
}
.isAct {
transform: rotate(180deg);
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/merchantDataStatistics/merchantDataStatistics.wxml -->
<view class="merchantDataStatistics-con">
<view class="contitle">
<view class="name">广西宏泽汽车有限公司</view>
<view class="select">
<view>全部</view>
<image
class="arrow {{isAct?'isAct':''}}"
webp
src="{{IMAGES.arrow}}"
alt="" />
</view>
</view>
<scene-select/>
<!-- <view class="senceCon">
<view>1</view>
<view>2</view>
<view>3</view>
<view>4</view>
</view> -->
<view class="outputValueCon">
<view class="title">产值图</view>
<view class="swiperCon">
<view class="swiper">轮播图</view>
<!-- 统计 -->
<view class="merchantCount">
<view class="turnover">
<view class="img" />
<view class="num">200</view>
<view class="label">营业额</view>
</view>
<view class="customerUnitPrice">
<view class="img" />
<view class="num">2000</view>
<view class="label">营业额</view>
</view>
</view>
<!-- 指标诊断 -->
<view class="diagnosisCon">
<view class="img">图片</view>
<view class="tips">日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。</view>
</view>
</view>
</view>
</view>
// pages/tab/output/components/senceSelect/senceSelect.js
import { IMG_URL } from '~/utils/constantData'
const IMAGES = Object.freeze({
scene0: `${IMG_URL}/output/car01.png`,
scene1: `${IMG_URL}/output/car02.png`,
scene2: `${IMG_URL}/output/car03.png`,
scene3: `${IMG_URL}/output/car04.png`,
scene1Act: `${IMG_URL}/output/caract02.png`,
scene2Act: `${IMG_URL}/output/caract03.png`,
scene3Act: `${IMG_URL}/output/caract04.png`,
carselect: `${IMG_URL}/output/carselect.png`,
lock: `${IMG_URL}/output/lock.png`
// scene
})
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {
// active:1,
sceneList: [
{
name: '新车洽谈场景',
label: '1.0 新车权益销售',
total: '0',
imgUrl: IMAGES.scene0,
activation: false
// actImgUrl:IMAGES.scene1Act
},
{
name: '新车交付场景',
label: '1.1 新车精品升级',
total: '1000.45',
imgUrl: IMAGES.scene1,
actImgUrl: IMAGES.scene1Act,
activation: true
},
{
name: '0-12个月',
label: '1.2 新车线上转化',
total: '0',
imgUrl: IMAGES.scene2,
actImgUrl: IMAGES.scene2Act,
activation: false
},
{
name: '12个月以上',
label: '1.3 存量用户众筹',
total: '14580.45',
imgUrl: IMAGES.scene3,
actImgUrl: IMAGES.scene3Act,
activation: true
}
],
selectInd: 1,
IMAGES
},
/**
* 组件的方法列表
*/
methods: {}
})
/* pages/tab/output/components/senceSelect/senceSelect.wxss */
.sceneCon {
display: flex;
align-items: center;
justify-content: space-around;
padding: 27rpx 10rpx;
position: relative;
.itemCon {
position: relative;
box-sizing: border-box;
flex: 1;
height: 250rpx;
background-color: #F7F8FC;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 12rpx;
.itemImg {
position: relative;
.icon {
width: 56rpx;
height: 56rpx;
}
.lockIcon {
position: absolute;
top: -18rpx;
right: -18rpx;
// transform: translate(-50%, -50%);
width: 36rpx;
height: 36rpx;
}
}
.name {
font-size: 24rpx;
color: #8A8C90;
margin: 10rpx 0;
}
.name.activation {
font-weight: 600;
font-size: 24rpx;
color: #323436;
}
.label {
font-size: 18rpx;
color: #8A8C90;
}
.total {
font-weight: 500;
font-size: 24rpx;
color: #3666FE;
margin-top: 22rpx;
}
}
.itemCon+.itemCon {
margin-left: 4rpx;
}
.selectBgc {
border: 2px solid #3666FE;
// background-size: 150% 150%;
// background-size: cover;
/*按比例缩放*/
// background-repeat: no-repeat;
}
}
// .sceneCon
.itemCon.activation::before {
content: '已开通';
position: absolute;
top: 0rpx;
left: 0rpx;
width: 56rpx;
height: 32rpx;
line-height: 32rpx;
text-align: center;
font-size: 16rpx;
color: #EF971E;
background: #FEEBD6;
border-radius: 6rpx 0 8rpx 0;
}
\ No newline at end of file \ No newline at end of file
<!-- pages/tab/output/components/senceSelect/senceSelect.wxml -->
<view class="sceneCon">
<view wx:for='{{sceneList}}' wx:key='index' class="itemCon {{index==selectInd?'selectBgc':'itembgc'}} {{item.activation?'activation':''}}">
<!-- style="background-image:url({{IMAGES.carselect}})" -->
<view class="itemImg">
<image class="icon" src="{{item.activation?item.actImgUrl:item.imgUrl}}" webp></image>
<image
class="lockIcon"
wx:if="{{!item.activation}}"
src="{{IMAGES.lock}}"
webp></image>
</view>
<view class="name {{item.activation?'activation':''}}">{{item.name}}</view>
<view class="label">{{item.label}}</view>
<view class="total">¥{{item.total}}</view>
</view>
</view>
/* pages/tab/output/components/senceSelect/senceSelect.wxss */
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/components/senceSelect/senceSelect.wxml-->
<text>pages/tab/output/components/senceSelect/senceSelect.wxml</text>
<!--pages/tab/output/components/staff/staff.wxml--> <!-- pages/tab/output/components/staff/staff.wxml -->
<text>pages/tab/output/components/staff/staff.wxml</text> <view class="staffCon">
<!-- <img src="" alt=""> -->
<view>程序员在通宵建设中…</view>
</view>
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
.layout { .layout {
position: relative; position: relative;
padding: 400rpx 16rpx 0; // padding: 400rpx 16rpx 0;
padding-top: 400rpx;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
...@@ -32,4 +33,27 @@ ...@@ -32,4 +33,27 @@
} }
}
.navigation-title {
display: flex;
align-items: center;
justify-content: center;
}
.navigation-title-text {
text-align: center;
max-width: calc(100% - 24rpx);
}
.navigation-title .arrow {
width: 20rpx;
height: 16rpx;
margin-left: 4rpx;
transform: translateY(25%);
transition: all 0.5s;
}
.navigation-title .move {
transform: rotate(-180deg) translateY(0);
} }
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,23 @@ ...@@ -3,7 +3,23 @@
<view class="layout"> <view class="layout">
</view> --> </view> -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">服务商账号名称</navigation-bar> <navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<!-- <picker
range="{{merchantRange}}"
value="{{subIndex}}"
range-key="merchantName"
bindchange="changePicker"
bindtap="tapPicker"
bindcancel="tapPicker"
disabled="{{merchantRange.length < 2}}">
<view class="navigation-title">
<view class="navigation-title-text text-hide">{{merchantRange[subIndex].merchantName}}</view>
<view class="arrow {{moveArrow?'move':''}}" wx:if="{{merchantRange.length > 1}}">
<image src="{{${IMG_URL}/output/arrow.png}}" />
</view>
</view>
</picker> -->
</navigation-bar>
<view class="layout" style="padding-top:{{tabBarStyle}}px;"> <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<tab <tab
tab="{{tabList}}" tab="{{tabList}}"
...@@ -11,6 +27,7 @@ ...@@ -11,6 +27,7 @@
index="{{tabIndx}}" index="{{tabIndx}}"
bindclick="changeTabIndx" bindclick="changeTabIndx"
class="tabContainer" /> class="tabContainer" />
<!-- <view class="">{{IMG_URL}}</view> -->
<!-- 我的客户 --> <!-- 我的客户 -->
<view hidden="{{tabIndx != 0}}"> <view hidden="{{tabIndx != 0}}">
<client id="client" /> <client id="client" />
......
const _routeHooks = Symbol('_routeHooks') const _routeHooks = Symbol('_routeHooks')
const _query = Symbol('_query') const _query = Symbol('_query')
const _routerList = Symbol('_routerList') const _routerList = Symbol('_routerList')
import { import { IMG_URL } from '~/utils/constantData'
generateRoutList import { generateRoutList } from './wxOnAppRoute.js'
} from './wxOnAppRoute.js' import { getNavigationBarTitleText } from '~/utils/cache/storageApi'
import { import { getUserInfo } from '~/utils/cache/userInfo'
getNavigationBarTitleText
} from '~/utils/cache/storageApi'
import {
getUserInfo
} from '~/utils/cache/userInfo'
class Router { class Router {
[_query] = {}; [_query] = {};
[_routeHooks] = []; [_routeHooks] = [];
...@@ -20,6 +15,7 @@ class Router { ...@@ -20,6 +15,7 @@ class Router {
wx.onAppRoute(e => { wx.onAppRoute(e => {
let thisPage = this.getPageInstance() let thisPage = this.getPageInstance()
if (thisPage) { if (thisPage) {
thisPage.setData({ IMG_URL })
thisPage.options = this[_query] thisPage.options = this[_query]
this.setNavigationBarTitleText(thisPage) this.setNavigationBarTitleText(thisPage)
let onRoute = thisPage.onRoute let onRoute = thisPage.onRoute
...@@ -41,10 +37,7 @@ class Router { ...@@ -41,10 +37,7 @@ class Router {
if (getUserInfo()) title = getUserInfo().merchantName if (getUserInfo()) title = getUserInfo().merchantName
const router = `${thisPage.__route__}.html` const router = `${thisPage.__route__}.html`
if (__wxConfig && __wxConfig.page && __wxConfig.page[router]) { if (__wxConfig && __wxConfig.page && __wxConfig.page[router]) {
let { let { navigationBarTitleText, navigationStyle } = __wxConfig.page[router].window
navigationBarTitleText,
navigationStyle
} = __wxConfig.page[router].window
if (!title) title = '生意助手' if (!title) title = '生意助手'
if (!navigationBarTitleText && !navigationStyle) if (!navigationBarTitleText && !navigationStyle)
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
...@@ -116,10 +109,7 @@ class Router { ...@@ -116,10 +109,7 @@ class Router {
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层 * 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层
*/ */
go(route, events) { go(route, events) {
let { let { routerMapItem, query } = this.checkRouter(route, events)
routerMapItem,
query
} = this.checkRouter(route, events)
if (routerMapItem.isTab) { if (routerMapItem.isTab) {
wx.switchTab({ wx.switchTab({
url: routerMapItem.url url: routerMapItem.url
...@@ -133,20 +123,14 @@ class Router { ...@@ -133,20 +123,14 @@ class Router {
} }
/**关闭所有页面,打开到应用内的某个页面 */ /**关闭所有页面,打开到应用内的某个页面 */
reLaunch(route, events) { reLaunch(route, events) {
let { let { routerMapItem, query } = this.checkRouter(route, events)
routerMapItem,
query
} = this.checkRouter(route, events)
wx.reLaunch({ wx.reLaunch({
url: `${routerMapItem.url}${query}` url: `${routerMapItem.url}${query}`
}) })
} }
/**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */ /**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */
redirectTo(route, events) { redirectTo(route, events) {
let { let { routerMapItem, query } = this.checkRouter(route, events)
routerMapItem,
query
} = this.checkRouter(route, events)
wx.redirectTo({ wx.redirectTo({
url: `${routerMapItem.url}${query}` url: `${routerMapItem.url}${query}`
}) })
...@@ -183,4 +167,4 @@ class Router { ...@@ -183,4 +167,4 @@ class Router {
} }
} }
export default Router
\ No newline at end of file \ No newline at end of file
export default Router
import { IMG_URL } from '~/utils/constantData'
/** /**
* 执行路由前的准备工作 * 执行路由前的准备工作
*/ */
...@@ -7,8 +6,6 @@ import { IMG_URL } from '~/utils/constantData' ...@@ -7,8 +6,6 @@ import { IMG_URL } from '~/utils/constantData'
const routerBefore = next => { const routerBefore = next => {
// console.log("处理前置钩子逻辑"); // console.log("处理前置钩子逻辑");
// 配置图片全局路径 // 配置图片全局路径
let page = wx.$router.getPageInstance()
page && (page.data.IMG_URL = IMG_URL)
// page && page.setData({ IMG_URL }) // page && page.setData({ IMG_URL })
// console.log() // console.log()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!