Browse Source

站点添加

zq-nodeTest
pengda 1 month ago
parent
commit
5821c36429
  1. 5
      src/components/site/addSiteStep/step1.vue
  2. 24
      src/components/site/addSiteStep/step2.vue
  3. 91
      src/components/site/addSiteStep/step3.vue
  4. 2
      src/views/agent/siteAdd.vue

5
src/components/site/addSiteStep/step1.vue

@ -43,7 +43,7 @@
<div class="flex-left">
<p class="flex-left-desc">销售方向</p>
<div class="flex mt12">
<GuipRadio v-model="formData.site_type" :options="site_types" label="" prop="site_type" @change="radioTypeChange" />
<GuipRadio v-model="formData.site_type" :options="site_types" :rules="formRules.sale_channel" prop="site_type" @change="radioTypeChange" />
</div>
<div class="tem-home">
<img class="tem-home-top" src="@/assets/register/tem-img-normal.png" alt="">
@ -118,6 +118,9 @@ export default {
domain: [
{ required: true, message: '请设置站点域名', trigger: 'blur' }
],
site_type: [
{ required: true, message: '请选择站点类型', trigger: 'blur' }
],
},
channel_options: [

24
src/components/site/addSiteStep/step2.vue

@ -276,7 +276,7 @@
</div>
<div class="register-btns">
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton>
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">去首页</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="nextStep">下一步</GuipButton>
</div>
</div>
@ -332,7 +332,7 @@ export default {
bindWxpayId: 0,
selectWxpay: null,
bindAlipayId: 10079,
bindAlipayId: null,
selectAlipay: null,
bindTaobaoId: 0,
selectTaobao: null,
@ -365,6 +365,11 @@ export default {
return false;
}
if(this.siteInfo.sale_channel === '2'){
this.$emit('handelStep', 3)
return false;
}
this.getSitePayIndex()
this.getPayList()
this.getAddablePays()
@ -536,9 +541,22 @@ export default {
this.getAddablePays()
},
jumpStep(){
this.$emit('handelStep', 3)
this.$router.push('/')
},
nextStep() {
if(this.siteInfo.sale_channel === '0' && !this.bindTaobaoId && !this.bindJdId){
this.$Message.error('请绑定收款方式');
return false
}
if(this.siteInfo.sale_channel === '1' && !this.bindWxpayId && !this.bindAlipayId){
this.$Message.error('请绑定收款方式');
return false
}
if(this.siteInfo.sale_channel === '3' && !this.bindPddId){
this.$Message.error('请绑定收款方式');
return false
}
var data = {
uid: this.siteInfo.uid,
open_processs: 4,

91
src/components/site/addSiteStep/step3.vue

@ -62,7 +62,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>
@ -102,16 +102,18 @@
<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>
<el-table-column label="操作" fixed="right" min-width="150px">
<div class="flex">
<el-button type="text">编辑</el-button>
<el-button type="text">删除</el-button>
</div>
<template slot-scope="scope">
<div class="flex">
<el-link :href="serviceEditUrl+'?uid='+siteInfo.uid+'&type='+scope.row.type" target="_blank" type="text">编辑</el-link>
<el-button type="text" @click="handleDelClick(scope.row, scope.$index)">删除</el-button>
</div>
</template>
</el-table-column>
</GuipTable>
@ -125,14 +127,19 @@
<PromptText text='按住左侧图标,上下拖动可进行排序,平台卡券只能放到最后。' :type="1" class="mb24 mt12"/>
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/>
</GuipDialog>
<GuipDialog :dialogVisible="dialogDelConfim" title="提示" :show-close-button="false" @confirm="handleDelConfirm"
@cancel="handleDelCancel">
确定要移除服务吗?
</GuipDialog>
</el-form>
</div>
</div>
</div>
<div class="register-btns">
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton>
<div class="register-btns" v-if="!tableLoading">
<GuipButton v-if="serviceList.length===0" type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton>
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="nextStep">完成</GuipButton>
</div>
</div>
@ -179,6 +186,9 @@ export default {
dialogVisible: false, //
dialogTitle: "", //
editRow:{},
//
dialogDelConfim: false,
delRow:{},
// url
serviceAddUrl: '/agent/siteAddFinally',
@ -202,8 +212,25 @@ export default {
},
nextStep(){
//
var data = {
uid: this.siteInfo.uid,
}
this.$emit('handelStep', 4)
this.$http('POST', '/agentnew/ajax_add_new_site_complete', data, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
if (response.status) {
this.$emit('handelStep', 4)
return true;
}
this.$Message.error(response.info);
})
}).catch(error => {
console.error(error, 'error')
})
},
//
getSiteServiceList() {
@ -218,9 +245,11 @@ export default {
}
}).then(response => {
that.tableLoading = false
that.$nextTick(() => {
that.serviceList = response.data.service_list
})
if(response.status && response.data.length>0){
that.$nextTick(() => {
that.serviceList = response.data.service_list
})
}
}).catch(error => {
console.error(error, 'error')
})
@ -235,7 +264,38 @@ export default {
serviceAdd(prodid){
this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + prodid)
},
//
handleDelClick(row, index) {
this.dialogDelConfim = true
this.delRow.index = index
this.delRow.type = row.type
},
handleDelCancel(){
this.dialogDelConfim = false
},
handleDelConfirm(){
const that = this
this.dialogDelConfim = false
this.$http('POST', '/agentnew/ajax_del_service', {
uid: that.siteInfo.uid,
type: that.delRow.type
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('删除成功');
this.$nextTick(() => {
that.serviceList.splice(that.delRow.index, 1);
})
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
//
handleEditClick(row, index, type) {
//
@ -292,13 +352,11 @@ 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.siteInfo.uid
obj.type = row.type
obj.is_index_display = row.is_index_display
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj)
console.log(res)
if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1"
},
async saveSort(row){
@ -308,8 +366,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() {

2
src/views/agent/siteAdd.vue

@ -75,7 +75,7 @@ export default {
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k',
siteInfo:{},
showAlert:true,
activeStep: '',//
activeStep: '1',//
process: '', //
prodid: '',//
stepDesc: {

Loading…
Cancel
Save