123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <template>
- <view>
- <view class="cell ">
- <view class="title-block">
- <text> 首页弹窗开关</text>
- </view>
- <view class="desc">
- <view class="desc-content" v-for="(item,index) of zt_list" :key='index'>
- <view class="checklist-box" @click="choicezt(index)" :class="is_zt==index?'actt':''">
- <view class="radio__inner" :class="is_zt==index?'act_border':''">
- <view :class="is_zt==index?'is-default-checked':''"
- class="radio__inner-icon radio__inner-icon ">
- </view>
- </view>
- <text class="checklist-text">{{item}}</text>
- </view>
- </view>
- </view>
- </view>
-
- <view class="title-block" v-if="is_zt==2">
- <navigator :url="`../../../saomaDiancan/couponList/couponList?store_id=${store_id}`" class="navURL ">
- 优惠券:点击跳转设置首页优惠券
- </navigator>
- </view>
- <view class="cell">
- <view class="title-block">
- <text>弹窗时间</text>
- </view>
- <view class="desc">
- <view class="" style="display: inline-block;" v-for="(item,index) of day_list" :key='index'>
- <view class="checklist-box" @click="choiceDay(index)" :class="is_day==index?'actt':''">
- <view class="radio__inner" :class="is_day==index?'act_border':''">
- <view :class="is_day==index?'is-default-checked':''"
- class="radio__inner-icon radio__inner-icon ">
- </view>
- </view>
- <text class="checklist-text">{{item}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="sub-btn" @click="submit">
- 提交
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- zt_list: ["关闭", "语音播报", "优惠劵", "轮播图"],
- is_zt: 0,
- day_list: ["每天一次", "每天每次"],
- is_day: 0,
- id:'',store_id:'',
- }
- },
- onLoad() {
- this.store_id=uni.getStorageSync("store_id");
- this.index_set_info();
- },
- methods: {
- index_set_info() {
- this.request({
- url: "Smdcshop/index_set_info",
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- }
- }).then(res => {
- if (res.code == 200) {
- this.is_zt = res.data.is_pop;
- this.is_day = res.data.pop_day-1;
- this.id=res.data.id;
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
- choicezt(e) {
- this.is_zt = e;
- },
- choiceDay(e) {
- this.is_day = e;
- },
- submit() {
- //is_pop 0关闭弹窗 1语音播报弹窗,2优惠券弹窗,3轮播图弹窗,
- //pop_day 1每天一次 2每天
- this.request({
- url: "Smdcshop/index_set",
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- is_pop: this.is_zt,
- pop_day: this.is_day + 1,
- id:this.id,
- }
- }).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>
- page {
- background-color: #F1F1F1;
- }
- .navURL{
- font-size: 28rpx;
- color: red;
- }
- .desc {
- padding: 20rpx 25rpx;
- background-color: #FFFFFF;
- border-bottom: 1rpx solid #F1F1F1;
- width: 690rpx;
- margin: 0 auto;
- border-radius: 12rpx;
- }
- .desc-content {
- display: inline-block;
- }
- .title-block {
- font-size: 28rpx;
- padding: 20rpx 30rpx;
- color: #999999;
- }
- page .act_border {
- border: 1rpx solid #007AFF;
- }
- .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;
- }
- .sub-btn {
- width: 690rpx;
- height: 100rpx;
- background: -webkit-linear-gradient(135deg, #3387ff 2%, #569bff 99%);
- background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
- border-radius: 8rpx;
- box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
- text-align: center;
- line-height: 100rpx;
- color: #fff;
- font-size: 36rpx;
- font-weight: bold;
- margin: 0 auto;
- margin-top: 30px;
- }
- </style>
|