ZZ hace 3 semanas
padre
commit
aadfd31d02

+ 43 - 0
mer_uniapp/api/secondHand.js

@@ -71,3 +71,46 @@ export function secondHandTakeTheirApi(secid) {
 export function preSecondHandOrderApi(data) {
 	return request.post(`secondHand/order/pre/order`, data);
 }
+
+/**
+ * 订单详情
+ * @param string uni
+ */
+export function getSecondHandDetail(uni) {
+	return request.get('secondHand/order/detail/' + uni);
+}
+
+/**
+ * 订单收货
+ * @param string orderNo
+ *
+ */
+export function secondHandTake(orderNo) {
+	return request.post(`secondHand/order/take/delivery/${orderNo}`);
+}
+
+/**
+ * 删除已完成订单
+ * @param string orderNo
+ *
+ */
+export function secondHandDel(orderNo) {
+	return request.post(`secondHand/order/delete/${orderNo}`);
+}
+
+/**
+ * 订单取消
+ * @param string id
+ *
+ */
+export function secondHandCancel(orderNo) {
+	return request.post(`secondHand/order/cancel/${orderNo}`);
+}
+
+/**
+ * 订单状态图
+ *
+ */
+export function secondHandStatusImgApi() {
+	return request.get(`secondHand/order/status/image`)
+}

+ 4 - 1
mer_uniapp/components/WaterfallsFlowItem/WaterfallsFlowItem.vue

@@ -2,7 +2,7 @@
 	<view class='list acea-row row-between-wrapper' :data-theme="theme">
 		<view class='item' hover-class='none' @click="goDetail(item)">
 			<view :class="isDynamics ? 'pictruesss' : 'pictrue'">
-				<view v-show="item.stock===0 || (items.saleStatus === 1 && isManage == 1)" class="sellOut">已售罄</view>
+				<view v-show="item.stock===0 || (item.saleStatus === 1 && isManage == 1)" class="sellOut">{{item.stock===0 ? '已售罄' : '已出售'}}</view>
 				<easy-loadimage :image-src="!userFair ? item.image : item.cover" mode="widthFix"></easy-loadimage>
 				<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
 			</view>
@@ -136,6 +136,9 @@
 				}
 			}
 		},
+		created() {
+			console.log(this.isManage)
+		},
 		methods: {
 			// 去详情页
 			goDetail(item) {

+ 24 - 9
mer_uniapp/pages/goods/order_details/index.vue

@@ -6,6 +6,7 @@
 				<view class='picTxt acea-row row-middle'>
 					<view class='data'>
 						<view v-if="orderInfo.refundStatus == 3"  class='state'>已退款</view>
+						<view v-else-if="shippingType == 2 && orderType == 'secondHand' && orderInfo.status == 1" class='state'>待自取</view>
 						<view v-else class='state'>{{orderInfo.status | orderStatusFilter}}</view>
 						<view v-if="orderInfo.refundReasonTime !== null">{{orderInfo.refundReasonTime}}</view>
 						<view v-if="orderInfo.createTime && orderInfo.status>0">{{orderInfo.createTime}}</view>
@@ -52,7 +53,7 @@
 				<view v-if="shippingType ===2 && orderInfo.refundStatus !== 3" class='nav'>
 					<view class='navCon acea-row row-between-wrapper'>
 						<view :class="orderInfo.status == 0 ?'on':''">待付款</view>
-						<view :class="orderInfo.status == 3 ? 'on':''">待核销</view>
+						<view :class="orderInfo.status == 3 ? 'on':''">{{orderType == 'secondHand' ? '待自取' : '待核销'}}</view>
 						<view :class="orderInfo.status == 6 ? 'on':''">已收货</view>
 					</view>
 					<!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
@@ -272,7 +273,7 @@
 						v-show="Number(orderInfo.status) >1 &&Number(orderInfo.status) < 9 && orderInfo.status!=3&&shippingType===1"
 						@tap='godeliverRecord'>发货记录
 					</view>
-					<view class='bnt bg_color' v-show="orderInfo.status==4 && orderInfo.refundStatus!==3" @tap='confirmOrder'>确认收货</view>
+					<view class='bnt bg_color' v-show="orderInfo.status==4 && orderInfo.refundStatus!==3 || orderType == 'secondHand' && shippingType == 2 && orderInfo.status == 1" @tap='confirmOrder'>确认收货</view>
 					<view class='bnt cancel' v-show="orderInfo.status==6 || orderInfo.status==9" @tap='delOrder'>删除订单
 					</view>
 					<view class='bnt bg_color' v-show="orderInfo.status==0" @tap='goPay(orderInfo)'>立即付款</view>
@@ -300,9 +301,16 @@
 		orderDel,
 		orderCancel,
 		strToBase64Api,
-		orderStatusImgApi
+		orderStatusImgApi,
 	} from '@/api/order.js';
 	import {
+		getSecondHandDetail,
+		secondHandTake,
+		secondHandDel,
+		secondHandCancel,
+		secondHandStatusImgApi
+	} from '@/api/secondHand.js';
+	import {
 		cartBatchAddApi
 	} from '@/api/product.js';
 	import orderGoods from "../components/orderGoods";
@@ -356,6 +364,7 @@
 				codeImg: '',
 				qrcodeSize: 100,
 				orderNo: '',
+				orderType: '',
 				cartInfo: [], //购物车产品
 				orderInfo: {
 					systemStore: {},
@@ -414,6 +423,7 @@
 				tab: 3,
 				url: 1
 			});
+			if (options.orderType) this.orderType = options.orderType;
 			this.$set(this, 'orderNo', options.orderNo);
 			this.bgColor = setThemeColor();
 			uni.setNavigationBarColor({
@@ -526,7 +536,8 @@
 			},
 			orderStatusImg() {
 				let that = this;
-				orderStatusImgApi().then(res => {
+				let api = that.orderType == 'secondHand' ? secondHandStatusImgApi : orderStatusImgApi;
+				api().then(res => {
 					res.data.map(item => {
 						if (item.title === 'await_pay' && this.orderInfo.status === 0) {
 							this.statusPic = item.pic
@@ -555,7 +566,8 @@
 				uni.showLoading({
 					title: "正在加载中"
 				});
-				getOrderDetail(that.orderNo).then(res => {
+				let api = this.orderType == 'secondHand' ? getSecondHandDetail : getOrderDetail;
+				api(that.orderNo).then(res => {
 					uni.hideLoading();
 					let data = res.data;
 					that.$set(that, 'orderInfo', data);
@@ -564,7 +576,7 @@
 					that.$set(that, 'secondType', data.secondType);
 					that.$set(that, 'orderExtend', data.orderExtend ? JSON.parse(data.orderExtend) : []);
 					that.orderStatusImg();
-					that.userAddress = data.merchantOrderList.filter(item => {
+					that.userAddress = data.merchantOrderList && data.merchantOrderList.filter(item => {
 						return item.shippingType === 1
 					})
 					that.isUserAddress = that.userAddress.length > 0 ? true : false;
@@ -688,7 +700,8 @@
 					content: '为保障权益,请收到货确认无误后,再确认收货',
 					success: function(res) {
 						if (res.confirm) {
-							orderTake(that.orderNo).then(res => {
+							let api = that.orderType == 'secondHand' ? secondHandTake : orderTake;
+							api(that.orderNo).then(res => {
 								return that.$util.Tips({
 									title: '操作成功',
 									icon: 'success'
@@ -718,7 +731,8 @@
 					success: (res) => {
 						if (res.confirm) {
 							let that = this;
-							orderDel(this.orderNo).then(res => {
+							let api = that.orderType == 'secondHand' ? secondHandDel : orderDel;
+							api(this.orderNo).then(res => {
 								return that.$util.Tips({
 									title: '删除成功',
 									icon: 'success'
@@ -744,7 +758,8 @@
 					content: '确认取消该订单?',
 					success: function(res) {
 						if (res.confirm) {
-							orderCancel(self.orderNo)
+							let api = self.orderType == 'secondHand' ? secondHandCancel : orderCancel;
+							api(self.orderNo)
 								.then((data) => {
 									self.$util.Tips({
 										title: '取消成功'

+ 60 - 48
mer_uniapp/pages/trade_fair/trade_fair_user/index.vue

@@ -33,8 +33,7 @@
 						<button v-else class="follow_btn focused">已关注</button>
 					</view>
 					<view v-if="userInfo.id==uid">
-						<navigator hover-class="none" :url="`/pages/discover/discover_release/index?fair=${true}`"
-							class="follow_btn focus bg-color">
+						<navigator hover-class="none" :url="`/pages/discover/discover_release/index?fair=${true}`" class="follow_btn focus bg-color">
 							去发布
 						</navigator>
 					</view>
@@ -56,12 +55,10 @@
 
 			<view class="plant_info" style="padding-bottom: 30rpx;">
 				<view class="count_wrapper acea-row">
-					<navigator :url="!id ? '/pages/discover/discover_follow/index?type=follow' : ''" class="item"
-						hover-class="none">
+					<navigator :url="!id ? '/pages/discover/discover_follow/index?type=follow' : ''" class="item" hover-class="none">
 						<text class="mr10">{{userInfo.concernedNum}}</text> 关注
 					</navigator>
-					<navigator :url="!id ? '/pages/discover/discover_follow/index?type=fans' : ''" class="item"
-						hover-class="none">
+					<navigator :url="!id ? '/pages/discover/discover_follow/index?type=fans' : ''" class="item" hover-class="none">
 						<text class="mr10">{{userInfo.fansNum}}</text> 粉丝
 					</navigator>
 					<view class="item">
@@ -107,9 +104,7 @@
 								</view>
 								<view v-if="item.refundStatus == 3" class='font_color'>已退款</view>
 								<template v-else>
-									<view v-if="item.groupBuyRecordStatus==99||item.status==9||item.groupBuyRecordStatus==10"
-										class='font_color'>{{item.status | orderStatusFilter}}</view>
-									<view v-else class='font_color'>{{item.groupBuyRecordStatus===0?'拼团中':'拼团失败'}}</view>
+									<view class='font_color'>{{item.status | orderStatusFilter}}</view>
 								</template>
 							</view>
 							<view v-for="(items,indexs) in item.orderInfoList" :key="indexs">
@@ -120,8 +115,7 @@
 									<view class='text acea-row row-between'>
 										<view class="nameBox">
 											<view class='name line2'>
-												<span v-if="Number(item.type) > 0 && Number(item.type) < 3"
-													class="activity bg_color">{{item.type | orderTypeFilter}}</span>
+												<span v-if="Number(item.type) > 0 && Number(item.type) < 3" class="activity bg_color">{{item.type | orderTypeFilter}}</span>
 												<span v-if="Number(item.secondType) === 1" class="activity bg_color">积分</span>
 												<span>{{items.productName}}</span>
 											</view>
@@ -133,8 +127,7 @@
 										</view>
 									</view>
 								</view>
-								<view v-if="items.applyRefundNum && item.refundStatus > -1"
-									class="text-24rpx font-color oppoSans-R mr-20px px-30 mt-14">
+								<view v-if="items.applyRefundNum && item.refundStatus > -1" class="text-24rpx font-color oppoSans-R mr-20px px-30 mt-14">
 									售后申请数量:{{ items.applyRefundNum }}
 								</view>
 							</view>
@@ -142,11 +135,11 @@
 								件商品,总金额
 								<text class='money semiBold'> ¥{{item.payPrice}}</text>
 							</view>
-							<view v-if="item.status===0" class="mx-20 flex">
+							<!-- <view v-if="item.status===0" class="mx-20 flex">
 								<view class="tips w-full px-20 f-s-26">
 									付款提醒<text class="ml-20 text-999">请在{{item.expirationTime}}前完成支付!</text>
 								</view>
-							</view>
+							</view> -->
 							<!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
 							<view class='bottom acea-row row-right row-middle'>
 								<view class='bnt cancelBnt' v-if="item.status === 0" @click='cancelOrder(index,item.orderNo)'>
@@ -155,36 +148,14 @@
 								<view class='bnt bg_color' v-if="item.status === 0" @click='goPay(item)'>
 									立即付款
 								</view>
-								<view class='bnt cancelBnt' v-if="item.type==2&&item.status !== 0&&item.status !== 9"
-									@click="toCheckGroup(item)">
-									查看拼团
-								</view>
-								<view class='bnt bg_color'
-									v-if="item.type==2&&item.status !== 0&&item.groupBuyRecordStatus===0&&item.status!=9"
-									@click="listenerActionSheet(item)">
-									邀请好友
-								</view>
-								<view class='bnt bg_color'
-									v-if="((item.paid || item.status == 9)&&item.type!=2)||(item.type==2&&item.groupBuyRecordStatus!==0)"
-									@click='goOrderDetails(item)'>
+								<view class='bnt bg_color' v-if="((item.paid || item.status == 9)&&item.type!=2)||(item.type==2&&item.groupBuyRecordStatus!==0)"
+								 @click='goOrderDetails(item)'>
 									查看详情</view>
-								<view class='bnt cancelBnt' v-if="item.status==6 || item.status==9"
-									@click='delOrder(item.orderNo,index)'>
+								<view class='bnt cancelBnt' v-if="item.status==6 || item.status==9" @click='delOrder(item.orderNo,index)'>
 									删除订单
 								</view>
 							</view>
-				
-						</view>
-					</view>
-				
-					<view class='loadingicon acea-row row-center-wrapper'>
-						<text class='loading iconfont icon-jiazai'
-							:hidden='loading==false'></text>{{orderList.length>0?loadTitle:''}}
-					</view>
-					<view class='noCart' v-if="orderList.length == 0 && isShow && !loading">
-						<view class='pictrue'>
-							<image :src="urlDomain+'crmebimage/presets/nodingdan.png'"></image>
-							<view class="default_txt">暂无订单信息~</view>
+
 						</view>
 					</view>
 				</view>
@@ -194,8 +165,7 @@
 				</view>
 				<view class='loadingicon acea-row row-center-wrapper'>
 					<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
-					<view class="end" :hidden="loading || list.length == 0"><text
-							:class="loaded ? 'loaded' : ''">{{loadTitle}}</text>
+					<view class="end" :hidden="loading || list.length == 0"><text :class="loaded ? 'loaded' : ''">{{loadTitle}}</text>
 					</view>
 				</view>
 			</view>
@@ -206,8 +176,7 @@
 				<view class="fs-32 fw-500 lh-44rpx text-center">{{fieldStr == 'signature' ? '编辑简介' : '编辑学校'}}</view>
 				<view class="mt-24 bg--w111-f5f5f5 rd-16rpx p-24">
 					<textarea v-if="fieldStr == 'signature'" class="w-full fs-26 h-342" ref="myTextarea" v-model="signature" :focus="focus"
-						 :always-embed="true" :adjust-position="true" cursor-spacing="85rpx"
-						placeholder="请输入内容" :maxlength="100" name="desc" />
+					 :always-embed="true" :adjust-position="true" cursor-spacing="85rpx" placeholder="请输入内容" :maxlength="100" name="desc" />
 					<input v-if="fieldStr == 'school'" class="placeholder" type='text' v-model='school' :focus="focus"
 					 placeholder='请输入学校' placeholder-class='placeholder'></input>
 				</view>
@@ -248,6 +217,9 @@
 		editSignatureApi,
 		editSchoolApi
 	} from '@/api/discover.js';
+	import {
+		ProductTypeEnum,
+	} from "@/enums/productEnums";
 	import {secondHandOrderList} from '@/api/secondHand.js';
 	import {
 		toLogin
@@ -258,6 +230,7 @@
 	import {
 		discoverFollowAuthor
 	} from '@/libs/follow.js';
+	import easyLoadimage from '@/components/base/easy-loadimage.vue';
 	const app = getApp();
 	let sysHeight = uni.getSystemInfoSync().statusBarHeight;
 	export default {
@@ -265,13 +238,15 @@
 			WaterfallsFlow,
 			WaterfallsFlowItem,
 			emptyPage,
-			NavBar
+			NavBar,
+			easyLoadimage
 		},
 		data() {
 			return {
 				sysHeight: sysHeight,
 				urlDomain: this.$Cache.get("imgHost"),
 				theme: app.globalData.theme,
+				ProductTypeEnum: ProductTypeEnum,
 				list: [], // 内容列表
 				loadTitle: '加载更多',
 				loading: false,
@@ -385,6 +360,44 @@
 					})
 				});
 			},
+			/**
+			 * 去订单详情
+			 */
+			goOrderDetails: function(item, status) {
+				if (!item.orderNo) return this.$util.Tips({
+					title: '缺少订单号无法查看订单详情'
+				});
+				//虚拟商品
+				if (item.secondType === this.ProductTypeEnum.CloudDrive || item.secondType === this.ProductTypeEnum
+					.CardPassword) {
+					// #ifdef MP
+					uni.navigateTo({
+						url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
+					})
+					// #endif
+					// #ifndef MP
+					uni.navigateTo({
+						animationType: animationType.type,
+						animationDuration: animationType.duration,
+						url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
+					})
+					// #endif
+				} else {
+					// #ifdef MP
+					uni.navigateTo({
+						url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + '&orderType=secondHand'
+					})
+					// #endif
+					// #ifndef MP
+					uni.navigateTo({
+						animationType: animationType.type,
+						animationDuration: animationType.duration,
+						url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + "'&orderType=secondHand'
+					})
+					// #endif
+				}
+			
+			},
 			//逛逛用户主页
 			getUserHome(id) {
 				userHomeApi(id).then(res => {
@@ -965,7 +978,6 @@
 	
 	
 	.my-order {
-		/* #endif */
 		.header {
 			height: 250rpx;
 			padding: 0 30rpx;
@@ -1002,4 +1014,4 @@
 		width: 100%;
 		height: 100%;
 	}
-</style>
+</style>