Browse Source

服务添加

pull/97/head
pengda 2 months ago
parent
commit
f19732d8f5
  1. 12187
      package-lock.json
  2. BIN
      src/assets/site/invalid.png
  3. BIN
      src/assets/site/show_and_hide.png
  4. 1
      src/assets/site/star-active-icon.svg
  5. 1
      src/assets/site/star-icon.svg
  6. 18
      src/components/bindGoods.vue
  7. 16
      src/components/site/addSiteStep/step2.vue
  8. 2
      src/components/site/serviceSetting/priceSet.vue
  9. 843
      src/views/agent/siteServiceAdd.vue

12187
package-lock.json

File diff suppressed because it is too large

BIN
src/assets/site/invalid.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
src/assets/site/show_and_hide.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

1
src/assets/site/star-active-icon.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16.505903244018555" height="16.001562118530273" viewBox="0 0 16.505903244018555 16.001562118530273"><g transform="matrix(1,0,0,-1,0,32.00312423706055)"><path d="M9.15,31.440662118530273Q8.86875,31.971862118530275,8.24375,32.00316211853027Q7.65,31.971862118530275,7.3375,31.440662118530273L5.3375,27.315662118530273L0.8375,26.628162118530273Q0.24375,26.534362118530275,0.05625,25.97187211853027Q-0.13125,25.37812211853027,0.30625,24.94062211853027L3.55625,21.72187211853027L2.775,17.159372118530275Q2.7125,16.565625118530274,3.18125,16.190625118530274Q3.68125,15.846875118530274,4.24375,16.128125118530274L8.24375,18.253122118530275L12.275,16.128125118530274Q12.8062,15.846875118530274,13.3062,16.190625118530274Q13.8062,16.565625118530274,13.7125,17.159372118530275L12.9625,21.72187211853027L16.2125,24.94062211853027Q16.6187,25.37812211853027,16.4625,25.97187211853027Q16.2437,26.534362118530275,15.65,26.628162118530273L11.15,27.315662118530273L9.15,31.440662118530273Z" fill="#1677FF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
src/assets/site/star-icon.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16.505903244018555" height="16.001562118530273" viewBox="0 0 16.505903244018555 16.001562118530273"><g transform="matrix(1,0,0,-1,0,32.00312423706055)"><path d="M9.15,31.440662118530273Q8.86875,31.971862118530275,8.24375,32.00316211853027Q7.65,31.971862118530275,7.3375,31.440662118530273L5.3375,27.315662118530273L0.8375,26.628162118530273Q0.24375,26.534362118530275,0.05625,25.97187211853027Q-0.13125,25.37812211853027,0.30625,24.94062211853027L3.55625,21.72187211853027L2.775,17.159372118530275Q2.7125,16.565625118530274,3.18125,16.190625118530274Q3.68125,15.846875118530274,4.24375,16.128125118530274L8.24375,18.253122118530275L12.275,16.128125118530274Q12.8062,15.846875118530274,13.3062,16.190625118530274Q13.8062,16.565625118530274,13.7125,17.159372118530275L12.9625,21.72187211853027L16.2125,24.94062211853027Q16.6187,25.37812211853027,16.4625,25.97187211853027Q16.2437,26.534362118530275,15.65,26.628162118530273L11.15,27.315662118530273L9.15,31.440662118530273Z" fill="#9CA3AF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

18
src/components/bindGoods.vue

@ -1,13 +1,11 @@
<template>
<GuipDialog :dialogVisible="dialogVisible" :showFooterButton="list.length>0"
<GuipDialog :dialogVisible="showBind" :showFooterButton="list.length>0"
title="搜索商品" @confirm="handleConfirm" @cancel="handleCancel" @close="handleCancel">
<div class="domain-wrap">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="flex flex-between">
<GuipInput width="420px" v-model="keywords">
<GuipToolTip slot="suffix">
<img src="@/assets/site/input_search.svg"/>
</GuipToolTip>
<img class="flex" slot="suffix" src="@/assets/site/input_search.svg"/>
</GuipInput>
<GuipButton type="primary" @click="handleSearch()">搜索</GuipButton>
</div>
@ -33,24 +31,21 @@
</template>
<script>
import GuipDialog from "@/components/GuipDialog.vue";
import GuipToolTip from "@/components/GuipToolTip.vue";
import GuipInput from "@/components/GuipInput.vue";
import GuipButton from "@/components/GuipButton.vue";
import GuipSelect from "@/components/GuipSelect.vue";
export default {
name: '',
props:['uid','type','pdd_pati','pdd_pagecode'],
props:['showBind','uid','type','pdd_pati','pdd_pagecode'],
components: {
GuipSelect,
GuipButton,
GuipInput,
GuipToolTip,
GuipDialog
},
data(){
return {
dialogVisible: true,
keywords: '',
loading: false,
list: [],
@ -61,7 +56,6 @@ export default {
},
methods:{
handleConfirm(){
this.dialogVisible = false;
const that = this
this.$http('POST', '/agentnew/ajax_bind_service_goods', {
uid: that.uid,
@ -74,7 +68,7 @@ export default {
}).then(response => {
if(response.status){
that.$message.success('绑定成功');
this.$emit('handleBind', this.bindData)
this.$emit('handleBind', true)
return true;
}
that.$message.error(response.info);
@ -83,8 +77,7 @@ export default {
})
},
handleCancel(){
this.dialogVisible = false;
this.$emit('handleBind', this.bindData)
this.$emit('handleBind', false)
},
handleSearch(){
const that = this
@ -158,7 +151,6 @@ export default {
.el-empty{
padding: 20px 0;
}
.goods-list{
max-height: 400px;
overflow-y: scroll;

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

@ -11,7 +11,7 @@
<div class="flex-left">
<div class="shopadd-wrap" v-if="!taobaoList.length">
<p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area">
<div class="flex-between shopadd-area">
<div>
<p>请确保使用要添加的淘宝主账号登录并授权</p>
<p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -34,7 +34,7 @@
</template>
<template #normal>
<div class="flex flex-between noraml-jump">
<div class="flex-between noraml-jump">
<div class="left">
<b>添加新店铺</b>
<p class="one">请确保使用要添加的淘宝主账号登录并授权</p>
@ -81,7 +81,7 @@
<!-- 自定义下拉选项 -->
<template #normal>
<div class="flex flex-between noraml-jump">
<div class="flex-between noraml-jump">
<div class="left">
<b>绑定新微信收款</b>
<p class="one">需要使用您公司的微信支付</p>
@ -125,7 +125,7 @@
</template>
<template #normal>
<div class="flex flex-between noraml-jump">
<div class="flex-between noraml-jump">
<div class="left">
<b>绑定新支付宝收款</b>
<p class="one">需要使用您公司的支付宝支付</p>
@ -159,7 +159,7 @@
<div class="flex-left">
<div class="shopadd-wrap" v-if="pddList.length">
<p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area">
<div class="flex-between shopadd-area">
<div>
<p>请确保使用要添加的拼多多主账号登录并授权</p>
<p>如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -182,7 +182,7 @@
</template>
<template #normal>
<div class="flex flex-between noraml-jump">
<div class="flex-between noraml-jump">
<div class="left">
<b>绑定新拼多多店铺</b>
<p class="one">如未购买快乐帮手服务或已过期会跳转到购买服务页面</p>
@ -218,7 +218,7 @@
<div class="flex-left">
<div class="shopadd-wrap" v-if="!jdList.length">
<p class="shopadd-title">店铺授权</p>
<div class="flex flex-between shopadd-area">
<div class="flex-between shopadd-area">
<div>
<p>请确保使用要添加的京东主账号登录并授权</p>
<p>如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p>
@ -241,7 +241,7 @@
</template>
<template #normal>
<div class="flex flex-between noraml-jump">
<div class="flex-between noraml-jump">
<div class="left">
<b>绑定新京东店铺</b>
<p class="one">如未购买快乐论文检测服务服务或已过期会跳转到购买服务页面</p>

2
src/components/site/serviceSetting/priceSet.vue

@ -10,7 +10,7 @@
<div class="flex-wrap">
<div class="flex-left">
<div class="set-item">
<div class="set-title flex flex-between">
<div class="set-title flex-between">
<p>售价管理</p>
<p>供货价格3.5/</p>
</div>

843
src/views/agent/siteServiceAdd.vue

@ -1,234 +1,568 @@
<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">
<div class="pb80 ml12 mr12">
<PromptText text="如何添加服务?" :type="1" class="add-info">
<template #next_desc>
<div class="alert-more flex gap12" :class="alertShow? '' : 'alert-more-hide'" @click="handleAlert">
<div v-if="alertShow">收起</div>
<div v-else>展开</div>
<img src="@/assets/site/show_and_hide.png" alt="">
</div>
</template>
<template #desc>
<div class="alert-more-info mt12" v-show="alertShow">
<div class="flex mb10 gap10">1.点击左侧导航进入设置页开启所需服务<img src="@/assets/site/open_success_menu.svg" alt="">图标表示已开启</div>
<div class="flex mb10 gap10">2.可开启多个服务</div>
<div class="flex gap10">3.全部开启后点击底部 [添加完成] </div>
</div>
</template>
</PromptText>
<div class="service-title flex-between" v-if="serviceAddInfo">
<div class="service-name flex gap12">
<img src="@/assets/site/step_success.png" alt="">
<span>{{serviceAddInfo.ver_name}}_{{serviceAddInfo.type_name}}</span>
</div>
<div class="service-status" v-if="serviceInfo.status">
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span>
<span class="service-status-desc">已开启</span>
</div>
</div>
<!-- 网页售价 -->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="service-flex 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 class="price-top">
<span class="title">网页支付与售价</span>
<span class="desc" v-if="serviceAddInfo.supply_price">供货价{{serviceAddInfo.supply_price}}{{serviceAddInfo.supply_price_warning}}</span>
</div>
<PromptText v-if="serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1" class="mb12">
<template #desc v-if="serviceAddInfo.prompt.content">
<div class="alert-more-info mt12">
<div class="flex mb10" v-for="item in serviceAddInfo.prompt.content" :key="item">{{item}}</div>
</div>
</template>
</PromptText>
<div class="flex-wrap">
<div class="flex-left">
<div class="flex-between mb12">
<div>售价管理</div>
</div>
<div class="flex-between">
<div class="short-width">
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" :options="serviceAddInfo.set_units"/>
</div>
<div class="short-width" v-if="serviceInfo.unit>0">
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceInfo.price" width="100%" ref="GuipInput" unit="元/篇"></GuipInput>
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceInfo.price" width="100%" ref="GuipInput" unit="元/页"></GuipInput>
</div>
</div>
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'">
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元"></GuipInput>
</div>
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"></GuipInput>
</div>
<div class="service-title-right">
<el-checkbox v-model="row.has_base_price" @change="toggleSetBasePrice(row)">设置起售价格</el-checkbox>
</div>
</div>
<div class="service-flex">
<div class="service-info-item">
<span class="mr12">供货价格</span>
<span>{{row.supply_price}}</span>
<template v-if="serviceAddInfo.base_set">
<div class="flex-line"></div>
<div class="flex-right">
<div class="flex-between mb12">
<div>起售价格选填</div>
<div>超过设定字符按照正常售价收取</div>
</div>
<div class="flex-between">
<div class="third-width">
<GuipInput width="100%" v-model="serviceInfo.base_unit_num" ref="GuipInput" unit="字符内"></GuipInput>
</div>
<div class="w85">
用户需支付
</div>
<div class="third-width">
<GuipInput width="100%" v-model="serviceInfo.base_unit_price" ref="GuipInput" unit="元"></GuipInput>
</div>
</div>
<div class="service-info-item" v-if="row.freedom_set">
<GuipRadio label="计费方式" v-model="row.default_set" :options="methodOptions" @change="methodChange()"/>
</div>
<div class="service-info-item">
<GuipInput v-model="row.price" label="售价管理" ref="GuipInput" width="180px" unit="元"></GuipInput>
<template v-if="row.default_set == 0">
<span class="mr12"></span>
<GuipInput v-model="row.unit_num" ref="GuipInput" width="180px" unit="字符"></GuipInput>
</template>
</div>
<div class="flex service-opt mt12">
<GuipButton type="ignore" @click="resetPrice">重置</GuipButton>
<GuipButton type="primary" @click="savePrice" size="medium">保存</GuipButton>
</div>
</el-form>
</div>
<!-- 店铺售价-->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.shop_price_set">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top">
<span class="title">{{serviceAddInfo.shop_name}}支付管理</span>
<span class="desc"></span>
</div>
<div class="flex-wrap">
<div class="flex-left">
<div class="flex-between mb12">
<div>售价管理</div>
</div>
<div class="flex-between">
<div class="short-width">
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" :options="serviceAddInfo.set_units"/>
</div>
<div class="short-width" v-if="serviceInfo.unit>0">
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceAddInfo.unit_piece" width="100%" ref="GuipInput" unit="件/篇"></GuipInput>
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceAddInfo.unit_piece" width="100%" ref="GuipInput" unit="件/页"></GuipInput>
</div>
</div>
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'">
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_piece" ref="GuipInput" unit="件"></GuipInput>
</div>
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"></GuipInput>
</div>
</div>
</div>
<div class="service-flex" v-if="row.has_base_price">
<div class="service-info-item">
<GuipInput v-model="row.b_unit_num" label="起售价格" ref="GuipInput" width="240px" unit="字符内"></GuipInput>
<span class="ml12 mr12">用户需支付</span>
<GuipInput v-model="row.b_unit_price" ref="GuipInput" width="240px" unit="元"></GuipInput>
<span class="service-base-remark ml12">备注超过设定字符按照正常售价收取</span>
<template v-if="serviceAddInfo.base_set">
<div class="flex-line"></div>
<div class="flex-right">
<div class="flex-between mb12">
<div>起售价格选填</div>
<div>超过设定字符按照正常售价收取</div>
</div>
<div class="flex-between">
<div class="third-width">
<GuipInput width="100%" v-model="serviceInfo.base_unit_num" ref="GuipInput" unit="字符内"></GuipInput>
</div>
<div class="service-flex service-opt">
<GuipButton type="ignore" @click="reset">重置</GuipButton>
<GuipButton type="primary" @click="save(row)" size="medium">保存</GuipButton>
<div class="w85">
用户需支付
</div>
<div class="third-width">
<GuipInput width="100%" v-model="serviceInfo.base_unit_piece" ref="GuipInput" unit="件"></GuipInput>
</div>
</div>
</div>
</template>
</div>
<div class="flex service-opt mt12">
<GuipButton type="ignore" @click="resetShopPrice">重置</GuipButton>
<GuipButton type="primary" @click="saveShopPrice()" size="medium">保存</GuipButton>
</div>
</el-form>
</div>
<!-- 店铺商品绑定-->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.exists_shop_pay">
<el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top">
<span class="title">关联电商商品</span>
<span class="desc">必须关联且确保服务与{{serviceAddInfo.shop_name}}电商商品一致</span>
</div>
<div class="flex-wrap" @click="bindGoods">
<div class="flex-left bind-button gap12">
<img src="@/assets/addIcon.svg" alt="">
<span>添加宝贝</span>
</div>
</div>
<div class="bind-list" v-if="bindList">
<div class="bind-item" v-for="(row, key) in bindList" :key="key">
<img :src="row.pic_url?row.pic_url:require('@/assets/site/invalid.png')" alt="">
<div class="bind-goods-info">
<div class="bind-goods-title"><el-link :href="row.link" target="_blank">{{row.title}}</el-link></div>
<div class="flex-between gap12">
<div class="flex gap12">
<span v-if="row.price">{{row.price}}</span>
<span v-if="row.sec_title">{{row.sec_title}}</span>
</div>
<div class="flex gap12">
<span class="bind-btn bind-delete" @click="handleDelBindClick(row, key)">删除</span>
<span class="bind-btn" :class="row.is_default === '1' ? 'bind-default-active' : 'bind-default' " @click="handleDefaultConfirm(row.id)">默认商品</span>
</div>
</div>
</div>
</div>
</div>
</el-form>
<bindGoods :showBind="showBind" :uid="uid" :type="type" :pati="pati" :pageCode="pageCode" @handleBind="handleBind"></bindGoods>
<GuipDialog :dialogVisible="dialogDelBindConfim" title="提示" :show-close-button="false" @confirm="handleDelBindConfirm"
@cancel="handleDelBindCancel">
您确定要删除吗删除后所有绑定都会删除
</GuipDialog>
</div>
<GuipDialog :dialogVisible="dialogDelServiceConfim" title="提示" :show-close-button="false" @confirm="handleDelServiceConfirm"
@cancel="handleDelServiceCancel">
确定要移除服务吗?
</GuipDialog>
<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 GuipSelect from "@/components/GuipSelect.vue";
import GuipInput from "@/components/GuipInput.vue";
import bindGoods from "@/components/bindGoods.vue";
import GuipDialog from "@/components/GuipDialog.vue";
export default {
name: 'siteServiceAdd',
props: [''],
components: {
GuipDialog,
GuipInput,
GuipSelect,
PromptText,
GuipButton,
GuipInput,
GuipRadio
bindGoods,
},
data() {
return {
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTI2NDY1NDUsIm5iZiI6MTc1MjY0NjU0NSwiZXhwIjoxNzU1MjM4NTQ1LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.G-Is-x9qPMiV_urOlDPQVRjfAIozySxL5EK2k82d46k',
uid: 0,
serviceAddList:[],
methodOptions: [],
obj:{
'1': {
type: '1',
name: '万方数字哈哈哈哈',
is_select: true,
list: [
{
type: '29',
name: '万方通用版44生生世世生生世世',
is_select: true,
//componentsName:'1-1'
type: 0,
prodid: 0,
serviceAddInfo:{},
serviceInfo: {},
bindList: [],
alertShow: true,
menuList:{},
siteAddUrl: '/agent/siteAdd',
showBind: false,
pati: '',
pageCode: '',
dialogDelBindConfim: false,
delRow: {},
dialogDelServiceConfim: false,
}
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
},
{
type: '30',
name: '通用说播版44',
is_select: false,
//componentsName:'1-2'
watch: {
'$store.state.currentMenuItem'(newVal) {
this.type = newVal.type
this.getServiceAddInfo();
},
{
type: '32',
name: '本科通用版44',
is_select: false,
//componentsName:'1-3'
},
]
created() {
if (!this.$route.query.uid && !this.$route.query.prodid) {
this.$message.error('非法请求');
this.$router.push('/agent/siteAdd')
}
this.uid = this.$route.query.uid
this.prodid = this.$route.query.prodid
this.loadPddSDK()
},
'3': {
type: '3',
name: '万方',
is_select: true,
list: [
{
type: '6',
name: '万方通用版a salads asides33',
is_select: true,
//componentsName:'2-2'
mounted() {
store.commit('SET_PAGETITLE', '站点信息');
this.getAddServiceList();
},
{
type: '27',
name: '通用说播版33',
is_select: true,
//componentsName:'2-3'
methods: {
handleAlert(){
this.alertShow = !this.alertShow
},
{
type: '109',
name: '本科通用版33',
is_select: true,
//componentsName:'2-4'
//
getAddServiceList(){
const that = this
that.$http('POST', '/agentnew/ajax_get_service_add_list', {
uid: that.uid,
prodid: that.prodid,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
that.$nextTick(() => {
that.menuList = response.data
store.commit('SET_SECOND_MENU', response.data);
})
}).catch(error => {
console.error(error, 'error')
})
},
]
//
getServiceAddInfo() {
const that = this
that.$http('POST', '/agentnew/ajax_get_service_add_info', {
uid: that.uid,
type: that.type,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$nextTick(() => {
that.serviceAddInfo = response.data
//
if(that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid)
//
that.serviceInfo.unit = that.serviceAddInfo.unit
//
that.getServiceInfo()
store.commit('SET_BREADRIGHTTEXT', that.serviceAddInfo.site_short_name);
})
return true
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
'6': {
type: '6',
name: '万方',
is_select: true,
list: [
{
type: '10',
name: '万方通用版11',
is_select: false,
//componentsName:'3-4'
//
getServiceInfo(){
const that = this
that.serviceInfo = {}
that.$http('POST', '/agentnew/ajax_get_service_info', {
uid: that.uid,
type: that.type,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
that.serviceInfo.status = false
if(response.status && response.data){
that.$nextTick(() => {
that.serviceInfo = response.data.service_info
that.serviceInfo.status = true
})
that.getServiceBindGoods()
}
}).catch(error => {
console.error(error, 'error')
})
},
{
type: '11',
name: '通用说播版11',
is_select: true,
//componentsName:'3-5'
//
getServiceBindGoods(){
const that = this
that.$http('POST', '/agentnew/ajax_get_service_bind_goods', {
uid: that.uid,
type: that.type,
}, {
headers: {
'Auth': this.token
}
}).then(response => {
if(response.status && response.data){
that.$nextTick(() => {
that.bindList = response.data
})
}
}).catch(error => {
console.error(error, 'error')
})
},
{
type: '105',
name: '本科通用版11',
is_select: false,
//componentsName:'3-4'
handleDelServiceClick() {
this.dialogDelServiceConfim = true
},
]
handleDelServiceCancel(){
this.dialogDelServiceConfim = false
},
handleDelServiceConfirm(){
const that = this
this.dialogDelServiceConfim = false
this.$http('POST', '/agentnew/ajax_del_service', {
uid: that.uid,
type: that.type,
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('删除成功');
this.$nextTick(() => {
that.serviceInfo = {}
that.setMenuList(that.type, false)
})
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
resetPrice(){
this.serviceInfo.price = ''
this.serviceInfo.unit_num = ''
this.serviceInfo.b_unit_price = ''
this.serviceInfo.b_unit_num = ''
},
created() {
if(!this.$route.query.uid) {
this.$message.error('非法请求');
this.$router.push('/agent/siteList')
savePrice(){
const that = this
this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid,
type: that.type,
unit_num: that.serviceInfo.unit_num,
unit_price: that.serviceInfo.price,
b_unit_num: that.serviceInfo.base_unit_num,
b_unit_price: that.serviceInfo.base_unit_price,
},{
headers:{
'Auth': this.token
}
this.uid = this.$route.query.uid;
// store.commit('SET_CUSTOMIZE', true);
// store.commit('SET_SLIDER_MENU', 'siteSettingData');
}).then(response => {
if(response.status){
if(that.serviceInfo.status === false){
that.serviceInfo.status = true
that.setMenuList(that.type, true)
}
that.$message.success('保存成功');
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
mounted() {
store.commit('SET_PAGETITLE', '站点信息');
this.getServiceAdd();
resetShopPrice(){
this.serviceInfo.unit_piece = ''
this.serviceInfo.unit_num = ''
this.serviceInfo.b_unit_piece = ''
this.serviceInfo.b_unit_num = ''
},
methods: {
//
getServiceAdd() {
saveShopPrice(){
const that = this
that.siteInfo = []
this.$http('POST', '/agentnew/ajax_get_service_add', {
this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid,
prodid: that.$route.query.prodid,
type: that.type,
unit_num: that.serviceInfo.unit_num,
unit_piece: that.serviceInfo.unit_piece,
b_unit_num: that.serviceInfo.base_unit_num,
b_unit_piece: that.serviceInfo.base_unit_piece,
},{
headers:{
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.serviceAddList = response.data.service_add_list
store.commit('SET_BREADRIGHTTEXT', response.data.site_short_name);
//
store.commit('SET_SECOND_MENU', this.obj);
that.methodOptions = Object.entries(response.data.freedom_set_method).map(([key, value]) => ({
label: value,
value: Number(key)
}));
})
if(response.status){
if(that.serviceInfo.status === false){
that.serviceInfo.status = true
that.setMenuList(that.type, true)
}
that.$message.success('保存成功');
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
toggleSetBasePrice(row){
row.has_base_price = row.has_base_price == true ? false : true;
setMenuList(type, status){
Object.values(this.menuList).forEach((item) => {
let ver_select = false
item.list.forEach((item1) => {
if(item1.type === type) item1.is_select = status
if(item1.is_select === true) ver_select = true
})
if(ver_select) item.is_select = true
})
store.commit('SET_SECOND_MENU', this.menuList);
},
//------ start------
bindGoods(){
this.showBind = true
},
handleBind(bindRes){
this.showBind = false
if(bindRes) this.getServiceBindGoods()
},
methodChange(){
loadPddSDK(){
const script = document.createElement('script');
script.src = 'https://pfile.pddpic.com/galerie-go/open_sdk/pc.202102201613.js';
document.head.appendChild(script);
},
reset(){
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.pageCode = await this.getPddPageCode(uid)
await window.PDD_OPEN_init({code: this.pageCode})
this.pati = await window.PDD_OPEN_getPati()
} else {
console.error('PDD_OPEN_init 不存在,SDK 未正确加载');
}
},
handleDelBindClick(row, index) {
this.dialogDelBindConfim = true
this.delRow.index = index
this.delRow.row = row
},
handleDelBindCancel(){
this.dialogDelBindConfim = false
},
save(row){
console.log(row)
handleDelBindConfirm(){
const that = this
this.$http('POST', "/agentnew/ajax_set_service_price", {
this.dialogDelBindConfim = false
this.$http('POST', '/agentnew/ajax_del_bind_service_goods', {
uid: that.uid,
type: row.type,
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,
type: that.type,
numiid: that.delRow.row.num_iid,
skuid: that.delRow.row.sku_id,
paytype: that.delRow.row.pay_type,
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('保存成功');
that.$message.success('删除成功');
this.$nextTick(() => {
that.bindList.splice(that.delRow.index, 1);
})
return true;
}
that.$message.error(response.info);
}).catch(error => {
console.error(error, 'error')
})
},
handleDefaultConfirm(id){
const that = this
this.$http('POST', '/agentnew/ajax_default_bind_setting', {
uid: that.uid,
type: that.type,
id: id,
},{
headers:{
'Auth': this.token
}
}).then(response => {
if(response.status){
that.$message.success('设置成功');
that.bindList.forEach((item) => {
item.is_default = '0'
if (item.id === id) item.is_default = '1'
});
return true;
}
that.$message.error(response.info);
@ -236,10 +570,17 @@ export default {
console.error(error, 'error')
})
},
//------ end------
jumpStep(){
this.$router.push(this.siteAddUrl + '?uid=' + this.uid)
},
}
}
</script>
<style lang="scss" scoped>
.pb80{
padding-bottom: 80px;
}
.ml12{
margin-left: 12px;
}
@ -248,65 +589,54 @@ export default {
margin-right: 12px;
}
.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;
.mb10{
margin-bottom: 10px;
}
span{
color: #1E2226;
.w85{
width: 85px;
}
.add-info{
.alert-more{
color: #006AFF;
letter-spacing: 0.08em;
font-size: 14px;
cursor:pointer;
user-select: none; /* 标准语法 */
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE/Edge */
}
.alert-more-hide{
img{
transform: rotate(180deg);
}
.service-setting-open{
background: #F2FBED!important;
}
.service-setting-area{
padding: 24px;
background: #F6F7FA;
margin-bottom: 12px;
.alert-more-info{
color: #1E2226;
letter-spacing: 0.08em;
.el-form-item{
margin: 0;
}
.el-checkbox{
::v-deep .prompt-desc{
font-size: 14px;
font-weight: bold;
color: #1E2226;
}
.service-flex{
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}
.service-flex:last-child{
margin-bottom: 0;
}
.service-title{
margin: 20px 0;
letter-spacing: 0.08em;
.service-title-left .service-title-name{
.service-name{
font-size: 16px;
font-weight: bold;
color: #1E2226;
margin-right: 24px;
}
.service-title-left .service-title-status{
.service-status {
.service-status-desc{
border-radius: 4px;
border: 1px solid rgba(0, 194, 97, 0.6);
color: #0DAF49;
@ -317,7 +647,8 @@ export default {
background-size: 16px 16px;
margin-right: 12px;
}
.service-title-left .service-title-close{
.service-status-close{
cursor: pointer;
color: #8A9099;
background-image: url(@/assets/site/form_close.svg);
background-repeat: no-repeat;
@ -326,20 +657,136 @@ export default {
padding: 2px 10px 2px 22px;
}
}
}
.service-info-item{
.price-set{
letter-spacing: 0.08em;
.price-top{
display: flex;
align-items: center;
margin-bottom: 16px;
.title{
font-size: 14px;
font-weight: bold;
color: #1E2226;
}
.desc{
font-size: 14px;
color: #626573;
margin-left: 12px;
}
}
.el-form-item{
margin-bottom: 0;
}
.service-base-remark{
font-size: 12px;
color: #8A9099;
.third-width{
width: calc((100% - 109px) / 2);
}
}
.service-opt{
justify-content: right;
}
.bind-button{
padding: 15px 20px;
border-radius: 4px;
border: 1px dashed #BABDC2;
justify-content: center;
align-items: center;
}
.bind-list{
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
letter-spacing: 0.08em;
flex-wrap: wrap;
margin-top: 32px;
.bind-item{
display: flex;
gap: 22px;
justify-content: space-between;
width: calc((100% - 78px) / 2);
height: 80px;
border-radius: 8px;
background: #FAFAFA;
padding: 16px;
color: #626573;
img{
width: 80px;
height: 80px;
border-radius: 4px;
}
.bind-goods-info{
display: flex;
flex-direction: column;
justify-content: space-between;
width: calc(100% - 80px);
.bind-goods-title{
text-align: left;
a{
color: #1E2226;
}
a:hover{
color: #006AFF;
}
}
span{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.bind-btn{
cursor: pointer;
background-repeat: no-repeat;
background-position: 0 50%;
background-size: 16px 16px;
padding: 2px 0 2px 22px;
}
.bind-delete{
color: #626573;
background-image: url(@/assets/site/delete.svg);
}
.bind-default{
color: #626573;
background-image: url(@/assets/site/star-icon.svg);
}
.bind-default-active{
color: #006AFF;
background-image: url(@/assets/site/star-active-icon.svg);
}
}
}
}
.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;
}
}
</style>
Loading…
Cancel
Save