Commit 85eabb11 by 张立顺

看产值外层页面功能开发完成

1 parent 55199f26
{ {
"pages": ["login/loading/loading","pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView","login/index/index"], "pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index"],
"requiredPrivateInfos": ["getLocation"], "requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
"selectedColor": "#3666FE", "selectedColor": "#3666FE",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [{ "list": [
{
"pagePath": "pages/tab/index/index", "pagePath": "pages/tab/index/index",
"text": "拓客户", "text": "拓客户",
"iconPath": "images/home.png", "iconPath": "images/home.png",
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
}, },
"subpackages": [], "subpackages": [],
"usingComponents": { "usingComponents": {
"tab": "/components/Tab/Tab"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
@import "/common.wxss"; @import "/style/common.wxss";
page { page {
background-color: #F7F7F7; background-color: #F7F7F7;
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
--themeColor: #F13C3D; --themeColor: #F13C3D;
--btnColor: #FC5B32; --btnColor: #3666FE;
--borderRadius: 8rpx; --borderRadius: 8rpx;
--margin: 32rpx; --margin: 32rpx;
} }
......
// components/Authorize/Authorize.js // components/Authorize/Authorize.js
import {
componentsMixin
} from '../../mixins/index'
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -39,7 +35,7 @@ Component({ ...@@ -39,7 +35,7 @@ Component({
} }
}, },
observers: { observers: {
'show': function (newVal) { show: function (newVal) {
this.setData({ this.setData({
openSet: newVal openSet: newVal
}) })
...@@ -48,9 +44,7 @@ Component({ ...@@ -48,9 +44,7 @@ Component({
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {},
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
...@@ -60,13 +54,8 @@ Component({ ...@@ -60,13 +54,8 @@ Component({
*/ */
noScroll: wx.$util.noScroll(), noScroll: wx.$util.noScroll(),
cancel(e) { cancel(e) {
let { let { confirm } = e.currentTarget.dataset
confirm let { buttonType, title } = this.data
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this let _this = this
if (buttonType == 'getUserInfo' && confirm) { if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({ wx.getUserProfile({
...@@ -87,11 +76,7 @@ Component({ ...@@ -87,11 +76,7 @@ Component({
/**检验是否已授权位置 */ /**检验是否已授权位置 */
check() { check() {
const _this = this const _this = this
let { let { buttonType, scopeType, autoOpen } = this.properties
buttonType,
scopeType,
autoOpen
} = this.properties
if (buttonType != 'getPhoneNumber') { if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}` let type = `scope.${scopeType}`
buttonType = 'openSetting' buttonType = 'openSetting'
...@@ -128,12 +113,9 @@ Component({ ...@@ -128,12 +113,9 @@ Component({
} }
}) })
} }
}, },
/**授权手机号 */ /**授权手机号 */
getPhoneNumber({ getPhoneNumber({ detail }) {
detail
}) {
console.log(detail) console.log(detail)
this.triggerEvent('getphonenumber', detail) this.triggerEvent('getphonenumber', detail)
} }
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
import Calendar from './Calendar_Function' import Calendar from './Calendar_Function'
import _component_ from './Static_Properties' import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction') const CalendarFunction = Symbol('CalendarFunction')
import {componentsMixin } from '../../mixins/index'
Component({ Component({
behaviors:[componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -24,7 +22,7 @@ Component({ ...@@ -24,7 +22,7 @@ Component({
this[CalendarFunction].setCalenderBodyHeight() this[CalendarFunction].setCalenderBodyHeight()
}, },
showCalendar(e) { showCalendar(e) {
let type = e && e.currentTarget && e.currentTarget.dataset.type || '' let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show' let result = type === 'show'
if (!result) { if (!result) {
this.setData({ this.setData({
...@@ -44,29 +42,19 @@ Component({ ...@@ -44,29 +42,19 @@ Component({
} }
}, },
dateChange(e) { dateChange(e) {
let { let { current } = e.detail
current
} = e.detail
this.setData({ this.setData({
current current
}) })
}, },
choose(e) { choose(e) {
let { let { dateType, minDate, maxDate } = this.data
dateType, let { data } = e.currentTarget.dataset
minDate,
maxDate
} = this.data
let {
data
} = e.currentTarget.dataset
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e) this[CalendarFunction][dateType](e)
}, },
done() { done() {
let { let { dateType } = this.data
dateType
} = this.data
this[CalendarFunction].done(dateType) this[CalendarFunction].done(dateType)
}, },
changeDate(e) { changeDate(e) {
......
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js // tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
import {
componentsMixin
} from '../../mixins/index'
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -30,7 +26,6 @@ Component({ ...@@ -30,7 +26,6 @@ Component({
hideTab hideTab
}) })
} }
} }
}, },
title: String, title: String,
...@@ -47,9 +42,7 @@ Component({ ...@@ -47,9 +42,7 @@ Component({
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {},
},
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -66,11 +59,9 @@ Component({ ...@@ -66,11 +59,9 @@ Component({
} }
}, },
attached() { attached() {
const { const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
isTab
} = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
this.setData({ this.setData({
isTab isTab
}) })
}, }
}) })
// components/SearchBox/SearchBox.js // components/SearchBox/SearchBox.js
import {componentsMixin } from '../../mixins/index';
Component({ Component({
behaviors: [componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
placeholder: { placeholder: {
type: String, type: String,
value: "请输入搜索内容", value: '请输入搜索内容'
}, },
value: { value: {
type: String, type: String,
value: "", value: '',
observer(n) { observer(n) {
this.setData({ this.setData({
inputValue: n, inputValue: n
}); })
}, }
}, },
searchType: { searchType: {
type: Number, type: Number,
value: 1, value: 1
}, },
couponDetails: Boolean, couponDetails: Boolean
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
inputValue: "", inputValue: ''
}, },
/** /**
...@@ -38,29 +36,29 @@ Component({ ...@@ -38,29 +36,29 @@ Component({
*/ */
methods: { methods: {
input(e) { input(e) {
let { value } = e.detail; let { value } = e.detail
this.setData({ this.setData({
inputValue: value, inputValue: value
}); })
}, },
blur(e) { blur(e) {
let { inputValue } = this.data; let { inputValue } = this.data
this.setData({ this.setData({
inputValue, inputValue
}); })
}, },
clear() { clear() {
this.setData({ this.setData({
inputValue: "", inputValue: ''
}); })
}, },
confirm(e) { confirm(e) {
let { value } = e.detail; let { value } = e.detail
this.triggerEvent("search", value); this.triggerEvent('search', value)
}, },
search(e) { search(e) {
let { value } = e.currentTarget.dataset; let { value } = e.currentTarget.dataset
this.triggerEvent("search", value); this.triggerEvent('search', value)
}, }
}, }
}); })
// components/SearchInput/SearchInput.js // components/SearchInput/SearchInput.js
import {componentsMixin } from '../../mixins/index'
Component({ Component({
behaviors:[componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -22,9 +20,7 @@ Component({ ...@@ -22,9 +20,7 @@ Component({
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {},
},
/** /**
* 组件的方法列表 * 组件的方法列表
...@@ -39,9 +35,7 @@ Component({ ...@@ -39,9 +35,7 @@ Component({
}) })
}, },
input(e) { input(e) {
let { let { value } = e.detail
value
} = e.detail
this.setValue(value) this.setValue(value)
this.triggerEvent('input', { this.triggerEvent('input', {
value value
...@@ -55,9 +49,7 @@ Component({ ...@@ -55,9 +49,7 @@ Component({
}, },
emit(e) { emit(e) {
let { let {
detail:{ detail: { value },
value
},
type type
} = e } = e
this.setData({ this.setData({
......
// components/Tab/Tab.js // components/Tab/Tab.js
import {componentsMixin } from '../../mixins/index'
Component({ Component({
behaviors:[componentsMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
...@@ -17,6 +15,7 @@ Component({ ...@@ -17,6 +15,7 @@ Component({
}) })
} }
}, },
itemWidth: String,
align: { align: {
type: String, type: String,
default: '' default: ''
...@@ -36,9 +35,7 @@ Component({ ...@@ -36,9 +35,7 @@ Component({
*/ */
methods: { methods: {
click(e) { click(e) {
let { let { count } = e.currentTarget.dataset
count
} = e.currentTarget.dataset
this.setData({ this.setData({
count, count,
to: `to-${count}` to: `to-${count}`
......
<block wx:if="{{openScroll}}"> <block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}"> <scroll-view
class="tab-box {{align}}"
scroll-x
enable-flex
scroll-with-animation
scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" > <view
<view class="text" >{{item}}</view> class="tab {{index==count?'active':''}}"
bindtap="click"
data-count="{{index}}"
id="to-{{index}}">
<view class="text">{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> --> <!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line"></view> <view class="line" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
...@@ -12,10 +21,15 @@ ...@@ -12,10 +21,15 @@
<block wx:else> <block wx:else>
<view class="tab-box flex"> <view class="tab-box flex">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}"> <view
class="tab {{index==count?'active':''}}"
style="width:{{itemWidth}}"
bindtap="click"
data-count="{{index}}">
<view class="text text-center">{{item}}</view> <view class="text text-center">{{item}}</view>
<view class="line"></view> <view class="line" style="lineStyle" />
</view> </view>
</block> </block>
</view> </view>
</block> </block>
/* components/Tab/Tab.wxss */ /* components/Tab/Tab.wxss */
@import "../../common.wxss";
.tab-box { .tab-box {
display: flex; display: flex;
/* display: grid; */
width: 100%; width: 100%;
height: 92rpx; height: 92rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.tab-box.left{
.tab-box.left {
padding-left: 32rpx; padding-left: 32rpx;
} }
.left .tab{
padding-right:40rpx; .left .tab {
padding-right: 40rpx;
} }
.flex .tab {
/* .flex .tab {
flex: 1; flex: 1;
} } */
.tab { .tab {
position: relative; position: relative;
flex-shrink: 0; flex-shrink: 0;
} }
.tab .text { .tab .text {
height: 84rpx; height: 84rpx;
display: flex; display: flex;
...@@ -28,18 +33,22 @@ ...@@ -28,18 +33,22 @@
color: #A9A9A9; color: #A9A9A9;
justify-content: center; justify-content: center;
} }
.left .text{
.left .text {
justify-content: flex-start; justify-content: flex-start;
} }
.flex .tab .text { .flex .tab .text {
padding: 0; padding: 0;
} }
.tab.active .text { .tab.active .text {
font-weight: 500; /* font-weight: 500; */
font-size: 28rpx; font-weight: 600;
font-size: 44rpx;
transition: all .25s; transition: all .25s;
color: #2C2C2C; color: #2C2C2C;
font-family: PingFangSC-S0pxibold;
} }
.tab .line { .tab .line {
......
...@@ -3,21 +3,17 @@ Component({ ...@@ -3,21 +3,17 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {},
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
tabIndx: 1
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {}
}
}) })
<!--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>
// pages/tab/output/output.js // pages/tab/output/output.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navStyle: 'background-color: rgba(0,0,0,0);', navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0, loginType: 0,
agree: true agree: true,
tabIndx: 1,
tabList: ['我的客户', '我的门店', '我的员工']
}, },
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
console.log(e)
},
changeTabIndx(e) {
this.setData({
tabIndx: e.detail
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {},
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {}
}
}) })
{ {
"usingComponents": { "usingComponents": {
"navigation-bar": "../../../components/NavigationBar/NavigationBar", "navigation-bar": "../../../components/NavigationBar/NavigationBar",
"tab": "../../../components/Tab/Tab",
"client": "./components/client/client", "client": "./components/client/client",
"merchant": "./components/merchant/mrechant", "merchant": "./components/merchant/mrechant",
"staff": "./components/staff/staff" "staff": "./components/staff/staff"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.layout { .layout {
position: relative; position: relative;
padding: 400rpx 32rpx 0; padding: 400rpx 16rpx 0;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
...@@ -26,22 +26,10 @@ ...@@ -26,22 +26,10 @@
top: 0; top: 0;
z-index: -1; z-index: -1;
} }
.button {
width: 100%; .tabContainer {
height: 88rpx; height: 100rpx;
background: #3666FE;
border-radius: 8rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
line-height: 88rpx;
padding: 0;
}
.disabled{
background: #CCCED1;
}
.btn-hover {
opacity: .75;
} }
} }
\ No newline at end of file \ No newline at end of file
<!--pages/tab/output/output.wxml--> <!-- pages/tab/output/output.wxml -->
<!-- <navigation-bar navStyle="{{navStyle}}">服务商账号名称</navigation-bar> <!-- <navigation-bar navStyle="{{navStyle}}">服务商账号名称</navigation-bar>
<view class="layout"> <view class="layout">
</view> --> </view> -->
<navigation-bar navStyle="{{navStyle}}" bindnavbarReady="navbarReady">服务商账号名称</navigation-bar>
<navigation-bar navStyle="{{navStyle}}">服务商账号名称</navigation-bar> <view class="layout" style="padding-top:{{tabBarStyle}}px;">
<view class="layout"> <tab
tab="{{tabList}}"
itemWidth="{{'27%'}}"
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer" />
<!-- 我的客户 --> <!-- 我的客户 -->
<client></client> <view hidden="{{tabIndx != 0}}">
<client id="client" />
</view>
<!-- 我的门店 --> <!-- 我的门店 -->
<merchant></merchant> <view hidden="{{tabIndx != 1}}">
<merchant id="merchant" />
</view>
<!-- 我的员工 --> <!-- 我的员工 -->
<staff></staff> <view hidden="{{tabIndx != 2}}">
<staff id="staff" />
</view>
</view> </view>
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
z-index: 2; z-index: 2;
background-color: #fff; background-color: #fff;
} }
.flex-center { .flex-center {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -59,3 +60,15 @@ ...@@ -59,3 +60,15 @@
bottom: constant(safe-area-inset-bottom) !important; bottom: constant(safe-area-inset-bottom) !important;
bottom: env(safe-area-inset-bottom) !important; bottom: env(safe-area-inset-bottom) !important;
} }
.c-blue {
color: #3666FE;
}
.c-white {
color: #fff;
}
.bgc-blue {
background-color: #3666FE;
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!