You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
1.8 KiB
96 lines
1.8 KiB
<template>
|
|
<view>
|
|
<view class="nav_area"></view>
|
|
<view class="setPage">
|
|
<view class="switch_item" v-for="(item, index) in dataList" :key="index">
|
|
<view class="icon_new"><image src="../../../static/user/ze-gold-coin-o@2x.png" mode=""></image></view>
|
|
<view style="flex:1;">{{item.title}}</view>
|
|
<switch :checked="item.is_open===1" @change="changeStatus($event, item.type)" color="#00E266" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import API from '@/common/js/api.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
dataList: []
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.getStatus();
|
|
},
|
|
methods: {
|
|
getStatus(){
|
|
API.request('/setting/rechargeSetInfo', {}, res=>{
|
|
this.dataList = res.data;
|
|
})
|
|
},
|
|
changeStatus(e, type){
|
|
// console.log(e.detail.value);
|
|
API.request('/setting/openRecharge', {
|
|
is_open: e.detail.value?1:0,
|
|
type: type
|
|
}, res=>{
|
|
uni.showToast({
|
|
title: res.msg
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.nav_area {
|
|
position: fixed;
|
|
top: 0px;
|
|
left: 0px;
|
|
z-index: 99;
|
|
background-color: #fff;
|
|
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.05);
|
|
width: 700rpx;
|
|
padding: 0px 25rpx;
|
|
/* #ifdef H5 */
|
|
height: 88rpx;padding-top: var(--status-bar-height);
|
|
/* #endif */
|
|
/* #ifdef APP-PLUS */
|
|
height: 2px;
|
|
/* #endif */
|
|
box-sizing: content-box;
|
|
color: #b0b0b0;
|
|
font-size: 14px;
|
|
}
|
|
.setPage{
|
|
padding: 40rpx;
|
|
font-size: 14px;
|
|
color: #444;
|
|
}
|
|
.switch_item{
|
|
height: 48rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 20rpx 0px;
|
|
margin-bottom: 40rpx;
|
|
.icon_new{
|
|
left: 32rpx;
|
|
top: 22rpx;
|
|
width: 48rpx;
|
|
height: 48rpx;
|
|
margin-right: 14rpx;
|
|
image{
|
|
width: 48rpx;
|
|
height: 48rpx;
|
|
}
|
|
}
|
|
switch{
|
|
scale: (0.8);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|