tremble 6 年之前
父节点
当前提交
53c98a032e

+ 1 - 1
src/App.vue

@@ -112,7 +112,7 @@ export default {
     }
   },
   mounted () {
-    // this.$store.dispatch('checkToken')
+    this.$store.dispatch('checkToken')
     let reZoom = () => {
       if (!this.isPad) {
         let zoom = Math.round(devicePixelRatio * 100)

+ 2 - 0
src/components/card/index.vue

@@ -57,6 +57,8 @@ export default {
   // 方法集合
   methods: {
     goto (url) {
+      // let temp = url.replace('//pro', '//test')
+      // window.open(temp.replace('//www', '//test'), '_blank')
       window.open(url.replace('http://', 'https://'), '_blank')
     }
   },

+ 1 - 1
src/components/toast/capacityRecharge.vue

@@ -199,7 +199,7 @@ export default {
       }
 
       let res = await this.$http
-        .post('user/order/expansionOrder', params, {
+        .post('/user/order/expansionOrder', params, {
           headers: {
             token: this.token
           }

+ 108 - 45
src/components/toast/editInvoice.vue

@@ -10,57 +10,61 @@
         <i class="iconfont icon-cuowu" @click="handleClick"></i>
       </div>
       <div class="invoice-con">
+        <div class="input-con open-edu">
+          <input type="text" v-model="edu" placeholder="请输入开金额">
+          <span>可开票额度:{{edititem.max}}元</span>
+        </div>
         <div class="invoice edit-invoice">
-        <div class="select-con">
-          <div :class="{'tag-active':cInvoice==='normal'}" @click="cInvoice='normal'">
-            <span>增值税普通发票</span>
-            <img src="@/assets/images/tag-icon.png" alt>
+          <div class="select-con">
+            <div :class="{'tag-active':cInvoice==='normal'}" @click="cInvoice='normal'">
+              <span>增值税普通发票</span>
+              <img src="@/assets/images/tag-icon.png" alt />
+            </div>
+            <div :class="{'tag-active':cInvoice==='zengzhi'}" @click="cInvoice='zengzhi'">
+              <span>增值税专用发票</span>
+              <i></i>
+              <img src="@/assets/images/tag-icon.png" alt />
+            </div>
           </div>
-          <div :class="{'tag-active':cInvoice==='zengzhi'}" @click="cInvoice='zengzhi'">
-            <span>增值税专用发票</span>
-            <i></i>
-            <img src="@/assets/images/tag-icon.png" alt>
+          <div v-if="cInvoice==='normal'">
+            <div class="input-con">
+              <input type="text" placeholder="请输入发票抬头" v-model="normal.title" />
+              <input type="text" placeholder="请输入税务登记号(个人用户可不填)" v-model="normal.code" />
+            </div>
           </div>
-        </div>
-        <div v-if="cInvoice==='normal'">
-          <div class="input-con">
-            <input type="text" placeholder="请输入发票抬头" v-model="invoice3.title">
-            <input type="text" placeholder="请输入税务登记号(个人用户可不填)" v-model="invoice3.code">
+          <div v-else>
+            <div class="input-con">
+              <input type="text" v-model="zengzhi.title" placeholder="请输入发票抬头" />
+              <input type="text" v-model="zengzhi.code" placeholder="请输入税务登记号(个人用户可不填)" />
+            </div>
+            <div class="input-con">
+              <input type="text" v-model="zengzhi.organizedAddress" placeholder="注册地址" />
+              <input type="text" v-model="zengzhi.registerPhone" placeholder="注册电话" />
+            </div>
+            <div class="input-con">
+              <input type="text" v-model="zengzhi.bankName" placeholder="开户银行" />
+              <input type="text" v-model="zengzhi.bankAccount" placeholder="银行账户" />
+            </div>
           </div>
         </div>
-        <div v-else>
+        <div class="address edit-address">
           <div class="input-con">
-            <input type="text" v-model="invoice3.title" placeholder="请输入发票抬头">
-            <input type="text" v-model="invoice3.code" placeholder="请输入税务登记号(个人用户可不填)">
+            <input type="text" v-model="editAdd.shipName" :placeholder="'姓名'" />
+            <input type="text" v-model="editAdd.shipMobile" :placeholder="'电话'" />
           </div>
           <div class="input-con">
-            <input type="text" v-model="invoice3.organizedAddress" placeholder="注册地址">
-            <input type="text" v-model="invoice3.registerPhone" placeholder="注册电话">
+            <citySelect :areaPath="editAdd.shipAreaPath" @currentVal="getCurrentSelect" />
           </div>
-          <div class="input-con">
-            <input type="text" v-model="invoice3.bankName" placeholder="开户银行">
-            <input type="text" v-model="invoice3.bankAccount" placeholder="银行账户">
+          <div class="input-con address-input">
+            <input
+              type="text"
+              v-model="editAdd.shipAddress"
+              :placeholder="'详细地址'"
+            />
           </div>
+          <div class="btn parmary" @click="saveInvoice">提交</div>
         </div>
       </div>
-      <div class="address edit-address">
-        <div class="input-con">
-          <input type="text" v-model="editAdd.shipName" :placeholder="address.shipName||'姓名'">
-          <input type="text" v-model="editAdd.shipMobile" :placeholder="address.shipMobile||'电话'">
-        </div>
-        <div class="input-con">
-          <citySelect :areaPath="editAdd.shipAreaPath" @currentVal="getCurrentSelect"/>
-        </div>
-        <div class="input-con address-input">
-          <input
-            type="text"
-            v-model="editAdd.shipAddress"
-            :placeholder="editAdd.shipAddress||'详细地址'"
-          >
-        </div>
-        <div class="btn parmary" @click="saveInvoice">保存</div>
-      </div>
-      </div>
     </div>
   </div>
 </template>
@@ -75,26 +79,85 @@ export default {
   },
   data () {
     return {
+      edu: '',
       cInvoice: 'normal',
-      invoice3: {},
+      normal: {},
+      zengzhi: {},
       editAdd: {},
       address: {},
-      tempSelect: ''
+      tempSelect: '',
+      language: localStorage.getItem('language'),
+      token: localStorage.getItem('token')
     }
   },
-  watch: {
-
-  },
+  watch: {},
   methods: {
     handleClick () {
       this.$emit('closePoint')
     },
-    saveInvoice () {
 
+    async saveInvoice () {
+      let params = {}
+      let invoiceType = ''
+      if (this.cInvoice === 'normal') {
+        invoiceType = 2
+        let {title = '', code = ''} = this.normal
+        params = {
+          invoiceType,
+          title,
+          code
+        }
+      } else {
+        let {title = '', code = '', organizedAddress = '', registerPhone = '', bankName = '', bankAccount = ''} = this.zengzhi
+        invoiceType = 3
+        params = {
+          invoiceType,
+          title,
+          code,
+          organizedAddress,
+          registerPhone,
+          bankName,
+          bankAccount
+        }
+      }
+      this.editAdd.shipAreaPath = this.tempSelect.join(',')
+      this.editAdd.amount = Number(this.edu)
+      this.editAdd.cameraId = this.edititem.cameraId
+
+      let temp = Object.keys(this.editAdd)
+      temp.forEach(item => {
+        params[item] = this.editAdd[item] || ''
+      })
+      let arr = Object.keys(params)
+      for (let i = 0; i < arr.length; i++) {
+        let condition = (arr[i] === 'invoiceType' && params[arr[i]] === 2)
+        if (!params[arr[i]] && (arr[i] !== 'code' && condition)) {
+          return this.$toast.show('warn', '信息填写不能为空')
+        }
+      }
+
+      let res = await this.$http
+        .post('/user/invoice/add', params, {
+          headers: {
+            token: this.token
+          }
+        })
+      let response = res.data
+
+      if (response.code === 0) {
+        this.$toast.show('success', '开票成功', () => {
+          this.visible = false
+        })
+      } else {
+        return this.$toast.show('warn', '信息填写不能为空', () => {
+          this.visible = false
+        })
+      }
     },
     getCurrentSelect (data) {
       this.tempSelect = data
     }
+
   }
 }
 </script>

+ 5 - 1
src/components/toast/index.vue

@@ -3,6 +3,7 @@
     <pointRecharge :pointid='pointid' :pointitem='pointitem' :pointchildName='pointchildName' :visible='ponintVisible' @closePoint="()=>{ponintVisible = false}"/>
     <capacityRecharge :capacityid='capacityid' :capacityitem='capacityitem' :capacitychildName='capacitychildName' :visible='capacityvisible' @closePoint="()=>{capacityvisible = false}"/>
     <editInvoice :edititem=editItem :visible='editVisible' @closePoint="()=>{editVisible = false}"/>
+    <showInvoice :showitem=showItem :visible='showVisible' @closePoint="()=>{showVisible = false}"/>
     <binding :btype="bindingType" :visible='bindingVisible' @closePoint="()=>{bindingVisible = false}"/>
     <div
       class="toast-layout"
@@ -53,6 +54,7 @@
 import pointRecharge from './pointRecharge'
 import capacityRecharge from './capacityRecharge'
 import editInvoice from './editInvoice'
+import showInvoice from './showInvoice'
 import binding from './binding'
 import { mapState } from 'vuex'
 
@@ -62,7 +64,7 @@ let types = {
   success: '成功'
 }
 export default {
-  components: {pointRecharge, binding, capacityRecharge, editInvoice},
+  components: {pointRecharge, binding, capacityRecharge, editInvoice, showInvoice},
   data () {
     return {
       visible: false,
@@ -70,8 +72,10 @@ export default {
       capacityvisible: false,
       ponintVisible: false,
       editVisible: false,
+      showVisible: false,
       bindingVisible: false,
       editItem: '',
+      showItem: '',
       capacityid: '',
       capacityitem: '',
       capacitychildName: '',

+ 1 - 1
src/components/toast/pointRecharge.vue

@@ -214,7 +214,7 @@ export default {
       }
 
       let res = await this.$http
-        .post('user/order/rechargeOrder', params, {
+        .post('/user/order/rechargeOrder', params, {
           headers: {
             token: this.token
           }

+ 57 - 0
src/components/toast/showInvoice.vue

@@ -0,0 +1,57 @@
+<template>
+  <div
+    class="toast-layout"
+    :style="{background:false?'none':'rgba(0, 0, 0, 0.3)'}"
+    :class="{'toast-active':visible}"
+  >
+    <div class="toast-con recharge-con" :style="{minWidth:'680px'}">
+      <div class="t-header">
+        <span>详细信息</span>
+        <i class="iconfont icon-cuowu" @click="handleClick"></i>
+      </div>
+      <div class="show-invoice">
+        <div class="invoice-p">
+          <p>发票信息</p>
+          <p>发票抬头:{{showitem.title||'暂无'}}</p>
+          <p>税号:{{showitem.code||'暂无'}}</p>
+          <p>注册地址:{{showitem.organizedAddress||'暂无'}}</p>
+          <p>电话号码:{{showitem.registerPhone||'暂无'}}</p>
+          <p>开户银行:{{showitem.bankName||'暂无'}}</p>
+          <p>银行账号:{{showitem.bankAccount||'暂无'}}</p>
+        </div>
+        <div class="address-p">
+          <p>收货地址</p>
+          <p>联系人:{{showitem.shipName||'暂无'}}</p>
+          <p>联系电话:{{showitem.shipMobile||'暂无'}}</p>
+          <p>收件地址:{{showitem.shipAreaPath}}{{showitem.shipAddress||'暂无'}}</p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import citySelect from '@/components/citySelect'
+
+export default {
+  props: ['visible', 'showitem'],
+  components: {
+    citySelect
+  },
+  data () {
+    return {
+
+    }
+  },
+  watch: {},
+  methods: {
+    handleClick () {
+      this.$emit('closePoint')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import "./style.scss";
+</style>

+ 26 - 0
src/components/toast/style.scss

@@ -319,6 +319,7 @@ $border-color: #e7e7e7;
           border: solid 1px $theme-color;
         }
       }
+      
       .btn {
         text-align: center;
         cursor: pointer;
@@ -376,6 +377,31 @@ $border-color: #e7e7e7;
           }
         }
       }
+      .open-edu{
+        margin-bottom: 10px;
+        span{
+          font-size: 14px;
+          margin-left: 10px;
+        }
+      }
+    }
+    .show-invoice{
+      background: #fff;
+      padding: 30px;
+      .invoice-p,.address-p{
+        p{
+          font-size: 14px;
+          color: #969696;
+          margin-bottom: 8px;
+          &:first-of-type{
+            margin-bottom: 10px;
+            color: $font-color;
+          }
+        }
+      }
+      .address-p{
+        margin-top: 20px;
+      }
     }
     .edit-address {
       .input-con {

+ 4 - 0
src/components/toast/toast.js

@@ -60,6 +60,10 @@ Toast.install = function (Vue) {
       instance.editVisible = true
       instance.editItem = item
     },
+    showInvoiceDetail: item => {
+      instance.showVisible = true
+      instance.showItem = item
+    },
     hideLoading: () => {
       instance.isLoaing = false
     },

+ 10 - 1
src/page/introduce/index.vue

@@ -28,7 +28,7 @@
             <p>重复开通商业会员,不会重复获取限期容量</p>
             <div>
               <span><i>166</i>元/月</span>
-              <span>立即开通</span>
+              <span @click="open">立即开通</span>
             </div>
           </div>
         </div>
@@ -130,6 +130,15 @@ export default {
     buy (item) {
       this.$toast.showCapacityRecharge(item, this.detail.childName, this.detail.id)
     },
+    open () {
+      this.$router.push({
+        name: 'payrecharge',
+        params: {
+          cameraId: this.detail.id,
+          childName: this.detail.childName
+        }
+      })
+    },
     getPercent (a, b) {
       let temp = a / b
       if (temp < 1) {

+ 14 - 1
src/page/layout/aside/index.vue

@@ -1,7 +1,7 @@
 <template>
 <div class="login-layout">
   <div class="mask" :style="{maxHeight:active?'100%':'0'}"></div>
-  <component :is="login?'cart':'login'" :cp="cp" :active='active'></component>
+  <component :is="login && notEmit ? 'cart' : 'login'" :cp="cp" :active='active'></component>
 </div>
 </template>
 
@@ -21,10 +21,23 @@ export default {
     login,
     cart
   },
+  data () {
+    return {
+      notEmit: true
+    }
+  },
   methods: {
     logoutHandle () {
       this.$bus.$emit('hideAside')
     }
+  },
+  mounted () {
+    this.$bus.$on('hasLogin', () => {
+      this.notEmit = false
+      setTimeout(() => {
+        this.notEmit = true
+      }, 700)
+    })
   }
 }
 </script>

+ 1 - 1
src/page/layout/aside/temp/cart.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="cart-con" :style="{maxHeight:active?'100%':'0'}">
-    <component :is="cp.type" :sku="cp.sku" @backList="cp.type='list'" :fromList='cp.fromList' @toPay="handlePay"></component>
+    <component :is="cp.type" :active='active' :sku="cp.sku" @backList="cp.type='list'" :fromList='cp.fromList' @toPay="handlePay"></component>
   </div>
 </template>
 

+ 3 - 0
src/page/layout/aside/temp/ctemp/detail.scss

@@ -97,6 +97,9 @@ input {
         overflow-wrap: break-word;
         line-height: 24px;
       }
+      .no-info {
+        margin-top: 4px;
+      }
       .avatar {
         width: 68px;
         height: 68px;

+ 20 - 9
src/page/layout/aside/temp/ctemp/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="detail-layout">
+    <div class="detail-layout" ref="detaillayout">
       <div class="detail-header">
         <div class="c-title">确认订单</div>
         <i v-if="fromList" @click="backHandle" class="iconfont icon-shang"></i>
@@ -15,15 +15,20 @@
       >
         <div class="address show-address" slot="show">
           <img src="@/assets/images/address-icon.png" alt>
-          <div>
-            <p>{{address.shipName}}</p>
-            <p class="p-desc">{{`${address.shipAreaPath}${address.shipAddress}`}}</p>
-          </div>
+          <template v-if="address.shipName">
+            <div>
+              <p>{{address.shipName}}</p>
+              <p class="p-desc">{{`${address.shipAreaPath}${address.shipAddress}`}}</p>
+            </div>
+          </template>
+          <template v-else>
+            <div class="p-desc no-info">暂无信息</div>
+          </template>
         </div>
         <div class="address edit-address" slot="edit">
           <div class="input-con">
-            <input type="text" v-model="editAdd.shipName" :placeholder="address.shipName||'姓名'">
-            <input type="text" v-model="editAdd.shipMobile" :placeholder="address.shipMobile||'电话'">
+            <input type="text" v-model="editAdd.shipName" :placeholder="'姓名'">
+            <input type="text" v-model="editAdd.shipMobile" :placeholder="'电话'">
           </div>
           <div class="input-con">
             <citySelect :areaPath="editAdd.shipAreaPath" @currentVal="getCurrentSelect"/>
@@ -32,7 +37,7 @@
             <input
               type="text"
               v-model="editAdd.shipAddress"
-              :placeholder="editAdd.shipAddress||'详细地址'"
+              :placeholder="'详细地址'"
             >
           </div>
           <div class="btn parmary" @click="uAddress">保存</div>
@@ -202,7 +207,7 @@ var cloneObj = function (obj) {
   return newObj
 }
 export default {
-  props: ['sku', 'fromList'],
+  props: ['sku', 'fromList', 'active'],
   data () {
     return {
       agree: -1,
@@ -218,6 +223,11 @@ export default {
     edit,
     citySelect
   },
+  watch: {
+    active (newVal) {
+      this.$refs.detaillayout.scroll(0, 0)
+    }
+  },
   computed: {
     ...mapState({
       invoice2: state => {
@@ -391,6 +401,7 @@ export default {
     }
   },
   mounted () {
+    console.log(this.address)
     if (this.address && Object.keys(this.address).length > 0) return
     this.$store.dispatch('getInfo', {
       url: '/user/getReceiverInfo',

+ 5 - 0
src/page/layout/aside/temp/ctemp/list.vue

@@ -63,6 +63,11 @@ export default {
       }
     })
   },
+  watch: {
+    active (newVal) {
+      console.log(newVal)
+    }
+  },
   data () {
     return {
       sum: 0

+ 0 - 1
src/page/layout/aside/temp/login.vue

@@ -63,7 +63,6 @@ export default {
   },
   mounted () {
     this.$bus.$on('currentActive', data => {
-      console.log(data)
       this.tabActive = data || 'ilogin'
     })
   }

+ 4 - 1
src/page/layout/aside/temp/ltemp/login.vue

@@ -90,7 +90,10 @@ export default {
       await this.$store.dispatch('login', params)
       clearInterval(this.t1)
       this.t1 = null
-      if (this.token) this.$bus.$emit('hideAside')
+      if (this.token) {
+        this.$bus.$emit('hideAside')
+        this.$bus.$emit('hasLogin')
+      }
     },
     async getQrCode () {
       let res = await this.$http({

+ 8 - 1
src/page/layout/aside/temp/ltemp/register.vue

@@ -14,6 +14,8 @@
 </template>
 
 <script>
+import { mapState } from 'vuex'
+
 export default {
   data () {
     return {
@@ -27,6 +29,11 @@ export default {
       interl: null
     }
   },
+  computed: {
+    ...mapState({
+      language: state => state.language.current
+    })
+  },
   methods: {
     async getAuthCode () {
       let res = await this.$store.dispatch('getAuthCode', this.phone)
@@ -84,7 +91,7 @@ export default {
         phoneNum: this.phone,
         msgAuthCode: this.authCode,
         nickName: this.nickname,
-        country: '中国',
+        country: this.language === '中' ? '内' : '国外',
         confirmPwd: this.confirmPass
       }
       let res = await this.$http({

+ 14 - 15
src/page/manage/index.vue

@@ -9,7 +9,7 @@
           <p>{{info.userName}}</p>
         </div>
       </div>
-      <div class="open-btn" @click="$router.push({path:'/privilege'})">立即升级</div>
+      <div class="open-btn" @click="$router.push(btnItem.to)">{{btnItem.name}}</div>
       </div>
     </div>
     <div class="manage-body">
@@ -46,6 +46,15 @@ export default {
       logout: '退出登录'
     }
 
+    let btnType = {
+      buy: {
+        name: '立即购买',
+        to: {
+          path: '/eight'
+        }
+      }
+    }
+
     let settings = [
       {
         name: 'info',
@@ -58,8 +67,7 @@ export default {
         }, {
           name: '我的订单',
           to: {name: 'order'}
-        },
-        {
+        }, {
           name: '我的设备',
           to: {name: 'device'}
         }, {
@@ -68,16 +76,6 @@ export default {
         }
         ]
       },
-      // {
-      //   name: 'member',
-      //   items: [{
-      //     name: '特权介绍',
-      //     cp: 'iprivilege'
-      //   }, {
-      //     name: '增值发票',
-      //     cp: 'iinvoice'
-      //   }]
-      // },
       {
         name: 'security',
         items: [{
@@ -92,11 +90,12 @@ export default {
     return {
       settings,
       nameArr,
-      content: ''
+      content: '',
+      btnItem: btnType['buy']
     }
   },
   mounted () {
-    // this.getInfo()
+    this.getInfo()
   },
   methods: {
     tabHandle (sub) {

+ 91 - 16
src/page/manage/temp/consumption.vue

@@ -6,26 +6,30 @@
           {{item.name}}
         </li>
       </ul>
-      <div class="tab-select" ref="invoiceMenu" @click="tabActive=!tabActive" :class="{'tab-active':tabActive}">
-        全部
+      <div v-if="active===2" class="tab-select" ref="invoiceMenu" @click="tabActive=!tabActive" :class="{'tab-active':tabActive}">
+        {{activeType}}
         <ul>
-          <li>全部</li>
-          <li v-for="(item,i) in cameraList" :key="i">{{item.name}}</li>
+          <li v-for="(item,i) in cameraList"  @click="selectCamTy(item)" :key="i">{{item.name}}</li>
         </ul>
       </div>
+      <div class="tab-search" v-else>
+        <input v-model="searchKey" @keyup.enter="getList(searchKey)" type="text" placeholder="搜索设备ID">
+        <i class="iconfont icon-sousuo" @click="getList(searchKey)"></i>
+      </div>
     </div>
     <div class="invoices" v-if="active===2">
       <span>设备</span>
       <div class="tab-select" ref="deviceMenu" @click="deviceActive=!deviceActive" :class="{'tab-active':deviceActive}">
-        全部
+        {{activeDevice}}
         <ul>
-          <li>全部</li>
+          <li @click="selectInId({childName:'全部',id:''})">全部</li>
           <li v-for="(item,i) in invoicedevice" @click="selectInId(item)" :key="i" >{{item.childName}}</li>
         </ul>
       </div>
       <span>可开票额度(元){{max}}</span>
-      <div class="btn parmary">开票</div>
+      <div class="btn parmary" @click="openInvice">开票</div>
     </div>
+
     <tableList :header='tabHeader' :data='data' class="table-list" >
       <div slot-scope="{data}" slot="header">
         {{data.name}}
@@ -40,12 +44,15 @@
         <Paging @clickHandle="pageChange" :current="currentPage" :total="total" :equable="pageSize" />
       </vcenter>
     </div>
+    <div class="scene-nothing" v-else>
+      <img src="@/assets/images/nothing.png">
+      <div>暂无任何记录</div>
+    </div>
   </div>
 </template>
 
 <script>
 import { mapState } from 'vuex'
-
 import tableList from '@/components/table'
 import {capacity, recharge, invoice} from './iconsumption'
 import Paging from '@/components/tablePaging'
@@ -92,6 +99,10 @@ export default {
 
     let cameraList = [
       {
+        name: '全部',
+        id: ''
+      },
+      {
         name: '二目充值',
         id: 0
       },
@@ -114,7 +125,11 @@ export default {
       tabActive: false,
       deviceActive: false,
       max: 0,
-      activeId: ''
+      activeDevice: '全部',
+      activeType: '全部',
+      activeId: '',
+      activeTypeId: ''
+
     }
   },
   computed: {
@@ -164,6 +179,11 @@ export default {
         this.getList()
       }
     },
+    activeTypeId (newVal) {
+      if (this.active === 2) {
+        this.getList()
+      }
+    },
     active (newVal) {
       switch (newVal) {
         case 1:
@@ -185,14 +205,26 @@ export default {
       this.currentPage = data
     },
     selectInId (item) {
+      this.activeDevice = item.childName
       this.activeId = item.id
     },
+    selectCamTy (item) {
+      this.activeType = item.name
+      this.activeTypeId = item.id
+    },
     showDetail (item) {
-      this.$toast.showInvoice(item)
+      this.$toast.showInvoiceDetail(item)
     },
-    getList () {
+    getList (searchKey = '') {
       let str = methodStr[this.active]
-      this[str]()
+      this[str](searchKey)
+    },
+    openInvice () {
+      let params = {
+        max: this.max,
+        cameraId: this.activeId
+      }
+      this.$toast.showInvoice(params)
     },
     async getAllDevice (searchKey = '') {
       let params = {
@@ -202,7 +234,7 @@ export default {
     },
     async getConsumpList (searchKey = '') {
       let params = {
-        cameraId: searchKey,
+        childName: searchKey,
         pageNum: searchKey ? 1 : this.currentPage,
         pageSize: this.pageSize
       }
@@ -234,7 +266,7 @@ export default {
     },
     async getChargeList (searchKey = '') {
       let params = {
-        cameraId: searchKey,
+        childName: searchKey,
         pageNum: searchKey ? 1 : this.currentPage,
         pageSize: this.pageSize
       }
@@ -250,7 +282,8 @@ export default {
       let params = {
         cameraId: this.activeId,
         pageNum: this.currentPage,
-        pageSize: this.pageSize
+        pageSize: this.pageSize,
+        type: this.activeTypeId
       }
       await this.$store.dispatch('getInvoiceList', params)
       this.pageSize = this.myinvoicelist.pageSize
@@ -263,6 +296,7 @@ export default {
     }
   },
   mounted () {
+    this.getInvoiceMax()
     this.getList()
     document.addEventListener('click', (e) => {
       if (this.$refs.invoiceMenu) {
@@ -328,6 +362,29 @@ $border-color: #d9d9d9;
       margin-right: 20px;
     }
   }
+  .tab-search{
+      float: right;
+      position: relative;
+      width: 200px;
+      padding-left: 10px;
+      margin-right: 15px;
+      border: 1px solid #ccc;
+      display: flex;
+      .iconfont{
+        width: 28px;
+        height: 28px;
+        padding: 6px;
+        background: #e4e4e4;
+      }
+      input{
+        width: 100%;
+        font-size: 14px;
+        appearance: none;
+        line-height: 28px;
+        height: 28px;
+        border: 0;
+      }
+    }
   .tab-select{
       float: right;
       position: relative;
@@ -356,12 +413,18 @@ $border-color: #d9d9d9;
         max-height: 0;
         left: 0;
         top: 34px;
-        padding-left: 10px;
         background: #fff;
         overflow: hidden;
         width: 100%;
         transition:all 0.3s ease;
         box-shadow: 0 0 10px rgba($color: #000000, $alpha: 0.4);
+        li{
+          padding-left: 10px;
+          &:hover{
+            background: $theme-color;
+            color: #2d2d2d;
+          }
+        }
       }
     }
     .tab-active{
@@ -380,6 +443,18 @@ $border-color: #d9d9d9;
       cursor: pointer;
     }
   }
+  .scene-nothing{
+    padding: 42px 0 0 40px;
+    text-align: center;
+    img{
+      padding-bottom: 22px;
+    }
+    div{
+      font-size: 16px;
+      color: #969696;
+      text-align: center;
+    }
+  }
   .paging {
     height: 100%;
   }

+ 4 - 1
src/page/manage/temp/device.vue

@@ -33,7 +33,10 @@
             </div>
             <p class="p-sub">{{item.usedSpaceStr}} / {{item.totalSpaceStr}}</p>
             <div class="d-edit">
-              <span @click="$router.push({path:'/privilege'})">升级</span>
+              <span v-if="!item.spaceEndTime" @click="$router.push({name:'privilege',params: {
+          cameraId: item.id,
+          childName: item.childName
+        }})">升级</span>
               <span @click="$router.push({name:'introduce',params:{id:item.childName}})">扩容</span>
               <span @click="unbind(item)">解绑</span>
             </div>

+ 3 - 3
src/page/manage/temp/information.vue

@@ -58,8 +58,8 @@
       </div>
       <div class="address edit-address" slot="edit">
         <div class="input-con">
-          <input type="text" v-model="editAdd.shipName" :placeholder="address.shipName||'姓名'">
-          <input type="text" v-model="editAdd.shipMobile" :placeholder="address.shipMobile||'电话'">
+          <input type="text" v-model="editAdd.shipName" :placeholder="'姓名'">
+          <input type="text" v-model="editAdd.shipMobile" :placeholder="'电话'">
         </div>
         <div class="input-con">
           <citySelect :areaPath="editAdd.shipAreaPath" @currentVal="getCurrentSelect"/>
@@ -68,7 +68,7 @@
           <input
             type="text"
             v-model="editAdd.shipAddress"
-            :placeholder="editAdd.shipAddress||'详细地址'"
+            :placeholder="'详细地址'"
           >
         </div>
         <div class="btn parmary" @click="uAddress">保存</div>

+ 3 - 0
src/page/manage/temp/scene.vue

@@ -66,6 +66,9 @@ export default {
   },
   methods: {
     goto (url) {
+      // let temp = url.replace('//pro', '//test')
+      // window.open(temp.replace('//www', '//test'), '_blank')
+
       window.open(url.replace('http://', 'https://'), '_blank')
     },
     getSceneImg (item) {

+ 0 - 20
src/page/pay/index.vue

@@ -9,26 +9,6 @@
       <div class="h-right">当前账号:{{info.userName}}</div>
     </div>
     <div class="pay-con">
-      <!-- <div class="top">
-        <div class="attr">开通选择:</div>
-        <div class="val">
-          <div class="tag" :class="{'tag-active':privilege==='year'}" @click="privilege='year'">
-            <span class="year">1年</span>
-            <span class="price">
-              <i style="font-size:12px">¥</i>1999
-              <span class="per">166元/月</span>
-            </span>
-            <img v-if="privilege==='year'" src="@/assets/images/tag-icon.png" alt>
-          </div>
-          <div class="tag" :class="{'tag-active':privilege==='mouth'}" @click="privilege='mouth'">
-            <span class="year">1个月</span>
-            <span class="price">
-              <i style="font-size:12px">¥</i>199
-            </span>
-            <img v-if="privilege==='mouth'" src="@/assets/images/tag-icon.png" alt>
-          </div>
-        </div>
-      </div> -->
       <div class="mid">
         <div class="attr">支付方式:</div>
         <div class="body">

+ 104 - 58
src/page/payrecharge/index.vue

@@ -12,25 +12,18 @@
       <div class="pay-left">
         <div class="device">
           <div class="attr">开通选择:</div>
-          <div class="val">b0f1ec548965</div>
+          <div class="val">{{childName}}</div>
         </div>
         <div class="top">
           <div class="attr">开通选择:</div>
           <div class="val">
-            <div class="tag" :class="{'tag-active':privilege==='year'}" @click="privilege='year'">
-              <span class="year">1年</span>
+            <div class="tag" v-for="(item,i) in privilegeArr" :key="i" :class="{'tag-active':privilege===item.privilege}" @click="privilege=item.privilege">
+              <span class="year">{{item.duration}}</span>
               <span class="price">
-                <i style="font-size:12px">¥</i>1999
-                <span class="per">166元/月</span>
+                <i style="font-size:12px">¥</i>{{item.price}}
+                <span class="per" v-if="item.each">{{item.each}}元/月</span>
               </span>
-              <img v-if="privilege==='year'" src="@/assets/images/tag-icon.png" alt />
-            </div>
-            <div class="tag" :class="{'tag-active':privilege==='mouth'}" @click="privilege='mouth'">
-              <span class="year">1个月</span>
-              <span class="price">
-                <i style="font-size:12px">¥</i>199
-              </span>
-              <img v-if="privilege==='mouth'" src="@/assets/images/tag-icon.png" alt />
+              <img v-if="privilege===item.privilege" src="@/assets/images/tag-icon.png" alt />
             </div>
           </div>
         </div>
@@ -65,11 +58,11 @@
               <img src="@/assets/images/tag-icon.png" class="t-click" alt />
               <form
                 class="form-con"
-                :action="`${$serverName}api/order/pay/paypal`"
                 method="post"
+                :action="`${$serverName}api/order/pay/paypal`"
               >
-                <input v-model="$route.params.orderId" type="text" name="orderId" />
-                <input v-model="$route.params.orderType" type="text" name="orderType" />
+                <input v-model="currentId" type="text" name="orderId" />
+                <input v-model="currentType" type="text" name="orderType" />
                 <input type="submit" value="提交" />
               </form>
             </div>
@@ -96,7 +89,10 @@
             <p>{{item.name}}</p>
           </li>
         </ul>
-        <div class="pay-detail" @click="$router.push({path:'/introduce'})">了解特权详细</div>
+        <div class="pay-detail" @click="$router.push({name:'privilege',params: {
+          cameraId: cameraId,
+          childName: childName
+        }})">了解特权详细</div>
       </div>
     </div>
     <div class="pay-bottom">©2019 4dkankan移动开放平台</div>
@@ -105,23 +101,35 @@
 
 <script>
 import { mapState } from 'vuex'
+
 let payTypes = {
   wechatPay: '微信',
   alipay: '支付宝',
   paypal: 'paypal'
 }
-let PAYS = {
-  0: 'wechatPay',
-  1: 'alipay',
-  2: 'paypal'
-}
+
 let PAYSID = {
   wechatPay: 0,
   alipay: 1,
   paypal: 2
 }
+let PAYSSTR = {
+  0: 'wechatPay',
+  1: 'alipay',
+  2: 'paypal'
+}
 
 export default {
+  computed: {
+    ...mapState({
+      token: state => state.user.token,
+      language: state => state.language.current,
+      info: state => state.user.info
+    }),
+    payZH () {
+      return payTypes[this.paytype]
+    }
+  },
   data () {
     let payicon = [{
       img: require('@/assets/images/payicon1.png'),
@@ -136,30 +144,44 @@ export default {
       img: require('@/assets/images/payicon4.png'),
       name: '更优惠的扩容价格'
     }]
+    let privilegeArr = [
+      {
+        duration: '1年',
+        price: 1999,
+        each: 166,
+        privilege: 'year'
+      },
+      {
+        duration: '1个月',
+        price: 199,
+        each: '',
+        privilege: 'mouth'
+      }
+    ]
+    let {cameraId, childName} = this.$route.params
     return {
+      privilegeArr,
       privilege: 'year',
       response: '',
       payicon,
       t1: null,
-      paytype: PAYS[this.$route.params.payType]
-    }
-  },
-  computed: {
-    ...mapState({
-      token: state => state.user.token,
-      info: state => state.user.info
-    }),
-    payZH () {
-      return payTypes[this.paytype]
+      paytype: 'wechatPay',
+      currentId: '',
+      currentType: 3,
+      cameraId,
+      childName
     }
   },
   watch: {
     paytype (newVal, oldVal) {
       this.getCode()
+    },
+    privilege () {
+      this.pay()
     }
   },
   mounted () {
-    // this.getCode()
+    this.pay()
   },
   methods: {
     inverRequest () {
@@ -171,25 +193,17 @@ export default {
     },
     async queryOrderStatus () {
       if (this.t1) {
-        let { orderSn, orderType } = this.$route.params
-        if (!orderSn) {
-          return this.$toast.show('error', '获取订单信息失败')
-        }
-
         let params = {
-          orderSn,
-          orderType: Number(orderType),
-          payType: Number(PAYSID[this.paytype])
+          orderSn: this.orderSn,
+          orderType: 3,
+          payType: PAYSID[this.paytype]
         }
-        let res = await this.$http.post(
-          '/user/order/queryOrderStatus',
-          params,
-          {
+        let res = await this.$http
+          .post('/user/order/queryOrderStatus', params, {
             headers: {
               token: this.token
             }
-          }
-        )
+          })
         let response = res.data
         if (response.code === 0 && response.data) {
           this.t1 = null
@@ -203,21 +217,53 @@ export default {
         }
       }
     },
-    async getCode () {
-      let { orderId, orderType } = this.$route.params
-      if (!orderId || (!orderType && orderType !== 0)) {
-        return this.$toast.show('error', '获取订单信息失败')
+    async pay () {
+      let skuSn, commerceType
+      if (this.privilege === 'year') {
+        skuSn = 'U15604134906280002'
+        commerceType = 0
+      } else {
+        skuSn = 'U15604134903250001'
+        commerceType = 1
       }
-      if (this.paytype !== 'paypal') {
-        let params = {
-          orderId: orderId,
-          orderType: Number(orderType)
-        }
-        let res = await this.$http.post(`/order/pay/${this.paytype}`, params, {
+      let params = {
+        cameraId: this.cameraId,
+        commerceType,
+        count: 1,
+        payType: PAYSID[this.paytype],
+        skuSn,
+        abroad: this.language === 'en' ? 1 : 0
+      }
+
+      let res = await this.$http
+        .post('/user/order/commerceOrder', params, {
           headers: {
             token: this.token
           }
         })
+
+      let data = res.data
+      if (data.code !== 0) {
+        return this.$toast.show('error', `获取订单信息失败,${data.msg}`)
+      }
+      let {id, orderSn} = data.data
+      this.currentId = id
+      this.orderSn = orderSn
+      this.getCode()
+    },
+    async getCode () {
+      let payType = PAYSID[this.paytype]
+      if (payType !== 2) {
+        let params = {
+          orderId: this.currentId,
+          orderType: 3
+        }
+        let res = await this.$http
+          .post(`/order/pay/${PAYSSTR[payType]}`, params, {
+            headers: {
+              token: this.token
+            }
+          })
         let response = res.data
         if (response.code !== 0) {
           return this.$toast.show('error', '获取支付二维码失败', () => {
@@ -228,7 +274,6 @@ export default {
         this.response = response.data
         this.inverRequest()
       } else {
-        document.getElementById('formid').submit()
         this.$toast.show('warn', '正在跳转至paypal支付链接,请稍等')
       }
     }
@@ -301,6 +346,7 @@ $theme-color: #1fe4dc;
             display: flex;
             align-items: center;
             border: 1px solid #f4f4f4;
+            cursor: pointer;
             position: relative;
             .year {
               width: 52px;

+ 9 - 52
src/page/privilege/index.vue

@@ -16,7 +16,7 @@
               <div class="item-name">
                 <p class="type">{{item.name.title}}</p>
                 <p :class="item.name.price.class" v-html="item.name.price.name"></p>
-                <p :class="item.name.authority.class" v-html="item.name.authority.name"></p>
+                <p @click="$router.push(item.name.authority.handle)" :class="item.name.authority.class" v-html="item.name.authority.name"></p>
               </div>
               <div>
                 <span v-if="!item.identity.img" v-html="item.identity.url"></span>
@@ -127,56 +127,6 @@ export default {
     let privilege = [
       {
         name: {
-          title: '普通会员',
-          price: {
-            name: '免费',
-            class: 'price'
-          },
-          authority: {
-            class: 'free',
-            name: '可长期免费使用'
-          }
-        },
-        identity: {
-          img: false,
-          url: '无'
-        },
-        count: '不限',
-        bCapacity: '3G<br/>(免费体验容量)',
-        xCapacity: '无',
-        per: '1G=¥69/年<br/>1T=¥639/年',
-        basic: '8项',
-        loading: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        updateModel: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        measure: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        video: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        coordination: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        customer: {
-          icon: true,
-          name: 'icon-vip_false'
-        },
-        scene: {
-          icon: true,
-          name: 'icon-vip_false'
-        }
-      },
-      {
-        name: {
           title: '专业会员',
           price: {
             name: `买设备就<span style='font-size:20px;margin-left:4px;'>送</span>`,
@@ -235,7 +185,14 @@ export default {
           },
           authority: {
             class: 'btns primary',
-            name: '立即开通'
+            name: '立即开通',
+            handle: {
+              name: 'payrecharge',
+              params: {
+                cameraId: this.$route.params.cameraId,
+                childName: this.$route.params.childName
+              }
+            }
           }
         },
         identity: {

+ 2 - 2
src/router/index.js

@@ -26,7 +26,7 @@ let router = new Router({
       component: resolve => require(['@/page/pay'], resolve)
     },
     {
-      path: '/payrecharge',
+      path: '/payrecharge/:cameraId/:childName',
       name: 'payrecharge',
       component: resolve => require(['@/page/payrecharge'], resolve)
     },
@@ -76,7 +76,7 @@ let router = new Router({
       component: resolve => require(['@/page/purchasetow'], resolve)
     },
     {
-      path: '/privilege',
+      path: '/privilege/:cameraId/:childName',
       name: 'privilege',
       component: resolve => require(['@/page/privilege'], resolve)
     },

+ 1 - 1
src/store/language/en/purchasetow.js

@@ -3,7 +3,7 @@ export default{
   top2: '技术规格',
   dec: '15分钟快速建模,全自动生成空间模型,实时计算空间尺寸,10K分辨率支持4倍放大',
   yushou: '【新品预售】',
-  price: 'RMB 9,800',
+  price: 'RMB 3,999',
   buy: 'Shop Now',
   tiaokuan: '* 付款成功后5个工作日内发货,默认顺丰快递包邮',
   guige: {

+ 1 - 3
src/store/user.js

@@ -180,10 +180,8 @@ export default {
       })
 
       let data = res.data
-      if (data.code === 0) {
+      if (data.code !== 0) {
         context.commit('logout')
-      } else {
-        return vue.$toast.show('warn', data.msg)
       }
     },
     async reduceCart (context, params) {

+ 2 - 2
src/util/http.js

@@ -5,8 +5,8 @@ import Vue from 'vue'
 
 let vue = new Vue()
 // import qs from 'qs'
-const exceptUrls = ['/sso/user/logout', '/sso/user/sendUserInfo', '/user/order/queryOrderStatus']
-// axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'http://pro.4dkankan.com/api' : '/api'
+const exceptUrls = ['/sso/user/logout', '/sso/user/sendUserInfo', '/user/order/queryOrderStatus', '/user/checkToken']
+// axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'https://pro.4dkankan.com/api' : '/api'
 
 axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.0.10:8080/api' : '/api'
 // 请求超时时限