123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="">
- <scroll-view class="titleTop" scroll-x="true" @scroll="scroll" scroll-left="100%">
- <view class="">
- <view class="titleTop-name" v-for="(item,index) in titleList" :key="index">
- {{item}}
- </view>
- </view>
- <view class="list">
- <view class="" v-for="(item,index) in list" :key="index">
- <view class="list-item" v-for="(str,index) in item" :key="index">
- <text>{{str}}</text>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- _API_GetOrderDetail
- } from '@/apis/order.js'
- export default {
- data() {
- return {
- id: '',
- // titleList: ['款式尺码','订单1','订单2','订单3','订单4','合并'],
- // list:[['精-男-L','精-男-XL'],[1,2], [3,0],[1,2],[3,4],[8,12]],
- titleList: [],
- list: []
- }
- },
- onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
- this.id = option.id
- },
- onShow() {
- this.getList()
- },
- computed: {},
- methods: {
- getList() {
- _API_GetOrderDetail({
- id: this.id
- }).then(res => {
- if (res.code === 200) {
- this.list = res.data
- let list = this.list
- let titleList = ['款式尺码']
- for (var i = 0; i < list.length; i++) {
- titleList[i + 1] = '订单' + (i + 1)
- }
- titleList.push('合并')
- titleList.splice(list.length - 1, 2)
- this.titleList = titleList
- } else {
- uni.showModal({
- content: res.message,
- showCancel: false,
- success() {
- uni.navigateBack()
- }
- })
- }
- }).catch(() => {})
- },
- scroll() {}
- },
- }
- </script>
- <style lang="scss" scoped>
- .titleTop {
- // width: 60rpx;
- white-space: nowrap;
- &-name {
- background-color: #eee;
- line-height: 104rpx;
- display: flex;
- color: #333;
- font-size: 32rpx;
- font-weight: bold;
- display: inline-block;
- text-align: center;
- width: 200rpx;
- }
- }
- .list {
- display: flex;
- &-item {
- width: 200rpx;
- font-weight: bold;
- line-height: 104rpx;
- text-align: center;
- border-right: 1rpx solid #eee;
- border-bottom: 1rpx solid #eee;
- }
- }
- </style>
|