Browse Source

switch修改

zq-nodeTest
pengda 1 month ago
parent
commit
d3d78f3518
  1. 5
      src/components/paymentMethod.vue
  2. 15
      src/components/site/serviceSetting/showSet.vue
  3. 2
      src/views/agent/siteAdd.vue
  4. 8
      src/views/agent/siteServiceList.vue

5
src/components/paymentMethod.vue

@ -14,7 +14,7 @@
</dd>
</dl>
<el-form>
<GuipSwitch :modelValue="item.status" :active-value="1" :inactive-value="0" activeText="开启" inactiveText="关闭" @change="onSwitchChange(item)">
<GuipSwitch v-model="item.status" :active-value="1" :inactive-value="0" activeText="开启" inactiveText="关闭" @change="onSwitchChange(item)">
</GuipSwitch>
</el-form>
</div>
@ -46,8 +46,7 @@ export default {
},
},
methods:{
onSwitchChange(data){
data.status = data.status === 1 ? 0 : 1;
onSwitchChange(){
this.$emit('confirm', this.list)
},
onEnd() {

15
src/components/site/serviceSetting/showSet.vue

@ -50,8 +50,8 @@
<p class="card-desc">控制首页是否显示本服务</p>
</div>
<el-form>
<GuipSwitch :modelValue="info.is_index_display" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭" @change="onSwitchChange('is_index_display')">
<GuipSwitch v-model="info.is_index_display" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭">
</GuipSwitch>
</el-form>
</div>
@ -61,8 +61,8 @@
<p class="card-desc">本服务检测页面是否展示价格</p>
</div>
<el-form>
<GuipSwitch :modelValue="info.is_display_price" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭" @change="onSwitchChange('is_display_price')">
<GuipSwitch v-model="info.is_display_price" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭">
</GuipSwitch>
</el-form>
</div>
@ -75,8 +75,8 @@
<p class="card-desc">开启即上推荐位</p>
</div>
<el-form>
<GuipSwitch :modelValue="info.is_recommend" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭" @change="onSwitchChange('is_recommend')">
<GuipSwitch v-model="info.is_recommend" :active-value="1" :inactive-value="0"
activeText="开启" inactiveText="关闭">
</GuipSwitch>
</el-form>
</div>
@ -179,9 +179,6 @@ export default {
saveBack(){
this.saveSuccess = false
},
onSwitchChange(attr){
this.info[attr] = this.info[attr] === 1 ? 0 : 1
},
saveConfirm() {
let obj = {}
obj.uid = this.info.uid

2
src/views/agent/siteAdd.vue

@ -154,7 +154,7 @@ export default {
handelStep(step){
if(step === 4){
//
this.$message.success('保存成功');
this.$router.push('/agent/siteList')
return true;
}

8
src/views/agent/siteServiceList.vue

@ -89,7 +89,7 @@
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover" @show="popshow" >
<div style="text-align: center">
<GuipInput ref="GuipInput" width="252px" v-model="row.edit_sort_id" label="排序" placeholder="请输入数字"></GuipInput>
<GuipInput ref="GuipInput" width="252px" v-model="row.sort_id" label="排序" placeholder="请输入数字"></GuipInput>
<p style="width: 252px;margin-left: 40px;text-align: right;color: #8A9099;letter-spacing: 0.08em;">输入0的数越小排序越前重复则新者优先0则默认排序</p>
<div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton>
@ -110,7 +110,7 @@
<el-table-column prop="sort_id" label="上首页">
<template slot-scope="scope">
<div class="flex cell_render">
<GuipSwitch :modelValue="scope.row.is_index_display" active-value="1" inactive-value="0" @change="onSwitchChange(scope.row)"></GuipSwitch>
<GuipSwitch v-model="scope.row.is_index_display" active-value="1" inactive-value="0" @change="onSwitchChange(scope.row)"></GuipSwitch>
</div>
</template>
</el-table-column>
@ -405,7 +405,6 @@ export default {
if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num);
},
async onSwitchChange(row){
console.log(row)
let obj = {}
obj.uid = this.uid
obj.type = row.type
@ -420,8 +419,9 @@ export default {
obj.sort_id = row.sort_id
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
if(res) {
row.sort_id = row.edit_sort_id;
this.sortServiceList()
}else{
this.getSiteServiceList()
}
},
sortServiceList() {

Loading…
Cancel
Save