Просмотр исходного кода

跳转实况记录也、倒计时bug

baijunde 1 год назад
Родитель
Сommit
eeadbe3d07
3 измененных файлов с 221 добавлено и 146 удалено
  1. 1 1
      pages/order/details.vue
  2. 32 27
      pages/order/index.vue
  3. 188 118
      pages/product/index.vue

+ 1 - 1
pages/order/details.vue

@@ -13,7 +13,7 @@
 				<view class="status_title">
 					{{product.state}} <span v-if="product.differenceMinutes>0">,剩余</span> 
 					<u-count-down :timestamp="product.differenceMinutes*60" :show-days="false" font-size="36rpx" @end="getDetail"
-						v-if="product.differenceMinutes>0"></u-count-down>
+						v-if="product.differenceMinutes>0 && product.state == '待支付'"></u-count-down>
 
 					<!-- <span>¥{{product.costPrice}}</span> -->
 				</view>

+ 32 - 27
pages/order/index.vue

@@ -76,34 +76,38 @@
 				</view>
 				<!-- 钣金喷漆订单 -->
 				<view class="spec" v-if="item.categoryId == 1945013773786701826">
-					<view class="order_product"
-						 v-for="(specitem, specIndex) in item.orderLinkCategorySpecItems.slice(0, item.isShow ? item.orderLinkCategorySpecItems.length : 2)"
-						:key="specIndex">
-						<view class="img">
-							<image :src="item.productImage" mode=""></image>
-						</view>
-						<view class="spec_item">
-							<view class="top">
-								{{item.productName}}
+					<view class="" v-if="item.orderLinkCategorySpecItems && item.orderLinkCategorySpecItems.length>0">
+
+
+						<view class="order_product"
+							v-for="(specitem, specIndex) in item.orderLinkCategorySpecItems.slice(0, item.isShow ? item.orderLinkCategorySpecItems.length : 2)"
+							:key="specIndex">
+							<view class="img">
+								<image :src="item.productImage" mode=""></image>
 							</view>
-							<view class="content">
-								<view class="left">
-									<view class="cventer">
-										{{specitem.partName}} {{specitem.positionName}}
+							<view class="spec_item">
+								<view class="top">
+									{{item.productName}}
+								</view>
+								<view class="content">
+									<view class="left">
+										<view class="cventer">
+											{{specitem.partName}} {{specitem.positionName}}
+										</view>
+										<view class="foot">
+											{{specitem.craftName}}
+										</view>
 									</view>
-									<view class="foot">
-										{{specitem.craftName}}
+									<view class="right">
+										<span style="font-size: 22rpx;color: #333333;">¥{{specitem.soldPrice}}</span>
+										<span
+											style="text-decoration: line-through;font-size: 18rpx;color: #999999;">¥{{specitem.price}}</span>
 									</view>
 								</view>
-								<view class="right">
-									<span style="font-size: 22rpx;color: #333333;">¥{{specitem.soldPrice}}</span>
-									<span
-										style="text-decoration: line-through;font-size: 18rpx;color: #999999;">¥{{specitem.price}}</span>
-								</view>
 							</view>
 						</view>
 					</view>
-					<view class="is_show" @click.stop="unfold(index)" v-if="item.orderLinkCategorySpecItems.length > 2">
+					<view class="is_show" @click.stop="unfold(index)" v-if="item.orderLinkCategorySpecItems&&item.orderLinkCategorySpecItems.length > 2">
 						{{item.isShow?'收起查看':'展开查看'}}
 						<image src="/static/order/hidden.png" mode="" v-if="item.isShow"></image>
 						<image src="/static/order/show.png" mode="" v-else></image>
@@ -116,9 +120,10 @@
 					<view class="time_right" @click.stop="goRecord(item)" v-if="item.auditType =='0'">
 						去处理
 					</view>
-					<view class="all_price"  v-if="item.categoryId == 1945013773786701826">
+					<view class="all_price" v-if="item.categoryId == 1945013773786701826">
 						<span style="font-size: 22rpx;color: #FD4912;margin-right: 10rpx;">¥已优惠{{item.couponPrice}}</span>
-						<span style="font-size: 26rpx;color: #FD4912;"><text style="font-size: 22rpx;">¥</text>{{item.orderPrice}}</span>
+						<span style="font-size: 26rpx;color: #FD4912;"><text
+								style="font-size: 22rpx;">¥</text>{{item.orderPrice}}</span>
 					</view>
 				</view>
 			</view>
@@ -372,7 +377,7 @@
 			//展开/收起查看钣金喷漆子选项
 			unfold(index) {
 				this.orderList[index].isShow = !this.orderList[index].isShow;
-				 this.$forceUpdate();
+				this.$forceUpdate();
 			},
 
 			//联系客户
@@ -413,9 +418,8 @@
 			},
 			//跳转实况记录
 			goLive(item) {
-				console.log(item)
 				uni.navigateTo({
-					url: '/pages/order/serviceOrder/live?taskId=' + item.taskId
+					url: '/pages/order/serviceOrder/live?taskId=' + item.taskId+'&checkType='+item.checkType
 				})
 			},
 			selectTime() {
@@ -505,7 +509,8 @@
 			//跳转至服务订单详情页
 			goDetail(item) {
 				uni.navigateTo({
-					url: '/pages/order/serviceOrder/orderDetail?taskId=' + item.taskId + '&checkType=' + item.checkType +'&rightsId='+item.rightsId
+					url: '/pages/order/serviceOrder/orderDetail?taskId=' + item.taskId + '&checkType=' + item.checkType +
+						'&rightsId=' + item.rightsId
 				})
 			},
 			getList(page) {

+ 188 - 118
pages/product/index.vue

@@ -70,7 +70,8 @@
 						<view class="price">
 							<span style="font-size: 22rpx;margin: 0px;">¥</span>{{item.soldPrice}}
 							<span v-if="item.categoryId == 1945013773786701826 ">~</span>
-							<span style="font-size: 22rpx;font-size: 30rpx;font-weight: 600;" v-if="item.categoryId == 1945013773786701826 ">¥{{item.price}}</span>
+							<span style="font-size: 22rpx;font-size: 30rpx;font-weight: 600;"
+								v-if="item.categoryId == 1945013773786701826 ">¥{{item.price}}</span>
 							<span style="color:#999 ;font-size: 22rpx; text-decoration: line-through;" v-else>¥{{item.price}}</span>
 						</view>
 						<image src="/static/product/ticket.png" mode="" class="ticket" v-if="item.isRights == 1"></image>
@@ -123,21 +124,66 @@
 		<view class="popup" v-if="isDelete">
 			<view class="content">
 				<view class="title">
-					<span>删除商品</span>
+					<span>提示</span>
 				</view>
 				<view class="center">
-					<image src="/static/index/close.png" mode="" v-if="canBeDelete"></image>
-					<image src="/static/product/error.png" mode="" v-else></image>
 					<view class="error" v-if="canBeDelete">
-						确定要删除?
+						是否将所选商品删除?<br />
+						<span style="font-size: 28rpx;color: #666666;margin-top: 16rpx;">删除后需要重新添加品牌标品</span>
+
 					</view>
 					<view class="error" v-else>
 						当前门店还存在有效服务券<br />
 						<span style="margin-top: 12rpx;">暂时无法关闭门店</span>
 					</view>
 				</view>
-				<view class="sub" @click="isSuccess = false">
-					<view class="button">
+				<view class="btn">
+					<view class="cancel" @click="isDelete = false,productHandleList = []">
+						取消
+					</view>
+					<view class="button" @click="removeProduct">
+						确定
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 下架弹窗 -->
+		<view class="popup" v-if="isDelist">
+			<view class="content">
+				<view class="title">
+					<span>提示</span>
+				</view>
+				<view class="center">
+					<view class="error">
+						是否将所选商品下架?
+					</view>
+				</view>
+				<view class="btn">
+					<view class="cancel" @click="isDelist = false,delistList =[]">
+						取消
+					</view>
+					<view class="button" @click="delistProduct">
+						确定
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 上架弹窗 -->
+		<view class="popup" v-if="isSell">
+			<view class="content">
+				<view class="title">
+					<span>提示</span>
+				</view>
+				<view class="center">
+					<view class="error">
+						是否将所选商品上架?
+					</view>
+				</view>
+				<view class="btn">
+					<view class="cancel" @click="isSell = false,sellProducts = []">
+						取消
+					</view>
+					<view class="button" @click="sellProduct">
 						确定
 					</view>
 				</view>
@@ -177,7 +223,11 @@
 				productList: [],
 				merchantId: '',
 				productHandleList: [],
-				tabIndex: 1
+				tabIndex: 1,
+				isDelist: false, //是否下架
+				isSell: false, //是否上架
+				sellProducts: [], //上架商品集合
+				delistList: [] //下架商品集合
 			}
 		},
 		methods: {
@@ -241,79 +291,76 @@
 				item.select = !item.select
 				this.productHandleList.push(item.productId)
 			},
-			//批量上下架status:0下。1上架
+			//批量上下架status:0下。1上架
 			deletes(status) {
-				let shelves = []
-				this.productList.forEach(item => {
-					if (item.select) {
-						shelves.push({
-							productId: item.productId,
-							productStatus: status
-						})
-					}
-
-				})
-
 				let that = this
-				uni.showModal({
-					title: this.productStatus == 0 ? '确定上架商品?' : '确定下架商品?',
-					success: function(res) {
-						if (res.confirm) {
-
-							that.$http.post("/app/product/shelves", shelves)
-								.then(res => {
-									if (res.data.code == 200) {
-										uni.showToast({
-											title: status == 0 ? '下架成功' : '上架成功',
-											duration: 2000,
-											icon: 'none'
-										});
-										that.$router.go(0)
-										that.isManage = false
-										that.isAll = false
-									}
-								})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-							that.isAll = false
-							that.allSelect()
+				// this.productStatus == 0 ?this.isSell = true:this.isDelist = true
+				if (this.productStatus == 0) {
+					this.isSell = true
+					this.productList.forEach(item => {
+						if (item.select) {
+							this.sellProducts.push({
+								productId: item.productId,
+								productStatus: status
+							})
 						}
-					}
-				});
+
+					})
+				} else {
+					this.isDelist = true
+					this.productList.forEach(item => {
+						if (item.select) {
+							this.delistList.push({
+								productId: item.productId,
+								productStatus: status
+							})
+						}
+
+					})
+				}
 			},
 			//批量删除
 			remove() {
+				console.log(this.productList)
 				this.productList.forEach((item => {
-					this.productHandleList.push(item.productId)
+					if(item.select){
+							this.productHandleList.push(item.productId)
+					}
+				
 				}))
-				let ids = this.productHandleList.join(',')
+				this.isDelete = true
+			},
+			removeProduct() {
+				let ids =[]
+				 ids = this.productHandleList.join(',')
 				console.log(ids)
-				let that = this
-				uni.showModal({
-					title: '确定删除商品?',
-					success: function(res) {
-						if (res.confirm) {
-							that.$http.get("/app/product/deleteBatch?ids=" + ids, )
-								.then(res => {
-									if (res.data.code == 200) {
-										console.log(res)
-
-										uni.showToast({
-											title: '删除成功',
-											duration: 2000,
-											icon: 'none'
-										});
-										that.$router.go(0)
-										that.isManage = false
-										that.isAll = false
-									}
-								})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
+				this.$http.get("/app/product/deleteBatch?ids=" + ids, )
+					.then(res => {
+						if (res.data.code == 200) {
+							console.log(res)
+
+							uni.showToast({
+								title: '删除成功',
+								duration: 2000,
+								icon: 'none'
+							});
+							this.isDelete = false
+							this.productHandleList = []
+							this.$router.go(0)
+							this.isManage = false
+							this.isAll = false
+						} else {
+							this.isDelete = false
+							this.productHandleList = []
+							uni.showToast({
+								title: res.data.message,
+								duration: 2000,
+								icon: 'none'
+							})
 						}
-					}
-				});
+					})
 			},
+
 			//全选
 			allSelect() {
 				if (this.isAll) {
@@ -353,66 +400,54 @@
 			// 		})
 			// },
 			delist(item) {
-				let shelves = []
-				shelves.push({
+
+				this.delistList.push({
 					productId: item.productId,
 					productStatus: 0
 				})
-				let that = this
-				uni.showModal({
-					title: '确定下架商品',
-					success: function(res) {
-						if (res.confirm) {
-							that.$http.post("/app/product/shelves", shelves)
-								.then(res => {
-									if (res.data.code == 200) {
-										that.getProductList()
-										that.getStatus()
-										uni.showToast({
-											title: '下架成功',
-											duration: 2000,
-											icon: 'none'
-										});
-
-									}
-								})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
+				this.isDelist = true
+			},
+			//下架商品
+			delistProduct() {
+				this.$http.post("/app/product/shelves", this.delistList)
+					.then(res => {
+						if (res.data.code == 200) {
+							this.getProductList()
+							this.getStatus()
+							uni.showToast({
+								title: '下架成功',
+								duration: 2000,
+								icon: 'none'
+							});
+							this.isDelist = false
+							this.delistList = []
 						}
-					}
-				});
-
+					})
 			},
 			//上架
 			sell(item) {
 				console.log(item)
-				let shelves = []
-				shelves.push({
+				this.sellProducts.push({
 					productId: item.productId,
 					productStatus: 1
 				})
-				let that = this
-				uni.showModal({
-					title: '确定上架商品?',
-					success: function(res) {
-						if (res.confirm) {
-							that.$http.post("/app/product/shelves", shelves)
-								.then(res => {
-									if (res.data.code == 200) {
-										that.getProductList()
-										that.getStatus()
-										uni.showToast({
-											title: '上架成功',
-											duration: 2000,
-											icon: 'none'
-										});
-									}
-								})
-						} else if (res.cancel) {
-							console.log('用户点击取消');
+				this.isSell = true
+			},
+			sellProduct() {
+				this.$http.post("/app/product/shelves", this.sellProducts)
+					.then(res => {
+						if (res.data.code == 200) {
+							this.getProductList()
+							this.getStatus()
+							uni.showToast({
+								title: '上架成功',
+								duration: 2000,
+								icon: 'none'
+							});
+							this.isSell = false
+							this.sellProducts = []
 						}
-					}
-				});
+					})
 			},
 			//跳转至选择检测站
 			goSelect(item) {
@@ -915,6 +950,7 @@
 				}
 
 				.center {
+					height: 190rpx;
 					font-size: 30rpx;
 					color: #333333;
 					line-height: 35rpx;
@@ -960,6 +996,40 @@
 					}
 				}
 
+				.btn {
+					width: 100%;
+					height: 68rpx;
+					border-radius: 66rpx;
+					font-size: 28rpx;
+					color: #FFFFFF;
+					display: flex;
+					align-items: center;
+					justify-content: space-around;
+					margin: 0rpx auto;
+
+					.cancel {
+						width: 241rpx;
+						height: 68rpx;
+						border-radius: 54rpx;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+						border: 1px solid #cccccc;
+						font-size: 28rpx;
+						color: #999999;
+					}
+
+					.button {
+						width: 241rpx;
+						height: 68rpx;
+						background: #449AFF;
+						border-radius: 54rpx;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+				}
+
 				.start {
 					background: #53CC48;
 				}