Переглянути джерело

渠道号测试修改添加应用时下载链接与应用标记的通配符关联

朱鑫波 3 роки тому
батько
коміт
0dbb13ed0c

+ 25 - 7
src/views/modules/autoLaunch/channelManage/components/creatApplication.vue

@@ -208,7 +208,12 @@ export default {
     methods: {
         getChangeAll(type, form, field) {
             var node = document.getElementById(field)
-            var v = '-{{' + type + '}}-'
+            var v = ''
+            if (field == 'url') {
+                v = '{{' + type + '}}'
+            }else{
+                v = '-{{' + type + '}}-'
+            }
             if (document.selection) {
                 //IE
                 node.focus()
@@ -473,13 +478,26 @@ export default {
                     if (this.fileUrl) {
                         this.confirmLoading = true
                         let params = {}
+                        var reg = RegExp(/{{渠道号}}/)
+                        if(reg.test(values.url)&&reg.test(values.appVersion)){
+                            this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+                            params = { ...values }
+                            params.appIconUrl = this.fileUrl
+                            this.confirmLoading = false
+                            this.$emit('getDataList', params)
+                            this.handleCancel()
+                        }else if(!reg.test(values.url)&&!reg.test(values.appVersion)){
+                            this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+                            params = { ...values }
+                            params.appIconUrl = this.fileUrl
+                            this.confirmLoading = false
+                            this.$emit('getDataList', params)
+                            this.handleCancel()
+                        }else{
+                            this.confirmLoading = false
+                            this.$message.error('下载链接必须和应用标记的通配符保持一致')
+                        }
 
-                        this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
-                        params = { ...values }
-                        params.appIconUrl = this.fileUrl
-                        this.confirmLoading = false
-                        this.$emit('getDataList', params)
-                        this.handleCancel()
                         // postAction(this.url.insertTemplateUrl, params).then(res => {
                         //     this.confirmLoading = false
                         //     if (res.success) {

+ 7 - 1
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -735,7 +735,13 @@ export default {
         },
         getChangeAll(type, form, field) {
             var node = document.getElementById(field)
-            var v = '-{{' + type + '}}-'
+            var v = ''
+            if (field == 'channelName'||field == 'channelCode') {
+                v = '-{{' + type + '}}-'
+            }else{
+                v = '{{' + type + '}}'
+            }
+            
             if (document.selection) {
                 //IE
                 node.focus()

+ 21 - 14
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -2268,24 +2268,31 @@ export default {
             if(checked){
                 if(!!this.accountId){
                     if(!!this.getFormData('appId')){
-                        var params = {}
-                        params.appIdArray = this.getFormData('appId') instanceof Array?this.getFormData('appId').map(item=>{return item.key}):[this.getFormData('appId').key]
-                        params.accountId = this.accountId
-                        postAction('/channel/queryChannelLevel', params).then(res=>{
-                            console.log(res)
-                            if(res.code === 200) {
-                                if(res.result){
-                                    this.channelData = res.result
+                        var paramsData = {}
+                        paramsData.appIdArray = this.getFormData('appId') instanceof Array?this.getFormData('appId').map(item=>{return item.key}):[this.getFormData('appId').key]
+                        postAction('/kuaishou/kuaiShouAppList/getAppNames',paramsData).then(result=>{
+                            var params = {}
+                            params.appNameArray = result.result.map(item=>{
+                                return item.appName
+                            })
+                            params.accountId = this.accountId
+                            postAction('/channel/queryChannelLevel', params).then(res=>{
+                                console.log(res)
+                                if(res.code === 200) {
+                                    if(res.result){
+                                        this.channelData = res.result
+                                    }else{
+                                        this.useChannel = false
+                                        this.$message.error(res.message) 
+                                    }
+                                    
                                 }else{
                                     this.useChannel = false
-                                    this.$message.error(res.message) 
+                                    this.$message.error('该账户不能使用渠道号')
                                 }
-                                
-                            }else{
-                                this.useChannel = false
-                                this.$message.error('该账户不能使用渠道号')
-                            }
+                            })
                         })
+                       
                     }else{
                         this.useChannel = false
                         this.$message.error('未选择应用不可开启')