瀏覽代碼

计算器-首页消息滚动

panyong 3 年之前
父節點
當前提交
5ed1c6a6ec

+ 1 - 1
htmldev/loan/src/api/request.js

@@ -18,7 +18,7 @@ request.interceptors.request.use(request => {
   // Do something before request is sent
   request.url = requestUrl + (requestUrl.indexOf('?') > -1 ? '&' : '?') + 'next=' + encodeURIComponent(location.href)
   // 因为微信开发者工具重复授权,本地开发时写死
-  if (/^(0|192|localhost)|(test$)/.test(domain)) {
+  if (/^(0|192|10|localhost)|(test$)/.test(domain)) {
     request.url += '&owner_open_id=o0wUBtDVDAvu3z1GRu58kv4_9DnI'
   }
   return request

+ 23 - 1
htmldev/loan/src/views/loan/calculator/index.vue

@@ -344,6 +344,28 @@ export default {
   },
   activated () {
     if (!this.$route.meta.isUseCache) {
+      this.loanTypeIndx = 0
+      this.gjjjine = ''
+      this.gjjnianxianIndex = 19
+      this.gjjlilvIndex = 0
+      this.sdjine = ''
+      this.sdlilvIndex = 0
+      this.hkfangshiIndex = 0
+      this.meiyuehuanchuan = ''
+      this.zonglixi = ''
+      this.showPicker0 = false
+      this.columns0 = loanConfig.loanType
+      this.defaultIndex0 = 0
+      this.showPicker1 = false
+      this.columns1 = loanConfig.loanYear
+      this.defaultIndex1 = 19
+      this.showPicker2 = false
+      this.defaultIndex2 = 0
+      this.showPicker4 = false
+      this.defaultIndex4 = 0
+      this.showPicker5 = false
+      this.columns5 = loanConfig.payType
+      this.defaultIndex5 = 0
     }
     this.$route.meta.isUseCache = false
   },
@@ -498,7 +520,7 @@ export default {
     this.Compressor = null
   },
   beforeRouteLeave (to, from, next) {
-    if (['agreement'].findIndex(item => item === to.name) > -1) {
+    if (['loanIndex', 'loanMine', 'loanRecommend'].findIndex(item => item === to.name) > -1) {
       this.$route.meta.isUseCache = true
     }
     next()

+ 0 - 1
htmldev/loan/src/views/loan/explain/index.vue

@@ -148,7 +148,6 @@ export default {
           shareHref += `?recommendedUser=${encodeURIComponent(JSON.stringify(this.userShareConfig))}`
         }
         funWxShare('驼驼银服', '家里用钱,就找驼驼银服,省心,省力,妥妥的!', shareHref, location.protocol + '//api.tuotuoyinfu.com/img/logo.jpg')
-        console.log(shareHref)
         this.$nextTick(() => {
           this.createQRCode(shareHref)
         })

+ 1 - 1
htmldev/loan/src/views/loan/index/child/banner.vue

@@ -35,7 +35,7 @@ export default {
     return {
       ttyfSWOptions: {
         loop: true,
-        autoplay: this.arrBanner.length > 1,
+        autoplay: true,
         pagination: {
           el: '.sw-pagination',
           clickable: true

+ 1 - 4
htmldev/loan/src/views/loan/index/child/notice.vue

@@ -37,10 +37,7 @@ export default {
         loop: true,
         speed: 2000,
         height: 44,
-        autoplay: {
-          delay: 2000,
-          disableOnInteraction: false
-        }
+        autoplay: true
       }
     }
   },

+ 17 - 2
htmldev/loan/src/views/loan/index/index.vue

@@ -33,6 +33,7 @@ export default {
     return {
       arrBanner: [],
       noticeArr: [],
+      noticeArrBridge: [], // 因为vue-router的keep-alive,swiper垂直滚动失效,缓存数据
       arrProducttype: [0, 1], // 产品类型: 0明星产品1推荐产品
       starProduct: [], // 明星产品
       recommendedProduct: [] // 推荐贷款
@@ -40,11 +41,22 @@ export default {
   },
   activated () {
     if (!this.$route.meta.isUseCache) {
+      this.arrBanner = []
+      this.noticeArr = []
+      this.noticeArrBridge = []
+      this.arrProducttype = [0, 1]
+      this.starProduct = []
+      this.recommendedProduct = []
       this.fetchBanner()
       this.fetchNotice()
       this.arrProducttype.forEach(item => {
         this.fetchProduct(item)
       })
+    } else {
+      this.noticeArr = []
+      this.$nextTick(() => {
+        this.noticeArr = JSON.parse(JSON.stringify(this.noticeArrBridge))
+      })
     }
     this.$route.meta.isUseCache = false
   },
@@ -68,7 +80,10 @@ export default {
     fetchNotice () {
       getNotice().then(res => {
         if (res.status) {
-          this.noticeArr = res.data
+          if (Object.prototype.toString.call(res.data) === '[object Array]') {
+            this.noticeArr = res.data
+            this.noticeArrBridge = JSON.parse(JSON.stringify(res.data))
+          }
         } else {
           Toast(res.msg)
         }
@@ -98,7 +113,7 @@ export default {
     }
   },
   beforeRouteLeave (to, from, next) {
-    if (['loanPrivacy', 'loanAgreement'].includes(to.name)) {
+    if (['loanMedia', 'loanExplain', 'loanCalculator', 'loanMine'].includes(to.name)) {
       from.meta.isUseCache = true
     }
     next()