twt 1 year ago
parent
commit
360f6da109
4 changed files with 53 additions and 3 deletions
  1. 1 1
      .env.staging
  2. 4 0
      src/main.js
  3. 44 0
      src/utils/common.js
  4. 4 2
      src/views/home/index.vue

+ 1 - 1
.env.staging

@@ -4,7 +4,7 @@ NODE_ENV = production
 ENV = 'staging'
 
 # base api
-VUE_APP_BASE_API = 'http://58.56.15.138:20189/'
+VUE_APP_BASE_API = 'http://api.dms.66km.com.cn/'
 VUE_APP_APP_ID = '3c660160-fbcd-4a18-bb06-bb2e04839c25'
 
 

+ 4 - 0
src/main.js

@@ -8,6 +8,10 @@ import 'vant/lib/index.css'
 import './styles/index.scss'
 import './importComponents'
 import GL_Components from '@/components/globalComponents'
+
+import common from '@/utils/common.js'
+Vue.prototype.$common =common
+//http://112.124.69.194:8092/  app-link
 Vue.use(GL_Components)
 
 Vue.config.productionTip = false

+ 44 - 0
src/utils/common.js

@@ -0,0 +1,44 @@
+
+// 防止处理多次点击
+function noMultipleClicks(methods, info) {
+    // methods是点击后需要执行的函数, info是函数需要传的参数
+    let that = this;
+    if (that.noClick) {
+        // 第一次点击
+        that.noClick= false;
+        if((info && info !== '') || info ==0) {
+            // info是执行函数需要传的参数
+            methods(info);
+        } else {
+            methods();
+        }
+        setTimeout(()=> {
+            that.noClick= true;
+        }, 3000)
+    } else {
+        //  这里是重复点击的判断
+    }
+}
+
+
+const getHashQuery = function(query) {
+	//console.log(location.hash)
+	if (location.hash.indexOf(query) > -1) {
+	  const cur = location.hash.slice(location.hash.indexOf(query) + query.length + 1, location.hash.length)
+	  if (cur.indexOf('&') > -1) {
+	    return cur.slice(0, cur.indexOf('&'))
+	  } else {
+	    return cur
+	  }
+	} else {
+	  return false
+	}
+}
+
+export default {
+	noMultipleClicks,      // 禁止多次点击
+	getHashQuery,
+}
+
+
+

+ 4 - 2
src/views/home/index.vue

@@ -132,7 +132,8 @@ export default {
       this.showArea=false;
     },
     donext(){
-
+      //console.log(this.$common.getHashQuery('shopType'))
+      var shopType=this.$common.getHashQuery('shopType')
       this.$refs.form.validate().then(() => {
          if(!this.businessLicense){
            this.$toast.fail('请上传营业执照')
@@ -148,6 +149,7 @@ export default {
              cityName:this.cityName,
              areaName:this.areaName,
              businessLicense:this.businessLicense,
+             shopType:shopType
            }
 
            if(!this.go){
@@ -161,7 +163,7 @@ export default {
            this.go=false;
           // console.log("55")
            var that=this;
-         
+
             addSuperShopApplication(params).then(res => {
                 this.$toast.clear()
                 setTimeout(function() {