Browse Source

Merge branch 'master' of gitea.intra.yunpaper.com:zhangqi/kuailelunwen_new_houtai into zq-nodeTest

zq-nodeTest
zq 1 month ago
parent
commit
33d06cad7d
  1. 5
      src/components/paymentMethod.vue
  2. 16
      src/components/site/addSiteStep/step1.vue
  3. 40
      src/components/site/addSiteStep/step2.vue
  4. 140
      src/components/site/addSiteStep/step3.vue
  5. 15
      src/components/site/serviceSetting/showSet.vue
  6. 4
      src/views/agent/siteAdd.vue
  7. 422
      src/views/agent/siteAddFinally.vue
  8. 2
      src/views/agent/siteBaseSetting.vue
  9. 22
      src/views/agent/siteServiceEdit.vue
  10. 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() {

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

@ -43,7 +43,7 @@
<div class="flex-left"> <div class="flex-left">
<p class="flex-left-desc">销售方向</p> <p class="flex-left-desc">销售方向</p>
<div class="flex mt12"> <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>
<div class="tem-home"> <div class="tem-home">
<img class="tem-home-top" src="@/assets/register/tem-img-normal.png" alt=""> <img class="tem-home-top" src="@/assets/register/tem-img-normal.png" alt="">
@ -118,6 +118,9 @@ export default {
domain: [ domain: [
{ required: true, message: '请设置站点域名', trigger: 'blur' } { required: true, message: '请设置站点域名', trigger: 'blur' }
], ],
site_type: [
{ required: true, message: '请选择站点类型', trigger: 'blur' }
],
}, },
channel_options: [ channel_options: [
@ -237,13 +240,16 @@ export default {
}).then(response => { }).then(response => {
if(response.status && response.data.uid){ if(response.status && response.data.uid){
that.formData.uid = response.data.uid that.formData.uid = response.data.uid
this.$emit('handelSiteInfo', that.formData) that.formData.domain_type = that.domainType
that.formData.domain_prefix = that.domainPrefix
that.formData.domain_name = that.domainName
that.$emit('handelSiteInfo', that.formData)
if(this.formData.sale_channel === '2'){ if(that.formData.sale_channel === '2'){
// //
this.$emit('handelStep', 3) that.$emit('handelStep', 3)
}else{ }else{
this.$emit('handelStep', 2) that.$emit('handelStep', 2)
} }
return true; return true;
} }

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

@ -276,7 +276,7 @@
</div> </div>
<div class="register-btns"> <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> <GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="nextStep">下一步</GuipButton>
</div> </div>
</div> </div>
@ -332,7 +332,7 @@ export default {
bindWxpayId: 0, bindWxpayId: 0,
selectWxpay: null, selectWxpay: null,
bindAlipayId: 10079, bindAlipayId: null,
selectAlipay: null, selectAlipay: null,
bindTaobaoId: 0, bindTaobaoId: 0,
selectTaobao: null, selectTaobao: null,
@ -365,6 +365,11 @@ export default {
return false; return false;
} }
if(this.siteInfo.sale_channel === '2'){
this.$emit('handelStep', 3)
return false;
}
this.getSitePayIndex() this.getSitePayIndex()
this.getPayList() this.getPayList()
this.getAddablePays() this.getAddablePays()
@ -410,7 +415,9 @@ export default {
}, },
// //
getPayList() { getPayList() {
this.$http('POST', '/agentnew/ajax_get_pay_list', {},{ this.$http('POST', '/agentnew/ajax_get_pay_list', {
uid: this.siteInfo.uid
},{
headers:{ headers:{
'Auth': this.token 'Auth': this.token
} }
@ -503,10 +510,8 @@ export default {
changeSelectAlipay(item) { changeSelectAlipay(item) {
this.bindAlipayId = item.payid; this.bindAlipayId = item.payid;
this.selectAlipay = item; this.selectAlipay = item;
console.log(this.bindWxpayId, 'bindWxpayId');
this.selectedItem = { ...item }; this.selectedItem = { ...item };
console.log(this.selectedItem, 'this.selectedItem====');
}, },
changeSelectTaobao(item) { changeSelectTaobao(item) {
this.bindTaobaoId = item.payid; this.bindTaobaoId = item.payid;
@ -536,19 +541,28 @@ export default {
this.getAddablePays() this.getAddablePays()
}, },
jumpStep(){ jumpStep(){
this.$emit('handelStep', 3) this.$router.push('/')
}, },
nextStep() { nextStep() {
var data = { var data = {
uid: this.siteInfo.uid, uid: this.siteInfo.uid,
open_processs: 4, open_processs: 4,
pay_config: { pay_config: {},
0: this.bindTaobaoId, }
2: this.bindWxpayId, if(this.siteInfo.sale_channel === '0'){
3: this.bindAlipayId, if(this.isJd && this.bindJdId) data.pay_config = { 4: this.bindJdId }
4: this.bindJdId, if(!this.isJd && this.bindTaobaoId) data.pay_config = { 0: this.bindTaobaoId }
11: this.bindPddId, }
}, if(this.siteInfo.sale_channel === '1'){
if(this.bindWxpayId) data.pay_config = { 2: this.bindWxpayId }
if(this.bindAlipayId) data.pay_config = { 3: this.bindAlipayId }
}
if(this.siteInfo.sale_channel === '3'){
if(this.bindPddId) data.pay_config = { 11: this.bindPddId }
}
if(Object.keys(data.pay_config).length === 0) {
this.$Message.error('请绑定收款方式');
return false
} }
this.$http('POST', '/agentnew/ajax_update_site_pay', data, { this.$http('POST', '/agentnew/ajax_update_site_pay', data, {

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

@ -12,13 +12,13 @@
<div> <div>
<div class="flex-common table-wrap"> <div class="flex-common table-wrap">
<el-form> <el-form>
<GuipTable :border="true" :tableData="serviceList" :loading="tableLoading"> <GuipTable :border="true" :tableData="serviceList.slice((currentPage - 1) * pageSize,currentPage * pageSize)" :loading="tableLoading">
<el-table-column prop="name" fixed="left" label="检测服务" width="200"> <el-table-column prop="name" fixed="left" label="检测服务">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex nowrap "> <div class="flex nowrap ">
<div :class="(scope.row.type == 'a' ? 'green' : 'blue')">{{ scope.row.type == 'a' ? '查重服务' : '写作辅助' <!-- <div :class="(scope.row.type == 'a' ? 'green' : 'blue')">{{ scope.row.type == 'a' ? '查重服务' : '写作辅助'-->
}}</div> <!-- }}</div>-->
<div class="">{{ scope.row.name }}</div> <div class="">{{ scope.row.type_desc }}</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -55,14 +55,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sort_id" label="排序"> <el-table-column prop="sort_id" label="排序">
<template #default="{ row,$index }"> <template #default="{ row,$index }">
<el-popover v-model="row.sortPopoverVisible" :ref="`popover-${row.type}`" <el-popover v-model="row.sortPopoverVisible" :ref="`popover-${row.type}`"
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>
@ -102,16 +101,18 @@
<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>
<el-table-column label="操作" fixed="right" min-width="150px"> <el-table-column label="操作" fixed="right">
<div class="flex"> <template slot-scope="scope">
<el-button type="text">编辑</el-button> <div class="flex gap12">
<el-button type="text">删除</el-button> <el-link :href="serviceEditUrl+'?uid='+siteInfo.uid+'&type='+scope.row.type" target="_blank" type="text">编辑</el-link>
</div> <el-button type="text" @click="handleDelClick(scope.row, scope.$index)">删除</el-button>
</div>
</template>
</el-table-column> </el-table-column>
</GuipTable> </GuipTable>
@ -125,14 +126,19 @@
<PromptText text='按住左侧图标,上下拖动可进行排序,平台卡券只能放到最后。' :type="1" class="mb24 mt12"/> <PromptText text='按住左侧图标,上下拖动可进行排序,平台卡券只能放到最后。' :type="1" class="mb24 mt12"/>
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/> <PaymentMethod :paymentList="payList" @confirm="confirmPayment"/>
</GuipDialog> </GuipDialog>
<GuipDialog :dialogVisible="dialogDelConfim" title="提示" :show-close-button="false" @confirm="handleDelConfirm"
@cancel="handleDelCancel">
确定要移除服务吗?
</GuipDialog>
</el-form> </el-form>
</div> </div>
</div> </div>
</div> </div>
<div class="register-btns"> <div class="register-btns" v-if="!tableLoading">
<GuipButton type="system" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton> <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> <GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="nextStep">完成</GuipButton>
</div> </div>
</div> </div>
@ -148,9 +154,15 @@ import {getServicePriceDesc} from "@/utils/common";
import PaymentMethod from "@/components/paymentMethod.vue"; import PaymentMethod from "@/components/paymentMethod.vue";
import GuipDialog from "@/components/GuipDialog.vue"; import GuipDialog from "@/components/GuipDialog.vue";
import PromptText from "@/components/PromptText.vue"; import PromptText from "@/components/PromptText.vue";
import page from "@/components/Page.vue";
export default { export default {
name: 'domainSet', name: 'domainSet',
computed: {
page() {
return page
}
},
props: { props: {
siteInfo: { siteInfo: {
type: Object, type: Object,
@ -169,7 +181,7 @@ export default {
serviceList:[], serviceList:[],
tableLoading:false, tableLoading:false,
currentPage: 1, // currentPage: 1, //
pageSize: 2, // pageSize: 8, //
total: 0, // total: 0, //
// //
payList: [], payList: [],
@ -179,9 +191,14 @@ export default {
dialogVisible: false, // dialogVisible: false, //
dialogTitle: "", // dialogTitle: "", //
editRow:{}, editRow:{},
//
dialogDelConfim: false,
delRow:{},
// url // url
serviceAddUrl: '/agent/siteAddFinally', serviceAddUrl: '/agent/siteAddFinally',
// url
serviceEditUrl: '/agent/siteServiceEdit',
} }
}, },
mounted() { mounted() {
@ -202,8 +219,25 @@ export default {
}, },
nextStep(){ 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() { getSiteServiceList() {
@ -218,14 +252,15 @@ export default {
} }
}).then(response => { }).then(response => {
that.tableLoading = false that.tableLoading = false
that.$nextTick(() => { if(response.status && response.data.service_list.length>0){
that.serviceList = response.data.service_list that.$nextTick(() => {
}) that.serviceList = response.data.service_list
})
}
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
}, },
@ -235,7 +270,38 @@ export default {
serviceAdd(prodid){ serviceAdd(prodid){
this.$router.push(this.serviceAddUrl + '?uid=' + this.siteInfo.uid + '&prodid=' + 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) { handleEditClick(row, index, type) {
// //
@ -292,13 +358,11 @@ 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.siteInfo.uid obj.uid = this.siteInfo.uid
obj.type = row.type obj.type = row.type
obj.is_index_display = row.is_index_display obj.is_index_display = row.is_index_display
const res = await this.saveRequest('/agentnew/ajax_update_service_show', obj) 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" if(!res) row.is_index_display = row.is_index_display === "1" ? "0" : "1"
}, },
async saveSort(row){ async saveSort(row){
@ -308,8 +372,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() {
@ -393,7 +458,6 @@ export default {
}); });
obj.info = obj.info.substr(1, obj.info.length-1); obj.info = obj.info.substr(1, obj.info.length-1);
await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
const res = await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow) const res = await this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
if(res && hasClose) { if(res && hasClose) {
this.editRow.payment_method_desc = '自定义支付'; this.editRow.payment_method_desc = '自定义支付';
@ -438,4 +502,28 @@ export default {
margin-left: 0 !important; margin-left: 0 !important;
transform: none !important; transform: none !important;
} }
.green,
.blue {
width: 80px;
box-sizing: border-box;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: #0DAF49 !important;
letter-spacing: 0.08em;
/* 基本 */
width: 80px;
border-radius: 4px;
background: rgba(239, 255, 224, 0.5);
box-sizing: border-box;
border: 1px solid rgba(0, 194, 97, 0.6);
margin-right: 8px;
}
.blue {
background: #F2F7FF;
border: 1px solid #BFDAFF;
color: #006AFF !important;
}
</style> </style>

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

4
src/views/agent/siteAdd.vue

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

422
src/views/agent/siteAddFinally.vue

@ -1,422 +0,0 @@
<template>
<div>
<PromptText text='操作提示:设置价格并保存,即添加服务' :type="2" class="mr12 ml12"/>
<div class="main-content12">
<!-- page content -->
<div class="flex-common" v-for="(ver_row) in serviceAddList" :key="ver_row.name">
<h3>{{ver_row.name}}</h3>
<div class="service-setting-area" :class="row.status == 1 ? 'service-setting-open' : ''" v-for="(row) in ver_row.list" :key="row.type" :id="'section_'+row.type">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="flex flex-between mb24 line40 service-title">
<div class="service-title-left">
<span class="service-title-name">{{row.type_name}}</span>
<span v-if="row.status == 1" class="service-title-status">已开启</span>
<span v-if="row.status == 1" class="service-title-close">关闭服务</span>
</div>
<div class="service-title-right" v-if="row.base_set">
<el-checkbox v-model="row.has_base_price" @change="toggleSetBasePrice(row)">设置起售价格</el-checkbox>
</div>
</div>
<div class="flex mb24 line40" v-if="row.supply_price_warning">
<div class="service-info-item">
<span class="mr12">供货价格</span>
<span>{{row.supply_price}} {{row.supply_price_warning}}</span>
</div>
</div>
<div class="flex mb24 line40">
<div class="service-info-item mr50" v-if="!row.supply_price_warning">
<span class="mr12">供货价格</span>
<span>{{row.supply_price}}</span>
</div>
<div class="service-info-item mr50" v-if="row.set_units">
<GuipRadio label="计费方式" v-model="row.unit" :options="row.set_units" @change="methodChange()"/>
</div>
<div class="service-info-item">
<template v-if="row.price_set_label == '售价管理'">
<GuipInput v-model="row.price" :label="row.price_set_label" ref="GuipInput" width="150px" unit="元"></GuipInput>
</template>
<template v-else>
<GuipInput v-model="row.unit_piece" :label="row.price_set_label" ref="GuipInput" width="150px" unit="件"></GuipInput>
</template>
<template v-if="row.unit == 0">
<span class="slash">/</span>
<GuipInput v-model="row.unit_num" ref="GuipInput" width="150px" unit="字符"></GuipInput>
</template>
<template v-if="row.unit == 1">
<span class="slash">/</span>
<span></span>
</template>
<template v-if="row.unit == 2">
<span class="slash">/</span>
<span></span>
</template>
<!-- <div>对应电商商品件数这样在电商平台进行促销也不影响提交论文</div>-->
</div>
</div>
<div class="flex mb24 line40" v-if="row.has_base_price">
<div class="service-info-item" v-if="row.price_set_label == '售价管理'">
<GuipInput v-model="row.b_unit_num" label="起售价格" ref="GuipInput" width="180px" unit="字符内"></GuipInput>
<span class="ml12 mr12">用户需支付</span>
<GuipInput v-model="row.b_unit_price" ref="GuipInput" width="180px" unit="元"></GuipInput>
<span class="service-base-remark ml12">备注超过设定字符按照正常售价收取</span>
</div>
<div class="service-info-item" v-else>
<GuipInput v-model="row.b_unit_num" label="起售价格" ref="GuipInput" width="180px" unit="字符内"></GuipInput>
<span class="ml12 mr12">用户需支付</span>
<GuipInput v-model="row.b_unit_piece" ref="GuipInput" width="180px" unit="件"></GuipInput>
<span class="service-base-remark ml12">备注超过设定字符按照正常售价收取</span>
</div>
</div>
<template v-if="row.enable_bind">
<div class="flex mb24 line40">
<GuipButton @click="bindGoods(row.type)" class="bind-button" type="ignore" :btnstyle="{width:'148px',height:'40px',background:'#F2F3F5','border-radius':'4px'}">
<div class="bgImg"></div>
<span>关联商品</span>
</GuipButton>
</div>
<div>
</div>
</template>
<div class="flex flex-between service-opt">
<GuipButton type="ignore" @click="reset(row)">重置</GuipButton>
<GuipButton type="primary" @click="save(row)" size="medium">保存</GuipButton>
</div>
</el-form>
</div>
</div>
</div>
<component :is="bindComponent" ref="dynamicComponent" @handleBind="handleBind"
:uid="bindData.uid" :type="bindData.type" :pati="bindData.pati" :pageCode="bindData.pageCode"/>
<div class="register-btns">
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">添加完成</GuipButton>
</div>
</div>
</template>
<script>
import store from '@/store';
import { mapState } from 'vuex';
import GuipRadio from "@/components/GuipRadio.vue";
import GuipInput from "@/components/GuipInput.vue";
import GuipButton from "@/components/GuipButton.vue";
import PromptText from "@/components/PromptText.vue";
import bindGoods from "@/components/bindGoods.vue";
export default {
name: 'siteAddFinally',
props: [''],
components: {
bindGoods,
PromptText,
GuipButton,
GuipInput,
GuipRadio
},
data() {
return {
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
siteInfo:{},
serviceAddList: [],
menuList:{},
siteAddUrl: '/agent/siteAdd',
showBind:false,
bindComponent:'',
bindData: {
uid: 0,
type: 0,
pati: '',
pageCode: '',
},
}
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
},
created() {
if (!this.$route.query.uid) {
this.$message.error('非法请求');
this.$router.push('/agent/siteAdd')
}
this.loadPddSDK()
},
mounted() {
store.commit('SET_PAGETITLE', '添加服务');
this.getAddServiceList();
this.getServiceAdd();
},
methods: {
bindGoods(type){
this.bindData.uid = this.siteInfo.uid
this.bindData.type = type
this.bindComponent = 'bindGoods'
},
loadPddSDK(){
const script = document.createElement('script');
script.src = 'https://pfile.pddpic.com/galerie-go/open_sdk/pc.202102201613.js';
document.head.appendChild(script);
},
async getPddPageCode(uid){
const that = this
return await that.$http('POST', '/agentnew/ajax_get_pdd_page_code', {
uid: uid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
return response.data
}).catch(error => {
console.error(error, 'error')
})
},
async initPddParam(uid) {
if (typeof window.PDD_OPEN_init === 'function') {
this.bindData.pageCode = await this.getPddPageCode(uid)
await window.PDD_OPEN_init({code: this.bindData.pageCode})
this.bindData.pati = await window.PDD_OPEN_getPati()
} else {
console.error('PDD_OPEN_init 不存在,SDK 未正确加载');
}
},
handleBind(data){
this.bindComponent = ''
console.log(data)
},
getAddServiceList(){
const that = this
that.siteInfo = []
this.$http('POST', '/agentnew/ajax_get_add_service_list', {
uid: this.$route.query.uid,
prodid: that.$route.query.prodid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
this.menuList = response.data
store.commit('SET_SECOND_MENU', response.data);
})
}).catch(error => {
console.error(error, 'error')
})
},
//
getServiceAdd() {
const that = this
this.$http('POST', '/agentnew/ajax_get_service_addinfo', {
uid: this.$route.query.uid,
prodid: that.$route.query.prodid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.siteInfo = response.data.siteinfo
that.serviceAddList = response.data.service_add_list
store.commit('SET_BREADRIGHTTEXT', that.siteInfo.short_name);
//
if(this.siteInfo.sale_channel == 3){
this.initPddParam(this.$route.query.uid)
}
})
}).catch(error => {
console.error(error, 'error')
})
},
toggleSetBasePrice(row) {
row.has_base_price = row.has_base_price == true ? false : true;
},
methodChange() {
},
reset(row) {
row.price = ''
row.unit_num = ''
row.unit_piece = ''
row.b_unit_num = ''
row.b_unit_price = ''
row.b_unit_piece = ''
},
save(row) {
console.log(row)
const that = this
this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid,
type: row.type,
unit: row.unit,
unit_num: row.unit_num,
unit_price: row.price,
unit_piece: row.unit_piece,
b_unit_num: row.b_unit_num,
b_unit_price: row.b_unit_price,
b_unit_piece: row.b_unit_piece,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
if (response.status) {
that.$message.success('保存成功');
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
jumpStep(){
this.$router.push(this.siteAddUrl + '?uid=' + this.uid)
}
}
}
</script>
<style lang="scss" scoped>
.line40{
line-height: 40px;
}
.ml12 {
margin-left: 12px;
}
.mr12 {
margin-right: 12px;
}
.mr50 {
margin-right: 50px;
}
.slash{
margin: 0 6px;
}
.warning-text {
margin: 0 12px;
display: flex;
align-items: center;
padding: 8px 13px;
align-self: stretch;
z-index: 1;
border-radius: 4px;
background: #FEFCE8;
border: 1px solid rgba(255, 140, 0, 0.3);
.warning-icon {
width: 16px;
height: 16px;;
margin-right: 8px;
}
span {
color: #1E2226;
letter-spacing: 0.08em;
font-size: 14px;
}
}
.service-setting-open {
background: #F2FBED !important;
}
.service-setting-area {
padding: 24px;
background: #F6F7FA;
margin-bottom: 12px;
letter-spacing: 0.08em;
.el-form-item {
margin: 0;
}
.el-checkbox {
color: #1E2226;
}
.service-title {
.service-title-left .service-title-name {
color: #1E2226;
margin-right: 24px;
}
.service-title-left .service-title-status {
border-radius: 4px;
border: 1px solid rgba(0, 194, 97, 0.6);
color: #0DAF49;
padding: 2px 10px 2px 32px;
background-image: url(@/assets/site/open_success.svg);
background-repeat: no-repeat;
background-position: 10px 50%;
background-size: 16px 16px;
margin-right: 12px;
}
.service-title-left .service-title-close {
color: #8A9099;
background-image: url(@/assets/site/form_close.svg);
background-repeat: no-repeat;
background-position: 0 50%;
background-size: 16px 16px;
padding: 2px 10px 2px 22px;
}
}
.service-info-item {
display: flex;
align-items: center;
.el-radio-group{
margin: 0;
}
}
.service-base-remark {
font-size: 12px;
color: #8A9099;
}
.service-opt {
justify-content: right;
}
}
.register-btns {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
background: #FFFFFF;
padding: 16px 0px;
/* 蓝色阴影_常规 */
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12);
z-index: 999;
button:nth-child(1) {
margin-right: 56px;
}
}
.bgImg{
width: 20px;
height: 16px;
margin-right: 6px;
background-image: url(@/assets/site/shop_bag.svg);
}
</style>

2
src/views/agent/siteBaseSetting.vue

@ -534,7 +534,7 @@ export default {
// //
getPayList() { getPayList() {
this.$http('POST', '/agentnew/ajax_get_pay_list', { this.$http('POST', '/agentnew/ajax_get_pay_list', {
gid: this.gid, uid: this.$route.query.uid,
},{ },{
headers:{ headers:{
'Auth': this.token 'Auth': this.token

22
src/views/agent/siteServiceEdit.vue

@ -39,16 +39,6 @@ export default {
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k', token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k',
siteServiceInfo:{}, siteServiceInfo:{},
tableKey:Date.now(), tableKey:Date.now(),
payinfo: [
{
type: 'a',
name: '传递的参数'
}
],
payType: -1,
payStatus: -1,
paySvg: '',
confirmText: '保存',
} }
}, },
computed: { computed: {
@ -65,13 +55,18 @@ export default {
store.commit('SET_CUSTOMIZE', true); store.commit('SET_CUSTOMIZE', true);
store.commit('SET_SLIDER_MENU', 'siteServiceSettingData'); store.commit('SET_SLIDER_MENU', 'siteServiceSettingData');
this.loadPddSDK()
this.getSiteServiceInfo() this.getSiteServiceInfo()
this.getPayList()
}, },
mounted() { mounted() {
store.commit('SET_PAGETITLE', '服务设置'); store.commit('SET_PAGETITLE', '服务设置');
}, },
methods: { methods: {
loadPddSDK() {
const script = document.createElement('script');
script.src = 'https://pfile.pddpic.com/galerie-go/open_sdk/pc.202102201613.js';
document.head.appendChild(script);
},
handleSaveEvent(payload) { handleSaveEvent(payload) {
this.siteServiceInfo = payload this.siteServiceInfo = payload
}, },
@ -88,10 +83,9 @@ export default {
}).then(response => { }).then(response => {
that.$nextTick(() => { that.$nextTick(() => {
that.siteServiceInfo = response.data.service_info that.siteServiceInfo = response.data.service_info
that.siteServiceInfo.paylist = []
this.tableKey = Date.now();
store.commit('SET_BREADRIGHTTEXT', response.data.site_short_name); store.commit('SET_BREADRIGHTTEXT', response.data.site_short_name);
that.getPayList()
}) })
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')

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