123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view :style="{ minHeight: sys.windowHeight + 'px' }"
- :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
- <tm-menubars title="我的订单" :shadow="0" :showback="true"></tm-menubars>
- <tm-tabs align="split" class="qiehuan1" v-model="activeIndex" :list="list2" range-key="title" @change="changeTab"></tm-tabs>
- <div class="zhuti shangpin">
- <tm-sheet class="jiaoxi" style="" v-for="item in test">
- <tm-cartCellListFood class="shuliang" :typeclick="typeclick" :mdata="item" :cart-num.sync="item.buy"></tm-cartCellListFood>
- </tm-sheet>
- </div>
- <view class="" v-if="isBottom">
- 没有更多了~~~~
- </view>
- <!-- 弹出层消息 -->
- <tm-message ref="toast"></tm-message>
- </view>
- </template>
- <script>
- import{myRequest} from '@/api/request.js'
- export default {
- data() {
- return {
- list2:[ '全部','待付款','已付款','已完成'],
- activeIndex:0,
- test: [
- {
- img: '../../static/img/83.png',
- title: '丝缎质感纹理风衣',
- label: '黑色 - 6518/320',
- size:'S',
- price: '1299',
- id: 3,
- buy: 0,
- itemId: 0,
- checked:false,
- status:0
- },{
- img: '../../static/img/84.png',
- title: '产品3(任选)',
- size:'S',
- label: '这个产品是只有几个融会',
- price: 36.2,
- id: 3,
- buy: 0,
- itemId: 0,
- checked:false,
- status:0
- }],
- typeclick:4,//1加入购物车,2购物车
- page:1,
- pagesize:5,
- isBottom:false
- };
- },
- onLoad() {
-
- },
- created() {
- if(!uni.getStorageSync("token")){
- uni.navigateTo({
- url: "/pages/login/index",
- })
- }
- this.sys = uni.getSystemInfoSync();
- this.getOrderList(-1);
- },
- methods: {
- // 切换tab
- changeTab(e){
- this.activeIndex=e;
- let sel=0;
- if(e==0){
- sel=-1;
- }else if(e==1){
- sel=0;
- }else if(e==2){
- sel=1;
- }else if(e==3){
- sel=2;
- }
- this.getOrderList(sel)
- },
- // 获取订单列表
- getOrderList(index){
- let that=this;
- myRequest({
- url:'/api/Order/orderList',
- method:'post',
- data:{type:index,
- page:that.page,
- pagesize:that.pagesize}
- }).then(res=>{
- if (res.data.code == 200) {
- if (res.data.data.length != 0) {
- that.test = [];
- for (let i = 0; i < res.data.data.data.length; i++) {
- var obj = {
- img: res.data.data.data[i].goods_image,
- title: res.data.data.data[i].goods_name,
- // label: '黑色 - 6518/320',
- // size:'S',
- price: res.data.data.data[i].pay_money,
- id: res.data.data.data[i].id,
- buy: res.data.data.data[i].goods_num,
- itemId: res.data.data.data[i].id,
- checked: false,
- goods_id:res.data.data.data[i].goods_id,
- orderStatus:res.data.data.data[i].order_status,
- orderNo:res.data.data.data[i].order_sn,
- isEval:res.data.data.data[i].is_evaluate
- };
- that.test.push(obj)
- }
- }else {
- that.test = [];
- }
- }
- console.log(res.data.data.data,'订单列表');
- })
- },
- },
- }
- </script>
- <style lang="scss">
- /deep/ .tm-menubars .body{background-color: #1b1b1b !important;}
- /deep/ .qiehuan1 .text-primary{color: white !important;}
- /deep/ .qiehuan1 .tm-tabs-wk{border-top: 1px solid #262628;}
- /deep/ .shuliang .text-size-n{color: white !important;}
- /deep/ .shangpin .white.bk{background-color:#1b1b1b!important;}
- /deep/ .shangpin .tm-cartCellListFood{padding: 0px 0px 15px 0px !important;
- margin-top: 5px !important;margin-bottom: 20px !important;
- border-bottom: 1px solid #1B1B1B;}
- /deep/ .shangpin .border-t-1.bk{border-top:1px solid #1b1b1b!important;}
- /deep/ .shangpin .title{color: white !important;}
- /deep/ .shangpin .text-red{color: white !important;}
- /deep/ .shangpin .round-3{width:90px !important;height:90px !important;}
- /deep/ .shangpin .tm-cartCellListFood-img{width:90px !important;height:90px !important;}
- /deep/ .shuliang .text-size-n{color: white !important;}
- /deep/ .jiaoxi{margin:0 !important;padding: 8px !important;margin-top: 10px !important;}
- </style>
|