Browse Source

更新消息

李书文 1 năm trước cách đây
mục cha
commit
8ed5b07e93

+ 5 - 16
App.vue

@@ -1,25 +1,14 @@
 <script>
 export default {
 	onLaunch: function () {
-		//#ifdef APP-PLUS
-		//获取已保存在本地的用户信息,该内容在登录页面登录成功之后,才保存到本地的
-		const userInfo = uni.getStorageSync('token');
-		if (userInfo) {
-			uni.reLaunch({
-				url: '/pages/index/index'
-			});
-		} else {
-			uni.navigateTo({
-				url: '/pages/login/login'
-			});
-		}
-		//#endif
+		console.log('App Launch');
 	},
 	onShow: function () {
-		//this.getAuth();
+		console.log('App Show');
 	},
-	onHide: function () {},
-	methods: {}
+	onHide: function () {
+		console.log('App Hide');
+	}
 };
 </script>
 

+ 18 - 13
common/style.scss

@@ -109,16 +109,16 @@
 	.uni-data-tree {
 		margin-top: 12px;
 		background-color: #f6f6f6;
-		border: 0px!important;
-		padding-left:5px;
+		border: 0px !important;
+		padding-left: 5px;
 		border-radius: 5px;
 		.placeholder {
 			font-size: 15px;
 		}
-		.input-value-border{
+		.input-value-border {
 			border: 0px;
 		}
-		.input-value{
+		.input-value {
 			padding: 1px 5.5px;
 		}
 	}
@@ -347,7 +347,7 @@
 		position: relative;
 		.title {
 			font-size: 14px;
-			color: #192B20;
+			color: #192b20;
 			line-height: 1.6;
 		}
 		.source {
@@ -356,6 +356,9 @@
 			bottom: 0px;
 			position: absolute;
 			width: 120px;
+			.icon{
+				padding-right: 4px;
+			}
 		}
 		.releaseTime {
 			font-size: 13px;
@@ -581,12 +584,12 @@
 					padding-bottom: 3px;
 				}
 			}
-			.tradeAreaName{
+			.tradeAreaName {
 				padding-top: 10px;
 				color: #abacb0;
 				float: left;
 			}
-			.date{
+			.date {
 				float: left;
 				color: #abacb0;
 				padding-top: 10px;
@@ -598,6 +601,9 @@
 			padding: 10px 10px 0px 10px;
 			color: #192b20;
 			font-size: 15px;
+			.f {
+				color: #abacb0;
+			}
 		}
 	}
 }
@@ -647,9 +653,9 @@
 				color: #abacb0;
 				font-weight: bold;
 			}
-			.del{
+			.del {
 				font-size: 20px;
-				color: #F44336;
+				color: #f44336;
 			}
 		}
 		.pic {
@@ -690,23 +696,22 @@
 				margin-right: -11px;
 			}
 		}
-		.op{
+		.op {
 			margin-top: 12px;
 			border-top: 1px solid $line;
 			color: #a0a2a6;
 			padding-top: 10px;
 			overflow: hidden;
-			.date{
+			.date {
 				float: left;
 				margin-top: 6px;
 			}
-			.an{
+			.an {
 				float: right;
 				margin-left: 15px;
 				margin-top: 4px;
 				font-weight: bold;
 			}
-			
 		}
 	}
 }

+ 24 - 29
pages.json

@@ -41,7 +41,8 @@
 		{
 			"path": "pages/message/message",
 			"style": {
-				"navigationBarTitleText": "消息中心"
+				"navigationBarTitleText": "消息中心",
+				"enablePullDownRefresh": true
 			}
 		}, {
 			"path": "pages/personal/personal",
@@ -301,35 +302,29 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/market/one/leader/detail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/market/one/leader/members",
+			"style": {
+				"navigationBarTitleText": "订单边民",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/market/one/car/car",
+			"style": {
+				"navigationBarTitleText": "叫车服务",
+				"enablePullDownRefresh": false
+			}
+
 		}
-	    ,{
-            "path" : "pages/market/one/leader/detail",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "订单详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/leader/members",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "订单边民",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/car/car",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "叫车服务",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-    ],
+	],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 17 - 4
pages/index/index.vue

@@ -19,7 +19,7 @@
 				<view class="msn" v-for="(item, index) in menuList" :key="index" @click="navTo(item.path)">
 					<view class="out">
 						<view class="int">
-							<image :src="item.icon" mode="widthFix" style="width: 54px;height: 54px;"></image>
+							<image :src="item.icon" mode="widthFix" style="width: 54px; height: 54px"></image>
 							<view class="tit">{{ item.menuName }}</view>
 						</view>
 					</view>
@@ -33,12 +33,15 @@
 					<text class="title">最新资讯</text>
 					<text class="more" @click="navTo('/pages/news/list')">更多</text>
 				</view>
-				<view class="list">
+				<view class="list animated fadeInDown">
 					<view class="news_item" v-for="(item, index) in newsList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
 						<image src="../../static/news.jpg" mode="aspectFill" class="img"></image>
 						<view class="con">
 							<view class="title ellip">{{ item.title }}</view>
-							<view class="source omit">{{ item.source }}</view>
+							<view class="source omit">
+								<text class="icon">&#xe639;</text>
+								<text>{{item.readCount}}</text>
+							</view>
 							<view class="releaseTime">{{ item.releaseTime }}</view>
 						</view>
 					</view>
@@ -65,6 +68,17 @@ export default {
 		this.getNewsList();
 		this.getMenu();
 	},
+	onShow() {
+		this.http.request({
+			url: '/sp-admin/app/TbMessage/getRead',
+			loading: 'false',
+			success: res => {
+				if (res.data.data.count > 0) {
+					uni.setTabBarBadge({ index: 1, text: res.data.data.count });
+				}
+			}
+		});
+	},
 	methods: {
 		getBannerList() {
 			this.http.request({
@@ -89,7 +103,6 @@ export default {
 					});
 				}
 			});
-			// console.log(this.menuList);
 		},
 		getNewsList() {
 			this.http.request({

+ 21 - 13
pages/market/one/detail.vue

@@ -9,30 +9,30 @@
 				<u-divider text="规格参数"></u-divider>
 				<view class="item">
 					<text class="desc">净重:</text>
-					<text>{{item.netWeight}}</text>
+					<text>{{ item.netWeight }}</text>
 				</view>
 				<view class="item">
 					<text class="desc">毛重:</text>
-					<text>{{item.grossWeight}}</text>
+					<text>{{ item.grossWeight }}</text>
 				</view>
 				<view class="item">
 					<text class="desc">计量单位:</text>
-					<text>{{item.goodsUnits}}</text>
+					<text>{{ item.goodsUnits }}</text>
 				</view>
 				<view class="item">
 					<text class="desc">商户:</text>
-					<text>{{item.merchantName}}</text>
+					<text>{{ item.merchantName }}</text>
 				</view>
 				<view class="item">
 					<text class="desc">互市区:</text>
-					<text>{{item.tradeAreaName}}</text>
+					<text>{{ item.tradeAreaName }}</text>
 				</view>
 				<view class="item">
 					<text class="desc">发布时间:</text>
-					<text>{{item.createTime}}</text>
+					<text>{{ item.createTime }}</text>
 				</view>
 				<u-divider text="商品介绍"></u-divider>
-				<view class="contents" v-if="item.description">{{item.description}}</view>
+				<view class="contents" v-if="item.description">{{ item.description }}</view>
 				<view class="contents">暂无关于该商品的介绍</view>
 			</view>
 		</view>
@@ -92,13 +92,21 @@ export default {
 		},
 		// 立即购买
 		buy() {
-			this.http.request({
-				url: '/level-one-server/app/TbGoodsTransit/purchaseLevelOntGoodsTransit',
-				data: { goodsTransitId: this.item.id },
-				method: 'POST',
-				contentType: 'application/json; charset=utf-8',
+			uni.showModal({
+				title: '提示',
+				content: '确定购买?',
 				success: res => {
-					uni.redirectTo({ url: '/pages/market/one/leader/success' });
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-one-server/app/TbGoodsTransit/purchaseLevelOntGoodsTransit',
+							data: { goodsTransitId: this.item.id },
+							method: 'POST',
+							contentType: 'application/json; charset=utf-8',
+							success: res => {
+								uni.redirectTo({ url: '/pages/market/one/leader/success' });
+							}
+						});
+					}
 				}
 			});
 		}

+ 31 - 37
pages/market/two/leader/detail.vue

@@ -1,64 +1,57 @@
 <template>
 	<view>
 		<view class="cmain">
-			<view class="box order_detail" style="margin-top: 0px">
-				<view class="item">
-					<text class="label">订单状态</text>
-					<text class="desc">
-						<text class="icon">&#xe830;</text>
-						<text>待确认</text>
-					</text>
-				</view>
-			</view>
 			<view class="box order_detail">
-				<u-divider text="订单信息"></u-divider>
-				<view class="item" style="padding-top: 0px">
-					<text class="label">订单编号</text>
-					<text class="desc">13454334567</text>
-				</view>
 				<view class="item">
-					<text class="label">申报单号</text>
-					<text class="desc">13454334567</text>
+					<text class="label">订单编号</text>
+					<text class="desc">{{ item.orderNo }}</text>
 				</view>
 				<view class="item">
 					<text class="label">收购商</text>
-					<text class="desc">貔貅</text>
+					<text class="desc">{{ item.acquirerName }}</text>
 				</view>
 				<view class="item">
 					<text class="label">联系号码</text>
-					<text class="desc">13097850971</text>
+					<text class="desc">{{ item.consigneePhone }}</text>
 				</view>
 				<view class="item">
 					<text class="label">商品名称</text>
-					<text class="desc">胡椒粉</text>
+					<text class="desc omit">{{ item.goodsName }}</text>
 				</view>
 				<view class="item">
 					<text class="label">计价单位</text>
-					<text class="desc">元/kg</text>
+					<text class="desc omit">{{ item.goodsUnit }}</text>
 				</view>
-				<view class="item">
-					<text class="label">净重</text>
-					<text class="desc">34吨</text>
+				<view class="item" v-if="item.quotation">
+					<text class="label">价格</text>
+					<text class="desc" style="color: #f44336; font-weight: bold">¥ {{ item.quotation }}</text>
 				</view>
 				<view class="item">
-					<text class="label">毛重</text>
-					<text class="desc">34吨</text>
+					<text class="label">来源国</text>
+					<text class="desc">{{ item.goodsFrom }}</text>
 				</view>
 				<view class="item">
-					<text class="label">价格</text>
-					<text class="desc">400000元</text>
+					<text class="label">状态</text>
+					<text class="desc" v-if="item.orderFinish == 0">已确认</text>
+				</view>
+				<view class="item" v-if="item.createTime">
+					<text class="label">接单时间</text>
+					<text class="desc">{{ item.createTime }}</text>
 				</view>
+			</view>
+			<u-divider text="收货地址"></u-divider>
+			<view class="box order_detail">
 				<view class="item">
-					<text class="label">来源国</text>
-					<text class="desc">越南</text>
+					<text class="label">收件人</text>
+					<text class="desc omit">{{ item.consigneeName }}</text>
 				</view>
 				<view class="item">
-					<text class="label">发布时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="label">联系电话</text>
+					<text class="desc">{{ item.consigneePhone }}</text>
 				</view>
 				<view class="item">
-					<text class="label">下单时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="label">收件地址</text>
+					<text class="desc">{{ item.unloadingAddress }}</text>
 				</view>
 			</view>
 		</view>
@@ -74,15 +67,16 @@ export default {
 	},
 	onLoad(e) {
 		if (e.id) {
-			/* 			this.http.request({
-				url: '/level-one-server/app/TbPortNews/getPortNewsDetails?id=' + e.id,
+			this.http.request({
+				url: '/level-two-server/app/TbOrders/getDetailById?id=' + e.id,
 				success: res => {
 					this.item = res.data.data;
 				}
-			}); */
+			});
 		}
 	},
-	methods: {}
+	methods: {
+	}
 };
 </script>
 

+ 10 - 12
pages/market/two/leader/order.vue

@@ -5,23 +5,21 @@
 		</view>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="title">广西京东自营店南宁分店</view>
-				<view class="state" style="color: #4581fb" v-if="item.orderFinish == 1">已确认</view>
-				<view class="state" style="color: #4581fb" v-if="item.orderFinish == 2">已完成</view>
+				<view class="title">{{ item.createName }}</view>
+				<view class="state" style="color: #4581fb" v-if="item.orderFinish == 0">已确认</view>
 				<image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
-					<view class="productName omit">{{item.goodsName}}</view>
+					<view class="productName omit">{{ item.goodsName }}</view>
 					<view class="desc omit">
-						<text>50吨</text>
-						<text>云南互市区云南互市区云南互市区云南互市区云南互市区</text>
+						<text>数量:{{ item.goodsQuantity }}</text>
+						<text>{{ item.tradeAreaName }}</text>
 					</view>
-					<view class="price">¥ 5000</view>
+					<view class="price">¥ {{ item.quotation }}</view>
 				</view>
 				<view class="clear"></view>
 				<view class="op">
-					<view class="date">2022-12-12:12:12</view>
-					<view class="an" style="color: #f44336">取消订单</view>
-					<view class="an" style="color: #4581fb">通知确认</view>
+					<view class="date">{{ item.createTime }}</view>
+					<view class="an" style="color: #4581fb">查看物流</view>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -84,8 +82,8 @@ export default {
 				}
 			});
 		},
-		detail(id) {
-			uni.navigateTo({ url: '/pages/market/two/leader/detail' });
+		detail(item) {
+			uni.navigateTo({ url: '/pages/market/two/leader/detail?id=' + item.id });
 		},
 		//刷新数据
 		refresh() {

+ 43 - 13
pages/market/two/purchaser/buy/detail.vue

@@ -62,7 +62,7 @@
 				</view>
 			</view>
 			<button class="btn" @click.stop="confirm()" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">同意接单并支付</button>
-			<button class="btn" @click.stop="refuse(item.goodsDemandId)" style="background-color: #f44336" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">拒绝接单</button>
+			<button class="btn" @click.stop="refuse()" style="background-color: #f44336" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">拒绝接单</button>
 		</view>
 	</view>
 </template>
@@ -86,23 +86,53 @@ export default {
 	},
 	methods: {
 		confirm() {
-			this.http.request({
-				url: '/level-two-server/app/TbOrders/add',
-				data: this.item,
+			uni.showModal({
+				title: '提示',
+				content: '确定同意接单并支付?',
 				success: res => {
-					uni.showToast({ title: '操作成功' });
-					// 收购商已确认
-					this.item.isConfirm = 1;
-					uni.$emit('purchaser_buy_list');
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/TbOrders/add',
+							data: this.item,
+							success: res => {
+								console.log('asd:');
+								uni.showModal({
+									title: '提示',
+									content: '处理成功,等待组长发货',
+									showCancel: false,
+									success: res => {
+										uni.navigateBack();
+										uni.$emit('purchaser_buy_list');
+									}
+								});
+							}
+						});
+					}
 				}
 			});
 		},
-		refuse(goodsDemandId) {
-			this.http.request({
-				url: '/level-two-server/app/TbGoodsDemand/refuse',
-				data: {id: goodsDemandId},
+		refuse() {
+			uni.showModal({
+				title: '提示',
+				content: '确定取消该接单?',
 				success: res => {
-					uni.showToast({ title: '操作成功' });
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/TbGoodsDemand/refuse',
+							data: { id: this.item.goodsDemandId, goodsName: this.item.goodsName },
+							success: res => {
+								uni.showModal({
+									title: '提示',
+									content: '取消成功',
+									showCancel: false,
+									success: res => {
+										uni.navigateBack();
+										uni.$emit('purchaser_buy_list');
+									}
+								});
+							}
+						});
+					}
 				}
 			});
 		}

+ 1 - 1
pages/market/two/purchaser/buy/list.vue

@@ -28,7 +28,7 @@
 						<view class="f" v-if="item.isRelease == 0 && item.isOrders == 0 && item.isConfirm == 0" style="color: #4581fb" @click.stop="op(item, 1)">发布</view>
 						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 0 && item.isConfirm == 0" style="color: #f44336" @click.stop="op(item, 0)">取消发布</view>
 						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0" style="color: #4581fb" @click.stop="confirm(item, 0)">前往确认</view>
-						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 1" style="color: #4581fb" @click.stop="detail(item)">查看订单</view>
+						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 1" @click.stop="detail(item)">查看订单</view>
 					</view>
 				</view>
 			</view>

+ 29 - 14
pages/message/message.vue

@@ -1,15 +1,17 @@
 <template>
 	<view>
+		<view class="tab">
+			<u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
+		</view>
 		<view class="list">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="top">
 					<view class="icon">&#xe60d;</view>
-					<view class="title">交易消息</view>
-					<view class="date">2023-8-310:50</view>
-					<view class="clear"></view>
+					<view class="title" v-if="item.types == 1">系统消息</view>
+					<view class="title" v-if="item.types == 2">交易消息</view>
+					<view class="date">{{ item.createTime }}</view>
 				</view>
-				<view class="content">订单20210803172489305已支付,请尽快与对方联系!</view>
-				<view class="clear"></view>
+				<view class="content">{{ item.contents }}</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
@@ -21,34 +23,45 @@
 export default {
 	data() {
 		return {
+			user: this.getUser(),
+			tab: [
+				{ name: '交易消息', types: 2 },
+				{ name: '系统消息', types: 1 }
+			],
 			list: [],
-			param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' },
+			param: { pageNo: 1, pageSize: 10, types: 2 },
 			loadMore: true
 		};
 	},
-	onLoad(e) {
-		this.getData();
+	onShow() {
+		uni.removeTabBarBadge({ index: 1 });
+		this.param.types = 2;
+		this.refresh();
 	},
 	methods: {
 		getData() {
 			this.http.request({
-				url: '/level-one-server/app/TbPortNews/getPortNewsList',
+				url: '/sp-admin/app/TbMessage/getList',
 				data: this.param,
 				loading: 'false',
 				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
 					this.list.push(...res.data.data);
 				}
 			});
 		},
+		//点击tab切换
+		click(e) {
+			this.param.types = e.types;
+			this.refresh();
+		},
 		detail(item) {
-			uni.navigateTo({
-				url: '/pages/news/detail?id=' + item.id
-			});
+			uni.navigateTo({ url: item.url });
 		},
 		//刷新数据
 		refresh() {
 			this.loadMore = true;
-			this.param.pageNum = 1;
+			this.param.pageNo = 1;
 			this.list = [];
 			this.getData();
 		}
@@ -63,7 +76,7 @@ export default {
 	//上拉加载
 	onReachBottom() {
 		if (this.loadMore) {
-			this.param.pageNum++;
+			this.param.pageNo++;
 			this.getData();
 		}
 	}
@@ -86,6 +99,7 @@ page {
 			color: $font-c;
 			border-bottom: 1px solid $line;
 			padding-bottom: 13px;
+			overflow: hidden;
 			.icon {
 				float: left;
 				width: 17px;
@@ -111,6 +125,7 @@ page {
 		.content {
 			padding-top: 15px;
 			color: #666666;
+			line-height: 25px;
 		}
 	}
 }

+ 12 - 4
pages/personal/personal.vue

@@ -153,10 +153,18 @@ export default {
 			uni.navigateTo({ url: url });
 		},
 		exitLogin() {
-			uni.removeStorageSync('token');
-			uni.removeStorageSync('info');
-			uni.removeStorageSync('menu');
-			uni.redirectTo({ url: '/pages/login/login' });
+			uni.showModal({
+				title: '提示',
+				content: '确定注销登录?',
+				success: res => {
+					if (res.confirm) {
+						uni.removeStorageSync('token');
+						uni.removeStorageSync('info');
+						uni.removeStorageSync('menu');
+						uni.redirectTo({ url: '/pages/login/login' });
+					}
+				}
+			});
 		}
 	}
 };