Commit 0be7a79e by 前端

1111

1 parent 823d50e0
......@@ -174,6 +174,10 @@ page {
pointer-events: none;
}
.disabled {
opacity: .5;
}
.btns {
position: fixed;
/* position: absolute; */
......
......@@ -2,7 +2,7 @@
<view class="main {{isFullSucreen?'isFullSucreen':''}}">
<view class="switch-v">
<view class="label">设置园区店集中接待电话</view>
<switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{info.yqMerchantEnableFlag}}" bindchange="changeYQSwitch" data-target="info.yqMerchantEnableFlag" />
<switch color="#347BFF" class=" {{userInfo.userType == 2 ?'disabled':''}}" disabled="{{!isYqdSuper}}" checked="{{info.yqMerchantEnableFlag}}" bindchange="changeYQSwitch" data-target="info.yqMerchantEnableFlag" />
</view>
<view class="setItem {{info.yqMerchantEnableFlag?'':'itemOP'}}">
<view class="item-label">{{info.yqMerchantName}}</view>
......@@ -23,7 +23,7 @@
</view>
<view class="switch-v">
<view class="label">设置单店驻店接待电话</view>
<switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{info.shopMerchantEnableFlag}}" bindchange="change4sSwitch" data-target="info.shopMerchantEnableFlag" />
<switch color="#347BFF" class=" {{userInfo.userType == 2 ?'disabled':''}}" disabled="{{!isYqdSuper}}" checked="{{info.shopMerchantEnableFlag}}" bindchange="change4sSwitch" data-target="info.shopMerchantEnableFlag" />
</view>
<block wx:for="{{info.shopMerchantConfigList}}" wx:key="index">
<view class="setItem {{info.shopMerchantEnableFlag?'':'itemOP'}}">
......@@ -48,6 +48,6 @@
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" />
<view class="btns-con">
<view class="confirm text-center" bindtap="submit">批量提交</view>
<view class="confirm text-center {{userInfo.userType == 2 ?'disabled':''}}" bindtap="submit">批量提交</view>
</view>
</view>
\ No newline at end of file
// tabMine/pages/completeBuild/completeBuild.js
import api from '../../api.js'
import {
ImgUrl
ImgUrl
} from '~/config';
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL: ImgUrl,
isYqdSuper: '',
tipsProps: {
tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单',
showTips: true,
type: 1
/**
* 页面的初始数据
*/
data: {
IMG_URL: ImgUrl,
isYqdSuper: '',
tipsProps: {
tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单',
showTips: true,
type: 1
},
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMerchantConfiguration()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMerchantConfiguration()
this.setData({
isYqdSuper: app.globalData.isYqdSuper,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
// 获取商户配置
getMerchantConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
api.getMerchantConfiguration({
merchantId,
sceneType: '1'
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
if (data) {
saturdayFlag = data.signatureSwitch ? true : false
}
} else {
this.showToast(message)
}
this.setData({
saturdayFlag
})
})
},
// 获取商户配置
getMerchantConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
api.getMerchantConfiguration({
merchantId,
sceneType: '1'
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
if (data) {
saturdayFlag = data.signatureSwitch ? true : false
}
} else {
this.showToast(message)
}
this.setData({
saturdayFlag
})
})
},
//是否开启电子签名
changeSwitch(e) {
let {
userInfo
} = this.data
if (userInfo.userType == 2) return
console.log('e', e);
let {
value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({
[target]: value
})
this.updateSignatureConfiguration()
},
//是否开启电子签名
changeSwitch(e) {
let {
userInfo
} = this.data
if (userInfo.userType == 2) return
console.log('e', e);
let {
value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({
[target]: value
})
this.updateSignatureConfiguration()
},
// 修改配置
updateSignatureConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
let signatureSwitch = saturdayFlag ? 1 : 0
api.updateSignatureConfiguration({
merchantId,
sceneType: '1',
signatureSwitch
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
console.log('data', data);
} else {
this.showToast(message)
}
})
},
// 修改配置
updateSignatureConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
let signatureSwitch = saturdayFlag ? 1 : 0
api.updateSignatureConfiguration({
merchantId,
sceneType: '1',
signatureSwitch
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
console.log('data', data);
} else {
this.showToast(message)
}
})
},
})
\ No newline at end of file
......@@ -3,7 +3,7 @@
<view class="main {{isFullSucreen?'isFullSucreen':'' }} {{showTips?'fullSucreen-tips':'' }}" style="height:calc(100vh - {{isFullSucreen?(34+71.5) : 71.5}}px);">
<view class="createData">
<view class="label">是否开启客户电子签名及评分选项</view>
<switch class=" {{userInfo.userType == 2 ?'disabled':''}}" color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{saturdayFlag}}" bindchange="changeSwitch" data-target="saturdayFlag" />
<switch class=" {{userInfo.userType == 2 ?'disabled':''}}" color="#347BFF" disabled="{{!isYqdSuper}}" checked="{{saturdayFlag}}" bindchange="changeSwitch" data-target="saturdayFlag" />
</view>
<view class="box">
<view class="box-label">客户电子签名及施工页面:</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!