index.php 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-attachment');
  4. ComponentHelper::loadComponentView('com-upload');
  5. ComponentHelper::loadComponentView('com-image');
  6. ComponentHelper::loadComponentView('com-qq-map');
  7. ComponentHelper::loadComponentView('com-pick-link');
  8. ComponentHelper::loadComponentView('com-rich-text');
  9. ComponentHelper::loadComponentView('com-district');
  10. ?>
  11. <style>
  12. .form-body {
  13. padding: 20px 0;
  14. background-color: #fff;
  15. margin-bottom: 20px;
  16. }
  17. .form-button {
  18. margin: 0;
  19. }
  20. .form-button .el-form-item__content {
  21. margin-left: 0!important;
  22. }
  23. .button-item {
  24. padding: 9px 25px;
  25. }
  26. .app-share {
  27. padding-top: 12px;
  28. border-top: 1px solid #e2e2e2;
  29. margin-top: -20px;
  30. }
  31. .app-share .app-share-bg {
  32. position: relative;
  33. width: 310px;
  34. height: 360px;
  35. background-repeat: no-repeat;
  36. background-size: contain;
  37. background-position: center
  38. }
  39. .app-share .app-share-bg .title {
  40. width: 160px;
  41. height: 29px;
  42. line-height: 1;
  43. word-break: break-all;
  44. text-overflow: ellipsis;
  45. display: -webkit-box;
  46. -webkit-box-orient: vertical;
  47. -webkit-line-clamp: 2;
  48. overflow: hidden;
  49. }
  50. .app-share .app-share-bg .pic-image {
  51. background-repeat: no-repeat;
  52. background-position: 0 0;
  53. background-size: cover;
  54. width: 160px;
  55. height: 130px;
  56. }
  57. .goods-list {
  58. flex-wrap: wrap;
  59. margin-top: 10px;
  60. /* cursor: move; */
  61. }
  62. .goods-item,
  63. .goods-add {
  64. width: 50px;
  65. height: 50px;
  66. position: relative;
  67. border: 1px solid #e2e2e2;
  68. margin-right: 15px;
  69. margin-bottom: 15px;
  70. }
  71. .goods-add .el-button {
  72. width: 100%;
  73. height: 100%;
  74. border: none;
  75. border-radius: 0;
  76. padding: 0;
  77. }
  78. .goods-delete {
  79. position: absolute;
  80. left: calc(100% - 13px);
  81. top: -13px;
  82. width: 25px;
  83. height: 25px;
  84. line-height: 25px;
  85. padding: 0 0;
  86. visibility: hidden;
  87. z-index: 1;
  88. }
  89. .goods-delete .el-icon-close {
  90. position: absolute;
  91. top: 6px;
  92. left: 6px;
  93. }
  94. .goods-item:hover .goods-delete {
  95. visibility: visible;
  96. }
  97. .goods-pic {
  98. background-size: cover;
  99. background-position: center;
  100. width: 100%;
  101. height: 100%;
  102. background-color: #f6f6f6;
  103. background-repeat: no-repeat;
  104. }
  105. .input-item {
  106. display: inline-block;
  107. width: 250px;
  108. margin: 0;
  109. }
  110. .input-item .el-input__inner {
  111. border-right: 0;
  112. }
  113. .input-item .el-input__inner:hover {
  114. border: 1px solid #dcdfe6;
  115. border-right: 0;
  116. outline: 0;
  117. }
  118. .input-item .el-input__inner:focus {
  119. border: 1px solid #dcdfe6;
  120. border-right: 0;
  121. outline: 0;
  122. }
  123. .input-item .el-input-group__append {
  124. background-color: #fff;
  125. border-left: 0;
  126. width: 10%;
  127. padding: 0;
  128. }
  129. .input-item .el-input-group__append .el-button {
  130. padding: 0;
  131. }
  132. .input-item .el-input-group__append .el-button {
  133. margin: 0;
  134. }
  135. .customize-share-title {
  136. position: relative;
  137. margin-top: 10px;
  138. }
  139. .customize-share-title .del-btn {
  140. position: absolute;
  141. top: -10px;
  142. left: 70px;
  143. }
  144. .title {
  145. padding: 0px 8px;
  146. border-left: 5px solid #1479F0;
  147. background-color: #fff;
  148. font-size: 18px;
  149. position: relative;
  150. left: 32px;
  151. margin: 20px 0;
  152. }
  153. .msg-title {
  154. padding: 18px 20px;
  155. margin-bottom: 18px;
  156. border-bottom: 1px solid #F3F3F3;
  157. line-height: normal;
  158. }
  159. </style>
  160. <div id="app" v-cloak>
  161. <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;">
  162. <div class="form_box">
  163. <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
  164. <el-tabs v-model="activeName" @tab-click="change_tab">
  165. <el-tab-pane label="基础设置" name="basic">
  166. <?=ComponentHelper::loadComponentView('basic/basic', __DIR__ . '/');?>
  167. </el-tab-pane>
  168. <el-tab-pane label="物流设置" name="logistics">
  169. <?=ComponentHelper::loadComponentView('basic/logistics', __DIR__ . '/'); ?>
  170. </el-tab-pane>
  171. <el-tab-pane label="区域设置" name="arealimit">
  172. <?=ComponentHelper::loadComponentView('basic/arealimit', __DIR__ . '/'); ?>
  173. </el-tab-pane>
  174. <el-tab-pane label="客服设置" name="service">
  175. <?=ComponentHelper::loadComponentView('basic/service', __DIR__ . '/'); ?>
  176. </el-tab-pane>
  177. <el-tab-pane label="版权设置" name="copyright">
  178. <?=ComponentHelper::loadComponentView('basic/copyright', __DIR__ . '/'); ?>
  179. </el-tab-pane>
  180. <el-tab-pane label="公众号关注设置" name="follow">
  181. <?=ComponentHelper::loadComponentView('basic/follow', __DIR__ . '/'); ?>
  182. </el-tab-pane>
  183. <el-tab-pane label="支付方式设置" name="pay">
  184. <?=ComponentHelper::loadComponentView('basic/pay', __DIR__ . '/'); ?>
  185. </el-tab-pane>
  186. <el-tab-pane label="消息提醒" name="notice">
  187. <?=ComponentHelper::loadComponentView('basic/notice', __DIR__ . '/'); ?>
  188. </el-tab-pane>
  189. <el-tab-pane label="敏感词过滤" name="sensitivewords">
  190. <?=ComponentHelper::loadComponentView('basic/sensitivewords', __DIR__ . '/'); ?>
  191. </el-tab-pane>
  192. <el-tab-pane label="短信提醒" name="message">
  193. <?=ComponentHelper::loadComponentView('basic/message', __DIR__ . '/'); ?>
  194. </el-tab-pane>
  195. <el-tab-pane label="详情设置" name="goodsdetail">
  196. <?=ComponentHelper::loadComponentView('basic/goodsdetail', __DIR__ . '/'); ?>
  197. </el-tab-pane>
  198. </el-tabs>
  199. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="submit" size="small">保存
  200. </el-button>
  201. </el-form>
  202. </div>
  203. </el-card>
  204. </div>
  205. <script src="<?= Yii::$app->request->baseUrl ?>/resources/unpkg/vuedraggable@2.18.1/dist/vuedraggable.umd.min.js"></script>
  206. <script>
  207. const app = new Vue({
  208. el: '#app',
  209. data() {
  210. return {
  211. multiple: Boolean,
  212. loading: false,
  213. btnLoading: false,
  214. btnLoading1: false,
  215. btnLoading2: false,
  216. btnLoading3: false,
  217. btnLoading4: false,
  218. params: {},
  219. areaLimitStatus:false,
  220. refundStatus:false,
  221. tabPosition:'left',
  222. earaRule: [],
  223. tabUser:'left',
  224. tabNotice:'left',
  225. activeName: 'basic',
  226. aliyunActive: 'domestic',
  227. submailActive: 'domestic',
  228. smsSystem: {
  229. 'platform': {
  230. 'aliyun': '阿里云',
  231. 'qcloud': '腾讯云',
  232. 'submail': '赛邮云',
  233. },
  234. 'qcloudActive': 'domestic',
  235. },
  236. dialogVisible: false,
  237. imgCaseImg: '',
  238. mall_sign: '',
  239. app_style: [],
  240. ruleForm: {
  241. // 基础设置
  242. basic: {
  243. name:{title:'商城名称',value:'',remark: ''},
  244. contact_tel:{title:'联系号码',value:'',remark: ''},
  245. web_url:{title:'网站url',value:'',remark: ''},
  246. logo:{title:'商城logo',value:'',remark: '建议尺寸:100 * 100',extra_type:'imgCase',extra:'/resources/img/mall/app-share-name.png'},
  247. quick_map_address:{title:'详细地址',value:'',remark: '请输入详细地址'},
  248. latitude_longitude:{title:'经纬度',value:'',remark: '请输入经纬度,用英文逗号分离'},
  249. latitude:{title:'纬度',value:'',remark: ''},
  250. longitude:{title:'经度',value:'',remark: ''},
  251. app_share_title:{title:'自定义分享标题',value:'',remark: '',extra_type:'imgCase',extra:'/resources/img/mall/app-share-name.png'},
  252. app_share_desc:{title:'自定义分享描述',value:'',remark: '',extra_type:'imgCase',extra:'/resources/img/mall/app-share-pic.png'},
  253. app_share_pic:{title:'自定义分享图片',value:'',remark: '分享给好友时,作为分享图片,建议尺寸420 * 336',extra_type:'imgCase',extra:'/resources/img/mall/app-share-pic.png'},
  254. is_address_goods_search:{title:'是否显示商品区域筛选',value:0,remark: '开启以后前端商品搜索框可进行区域筛选产品'},
  255. is_enable_dollars_symbol:{title:'是否开启自定义金钱符号',value:0,remark: '开启时前端所有带“¥”的符号显示变更为自定义名称'},
  256. dollars_symbol:{title:'',value:'',remark: '可不填,设置参数为空时,前端显示空白。则不需要金钱符号'},
  257. is_system_in_maintenance:{title:'是否禁止接口访问',value: 0,remark: '开启后所有的接口访问都会返回“商城维护中”的提示,目的是禁止商城访问'},
  258. is_write_name:{title:'登录时是否填写昵称',value: 0,remark: 'h5注册时,按钮关闭,自动给用户命名“游客001”、“游客002”...;按钮开启,强制用户填写昵称'},
  259. },
  260. // 快递
  261. logistics: {
  262. request_type: {title:'快递类型',value:1,remark: ''},
  263. kdniao_request_type:{title:'快递鸟请求类型',value:1,remark: ''},
  264. kdniao_mch_id:{title:'快递鸟商户ID',value:'',remark: '快递鸟商户ID用于查询快递物流轨迹信息'},
  265. kdniao_api_key:{title:'快递鸟API KEY',value:'',remark: ''},
  266. jd_mch_code:{title:'京东商家编码',value:'',remark: '若您使用京东物流,则需填写"京东商家编码",否则将会造成物流信息无法查询'},
  267. update:{title:'物流更新',value:8,remark: 'N小时才可更新一次物流,0则表示不做任何限制刷新即更新'},
  268. aliyun_app_id:{title:'App ID',value:'',remark: ''},
  269. aliyun_app_key:{title:'App Key',value:'',remark: ''},
  270. aliyun_app_secret:{title:'App Secret',value:'',remark: ''},
  271. },
  272. service: {
  273. web_service_url:{title:'外链客服链接',value:'',remark: ''},
  274. web_service_applets:{title:'客服小程序链接',value:'',remark: ''},
  275. alipay_mini_service_enable:{title:'支付宝小程序客服',value:'0',remark: ''},
  276. alipay_mini_service_inst_id:{title:'企业编码',value:'',remark: '对应 https://csmng.cloud.alipay.com/ccm.htm#/fc-setting/all?ddtab=true -> 服务窗配置 -> 部署 租户ID'},
  277. alipay_mini_service_scene:{title:'聊天窗编码',value:'',remark: '对应 https://csmng.cloud.alipay.com/ccm.htm#/fc-setting/all?ddtab=true -> 服务窗配置 -> 部署 聊天窗ID'},
  278. hide_service_entry:{title:'隐藏客服入口',value:'0',remark: '如果打开当前开关那么商品详情页面左下角客服入口将被隐藏'},
  279. },
  280. copyright: {
  281. status:{title:'版权开关',value:'0',remark: ''},
  282. description:{title:'底部版权文字',value:'',remark: ''},
  283. usage_agreement:{title:'软件许可使用协议', value:'', remark: ''},
  284. certificates:{title:'证照信息', value:[], remark: ''},
  285. pic_url:{title:'版权图标',value:'',remark: '建议尺寸160*50'},
  286. link_url:{title:'版权链接',value:'https://www.qijianshigw.com',remark: ''},
  287. link_logo:{title:'版权LOGO',value:'https://shuzixiangdao.oss-cn-guangzhou.aliyuncs.com/images/2021/12/13/image_1639389765_m4a9raM4.png',remark: ''},
  288. link_text:{title:'版权文字',value:'七件事提供技术支持',remark: ''},
  289. },
  290. follow: {
  291. is_subscribe:{title:'公众号关注',value:'0',remark: ''},
  292. subscribe_type:{title:'关注公众号引导',value:'',remark: ''},
  293. subscribe_link:{title:'链接引导',value:'',remark: ''},
  294. subscribe_qrcode:{title:'二维码引导',value:'',remark: '将作为公众号关注引导二维码,建议尺寸:100 * 100'},
  295. },
  296. pay: {
  297. balance:{
  298. title:'余额设置',
  299. value:{
  300. status:'0',
  301. pay_password_status:'0',
  302. // balance_charge_status:'0'
  303. is_enable_group:'0',
  304. },
  305. remark:''
  306. },
  307. score:{
  308. title:'积分设置',
  309. value:{
  310. status:'0',
  311. pay_password_status:'0',
  312. is_enable_group:'0',
  313. },
  314. remark:''
  315. },
  316. wechat:{
  317. title:'微信设置',
  318. value:{
  319. status:'0',
  320. // wechat_app_id:'',
  321. wechat_open_app_id:'',
  322. wechat_mch_id:'',
  323. wechat_pay_secret:'',
  324. wechat_pay_secret_v3:'',
  325. wechat_cert_pem:'',
  326. wechat_cert_pem_file:'',
  327. wechat_key_pem:'',
  328. wechat_key_pem_file:'',
  329. wechat_transfer:2,
  330. wechat_serial: '',
  331. wechat_pay_public_key_id: '',
  332. wechat_transfer_version:1,
  333. wechat_auto_pay_limit:200,
  334. },
  335. remark:''
  336. },
  337. alipay:{
  338. title:'支付宝设置',
  339. value:{
  340. status:'0',
  341. alipay_app_id:'',
  342. alipay_private_key:'',
  343. alipay_public_key:'',
  344. },
  345. remark:''
  346. },
  347. mixed:{
  348. title:'组合支付设置',
  349. value:{
  350. status:'0',
  351. },
  352. remark:''
  353. },
  354. },
  355. notice_wechat:{
  356. is_logging: {title:"开启消息模板推送",value:'0',remark:''},
  357. is_miniapp_priority: {title:"是否跳转链接小程序优先",value:'0',remark:''},
  358. is_open: {title:"是否记录数据库日志",value:'0',remark:''},
  359. template_message: {},
  360. },
  361. notice_sms:{
  362. status: {title:"状态",value:'0',remark:''},
  363. platform: {title:"平台",value:'aliyun',remark:''},
  364. access_key_id: {title:"access_key_id",value:'',remark:''},
  365. access_key_secret: {title:"access_key_secret",value:'',remark:''},
  366. template_name: {title:"模板签名",value:'',remark:''},
  367. register_template_id: {title:"模板ID",value:'',remark:''},
  368. register_template_variable: {title:"模板签名",value:'',remark:''},
  369. order_template_id: {title:"模板ID",value:'',remark:''},
  370. order_template_variable: {title:"模板签名",value:'',remark:''},
  371. sale_template_id: {title:"模板ID",value:'',remark:''},
  372. sale_template_variable: {title:"模板签名",value:'',remark:''},
  373. captcha_template_id: {title:"模板ID",value:'',remark:''},
  374. captcha_template_variable: {title:"模板签名",value:'',remark:''},
  375. user_level_expired_template_id: {title:"模板ID",value:'',remark:''},
  376. user_level_expired_template_variable: {title:"模板签名",value:'',remark:''},
  377. int_access_key_id: {title:"access_key_id",value:'',remark:''},
  378. int_access_key_secret: {title:"access_key_secret",value:'',remark:''},
  379. int_template_name: {title:"模板签名",value:'',remark:''},
  380. int_register_template_id: {title:"模板ID",value:'',remark:''},
  381. int_register_template_variable: {title:"模板签名",value:'',remark:''},
  382. int_order_template_id: {title:"模板ID",value:'',remark:''},
  383. int_order_template_variable: {title:"模板签名",value:'',remark:''},
  384. int_sale_template_id: {title:"模板ID",value:'',remark:''},
  385. int_sale_template_variable: {title:"模板签名",value:'',remark:''},
  386. int_captcha_template_id: {title:"模板ID",value:'',remark:''},
  387. int_captcha_template_variable: {title:"模板签名",value:'',remark:''},
  388. int_user_level_expired_template_id: {title:"模板ID",value:'',remark:''},
  389. int_user_level_expired_template_variable: {title:"模板签名",value:'',remark:''},
  390. mobile: {title:"手机号",value:'',remark:''},
  391. mobile_limit_num: {title:"短信手机号限制",value:'3',remark:''},
  392. ip_limit_num: {title:"短信IP限制",value:'10',remark:''},
  393. // 腾讯云短信
  394. qcloud_sdk_app_id: {title:"sdk_app_id", value:'', remark:''}, // 腾讯云SDK AppID
  395. qcloud_app_key: {title:"app_key", value:'', remark:''}, // 腾讯云SDK AppID
  396. qcloud_secret_id: {title:"secret_id", value:'', remark:''}, // 腾讯云SecretId
  397. qcloud_secret_key: {title:"secret_key", value:'', remark:''}, // 腾讯云SecretKey
  398. qcloud_mobile: {title:"mobile", value:'', remark:''}, // 手机号
  399. qcloud_domestic_sign_name: {title:"sign_name", value:'', remark:''}, // 国内短信签名
  400. qcloud_international_sign_name: {title:"sign_name", value:'', remark:''}, // 国际短信签名
  401. // 腾讯云短信国内信息
  402. domestic_register_template_id: {title:"register_template_id", value:'', remark:''}, // 注册模板ID
  403. domestic_register_template_sign: {title:"register_template_sign", value:'', remark:''}, // 注册模板签名
  404. domestic_order_template_id: {title:"order_template_id", value:'', remark:''}, // 订单支付模板ID
  405. domestic_order_template_sign: {title:"order_template_sign", value:'', remark:''}, // 订单支付模板签名
  406. domestic_sale_template_id: {title:"sale_template_id", value:'', remark:''}, // 订单售后模板ID
  407. domestic_sale_template_sign: {title:"sale_template_sign", value:'', remark:''}, // 订单售后模板签名
  408. domestic_captcha_template_id: {title:"captcha_template_id", value:'', remark:''}, // 验证码模板ID
  409. domestic_captcha_template_sign: {title:"captcha_template_sign", value:'', remark:''}, // 验证码模板签名
  410. domestic_user_level_expired_template_id: {title:"user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
  411. domestic_user_level_expired_template_sign: {title:"user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
  412. // 腾讯云短信国际信息
  413. international_register_template_id: {title:"register_template_id", value:'', remark:''}, // 注册模板ID
  414. international_register_template_sign: {title:"register_template_sign", value:'', remark:''}, // 注册模板签名
  415. international_order_template_id: {title:"order_template_id", value:'', remark:''}, // 订单支付模板ID
  416. international_order_template_sign: {title:"order_template_sign", value:'', remark:''}, // 订单支付模板签名
  417. international_sale_template_id: {title:"sale_template_id", value:'', remark:''}, // 订单售后模板ID
  418. international_sale_template_sign: {title:"sale_template_sign", value:'', remark:''}, // 订单售后模板签名
  419. international_captcha_template_id: {title:"captcha_template_id", value:'', remark:''}, // 验证码模板ID
  420. international_captcha_template_sign: {title:"captcha_template_sign", value:'', remark:''}, // 验证码模板签名
  421. international_user_level_expired_template_id: {title:"user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
  422. international_user_level_expired_template_sign: {title:"user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
  423. //赛邮云短信配置
  424. submail_app_id:{title: 'submail_app_id', value:'', remark:'',},//appId
  425. submail_app_key:{title: 'submail_app_key', value:'', remark:'',},//appKey
  426. submail_mobile:{title: 'submail_mobile', value:'', remark:'',},//测试手机号
  427. submail_domestic_register_template_id: {title:"submail_domestic_register_template_id", value:'', remark:''}, // 注册模板ID
  428. submail_domestic_register_template_sign: {title:"submail_domestic_register_template_sign", value:'', remark:''}, // 注册模板签名
  429. submail_domestic_order_template_id: {title:"submail_domestic_order_template_id", value:'', remark:''}, // 订单支付模板ID
  430. submail_domestic_order_template_sign: {title:"submail_domestic_order_template_sign", value:'', remark:''}, // 订单支付模板签名
  431. submail_domestic_sale_template_id: {title:"submail_domestic_sale_template_id", value:'', remark:''}, // 订单售后模板ID
  432. submail_domestic_sale_template_sign: {title:"submail_domestic_sale_template_sign", value:'', remark:''}, // 订单售后模板签名
  433. submail_domestic_captcha_template_id: {title:"submail_domestic_captcha_template_id", value:'', remark:''}, // 验证码模板ID
  434. submail_domestic_captcha_template_sign: {title:"submail_domestic_captcha_template_sign", value:'', remark:''}, // 验证码模板签名
  435. submail_domestic_user_level_expired_template_id: {title:"submail_domestic_user_level_expired_template_id", value:'', remark:''}, // 用户等级过期模板ID
  436. submail_domestic_user_level_expired_template_sign: {title:"submail_domestic_user_level_expired_template_sign", value:'', remark:''}, // 用户等级过期模板签名
  437. },
  438. notice_alipay: {
  439. order_created: {title:"未付款订单",value:'0',remark:''},
  440. order_pay: {title:"待发货订单",value:'0',remark:''},
  441. order_ship: {title:"待收货订单",value:'0',remark:''},
  442. order_receive: {title:"已收货订单",value:'0',remark:''},
  443. order_complete: {title:"已完成订单",value:'0',remark:''},
  444. order_close: {title:"已关闭订单",value:'0',remark:''},
  445. order_refund_created:{title:"等待商家处理",value:'0',remark:''},
  446. order_refund_agree:{title:"已同意退货申请,等待买家处理",value:'0',remark:''},
  447. order_refund_buyer:{title:"买家已退货",value:'0',remark:''},
  448. order_refund_ship:{title:"已重新发货",value:'0',remark:''},
  449. order_refund_buyer_reject:{title:"买家拒绝售后申请",value:'0',remark:''},
  450. order_refund_seller_reject:{title:"商家拒绝售后申请",value:'0',remark:''},
  451. order_refund_complete:{title:"退款完成",value:'0',remark:''},
  452. },
  453. //商品详情页推荐设置
  454. goods:{
  455. is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
  456. goods_list:{title:"商品列表",value:[],remark:""},
  457. },
  458. area:{
  459. is_area_limit:{title:'配送范围限制',value:'0',remark: ''},
  460. area_limit:{title:'允许购买区域',value:[],remark: ''},
  461. is_area_limit_town:{title:'启用乡镇级别限制',value:'0',remark: ''},
  462. },
  463. //订单完成后推荐设置
  464. order_pay:{
  465. is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
  466. goods_list:{title:"商品列表",value:[],remark:""},
  467. },
  468. upgrade: {
  469. Distribution:{title:'经销商升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  470. Agent:{title:'渠道分红升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  471. Boss:{title:'股东升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  472. BossAchievement:{title:'股东业绩升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  473. ServeBonus:{title:'服务商升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  474. Achievement:{title:'业绩奖励升级设置',value:{'is_open':0,'upgrade_status':'1'},remark: ''},
  475. },
  476. //评论后推荐设置
  477. order_comment:{
  478. is_recommend_status:{title:"推荐商品状态",value:0,remark:""},
  479. goods_list:{title:"商品列表",value:[],remark:""},
  480. },
  481. //打印机
  482. printer: {
  483. printer: {name: "七件事打印机"}
  484. },
  485. //敏感词
  486. sensitive:{
  487. api_key:{title:"敏感词api_key",value:'',remark:""},
  488. secret_key:{title:"敏感词secret_key",value:'',remark:""},
  489. },
  490. goodsdetail: {
  491. home_text:{title:"首页文字自定义",value:'',remark:""},
  492. }
  493. },
  494. goodsDialog: {
  495. visible: false,
  496. page: 1,
  497. loading: null,
  498. pagination: null,
  499. list: [],
  500. index: 'goods',
  501. selectedList: null,
  502. max: 20,//添加商品最大数量
  503. },
  504. keyword: '',
  505. pem_value: '',
  506. mall_id: <?= $mall_id ?>,
  507. notice_loading: false,
  508. is_install_logistics: <?= $is_install_logistics ?>,
  509. }
  510. },
  511. mounted: function() {
  512. let tab_name= getQuery('tab_name');
  513. if(tab_name)
  514. {
  515. this.activeName =tab_name
  516. }
  517. this.loadData();
  518. },
  519. methods: {
  520. change_tab() {
  521. if(this.activeName == 'areaLimit') this.areaLimitStatus = true;
  522. if(this.activeName == 'refund') this.refundStatus = true;
  523. // if (this.activeName == 'printer') this.show = false;
  524. },
  525. certificatesPic(e) { // 证件照
  526. if (e.length) {
  527. // 设置为只需要10张。当用户超过10张时,去除后面超出数据
  528. let length = this.ruleForm.copyright.certificates.value.length;
  529. e = e.slice(0, 10 - length);
  530. if (this.ruleForm.copyright.certificates.value.length >= 10) return;
  531. e.forEach((item, index) => {
  532. this.ruleForm.copyright.certificates.value.push({
  533. id: item.id,
  534. pic_url: item.url
  535. });
  536. })
  537. }
  538. },
  539. delPic(type, index) { // 删除图片
  540. switch (type) {
  541. case 'bannar_pic':
  542. this.ruleForm.copyright.certificates.value.splice(index, 1)
  543. break;
  544. default:
  545. break;
  546. }
  547. },
  548. loadData() {
  549. if(this.loading === true) return;
  550. this.loading = true;
  551. request({
  552. params: {
  553. r: 'mall/setting/edit',
  554. type: 'mall_basic'
  555. },
  556. method: 'get'
  557. }).then(e => {
  558. this.loading = false;
  559. if (e.data.code == 0) {
  560. if(e.data.data) {//有选中的
  561. let data = e.data.data
  562. this.mall_sign = data.mall_sign;
  563. Object.keys(this.ruleForm).forEach((key) => {
  564. Object.keys(this.ruleForm[key]).forEach((k) => {
  565. if (!isEmpty(data[key][k])) {
  566. var dataValue = data[key][k].value;
  567. if(data[key][k].value!==null&&data[key][k].value!==""){
  568. if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
  569. // 将json字符串转为对象
  570. this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
  571. }else{
  572. this.ruleForm[key][k].value = data[key][k].value;
  573. }
  574. }
  575. }
  576. });
  577. });
  578. this.ruleForm.basic.web_url.value = data.web_url;
  579. }
  580. }
  581. }).catch(e => {
  582. this.loading = false;
  583. })
  584. },
  585. submit() {
  586. // 解决php提交变量的限制
  587. let area_limit = '';
  588. if(this.ruleForm.area.area_limit.value.length > 0){
  589. area_limit = JSON.stringify(this.ruleForm.area.area_limit.value)
  590. }
  591. if(this.ruleForm.pay.wechat.value.wechat_auto_pay_limit === undefined){
  592. this.ruleForm.pay.wechat.value.wechat_auto_pay_limit = 200;
  593. }else if(isNaN(this.ruleForm.pay.wechat.value.wechat_auto_pay_limit) || this.ruleForm.pay.wechat.value.wechat_auto_pay_limit < 0){
  594. this.$message.error('请输入正确的微信自动打款单笔上限'); return
  595. }
  596. let InitDataPara = {}
  597. // 对象深拷贝
  598. InitDataPara = JSON.parse(JSON.stringify(this.ruleForm));
  599. InitDataPara.area.area_limit.value = area_limit;
  600. this.btnLoading = true;
  601. this.$request({
  602. params: {
  603. r: 'mall/setting/edit',
  604. },
  605. method: 'post',
  606. data: {
  607. setting: InitDataPara,
  608. },
  609. }).then(e => {
  610. this.btnLoading = false;
  611. if (e.data.code === 0) {
  612. this.$message.success(e.data.msg);
  613. } else {
  614. this.$message.error(e.data.msg);
  615. }
  616. }).catch(e => {
  617. this.btnLoading = false;
  618. });
  619. },
  620. createPayCredentials() {
  621. this.btnLoading = true;
  622. this.$request({
  623. params: {
  624. r: 'mall/setting/create-pay-credentials',
  625. },
  626. method: 'post',
  627. }).then(e => {
  628. this.btnLoading = false;
  629. if (e.data.code === 0) {
  630. this.$message.success(e.data.msg);
  631. } else {
  632. this.$message.error(e.data.msg);
  633. }
  634. }).catch(e => {
  635. this.btnLoading = false;
  636. });
  637. },
  638. createPlatformCertificateFile() {
  639. this.btnLoading = true;
  640. this.$request({
  641. params: {
  642. r: 'mall/setting/create-platform-certificate-file',
  643. },
  644. method: 'get',
  645. }).then(e => {
  646. this.btnLoading = false;
  647. if (e.data.code === 0) {
  648. this.$message.success(e.data.msg);
  649. } else {
  650. this.$message.error(e.data.msg);
  651. }
  652. }).catch(e => {
  653. this.btnLoading = false;
  654. });
  655. },
  656. //地图确定事件
  657. mapEvent(e) {
  658. let self = this;
  659. self.ruleForm.basic.latitude_longitude.value = e.lat + ',' + e.long;
  660. self.ruleForm.basic.longitude.value = e.long;
  661. self.ruleForm.basic.latitude.value = e.lat;
  662. self.ruleForm.basic.quick_map_address.value = e.address;
  663. },
  664. selectLinkUrl(e) {
  665. let self = this;
  666. e.forEach(function (item, index) {
  667. self.ruleForm.link_url = item.new_link_url;
  668. self.ruleForm.link = item;
  669. })
  670. },
  671. picUrl(e) {
  672. if (e.length) {
  673. this.ruleForm.copyright.pic_url.value = e[0].url;
  674. this.$refs.ruleForm.validateField('pic_url');
  675. }
  676. },
  677. imgCase(img) {
  678. this.dialogVisible = true;
  679. this.imgCaseImg = img;
  680. },
  681. showGoodsDialog(index) {
  682. this.goodsDialog.visible = true;
  683. this.goodsDialog.index = index;
  684. },
  685. getGoods() {
  686. let self = this;
  687. self.goodsDialog.loading = true;
  688. request({
  689. params: {
  690. r: 'mall/goods/recommend-goods',
  691. page: self.goodsDialog.page,
  692. keyword: self.keyword,
  693. type:this.goodsDialog.index,
  694. },
  695. method: 'get',
  696. }).then(e => {
  697. self.goodsDialog.loading = false;
  698. self.goodsDialog.list = e.data.data.list;
  699. self.goodsDialog.pagination = e.data.data.pagination;
  700. }).catch(e => {
  701. console.log(e);
  702. });
  703. },
  704. addGoods() {
  705. this.goodsDialog.visible = false;
  706. var msg_goods = "";
  707. for (let i in this.goodsDialog.selectedList) {
  708. const item = {
  709. id: this.goodsDialog.selectedList[i].id,
  710. goods_name: this.goodsDialog.selectedList[i].goods_name,
  711. cover_pic: this.goodsDialog.selectedList[i].cover_pic,
  712. price: this.goodsDialog.selectedList[i].price,
  713. };
  714. if (this.ruleForm[this.goodsDialog.index].goods_list.value.length < this.goodsDialog.max) {
  715. console.log(item)
  716. console.log(this.ruleForm[this.goodsDialog.index].goods_list.value,8899)
  717. var is_on = 1;
  718. for (let j in this.ruleForm[this.goodsDialog.index].goods_list.value){
  719. if(this.goodsDialog.selectedList[i].id==this.ruleForm[this.goodsDialog.index].goods_list.value[j].id){
  720. is_on = 2;
  721. }
  722. }
  723. if(is_on==1){
  724. this.ruleForm[this.goodsDialog.index].goods_list.value.push(item);
  725. }else{
  726. msg_goods = msg_goods + (msg_goods?","+this.goodsDialog.selectedList[i].goods_name:this.goodsDialog.selectedList[i].goods_name);
  727. }
  728. }
  729. }
  730. if(msg_goods){
  731. this.$message({
  732. message: "商品 "+msg_goods+" 已经选入",
  733. type: 'error'
  734. });
  735. }
  736. },
  737. space() { // 删除地区
  738. this.ruleForm.area.area_limit.value = [];
  739. },
  740. /* 配送范围end */
  741. toSearch() {
  742. this.getGoods();
  743. },
  744. goodsSelectionChange(e) {
  745. console.log(e)
  746. this.goodsDialog.selectedList = e;
  747. },
  748. goodsDialogPageChange(page) {
  749. this.goodsDialog.page = page;
  750. this.getGoods();
  751. },
  752. deleteGoods(goodsIndex, index) {
  753. this.ruleForm[index].goods_list.value.splice(goodsIndex, 1);
  754. },
  755. onInput(){
  756. this.$forceUpdate();
  757. },
  758. uploadPem(key) {
  759. this.pem_value = key;
  760. this.$refs[key].value = null;
  761. this.$refs[key].click();
  762. },
  763. /* 配送范围start */
  764. openDistrict() {
  765. this.dialogVisible = true;
  766. this.earaRule = this.ruleForm.area.area_limit.value;
  767. },
  768. selectDistrict(e) {
  769. let list = [];
  770. for (let i in e) {
  771. let obj = {
  772. id: e[i].id,
  773. name: e[i].name
  774. };
  775. list.push(obj);
  776. }
  777. this.earaRule = list;
  778. },
  779. districtConfirm() {
  780. this.ruleForm.area.area_limit.value = JSON.parse(JSON.stringify(this.earaRule));
  781. this.dialogVisible = false;
  782. // this.$refs['ruleForm'].validate((valid) => {
  783. // return false;
  784. // })
  785. },
  786. handleChange(e){
  787. var rawFiles = e.target.files;
  788. if (rawFiles.length > 1) {
  789. this.$message.error('最多一次只能上传一个文件。')
  790. return;
  791. }
  792. let file = {
  793. _complete: false,
  794. response: null,
  795. rawFile: rawFiles[0],
  796. };
  797. let formData = new FormData();
  798. const params = {};
  799. params['r'] = 'mall/file/upload';
  800. for (let i in this.params) {
  801. params[i] = this.params[i];
  802. }
  803. for (let i in this.fields) {
  804. formData.append(i, this.fields[i]);
  805. }
  806. formData.append('file', file.rawFile, file.rawFile.name);
  807. this.$request({
  808. headers: {'Content-Type': 'multipart/form-data'},
  809. params: params,
  810. method: 'post',
  811. data: formData,
  812. }).then(e => {
  813. if (e.data.code === 0) {
  814. console.log(e.data.path);
  815. this.ruleForm.pay.wechat.value[this.pem_value] = e.data.data.path;
  816. this.$message.success('上传成功');
  817. } else {
  818. this.$message.error(e.data.msg);
  819. }
  820. }).catch(e => {
  821. this.$message.error('上传失败');
  822. });
  823. },
  824. testSend(type) {
  825. this.updateBtnLoading(type,true);
  826. let mobile = this.ruleForm.notice_sms.mobile.value;
  827. if (this.ruleForm.notice_sms.platform.value === 'qcloud') {
  828. mobile = this.ruleForm.notice_sms.qcloud_mobile.value;
  829. }
  830. if (this.ruleForm.notice_sms.platform.value === 'submail') {
  831. mobile = this.ruleForm.notice_sms.submail_mobile.value;
  832. }
  833. this.$request({
  834. params: {
  835. r: 'mall/setting/send-sms',
  836. },
  837. method: 'post',
  838. data: {
  839. type: type,
  840. platform: this.ruleForm.notice_sms.platform.value,
  841. mobile: mobile,
  842. },
  843. }).then(e => {
  844. this.updateBtnLoading(type,false);
  845. if (e.data.code === 0) {
  846. this.$message.success(e.data.msg);
  847. } else {
  848. this.$message.error(e.data.msg);
  849. }
  850. }).catch(e => {
  851. this.updateBtnLoading(type,false);
  852. });
  853. },
  854. updateBtnLoading(type,is_bool){
  855. switch (type){
  856. case 1:
  857. this.btnLoading1 = is_bool;
  858. break;
  859. case 2:
  860. this.btnLoading2 = is_bool;
  861. break;
  862. case 3:
  863. this.btnLoading3 = is_bool;
  864. break;
  865. case 4:
  866. this.btnLoading4 = is_bool;
  867. break;
  868. case 5:
  869. this.notice_loading = is_bool;
  870. break;
  871. }
  872. },
  873. getWechatNoticeId(index){
  874. this.updateBtnLoading(5,true);
  875. this.$request({
  876. params: {
  877. r: 'mall/setting/get-wechat-notice',
  878. },
  879. method: 'post',
  880. data: {
  881. key: index,
  882. },
  883. }).then(e => {
  884. this.updateBtnLoading(5,false);
  885. if (e.data.code === 0) {
  886. this.ruleForm.notice_wechat.template_message.value[index].tempid = e.data.data
  887. this.$message.success(e.data.msg);
  888. } else {
  889. this.$message.error(e.data.msg);
  890. }
  891. }).catch(e => {
  892. this.updateBtnLoading(5,false);
  893. });
  894. },
  895. onChangeLogistics(val) {
  896. if (val == 2) {
  897. this.ruleForm.logistics.kdniao_request_type.value = 3
  898. }
  899. },
  900. headleClearData() {
  901. let params = {
  902. r: 'mall/data/clean'
  903. };
  904. // if (id) params = Object.assign(params, {
  905. // id: id
  906. // });
  907. navigateTo(params, true);
  908. }
  909. }
  910. });
  911. </script>