Selaa lähdekoodia

Merge branch 'feature/asyncOrder' of http://git.aseanbusiness.cn/qzyReal/market-app-ui into feature/asyncOrder

qzyReal 1 vuosi sitten
vanhempi
commit
c7016ef984

+ 1 - 1
App.vue

@@ -36,7 +36,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4191999_e5zep4g7w2a.ttf?t=1693296694547') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4191999_7iv6g88ty2h.ttf?t=1693811980958') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 1 - 1
common/style.scss

@@ -833,4 +833,4 @@
 		right: 11px;
 		line-height: 21px;
 	}
-}
+}

+ 5 - 0
common/util.js

@@ -185,6 +185,11 @@ const getDate = (obj = 'day') => {
 	if (obj == 'day') {
 		return `${year}-${month}-${day}`;
 	}
+	if (obj == 'lm') {
+		month = date.getMonth();
+		month = month > 9 ? month : '0' + month;
+		return `${year}-${month}-${day}`;
+	}
 	if (obj == 'time') {
 		return `${year}-${month}-${day}` + ' ' + Hours + ':' + Minutes;
 	}

+ 91 - 0
components/mcalendar/mcalendar.vue

@@ -0,0 +1,91 @@
+<template>
+	<view>
+		<view class="mcalendar">
+			<view class="con">
+				<text class="icon">&#xe621;</text>
+				<input placeholder="选择日期范围" :value="param.data" class="date" :disabled="true" @click="show = true" />
+				<text class="icon del" @click="clear()" v-if="param.data">&#xe61a;</text>
+				<text class="label" @click="today()">今天</text>
+			</view>
+		</view>
+		<u-calendar :show="show" mode="range" :minDate="minDate" @confirm="confirm" @close="show = false" :closeOnClickOverlay="true"></u-calendar>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'mcalendar',
+	props: {
+		value: {
+			type: Boolean,
+			default: false
+		}
+	},
+	data() {
+		return {
+			show: false,
+			minDate: this.util.getDate('lm'),
+			param: {}
+		};
+	},
+	watch: {
+		value(newValue) {
+			this.show = newValue;
+		}
+	},
+	methods: {
+		confirm(e) {
+			this.$emit('input', false);
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.param.data = e[0] + ' - ' + e[1];
+			this.show = false;
+			this.$emit('confirm', e);
+		},
+		today() {
+			this.param.dateBegin = this.util.getDate('day');
+			this.param.dateEnd = this.util.getDate('day');
+			this.param.data = this.util.getDate('day') + ' - ' + this.util.getDate('day');
+			this.$forceUpdate();
+			this.$emit('today', [this.util.getDate('day'), this.util.getDate('day')]);
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.param.data = '';
+			this.$forceUpdate();
+			this.$emit('clear');
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.mcalendar {
+	padding: 10px 10px 0px 10px;
+	.con {
+		padding: 10px 15px 10px 15px;
+		background-color: white;
+		border-radius: 20px;
+		color: $font-c;
+		overflow: hidden;
+		.icon {
+			padding-right: 10px;
+			float: left;
+			margin-top: 2px;
+		}
+		.del {
+			padding-left: 9px;
+		}
+		.date {
+			float: left;
+			width: 60%;
+		}
+		.label {
+			float: right;
+			color: $main-color;
+			padding-right: 5px;
+		}
+	}
+}
+</style>

+ 27 - 1
pages.json

@@ -432,6 +432,14 @@
 
 		},
 		{
+			"path": "pages/market/two/leader/updatePrice",
+			"style": {
+				"navigationBarTitleText": "修改转售价格",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
 			"path": "pages/market/two/leader/feeDetail",
 			"style": {
 				"navigationBarTitleText": "缴税费",
@@ -499,7 +507,25 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/shop/shop",
+            "style" :
+            {
+                "navigationBarTitleText": "商铺列表",
+                "enablePullDownRefresh": true
+            }
+
+        }
+        ,{
+            "path" : "pages/shop/detail",
+            "style" :
+            {
+                "navigationBarTitleText": "商铺详情",
+                "enablePullDownRefresh": false
+            }
+
+        }
+    ],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 5 - 2
pages/index/index.vue

@@ -91,9 +91,12 @@ export default {
 		};
 	},
 	onLoad() {
-		this.getMenu();
 		this.getBannerList();
 		this.getNewsList();
+		this.getMenu();
+		uni.$on('getMenu', res => {
+			this.getMenu();
+		});
 	},
 	onShow() {
 		this.keyword = '';
@@ -108,7 +111,7 @@ export default {
 				loading: 'false',
 				success: res => {
 					if (res.data.data) {
-						this.order=res.data.data;
+						this.order = res.data.data;
 						this.show = true;
 					}
 				}

+ 1 - 0
pages/login/login.vue

@@ -83,6 +83,7 @@ export default {
 					uni.setStorageSync('menu', data.per_list);
 					uni.showToast({ title: '登录成功' });
 					setTimeout(() => {
+						uni.$emit('getMenu');
 						uni.switchTab({ url: '/pages/index/index' });
 					}, 1000);
 				}

+ 18 - 0
pages/market/one/confirm/apply.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.enterpriseName }}
@@ -40,6 +41,7 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
@@ -84,6 +86,22 @@ export default {
 		detail(item) {
 			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 18 - 0
pages/market/one/confirm/cooperation.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">
@@ -41,6 +42,7 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
@@ -86,6 +88,22 @@ export default {
 		detail(item) {
 			uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 24 - 6
pages/market/one/confirm/people.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<mcalendar v-model="show" @confirm="confirm" @clear="clear" @today="today"></mcalendar>
 		<view class="goodsList">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.enterpriseName }}
@@ -26,7 +27,7 @@
 				<view class="op">
 					<view class="date">{{ item.createTime }}</view>
 					<template v-if="item.peopleConfirmStatus == 0">
-						<view class="an" style="color: #f44336"  @click.stop="confirmOrder(item.id)">边民确认</view>
+						<view class="an" style="color: #f44336" @click.stop="confirmOrder(item.id)">边民确认</view>
 					</template>
 				</view>
 			</view>
@@ -40,17 +41,18 @@
 export default {
 	data() {
 		return {
+			show: false,
 			param: {
 				pageNo: 1,
 				pageSize: 10,
 				//peopleConfirmStatus: 0, //边民确认状态
-				cooperEntrustStatus: 0,//互助委托申报确认状态
+				cooperEntrustStatus: 0, //互助委托申报确认状态
 				applyConfirmStatus: 0, //进口申报确认状态
 				finishStatus: 0, //订单完成状态
 				resaleStatus: 0 //订单转售状态
 			},
 			list: [],
-			loadMore: true,
+			loadMore: true
 		};
 	},
 	onLoad() {
@@ -81,8 +83,24 @@ export default {
 				}
 			});
 		},
+		confirm(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.show = false;
+			this.refresh();
+		},
+		today(e) {
+			this.param.dateBegin = e[0];
+			this.param.dateEnd = e[1];
+			this.refresh();
+		},
+		clear() {
+			this.param.dateBegin = '';
+			this.param.dateEnd = '';
+			this.refresh();
+		},
 		detail(item) {
-			uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
+			uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
 		},
 		// 刷新数据
 		refresh() {
@@ -90,7 +108,7 @@ export default {
 			this.param.pageNo = 1;
 			this.list = [];
 			this.getData();
-		},
+		}
 	},
 	//下拉刷新
 	onPullDownRefresh() {
@@ -113,7 +131,7 @@ export default {
 page {
 	background-color: $pg;
 }
-.state{
+.state {
 	margin-right: -70px;
 }
 </style>

+ 10 - 1
pages/market/one/leader/order.vue

@@ -10,7 +10,7 @@
 						<text class="icon">&#xe830;</text>
 						<text>未确认</text>
 					</view>
-					<view class="state" v-if="item.finishStatus == 0">
+					<view class="state" v-if="item.peopleConfirmStatus == 1 && item.cooperEntrustStatus == 1 && item.applyConfirmStatus == 1 &&item.finishStatus == 0">
 						<text class="icon">&#xe830;</text>
 						<text>进口中</text>
 					</view>
@@ -39,6 +39,9 @@
 					<template v-if="item.finishStatus == 1 && item.resaleStatus == 0">
 						<view class="an" style="color: #f44336"  @click.stop="resale(item)">订单转售</view>
 					</template>
+					<template v-if="item.resaleStatus == 1 && item.beingOrder == 0">
+						<view class="an" style="color: #f44336"  @click.stop="updateResalePrice(item.id)">修改转售价格</view>
+					</template>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -62,6 +65,9 @@ export default {
 				},
 				{
 					name: '进口中',
+					peopleConfirmStatus: 1,
+					cooperEntrustStatus: 1,
+					applyConfirmStatus: 1,
 					finishStatus: 0,
 					resaleStatus: 0
 				},
@@ -146,6 +152,9 @@ export default {
 		resale(item) {
 			uni.navigateTo({url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)});
 		},
+		updateResalePrice(id) {
+			uni.navigateTo({url: '/pages/market/two/leader/updatePrice?id=' + id});
+		},
 		// 刷新数据
 		refresh() {
 			this.loadMore = true;

+ 6 - 22
pages/market/two/leader/resale.vue

@@ -21,7 +21,7 @@
 				<view class="item">
 					<text class="label">转售金额(必填)</text>
 					<text class="desc">
-						<input type="number" v-model="order.resalePrice" placeholder="请输入(元)" />
+						<input type="number" v-model="resalePrice" placeholder="请输入(元)" />
 					</text>
 				</view>
 			</view>
@@ -33,7 +33,7 @@
 						<view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
 						<view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
 						<view class="itm" v-if="item.feeType ==1">3、收费%(按交易额):<span style="color: coral;">{{ item.percent }} %</span></view>
-						<view class="itm" v-if="item.feeType ==1">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * order.resalePrice)/100}} 元</span></view>
+						<view class="itm" v-if="item.feeType ==1">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * resalePrice)/100}} 元</span></view>
 						<view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
 						<view class="itm" v-if="item.feeType ==2">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
 						</br>
@@ -56,29 +56,14 @@
 export default {
 	data() {
 		return {
-			user: this.getUser(),
 			item: {},
-			order: {
-				resalePrice: '',
-				levelOneOrderId: '',
-				goodsId: '',
-				goodsName: '',
-				goodsUnit: '',
-				tradeAreaId: '',
-				tradeAreaName: '',
-			},
+			resalePrice: '',
 			feeItemLIst: []
 		};
 	},
 	onLoad(e) {
 		if (e.item) {
 			this.item = JSON.parse(e.item);
-			this.order.levelOneOrderId = this.item.id;
-			this.order.goodsId = this.item.goodsId;
-			this.order.goodsName = this.item.goodsNames;
-			this.order.goodsUnit = this.item.goodsUnit;
-			this.order.tradeAreaId = this.item.tradeAreaId;
-			this.order.tradeAreaName = this.item.tradeAreaName;
 		}
 		this.getFeeItem();
 	},
@@ -93,8 +78,8 @@ export default {
 			});
 		},
 		ok() {
-			let rule = [{ name: 'resalePrice', checkType: 'notnull', errorMsg: '请输入转售金额' }];
-			if (!this.verify.check(this.order, rule)) {
+			let rule = { name: 'resalePrice', checkType: 'notnull', errorMsg: '请输入转售金额' };
+			if (!this.verify.check(this.resalePrice, rule)) {
 				uni.showModal({ content: this.verify.error, showCancel: false });
 				return false;
 			}
@@ -105,8 +90,7 @@ export default {
 					if (res.confirm) {
 						this.http.request({
 							url: '/level-two-server/app/TbOrders/addOrderByResale',
-							method: 'POST',
-							data: this.order,
+							data: {id: this.item.id, resalePrice: this.resalePrice},
 							success: res => {
 								uni.showToast({title: '提交成功'});
 								this.item.resaleStatus = 1;

+ 127 - 0
pages/market/two/leader/updatePrice.vue

@@ -0,0 +1,127 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box order_detail">
+				<view class="item">
+					<text class="label">商品名称</text>
+					<text class="desc omit">{{ item.goodsName }}</text>
+				</view>
+				<view class="item">
+					<text class="label">订单编号</text>
+					<text class="desc omit">{{ item.orderNo }}</text>
+				</view>
+				<view class="item">
+					<text class="label">转售金额(必填)</text>
+					<text class="desc">
+						<input type="number" v-model="item.resalePrice" placeholder="请输入(元)" />
+					</text>
+				</view>
+			</view>
+			<u-divider text="费项明细"></u-divider>
+			<view class="box">
+				<u-collapse v-for="(item,index) in feeItemLIst" :key="index">
+					<u-collapse-item :title="item.name" class="cell_title" >
+						<view class="itm">1、收费企业:{{ item.companyName }}</view>
+						<view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
+						<view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
+						<view class="itm" v-if="item.feeType ==1">3、收费%(按交易额):<span style="color: coral;">{{ item.percent }} %</span></view>
+						<view class="itm" v-if="item.feeType ==1">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * price)/100}} 元</span></view>
+						<view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
+						<view class="itm" v-if="item.feeType ==2">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
+						</br>
+						<view class="itm">当前费项收取金额以最后结算时为准</view>
+					</u-collapse-item>
+				</u-collapse>
+			</view>
+		</view>
+		<view class="mfooter" v-if="resaleStatus == 0">
+			<view class="flex">
+				<view class="f">
+					<button class="btn" @click="ok()">确定</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: {resalePrice: ''},
+			feeItemLIst: [],
+			resaleStatus: 0,
+			price: ''
+		};
+	},
+	watch:{
+		'item.resalePrice':{
+			 handler(newVal, oldVal) {
+				 this.price = newVal;
+			}
+		}
+	},
+	onLoad(e) {
+		if (e.id) {
+			this.http.request({
+				url: '/level-two-server/app/TbOrders/getByLevelOneOrderId',
+				data: {levelOneOrderId: e.id},
+				success: res => {
+					this.item = res.data.data;
+					this.price = this.item.resalePrice;
+				}
+			});
+		}
+		this.getFeeItem();
+	},
+	methods: {
+		//费项明细
+		getFeeItem(){
+			this.http.request({
+				url: '/level-two-server/app/TbFeeItem/getList',
+				success: res => {
+					this.feeItemLIst = res.data.data
+				}
+			});
+		},
+		changePrice() {
+			
+		},
+		ok() {
+			let rule = [{ name: 'resalePrice', checkType: 'notnull', errorMsg: '请输入转售金额' }];
+			if (!this.verify.check(this.item, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
+			uni.showModal({
+				title: '提示',
+				content: '我已核对转售金额',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/TbOrders/updateResalePrice',
+							data: {id: this.item.id, resalePrice: this.price},
+							success: res => {
+								uni.showToast({title: '修改成功成功'});
+								this.resaleStatus = 1;
+							}
+						});
+					}
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+.item {
+	input{
+		margin-top: 0px!important;
+	}
+	}
+
+</style>

+ 4 - 4
pages/market/two/list.vue

@@ -69,15 +69,15 @@ export default {
 			selects: []
 		};
 	},
-	onShow(){
+	/* onShow(){
 		this.refresh();
-	},
+	}, */
 	onLoad(e) {
+		this.getData();
 		//选择商品分类
 		uni.$on('productType', res => {
+			this.param.typeCode = res.no;
 			this.param.goodsType = res.name;
-			this.param.current = res.current;
-			this.param.now = res.now;
 			this.refresh();
 		});
 	},

+ 74 - 0
pages/shop/detail.vue

@@ -0,0 +1,74 @@
+<template>
+	<view>
+		<view class="cmain">
+			<view class="box order_detail">
+				<u-divider text="商铺信息"></u-divider>
+				<view class="item">
+					<text class="label">商铺编号</text>
+					<text class="desc">{{item.shopNo}}</text>
+				</view>
+				<view class="item">
+					<text class="label">商铺名称</text>
+					<text class="desc">{{item.shopName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">铺主</text>
+					<text class="desc">{{item.ownerName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">互市区</text>
+					<text class="desc">{{item.tradeAreaName}}</text>
+				</view>
+				<view class="item">
+					<text class="label">区域</text>
+					<text class="desc">{{item.area}}</text>
+				</view>
+				<view class="item">
+					<text class="label">经营范围</text>
+					<text class="desc">{{item.bnsScope}}</text>
+				</view>
+				<view class="item">
+					<text class="label">有效期</text>
+					<text class="desc">{{item.expiry}}</text>
+				</view>
+				<view class="item">
+					<text class="label">店铺地址</text>
+					<text class="desc">{{item.shopAddr}}</text>
+				</view>
+				<view class="item">
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				item: {}
+			}
+		},
+		onLoad(e) {
+			if(e.id) {
+				this.http.request({
+					url: '/level-one-server/app/TbShop/getDetailById',
+					data: { id: e.id },
+					success: res=> {
+						this.item = res.data.data;
+					}
+				})
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+
+<style lang="scss">
+	page {
+		background-color: $pg;
+	}
+</style>

+ 78 - 0
pages/shop/shop.vue

@@ -0,0 +1,78 @@
+<template>
+	<view>
+		<view class="goodsManageList">
+			<view class="item" v-for="(item, index) in list" :key="index" >
+				<view class="top">
+					<view class="title omit">{{ item.shopName }}</view>
+					<view class="state">
+						<text style="color: lightskyblue;font-weight: bold;" @click="detail(item.id)">详情></text>
+					</view>
+					<view class="clear"></view>
+				</view>
+				<view class="con">
+					<view style="float: left;margin-right: 10px;">铺主:{{item.ownerName}}</view>
+					<view style="">编号:{{item.shopNo}}</view>
+					<view class="tradeAreaName">{{ item.tradeAreaName }}</view>
+					<view class="date">区域:{{ item.area }}</view>
+				</view>
+				<view class="clear"></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>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				list: [],
+				loadMore: true,
+				param: { pageNo: 1, pageSize: 10 },
+			}
+		},
+		onLoad() {
+			this.getData();
+		},
+		methods: {
+			getData() {
+				this.http.request({
+					url: '/level-one-server/app/TbShop/getAppList',
+					success: res=> {
+						this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+						this.list.push(...res.data.data);
+					}
+				})
+			},
+			detail(id) {
+				uni.navigateTo({ url: '/pages/shop/detail?id=' + id });
+			},
+			//刷新数据
+			refresh() {
+				this.loadMore = true;
+				this.param.pageNo = 1;
+				this.list = [];
+				this.getData();
+			}
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			setTimeout(() => {
+				this.refresh();
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		//上拉加载
+		onReachBottom() {
+			if (this.loadMore) {
+				this.param.pageNo++;
+				this.getData();
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>