wenmenghao 1 жил өмнө
parent
commit
a56ddb72e0

+ 25 - 15
apps/mobile/src/store/modules/createOrder.js

@@ -71,7 +71,7 @@ const productNameMap = {
   118: '剑鱼文库会员',
   203: '市场分析定制报告下载包',
   201: '企业中标分析报告下载包',
-  202: '业主采购分析报告下载包',
+  202: '业主采购分析报告下载包'
 }
 
 const Hooks = {
@@ -512,11 +512,12 @@ export default {
       { index, id, extend }
     ) {
       // 请求前-展示默认产品规格选择、活动等信息
-      await dispatch('setProductSpecInfo', {
-        index,
-        id,
-        extend
-      })
+      
+      // await dispatch('setProductSpecInfo', {
+      //   index,
+      //   id,
+      //   extend
+      // })
       // 合并一些请求参数并请求
       await dispatch(
         'getProductOffers',
@@ -626,7 +627,7 @@ export default {
       )
     },
     // 根据商品ID、规格、优惠等参数获取商品订单金额信息
-    async getProductOrderAmount({ commit, getters }, payload) {
+    async getProductOrderAmount({ state, commit, getters }, payload) {
       // 合并一些请求参数
       const params = Object.assign({}, getters.productExtend, payload)
       // 设置加载状态
@@ -646,6 +647,15 @@ export default {
           activity: false,
           amount: false
         })
+        // 获得当前价格后更新商品规格信息
+        let productobj = JSON.parse(JSON.stringify(getters.productSpecInfo))
+        productobj.discountAmount = data?.discountAmount || 0
+        productobj.discountPrice = data?.discountPrice || 0
+        productobj.originalPrice = data?.originalPrice || 0
+        commit(
+          'updateProductSpecInfo',
+          formatProductSpecInfo(productobj, getters.productChoiceOffers)
+        )
       } else {
         if (msg) {
           // 移动端有msg弹窗。由于toast是单例的,msg弹窗会覆盖loading。
@@ -772,14 +782,14 @@ export default {
     },
     // 获取当前商品选中的优惠信息
     productChoiceOffers(state, getters) {
-      return (
-        getters.productAvailableOffersList.find(
-          (offers) => offers?.lotteryId === state.offers.id
-        ) || {
-          activityId: -1,
-          lotteryId: -1
-        }
-      )
+      let choosed = getters.productAvailableOffersList.find(
+        (offers) => offers?.lotteryId === state.offers.id
+      ) || {
+        activityId: -1,
+        lotteryId: -1
+      }
+
+      return choosed
     },
     // 获取商品不可用优惠信息列表
     productUnavailableOffersList(_, getters) {

+ 29 - 5
apps/mobile/src/views/common/vipsubscribeRights.vue

@@ -164,7 +164,12 @@ export default {
     ...mapGetters('user', ['isLogin', 'isFree', 'isMember', 'isSuper']),
     viperbtnText() {
       if (this.isSuper) {
-        return '1'
+        if (this.renew) {
+          // 允许立即续费
+          return '立即续费'
+        } else {
+          return '续费咨询'
+        }
       } else {
         return '立即开通'
       }
@@ -213,7 +218,22 @@ export default {
     callPhone,
     getUserAccountInfoAjax() {
       getUserAccountInfo().then((res) => {
-        console.log(res)
+        let data = res.data
+        if (data.list && data.list.length > 0) {
+          let list = data.list
+          list.forEach((ele) => {
+            if (ele.name === '超级订阅') {
+              this.renew = ele.attr.renew || false
+            }
+            if (ele.name.includes('大会员')) {
+              if (this.$envs.inApp) {
+                this.hjLink = ele.attr.app || ''
+              } else {
+                this.hjLink = ele.attr.h5 || ''
+              }
+            }
+          })
+        }
       })
     },
     cardClick(item) {
@@ -233,13 +253,15 @@ export default {
         }
       } else if (item.title === '大会员商机版2.0') {
         if (this.memberbtnText === '立即开通') {
+          this.$router.push('/order/create/bigmember?meal=sj')
         } else if (this.memberbtnText === '续费咨询') {
-          window.location.href = ''
+          window.location.href = this.hjLink
         }
       } else if (item.title === '大会员专家版2.0') {
         if (this.memberbtnText === '立即开通') {
+          this.$router.push('/order/create/bigmember?meal=zj')
         } else if (this.memberbtnText === '续费咨询') {
-          window.location.href = ''
+          window.location.href = this.hjLink
         }
       }
     },
@@ -285,7 +307,9 @@ export default {
   },
   data() {
     return {
+      hjLink: '',
       tab: 0,
+      renew: false,
       cardlist: [
         {
           title: '超级订阅',
@@ -940,7 +964,7 @@ export default {
         {
           color: 'yellowb',
           title: '业务拓展',
-          head: ['服务项目', '超级订阅', '大会员商机版2.0'],
+          head: ['服务项目', '大会员商机版2.0', '大会员专家版2.0'],
           content: [
             {
               one: '招标/采购进度监控(项目进度监控)',

+ 20 - 6
apps/mobile/src/views/create-order/components/vipsubscribe/ProductionCard.vue

@@ -263,8 +263,11 @@ export default {
           effectTimeAddType = 4
           value = '1年'
         }
-        const perDayPrice = this.calcSpecPerDayPrice(spec, cycleType)
-
+        const perDayPrice = this.calcSpecPerDayPrice(
+          spec,
+          cycleType,
+          spec?._format?.tag
+        )
         return {
           id: spec.productId,
           productionId: spec.productId,
@@ -928,8 +931,19 @@ export default {
         confirmButtonText: '我知道了'
       })
     },
-    calcSpecPerDayPrice(spec, cycleType) {
+    calcSpecPerDayPrice(spec, cycleType, tag) {
       // 只根据当前省份下原价计算单价
+      let zsTime = 0
+      if(tag){
+        if(tag.includes('天')){
+          zsTime =  Number(tag.replace('天','').replace('赠',''))
+
+        }else if(tag.includes('月')){
+          zsTime =  Number(tag.replace('月','').replace('赠','')) * 30
+        }else if(tag.includes('年')){
+          zsTime =  Number(tag.replace('年','').replace('赠','')) * 365
+        }
+      }
       const price =
         spec.originalPrice > spec.discountPrice
           ? spec.discountPrice
@@ -940,19 +954,19 @@ export default {
         // 1个月
         case 1:
         case '月': {
-          perDayPrice = (fen2Yuan(price) / 30).toFixed(2)
+          perDayPrice = (fen2Yuan(price) / (30 + zsTime)).toFixed(2)
           break
         }
         // 1个季度
         case 2:
         case '季': {
-          perDayPrice = (fen2Yuan(price) / (30 * 3)).toFixed(2)
+          perDayPrice = (fen2Yuan(price) / ((30 * 3) + zsTime)).toFixed(2)
           break
         }
         // 1年
         case 3:
         case '年': {
-          perDayPrice = (fen2Yuan(price) / 365).toFixed(2)
+          perDayPrice = (fen2Yuan(price) / (365 + zsTime)).toFixed(2)
           break
         }
       }