123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- <template>
- <block>
- <scroll-view class="scrollView" :scroll-x="true" style="width: 100%">
- <view class="navs">
- <text :class="'nav ' + (nowIndex == index ? 'bold' : '')" @tap="navChange" :data-index="index"
- :data-id="item.id" v-for="(item, index) in navs" :key="index">
- {{ item.name }}
- </text>
- <text class="borderLine"
- :style="'width: ' + (width + 'rpx') + ';left: ' + (45 + nowIndex * 150 + 'rpx')"></text>
- </view>
- </scroll-view>
- <view class="content" v-if="list.length > 0">
- <view class="lists" @tap="toPage" :data-id="item.order_id"
- data-url="/pages/intergalShop/orderDetail" v-for="(item, index) in list"
- :key="index">
-
- {{item.order_no}}
- {{item.create_time}}
- <text class="lists-status" v-if="item.state == 2">待发货</text>
- <text class="lists-status" v-else-if="item.state == 3">待收货</text>
- <text class="lists-status" v-else-if="item.state == 5">已完成</text>
- <view class="iflexC lists-content">
- <image class="lists-img" :src="item.products[0].image" mode="aspectFill"></image>
- <text class="lists-title over_2">{{ item.products[0].title }}</text>
-
- {{item.order_status== 6&&item.is_film==1}}
- <text class="lists-money">
- 价格:
- <text class="red">{{ item.products[0].price }}</text>
- </text>
- <text class="lists-time">下单时间:{{ item.createtime }}</text>
- </view>
- {{item.deliver_no}}
- {{item.send_comp}}
- {{item.deliver_no}}
- <view class="iflex l-btns" style="flex-direction: row-reverse">
-
- <button class="lists-btn btn2"
- v-if="item.state == 5" @click.stop="buyNext(item.products[0].id)">再次购买</button>
-
-
-
- <button @click.stop="confirm(item.order_id)" class="lists-btn btn2" v-if="item.state == 3">确认收货</button>
-
-
-
-
-
- </view>
- </view>
- </view>
-
-
-
- <view v-if="!list.length && loaded" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>
- 暂无数据
- </view>
-
-
-
-
- </block>
- </template>
- <script>
- var app = getApp();
- export default {
- data() {
- return {
- list: [
- ],
- page: 1,
- loaded: false,
- nowIndex: 0,
- width: 60,
- navs: [{
- id: 0,
- name: '全部'
- },
- {
- id: 2,
- name: '待发货'
- },
- {
- id: 3,
- name: '待收货'
- },
- {
- id: 5,
- name: '已完成'
- }
- ],
- is_deliver: 4,
- unit: '积分',
- flag: false,
- qr_img: '',
- show: false,
- id: ''
- };
- },
- onLoad: function() {
- var that = this;
- that.getlist();
- },
- onPullDownRefresh: function() {
-
- this.list= [],
- this.page= 1,
- this.loaded= false
-
- this.getlist();
- },
- onReachBottom: function() {
- this.loaded || this.getlist();
- },
- methods: {
-
- buyNext(id) {
-
- uni.navigateTo({
- url: `/pages/intergalShop/goodsDetail?id=${id}`
- });
- },
- async confirm(id) {
-
-
- let that = this;
- let [error, res] = await uni.showModal({
- title: '确认收货?'
- });
- if (res.confirm == true) {
- let res = await that.$api.request('/order/received', 'GET', {
- order_id: id,
- type:1
- });
- if (res) {
-
- that.initData()
- that.getlist()
-
- }
- return true;
- }
- this.$api.msg('收货失败');
- return false;
-
-
-
-
- },
- navChange(e) {
- if (this.nowIndex != e.currentTarget.dataset.index) {
-
- this.nowIndex=e.currentTarget.dataset.index,
-
- this.initData();
- this.getlist();
- }
- },
- initData() {
- this.page = 1
- this.loaded = false
- this.list = []
- },
- async getlist() {
- var that = this;
- var res = await this.$api.request('/order/getOrders', 'GET', {
- type: 1 ,
- page: this.page,
- pagesize: 10,
- state:this.navs[this.nowIndex].id
- });
- console.log(res)
- if (res) {
- if (res.length > 0) {
- this.list = this.list.concat(res);
- this.page++;
- } else {
- this.loaded = true
- this.$api.msg('没有更多数据');
- }
- }
- },
- toPage(e) {
- let index = e.currentTarget.dataset.index;
- app.globalData.toPage(e);
- }
- }
- };
- </script>
- <style>
- page {
- background: #f2f2f2;
- padding-bottom: 140rpx;
- }
- .scrollView {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 100;
- }
- .navs {
- display: flex;
- width: 100%;
- position: relative;
- border-top: 1px solid #e4e4e4;
- background: white;
- }
- .lists-time1 {
- font-size: 24rpx;
- color: #666;
- padding: 10rpx 0 16rpx;
- }
- .navs .nav {
- flex: 1;
- flex-shrink: 0;
- text-align: center;
- padding: 26rpx 0;
- font-size: 28rpx;
- color: #333;
- }
- .borderNone {
- border-bottom: none !important;
- }
- .bold {
- font-weight: bold;
- color: #FB4C6F !important;
- }
- .borderLine {
- width: 60rpx;
- height: 4rpx;
- background: rgba(234, 63, 51, 1);
- opacity: 1;
- display: block;
- position: absolute;
- bottom: 0;
- transition: left 0.3s;
- opacity: 0;
- }
- .content {
- margin-top: 116rpx;
- }
- .lists {
- background: white;
- margin: 0 20rpx 20rpx;
- padding: 22rpx;
- border-radius: 15rpx;
- font-size: 28rpx;
- position: relative;
- }
- .lists-status {
- position: absolute;
- top: 22rpx;
- right: 22rpx;
- font-size: 26rpx;
- color: #8E8E8E;
- }
- .lists-content {
- padding: 0 0 0 156rpx;
- position: relative;
- min-height: 132rpx;
- }
- .lists-img {
- height: 132rpx;
- width: 132rpx;
- position: absolute;
- top: 0;
- left: 0;
- border-radius: 6rpx;
- }
- .lists-time {
- font-size: 22rpx;
- color: #666;
- }
- .lists-title {
- font-size: 32rpx;
- width: 410rpx;
- line-height: 1.2;
- }
- .lists-num {
- padding: 12rpx 0 24rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .lists-num1 {
- color: #666;
- }
- .goDetail {
- width: 150rpx;
- height: 65rpx;
- color: #f62e2e;
- border: 1px solid #f62e2e;
- border-radius: 40rpx;
- font-size: 24rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .lists-money {
- font-size: 26rpx;
- padding: 6rpx 0 26rpx;
- }
- .lists-btn,
- .btn1 {
- position: relative;
- z-index: 1;
- width: 140rpx;
- height: 50rpx;
- line-height: 50rpx;
- opacity: 1;
- border-radius: 24rpx;
- margin: 12rpx 0 0 14rpx;
- border: none;
- font-size: 24rpx;
- font-weight: 400;
- padding: 0;
- background: #FB4C6F;
- color: white;
-
- overflow: inherit;
- }
-
- .l-btns {
- border-top: 1rpx solid RGBA(220, 220, 220, 0.6);
- margin-top: 18rpx;
- }
- .btn1 {
- line-height: 46rpx;
- border: 1rpx solid #999999;
- color: #333;
- background: white;
- }
-
- .integral {
- background: #fff;
- padding: 30rpx;
- box-sizing: border-box;
- width: 100%;
- font-family: 微软雅黑;
- margin: 0 auto 0;
- font-size: 30rpx;
- color: #333;
- border-bottom: 1rpx solid #e5e5e5;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .integral-left {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- }
- .integral-left1 {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .integral-left image {
- width: 180rpx;
- height: 120rpx;
- margin-right: 30rpx;
- }
- .integral-left view:nth-child(1) {
- color: #333;
- }
- .integral-left view:nth-child(2) {
- margin-top: 5rpx;
- color: #999;
- font-size: 25rpx;
- }
- .integral-right {
- font-weight: bold;
- font-size: 40rpx;
- }
- .integral-right1 {
- font-weight: 100;
- font-size: 26rpx;
- margin-left: 5rpx;
- }
- .vice {
- color: #999;
- font-size: 25rpx;
- }
- .mask {
- width: 100%;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 999;
- }
- .qrcode {
- width: 80%;
- height: auto;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .close {
- margin: 30rpx auto;
- width: 200rpx;
- height: 70rpx;
- background: #fff;
- border-radius: 20rpx;
- text-align: center;
- line-height: 70rpx;
- }
- .qrcode image {
- width: 100%;
- height: auto;
- border-radius: 10rpx;
- }
- .over_2 {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .iflex {
- display: flex;
- }
- .iflexC {
- display: flex;
- flex-direction: column
- }
- </style>
|