Commit bccc3261 by 张立顺

页面初始化

1 parent dcdf42ce
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 1 let index = 2
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
/* packageEquity/pages/carQuotation/updateOrderInfo/updateOrderInfo.wxss */
\ No newline at end of file \ No newline at end of file
// const api = wx.$request
import api from '~/utils/request/request.js'
// const api = wx.$request
module.exports = {
/**退出*/
logout() {
return api.post('dj.api.smartcarlife.logout')
},
/** 获取工位设置信息 */
getWorkSetting() {
return api.post('dj.api.smartcarlife.inviteStationSet.get')
},
/**更新工位设置 */
setWorkSetting(data) {
return api.post('dj.api.smartcarlife.inviteStationSet.update', data)
},
/** 获取我的种草总数 */
GETGRASSTOTAL(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.own.count', data)
},
/** 分页查询我的种草 */
GETGRASSLIST(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.own.page', data)
}
}
// components/switchPopup/switchPopup.js
const app = getApp()
import api from '~/api/api'
import { getYQorderInfo } from '~/store/index'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: true
// observer: function (n) {
// if (n) {
// this.checkCoupon()
// }
// }
},
title: String,
tips: String,
height: {
type: String,
value: '85%'
},
isYqdSuper: Boolean
// merchantSettingInfo: {
// type: Object,
// observer: function (n) {
// if (n) {
// this.setOrderSettingList(n)
// }
// }
// }
},
/**
* 组件的初始数据
*/
data: {
merchantSettingInfo: '',
// switchStatus: 1,
orderSettingList: [
{
label: '选择车型',
valueName: 'carTypeRequiredFlag',
value: false
},
{
label: '车架号(VIN码)',
valueName: 'standNoRequiredFlag',
value: false
},
{
label: '车牌号',
valueName: 'plateNumRequiredFlag',
value: false
},
{
label: '战败下单是否体验',
valueName: 'foEfRequiredFlag',
value: true
},
{
label: '战败下单拒升理由提交',
valueName: 'foRrRequiredFlag',
value: true
}
]
},
/** 组件生命周期 */
lifetimes: {
attached: function () {
// console.log(app.globalData.isYqdSuper)
console.log(this.data.isYqdSuper)
// app .
getYQorderInfo()
.then(merchantSettingInfo => {
console.log(merchantSettingInfo)
this.setData({ merchantSettingInfo })
this.setOrderSettingList(merchantSettingInfo)
})
.catch(err => {
console.log(err)
})
}
},
/**
* 组件的方法列表
*/
methods: {
async confirm() {
// 判断是不是园区店管理员 不是都不处理
let { isYqdSuper, merchantSettingInfo, orderSettingList } = this.data
// 是管理员请求数据 并存全局读取
if (isYqdSuper) {
let { merchantId, merchantName } = merchantSettingInfo
wx.$util.showLoading('设置中...')
let params = orderSettingList.reduce((obj, item) => {
obj[item.valueName] = item.value == true ? 'Y' : 'N'
// item
return obj
}, {})
let result = await api.setMerchantRecordingSettings({
merchantId,
merchantName,
...params
})
let { code, data } = result
if (code == 0) {
app.globalData.YQorderSetting = Object.assign(app.globalData.YQorderSetting, params)
}
wx.$util.hideLoading()
}
this.setData({
show: false
})
},
onSwitchChange(e) {
// console.log(e)
let { index } = e.currentTarget.dataset
let { orderSettingList } = this.data
// console.log(index)
orderSettingList[index]['value'] = !orderSettingList[index]['value']
// console.log(orderSettingList[index]['value'])
this.setData({
orderSettingList
})
},
setOrderSettingList(n) {
// 做转换
let { orderSettingList } = this.data
orderSettingList.forEach(element => {
// if (element.valueName == n) {
let value = n[element.valueName]
element.value = value == 'Y' ? true : false
// }
})
console.log(orderSettingList)
this.setData({
orderSettingList
})
}
}
})
{
"component": true,
"usingComponents": { "switch-block": "/components/switchBlock/switchBlock", "tab-popup": "/components/tabPopup/tabPopup" }
}
<tab-popup
show="{{show}}"
title="{{title}}"
height="{{height}}"
tips="{{tips}}"
bindconfirm="confirm">
<block
wx:for="{{orderSettingList}}"
wx:key="index"
wx:for-item="item"
wx:for-index="index">
<gl-cell
border
label="{{item.label}}"
valueAlign="right"
labelWidth="240rpx">
<!-- <switchBlock/> -->
<switch-block
switchStatus="{{item.value}}"
disable="{{isYqdSuper}}"
bindswitchEvent="onSwitchChange"
data-index="{{index}}" />
<!-- <view class="gender-box">
<view class="block text-center {{orderObj.customer.customerSex==1?'':'right'}}" />
<view class="male text-center {{orderObj.customer.customerSex == 1?'active':''}}" bindtap="changeGender" data-gender="1">
男
</view>
<view class="woman text-center {{orderObj.customer.customerSex == 2?'active':''}}" bindtap="changeGender" data-gender="2">
女
</view>
</view> -->
</gl-cell>
</block>
</tab-popup>
/* components/switchPopup/switchPopup.wxss */
\ No newline at end of file \ No newline at end of file
// tabComponents/pages/index/index.js
import api from '../../api.js'
const app = getApp()
import constantData from '~/pages/constant/data'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/mine/'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;',
workCount: 0,
workItem: [{
label: '上午 09:00-10:30',
startTime: '09:00',
endTime: '10:30',
maxCount: 0
},
{
label: '上午 10:30-12:00',
startTime: '10:30',
endTime: '12:00',
maxCount: 0
},
{
label: '下午 13:00-14:30',
startTime: '13:00',
endTime: '14:30',
maxCount: 0
},
{
label: '下午 14:30-16:00',
startTime: '14:30',
endTime: '16:00',
maxCount: 0
},
{
label: '下午 16:00-17:30',
startTime: '16:00',
endTime: '17:30',
maxCount: 0
}
],
grassNum: '',
showMerchantPop: false,
merchantPopConfig: {
height: '70%',
title: '录单设置',
tips: '设置录单时客户信息的必填项。'
},
isYqdSuper: '',
loginRoleLabel: {
1: '超管',
2: '商户管理员',
3: '区域督导',
4: '驻店负责人'
},
selectedSceneName: '',
selectedSceneDesc: '',
versionData: {}
},
goReservationCouponPage() {
},
goTechnicianSetupPage() {
wx.$router.go('tabMine.technicianSetup')
},
goConstructSetupPage() {
},
changeSwitch(e) {
let {
value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({
[target]: value
})
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
showNavBar: true,
navBarHeight
})
},
noScroll() {},
showWork() {
let {
showWorkBox
} = this.data
this.setData({
showWorkBox: !showWorkBox
})
},
addWorkCount(e) {
let {
count,
index
} = e.currentTarget.dataset
let type = e.type
let {
workItem,
touchEnd,
userInfo: {
userType
}
} = this.data
if (userType == 2) return
let value = workItem[index].maxCount
value += count
if (value < 0) value = 0
if (value > 50) value = 50
this.setData({
[`workItem[${index}].maxCount`]: value
})
if (touchEnd) return
if (type == 'longtap') {
setTimeout(() => {
this.addWorkCount(e)
}, 200)
}
},
touchstart() {
this.setData({
touchEnd: false
})
},
touchend() {
this.setData({
touchEnd: true
})
},
// input(e) {
// let {
// value
// } = e.detail
// let {
// index
// } = e.currentTarget.dataset
// value = Number(value)
// if (value < 0) value = 0
// else if (value > 50) value = 50
// this.setData({
// [`workItem[${index}].maxCount`]: value
// })
// },
confirm() {
let {
workItem,
saturdayFlag,
sundayFlag,
userInfo: {
userType
}
} = this.data
if (userType == 2) {
this.showWork()
return
}
workItem.map(e => {
e.saturdayFlag = saturdayFlag ? 'Y' : 'N'
e.sundayFlag = sundayFlag ? 'Y' : 'N'
})
this.showLoading('提交中...')
api
.setWorkSetting({
setList: workItem
})
.then(res => {
wx.hideLoading()
let {
code,
message
} = res
if (code == 0) {
this.setData({
showWorkBox: false
})
this.showLoading('更新中...')
this.getWorkSetting()
} else {
this.showToast(message)
}
})
},
logout() {
let _this = this
wx.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
_this.setData({
flag: true
})
_this.showLoading()
api.logout().then(_res_ => {
let {
code,
message
} = _res_
if (code == 0) {
app.login(false)
} else {
_this.setData({
flag: false
})
_this.showToast(message)
}
})
}
}
})
},
getWorkSetting() {
let {
workItem,
saturdayFlag,
sundayFlag
} = this.data
let workCount = 0
api.getWorkSetting().then(res => {
wx.hideLoading()
let {
code,
data,
message
} = res
if (code == 0) {
if (data?.length > 0) {
data.map((e, index) => {
workItem[index].maxCount = e.maxCount
saturdayFlag = e.saturdayFlag == 'Y'
sundayFlag = e.sundayFlag == 'Y'
workCount += e.maxCount
})
}
} else {
this.showToast(message)
}
this.setData({
workItem,
workCount,
saturdayFlag,
sundayFlag
})
})
},
init() {
let {
userInfo
} = this.data
// console.log(userInfo)
// 兼容ios IOS只识别2017/01/01这种格式
// console.log(userInfo.createdDate)
if (userInfo.createdDate) {
let date = userInfo.createdDate + ''
date = date.replace(/-/g, '/').split(' ')[0] // 日期格式处理
this.setData({
['userInfo.createdTime']: date
})
}
if (userInfo.merchantType) this.getWorkSetting()
// wx.$util.getStorageSync('dj_boutique_system_info')
// console.log('wx.$storage ', wx.$storage)
let systemInfo = wx.$storage.get('system_info')
// console.log(systemInfo)
if (!userInfo.userAvatarUrl && systemInfo.environment) this.getAvatar(userInfo)
},
getAvatar(userInfo) {
let _this = this
// wx.qy.getAvatar({
// success(res) {
// _this.setData({
// ['userInfo.userAvatarUrl']: res.avatar
// })
// userInfo.userAvatarUrl = res.avatar
// // wx.$util.setUserInfo(userInfo)
// }
// })
},
showMerchantPop() {
this.setData({
showMerchantPop: true
})
},
// 获取版本信息
async getVersionInfo() {
const versionData = await getApp().getVersionInfo()
this.setData({
versionData
})
},
// 更新日志
goVersionPage() {
wx.$router.go('pages.log')
},
// 切换场景
changeScene() {
wx.$util.pointRecord(31)
wx.$router.go('pages.changeScene')
},
// 切换账号
changeAccount() {
wx.$router.reLaunch('pages.accountItems')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.getTotal()
let userInfo = wx.$util.getUserInfo()
this.setData({
isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc
})
this.getVersionInfo()
// console.log(app.globalData.isYqdSuper)
},
jump: e => wx.$router.jump(e),
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// this.getTotal()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 查看我的种草
*/
goGrass: function () {
wx.navigateTo({
url: '/tabMine/pages/grass/index'
})
},
/** 获取种草总数 */
getTotal: function () {
let _this = this
api.GETGRASSTOTAL().then(res => {
if (res.code != 0) {
wx.showToast({
title: res.message,
icon: 'none'
})
return false
}
_this.setData({
grassNum: res.data
})
})
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"switch-popup": "../../components/switchPopup/switchPopup"
}
}
/* tabMine/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!-- src引入filter.wxs, module给模块起名 -->
<!-- <wxs src="./index.wxs" module="filter" /> -->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}">我的</navigation-bar>
<view class="bg"></view>
<block wx:if="{{!flag}}">
<block wx:if="{{navBarHeight > 0}}">
<view class="main" style="margin-top:calc({{navBarHeight}}px + 104rpx)">
<view class="user-box">
<view class="user-avatar">
<block wx:if="{{userInfo.userAvatarUrl}}">
<image src="{{userInfo.userAvatarUrl}}" bindtap="getAvatar" />
</block>
<block wx:else>
<open-data type="userAvatarUrl" />
</block>
</view>
<view class="name_box">
<view class="item name text-hide">{{userInfo.name}}</view>
<view class="change_btn" bindtap="changeAccount">切换账号</view>
</view>
<view class="user-info">
<view class="user-text">
<view class="item">
所属园区:{{userInfo.merchantName}}{{userInfo.isSuper==true?'(超管)':loginRoleLabel[userInfo.loginRole]}}
</view>
<view class="item">商户号:{{userInfo.merchantId}}</view>
</view>
</view>
</view>
<block >
<!-- <view class="scene_box">
<view class="title">场景</view>
<view class="select_item">
<view class="scene_message">
<view class="scene_icon">
<image src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/scene_type_{{userInfo.sceneType}}.png" mode=""/>
</view>
<view class="scene_text">
<view class="name">
<view>{{selectedSceneName}}</view>
<view class="name_tips">当前</view>
</view>
<view class="tips">{{selectedSceneDesc}}</view>
</view>
</view>
<view class="change_btn" bindtap="changeScene">切换场景</view>
</view>
</view> -->
<view class="set_box">
<view class="set_item item_1" bindtap="showWork">
<view class="title">工位设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips" wx:if="{{workCount>0}}"><text style="font-size: 32rpx;color: #333333; font-weight: 500;">{{workCount}}</text>个</view>
<view class="set_tips" wx:else>根据门店设置工位数</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_4.png" mode=""/>
</view>
<view class="set_item item_2" bindtap="showMerchantPop">
<view class="title">录单设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置录单必填项</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_2.png" mode=""/>
</view>
<view class="set_item item_3" bindtap="changeScene">
<view class="title">场景切换<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">{{selectedSceneName}}</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_3.png" mode=""/>
</view>
<view class="set_item item_4" bindtap="goVersionPage">
<view class="title">更新日志<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">最新{{versionData.version}}版</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_1.png" mode=""/>
</view>
<view class="set_item item_5" bindtap="goReservationCouponPage">
<view class="title">领券预约<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置接待电话</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_5.png" mode=""/>
</view>
<view class="set_item item_6" bindtap="goTechnicianSetupPage">
<view class="title">技师设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置园区店技师</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_6.png" mode=""/>
</view>
<view class="set_item item_7" bindtap="goConstructSetupPage">
<view class="title">完成施工<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置施工完成上传图片</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_7.png" mode=""/>
</view>
</view>
<!-- <view class="version_box" bindtap="goVersionPage">
<view class="item">
<view class="icon_box">
<view class="is_new" hidden="{{!versionData.isNew}}">NEW</view>
</view>
<view>更新日志</view>
</view>
</view> -->
</block>
<view class="logout text-center" bindtap="logout">退出账号</view>
</view>
</block>
<block wx:if="{{showWorkBox}}">
<view class="work-box" catchtouchmove="noScroll">
<view class="work-bg" bindtap="showWork" />
<view class="work-content">
<view class="work-title text-center hasborder">工位设置</view>
<view class="work-body">
<block wx:for="{{workItem}}" wx:key="index">
<view class="item hasborder">
<view class="label">{{item.label}}</view>
<view class="value">
<view
class="minus {{userInfo.userType == 2 ?'disabled':''}}"
bindtap="addWorkCount"
data-count="{{-1}}"
data-index="{{index}}"
bindlongtap="addWorkCount"
bindtouchend="touchend"
bindtouchstart="touchstart">
-
</view>
<view class="input text-center {{userInfo.userType == 2 ?'disabled':''}}">
{{item.maxCount}}
</view>
<view
class="add {{userInfo.userType == 2 ?'disabled':''}}"
bindtap="addWorkCount"
data-count="{{1}}"
data-index="{{index}}"
bindlongtap="addWorkCount"
bindtouchend="touchend"
bindtouchstart="touchstart">
+
</view>
个
</view>
</view>
</block>
<view class="item hasborder">
<view class="label">周六施工</view>
<switch
class="{{userInfo.userType == 2 ?'disabled':''}}"
disabled="{{userInfo.userType == 2}}"
color="#347BFF"
isYqdSuper="{{isYqdSuper}}"
checked="{{saturdayFlag}}"
bindchange="changeSwitch"
data-target="saturdayFlag" />
</view>
<view class="item hasborder">
<view class="label">周日施工</view>
<switch
class="{{userInfo.userType == 2 ?'disabled':''}}"
disabled="{{userInfo.userType == 2}}"
color="#347BFF"
checked="{{sundayFlag}}"
bindchange="changeSwitch"
data-target="sundayFlag" />
</view>
<view class="tips">设置门店每日每个时段可接待的客户人数, 施工时段以1个半小时为准,请合理安排施工进度</view>
</view>
<view class="work-footer">
<view class="cancel text-center" bindtap="showWork">取消</view>
<view class="confirm text-center" bindtap="confirm">确定</view>
</view>
</view>
</view>
</block>
<!-- isYqdSuper -->
<switch-popup
show="{{showMerchantPop}}"
height="{{merchantPopConfig.height}}"
title="{{merchantPopConfig.title}}"
isYqdSuper="{{isYqdSuper}}"
tips="{{merchantPopConfig.tips}}" />
</block>
/* tabComponents/pages/index/index.wxss */
.main {
}
.bg {
width: 100%;
height: 350rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/navgation_bg.png') no-repeat;
background-size: 100% 526rpx;
background-color: #fff;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.user-box {
position: relative;
border-radius: 32rpx 32rpx 0 0;
background: #FFFFFF;
font-size: 28rpx;
color: #333333;
}
.user-avatar {
width: 108rpx;
height: 108rpx;
overflow: hidden;
border-radius: 100%;
box-sizing: border-box;
position: absolute;
left: 50rpx;
top: -32rpx;
border: 4rpx solid #fff;
}
.name_box{
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 32rpx 40rpx 182rpx;
}
.name_box .name {
font-size: 40rpx;
color: #323436;
font-weight: 600;
}
.change_btn{
width: 134rpx;
height: 48rpx;
background: rgba(52, 123, 255, .1);
color: #347BFF;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 24rpx;
}
.user-info {
padding: 0 50rpx;
}
.user-text {
width: 100%;
}
.user-text .item {
color: #5A6066;
font-size: 24rpx;
margin: 4rpx;
}
.scene_box{
margin: 20rpx;
margin-top: 48rpx;
box-sizing: border-box;
height: 236rpx;
background: #b8d6ff1a;
border-radius: 16rpx;
padding: 20rpx 32rpx;
}
.scene_box .title {
color: #323436;
font-size: 28rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.select_item{
display: flex;
align-items: center;
justify-content: space-between;
}
.select_item .scene_message{
display: flex;
align-items: center;
}
.select_item .scene_icon{
width: 128rpx;
height: 128rpx;
margin-right: 24rpx;
}
.select_item .scene_text .name{
color: #333333;
font-size: 32rpx;
font-weight: 500;
display: flex;
align-items: center;
}
.select_item .scene_text .name .name_tips{
width: 64rpx;
height: 30rpx;
line-height: 30rpx;
text-align: center;
font-size: 24rpx;
background: #ff9d0a0d;
border: 1rpx solid #ff9d0a4d;
color: #FF9D0A;
border-radius: 4rpx;
margin-left: 4rpx;
}
.select_item .scene_text .tips{
font-size: 24rpx;
color: #9B9B9E;
margin-top: 8rpx;
}
.select_item .change_btn{
margin: 0;
}
.set_box{
margin: 20rpx;
margin-top: 48rpx;
display: grid;
grid-template-columns: repeat(auto-fill, 344rpx);
justify-content: space-between;
align-items: center;
}
.set_box .set_item{
box-sizing: border-box;
width: 344rpx;
height: 168rpx;
border-radius: 16rpx;
display: flex;
flex-flow: column;
justify-content: center;
padding: 32rpx;
margin-bottom: 20rpx;
position: relative;
}
.set_box .set_item .icon_image{
width: 120rpx;
height: 120rpx;
position: absolute;
right: 0;
bottom: 0;
}
.set_box .set_item .title .arrow_icon{
width: 40rpx;
height: 40rpx;
}
.set_box .item_1{
background: #F8FFFD;
}
.set_box .item_2{
background: #F8F9FF;
}
.set_box .item_3{
background: #F6FCFE;
}
.set_box .item_4{
background: #FFF8F8;
}
.set_box .item_5{
background: #FFFCF7;
}
.set_box .item_6{
background: #F8FFFD;
}
.set_box .item_7{
background: #F6FCFE;
}
.set_box .set_item .title{
font-weight: 500;
font-size: 28rpx;
color: #333333;
letter-spacing: 0;
}
.set_box .set_item .set_tips{
font-weight: 400;
font-size: 24rpx;
color: #9B9B9E;
margin-top: 8rpx;
}
.version_box{
margin-top: 28rpx;
display: grid;
grid-template-columns: repeat(auto-fill, 190rpx);
align-items: center;
font-size: 24rpx;
color: #323436;
}
.version_box .icon_box{
width: 90rpx;
height: 90rpx;
background: #FAFAFA;
border-radius: 16rpx;
position: relative;
}
.version_box .item{
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
.version_box .is_new {
font-size: 20rpx;
text-align: center;
color: #fff;
position: absolute;
top: -14rpx;
right: -28rpx;
background-image: linear-gradient(0deg, #347BFF 0%, #3B8FFE 100%);
width: 56rpx;
height: 28rpx;
line-height: 28rpx;
border-radius: 4rpx;
}
.version_box .is_new::before {
content: "";
position: absolute;
top: 8rpx;
left: -6rpx;
transform: rotate(-90deg);
margin-left: -6rpx; /* 调整尖角位置 */
border-width: 6rpx;
border-style: solid;
border-color: transparent transparent #007bff transparent;
}
.work-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
}
.work-box .work-bg {
position: absolute;
opacity: 0.6;
background: #000000;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.work-box .work-content {
position: absolute;
z-index: 2;
background-color: #fff;
border-radius: 20rpx 20rpx 0 0;
overflow: hidden;
left: 0;
width: 100%;
padding: 0 32rpx;
box-sizing: border-box;
color: #323233;
animation: show-work-box .5s forwards;
}
@keyframes show-work-box {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
.work-title {
height: 100rpx;
}
.work-body .item {
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24rpx;
font-size: 28rpx;
}
.hasborder {
border-bottom: 1rpx solid #EBEDF0;
}
.work-body .item .value {
display: flex;
align-items: center;
}
.work-body .item .value .minus,
.work-body .item .value .add {
width: 44rpx;
height: 44rpx;
color: #347BFF;
background: #F7F7F7;
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
font-weight: 700;
}
.work-body .item .value .add {
margin-right: 16rpx;
}
.work-body .item .value .input {
width: 68rpx;
height: 44rpx;
background: #F7F7F7;
border-radius: 6rpx;
margin: 0 2rpx;
text-align: center;
font-size: 24rpx;
color: #333333;
}
.work-body .item switch {
zoom: .8;
}
.work-body .tips {
height: 146rpx;
font-size: 24rpx;
color: #999999;
display: flex;
align-items: center;
width: 500rpx;
margin: 0 auto;
}
.work-footer {
display: flex;
height: 100rpx;
align-items: center;
justify-content: space-between;
}
.work-footer .cancel,
.work-footer .confirm {
width: 330rpx;
height: 80rpx;
box-sizing: border-box;
font-size: 28rpx;
border-radius: 12rpx;
}
.work-footer .cancel {
background: #FFFFFF;
border: 2rpx solid #DCDEE0;
color: #323233;
}
.work-footer .confirm {
background: #347BFF;
color: #fff;
}
.work-box .disabled {
opacity: .5;
}
.logout {
position: fixed;
bottom: 106rpx;
left: 50%;
transform: translateX(-50%);
width: 326rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #DCDEE0;
border-radius: 12rpx;
color: #6C6C70;
font-size: 28rpx;
}
.c_blue {
color: #347BFF;
}
.set_box_grass {
margin-top: 20rpx;
}
.m-t-0 {
margin-top: 20rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -11,8 +11,7 @@ Page({ ...@@ -11,8 +11,7 @@ Page({
IMG_URL, IMG_URL,
navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;', navStyle: 'background-color: rgba(0,0,0,0);box-shadow:none;',
workCount: 0, workCount: 0,
workItem: [ workItem: [{
{
label: '上午 09:00-10:30', label: '上午 09:00-10:30',
startTime: '09:00', startTime: '09:00',
endTime: '10:30', endTime: '10:30',
...@@ -51,28 +50,32 @@ Page({ ...@@ -51,28 +50,32 @@ Page({
tips: '设置录单时客户信息的必填项。' tips: '设置录单时客户信息的必填项。'
}, },
isYqdSuper: '', isYqdSuper: '',
loginRoleLabel:{ loginRoleLabel: {
1:'超管', 1: '超管',
2:'商户管理员', 2: '商户管理员',
3:'区域督导', 3: '区域督导',
4:'驻店负责人' 4: '驻店负责人'
}, },
selectedSceneName: '', selectedSceneName: '',
selectedSceneDesc: '', selectedSceneDesc: '',
versionData: {} versionData: {}
}, },
goReservationCouponPage () { goReservationCouponPage() {
}, },
goTechnicianSetupPage () { goTechnicianSetupPage() {
wx.$router.go('technicianSetup')
}, },
goConstructSetupPage () { goConstructSetupPage() {
}, },
changeSwitch(e) { changeSwitch(e) {
let { value } = e.detail let {
let { target } = e.currentTarget.dataset value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({ this.setData({
[target]: value [target]: value
}) })
...@@ -86,18 +89,25 @@ Page({ ...@@ -86,18 +89,25 @@ Page({
}, },
noScroll() {}, noScroll() {},
showWork() { showWork() {
let { showWorkBox } = this.data let {
showWorkBox
} = this.data
this.setData({ this.setData({
showWorkBox: !showWorkBox showWorkBox: !showWorkBox
}) })
}, },
addWorkCount(e) { addWorkCount(e) {
let { count, index } = e.currentTarget.dataset let {
count,
index
} = e.currentTarget.dataset
let type = e.type let type = e.type
let { let {
workItem, workItem,
touchEnd, touchEnd,
userInfo: { userType } userInfo: {
userType
}
} = this.data } = this.data
if (userType == 2) return if (userType == 2) return
let value = workItem[index].maxCount let value = workItem[index].maxCount
...@@ -143,7 +153,9 @@ Page({ ...@@ -143,7 +153,9 @@ Page({
workItem, workItem,
saturdayFlag, saturdayFlag,
sundayFlag, sundayFlag,
userInfo: { userType } userInfo: {
userType
}
} = this.data } = this.data
if (userType == 2) { if (userType == 2) {
this.showWork() this.showWork()
...@@ -160,7 +172,10 @@ Page({ ...@@ -160,7 +172,10 @@ Page({
}) })
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
let { code, message } = res let {
code,
message
} = res
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
showWorkBox: false showWorkBox: false
...@@ -185,7 +200,10 @@ Page({ ...@@ -185,7 +200,10 @@ Page({
}) })
_this.showLoading() _this.showLoading()
api.logout().then(_res_ => { api.logout().then(_res_ => {
let { code, message } = _res_ let {
code,
message
} = _res_
if (code == 0) { if (code == 0) {
app.login(false) app.login(false)
} else { } else {
...@@ -200,11 +218,19 @@ Page({ ...@@ -200,11 +218,19 @@ Page({
}) })
}, },
getWorkSetting() { getWorkSetting() {
let { workItem, saturdayFlag, sundayFlag } = this.data let {
workItem,
saturdayFlag,
sundayFlag
} = this.data
let workCount = 0 let workCount = 0
api.getWorkSetting().then(res => { api.getWorkSetting().then(res => {
wx.hideLoading() wx.hideLoading()
let { code, data, message } = res let {
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
if (data?.length > 0) { if (data?.length > 0) {
data.map((e, index) => { data.map((e, index) => {
...@@ -226,7 +252,9 @@ Page({ ...@@ -226,7 +252,9 @@ Page({
}) })
}, },
init() { init() {
let { userInfo } = this.data let {
userInfo
} = this.data
// console.log(userInfo) // console.log(userInfo)
// 兼容ios IOS只识别2017/01/01这种格式 // 兼容ios IOS只识别2017/01/01这种格式
// console.log(userInfo.createdDate) // console.log(userInfo.createdDate)
...@@ -291,7 +319,7 @@ Page({ ...@@ -291,7 +319,7 @@ Page({
this.setData({ this.setData({
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName, selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc:constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc
}) })
this.getVersionInfo() this.getVersionInfo()
// console.log(app.globalData.isYqdSuper) // console.log(app.globalData.isYqdSuper)
...@@ -355,4 +383,4 @@ Page({ ...@@ -355,4 +383,4 @@ Page({
}) })
}) })
} }
}) })
\ No newline at end of file \ No newline at end of file
// tabMine/pages/technicianSetup/technicianSetup.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "技师设置",
"usingComponents": {
}
}
\ No newline at end of file \ No newline at end of file
/* tabMine/pages/technicianSetup/technicianSetup.wxss */
\ No newline at end of file \ No newline at end of file
<!--tabMine/pages/technicianSetup/technicianSetup.wxml-->
<text>tabMine/pages/technicianSetup/technicianSetup.wxml</text>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!