Commit 0616ee55 by 前端

领劵预约功能代码提交

1 parent a5ddb1df
// tabMine/pages/collectCoupons/collectCoupons.js // tabMine/pages/collectCoupons/collectCoupons.js
import api from '../../api.js'
import {
ImgUrl
} from '~/config';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
info: {},
IMG_URL: ImgUrl,
isYqdSuper: '', isYqdSuper: '',
tipsProps: { tipsProps: {
tipsText: '设置的电话将作为客户领券时在界面中显示为可拨打电话', tipsText: '设置的电话将作为客户领券时在界面中显示为可拨打电话',
...@@ -17,7 +23,7 @@ Page({ ...@@ -17,7 +23,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getReservationConfig()
}, },
/** /**
...@@ -55,6 +61,35 @@ Page({ ...@@ -55,6 +61,35 @@ Page({
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
// 获取领劵预约设置
getReservationConfig() {
let {
info
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
api.getReservationConfig({
merchantId
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
info = data
info.yqMerchantEnableFlag = data.yqMerchantEnableFlag == 'Y' ? true : false
info.shopMerchantEnableFlag = data.shopMerchantEnableFlag == 'Y' ? true : false
console.log('data', data);
} else {
this.showToast(message)
}
this.setData({
info
})
})
},
//设置园区店集中接待电话 //设置园区店集中接待电话
changeYQSwitch(e) { changeYQSwitch(e) {
console.log('e', e); console.log('e', e);
...@@ -67,7 +102,6 @@ Page({ ...@@ -67,7 +102,6 @@ Page({
this.setData({ this.setData({
[target]: value [target]: value
}) })
}, },
//设置单店驻店接待电话 //设置单店驻店接待电话
...@@ -84,4 +118,145 @@ Page({ ...@@ -84,4 +118,145 @@ Page({
}) })
}, },
input(e) {
let {
value
} = e.detail
let {
name
} = e.currentTarget.dataset
console.log('e', e);
this.setData({
[name]: value
})
},
submitContactInfo() {
let {
info
} = this.data
console.log('info', info);
if (!info.contactName) {
return wx.$util.showToast('请输入姓名')
}
const phoneRex = /^[1]([3-9])[0-9]{9}$/
if (!info.contactPhoneNumber || !phoneRex.test(info.contactPhoneNumber)) {
return wx.$util.showToast('请输入正确手机号')
}
info.isEdit = false
this.setData({
info
})
},
editYQInfo() {
let {
info
} = this.data
info.isEdit = true
this.setData({
info
})
},
shopInput(e) {
let {
value
} = e.detail
let {
name,
index
} = e.currentTarget.dataset
let {
info
} = this.data
let itemChar = `info.shopMerchantConfigList[${index}].${name}`
this.setData({
[itemChar]: value.trim()
})
},
editShopInfo(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
[`info.shopMerchantConfigList[${index}].isEdit`]: true
})
},
submitShopInfo(e) {
let {
index
} = e.currentTarget.dataset
let {
info
} = this.data
if (!info.shopMerchantConfigList[index].contactName) {
return wx.$util.showToast('请输入姓名')
}
const phoneRex = /^[1]([3-9])[0-9]{9}$/
if (!info.shopMerchantConfigList[index].contactPhoneNumber || !phoneRex.test(info.shopMerchantConfigList[index].contactPhoneNumber)) {
return wx.$util.showToast('请输入正确手机号')
}
info.shopMerchantConfigList[index].isEdit = false
this.setData({
info
})
},
submit() {
let {
info
} = this.data
let params = {}
let config = wx.$util.deepClone(info)
if (config.isEdit) {
return wx.$util.showToast('请点击确认园区店信息后提交')
}
if (config.shopMerchantConfigList.length > 0) {
if (config.shopMerchantConfigList.some(item => item.isEdit)) {
return wx.$util.showToast('请点击确认单店信息后提交')
}
}
config.yqMerchantEnableFlag = config.yqMerchantEnableFlag ? 'Y' : 'N'
config.shopMerchantEnableFlag = config.shopMerchantEnableFlag ? 'Y' : 'N'
let {
id,
createdBy,
createdDate,
updatedBy,
updatedDate,
deletedFlag,
...newConfig
} = config;
console.log('newConfig', newConfig);
newConfig.shopMerchantConfigList = newConfig.shopMerchantConfigList.map(item => {
return {
shopMerchantId: item.shopMerchantId,
contactName: item.contactName,
contactPhoneNumber: item.contactPhoneNumber
}
})
params.config = newConfig
console.log('params', params);
wx.$util.showLoading('加载中')
api.updateReservationConfig(params).then((res) => {
wx.hideLoading()
console.log(res, 'res');
let {
code,
data,
message
} = res
if (code == 0) {
wx.$util.showToast('修改成功')
} else {
wx.$util.showToast(message)
}
}).catch((err) => {
});
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -4,19 +4,19 @@ page { ...@@ -4,19 +4,19 @@ page {
background-color: #F7F8FA; background-color: #F7F8FA;
transition: none !important; transition: none !important;
/* position: relative; */ /* position: relative; */
} }
.main { .main {
padding: 0 20rpx 136rpx; padding: 0 20rpx 136rpx;
} }
.isFullSucreen { .isFullSucreen {
padding-bottom: 185rpx !important; padding-bottom: 185rpx !important;
} }
.isFullSucreen-btn { .isFullSucreen-btn {
padding-bottom: 34px !important; padding-bottom: 34px !important;
} }
.switch-v { .switch-v {
margin: 20rpx; margin: 20rpx;
...@@ -31,9 +31,9 @@ page { ...@@ -31,9 +31,9 @@ page {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
// padding: 0 40rpx; // padding: 0 40rpx;
} }
.switch-v .label { .switch-v .label {
width: 308rpx; width: 308rpx;
height: 40rpx; height: 40rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
...@@ -41,16 +41,16 @@ page { ...@@ -41,16 +41,16 @@ page {
font-size: 28rpx; font-size: 28rpx;
color: #292D33; color: #292D33;
letter-spacing: 0; letter-spacing: 0;
} }
.setItem{ .setItem {
width: 710rpx; width: 710rpx;
height: 264rpx; height: 264rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
margin: 20rpx 0 0 20rpx; margin: 20rpx 0 0 20rpx;
position: relative; position: relative;
&::before { &::before {
position: absolute; position: absolute;
left: 0rpx; left: 0rpx;
...@@ -62,28 +62,119 @@ page { ...@@ -62,28 +62,119 @@ page {
border-radius: 0 4rpx 4rpx 0; border-radius: 0 4rpx 4rpx 0;
} }
}
.setItem .label{ .item-label {
width: 224rpx; // width: 224rpx;
height: 44rpx; height: 44rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 500; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
color: #292D33; color: #292D33;
line-height: 44rpx; line-height: 44rpx;
padding: 32rpx 0 0 32rpx; padding: 32rpx 0 0 32rpx;
} }
.setItem .input-item{ .input-item {
width: 670rpx; width: 670rpx;
height: 124rpx; height: 124rpx;
background: #F7F8FA; background: #F7F8FA;
border-radius: 16rpx; border-radius: 16rpx;
padding: 32rpx 0 0 12rpx; padding: 32rpx 0 0 12rpx;
} }
.btns { .techicianInfoEdit {
box-sizing: border-box;
padding: 0 24rpx 0 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
// .icon-delete {
// width: 28rpx;
// height: 28rpx;
// }
.name {
box-sizing: border-box;
width: 200rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #DEE0E3;
border-radius: 12rpx;
}
.phone {
box-sizing: border-box;
width: 280rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #DEE0E3;
border-radius: 12rpx;
}
.btn {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #347BFF;
}
}
.techicianInfo {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18rpx 32rpx;
.left {
.label {
display: flex;
.name {
font-family: PingFangSC-SNaNrpxibold;
font-weight: 600;
font-size: 28rpx;
color: #292D33;
margin-right: 10rpx;
}
// .position {
// font-family: PingFangSC-SNaNrpxibold;
// font-weight: 600;
// font-size: 20rpx;
// background: #EAF1FF;
// border: 1rpx solid #347bff80;
// padding: 4rpx 16rpx;
// font-family: PingFangSC-SNaNrpxibold;
// font-weight: 600;
// font-size: 20rpx;
// color: #347BFF;
// }
}
.phone {
margin-top: 10rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #292D33;
}
}
.icon-edit {
width: 32rpx;
height: 32rpx;
}
}
}
.itemOP {
opacity: 0.5;
pointer-events: none;
}
.btns {
position: fixed; position: fixed;
/* position: absolute; */ /* position: absolute; */
width: 100%; width: 100%;
...@@ -96,25 +187,35 @@ page { ...@@ -96,25 +187,35 @@ page {
transition: none !important; transition: none !important;
/* padding-bottom: 34px !important; */ /* padding-bottom: 34px !important; */
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.btns-con { .btns-con {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
padding: 20rpx 0 0 32rpx; padding: 20rpx 0 0 32rpx;
} }
.btns .confirm { .btns .confirm {
border: 2rpx solid #0075F9; border: 2rpx solid #0075F9;
border-radius: 12rpx; border-radius: 12rpx;
height: 80rpx; height: 80rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.btns .confirm { .btns .confirm {
width: 686rpx; width: 686rpx;
height: 80rpx; height: 80rpx;
color: #fff; color: #fff;
background-color: #347BFF; background-color: #347BFF;
border-radius: 12rpx; border-radius: 12rpx;
}
\ No newline at end of file \ No newline at end of file
}
.input {
// text-align: right;
font-size: 28rpx;
padding: 0 24rpx;
}
.placeholder-class {
color: #BEC1C7;
}
\ No newline at end of file \ No newline at end of file
...@@ -2,18 +2,48 @@ ...@@ -2,18 +2,48 @@
<view class="main {{isFullSucreen?'isFullSucreen':''}}"> <view class="main {{isFullSucreen?'isFullSucreen':''}}">
<view class="switch-v"> <view class="switch-v">
<view class="label">设置园区店集中接待电话</view> <view class="label">设置园区店集中接待电话</view>
<switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{yqMerchantFlag}}" bindchange="changeYQSwitch" data-target="yqMerchantFlag" /> <switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{info.yqMerchantEnableFlag}}" bindchange="changeYQSwitch" data-target="info.yqMerchantEnableFlag" />
</view> </view>
<view class="setItem"> <view class="setItem {{info.yqMerchantEnableFlag?'':'itemOP'}}">
<view class="label">单个园区店名称</view> <view class="item-label">{{info.yqMerchantName}}</view>
<view class="input-item"> <view class="input-item techicianInfoEdit" wx:if="{{info.isEdit}}">
<input placeholder="接待联系人" class="input name" placeholder-class="placeholder-class" maxlength="16" value="{{ info.contactName }}" bindinput="input" data-name="info.contactName" always-embed></input>
<input placeholder="联系人手机号" class="input phone" type="number" maxlength="11" placeholder-class="placeholder-class" value="{{ info.contactPhoneNumber }}" bindinput="input" data-name="info.contactPhoneNumber" always-embed></input>
<view class="btn" bind:tap="submitContactInfo">确认</view>
</view>
<view class=" item techicianInfo" wx:else>
<view class="left">
<view class="label">
<view class="name">{{info.contactName}}</view>
</view>
<view class="phone">手机号 {{info.contactPhoneNumber}}</view>
</view>
<image class="icon-edit" bind:tap="editYQInfo" src="{{IMG_URL}}/miniProgram/grayEditIcon.png" />
</view> </view>
</view> </view>
<view class="switch-v"> <view class="switch-v">
<view class="label">设置单店驻店接待电话</view> <view class="label">设置单店驻店接待电话</view>
<switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{merchantFlag}}" bindchange="change4sSwitch" data-target="merchantFlag" /> <switch color="#347BFF" isYqdSuper="{{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'}}">
<view class="item-label">{{item.shopMerchantName}}</view>
<view class="input-item techicianInfoEdit" wx:if="{{item.isEdit}}">
<input placeholder="接待联系人" class="input name" placeholder-class="placeholder-class" maxlength="16" data-index="{{index}}" value="{{ item.contactName }}" bindinput="shopInput" data-name="contactName" always-embed></input>
<input placeholder="联系人手机号" class="input phone" type="number" maxlength="11" placeholder-class="placeholder-class" data-index="{{index}}" value="{{ item.contactPhoneNumber }}" bindinput="shopInput" data-name="contactPhoneNumber" always-embed></input>
<view class="btn" bind:tap="submitShopInfo" data-index="{{index}}">确认</view>
</view>
<view class=" item techicianInfo" wx:else>
<view class="left">
<view class="label">
<view class="name">{{item.contactName}}</view>
</view>
<view class="phone">手机号 {{item.contactPhoneNumber}}</view>
</view>
<image class="icon-edit" bind:tap="editShopInfo" data-index="{{index}}" src="{{IMG_URL}}/miniProgram/grayEditIcon.png" />
</view>
</view> </view>
</block>
</view> </view>
<view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btns {{isFullSucreen?'isFullSucreen-btn':''}}">
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" /> <tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" />
......
// tabMine/pages/completeBuild/completeBuild.js // tabMine/pages/completeBuild/completeBuild.js
import api from '../../api.js' import api from '../../api.js'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' import {
ImgUrl
} from '~/config';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL, IMG_URL: ImgUrl,
isYqdSuper: '', isYqdSuper: '',
tipsProps: { tipsProps: {
tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单', tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单',
...@@ -63,14 +65,19 @@ Page({ ...@@ -63,14 +65,19 @@ Page({
let { let {
saturdayFlag saturdayFlag
} = this.data } = this.data
let { merchantId } = wx.$util.getUserInfo() let {
api.getMerchantConfiguration({ merchantId,sceneType:'1' }).then(res => { merchantId
} = wx.$util.getUserInfo()
api.getMerchantConfiguration({
merchantId,
sceneType: '1'
}).then(res => {
let { let {
code, code,
data data
} = res } = res
if (code == '0') { if (code == '0') {
if(data){ if (data) {
saturdayFlag = data.signatureSwitch ? true : false saturdayFlag = data.signatureSwitch ? true : false
} }
} else { } else {
...@@ -84,7 +91,7 @@ Page({ ...@@ -84,7 +91,7 @@ Page({
//是否开启电子签名 //是否开启电子签名
changeSwitch(e) { changeSwitch(e) {
console.log('e',e); console.log('e', e);
let { let {
value value
} = e.detail } = e.detail
...@@ -102,15 +109,21 @@ Page({ ...@@ -102,15 +109,21 @@ Page({
let { let {
saturdayFlag saturdayFlag
} = this.data } = this.data
let { merchantId } = wx.$util.getUserInfo() let {
merchantId
} = wx.$util.getUserInfo()
let signatureSwitch = saturdayFlag ? 1 : 0 let signatureSwitch = saturdayFlag ? 1 : 0
api.updateSignatureConfiguration({ merchantId,sceneType:'1',signatureSwitch }).then(res => { api.updateSignatureConfiguration({
merchantId,
sceneType: '1',
signatureSwitch
}).then(res => {
let { let {
code, code,
data data
} = res } = res
if (code == '0') { if (code == '0') {
console.log('data',data); console.log('data', data);
} else { } else {
this.showToast(message) this.showToast(message)
} }
......
...@@ -3,17 +3,12 @@ ...@@ -3,17 +3,12 @@
<view class="main {{isFullSucreen?'isFullSucreen':'' }} {{showTips?'fullSucreen-tips':'' }}" style="height:calc(100vh - {{isFullSucreen?(34+71.5) : 71.5}}px);"> <view class="main {{isFullSucreen?'isFullSucreen':'' }} {{showTips?'fullSucreen-tips':'' }}" style="height:calc(100vh - {{isFullSucreen?(34+71.5) : 71.5}}px);">
<view class="createData"> <view class="createData">
<view class="label">是否开启客户电子签名及评分选项</view> <view class="label">是否开启客户电子签名及评分选项</view>
<switch <switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{saturdayFlag}}" bindchange="changeSwitch" data-target="saturdayFlag" />
color="#347BFF"
isYqdSuper="{{isYqdSuper}}"
checked="{{saturdayFlag}}"
bindchange="changeSwitch"
data-target="saturdayFlag" />
</view> </view>
<view class="box"> <view class="box">
<view class="box-label">客户电子签名及施工页面:</view> <view class="box-label">客户电子签名及施工页面:</view>
<view class="box-img"> <view class="box-img">
<image class='select_img' src='{{IMG_URL}}example01.png'></image> <image class='select_img' src='{{IMG_URL}}/example01.png'></image>
</view> </view>
</view> </view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!