瀏覽代碼

碎屏险、会员购

宇宙无敌M1处理器的MacBook Pro 4 年之前
父節點
當前提交
f53781e3fb
共有 3 個文件被更改,包括 520 次插入472 次删除
  1. 126 120
      components/page-component/app-attr/app-attr.vue
  2. 389 347
      plugins/community/components/app-order.vue
  3. 5 5
      plugins/composition/detail/detail.vue

+ 126 - 120
components/page-component/app-attr/app-attr.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -52,7 +52,8 @@
 										@click="chooseAttr(index,attr)">{{attr.attr_name}}
 										<view class="attr-number" :style="{'right':`${attr.length + 'rpx'}`}"
 											:class="theme + '-m-back ' + theme" v-if="index == 0 && attr.number > 0">
-											{{attr.number}}</view>
+											{{attr.number}}
+										</view>
 									</view>
 									<view class="attr-name attr-background" style="visibility: hidden">占位
 									</view>
@@ -68,7 +69,8 @@
 										<view class="wholesale-attr-item main-between">
 											<view class="dir-top-nowrap main-center attr-name t-omit">
 												<view class="t-omit">
-													{{item.attr_list[item.attr_list.length - 1].attr_name}}</view>
+													{{item.attr_list[item.attr_list.length - 1].attr_name}}
+												</view>
 												<view class="attr-price">
 													¥{{goods.level_show === 1 ? item.price_member : item.price}}</view>
 											</view>
@@ -117,32 +119,32 @@
 							</view>
 							<image src="/static/image/cart/can-be-added.png"
 								class="block box-grow-0 cross-center main-center" @click="numberAdd"></image>
-						</view>
-						<view class="service"
-							v-if="service_screen&&service_screen.screenList&&service_screen.screenList.length>0">
-							<view class="service_title">全优汇服务</view>
-							<view class="service_item" style="align-items: center;">
-								<image style="width: 26upx;height:26upx;"
-									src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
-						
-								<view style="flex: 1;">
-									<view style="float: left;">碎屏险</view>
-									<view class="slh">{{screenDescription}}</view>
-								</view>
-						
-								<view style="color: red;" @click="gotoSpDetail">服务说明
-									<image style="width: 26upx;height:26upx;"
-										src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
-								</view>
-								<!-- 	<view>{{service_screen.screenList.intro}}</view> -->
-							</view>
-							<view class="service_value">
-								<view class="service_block" v-for="(item,index) of service_screen.screenList"
-									:key="index" :class="{service_block_active:index == serviceId}"
-									@click="select_service(index)">
-									{{item.name}} ¥{{item.price}}
-								</view>
-							</view>
+						</view>
+						<view class="service"
+							v-if="service_screen&&service_screen.screenList&&service_screen.screenList.length>0">
+							<view class="service_title">全优汇服务</view>
+							<view class="service_item" style="align-items: center;">
+								<image style="width: 26upx;height:26upx;"
+									src="https://t12.9026.com/web/statics/icon1/sp.png"> </image>
+
+								<view style="flex: 1;">
+									<view style="float: left;">碎屏险</view>
+									<view class="slh">{{screenDescription}}</view>
+								</view>
+
+								<view style="color: red;" @click="gotoSpDetail">服务说明
+									<image style="width: 26upx;height:26upx;"
+										src="https://t12.9026.com/web/statics/icon1/问号.png"> </image>
+								</view>
+								<!-- 	<view>{{service_screen.screenList.intro}}</view> -->
+							</view>
+							<view class="service_value">
+								<view class="service_block" v-for="(item,index) of service_screen.screenList"
+									:key="index" :class="{service_block_active:index == serviceId}"
+									@click="select_service(index)">
+									{{item.name}} ¥{{item.price}}
+								</view>
+							</view>
 						</view>
 					</view>
 					<view v-if="sign =='wholesale'" class="total">已选<text>{{totalNumber}}</text>件
@@ -264,11 +266,11 @@
 				pic_url: null,
 				// 商品批发
 				activeAttr: [],
-				goodsAttr: [],
-				service_screen: null, //碎屏险
-				service_label: null, //当前对屏对象
-				serviceId: null, //碎屏险ID
-				card_id: null,
+				goodsAttr: [],
+				service_screen: null, //碎屏险
+				service_label: null, //当前对屏对象
+				serviceId: null, //碎屏险ID
+				card_id: null,
 				screenDescription: '',
 			};
 		},
@@ -277,11 +279,11 @@
 				if (this.display === 'block') {
 					this.selectAttr = null;
 					this.close();
-				} else if (this.display === 'none') {
-					this.serviceId = null
-					this.screenDescription = ""
-					this.service_label = null
-					this.card_id = null
+				} else if (this.display === 'none') {
+					this.serviceId = null
+					this.screenDescription = ""
+					this.service_label = null
+					this.card_id = null
 					this.service_screen = null
 					this.alert();
 				}
@@ -349,22 +351,22 @@
 				}
 			}
 		},
-		methods: {
-			select_service(index) {
-				if (this.serviceId == index) {
-					this.serviceId = null
-					this.screenDescription = ""
-					this.service_label = null
-					this.card_id = null
-				} else {
-					this.serviceId = index
-					this.screenDescription = this.service_screen.screenList[index]['description'] || ''
-					this.service_label = this.service_screen.screenList[index]
-					this.card_id = this.service_screen.screenList['card_id']
-				}
+		methods: {
+			select_service(index) {
+				if (this.serviceId == index) {
+					this.serviceId = null
+					this.screenDescription = ""
+					this.service_label = null
+					this.card_id = null
+				} else {
+					this.serviceId = index
+					this.screenDescription = this.service_screen.screenList[index]['description'] || ''
+					this.service_label = this.service_screen.screenList[index]
+					this.card_id = this.service_screen.screenList['card_id']
+				}
 			},
-			alert() {
-				
+			alert() {
+
 				if (this.attrGroupList.length === 0) {
 					return;
 				}
@@ -402,17 +404,17 @@
 					} else {
 						this.selectAttr = select_attr;
 					}
-				}
+				}
 				// this.getservice()
 				this.display = 'block';
-			},
-			gotoSpDetail() {
-				uni.navigateTo({
-					url: "/pages/goods/spDetail"
-				})
 			},
-			getservice(select_val) {
-				if(select_val.length<=1) return false
+			gotoSpDetail() {
+				uni.navigateTo({
+					url: "/pages/goods/spDetail"
+				})
+			},
+			getservice(select_val) {
+				if (select_val.length <= 1) return false
 				this.goods.attr.forEach((item, index) => {
 					let select_item_list = []
 					let select_item_value = ''
@@ -513,7 +515,7 @@
 				this.$emit('close', false)
 			},
 			preventD() {},
-			storeAttrClick(attr_id, attr_group_id) {
+			storeAttrClick(attr_id, attr_group_id) {
 				let select_num = []
 				let attr_group_list = JSON.parse(JSON.stringify(this.newAttrGroupList));
 				let attrs = this.goods.attr;
@@ -543,7 +545,7 @@
 							checkedAttr.push(attr_group_list[i].attr_group_id + '-' + temp.attr_id);
 						}
 					}
-				}
+				}
 				this.getservice(checkedAttr)
 
 				function inArray(val, arr) {
@@ -807,7 +809,7 @@
 				}
 				if (this.buyClick) {
 					this.display = 'none';
-					this.selectAttr.number = this.number;
+					this.selectAttr.number = this.number;
 					this.selectAttr.service_label = this.service_label
 					this.$emit('buyClick', this.selectAttr);
 					return false;
@@ -873,9 +875,11 @@
 							attr: attr,
 							num: number,
 							cat_id: 0,
-							goods_attr_id: goods_attr_id
+							goods_attr_id: goods_attr_id,
+							service_label: this.service_label
 						}]
 					}];
+					console.log(mch_list, "*******///////////")
 					let url = `/pages/order-submit/order-submit?mch_list=${JSON.stringify(mch_list)}`;
 					if (this.submitUrl && this.previewUrl) {
 						url +=
@@ -1127,7 +1131,7 @@
 
 				.number-box {
 					color: $uni-general-color-one;
-					height: #{124rpx};
+					height: #{100rpx};
 
 					.block {
 						width: #{60rpx};
@@ -1312,59 +1316,61 @@
 		left: 0;
 		width: 100%;
 		background-color: #ffffff;
-	}
-	.service{
-		margin-bottom: 20rpx;
-	}
-	.service_title {
-		padding-top: 10px;
-		margin: 14px 10px 10px;
-		font-weight: 700;
-		font-size: 13px;
-	}
-	
-	.service_item {
-		margin: 14px 0px 0px;
-		font-size: 26rpx;
-		color: #666;
-		display: flex;
-		justify-content: space-between;
-	}
-	
-	.service_value {
-		display: flex;
-		flex-wrap: wrap;
-		padding: 0px 10px;
-	}
-	
-	.service_block {
-		min-width: 46%;
-		height: 28px;
-		line-height: 26px;
-		border: 1px solid #f5f5f5;
-		border-radius: 16px;
-		text-align: center;
-		margin-right: 10px;
-		margin-top: 10px;
-		font-size: 12px;
-		background-color: #f5f5f5;
-		position: relative;
-	}
-	
-	.service_block_active {
-		color: #f21c1c;
-		border: 1px solid #f21c1c;
-	}
-	
-	.slh {
-		margin-left: 5upx;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		width: 460upx;
-		white-space: nowrap;
-		float: left;
-		/* 	  display: -webkit-box;
-		  -webkit-line-clamp: 1;
-		  -webkit-box-orient: vertical; */
+	}
+
+	.service {
+		margin-bottom: 20rpx;
+	}
+
+	.service_title {
+		padding-top: 10px;
+		// margin: 14px 10px 10px;
+		font-weight: 700;
+		font-size: 13px;
+	}
+
+	.service_item {
+		margin: 14px 0px 0px;
+		font-size: 26rpx;
+		color: #666;
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.service_value {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0px 10px;
+	}
+
+	.service_block {
+		min-width: 46%;
+		height: 28px;
+		line-height: 26px;
+		border: 1px solid #f5f5f5;
+		border-radius: 16px;
+		text-align: center;
+		margin-right: 10px;
+		margin-top: 10px;
+		font-size: 12px;
+		background-color: #f5f5f5;
+		position: relative;
+	}
+
+	.service_block_active {
+		color: #f21c1c;
+		border: 1px solid #f21c1c;
+	}
+
+	.slh {
+		margin-left: 5upx;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		width: 460upx;
+		white-space: nowrap;
+		float: left;
+		/* 	  display: -webkit-box;
+		  -webkit-line-clamp: 1;
+		  -webkit-box-orient: vertical; */
 	}
 </style>

+ 389 - 347
plugins/community/components/app-order.vue

xqd
@@ -1,347 +1,389 @@
-<template>
-    <view>
-        <view @click="toDetail(item.id)" class="item">
-            <view class="title main-between cross-center">
-                <view class="activity-title dir-left-nowrap">
-                    <image src="./../image/activity-name.png"></image>
-                    <view>{{item.title}}</view>
-                </view>
-                <view class="number dir-right-nowrap">
-                    <view :class="theme + '-m-text ' + theme">{{item.no}}</view>
-                    <view v-if="is_user && item.cancel_status == 1" class="status">已关闭</view>
-                    <view v-else-if="is_user && item.is_sale == 1" class="status">已完成</view>
-                    <view v-else-if="is_user && item.is_confirm == 1" class="status">已提货</view>
-                    <view v-else-if="is_user && item.is_send == 1" class="status">待提货</view>
-                    <view v-else-if="is_user && item.is_pay == 1" class="status">待发货</view>
-                    <view v-else-if="is_user && item.is_pay == 0" class="status">未付款</view>
-                </view>
-            </view>
-            <view v-if="!is_user" class="info main-between cross-center">
-                <view class="user-info dir-left-nowrap cross-center">
-                    <view class="avatar">
-                        <image :src="item.user_avatar"></image>
-                    </view>
-                    <view class="user">
-                        {{item.name}}
-                        <text>{{item.mobile}}</text>
-                    </view>
-                </view>
-                <view :class="theme + '-m-text ' + theme" v-if="item.cancel_status == 1" class="status">已关闭</view>
-                <view :class="theme + '-m-text ' + theme" v-else-if="item.is_sale == 1" class="status">已完成</view>
-                <view :class="theme + '-m-text ' + theme" v-else-if="item.is_confirm == 1" class="status">已提货</view>
-                <view :class="theme + '-m-text ' + theme" v-else-if="item.is_send == 1" class="status">待提货</view>
-                <view :class="theme + '-m-text ' + theme" v-else-if="item.is_pay == 1" class="status">待发货</view>
-                <view :class="theme + '-m-text ' + theme" v-else-if="item.is_pay == 0" class="status">未付款</view>
-            </view>
-            <view v-if="item.remark" class="remark">买家备注:{{item.remark}}</view>
-            <view v-for="goods in item.detail" class="goods" :key="goods.id">
-                <image class="goods-img" mode='aspectFill' :src='goods.goods_info.pic_url'></image>
-                <view class='t-omit-two goods-name'>{{goods.goods_info.name}}</view>
-                <view class="goods-attr t-omit">
-                    <text v-for="attr in goods.goods_info.attr_list" :key="item.attr_id">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
-                </view>
-                <view class="goods-num">x{{goods.goods_info.num}}</view>
-                <view class="goods-price">¥{{goods.goods_info.total_original_price}}</view>
-            </view>
-            <view class="order-total">共<text>{{item.num}}</text>件商品 合计<text>¥{{item.total_price}}</text></view>
-            <view class="dir-right-nowrap">
-                <view @click.stop="orderPay(item)" v-if="is_user && item.is_pay == 0 && item.cancel_status == 0" class="pick-btn" :class="theme + '-m-text ' + theme + ' ' +theme + '-m-border ' + theme">立即支付</view>
-                <view @click.stop="toRemind(item)" v-if="item.is_send == 1 && item.is_confirm == 0" class="pick-btn" :class="theme + '-m-text ' + theme + ' ' +theme + '-m-border ' + theme">确认提货</view>
-            </view>
-        </view>
-        <view v-if="show" class="bg">
-            <view class="dialog">
-                <view class="dialog-content">是否确认提货</view>
-                <view class="main-center btn-area">
-                    <view class="submit-btn box-grow-1" style="color: #666" @click='toRemind'>取消</view>
-                    <view class="line"></view>
-                    <view class="submit-btn box-grow-1" @click='beConfirm'  :class="theme + '-m-text ' + theme">确认</view>
-                </view>
-            </view>
-        </view>
-    </view>
-</template>
-
-<script>
-    import { mapState } from "vuex";
-
-    export default {
-        name: 'app-order',
-        props: {
-            item: {
-                type: Object
-            },
-            is_user: {
-                type: Boolean
-            },
-            is_confirm: {
-                type: Boolean
-            },
-            theme: String
-        },
-        data() {
-            return {
-                show: false,
-                orderList: [],
-                id: 0,
-            };
-        },
-        methods: {
-            toRemind(item) {
-                if(item.id > 0) {
-                    this.show = true;
-                    this.id = item.id
-                }else {
-                    this.show = false;
-                    this.id = 0;
-                }
-            },
-            // 订单支付
-            orderPay(e) {
-                let _this = this;
-                _this.$showLoading();
-                _this.$request({
-                    url: _this.$api.order.list_pay_data,
-                    data: {
-                        id: e.id
-                    }
-                }).then(response => {
-                    _this.$hideLoading();
-                    if (response.code === 0) {
-                        _this.$payment.pay(response.data.id).then(() => {
-                            // 支付成功
-                            uni.redirectTo({
-                                url: '/plugins/community/order/order?is_user=1'
-                            })
-                        }).catch(e => {
-                            // 支付失败
-                            uni.showModal({
-                                title: '',
-                                content: e.errMsg,
-                                showCancel: false
-                            })
-                        })
-                    }
-                }).catch(() => {
-                    _this.$hideLoading();
-                });
-            },
-            toDetail(id) {
-                let is_user = 0;
-                if(this.is_user) {
-                    is_user = 1
-                }
-                uni.navigateTo({
-                    url: '/plugins/community/order-detail/order-detail?id=' + id + '&is_user=' + is_user
-                });
-            },
-            beConfirm() {
-                let that = this;
-                that.show = false;
-                uni.showLoading({
-                    title: '确认提货中...'
-                });
-                that.$request({
-                    url: that.is_user ? that.$api.order.confirm : that.$api.community.confirm,
-                    data: {
-                        id: that.id
-                    }
-                }).then(response=>{
-                    uni.hideLoading();
-                    if(response.code == 0) {
-                        that.item.is_confirm = 1;
-                        that.id = 0;
-                        that.$emit('update', that.item);
-                    }else {
-                        uni.showToast({
-                            title: response.msg,
-                            icon: 'none',
-                            duration: 1000
-                        });
-                    }
-                })
-            }
-        }
-    }
-</script>
-
-<style scoped lang="scss">
-        .item {
-            border-radius: 16rpx;
-            background-color: #fff;
-            width: 702rpx;
-            margin: 24rpx;
-            margin-top: 0;
-            padding: 24rpx;
-            &:first-of-type {
-                margin-top: 24rpx;
-            }
-            .status {
-                font-size: 24rpx;
-            }
-            .title {
-                height: 32rpx;
-                line-height: 32rpx;
-                margin-bottom: 24rpx;
-                .number {
-                    font-size: 38rpx;
-                    .status {
-                        margin-right: 30rpx;
-                    }
-                }
-                .activity-title {
-                    color: #353535;
-                    font-size: #{24rpx};
-                    height: 30rpx;
-                    line-height: 30rpx;
-                    image {
-                        width: 30rpx;
-                        height: 30rpx;
-                        margin-right: 20rpx;
-                        display: block;
-                    }
-                }
-            }
-            .info {
-                height: 56rpx;
-                font-size: 24rpx;
-                .user-info {
-                    height: 56rpx;
-                    .avatar {
-                        margin-right: 20rpx;
-                        width: 56rpx;
-                        height: 56rpx;
-                        border-radius: 50%;
-                        image {
-                            width: 56rpx;
-                            height: 56rpx;
-                            border-radius: 50%;
-                        }
-                    }
-                    .user {
-                        color: #353535;
-                        text {
-                            margin-left: 30rpx;
-                        }
-                    }
-                }
-            }
-            .remark {
-                margin-top: 25rpx;
-                word-break: break-all;
-                font-size: 24rpx;
-                color: #3b3939;
-                padding: 20rpx 24rpx;
-                background-color: #F7F7F7;
-            }
-            .goods {
-                height: #{160rpx};
-                margin-top: #{24rpx};
-                position: relative;
-                font-size: #{24rpx};
-                color: #353535;
-                margin-bottom: #{24rpx};
-                .goods-img {
-                    height: #{160rpx};
-                    width: #{160rpx};
-                    float: left;
-                    margin-right: #{20rpx};
-                    border-radius: #{4rpx};
-                }
-                .goods-attr {
-                    font-size: #{24rpx};
-                    color: #999;
-                    width: 70%;
-                    position: absolute;
-                    width: 70%;
-                    top: #{78rpx};
-                    left: #{180rpx};
-                    text {
-                        margin-right: #{20rpx};
-                    }
-                }
-                .goods-num {
-                    font-size: #{24rpx};
-                    color: #999;
-                    position: absolute;
-                    top: #{126rpx};
-                    left: #{180rpx};
-                }
-                .goods-price {
-                    font-size: #{24rpx};
-                    color: #353535;
-                    position: absolute;
-                    bottom: 0;
-                    right: 0;
-                }
-            }
-            .order-total {
-                text-align: right;
-                color: #999999;
-                font-size: 24rpx;
-                margin-bottom: 24rpx;
-                text {
-                    font-size: 28rpx;
-                    color: #353535;
-                }
-            }
-            .pick-btn {
-                height: 48rpx;
-                line-height: 46rpx;
-                border-radius: 24rpx;
-                border: 2rpx solid;
-                font-size: 24rpx;
-                display: inline-block;
-                padding: 0 20rpx;
-                margin-left: 20rpx;
-            }
-        }
-        .bg {
-            position: fixed;
-            background-color: rgba(0,0,0,.3);
-            top: 0;
-            left: 0;
-            height: 100%;
-            width: 100%;
-            z-index: 99;
-            .dialog {
-                width: 480rpx;
-                height: 200rpx;
-                position: fixed;
-                top: 30%;
-                left: 50%;
-                margin-left: -240rpx;
-                background-color: #fff;
-                border-radius: 16rpx;
-                z-index: 233;
-                font-size: 28rpx;
-                color: #353535;
-                .dialog-content {
-                    height: 110rpx;
-                    line-height: 110rpx;
-                    text-align: center;
-                }
-                .btn-area {
-                    height: #{88rpx};
-                    position: relative;
-                    border-top: #{2rpx} solid #e2e2e2;
-                    .line {
-                        height: #{32rpx};
-                        width: #{1rpx};
-                        background-color: #e2e2e2;
-                        position: absolute;
-                        top: #{28rpx};
-                        left: 0;
-                        right: 0;
-                        margin: 0 auto;
-                    }
-                    .submit-btn {
-                        height: #{88rpx};
-                        line-height: #{88rpx};
-                        font-size: #{28rpx};
-                        text-align: center;
-                    }
-                }
-            }
-        }
-</style>
+<template>
+	<view>
+		<view @click="toDetail(item.id)" class="item">
+			<view class="title main-between cross-center">
+				<view class="activity-title dir-left-nowrap">
+					<image src="./../image/activity-name.png"></image>
+					<view>{{item.title}}</view>
+				</view>
+				<view class="number dir-right-nowrap">
+					<view :class="theme + '-m-text ' + theme">{{item.no}}</view>
+					<view v-if="is_user && item.cancel_status == 1" class="status">已关闭</view>
+					<view v-else-if="is_user && item.is_sale == 1" class="status">已完成</view>
+					<view v-else-if="is_user && item.is_confirm == 1" class="status">已提货</view>
+					<view v-else-if="is_user && item.is_send == 1" class="status">待提货</view>
+					<view v-else-if="is_user && item.is_pay == 1" class="status">待发货</view>
+					<view v-else-if="is_user && item.is_pay == 0" class="status">未付款</view>
+				</view>
+			</view>
+			<view v-if="!is_user" class="info main-between cross-center">
+				<view class="user-info dir-left-nowrap cross-center">
+					<view class="avatar">
+						<image :src="item.user_avatar"></image>
+					</view>
+					<view class="user">
+						{{item.name}}
+						<text>{{item.mobile}}</text>
+					</view>
+				</view>
+				<view :class="theme + '-m-text ' + theme" v-if="item.cancel_status == 1" class="status">已关闭</view>
+				<view :class="theme + '-m-text ' + theme" v-else-if="item.is_sale == 1" class="status">已完成</view>
+				<view :class="theme + '-m-text ' + theme" v-else-if="item.is_confirm == 1" class="status">已提货</view>
+				<view :class="theme + '-m-text ' + theme" v-else-if="item.is_send == 1" class="status">待提货</view>
+				<view :class="theme + '-m-text ' + theme" v-else-if="item.is_pay == 1" class="status">待发货</view>
+				<view :class="theme + '-m-text ' + theme" v-else-if="item.is_pay == 0" class="status">未付款</view>
+			</view>
+			<view v-if="item.remark" class="remark">买家备注:{{item.remark}}</view>
+			<view v-for="goods in item.detail" class="goods" :key="goods.id">
+				<image class="goods-img" mode='aspectFill' :src='goods.goods_info.pic_url'></image>
+				<view class='t-omit-two goods-name'>{{goods.goods_info.name}}</view>
+				<view class="goods-attr t-omit">
+					<text v-for="attr in goods.goods_info.attr_list"
+						:key="item.attr_id">{{attr.attr_group_name}}:{{attr.attr_name}}</text>
+				</view>
+				<view class="goods-num">x{{goods.goods_info.num}}</view>
+				<view class="goods-price">¥{{goods.goods_info.total_original_price}}</view>
+				<view class="" style="display: flex; align-items: center;justify-content: space-between;">
+					<view class="goods-num" style="position: static;">
+						碎屏险 x1
+					</view>
+					<view class="goods-price" style="position: static;">
+						¥{{goods.service_price}}
+					</view>
+				</view>
+			</view>
+			<view class="order-total">共<text>{{item.num}}</text>件商品 合计<text>¥{{item.total_price}}</text></view>
+			<view class="dir-right-nowrap">
+				<view @click.stop="orderPay(item)" v-if="is_user && item.is_pay == 0 && item.cancel_status == 0"
+					class="pick-btn" :class="theme + '-m-text ' + theme + ' ' +theme + '-m-border ' + theme">立即支付</view>
+				<view @click.stop="toRemind(item)" v-if="item.is_send == 1 && item.is_confirm == 0" class="pick-btn"
+					:class="theme + '-m-text ' + theme + ' ' +theme + '-m-border ' + theme">确认提货</view>
+			</view>
+		</view>
+		<view v-if="show" class="bg">
+			<view class="dialog">
+				<view class="dialog-content">是否确认提货</view>
+				<view class="main-center btn-area">
+					<view class="submit-btn box-grow-1" style="color: #666" @click='toRemind'>取消</view>
+					<view class="line"></view>
+					<view class="submit-btn box-grow-1" @click='beConfirm' :class="theme + '-m-text ' + theme">确认</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from "vuex";
+
+	export default {
+		name: 'app-order',
+		props: {
+			item: {
+				type: Object
+			},
+			is_user: {
+				type: Boolean
+			},
+			is_confirm: {
+				type: Boolean
+			},
+			theme: String
+		},
+		data() {
+			return {
+				show: false,
+				orderList: [],
+				id: 0,
+			};
+		},
+		methods: {
+			toRemind(item) {
+				if (item.id > 0) {
+					this.show = true;
+					this.id = item.id
+				} else {
+					this.show = false;
+					this.id = 0;
+				}
+			},
+			// 订单支付
+			orderPay(e) {
+				let _this = this;
+				_this.$showLoading();
+				_this.$request({
+					url: _this.$api.order.list_pay_data,
+					data: {
+						id: e.id
+					}
+				}).then(response => {
+					_this.$hideLoading();
+					if (response.code === 0) {
+						_this.$payment.pay(response.data.id).then(() => {
+							// 支付成功
+							uni.redirectTo({
+								url: '/plugins/community/order/order?is_user=1'
+							})
+						}).catch(e => {
+							// 支付失败
+							uni.showModal({
+								title: '',
+								content: e.errMsg,
+								showCancel: false
+							})
+						})
+					}
+				}).catch(() => {
+					_this.$hideLoading();
+				});
+			},
+			toDetail(id) {
+				let is_user = 0;
+				if (this.is_user) {
+					is_user = 1
+				}
+				uni.navigateTo({
+					url: '/plugins/community/order-detail/order-detail?id=' + id + '&is_user=' + is_user
+				});
+			},
+			beConfirm() {
+				let that = this;
+				that.show = false;
+				uni.showLoading({
+					title: '确认提货中...'
+				});
+				that.$request({
+					url: that.is_user ? that.$api.order.confirm : that.$api.community.confirm,
+					data: {
+						id: that.id
+					}
+				}).then(response => {
+					uni.hideLoading();
+					if (response.code == 0) {
+						that.item.is_confirm = 1;
+						that.id = 0;
+						that.$emit('update', that.item);
+					} else {
+						uni.showToast({
+							title: response.msg,
+							icon: 'none',
+							duration: 1000
+						});
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.item {
+		border-radius: 16rpx;
+		background-color: #fff;
+		width: 702rpx;
+		margin: 24rpx;
+		margin-top: 0;
+		padding: 24rpx;
+
+		&:first-of-type {
+			margin-top: 24rpx;
+		}
+
+		.status {
+			font-size: 24rpx;
+		}
+
+		.title {
+			height: 32rpx;
+			line-height: 32rpx;
+			margin-bottom: 24rpx;
+
+			.number {
+				font-size: 38rpx;
+
+				.status {
+					margin-right: 30rpx;
+				}
+			}
+
+			.activity-title {
+				color: #353535;
+				font-size: #{24rpx};
+				height: 30rpx;
+				line-height: 30rpx;
+
+				image {
+					width: 30rpx;
+					height: 30rpx;
+					margin-right: 20rpx;
+					display: block;
+				}
+			}
+		}
+
+		.info {
+			height: 56rpx;
+			font-size: 24rpx;
+
+			.user-info {
+				height: 56rpx;
+
+				.avatar {
+					margin-right: 20rpx;
+					width: 56rpx;
+					height: 56rpx;
+					border-radius: 50%;
+
+					image {
+						width: 56rpx;
+						height: 56rpx;
+						border-radius: 50%;
+					}
+				}
+
+				.user {
+					color: #353535;
+
+					text {
+						margin-left: 30rpx;
+					}
+				}
+			}
+		}
+
+		.remark {
+			margin-top: 25rpx;
+			word-break: break-all;
+			font-size: 24rpx;
+			color: #3b3939;
+			padding: 20rpx 24rpx;
+			background-color: #F7F7F7;
+		}
+
+		.goods {
+			height: #{160rpx};
+			margin-top: #{24rpx};
+			position: relative;
+			font-size: #{24rpx};
+			color: #353535;
+			margin-bottom: #{24rpx};
+
+			.goods-img {
+				height: #{160rpx};
+				width: #{160rpx};
+				float: left;
+				margin-right: #{20rpx};
+				border-radius: #{4rpx};
+			}
+
+			.goods-attr {
+				font-size: #{24rpx};
+				color: #999;
+				width: 70%;
+				position: absolute;
+				width: 70%;
+				top: #{78rpx};
+				left: #{180rpx};
+
+				text {
+					margin-right: #{20rpx};
+				}
+			}
+
+			.goods-num {
+				font-size: #{24rpx};
+				color: #999;
+				position: absolute;
+				top: #{126rpx};
+				left: #{180rpx};
+			}
+
+			.goods-price {
+				font-size: #{24rpx};
+				color: #353535;
+				position: absolute;
+				bottom: 0;
+				right: 0;
+			}
+		}
+
+		.order-total {
+			text-align: right;
+			color: #999999;
+			font-size: 24rpx;
+			margin-bottom: 24rpx;
+
+			text {
+				font-size: 28rpx;
+				color: #353535;
+			}
+		}
+
+		.pick-btn {
+			height: 48rpx;
+			line-height: 46rpx;
+			border-radius: 24rpx;
+			border: 2rpx solid;
+			font-size: 24rpx;
+			display: inline-block;
+			padding: 0 20rpx;
+			margin-left: 20rpx;
+		}
+	}
+
+	.bg {
+		position: fixed;
+		background-color: rgba(0, 0, 0, .3);
+		top: 0;
+		left: 0;
+		height: 100%;
+		width: 100%;
+		z-index: 99;
+
+		.dialog {
+			width: 480rpx;
+			height: 200rpx;
+			position: fixed;
+			top: 30%;
+			left: 50%;
+			margin-left: -240rpx;
+			background-color: #fff;
+			border-radius: 16rpx;
+			z-index: 233;
+			font-size: 28rpx;
+			color: #353535;
+
+			.dialog-content {
+				height: 110rpx;
+				line-height: 110rpx;
+				text-align: center;
+			}
+
+			.btn-area {
+				height: #{88rpx};
+				position: relative;
+				border-top: #{2rpx} solid #e2e2e2;
+
+				.line {
+					height: #{32rpx};
+					width: #{1rpx};
+					background-color: #e2e2e2;
+					position: absolute;
+					top: #{28rpx};
+					left: 0;
+					right: 0;
+					margin: 0 auto;
+				}
+
+				.submit-btn {
+					height: #{88rpx};
+					line-height: #{88rpx};
+					font-size: #{28rpx};
+					text-align: center;
+				}
+			}
+		}
+	}
+</style>

+ 5 - 5
plugins/composition/detail/detail.vue

xqd xqd xqd
@@ -85,6 +85,7 @@
                 });
             },
 			isCanbuy(goods){
+				console.log(goods)
 				if (this.$user.isLogin() && this.$store.state.user.info) {
 				    let  member_level =this.$store.state.user.info.identity.member_level;
 					if(member_level<goods.member_level){
@@ -100,15 +101,15 @@
 									url: '/pages/member/upgrade/upgrade?level=' + member_level + '&other=' +goods.member_level
 								  })
 								  return false;
-								} else if (res.cancel) {
-								  console.log('用户点击取消');
-								  return true;
 								}
+				
 							}
 						})
+						return false;
+					}else{
 						return true;
 					}
-					//return true;
+					
 				}
 			},
             toBuy() {
@@ -282,7 +283,6 @@
                 this.noAttrList = e;
             },
             getTotal(e,max_discount) {
-				console.log(e)
                 this.total = e;
                 if(max_discount) {
                     this.max_discount = max_discount.toFixed(2)