123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <template>
- <view class="pagesCons">
- <view class="tab-body">
- <scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
- <view class="check-order-list" v-for="(item,index) in list" :key="item.id"
- >
- <view class="order-log">
- <view v-if="!item.expressNum">待发货</view>
- <view v-else>
- <view>
- 快递公司:<text class="address-title">{{item.expressName}}</text>
- <u-button v-if="item.expressState=='WAIT_SIGN'"
- :custom-style="btnStyle"
- @click="handleGet(index)"
- type="primary" shape="circle" size="mini" >确认收货</u-button>
- </view>
- <view>
- <text>运单编号:</text>
- <text>{{item.expressNum}}</text>
- <u-button @click="copyLogNum(item.expressNum)" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
- </view>
- </view>
- </view>
- <u-gap height="10" bg-color="#f8f8f8"></u-gap>
- <view class="bundle-list" v-for="row in item.orderGoodsList" :key="row.id">
- <view class="img-cont">
- <image :src="row.goodsImages"></image>
- </view>
- <view >
- <view class="ellipsis-two">{{row.goodsName}}</view>
- <view class="bundle-num">
- <view ><text class="price-num">{{row.payGold}}</text> <text class="price-text">乐豆</text></view>
- <view >X {{row.buyQty}}</view>
- </view>
- </view>
- </view>
- </view>
- <u-empty style="padding-top: 10vh;height: auto;" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'"
- mode="list"></u-empty>
- <view style="padding: 20upx;">
- <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { queryOrderExpress, finishOrder } from '@/api/order.js'
- export default {
- components: {
- },
- data() {
- return {
- btnStyle:{
- width: '180rpx',
- fontSize: '30rpx',
- float: 'right'
- },
- isShow: false, // 是否显示物流弹框
- status: 'loadmore',
- noDataText: '暂无数据',
- list: [],
- total: 0,
- orderSn: '' // 订单编号
- }
- },
- onLoad(option) {
- if(option.orderNo) {
- this.orderSn = option.orderNo
- this.getRow()
- }
- // 开启分享
- uni.showShareMenu({
- withShareTicket: true,
- menus: ['shareAppMessage', 'shareTimeline']
- })
- },
- methods: {
- // scroll-view到底部加载更多
- onreachBottom() {
- if (this.list.length < this.total) {
- this.pageNo += 1
- this.getRow()
- } else {
- uni.showToast({
- title: '已经到底了',
- icon: 'none'
- });
- this.status = "nomore"
- }
- },
- // 查询列表
- getRow() {
- this.status = "loading"
- queryOrderExpress({orderSn:this.orderSn}).then(res => {
- console.log(res,'rrrrrrrr')
- if (res.status == 200) {
- this.list = res.data || []
- } else {
- this.list = []
- this.total = 0
- this.noDataText = res.message
- }
- this.status = "loadmore"
- })
- },
- // 确认收货
- handleGet(index) {
- console.log(index,'iiiiiiiiii')
- let params = {
- "expressNo": this.list[index].expressNo,
- "orderNo": this.list[index].orderNo,
- }
- finishOrder(params).then(res=>{
- if(res.status==200) {
- uni.$emit('refresh')
- uni.showToast({
- title:res.message,
- icon: 'none'
- })
- this.getRow()
- }
- })
- },
-
- // 复制运单编号
- copyLogNum (logNum) {
- // H5 不支持
- uni.setClipboardData({
- data: logNum,
- success: function(res) {
- uni.getClipboardData({
- success: function(res) {
- uni.showToast({
- title: '已复制到剪贴板',
- icon: 'none'
- });
- }
- });
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- height: 100%;
- width: 100%;
- background: #F8F8F8;
- }
- .pagesCons {
- height: 100%;
- width: 100%;
- background: #F8F8F8;
- display: flex;
- flex-direction: column;
- .text-right {
- text-align: right;
- }
- .tab-body {
- flex: 1;
- display: flex;
- flex-direction: column;
- .uTabs {
- border-bottom: 1px solid #EEEEEE;
- box-shadow: 1px 1px 3px #eeeeee;
- }
- .check-list {
- flex: 1;
- overflow-y: scroll;
- .swiper-item {
- width: 100%;
- height: 100%;
- overflow: hidden;
- .scroll-view {
- width: 100%;
- height: 100%;
- overflow: auto;
- }
- }
- }
- // 列表样式
- .check-order-list {
- background: #ffffff;
- padding: 10upx 20upx;
- margin: 25upx;
- border-radius: 6upx;
- box-shadow: 1px 1px 3px #EEEEEE;
- font-size: 28upx;
- .check-row {
- display: flex;
- align-items: center;
- padding: 20upx 10upx;
- .icon-xian {
- text-align: right;
- width: 40upx;
- }
- &:first-child {
- border-bottom: 1px dashed #F8F8F8;
- .createDate {
- color: #666;
- font-size: 26upx;
- margin-left: 10upx;
- }
- }
- &:last-child {
- border-top: 1px dashed #F8F8F8;
- }
- >view {
- &:first-child {
- flex: 1;
- }
- }
- }
- // 订单中商品列表
- .bundle-list {
- display: flex;
- padding: 20upx 10upx;
- font-size: 28upx;
- border-bottom: 1px solid #F8F8F8;
- &:last-child {
- border-bottom: none;
- }
- .img-cont {
- width: 160upx;
- height: 160upx;
- >image {
- width: 100%;
- height: 100%;
- }
- }
- >view {
- &:last-child {
- flex: 1;
- margin-left: 20upx;
- padding: 10upx 0upx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- }
- .bundle-num {
- display: flex;
- justify-content: space-between;
- }
- }
- .btn-cont {
- width: 180upx;
- height: 60upx;
- float: right;
- // background-color: #2979ff;
- // color: #fff;
- // text-align: center;
- // border-radius: 100upx;
- font-size: 30upx;
- }
- .price-text{
- font-size: 20upx;
- margin-left: 10upx;
- }
- .price-num{
- font-size: 32upx;
- color: red;
- }
- .total-text{
- margin-right: 50upx;
- }
- .money-total{
- margin-right: 10upx;
- }
- }
- }
- // 物流弹窗
- .order-log {
- padding: 20upx ;
- font-size: 28upx;
- >view{
- line-height: 60upx;
- }
- }
- }
- </style>
|