| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-attachment');
- ComponentHelper::loadComponentView('com-upload');
- ComponentHelper::loadComponentView('com-image');
- ComponentHelper::loadComponentView('com-qq-map');
- ComponentHelper::loadComponentView('com-pick-link');
- ComponentHelper::loadComponentView('com-rich-text');
- ComponentHelper::loadComponentView('com-district');
- ?>
- <style>
- .form-body {
- padding: 20px 0;
- background-color: #fff;
- margin-bottom: 20px;
- }
- .form-button {
- margin: 0;
- }
- .form-button .el-form-item__content {
- margin-left: 0!important;
- }
- .button-item {
- padding: 9px 25px;
- }
- .app-share {
- padding-top: 12px;
- border-top: 1px solid #e2e2e2;
- margin-top: -20px;
- }
- .app-share .app-share-bg {
- position: relative;
- width: 310px;
- height: 360px;
- background-repeat: no-repeat;
- background-size: contain;
- background-position: center
- }
- .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;
- }
- .app-share .app-share-bg .pic-image {
- background-repeat: no-repeat;
- background-position: 0 0;
- background-size: cover;
- width: 160px;
- height: 130px;
- }
- .goods-list {
- flex-wrap: wrap;
- margin-top: 10px;
- /* cursor: move; */
- }
- .goods-item,
- .goods-add {
- width: 50px;
- height: 50px;
- position: relative;
- border: 1px solid #e2e2e2;
- margin-right: 15px;
- margin-bottom: 15px;
- }
- .goods-add .el-button {
- width: 100%;
- height: 100%;
- border: none;
- border-radius: 0;
- padding: 0;
- }
- .goods-delete {
- position: absolute;
- left: calc(100% - 13px);
- top: -13px;
- width: 25px;
- height: 25px;
- line-height: 25px;
- padding: 0 0;
- visibility: hidden;
- z-index: 1;
- }
- .goods-delete .el-icon-close {
- position: absolute;
- top: 6px;
- left: 6px;
- }
- .goods-item:hover .goods-delete {
- visibility: visible;
- }
- .goods-pic {
- background-size: cover;
- background-position: center;
- width: 100%;
- height: 100%;
- background-color: #f6f6f6;
- background-repeat: no-repeat;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .customize-share-title {
- position: relative;
- margin-top: 10px;
- }
- .customize-share-title .del-btn {
- position: absolute;
- top: -10px;
- left: 70px;
- }
- .title {
- padding: 0px 8px;
- border-left: 5px solid #1479F0;
- background-color: #fff;
- font-size: 18px;
- position: relative;
- left: 32px;
- margin: 20px 0;
- }
- .msg-title {
- padding: 18px 20px;
- margin-bottom: 18px;
- border-bottom: 1px solid #F3F3F3;
- line-height: normal;
- }
- </style>
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;">
- <div class="form_box">
- <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
- <el-tabs v-model="activeName" @tab-click="change_tab">
- <el-tab-pane label="基础设置" name="basic">
- <?=ComponentHelper::loadComponentView('basic/basic', __DIR__ . '/');?>
- </el-tab-pane>
- <el-tab-pane label="物流设置" name="logistics">
- <?=ComponentHelper::loadComponentView('basic/logistics', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="区域设置" name="arealimit">
- <?=ComponentHelper::loadComponentView('basic/arealimit', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="客服设置" name="service">
- <?=ComponentHelper::loadComponentView('basic/service', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="版权设置" name="copyright">
- <?=ComponentHelper::loadComponentView('basic/copyright', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="公众号关注设置" name="follow">
- <?=ComponentHelper::loadComponentView('basic/follow', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="支付方式设置" name="pay">
- <?=ComponentHelper::loadComponentView('basic/pay', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="消息提醒" name="notice">
- <?=ComponentHelper::loadComponentView('basic/notice', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="敏感词过滤" name="sensitivewords">
- <?=ComponentHelper::loadComponentView('basic/sensitivewords', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="短信提醒" name="message">
- <?=ComponentHelper::loadComponentView('basic/message', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="详情设置" name="goodsdetail">
- <?=ComponentHelper::loadComponentView('basic/goodsdetail', __DIR__ . '/'); ?>
- </el-tab-pane>
- </el-tabs>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="submit" size="small">保存
- </el-button>
- </el-form>
- </div>
- </el-card>
- </div>
- <script src="<?= Yii::$app->request->baseUrl ?>/resources/unpkg/vuedraggable@2.18.1/dist/vuedraggable.umd.min.js"></script>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- multiple: Boolean,
- loading: false,
- btnLoading: false,
- btnLoading1: false,
- btnLoading2: false,
- btnLoading3: false,
- btnLoading4: false,
- params: {},
- areaLimitStatus:false,
- refundStatus:false,
- tabPosition:'left',
- earaRule: [],
- tabUser:'left',
- tabNotice:'left',
- activeName: 'basic',
- aliyunActive: 'domestic',
- submailActive: 'domestic',
- smsSystem: {
- 'platform': {
- 'aliyun': '阿里云',
- 'qcloud': '腾讯云',
- 'submail': '赛邮云',
- },
- 'qcloudActive': 'domestic',
- },
- dialogVisible: false,
- imgCaseImg: '',
- mall_sign: '',
- app_style: [],
- ruleForm: {
- // 基础设置
- basic: {
- name:{title:'商城名称',value:'',remark: ''},
- contact_tel:{title:'联系号码',value:'',remark: ''},
- web_url:{title:'网站url',value:'',remark: ''},
- logo:{title:'商城logo',value:'',remark: '建议尺寸:100 * 100',extra_type:'imgCase',extra:'/resources/img/mall/app-share-name.png'},
- quick_map_address:{title:'详细地址',value:'',remark: '请输入详细地址'},
- latitude_longitude:{title:'经纬度',value:'',remark: '请输入经纬度,用英文逗号分离'},
- latitude:{title:'纬度',value:'',remark: ''},
- longitude:{title:'经度',value:'',remark: ''},
- app_share_title:{title:'自定义分享标题',value:'',remark: '',extra_type:'imgCase',extra:'/resources/img/mall/app-share-name.png'},
- app_share_desc:{title:'自定义分享描述',value:'',remark: '',extra_type:'imgCase',extra:'/resources/img/mall/app-share-pic.png'},
- app_share_pic:{title:'自定义分享图片',value:'',remark: '分享给好友时,作为分享图片,建议尺寸420 * 336',extra_type:'imgCase',extra:'/resources/img/mall/app-share-pic.png'},
- is_address_goods_search:{title:'是否显示商品区域筛选',value:0,remark: '开启以后前端商品搜索框可进行区域筛选产品'},
- is_enable_dollars_symbol:{title:'是否开启自定义金钱符号',value:0,remark: '开启时前端所有带“¥”的符号显示变更为自定义名称'},
- dollars_symbol:{title:'',value:'',remark: '可不填,设置参数为空时,前端显示空白。则不需要金钱符号'},
- is_system_in_maintenance:{title:'是否禁止接口访问',value: 0,remark: '开启后所有的接口访问都会返回“商城维护中”的提示,目的是禁止商城访问'},
- is_write_name:{title:'登录时是否填写昵称',value: 0,remark: 'h5注册时,按钮关闭,自动给用户命名“游客001”、“游客002”...;按钮开启,强制用户填写昵称'},
- },
- // 快递
- logistics: {
- request_type: {title:'快递类型',value:1,remark: ''},
- kdniao_request_type:{title:'快递鸟请求类型',value:1,remark: ''},
- kdniao_mch_id:{title:'快递鸟商户ID',value:'',remark: '快递鸟商户ID用于查询快递物流轨迹信息'},
- kdniao_api_key:{title:'快递鸟API KEY',value:'',remark: ''},
- jd_mch_code:{title:'京东商家编码',value:'',remark: '若您使用京东物流,则需填写"京东商家编码",否则将会造成物流信息无法查询'},
- update:{title:'物流更新',value:8,remark: 'N小时才可更新一次物流,0则表示不做任何限制刷新即更新'},
- aliyun_app_id:{title:'App ID',value:'',remark: ''},
- aliyun_app_key:{title:'App Key',value:'',remark: ''},
- aliyun_app_secret:{title:'App Secret',value:'',remark: ''},
- },
- service: {
- web_service_url:{title:'外链客服链接',value:'',remark: ''},
- web_service_applets:{title:'客服小程序链接',value:'',remark: ''},
- alipay_mini_service_enable:{title:'支付宝小程序客服',value:'0',remark: ''},
- alipay_mini_service_inst_id:{title:'企业编码',value:'',remark: '对应 https://csmng.cloud.alipay.com/ccm.htm#/fc-setting/all?ddtab=true -> 服务窗配置 -> 部署 租户ID'},
- alipay_mini_service_scene:{title:'聊天窗编码',value:'',remark: '对应 https://csmng.cloud.alipay.com/ccm.htm#/fc-setting/all?ddtab=true -> 服务窗配置 -> 部署 聊天窗ID'},
- hide_service_entry:{title:'隐藏客服入口',value:'0',remark: '如果打开当前开关那么商品详情页面左下角客服入口将被隐藏'},
- },
- copyright: {
- status:{title:'版权开关',value:'0',remark: ''},
- description:{title:'底部版权文字',value:'',remark: ''},
- usage_agreement:{title:'软件许可使用协议', value:'', remark: ''},
- certificates:{title:'证照信息', value:[], remark: ''},
- pic_url:{title:'版权图标',value:'',remark: '建议尺寸160*50'},
- link_url:{title:'版权链接',value:'https://www.qijianshigw.com',remark: ''},
- link_logo:{title:'版权LOGO',value:'https://shuzixiangdao.oss-cn-guangzhou.aliyuncs.com/images/2021/12/13/image_1639389765_m4a9raM4.png',remark: ''},
- link_text:{title:'版权文字',value:'七件事提供技术支持',remark: ''},
- },
- follow: {
- is_subscribe:{title:'公众号关注',value:'0',remark: ''},
- subscribe_type:{title:'关注公众号引导',value:'',remark: ''},
- subscribe_link:{title:'链接引导',value:'',remark: ''},
- subscribe_qrcode:{title:'二维码引导',value:'',remark: '将作为公众号关注引导二维码,建议尺寸:100 * 100'},
- },
- pay: {
- balance:{
- title:'余额设置',
- value:{
- status:'0',
- pay_password_status:'0',
- // balance_charge_status:'0'
- is_enable_group:'0',
- },
- remark:''
- },
- score:{
- title:'积分设置',
- value:{
- status:'0',
- pay_password_status:'0',
- is_enable_group:'0',
- },
- remark:''
- },
- wechat:{
- title:'微信设置',
- value:{
- status:'0',
- // wechat_app_id:'',
- wechat_open_app_id:'',
- wechat_mch_id:'',
- wechat_pay_secret:'',
- wechat_pay_secret_v3:'',
- wechat_cert_pem:'',
- wechat_cert_pem_file:'',
- wechat_key_pem:'',
- wechat_key_pem_file:'',
- wechat_transfer:2,
- wechat_serial: '',
- wechat_pay_public_key_id: '',
- wechat_transfer_version:1,
- wechat_auto_pay_limit:200,
- },
- remark:''
- },
- alipay:{
- title:'支付宝设置',
- value:{
- status:'0',
- alipay_app_id:'',
- alipay_private_key:'',
- alipay_public_key:'',
- },
- remark:''
- },
- mixed:{
- title:'组合支付设置',
- value:{
- status:'0',
- },
- remark:''
- },
- },
- notice_wechat:{
- is_logging: {title:"开启消息模板推送",value:'0',remark:''},
- is_miniapp_priority: {title:"是否跳转链接小程序优先",value:'0',remark:''},
- is_open: {title:"是否记录数据库日志",value:'0',remark:''},
- template_message: {},
- },
- notice_sms:{
- status: {title:"状态",value:'0',remark:''},
- platform: {title:"平台",value:'aliyun',remark:''},
- access_key_id: {title:"access_key_id",value:'',remark:''},
- access_key_secret: {title:"access_key_secret",value:'',remark:''},
- template_name: {title:"模板签名",value:'',remark:''},
- register_template_id: {title:"模板ID",value:'',remark:''},
- register_template_variable: {title:"模板签名",value:'',remark:''},
- order_template_id: {title:"模板ID",value:'',remark:''},
- order_template_variable: {title:"模板签名",value:'',remark:''},
- sale_template_id: {title:"模板ID",value:'',remark:''},
- sale_template_variable: {title:"模板签名",value:'',remark:''},
- captcha_template_id: {title:"模板ID",value:'',remark:''},
- captcha_template_variable: {title:"模板签名",value:'',remark:''},
- user_level_expired_template_id: {title:"模板ID",value:'',remark:''},
- user_level_expired_template_variable: {title:"模板签名",value:'',remark:''},
- int_access_key_id: {title:"access_key_id",value:'',remark:''},
- int_access_key_secret: {title:"access_key_secret",value:'',remark:''},
- int_template_name: {title:"模板签名",value:'',remark:''},
- int_register_template_id: {title:"模板ID",value:'',remark:''},
- int_register_template_variable: {title:"模板签名",value:'',remark:''},
- int_order_template_id: {title:"模板ID",value:'',remark:''},
- int_order_template_variable: {title:"模板签名",value:'',remark:''},
- int_sale_template_id: {title:"模板ID",value:'',remark:''},
- int_sale_template_variable: {title:"模板签名",value:'',remark:''},
- int_captcha_template_id: {title:"模板ID",value:'',remark:''},
- int_captcha_template_variable: {title:"模板签名",value:'',remark:''},
- int_user_level_expired_template_id: {title:"模板ID",value:'',remark:''},
- int_user_level_expired_template_variable: {title:"模板签名",value:'',remark:''},
- mobile: {title:"手机号",value:'',remark:''},
- mobile_limit_num: {title:"短信手机号限制",value:'3',remark:''},
- ip_limit_num: {title:"短信IP限制",value:'10',remark:''},
- // 腾讯云短信
- qcloud_sdk_app_id: {title:"sdk_app_id", value:'', remark:''}, // 腾讯云SDK AppID
- qcloud_app_key: {title:"app_key", value:'', remark:''}, // 腾讯云SDK AppID
- qcloud_secret_id: {title:"secret_id", value:'', remark:''}, // 腾讯云SecretId
- qcloud_secret_key: {title:"secret_key", value:'', remark:''}, // 腾讯云SecretKey
- qcloud_mobile: {title:"mobile", value:'', remark:''}, // 手机号
- qcloud_domestic_sign_name: {title:"sign_name", value:'', remark:''}, // 国内短信签名
- qcloud_international_sign_name: {title:"sign_name", value:'', remark:''}, // 国际短信签名
- // 腾讯云短信国内信息
- domestic_register_template_id: {title:"register_template_id", value:'', remark:''}, // 注册模板ID
- domestic_register_template_sign: {title:"register_template_sign", value:'', remark:''}, // 注册模板签名
- domestic_order_template_id: {title:"order_template_id", value:'', remark:''}, // 订单支付模板ID
- domestic_order_template_sign: {title:"order_template_sign", value:'', remark:''}, // 订单支付模板签名
- domestic_sale_template_id: {title:"sale_template_id", value:'', remark:''}, // 订单售后模板ID
- domestic_sale_template_sign: {title:"sale_template_sign", value:'', remark:''}, // 订单售后模板签名
- domestic_captcha_template_id: {title:"captcha_template_id", value:'', remark:''}, // 验证码模板ID
- domestic_captcha_template_sign: {title:"captcha_template_sign", value:'', remark:''}, // 验证码模板签名
- domestic_user_level_expired_template_id: {title:"user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
- domestic_user_level_expired_template_sign: {title:"user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
- // 腾讯云短信国际信息
- international_register_template_id: {title:"register_template_id", value:'', remark:''}, // 注册模板ID
- international_register_template_sign: {title:"register_template_sign", value:'', remark:''}, // 注册模板签名
- international_order_template_id: {title:"order_template_id", value:'', remark:''}, // 订单支付模板ID
- international_order_template_sign: {title:"order_template_sign", value:'', remark:''}, // 订单支付模板签名
- international_sale_template_id: {title:"sale_template_id", value:'', remark:''}, // 订单售后模板ID
- international_sale_template_sign: {title:"sale_template_sign", value:'', remark:''}, // 订单售后模板签名
- international_captcha_template_id: {title:"captcha_template_id", value:'', remark:''}, // 验证码模板ID
- international_captcha_template_sign: {title:"captcha_template_sign", value:'', remark:''}, // 验证码模板签名
- international_user_level_expired_template_id: {title:"user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
- international_user_level_expired_template_sign: {title:"user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
- //赛邮云短信配置
- submail_app_id:{title: 'submail_app_id', value:'', remark:'',},//appId
- submail_app_key:{title: 'submail_app_key', value:'', remark:'',},//appKey
- submail_mobile:{title: 'submail_mobile', value:'', remark:'',},//测试手机号
- submail_domestic_register_template_id: {title:"submail_domestic_register_template_id", value:'', remark:''}, // 注册模板ID
- submail_domestic_register_template_sign: {title:"submail_domestic_register_template_sign", value:'', remark:''}, // 注册模板签名
- submail_domestic_order_template_id: {title:"submail_domestic_order_template_id", value:'', remark:''}, // 订单支付模板ID
- submail_domestic_order_template_sign: {title:"submail_domestic_order_template_sign", value:'', remark:''}, // 订单支付模板签名
- submail_domestic_sale_template_id: {title:"submail_domestic_sale_template_id", value:'', remark:''}, // 订单售后模板ID
- submail_domestic_sale_template_sign: {title:"submail_domestic_sale_template_sign", value:'', remark:''}, // 订单售后模板签名
- submail_domestic_captcha_template_id: {title:"submail_domestic_captcha_template_id", value:'', remark:''}, // 验证码模板ID
- submail_domestic_captcha_template_sign: {title:"submail_domestic_captcha_template_sign", value:'', remark:''}, // 验证码模板签名
- submail_domestic_user_level_expired_template_id: {title:"submail_domestic_user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
- submail_domestic_user_level_expired_template_sign: {title:"submail_domestic_user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
- },
- notice_alipay: {
- order_created: {title:"未付款订单",value:'0',remark:''},
- order_pay: {title:"待发货订单",value:'0',remark:''},
- order_ship: {title:"待收货订单",value:'0',remark:''},
- order_receive: {title:"已收货订单",value:'0',remark:''},
- order_complete: {title:"已完成订单",value:'0',remark:''},
- order_close: {title:"已关闭订单",value:'0',remark:''},
- order_refund_created:{title:"等待商家处理",value:'0',remark:''},
- order_refund_agree:{title:"已同意退货申请,等待买家处理",value:'0',remark:''},
- order_refund_buyer:{title:"买家已退货",value:'0',remark:''},
- order_refund_ship:{title:"已重新发货",value:'0',remark:''},
- order_refund_buyer_reject:{title:"买家拒绝售后申请",value:'0',remark:''},
- order_refund_seller_reject:{title:"商家拒绝售后申请",value:'0',remark:''},
- order_refund_complete:{title:"退款完成",value:'0',remark:''},
- },
- //商品详情页推荐设置
- goods:{
- is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
- goods_list:{title:"商品列表",value:[],remark:""},
- },
- area:{
- is_area_limit:{title:'配送范围限制',value:'0',remark: ''},
- area_limit:{title:'允许购买区域',value:[],remark: ''},
- is_area_limit_town:{title:'启用乡镇级别限制',value:'0',remark: ''},
- },
- //订单完成后推荐设置
- order_pay:{
- is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
- goods_list:{title:"商品列表",value:[],remark:""},
- },
- upgrade: {
- Distribution:{title:'经销商升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- Agent:{title:'渠道分红升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- Boss:{title:'股东升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- BossAchievement:{title:'股东业绩升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- ServeBonus:{title:'服务商升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- Achievement:{title:'业绩奖励升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
- },
- //评论后推荐设置
- order_comment:{
- is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
- goods_list:{title:"商品列表",value:[],remark:""},
- },
- //打印机
- printer: {
- printer: {name: "七件事打印机"}
- },
- //敏感词
- sensitive:{
- api_key:{title:"敏感词api_key",value:'',remark:""},
- secret_key:{title:"敏感词secret_key",value:'',remark:""},
- },
- goodsdetail: {
- home_text:{title:"首页文字自定义",value:'',remark:""},
- }
- },
- goodsDialog: {
- visible: false,
- page: 1,
- loading: null,
- pagination: null,
- list: [],
- index: 'goods',
- selectedList: null,
- max: 20,//添加商品最大数量
- },
- keyword: '',
- pem_value: '',
- mall_id: <?= $mall_id ?>,
- notice_loading: false,
- is_install_logistics: <?= $is_install_logistics ?>,
- }
- },
- mounted: function() {
- let tab_name= getQuery('tab_name');
- if(tab_name)
- {
- this.activeName =tab_name
- }
- this.loadData();
- },
- methods: {
- change_tab() {
- if(this.activeName == 'areaLimit') this.areaLimitStatus = true;
- if(this.activeName == 'refund') this.refundStatus = true;
- // if (this.activeName == 'printer') this.show = false;
- },
- certificatesPic(e) { // 证件照
- if (e.length) {
- // 设置为只需要10张。当用户超过10张时,去除后面超出数据
- let length = this.ruleForm.copyright.certificates.value.length;
- e = e.slice(0, 10 - length);
- if (this.ruleForm.copyright.certificates.value.length >= 10) return;
- e.forEach((item, index) => {
- this.ruleForm.copyright.certificates.value.push({
- id: item.id,
- pic_url: item.url
- });
- })
- }
- },
- delPic(type, index) { // 删除图片
- switch (type) {
- case 'bannar_pic':
- this.ruleForm.copyright.certificates.value.splice(index, 1)
- break;
- default:
- break;
- }
- },
- loadData() {
- if(this.loading === true) return;
- this.loading = true;
- request({
- params: {
- r: 'mall/setting/edit',
- type: 'mall_basic'
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if(e.data.data) {//有选中的
- let data = e.data.data
- this.mall_sign = data.mall_sign;
- Object.keys(this.ruleForm).forEach((key) => {
- Object.keys(this.ruleForm[key]).forEach((k) => {
- if (!isEmpty(data[key][k])) {
- var dataValue = data[key][k].value;
- if(data[key][k].value!==null&&data[key][k].value!==""){
- if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
- // 将json字符串转为对象
- this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
- }else{
- this.ruleForm[key][k].value = data[key][k].value;
- }
- }
- }
- });
- });
- this.ruleForm.basic.web_url.value = data.web_url;
- }
- }
- }).catch(e => {
- this.loading = false;
- })
- },
- submit() {
- // 解决php提交变量的限制
- let area_limit = '';
- if(this.ruleForm.area.area_limit.value.length > 0){
- area_limit = JSON.stringify(this.ruleForm.area.area_limit.value)
- }
- if(this.ruleForm.pay.wechat.value.wechat_auto_pay_limit === undefined){
- this.ruleForm.pay.wechat.value.wechat_auto_pay_limit = 200;
- }else if(isNaN(this.ruleForm.pay.wechat.value.wechat_auto_pay_limit) || this.ruleForm.pay.wechat.value.wechat_auto_pay_limit < 0){
- this.$message.error('请输入正确的微信自动打款单笔上限'); return
- }
- let InitDataPara = {}
- // 对象深拷贝
- InitDataPara = JSON.parse(JSON.stringify(this.ruleForm));
- InitDataPara.area.area_limit.value = area_limit;
- this.btnLoading = true;
- this.$request({
- params: {
- r: 'mall/setting/edit',
- },
- method: 'post',
- data: {
- setting: InitDataPara,
- },
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- });
- },
- createPayCredentials() {
- this.btnLoading = true;
- this.$request({
- params: {
- r: 'mall/setting/create-pay-credentials',
- },
- method: 'post',
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- });
- },
- createPlatformCertificateFile() {
- this.btnLoading = true;
- this.$request({
- params: {
- r: 'mall/setting/create-platform-certificate-file',
- },
- method: 'get',
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- });
- },
- //地图确定事件
- mapEvent(e) {
- let self = this;
- self.ruleForm.basic.latitude_longitude.value = e.lat + ',' + e.long;
- self.ruleForm.basic.longitude.value = e.long;
- self.ruleForm.basic.latitude.value = e.lat;
- self.ruleForm.basic.quick_map_address.value = e.address;
- },
- selectLinkUrl(e) {
- let self = this;
- e.forEach(function (item, index) {
- self.ruleForm.link_url = item.new_link_url;
- self.ruleForm.link = item;
- })
- },
- picUrl(e) {
- if (e.length) {
- this.ruleForm.copyright.pic_url.value = e[0].url;
- this.$refs.ruleForm.validateField('pic_url');
- }
- },
- imgCase(img) {
- this.dialogVisible = true;
- this.imgCaseImg = img;
- },
- showGoodsDialog(index) {
- this.goodsDialog.visible = true;
- this.goodsDialog.index = index;
- },
- getGoods() {
- let self = this;
- self.goodsDialog.loading = true;
- request({
- params: {
- r: 'mall/goods/recommend-goods',
- page: self.goodsDialog.page,
- keyword: self.keyword,
- type:this.goodsDialog.index,
- },
- method: 'get',
- }).then(e => {
- self.goodsDialog.loading = false;
- self.goodsDialog.list = e.data.data.list;
- self.goodsDialog.pagination = e.data.data.pagination;
- }).catch(e => {
- console.log(e);
- });
- },
- addGoods() {
- this.goodsDialog.visible = false;
- var msg_goods = "";
- for (let i in this.goodsDialog.selectedList) {
- const item = {
- id: this.goodsDialog.selectedList[i].id,
- goods_name: this.goodsDialog.selectedList[i].goods_name,
- cover_pic: this.goodsDialog.selectedList[i].cover_pic,
- price: this.goodsDialog.selectedList[i].price,
- };
- if (this.ruleForm[this.goodsDialog.index].goods_list.value.length < this.goodsDialog.max) {
- console.log(item)
- console.log(this.ruleForm[this.goodsDialog.index].goods_list.value,8899)
- var is_on = 1;
- for (let j in this.ruleForm[this.goodsDialog.index].goods_list.value){
- if(this.goodsDialog.selectedList[i].id==this.ruleForm[this.goodsDialog.index].goods_list.value[j].id){
- is_on = 2;
- }
- }
- if(is_on==1){
- this.ruleForm[this.goodsDialog.index].goods_list.value.push(item);
- }else{
- msg_goods = msg_goods + (msg_goods?","+this.goodsDialog.selectedList[i].goods_name:this.goodsDialog.selectedList[i].goods_name);
- }
- }
- }
- if(msg_goods){
- this.$message({
- message: "商品 "+msg_goods+" 已经选入",
- type: 'error'
- });
- }
- },
- space() { // 删除地区
- this.ruleForm.area.area_limit.value = [];
- },
- /* 配送范围end */
- toSearch() {
- this.getGoods();
- },
- goodsSelectionChange(e) {
- console.log(e)
- this.goodsDialog.selectedList = e;
- },
- goodsDialogPageChange(page) {
- this.goodsDialog.page = page;
- this.getGoods();
- },
- deleteGoods(goodsIndex, index) {
- this.ruleForm[index].goods_list.value.splice(goodsIndex, 1);
- },
- onInput(){
- this.$forceUpdate();
- },
- uploadPem(key) {
- this.pem_value = key;
- this.$refs[key].value = null;
- this.$refs[key].click();
- },
- /* 配送范围start */
- openDistrict() {
- this.dialogVisible = true;
- this.earaRule = this.ruleForm.area.area_limit.value;
- },
- selectDistrict(e) {
- let list = [];
- for (let i in e) {
- let obj = {
- id: e[i].id,
- name: e[i].name
- };
- list.push(obj);
- }
- this.earaRule = list;
- },
- districtConfirm() {
- this.ruleForm.area.area_limit.value = JSON.parse(JSON.stringify(this.earaRule));
- this.dialogVisible = false;
- // this.$refs['ruleForm'].validate((valid) => {
- // return false;
- // })
- },
- handleChange(e){
- var rawFiles = e.target.files;
- if (rawFiles.length > 1) {
- this.$message.error('最多一次只能上传一个文件。')
- return;
- }
- let file = {
- _complete: false,
- response: null,
- rawFile: rawFiles[0],
- };
- let formData = new FormData();
- const params = {};
- params['r'] = 'mall/file/upload';
- for (let i in this.params) {
- params[i] = this.params[i];
- }
- for (let i in this.fields) {
- formData.append(i, this.fields[i]);
- }
- formData.append('file', file.rawFile, file.rawFile.name);
- this.$request({
- headers: {'Content-Type': 'multipart/form-data'},
- params: params,
- method: 'post',
- data: formData,
- }).then(e => {
- if (e.data.code === 0) {
- console.log(e.data.path);
- this.ruleForm.pay.wechat.value[this.pem_value] = e.data.data.path;
- this.$message.success('上传成功');
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error('上传失败');
- });
- },
- testSend(type) {
- this.updateBtnLoading(type,true);
- let mobile = this.ruleForm.notice_sms.mobile.value;
- if (this.ruleForm.notice_sms.platform.value === 'qcloud') {
- mobile = this.ruleForm.notice_sms.qcloud_mobile.value;
- }
- if (this.ruleForm.notice_sms.platform.value === 'submail') {
- mobile = this.ruleForm.notice_sms.submail_mobile.value;
- }
- this.$request({
- params: {
- r: 'mall/setting/send-sms',
- },
- method: 'post',
- data: {
- type: type,
- platform: this.ruleForm.notice_sms.platform.value,
- mobile: mobile,
- },
- }).then(e => {
- this.updateBtnLoading(type,false);
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.updateBtnLoading(type,false);
- });
- },
- updateBtnLoading(type,is_bool){
- switch (type){
- case 1:
- this.btnLoading1 = is_bool;
- break;
- case 2:
- this.btnLoading2 = is_bool;
- break;
- case 3:
- this.btnLoading3 = is_bool;
- break;
- case 4:
- this.btnLoading4 = is_bool;
- break;
- case 5:
- this.notice_loading = is_bool;
- break;
- }
- },
- getWechatNoticeId(index){
- this.updateBtnLoading(5,true);
- this.$request({
- params: {
- r: 'mall/setting/get-wechat-notice',
- },
- method: 'post',
- data: {
- key: index,
- },
- }).then(e => {
- this.updateBtnLoading(5,false);
- if (e.data.code === 0) {
- this.ruleForm.notice_wechat.template_message.value[index].tempid = e.data.data
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.updateBtnLoading(5,false);
- });
- },
- onChangeLogistics(val) {
- if (val == 2) {
- this.ruleForm.logistics.kdniao_request_type.value = 3
- }
- },
- headleClearData() {
- let params = {
- r: 'mall/data/clean'
- };
- // if (id) params = Object.assign(params, {
- // id: id
- // });
- navigateTo(params, true);
- }
- }
- });
- </script>
|