Browse Source

bug修复

喻文俊 3 năm trước cách đây
mục cha
commit
ea1b0ae8fb

+ 3 - 2
components/cm-module/cm-goods-nav/cm-goods-nav.vue

@@ -103,7 +103,8 @@ export default {
             return this.productInfo.collageProduct || {}
         },
         maxCount(){
-            if(this.collageProduct.unlimitedFlag === 1){
+            // unlimitedFlag  0 限购  1 不限购
+            if(this.collageProduct.unlimitedFlag === 0){
                 return this.collageProduct.limitedNum
             }else{
                 return this.productInfo.stock
@@ -118,7 +119,7 @@ export default {
             deep: true,
             handler: function(nVal) {
                 console.log(nVal)
-                this.navType = this.productInfo.collageStatus === 1 ? 2 : 1
+                this.navType = this.productInfo.collageStatus === 1 && (this.collageProduct.limitedNum > 0) ? 2 : 1
                 this.resetButtonInfo()
             }
         },

+ 1 - 1
mixins/shareEntry.js

@@ -31,7 +31,7 @@ const shareEntry = {
                     ...JSON.parse(decrypt)
                 }
                 // 保存分享者的用户id
-                this.setInviteUserId(this.shareData.inviteUserId)
+                this.shareData.inviteUserId && this.setInviteUserId(this.shareData.inviteUserId)
                 this.jumpTopSharePage()
             } catch (e) {
                 console.log(e)

+ 6 - 1
pages/fight-order/fight-detail.vue

@@ -82,6 +82,9 @@ export default {
         this.collageId = options.collageId
         this.fetchOrderDetails()
     },
+    onShow() {
+      !isRequest && this.countDown()  
+    },
     onShareAppMessage(e) {
         const shareData = {
             type: 4,
@@ -136,7 +139,9 @@ export default {
         countDown() {
             const diffTime = new Date(this.collageData.endTime).getTime()
             const loadTime = new Date().getTime()
-
+            
+            this.timer && clearTimeout(this.timer)
+            
             this.$util.countDown(diffTime, loadTime, {}, item => {
                 this.countDownTime = item.conttainer
                 this.timer = item.t

+ 10 - 2
pages/fight-order/fight-share-entry.vue

@@ -62,7 +62,7 @@ import CountdownBox from './components/countdown-box.vue'
 import CmOrderProdcut from '@/components/cm-module/cm-order-prodcut/cm-order-prodcut.vue'
 import CmNumberBox from '@/components/cm-module/cm-number-box/cm-number-box.vue'
 import CmDrawer from '@/components/cm-module/cm-drawer/cm-drawer.vue'
-import { mapGetters } from 'vuex'
+import { mapGetters, mapActions } from 'vuex'
 export default {
     components: {
         UserList,
@@ -124,11 +124,17 @@ export default {
     onLoad(options) {
         this.collageId = options.collageId
         this.initiatorId = options.initiatorId
-        setTimeout(() => {
+        // 用户登录 获取拼团信息
+        // await this.wechatlogin()
+        setTimeout(()=>{
             this.fetchOrderDetails()
         }, 2000)
     },
+    onShow() {
+      !this.isRequest && this.countDown()  
+    },
     methods: {
+        ...mapActions('user', ['wechatlogin']),
         handleClick(type) {
             if (!this.hasLogin) {
                 // 保存当前页面链接参数
@@ -171,6 +177,8 @@ export default {
             const diffTime = new Date(this.collageData.endTime).getTime()
             const loadTime = new Date().getTime()
 
+            this.timer && clearTimeout(this.timer)
+
             this.$util.countDown(diffTime, loadTime, {}, item => {
                 this.countDownTime = item.conttainer
                 this.timer = item.t

+ 1 - 1
pages/goods/cart.vue

@@ -55,7 +55,7 @@
                         <view class="row">
                             <text>总价:</text> <text class="total-price">
                                 <text>¥{{ allPrice | formatPrice }}</text>
-                                <text class="delete">¥9999.99</text>
+                                <text class="delete" v-if="allPrice > finallyPrice">¥{{ allPrice | formatPrice }}</text>
                             </text>
                         </view>
                         <!-- TODO -->

+ 5 - 12
pages/login/login.vue

@@ -52,6 +52,7 @@
 import authorize from '@/common/authorize.js'
 import CmLoading from '@/components/cm-module/cm-loading/cm-loading.vue'
 import { mapGetters, mapActions } from 'vuex'
+import { switchTabTo } from '@/common/utilsTools.js'
 export default {
     components: {
         CmLoading
@@ -77,8 +78,7 @@ export default {
             hasProfile: false,
         }
     },
-    onLoad() { 
-        this.redirectUrl = uni.getStorageInfoSync('login_redirect_url') || ''
+    onLoad() {
         if (this.hasLogin) return this.$api.switchTabTo('/pages/tabBar/index/index')
     },
     created() {
@@ -117,6 +117,7 @@ export default {
             this.params.openId = uni.getStorageSync('openId')
             // 直接登录  /  授权再登录
             this.hasProfile ? this.LoginGetUser() : this.ProfileAndLogin()
+            // this.ProfileAndLogin()
         },
         // 获取用户信息
         GetUserProfile() {
@@ -151,18 +152,10 @@ export default {
                 this.isLogin = true
                 await this.customLogin(this.params)
                 this.isLogin = false
-                
-                if(redirectUrl){
-                    setTimeout(() => {
-                        switchTabTo(redirectUrl)
-                    }, 1500)
-                }else{
-                    setTimeout(() => {
-                        switchTabTo('/pages/tabBar/index/index')
-                    }, 1500)
-                }
+                this.hasProfile = false
             } catch (e) {
                 this.isLogin = false
+                this.hasProfile = false
             }
         },
         //获取手机验证码

+ 2 - 2
pages/tabBar/cart/index.vue

@@ -48,8 +48,8 @@
                         <view class="row">
                             <text>总价:</text> 
                             <text class="total-price">
-                                <text>¥{{ allPrice | formatPrice }}</text>
-                                <text class="delete">¥9999.99</text>
+                                <text>¥{{ finallyPrice | formatPrice }}</text>
+                                <text class="delete" v-if="allPrice > finallyPrice">¥{{ allPrice | formatPrice }}</text>
                             </text>
                         </view>
                         <!-- TODO -->

+ 2 - 2
services/config.env.js

@@ -3,9 +3,9 @@ if (process.env.NODE_ENV === 'development') {
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.75:8011'	 //采美测试地址
     // URL_CONFIG = 'http://192.168.2.67:8011'	 //裴裴联调地址
-    URL_CONFIG = 'http://192.168.2.68:8011'	 //涛涛联调地址
+    // URL_CONFIG = 'http://192.168.2.68:8011'	 //涛涛联调地址
     // URL_CONFIG = 'http://127.0.0.1:8011'	 //本地联调地址
-    // URL_CONFIG = 'https://mall2c-b.caimei365.com'
+    URL_CONFIG = 'https://mall2c-b.caimei365.com'
     // URL_CONFIG = 'https://mall2c.caimei365.com'
 } else {
     // 生产环境

+ 12 - 5
store/modules/user.js

@@ -33,7 +33,7 @@ const mutations = {
         userInfo && uni.setStorageSync('openId', userInfo.openId)
     },
     // 设置邀请用户id
-    setInviteUserId(state, id){
+    setInviteUserId(state, id) {
         state.inviteUserId = parseInt(id)
     }
 }
@@ -42,7 +42,7 @@ const actions = {
     async wechatlogin({ commit, dispatch, state }) {
         // 获取code
         const code = await authorize.getCode('weixin')
-        userService.UserWechatAuthorLogin({ code })
+        return userService.UserWechatAuthorLogin({ code })
             .then(response => {
                 console.log('登录成功')
                 commit('LOGIN', response.data)
@@ -58,6 +58,7 @@ const actions = {
     },
     // 手机号注册登录
     customLogin({ commit, state, dispatch }, params) {
+        const redirectUrl = uni.getStorageSync('login_redirect_url') || ''
         params.shareUserId = state.inviteUserId
         return userService.UserMobileLogin(params)
             .then(response => {
@@ -68,9 +69,15 @@ const actions = {
                 dispatch('coupon/initReceiveCouponCount', null, { root: true }) // 获取已领取优惠券数量
                 // 登录成功提示
                 showMsg('登录成功', 1500, false, 'success')
-                // setTimeout(() => {
-                //     switchTabTo('/pages/tabBar/index/index')
-                // }, 1500)
+                if (redirectUrl) {
+                    setTimeout(() => {
+                        uni.redirectTo({ url: redirectUrl })
+                    }, 1500)
+                } else {
+                    setTimeout(() => {
+                        switchTabTo('/pages/tabBar/index/index')
+                    }, 1500)
+                }
             })
             .catch(error => {
                 showMsg(error.msg, 2000)