123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <template>
- <view class="container">
- <view class="content">
- <view class="cell flex flex-y-center">
- <view class="title-block requsired">
- <text>是否开启外卖:</text>
- </view>
- <view class="desc">
- <view class="flex-center">
- <view class="checklist-box " @click="choicepay(item.type)" v-for="(item,index) of integral_arr"
- :key='index' :class="is_integral==item.type?'actt':''">
- <view class="radio__inner" :class="is_integral==item.type?'act_border':''">
- <view :class="is_integral==item.type?'is-default-checked':''"
- class="radio__inner-icon radio__inner-icon ">
- </view>
- </view>
- <text class="checklist-text">{{item.name}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="cell flex flex-y-center">
- <view class="title-block requsired">
- <text>是否开启堂食:</text>
- </view>
- <view class="desc">
- <view class="flex-center">
- <view class="checklist-box " @click="choicepayTs(item.type)"
- v-for="(item,index) of integral_arr_add" :key='index'
- :class="is_integral_add==item.type?'actt':''">
- <view class="radio__inner" :class="is_integral_add==item.type?'act_border':''">
- <view :class="is_integral_add==item.type?'is-default-checked':''"
- class="radio__inner-icon radio__inner-icon ">
- </view>
- </view>
- <text class="checklist-text">{{item.name}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="footer-bar" @click="onSubmit">
- <view class="content flex flex-center" style="background: none;">
- <button class="btn" hover-class="none" form-type="submit">
- 提交
- </button>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- integral_arr: [{
- type: 1,
- name: "开启",
- }, {
- type: 2,
- name: "关闭",
- }, ],
- is_integral: 1,
- integral_arr_add: [{
- type: 1,
- name: "开启",
- }, {
- type: 2,
- name: "关闭",
- }, ],
- is_integral_add: 1,
- store_id: '',
- obj:{},
- id:'',
- }
- },
- onLoad(e) {
- this.store_id = uni.getStorageSync("store_id");
- this.less()
- },
- methods: {
-
- less(){
- let params = {
- store_id:this.store_id,
- }
- this.request({
- url: "xcx/siteConfigFind",
- data: params
- }).then(res => {
- if (res.code == 200||res.code == '200') {
- this.id=res.data.id;
- this.is_integral=res.data.outside==1?1:2;
- this.is_integral_add=res.data.canteen==1?1:2;
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
-
- choicepay(index) {
- this.is_integral = index;
- },
-
- choicepayTs(index) {
- this.is_integral_add = index;
- },
-
- onSubmit(e) {
- let params = {
- outside: this.is_integral == 1 ? 1 : 5,
- canteen: this.is_integral_add == 1 ? 1 :5,
- store_id:this.store_id,
- id:this.id,
- }
- this.request({
- url: "xcx/siteConfigFind",
- data: params
- }).then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- setTimeout(() => {
- uni.navigateBack()
- }, 2000)
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
- }
- }
- </script>
- <style>
- @import url("./static/css/common.css");
- page {
- background-color: #F4F5F7;
- }
- page .content {
- background-color: #F4F5F7;
- padding: 0;
- }
- page .content .cell {
- background-color: #FFF;
- padding: 25rpx;
- }
- .title-block {
- margin-right: 20rpx;
- }
- .checklist-box {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: horizontal;
- -webkit-box-direction: normal;
- -webkit-flex-direction: row;
- flex-direction: row;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- margin: 5px 0;
- margin-right: 22px;
- }
- .radio__inner {
- -webkit-flex-shrink: 0;
- flex-shrink: 0;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- position: relative;
- border: 1px solid #DCDFE6;
- border-radius: 2px;
- box-sizing: border-box;
- width: 16px;
- height: 16px;
- border-radius: 16px;
- background-color: #fff;
- z-index: 1;
- -webkit-transition: border-color .3s;
- transition: border-color .3s;
- }
- .radio__inner-icon {
- width: 8px;
- height: 8px;
- border-radius: 10px;
- opacity: 0;
- -webkit-transition: -webkit-transform .3s;
- transition: -webkit-transform .3s;
- transition: transform .3s;
- transition: transform .3s, -webkit-transform .3s;
- }
- .is-default-checked {
- opacity: 1;
- background-color: #007aff;
- -webkit-transform: rotate(45deg) scaleY(1);
- transform: rotate(45deg) scaleY(1);
- }
- .checklist-text {
- font-size: 28rpx;
- margin-left: 5px;
- -webkit-transition: color 0.2s;
- transition: color 0.2s;
- color: #000;
- }
- .act_border {
- border: 1rpx solid #007aff;
- }
- </style>
|