| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-rich-text');
- ComponentHelper::loadComponentView('com-dialog-select');
- ComponentHelper::loadComponentView('com-qq-map');
- $addons_settings = empty($addons_settings) ? [] : $addons_settings;
- foreach ($addons_settings as $key => $item) {
- ComponentHelper::loadComponentView($item['components'], Yii::$app->basePath . '/../addons/' . ucfirst($key) . '/backend/views/goods');
- }
- $addons_settings = \yii\helpers\Json::encode($addons_settings);
- ?>
- <div id="app" v-cloak>
- <el-card v-loading="loading" style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="基础信息" name="basic_setting">
- <?php ComponentHelper::loadComponentView('detail-basic', __DIR__ . '/');
- ?>
- </el-tab-pane>
- <el-tab-pane label="门店设置" name="store_setting" class="cashier-tabs">
- <?php ComponentHelper::loadComponentView('detail-store', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="收银设置" name="cashier_setting">
- <?php ComponentHelper::loadComponentView('detail-cashier', __DIR__ . '/'); ?>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- var validatePass = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('两次输入密码不一致'));
- } else if (value !== this.storeForm.password) {
- callback(new Error('两次输入密码不一致!'));
- } else {
- callback();
- }
- };
- var validateTime = (rule, value, callback) => {
- if ((!this.times || !this.times.length) && this.storeForm.shop_status == 1) {
- callback(new Error('请设置营业时间'));
- } else {
- callback();
- }
- };
- var validateStoreServiceRatio = (rule, value, callback) => {
- if (this.storeForm.store_service_fee == 1 && value <= 0) {
- callback(new Error('请填写服务费收取比例'));
- } else {
- callback();
- }
- };
- var validateCachierServiceRatio = (rule, value, callback) => {
- if (value < 0) {
- callback(new Error('服务费不能小于0'));
- }
- if (value > 100) {
- callback(new Error('服务费不能大于100'));
- }
- callback();
- };
- return {
- store_id: 0,
- loading: false,
- switchStoreLoading: false,
- submitLoading: false,
- activeName: 'basic_setting',
- times: null,
- basicForm: {
- goods_auth: 0,
- service_fee: 0,
- settle_type: 0,
- platform_ratio: 0,
- risk_management: 0,
- risk_management_ratio: 0,
- settle_scene: 1,
- store_distribution_status: 0,
- store_agent_status: 0,
- store_area_status: 0,
- store_boss_status: 0,
- payment_settlement_type: 0,
- address: '',
- province_id: '',
- province_name: '',
- city_id: '',
- city_name: '',
- district_id: '',
- district_name: '',
- street_id: '',
- street_name: '',
- community_id: '',
- community_name: '',
- c_id: '',
- cate_name:'',
- },
- category: [],
- storeForm: {
- shop_status: 1,
- store_background: '',
- username: '',
- password: '',
- repassword: '',
- store_service_fee: 0,
- store_service_fee_type: 0,
- store_service_ratio: 0,
- huifu_mch_no: '',
- store_settle_type: 1,
- store_service_fee_settle_type: 1,
- store_settle_scene: 2,
- store_commission_authority: {
- distribution: 0,
- agent: 0,
- area: 0,
- boss: 0,
- },
- business_time_start: '',
- business_time_end: '',
- status: 0,
- show_sync_goods: 0,
- is_enable_withdraw_setting: 0,
- balance_cash_service_fee: 0,
- balance_cash_service_fee_limit: 0,
- balance_cash_service_fee_month: 0,
- balance_cash_service_fee_diff: 0,
- },
- cashierForm: {
- is_preferential_gift: 0,//优惠赠送开关
- is_preferential_undertaking: 0,//优惠谁承担独立设置
- preferential_undertaking: '1',//优惠谁承担
- is_distribution_enable: 1,
- is_agent_enable: 1,
- service_fee_ratio: 0,
- member_status: 0,
- enable_discount_price: 0,
- discount_price_scale: 0,
- cashier_is_open_discount: 0,
- members: [
- // {
- // level: 0,
- // level_name: '默认等级',
- // discount: 0
- // }
- ],
- is_area_enable_cashier: 1, // 区域管理是否安装
- cashier_area_settings: { // 区域管理配置
- is_enable: 1, // 是否开启区域管理
- },
- area_currency: [],
- is_distribution: 0,
- deepNames: ['一级分销', '二级分销'],
- distribution_settings: [
- // {
- // level: 0,
- // level_name: '默认等级',
- // name: '佣金',
- // commission_rate: [10, 15]
- // },
- ],
- is_agent: 0,
- agent_settings: {
- // team_rewards: [{
- // level: 0,
- // level_name: '默认等级',
- // commission_rate: 0
- // }, ],
- // equal_rewards: [{
- // level: 0,
- // level_name: '默认等级',
- // commission_rate: 0
- // }, ],
- // over_rewards: [{
- // level: 0,
- // level_name: '默认等级',
- // commission_rate: 0
- // }, ],
- },
- cashier_goods_complete_direct: 0
- },
- categorys: [],
- basicFormRules: {},
- storeRules: {
- shop_status: [{
- required: true,
- message: '请设置营业状态',
- trigger: 'blur'
- }],
- range_time: [{
- required: true,
- validator: validateTime,
- trigger: 'blur'
- }],
- store_service_fee: [{
- required: true,
- message: '请设置是否收取服务器',
- trigger: 'blur'
- }],
- store_service_ratio: [{
- validator: validateStoreServiceRatio,
- trigger: 'blur'
- }],
- store_settle_type: [{
- required: true,
- message: '请选择计算方式',
- trigger: 'blur'
- }],
- store_service_fee_settle_type: [{
- required: true,
- message: '请选择计算方式',
- trigger: 'blur'
- }],
- store_settle_scene: [{
- required: true,
- message: '请选择结算方式',
- trigger: 'blur'
- }],
- repassword: [{
- validator: validatePass,
- trigger: 'blur'
- }],
- balance_cash_service_fee: [{
- required: true,
- message: '请输入提现手续费',
- trigger: 'blur'
- }],
- balance_cash_service_fee_month: [{
- required: true,
- message: '请输入当月商家累计提现',
- trigger: 'blur'
- }],
- balance_cash_service_fee_diff: [{
- required: true,
- message: '请输入超出手续费',
- trigger: 'blur'
- }],
- huifu_mch_no: [{
- required: true,
- message: '请输入汇付分账商户号',
- trigger: 'blur'
- }],
- },
- cashierFormRules: {
- cachier_service_ratio: [
- {
- validator: validateCachierServiceRatio,
- trigger: 'blur'
- }
- ],
- },
- basicRules: {},
- statisticsData: { // 基础信息数据统计对象
- 'total_money': '累计收入',
- 'balance': '当前余额',
- 'total_expenses': '累计支出',
- 'unsettled_amount': '累计提现',
- 'user_nums': '门店会员数',
- 'good_counts': '商品数',
- 'total_order_number': '订单支付数',
- 'total_order_money': '订单支付金额',
- 'total_settled_amount': '结算货款',
- 'share_amount': '已分帐金额',
- },
- isDisable: false, // 是否禁用门店
- baseDialogVisible: false,
- shareDialogVisible: false,
- addressDialogVisible: false,
- form: {
- name: '',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: ''
- },
- captcha: '发送验证码',
- address: '',
- latitude: 0,
- longitude: 0,
- addonsSettings: <?= $addons_settings ?? '{}'; ?>, // 各个插件模式配置
- goods: {},
- setting: {},
- commission_type_map: {},
- coupon_type_map: {},
- level: {},
- expireDate: null,
- editExpireTime: false,
- cashierDistributionName: 'commission',
- areaName: 'area-detail',
- huifu_addons: <?= $huifu_addons ?>,
- provinces: [],
- provinceInfo: {},
- citys: [],
- cityInfo: {},
- districts: [],
- districtInfo: {},
- streets: [],
- streetInfo: {},
- communitys: [],
- communityInfo: {},
- show_address:'',
- address_names:'',
- community_status: 0
- };
- },
- mounted: function() {
- this.store_id = getQuery('store_id');
- this.loadData();
- },
- methods: {
- handleCancel() {
- this.addressDialogVisible = false; // 关闭弹框
- // 可以在这里添加更多的取消逻辑
- },
- tabClickHandles(tab, key) {
- this[key] = tab.name
- },
- mapEvent(e) {
- console.log(e, '----')
- this.basicForm.address = e.address;
- this.basicForm.latitude = e.lat;
- this.basicForm.longitude = e.long;
- this.$forceUpdate();
- },
- storeSwitch() { // 启用/禁用门店
- let self = this;
- self.switchStoreLoading = true;
- let status = null;
- if (self.isDisable) {
- status = 1;
- } else {
- status = 3;
- }
- request({
- params: {
- r: 'store/store/switch-status',
- },
- method: 'post',
- data: {
- store_id: self.store_id,
- status: status,
- }
- }).then(e => {
- self.switchStoreLoading = false;
- if (e.data.code == 0) {
- self.isDisable = !self.isDisable;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.switchStoreLoading = false;
- console.log(e);
- self.$message.error('网络错误');
- return false;
- });
- },
- storeEdit(name) { // 编辑
- this[name] = true;
- },
- storeDetailSelectedImg(e, key) { // 选中图片
- console.log(e, 'upload----')
- this.basicForm[key] = e[0].url;
- },
- // 删除图片
- storeDetailDeletePic(key) {
- this.basicForm[key] = '';
- },
- addressDialog(){
- this.addressDialogVisible = false
- this.streetInfo.name = this.streetInfo.name ? this.streetInfo.name : '';
- this.communityInfo.name = this.communityInfo.name ? this.communityInfo.name : '';
- this.basicForm.province_id = this.provinceInfo.id;
- this.basicForm.city_id = this.cityInfo.id;
- this.basicForm.district_id = this.districtInfo.id;
- this.basicForm.street_id = this.streetInfo.id ? this.streetInfo.id : 0;
- this.basicForm.community_id = this.communityInfo.id ? this.communityInfo.id : 0;
- this.basicForm.address = this.address
- let address = this.address;
- let reg = new RegExp(/(.*?(?:省|自治区|北京市|天津市|上海市|重庆市))+(.*?(?:市|自治州|地区|区划|县))+(.*?(?:市|区|县|镇|乡|街道))/);
- let rst = address.match(reg);
- let addr = '';
- if (rst) {
- addr += this.provinceInfo.name + '/' + this.cityInfo.name + '/' + this.districtInfo.name;
- }
- this.basicForm.addr = addr;
- this.basicForm.show_address = this.provinceInfo.name + this.cityInfo.name + this.districtInfo.name + this.streetInfo.name + this.communityInfo.name + this.address
- //如果有从经纬度获取值,那么拼接后面的
- },
- // sendCode() { // 发送验证码
- // this.captcha = 60
- // this.countDown()
- // },
- // // 倒计时
- // countDown() {
- // var timer = setInterval(() => {
- // this.captcha--
- // if (this.captcha <= 0) {
- // clearInterval(timer)
- // this.captcha = '重新获取'
- // }
- // }, 1000)
- // },
- // 输入值过滤处理
- changeHandle(key) {
- try {
- this.flierValue(this.activeName, key);
- } catch (err) {
- this.$message.error(err);
- let tabs = this.activeName.split('_');
- let formName = tabs[0] + 'Form';
- if (this[formName][key] < 0) {
- this[formName][key] = Math.abs(this[formName][key]);
- } else if (this[formName][key] > 100) {
- this[formName][key] = 0;
- }
- return false;
- }
- },
- // 过滤和处理值
- flierValue(group, key) {
- // console.log(group, key);
- let configs = {
- store_service_ratio: {
- text: `服务费比例取值在 0~100 之间`,
- max: '100',
- min: '0',
- },
- // expired_days: {
- // text: '请填写门店有效天数',
- // min: '0',
- // },
- // service_fee_ratio: {
- // text: `服务费比例取值在 0~100 之间`,
- // max: '100',
- // min: '0',
- // },
- };
- let datas = {
- basic_setting: this.basicForm,
- cashier_setting: this.cashierForm,
- store_setting: this.storeForm,
- };
- let val = datas[group][key];
- if (configs[key]) {
- if (configs[key].max && val > parseInt(configs[key].max)) {
- throw new Error(configs[key].text);
- }
- if (configs[key].min && val < parseInt(configs[key].min)) {
- throw new Error(configs[key].text);
- }
- }
- },
- regionChange(val,level) {
- if (level < 4 && val.lng !== "" && val.lat !== "") {
- this.basicForm.longitude = val.lng;
- this.basicForm.latitude = val.lat;
- }
- switch (level) {
- case 1:
- this.provinceInfo.id = val.id;
- this.provinceInfo.name = val.name;
- this.cityInfo = {};
- this.districtInfo = {};
- this.streetInfo = {};
- this.communityInfo = {};
- this.citys = '';
- this.districts = '';
- this.streets = '';
- this.communitys = '';
- break;
- case 2:
- this.cityInfo.id = val.id;
- this.cityInfo.name = val.name;
- this.districtInfo = {};
- this.streetInfo = {};
- this.communityInfo = {};
- this.districts = '';
- this.streets = '';
- this.communitys = '';
- break;
- case 3:
- this.districtInfo.id = val.id;
- this.districtInfo.name = val.name;
- this.streetInfo = {};
- this.communityInfo = {};
- this.streets = '';
- this.communitys = '';
- break;
- case 4:
- this.streetInfo.id = val.id;
- this.streetInfo.name = val.name;
- this.communityInfo = {};
- this.communitys = '';
- break;
- case 5:
- this.communityInfo.id = val.id;
- this.communityInfo.name = val.community_name;
- break;
- }
- this.getCity(level, val.id);
- },
- // 省市区三级联动
- getCity(level, id ) {
- let self = this;
- request({
- params: {
- r: 'store/store/get-regions',
- region_id: id,
- level: level,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- switch (level) {
- case 1:
- self.citys = e.data.data;
- break;
- case 2:
- self.districts = e.data.data;
- break;
- case 3:
- self.streets = e.data.data;
- break;
- case 4:
- self.communitys = e.data.data;
- break;
- }
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- self.$message.error('网络错误');
- return false;
- });
- },
- //选定社区
- communityChange(val) {
- this.communityInfo = val
- },
- loadData() {
- let self = this;
- this.loading = true;
- request({
- params: {
- r: 'store/store/detail',
- store_id: self.store_id,
- },
- method: 'get'
- }).then(e => {
- // console.log('LLLLLLL: ', e);
- self.loading = false;
- if (e.data.code === 0) {
- self.provinces = e.data.data.provinces;
- this.community_status = e.data.data.community_status
- if (e.data.data.basic_setting) {
- self.basicForm = e.data.data.basic_setting;
- self.address_names = e.data.data.basic_setting.address_names.split('-');
- if(self.basicForm.province_id){
- self.provinceInfo.id = self.basicForm.province_id;
- self.provinceInfo.name = self.address_names[0];
- }
- if(self.basicForm.city_id){
- this.getCity(1,self.basicForm.province_id)
- self.cityInfo.id = self.basicForm.city_id;
- self.cityInfo.name = self.address_names[1];
- }
- if(self.basicForm.district_id){
- this.getCity(2,self.basicForm.city_id)
- self.districtInfo.id = self.basicForm.district_id;
- self.districtInfo.name = self.address_names[2];
- }
- if(self.basicForm.street_id){
- this.getCity(3,self.basicForm.district_id)
- self.streetInfo.id = self.basicForm.street_id;
- self.streetInfo.name = self.address_names[3];
- }
- if(self.basicForm.community_id){
- this.getCity(4,self.basicForm.street_id)
- self.communityInfo.id = self.basicForm.community_id;
- self.communityInfo.name = self.address_names[4];
- }
- self.address = self.basicForm.address;
- if (1 == e.data.data.basic_setting.status) {
- this.isDisable = false;
- } else {
- this.isDisable = true;
- }
- }
- if (e.data.data.store_setting) {
- e.data.data.store_setting.status=0;
- self.storeForm = e.data.data.store_setting;
- self.times = [e.data.data.store_setting.business_time_start, e.data.data.store_setting.business_time_end];
- }
- if (e.data.data.cashier_setting) {
- self.cashierForm = e.data.data.cashier_setting;
- self.cashierForm.preferential_undertaking = self.cashierForm.preferential_undertaking.toString();
- }
- // console.log(self.times);
- // console.log('self.storeForm: ', self.storeForm);
- this.getCategory();
- this.getModelDetail();
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- // console.log(e);
- self.$message.error('网络错误');
- });
- },
- // 配置提交
- submit(formName) {
- // console.log('5555555555: ', formName, this.activeName, this.storeForm);return null;
- let self = this;
- let keys = [];
- if ('basic_setting' == self.activeName) {
- keys = [];
- } else if ('cashier_setting' == self.activeName) {
- keys = ['service_fee_ratio'];
- // 会员等级折扣验证
- if (1 == self.cashierForm.member_status) {
- let memberForNum = self.cashierForm.members.length;
- for (let i = 0; i < memberForNum; i++) {
- let discount_val = self.cashierForm.members[i].discount;
- if (discount_val < 0 || discount_val > 100) {
- self.$message.error('会员折扣比例取值在 0~100 之间');
- return false;
- }
- }
- }
- // 分销佣金比例验证
- if (1 == self.cashierForm.is_distribution && 1 == self.cashierForm.is_distribution_enable) {
- let forNum = self.cashierForm.distribution_settings.length;
- for (let i = 0; i < forNum; i++) {
- let val = self.cashierForm.distribution_settings[i].commission_rate;
- let valForNum = val.length;
- for (let i = 0; i < valForNum; i++) {
- if (val[i] < 0 || val[i] > 100) {
- self.$message.error('分销佣金比例取值在 0~100 之间');
- return false;
- }
- }
- }
- }
- // 经销佣金比例验证
- if (1 == self.cashierForm.is_agent && 1 == self.cashierForm.is_agent_enable) {
- for (key in self.cashierForm.agent_settings) {
- let settings = self.cashierForm.agent_settings[key];
- let forNum = settings.length;
- for (let i = 0; i < forNum; i++) {
- let val = settings[i].commission_rate;
- if (val < 0 || val > 100) {
- self.$message.error('经销佣金比例取值在 0~100 之间');
- return false;
- }
- }
- }
- }
- } else if ('store_setting' == self.activeName) {
- keys = ['store_service_ratio'];
- if (self.storeForm.password && self.storeForm.password != self.storeForm.repassword) {
- self.$message.error('两次输入密码不一致');
- return false;
- }
- }
- let forNum = keys.length;
- for (let i = 0; i < forNum; i++) {
- try {
- self.flierValue(self.activeName, keys[i]);
- } catch (err) {
- self.$message.error(err);
- return false;
- }
- }
- // console.log(self.$refs);return null;
- self.$refs[formName].validate(valid => {
- if (valid) {
- self.submitLoading = true;
- let activeName = self.activeName;
- let formData = {};
- formData[activeName] = self[formName];
- formData.group = activeName;
- formData.store_id = this.store_id;
- // console.log(formData);return null;
- request({
- params: {
- r: 'store/store/detail',
- },
- method: 'post',
- data: formData,
- }).then(e => {
- self.submitLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- return false;
- }
- }).catch(e => {
- self.submitLoading = false;
- console.log(e);
- self.$message.error('网络错误');
- return false;
- });
- } else {
- self.$message.error('参数验证未通过');
- return false;
- }
- });
- },
- handleClick(tab, event) {
- this.activeName = tab.name;
- },
- // 时间改变回调
- selectTime(e) {
- // console.log('kkkkkkk ==== : ', e, this.times);
- if (e) {
- this.storeForm.business_time_start = this.times[0];
- this.storeForm.business_time_end = this.times[1];
- } else {
- this.times = null;
- this.storeForm.business_time_start = '';
- this.storeForm.business_time_end = '';
- }
- },
- // 选择图片
- selectedImg(e, key) {
- // console.log('ddddd: ', e, key);
- this.storeForm[key] = e[0].url;
- this.$forceUpdate();
- },
- // 删除图片
- delPic(key) {
- this.storeForm[key] = '';
- this.$forceUpdate();
- },
- handleCascaderChange(selectedValues) {
- // 方法1:使用$refs获取选中节点(推荐)
- const cascader = this.$refs.cascaderRef;
- const selectedNodes = cascader.getCheckedNodes();
- if (selectedNodes && selectedNodes.length > 0) {
- // 获取第一个选中节点的完整路径(单选情况)
- const pathLabels = selectedNodes[0].pathLabels;
- this.basicForm.cate_name = pathLabels.join(' / ');
- this.basicForm.c_id = selectedValues[selectedValues.length -1];
- } else {
- this.basicForm.cate_name = '';
- }
- },
- // 获取门店模式设置详情
- getModelDetail() {
- let self = this;
- self.cardLoading = true;
- request({
- params: {
- r: 'store/store/model-detail',
- store_id: self.store_id,
- },
- method: 'get',
- }).then(e => {
- // console.log(e, 'model-detail ============== ');
- self.cardLoading = false;
- if (e.data.code == 0) {
- self.level = e.data.data.level;
- if (!isEmpty(e.data.data.setting)) {
- self.setting = e.data.data.setting;
- for (let key in self.setting) {
- // 将空的
- if (isEmpty(self.setting[key])) self.setting[key] = {};
- }
- }
- self.commission_type_map = e.data.data.commission_type_map;
- self.coupon_type_map = e.data.data.coupon_type_map;
- self.storeForm.status = e.data.data.status;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- getData(val, key) {
- this.storeForm[key] = val;
- },
- getCategory() {
- request({
- params: {
- r: 'store/store/store-cate-tree',
- }
- }).then(res => {
- if (res.data.code == 0) {
- this.category = res.data.data.list
- } else {
- this.$message.error(res.data.msg);
- }
- });
- },
- expireDateChange(e) {
- // console.log(e, '=============== ', this.basicForm.expire_time);
- this.basicForm.expire_time = Math.ceil(e / 1000) +86399;
- },
- suonaTest() {
- let self = this;
- if (isEmpty(self.storeForm.device_id)) {
- self.$message.error('设备ID不能为空');
- return false;
- }
- request({
- params: {
- r: 'store/store/suona-test',
- },
- method: 'post',
- data: {
- store_id: self.store_id,
- device_id: self.storeForm.device_id
- },
- }).then(e => {
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.$message.error('网络错误');
- });
- },
- onChangeStoreServiceFee(val) {
- console.log('onChangeStoreServiceFee', val)
- this.storeForm.store_settle_type = 2
- },
- handleFeeTypeChange(val) {
- console.log('handleFeeTypeChange', val)
- if (val === 0) {
- this.storeForm.store_settle_type = 2;
- }
- },
- },
- computed: {
- }
- });
- </script>
- <style>
- .grid-box {
- padding: 0 40px;
- background: #fff;
- border-radius: 0 0 4px 4px;
- }
- .grid-item {
- height: 130px;
- }
- .grid-text {
- font-size: 15px;
- }
- .grid-val {
- font-size: 20px;
- padding-top: 10px;
- }
- .grid-icon {
- color: #999;
- cursor: pointer;
- font-size: 18px;
- }
- .store-card {
- margin-top: 15px;
- }
- .store-card.el-card {
- border: 0;
- }
- .store-card-body .store-name {
- padding-left: 10px;
- }
- .store-card-body .el-descriptions__body {
- padding: 20px 40px;
- }
- .store-send-code {
- padding-left: 10px;
- font-size: 12px;
- cursor: pointer;
- }
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .title {
- padding: 0px 8px;
- border-left: 5px solid #1479F0;
- background-color: #fff;
- font-size: 18px;
- position: relative;
- left: 32px;
- margin: 20px 0;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- padding: 9px 25px;
- margin-bottom: 15px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- .btn-abs {
- position: absolute;
- top: 12px;
- right: 18px;
- }
- .form-body .app-share {
- padding-top: 12px;
- border-top: 1px solid #e2e2e2;
- margin-top: -20px;
- }
- .form-body .app-share .app-share-bg {
- position: relative;
- width: 310px;
- height: 360px;
- background-repeat: no-repeat;
- background-size: contain;
- background-position: center
- }
- .form-body .app-share .app-share-bg .title {
- width: 160px;
- height: 29px;
- line-height: 1;
- word-break: break-all;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .form-body .app-share .app-share-bg .pic-image {
- background-repeat: no-repeat;
- background-position: 0 0;
- background-size: cover;
- width: 160px;
- height: 130px;
- }
- .cashier-tabs .el-tabs__header {
- padding: 0;
- height: 45px;
- line-height: 45px;
- /* background-color: #F5F7FA; */
- margin-bottom: 0;
- }
- .cashier-tabs .el-tabs__item {
- height: 43px;
- line-height: 43px;
- }
- .cashier-tabs .el-tabs__content {
- margin-top: 20px;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- .add-image-btn {
- width: 100px;
- height: 100px;
- color: #419EFB;
- border: 1px solid #e2e2e2;
- cursor: pointer;
- }
- .addon-no-install {
- margin-top: 15px;
- margin-left: 40px;
- }
- .desc-container {
- padding: 20px;
- }
- .el-descriptions__body {
- color: #606266;
- background-color: #FFF;
- padding: 40px;
- }
- .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
- line-height: 3;
- }
- .stat-item-label {
- font-size: 18px;
- line-height: 3;
- /* width: 38%; */
- }
- .stat-itme-content {
- font-size: 18px;
- line-height: 3;
- }
- .delele-img-btn {
- position: absolute;
- left: 64px;
- top: -13px;
- }
- .goods-box {
- position: relative;
- left: -104px;
- }
- .mode-switch-btn {
- position: relative;
- left: -106px;
- }
- .mode-switch-box {
- margin-bottom: 30px;
- }
- .form-body {
- padding: 10px 20px 20px;
- background-color: #fff;
- margin-bottom: 30px;
- }
- </style>
|