|
@@ -10,9 +10,9 @@
|
|
|
|
|
|
<view class="">
|
|
|
|
|
|
- <u-radio-group>
|
|
|
+ <u-radio-group v-model="detail.enableShare" >
|
|
|
|
|
|
- <u-radio @change="radioChange" v-for="(item, index) in list2" :key="index" :name="item.name"
|
|
|
+ <u-radio v-for="(item, index) in list2" :key="index+'a'" :name="item.value"
|
|
|
:disabled="item.disabled" active-color="#00b962">
|
|
|
|
|
|
{{item.name}}
|
|
@@ -30,9 +30,9 @@
|
|
|
<u-cell-item title="开放预约" :arrow="false">
|
|
|
<view class="">
|
|
|
|
|
|
- <u-radio-group @change="radioGroupChange">
|
|
|
+ <u-radio-group v-model="detail.enableAppointment" >
|
|
|
|
|
|
- <u-radio @change="radioChange" v-for="(item, index) in list2" :key="index" :name="item.name"
|
|
|
+ <u-radio v-for="(item, index) in list2" :key="index+'b'" :name="item.value"
|
|
|
:disabled="item.disabled" active-color="#00b962">
|
|
|
|
|
|
{{item.name}}
|
|
@@ -47,10 +47,10 @@
|
|
|
<u-cell-item title="预约自动确认" :arrow="false">
|
|
|
<view class="">
|
|
|
|
|
|
- <u-radio-group @change="radioGroupChange">
|
|
|
+ <u-radio-group v-model="detail.autoConfirm" >
|
|
|
|
|
|
- <u-radio @change="radioChange" v-for="(item, index) in list2" :key="index" :name="item.name"
|
|
|
- :disabled="item.disabled" active-color="#00b962">
|
|
|
+ <u-radio v-for="(item, index) in list2" :key="index+'c'" :name="item.value"
|
|
|
+ active-color="#00b962">
|
|
|
|
|
|
{{item.name}}
|
|
|
|
|
@@ -61,9 +61,34 @@
|
|
|
</view>
|
|
|
</u-cell-item>
|
|
|
|
|
|
- <u-cell-item title="允许预约日期" value="周一/周二/周三/周四/周五/周六/周日"></u-cell-item>
|
|
|
+
|
|
|
+
|
|
|
+ <u-cell-item :arrow="false" class="time-cell border-bottom" title="允许预约日期">
|
|
|
+
|
|
|
+ </u-cell-item>
|
|
|
+
|
|
|
+ <view class="" style="padding-left: 16px;">
|
|
|
+ <u-checkbox-group shape="square">
|
|
|
+
|
|
|
+ <u-checkbox
|
|
|
+ v-model="item.checked"
|
|
|
+ v-for="(item, index) in weekList" :key="index" :name="item.value"
|
|
|
+ :disabled="item.disabled" active-color="#00b962">
|
|
|
+
|
|
|
+ {{item.name}}
|
|
|
+
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <u-picker mode="time" @confirm="confirm" v-model="show"
|
|
|
+
|
|
|
+ :params="params"></u-picker>
|
|
|
+
|
|
|
|
|
|
- <u-cell-item title="允许预约时段" value="10:00至12:00"></u-cell-item>
|
|
|
+ <u-cell-item title="预约开始时段" :value="detail.shareStartTime" @click="showTimeBtn(0)" ></u-cell-item>
|
|
|
+ <u-cell-item title="预约结束时段" :value="detail.shareEndTime" @click="showTimeBtn(1)" ></u-cell-item>
|
|
|
|
|
|
<u-cell-item :arrow="false" class="time-cell border-bottom" title="预约时长选项">
|
|
|
|
|
@@ -73,62 +98,265 @@
|
|
|
</u-cell-item>
|
|
|
|
|
|
|
|
|
- <!-- <p>预约时长选项</p> -->
|
|
|
-
|
|
|
|
|
|
<view class="" style="padding-left: 16px;">
|
|
|
- <u-radio-group @change="radioGroupChange" class="radio-padding" shape="square">
|
|
|
+ <u-checkbox-group shape="square">
|
|
|
|
|
|
- <u-radio @change="radioChange" v-for="(item, index) in timeList" :key="index" :name="item.name"
|
|
|
+ <u-checkbox v-for="(item, index) in timeList"
|
|
|
+ v-model="item.checked"
|
|
|
+ :key="index" :name="item.value"
|
|
|
:disabled="item.disabled" active-color="#00b962">
|
|
|
|
|
|
{{item.name}}
|
|
|
|
|
|
- </u-radio>
|
|
|
- </u-radio-group>
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
</u-cell-group>
|
|
|
|
|
|
</view>
|
|
|
-
|
|
|
+ <!-- 底部按钮 -->
|
|
|
+ <view class="bottom">
|
|
|
+ <!-- <u-button shape='circle' class="refuse-btn">拒绝</u-button>
|
|
|
+ <u-button type="success" shape='circle'>确认</u-button> -->
|
|
|
+ <!-- 删除订单按钮 -->
|
|
|
+ <u-button shape='circle' type="success" @click="submit" >保存</u-button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API from '@/apis/finance.js'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ showTimeType:"",
|
|
|
+ showTime:"",
|
|
|
+ show:false,
|
|
|
+ params: {
|
|
|
+ year: false,
|
|
|
+ month: false,
|
|
|
+ day: false,
|
|
|
+ hour: true,
|
|
|
+ minute: true,
|
|
|
+ second: false
|
|
|
+ },
|
|
|
+
|
|
|
+ detail:{
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
list2: [{
|
|
|
+ value:"1",
|
|
|
name: "是"
|
|
|
},
|
|
|
{
|
|
|
+ value:"0",
|
|
|
name: "否"
|
|
|
}
|
|
|
],
|
|
|
- timeList: [{
|
|
|
+ weekList: [
|
|
|
+ {
|
|
|
+ value:"1",
|
|
|
+ name: "周一"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"2",
|
|
|
+ name: "周二"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"3",
|
|
|
+ name: "周三"
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ value:"4",
|
|
|
+ name: "周四"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"5",
|
|
|
+ name: "周五"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"6",
|
|
|
+ name: "周六"
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ value:"7",
|
|
|
+ name: "周日"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ timeList: [
|
|
|
+ {
|
|
|
+ value:"10",
|
|
|
name: "10分钟"
|
|
|
},
|
|
|
{
|
|
|
+ value:"20",
|
|
|
name: "20分钟"
|
|
|
},
|
|
|
{
|
|
|
+ value:"30",
|
|
|
name: "30分钟"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ onLoad(op){
|
|
|
+
|
|
|
+ this.id=op.id;
|
|
|
+ this.getInfo()
|
|
|
+ },
|
|
|
methods: {
|
|
|
-
|
|
|
+ confirm(e){
|
|
|
+
|
|
|
+ var type=this.showTimeType;
|
|
|
+
|
|
|
+ if(type==0){
|
|
|
+ this.detail.shareStartTime=e.hour+":"+e.minute
|
|
|
+ }
|
|
|
+ if(type==1){
|
|
|
+ this.detail.shareEndTime=e.hour+":"+e.minute
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showTimeBtn(type){
|
|
|
+ this.showTimeType=type;
|
|
|
+ console.log(type)
|
|
|
+ if(type=="0"){
|
|
|
+ this.showTime=this.detail.shareStartTime
|
|
|
+ }
|
|
|
+ if(type=="1"){
|
|
|
+ this.showTime=this.detail.shareEndTime
|
|
|
+ }
|
|
|
+ this.show=true;
|
|
|
+ },
|
|
|
+ submit(){
|
|
|
+
|
|
|
+ var sz=[]
|
|
|
+ for(var i in this.weekList){
|
|
|
+ var item=this.weekList[i]
|
|
|
+ if(item.checked){
|
|
|
+ sz.push(item.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var weekDay=sz.join();
|
|
|
+
|
|
|
+
|
|
|
+ var sz2=[]
|
|
|
+ for(var i in this.timeList){
|
|
|
+ var item=this.timeList[i]
|
|
|
+ if(item.checked){
|
|
|
+ sz2.push(item.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var reserveMinutes=sz2.join();
|
|
|
+ var weekTime=[this.detail.shareStartTime,this.detail.shareEndTime]
|
|
|
+ if(this.detail.enableAppointment){
|
|
|
+ if(weekDay==""){
|
|
|
+ uni.showToast({
|
|
|
+ title:"开放预约功能需要选择预约日期"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.detail.weekDay=weekDay
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.detail.reserveMinutes=reserveMinutes
|
|
|
+ if(!weekTime[0]){
|
|
|
+ uni.showToast({
|
|
|
+ title:"开放预约功能需要预约开始时间"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!weekTime[1]){
|
|
|
+ uni.showToast({
|
|
|
+ title:"开放预约功能需要预约结束时间"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(reserveMinutes==""){
|
|
|
+ uni.showToast({
|
|
|
+ title:"开放预约功能需要选择预约时长"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.detail.weekTime=weekTime
|
|
|
+ console.log( this.detail )
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title:"加载中",mask:true,
|
|
|
+ })
|
|
|
+ API.saveGunShare(this.detail).then((res) => {
|
|
|
+
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title:"操作成功"
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+
|
|
|
+ title:error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getInfo(){
|
|
|
+ uni.showLoading({
|
|
|
+ title:"加载中",mask:true,
|
|
|
+ })
|
|
|
+ API.gunShareDetail({
|
|
|
+ gunId:this.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.detail={};
|
|
|
+ var obj=res.data.gunShare;
|
|
|
+ for(var i in obj){
|
|
|
+
|
|
|
+ if(obj[i]===true){
|
|
|
+ this.detail[i]="1";
|
|
|
+ }else if(obj===false){
|
|
|
+ this.detail[i]="0";
|
|
|
+ }else {
|
|
|
+ this.detail[i]=obj[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.detail.reserveMinutes){
|
|
|
+ var sz=this.detail.reserveMinutes.split(",")
|
|
|
+ for(var i in this.timeList){
|
|
|
+ var item=this.timeList[i]
|
|
|
+
|
|
|
+ if(sz.indexOf(item.value)!=-1){
|
|
|
+ item.checked=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.detail.shareWeekDay){
|
|
|
+ var sz=this.detail.shareWeekDay.split(",")
|
|
|
+ for(var i in this.weekList){
|
|
|
+ var item=this.weekList[i]
|
|
|
+
|
|
|
+ if(sz.indexOf(item.value)!=-1){
|
|
|
+ item.checked=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.detail)
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+
|
|
|
+ title:error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -181,4 +409,30 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// 按钮
|
|
|
+.bottom{
|
|
|
+ width: 100%;
|
|
|
+ height: 56px;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ .refuse-btn{
|
|
|
+ background-color: #DBDBDB;
|
|
|
+ }
|
|
|
+ .u-btn{
|
|
|
+ width: 91.4%;
|
|
|
+ height: 40px;
|
|
|
+ margin: auto;
|
|
|
+ font-size: 18px;
|
|
|
+
|
|
|
+ }
|
|
|
+ .cancel-btn{
|
|
|
+ width: 91.4%;
|
|
|
+ background-color: #dbdbdb;
|
|
|
+ color: #666666
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|