|
@@ -8,7 +8,7 @@
|
|
|
<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
|
<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
|
|
|
- <view class="check-order-list" v-if="index==current" v-for="(item,sindex) in list" :key="item.id+'-'+sindex"
|
|
|
+ <view class="check-order-list" v-if="index==current" v-for="item in list" :key="item.id"
|
|
|
@click="viewRow(item)">
|
|
|
<view class="check-row">
|
|
|
<view class="createDate">{{item.createDate}}</view>
|
|
@@ -31,25 +31,24 @@
|
|
|
<text class="total-text">
|
|
|
共{{item.goodsNum}}件商品
|
|
|
</text>
|
|
|
- <text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><text class="price-num">{{item.originalGold}}</text>
|
|
|
+ <text v-if="item.orderState=='待支付'"><text class="money-total">应付</text><text class="price-num">{{item.originalGold}}</text>
|
|
|
<text class="price-text">乐豆</text></text>
|
|
|
- <text v-else><text class="money-total">实付</text><text class="price-num">{{item.payGold}}</text> <text
|
|
|
- class="price-text">乐豆</text></text>
|
|
|
+ <text v-else><text class="money-total">实付</text><text class="price-num">{{item.payGold}}</text> <text class="price-text">乐豆</text></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="check-row">
|
|
|
- <view v-if="item.orderFlag=='待支付'" class="text-right">
|
|
|
- <text style="margin-right: 30upx;">支付剩余1天45分</text>
|
|
|
- <u-button class="btn-cont" shape="circle" type="error" size="medium">去支付</u-button>
|
|
|
+ <view v-if="item.orderState=='WAIT_PAY'" class="text-right">
|
|
|
+ <text style="margin-right: 30upx;">支付剩余{{filterTime(item.orderTime)}}</text>
|
|
|
+ <u-button class="btn-cont" @click="toPay(item)" shape="circle" type="error" size="medium">去支付</u-button>
|
|
|
</view>
|
|
|
- <view v-if="item.orderFlag=='待发货'" class="text-right">
|
|
|
- <u-button class="btn-cont" shape="circle" size="medium">提醒发货</u-button>
|
|
|
+ <view v-if="item.orderState=='WAIT_SEND'" class="text-right">
|
|
|
+ <u-button class="btn-cont" @click="showTip" shape="circle" size="medium">提醒发货</u-button>
|
|
|
</view>
|
|
|
- <view v-if="item.orderFlag=='已发货'" class="text-right">
|
|
|
+ <view v-if="item.orderState=='SEND_ALL'" class="text-right">
|
|
|
<u-button @click="showLog(item)" class="btn-cont" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
|
|
|
<u-button class="btn-cont" shape="circle" type="primary" size="medium">确认收货</u-button>
|
|
|
</view>
|
|
|
- <view v-if="item.orderFlag=='已完成'" class="text-right">
|
|
|
+ <view v-if="item.orderState=='FINISH'" class="text-right">
|
|
|
<u-button @click="showLog(item)" class="btn-cont" shape="circle" size="medium">查看物流</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -63,6 +62,37 @@
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
|
+ <!-- 提示用户设置支付密码 -->
|
|
|
+ <u-modal v-model="showSetPswModal"
|
|
|
+ content="请先设置支付密码,才能使用乐豆"
|
|
|
+ show-cancel-button
|
|
|
+ confirm-text="去设置"
|
|
|
+ cancel-text="暂时放弃"
|
|
|
+ @confirm="toSetPwd"
|
|
|
+ @cancel="showSetPswModal=false"
|
|
|
+ ></u-modal>
|
|
|
+ <!-- 确认取消弹窗 -->
|
|
|
+ <u-modal v-model="showLeavePsw"
|
|
|
+ title="确认放弃支付吗?"
|
|
|
+ content="您的订单在30分钟内未支付将被取消"
|
|
|
+ show-cancel-button
|
|
|
+ confirm-text="确认放弃"
|
|
|
+ cancel-text="继续支付"
|
|
|
+ @confirm="canclePay"
|
|
|
+ @cancel="payAgain"
|
|
|
+ ></u-modal>
|
|
|
+ <!-- 确认支付弹窗 -->
|
|
|
+ <u-popup mode="center" closeable @close="showLeavePsw=true" v-model="showInputPsw" width="500rpx" >
|
|
|
+ <view class="slot-content">
|
|
|
+ <view>确认支付</view>
|
|
|
+ <view class="text-cont">
|
|
|
+ <text class="num-big">{{totalPrice}}</text>乐豆
|
|
|
+ </view>
|
|
|
+ <view class="footer">
|
|
|
+ <u-input v-model="password" maxlength="30" input-align="center" type="password" placeholder="请输入支付密码" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -72,7 +102,7 @@
|
|
|
listLookUp
|
|
|
} from '@/api/data'
|
|
|
import {
|
|
|
- getOrderList
|
|
|
+ getOrderList, signPay
|
|
|
} from '@/api/order.js'
|
|
|
export default {
|
|
|
components: {},
|
|
@@ -93,7 +123,7 @@
|
|
|
{
|
|
|
dispName: '待发货',
|
|
|
typeId: 3,
|
|
|
- queryLabel: ['WAIT_SEND','SEND_PART'] // tab参数
|
|
|
+ queryLabel: ['WAIT_SEND', 'SEND_PART'] // tab参数
|
|
|
},
|
|
|
{
|
|
|
dispName: '已发货',
|
|
@@ -117,12 +147,16 @@
|
|
|
logNum: 12356544544
|
|
|
},
|
|
|
total: 0,
|
|
|
+ totalPrice: 0, // 支付合计
|
|
|
action: 'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
|
+ showSetPswModal: false, // 设置支付密码弹窗
|
|
|
+ showInputPsw: false, // 打开输入密码弹窗
|
|
|
+ showLeavePsw: false, // 打开确定放弃弹窗
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- // 监听待办处理后刷新
|
|
|
- uni.$on('refreshBl-handle', this.handleRefresh)
|
|
|
+ // 监听设置密码是否成功
|
|
|
+ uni.$once('setPswSuccess', this.setPsw)
|
|
|
this.pageInit()
|
|
|
},
|
|
|
onUnload() {
|
|
@@ -227,37 +261,98 @@
|
|
|
this.searchParams = params
|
|
|
this.getRow(1)
|
|
|
},
|
|
|
- // 查看物流
|
|
|
- showLog(item) {
|
|
|
- console.log(item, '111111')
|
|
|
+ // 支付剩余时间
|
|
|
+ filterTime (time) {
|
|
|
+ let nowT = new Date().valueOf() // 现在时间戳
|
|
|
+ let orderT = new Date(time).valueOf() // 下单时间戳
|
|
|
+ let tt = (1800 * 1000) - (nowT - orderT) // 距离30分钟支付 相差时间戳
|
|
|
+
|
|
|
+ setInterval(()=>{
|
|
|
+ if(tt>0) {
|
|
|
+ tt = tt -1000
|
|
|
+ } else {
|
|
|
+ clearInterval()
|
|
|
+ // this.getRow()
|
|
|
+ }
|
|
|
+ },1000)
|
|
|
+ //计算相差分钟数
|
|
|
+ var leave1 = tt % (3600 * 1000); //计算小时数后剩余的毫秒数
|
|
|
+ var minutes = Math.floor(tt / (60 * 1000));
|
|
|
+ //计算相差秒数
|
|
|
+ var leave3 = leave1 % (60 * 1000); //计算分钟数后剩余的毫秒数
|
|
|
+ var seconds = Math.round(leave3 / 1000);
|
|
|
+
|
|
|
+ console.log(minutes + "天 " + seconds + "小时 ")
|
|
|
+
|
|
|
+ // console.log(new Date(time).valueOf(),dt.valueOf(),'ttttttt')
|
|
|
+ return minutes + "分 " + seconds + "秒"
|
|
|
+ },
|
|
|
+
|
|
|
+ // 跳转到设置支付密码页
|
|
|
+ toSetPwd () {
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/order/LogList?id="
|
|
|
+ url:"/pages/userCenter/userInfo/paymentPwd"
|
|
|
})
|
|
|
},
|
|
|
- // 复制运单编号
|
|
|
- copyLogNum() {
|
|
|
- // H5 不支持
|
|
|
- uni.setClipboardData({
|
|
|
- data: this.logData.logNum,
|
|
|
- success: function(res) {
|
|
|
- uni.getClipboardData({
|
|
|
- success: function(res) {
|
|
|
- uni.showToast({
|
|
|
- title: '已复制到剪贴板'
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ // 设置密码成功, 打开输入密码弹窗
|
|
|
+ setPsw (e) {
|
|
|
+ if (e.success) {
|
|
|
+ this.showInputPsw = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //确认放弃
|
|
|
+ canclePay() {
|
|
|
+ this.showLeavePsw = false
|
|
|
+ this.showInputPsw = false
|
|
|
+ },
|
|
|
+ // 继续支付
|
|
|
+ payAgain () {
|
|
|
+ this.showLeavePsw = false
|
|
|
+ this.showInputPsw = true
|
|
|
+ },
|
|
|
+ // 支付
|
|
|
+ toPay(item) {
|
|
|
+ // this.totalPrice = item.payGold
|
|
|
+ // this.showSetPswModal = true
|
|
|
+ // return
|
|
|
+ signPay({id:item.id}).then(res=>{
|
|
|
+ this.btnLoading = false
|
|
|
+ if(res.status == 200) {
|
|
|
+ // 跳转到支付完成界面
|
|
|
+ uni.navigateTo({
|
|
|
+ url:"/pages/toOrder/payFinish?id=" + this.orderId
|
|
|
+ })
|
|
|
+ } else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 提醒发货
|
|
|
+ showTip() {
|
|
|
+ uni.showToast({
|
|
|
+ title: '已提醒商家发货',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看物流
|
|
|
+ showLog(item) {
|
|
|
+ console.log(item, '111111')
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/order/LogList?id=" + item.id
|
|
|
+ })
|
|
|
+ },
|
|
|
// 详细页
|
|
|
viewRow(item) {
|
|
|
// if (!this.$hasPermissions('M_backlog_detail_mobile')) {
|
|
|
// return
|
|
|
// }
|
|
|
+ console.log(item, '111111')
|
|
|
// 已完成的
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/order/orderDetail?id="
|
|
|
+ url: "/pages/order/orderDetail?id=" + item.id
|
|
|
})
|
|
|
},
|
|
|
}
|