<template>
  <view>
    <uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="测试"></uni-nav-bar>
    <view @click="getList">list</view>
    <view @click="getDetail">detail</view>
    <view @click="purchase">purchase</view>
  </view>
</template>

<script>
import { go2, back } from '@/utils/hook.js'
import { getPaperList, getPaperDetail, purchasePaper } from '@/apis/testApi.js'
export default {
  data() {
    return {}
  },
  methods: {
    go2,
    back,
    // 获取纸品列表
    getList() {
      getPaperList({ supplierId: this.$store.state.supplierId }).then((res) => {
        console.log(res)
      })
    },
    getDetail() {
      getPaperDetail({ productId: '678972506887032832' })
    },
    purchase() {
      let form = {
        orderGoodsList: [
          {
            buyTon: 0.1,
            gramWeight: 200,
            length: 1000,
            mallSupplierId: '677166944742412288',
            pieceQuantity: 500,
            productId: '678972506887032832',
            productSkuId: '678972507222577152',
            unitPrice: 10000,
            width: 1000
          }
        ],
        otherFee: 0,
        purchaserEnterpriseId: '807704'
      }
      purchasePaper(form).then((res) => {
        console.log(res)
      })
    }
  }
}
</script>
