<template>
  <view class="order-edit">
	  <view class="order-edit_head">
		  <view class="order-edit_head-steps">
			  <uni-steps :options="[{title: '代付款'}, {title: '代发货'}, {title: '待收货'}, {title: '待评价'},{title: '完成'}]" :active="0"></uni-steps>
		  </view>
		  <scroll-view class="order-edit_head_scroll" height="110rpx" scroll-x="true">
		  	<view class="order-edit_head_scroll-sul">
		  		<view class="order-edit_head_scroll-sul-sli" v-for="(sItem,sIndex) in navList" :key="sIndex" @click="navTab(sIndex,sItem)">
		  			<view class="order-edit_head_scroll-sul-sli-stext">
		  				<text class="order-edit_head_scroll-sul-sli-stext-sname">{{sItem.name}}</text>
		  			</view>
		  			<view class="order-edit_head_scroll-sul-sli-sline" :class="{'order-edit_head_scroll-sul-sli-sactive':navIndex==sIndex}"></view>
		  		</view>
		  	</view>
		  </scroll-view>
	  </view>
	  <view style="height: 200rpx;background-color: #F5F5F5;"></view>
	  <view class="order-edit_conter">
		  <edit-information :viewModel="viewModel" v-if="navIndex==0"></edit-information>
		  <edit-record :viewModel="refund" v-else-if="navIndex==1"></edit-record>
		  <pay-information :viewModel="viewModel" v-else></pay-information>
	  </view>
  </view>
</template>
<script>
import ala from '@/service/ala'
import editInformation from './widget/edit-information.vue'
import editRecord from './widget/edit-record.vue'
import payInformation from './widget/pay-information.vue'
export default {
	components:{
		editInformation,
		editRecord,
		payInformation
	},
	props:{
		widget:{}
	},
  data () {
    return {
      viewModel: '',
	  navList: [{name: '商品信息'},{name:'操作记录'},{name:'支付信息'}],
	  navIndex: 0
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    async init () {
      let para = {
        id: ala.getId(this.widget.route),
        loginuserid: ala.getId(this.widget.route)
      }
      var response = await ala.httpGet('api/OrderAdmin/Show', para)
      this.viewModel = response
	  var par = {
		orderId: ala.getId(this.widget.route)
	  }
	  var res = await ala.httpGet('api/orderaction/GetOrderActionRecord', par)
	  if (res) {
		this.refund = res
	  }
    },
	navTab(vIndex,val){
		this.navIndex = vIndex
	}
  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
@import "./var.scss";
</style>
