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> </dd>
</dl> </dl>
<el-form> <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> </GuipSwitch>
</el-form> </el-form>
</div> </div>
@ -46,8 +46,7 @@ export default {
}, },
}, },
methods:{ methods:{
onSwitchChange(data){ onSwitchChange(){
data.status = data.status === 1 ? 0 : 1;
this.$emit('confirm', this.list) this.$emit('confirm', this.list)
}, },
onEnd() { onEnd() {

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

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

2
src/views/agent/siteAdd.vue

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

8
src/views/agent/siteServiceList.vue

@ -89,7 +89,7 @@
placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true" placement="bottom" trigger="manual" :append-to-body="false" :visible-arrow="true"
popper-class="custom-popover" @show="popshow" > popper-class="custom-popover" @show="popshow" >
<div style="text-align: center"> <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> <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;"> <div class="flex" style="text-align: right; margin-top: 32px;justify-content: flex-end;">
<GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton> <GuipButton size="medium" @click="cancelEdit(row, 'sort')">取消</GuipButton>
@ -110,7 +110,7 @@
<el-table-column prop="sort_id" label="上首页"> <el-table-column prop="sort_id" label="上首页">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex cell_render"> <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> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -405,7 +405,6 @@ export default {
if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num); if(res) row.price_desc = getServicePriceDesc(row.price, row.price_unit, row.price_unit_num);
}, },
async onSwitchChange(row){ async onSwitchChange(row){
console.log(row)
let obj = {} let obj = {}
obj.uid = this.uid obj.uid = this.uid
obj.type = row.type obj.type = row.type
@ -420,8 +419,9 @@ export default {
obj.sort_id = row.sort_id obj.sort_id = row.sort_id
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
if(res) { if(res) {
row.sort_id = row.edit_sort_id;
this.sortServiceList() this.sortServiceList()
}else{
this.getSiteServiceList()
} }
}, },
sortServiceList() { sortServiceList() {

Loading…
Cancel
Save