|
@@ -12,19 +12,27 @@
|
|
|
<view class="main">
|
|
|
<view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
|
|
|
<view class="itemTop">
|
|
|
- <view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>
|
|
|
- <view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>
|
|
|
- <view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>
|
|
|
- <view class="itemType" v-if="item.SheetType==4">救援订单</view>
|
|
|
- <view class="itemType" v-if="item.SheetType==5">钣喷订单</view>
|
|
|
- <view class="itemType" v-if="item.SheetType==6">集客订单</view>
|
|
|
- <view class="itemType" v-else></view>
|
|
|
+ <view class="orderCodeBox">
|
|
|
+ <view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==4">救援订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==5">钣喷订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==6">集客订单</view>
|
|
|
+ <view class="itemType" v-if="item.SheetType==7">保养订单</view>
|
|
|
+ <view class="itemType" v-else></view>
|
|
|
+ <view class="orderCode">:{{item.Code}}</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="itemSheetState redColor" v-if="item.SheetState==5">待成团</view>
|
|
|
<view class="itemSheetState redColor" v-if="item.SheetState==1">待付款</view>
|
|
|
- <view class="itemSheetState orangeColor" v-if="item.SheetState==2">待服务</view>
|
|
|
+ <view v-if="item.SheetType==7">
|
|
|
+ <view class="itemSheetState orangeColor" v-if="item.SheetState==2">已完成</view>
|
|
|
+ </view>
|
|
|
+ <view class="itemSheetState orangeColor" v-if="item.SheetState==2&&item.SheetType!=7">待服务</view>
|
|
|
<view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>
|
|
|
<view class="itemSheetState" v-if="item.SheetState==4">已取消</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
<view class="itemShopBg">
|
|
|
<view class="shopName">{{item.SheetContent}}</view>
|
|
@@ -37,7 +45,10 @@
|
|
|
</view>
|
|
|
<view class="itemName">{{item.CreateTime}}</view>
|
|
|
<view class="itemName" style="padding-top: 2rpx;padding-bottom: 0;">{{item.ShopName}}</view>
|
|
|
-
|
|
|
+ <view class="bottom" v-if="item.SheetState == 1">
|
|
|
+ <view class="cancel" @click.stop="cancelBespeak(item)">取消订单</view>
|
|
|
+ <view class="defer" @click.stop="pay(item)">立即支付</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<nodata v-show="items==''&&isload"></nodata>
|
|
@@ -106,6 +117,100 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ pay(item){
|
|
|
+ this.$http('openMallOrder/unifiedPay', {
|
|
|
+ sheetId:item.ID
|
|
|
+ },'POST').then(res => {
|
|
|
+
|
|
|
+ if(res.code==0){
|
|
|
+
|
|
|
+ this.requestPayment(res.data)
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ requestPayment(res){
|
|
|
+ var payInfo=res;
|
|
|
+ //console.log(payInfo)
|
|
|
+ //console.log(String(Date.now()))
|
|
|
+ var that=this;
|
|
|
+ uni.requestPayment({
|
|
|
+ provider: 'wxpay',
|
|
|
+ //timeStamp: String(Date.now()),
|
|
|
+ timeStamp: payInfo.timeStamp,
|
|
|
+ nonceStr: payInfo.nonceStr,
|
|
|
+ package:payInfo.package,
|
|
|
+ signType: payInfo.signType,
|
|
|
+ paySign: payInfo.paySign,
|
|
|
+ appid:payInfo.appId,
|
|
|
+
|
|
|
+ success: function (res) {
|
|
|
+ console.log('success:' + JSON.stringify(res));
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功',
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ that.tabIndex=0
|
|
|
+ that.page = 1;
|
|
|
+ that.getData()
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ console.log(err)
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付失败',
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelBespeak(item){
|
|
|
+ var that = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否取消该订单',
|
|
|
+ cancelText:'否',
|
|
|
+ confirmText:'是',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+
|
|
|
+ that.$http('openOrderManagement/updateSheetState', {
|
|
|
+
|
|
|
+ id: item.ID,
|
|
|
+
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ // var list = res.data.Items
|
|
|
+
|
|
|
+ uni.showToast({
|
|
|
+ title: '取消成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(function() {
|
|
|
+ that.page = 1;
|
|
|
+ that.getData();
|
|
|
+ }, 100);
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ } else if (res.cancel) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
decryptPhoneNumber: function(e) {
|
|
|
console.log(e);
|
|
|
this.code=e.detail.code
|
|
@@ -456,4 +561,37 @@
|
|
|
|
|
|
height: 100%;
|
|
|
}
|
|
|
+ .orderCodeBox{
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .orderCode{
|
|
|
+ color: #999999; font-size: 24rpx;
|
|
|
+ }
|
|
|
+ .cancel {
|
|
|
+ color: #3C3C3C;
|
|
|
+ font-size: 24rpx;
|
|
|
+ width: 120rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ border: 1rpx solid #DDDDDD;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40rpx;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .defer {
|
|
|
+ color: #EC0F0A;
|
|
|
+ font-size: 24rpx;
|
|
|
+ width: 120rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ border: 1rpx solid #EC0F0A;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+ .bottom{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
</style>
|