Преглед изворни кода

会员后台:用户主页链接修改

zweizhao пре 7 година
родитељ
комит
688a33cda1

+ 6 - 1
src/module/main/components/vip_manager.vue

@@ -57,6 +57,9 @@ const tableProps = [
   "status_name",
 ]
 
+// 现在环境是线上还是测试, 默认线上
+let env = ''
+
 export default {
   data() {
     return {
@@ -101,7 +104,8 @@ export default {
      * 点击 uid
      */
     clickUID({uid}) {
-      window.open(`https://www.proginn.com/rooter/user/${uid}`)
+      if(env === 'test') window.open(`https://dev.test.proginn.com/rooter/user/${uid}`)
+      else window.open(`https://www.proginn.com/rooter/user/${uid}`)
     },
     // 页码变动
     changePagination() {
@@ -127,6 +131,7 @@ export default {
       const res = await this.$post("/api/admin/vip/getVips", { page: this.currentPage, page_size: 10 })
       // console.log(res)
       const data = res.data;
+      env = data.current_env
       const list = data.list;
       this.listData = data;
       this.tableData = list; // this.formatTableData(list, data);

+ 13 - 2
src/module/main/components/wage_settlement.vue

@@ -3,7 +3,7 @@
     <h3>工资结算</h3>
     <h4>
-      <a :href="'/rooter/cloudjobdetail/'+detail.job_id">{{detail.job.title_count}}</a>
+      <a :href="orderHref">{{detail.job.title_count}}</a>
       】{{detail.time.month}}工资账单
     </h4>
     <section class="container">
@@ -93,6 +93,9 @@
 </template>
 
 <script>
+// 现在环境是线上还是测试, 默认线上
+let env = ''
+
 export default {
   data() {
     return {
@@ -186,7 +189,14 @@ export default {
       let isPayable = this.payable ? (1 + rate.company_tax_rate / 100) : 1
       let companyPrice = (((salary.normal_salary - 0) + (salary.probation_salary - 0)) * work_hour.work_rate / 100 - Number(salary.deduction_fee)) * (1 + rate.company_service_fee_rate / 100) * isPayable
       return this.keepDecimal(companyPrice)
-    }
+    },
+    orderHref() {
+      let detail = this.detail
+        , hrefFix = `/rooter/cloudjobdetail/${detail.job_id}`
+      if(env === 'test') hrefFix = `https://dev.test.proginn.com${hrefFix}`
+      else hrefFix = `https://www.proginn.com${hrefFix}`
+      return hrefFix
+    },
   },
   filters: {
     /**
@@ -254,6 +264,7 @@ export default {
       })
       if(!res.data) return
       let data = res.data
+      env = data.current_env
       this.detail = data
       this.payable = data.is_invoice === '1'
       this.is_use_deposit = data.can_use_deposit === '1'