chenrui 4 years ago
parent
commit
b22a215445

+ 0 - 37
api/coupon.js

@@ -1,37 +0,0 @@
-import axios from '@/libs/axios.js';
-// 确认领取优惠券
-export const receivesCoupon = (params) => {
-	return axios.request({
-		url: `couponReceives/receivesCoupon`,
-		method: 'post',
-		data: params
-	})
-}
-
-// 根据券码查询优惠券信息
-export const couponData = (params) => {
-	return axios.request({
-		url: `coupon/findByCode/${params.couponCode}`,
-		method: 'get'
-	})
-}
-
-// 优惠券领取明细查询
-export const couponListFind = (params) => {
-	let url = `couponReceives/findPage/${params.pageNo}/${params.pageSize}`
-	delete params.pageNo
-	delete params.pageSize
-	return axios.request({
-		url: url,
-		method: 'post',
-		data: params
-	})
-}
-// 订单可用优惠券查询
-export const couponEnable = (params) => {
-	return axios.request({
-		url: 'couponReceives/findUsableCoupon',
-		method: 'post',
-		data: params
-	})
-}

+ 0 - 27
api/goods.js

@@ -1,27 +0,0 @@
-import axios from '@/libs/axios.js';
-
-// 获取商品分类
-export const getGoodsClass = params => {
-  return axios.request({
-    url: `goodsType/queryList`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 获取商品列表
-export const getGoodsList = params => {
-  return axios.request({
-    url: `goods/query/${params.pageNo}/${params.pageSize}`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 获取商品详情
-export const getGoodsDetail = params => {
-  return axios.request({
-    url: `goods/findById/${params.id}`,
-    method: 'get',
-  })
-};

+ 28 - 0
api/officialPartnerGoldLog.js

@@ -0,0 +1,28 @@
+import axios from '@/libs/axios.js';
+
+// 交易记录列表
+export const getGoldLogList = params => {
+	let url = `officialPartnerGoldLog/query/${params.pageNo}/${params.pageSize}`
+	delete params.pageNo
+	delete params.pageSize
+	return axios.request({
+		url: url,
+		method: 'post',
+		data: params
+	})
+};
+// 撤销单据
+export const GoldLogCancel = params => {
+  return axios.request({
+    url: `officialPartnerGoldLog/cancel/${params.id}`,
+    method: 'get',
+  })
+};
+
+// 总计乐豆数
+export const getUnFinishedOrder = params => {
+	return axios.request({
+	  url: `order/unFinishedOrderRunStatus`,
+	  method: 'get',
+	})
+}

+ 0 - 61
api/order.js

@@ -1,61 +0,0 @@
-import axios from '@/libs/axios.js';
-
-// 获取网点下的服务项目
-export const getStoreItems = params => {
-  return axios.request({
-    url: `item/storeItems/?storeId=${params.storeId}`,
-    method: 'get',
-  })
-};
-
-// 下单 保存订单
-export const saveOrder = params => {
-  return axios.request({
-    url: `order/save`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 下单 预支付
-export const signPay  = params => {
-  return axios.request({
-    url: `order/pay?orderId=${params.orderId}`,
-    method: 'get',
-  })
-};
-
-// 我的订单
-export const getOrderList = params => {
-	let url = `order/query/${params.pageNo}/${params.pageSize}`
-	delete params.pageNo
-	delete params.pageSize
-	return axios.request({
-		url: url,
-		method: 'post',
-		data: params
-	})
-};
-// 订单详情
-export const orderDetail = params => {
-  return axios.request({
-    url: `order/find/${params.id}`,
-    method: 'get',
-  })
-};
-
-// 查询当前是否有未完成的订单
-export const getUnFinishedOrder = params => {
-	return axios.request({
-	  url: `order/unFinishedOrderRunStatus`,
-	  method: 'get',
-	})
-}
-
-// 取消订单
-export const cancleOrder = params => {
-	return axios.request({
-	  url: `order/cancel/${params.id}`,
-	  method: 'get',
-	})
-}

+ 0 - 36
api/shoppingCart.js

@@ -1,36 +0,0 @@
-import axios from '@/libs/axios.js';
-
-// 添加商品到购物车
-export const addGoodsToCart = params => {
-  return axios.request({
-    url: `shoppingCart/addGoods`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 从购物车删除商品
-export const deleteGoodsFormCart = params => {
-  return axios.request({
-    url: `shoppingCart/deleteGoods`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 查询购物车列表
-export const getCartList = params => {
-  return axios.request({
-    url: `shoppingCart/queryList`,
-    method: 'post',
-	data: params
-  })
-};
-
-// 更新商品购买数量
-export const updateGoodsBuyQty = params => {
-  return axios.request({
-    url: `shoppingCart/updateGoodsBuyQty/${params.id}/${params.buyQty}`,
-    method: 'get'
-  })
-};

+ 0 - 40
components/uni-cart-fix/uni-cart-fix.vue

@@ -1,40 +0,0 @@
-<template>
-	 <view class="cart-fix" @click="toCart">
-	 	<u-image width="70rpx" height="70rpx" src="/static/cart.png"></u-image>
-	 	<u-badge absolute :offset="[15,10]" type="error" :count="count"></u-badge>
-	 </view>
-</template>
-	<script>
-		export default {
-			computed: {
-				count() {
-					let arr = this.$store.state.vuex_cartList
-					let count = 0
-					arr.map(item=>{
-						count = count + item.shoppingCartGoodsList.length
-					})
-					return count
-				},
-			},
-			methods: {
-				toCart() {
-					uni.navigateTo({
-						url:"/pages/cart/cart"
-					})
-				}
-			},
-		}
-	</script>
-
-<style lang="scss">
-	.cart-fix{
-		position: fixed;
-		z-index: 100000;
-		background: rgba($color: #ffffff, $alpha: 0.7);
-		padding: 10upx;
-		border-radius: 100%;
-		bottom: 40%;
-		right: 2%;
-		box-shadow: 3upx 3upx 8upx #ccc;
-	}
-</style>

+ 0 - 121
components/uni-coods/uni-coods.vue

@@ -1,121 +0,0 @@
-<template>
-	<view class="goods-list">
-		<view class="goods-item" v-for="item in list" :key="item.id" @click="toDetail(item)">
-			<view class="goods-imgs">
-				<view v-if="item.inventoryQty == 0" class="goods-staus">已售罄</view>
-				<u-lazy-load img-mode="scaleToFill" :height="imgHeight" :image="item.homeImage" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
-			</view>
-			<view class="name ellipsis-two">{{item.name}}</view>
-			<view class="price">
-				<view>
-					<text>{{item.sellGold}}</text>
-					<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
-				</view>
-				<view @click.stop="addCart(item)" v-if="item.inventoryQty > 0">
-					<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		props: {
-			imgHeight: {
-				type: Number,
-				default: 250
-			},
-			list:{
-				type: Array,
-				default: function(){
-					return []
-				}
-			}
-		},
-		data() {
-			return {
-				loadingImg: '/static/loading.gif',
-				errorImg: '/static/imgError.png',
-				timer: null,
-				finger: {x:0,y:0},
-				linePos: null
-			}
-		},
-		methods: {
-			// 加入购物车
-			addCart(item) {
-				uni.$emit("addCart",{goodsNo:item.goodsNo,buyQty:1})
-			},
-			// 商品详情
-			toDetail(item){
-				uni.navigateTo({
-					url:"/pages/goods/goodsDetail?id="+item.id
-				})
-			}
-		},
-	}
-</script>
-
-<style lang="scss" scoped>
-.goods-list{
-	display: flex;
-	flex-wrap: wrap;
-	justify-content: space-between;
-	padding-top: 20upx;
-	.goods-item{
-		background: #FFFFFF;
-		width: 48%;
-		margin-bottom: 5upx;
-		.goods-imgs{
-			position: relative;
-			border-radius: 28upx 28upx 0 0;
-			overflow: hidden;
-			.goods-staus{
-				width: 100%;
-				height: 100%;
-				position: absolute;
-				z-index: 100;
-				border-radius: 15rpx 15rpx 0 0;
-				background: rgba($color: #000000, $alpha: 0.4);
-				text-align: center;
-				line-height: 250rpx;
-				left: 0;
-				top: 0;
-				color: #eee;
-				font-size: 30upx;
-				font-weight: bold;
-			}
-		}
-		.name{
-			padding: 10upx 20upx 0;
-			font-weight: bold;
-		}
-		.price{
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 15upx 20upx;
-			text{
-				color: #d42a26;
-				font-size: 36upx;
-				margin-right: 6upx;
-				font-weight: bold;
-			}
-			>view{
-				&:first-child{
-					font-size: 22upx;
-					display: flex;
-					align-items: center;
-				}
-				&:last-child{
-					&:active{
-						opacity: 0.5;
-					}
-				}
-			}
-		}
-	}
-}
-
-</style>

+ 42 - 37
pages/index/index.vue

@@ -13,31 +13,32 @@
 			</view>
 			<image class="filter-icon" src="@/static/filter.png" @tap="openScreen=true"></image>
 		</view>
-		<scroll-view class="scroll-con" scroll-y @scrolltolower="onreachBottom">
+		<scroll-view class="scroll-con" scroll-y :scroll-top="scrollTop" @scrolltolower="onreachBottom">
 			<!-- 列表数据 -->
 			<view class="cell-item-con">
 				<view class="cell-item" v-for="(item, index) in listdata" :key="index">
 					<view class="cell-item-c">
 						<view class="cell-item-label">交易时间</view>
-						<view class="cell-item-main">{{item.creatDate}}</view>
+						<view class="cell-item-main">{{item.createDate}}</view>
 					</view>
 					<view class="cell-item-c">
 						<view class="cell-item-label">支付账户</view>
-						<view class="cell-item-main">{{item.account}}</view>
+						<view class="cell-item-main">{{item.customerMobile}}</view>
 					</view>
 					<view class="cell-item-c">
 						<view class="cell-item-label">交易数量(个)</view>
-						<view :class="['cell-item-main', item.num>0 ? 'red' : 'blue']">{{item.num > 0 ? '+' + item.num : item.num }}</view>
+						<view :class="['cell-item-main', item.changeType=='ADD' ? 'red' : 'blue']">{{item.changeType=='ADD' ? '+' : item.changeType=='SUB' ? '-' : ''}}{{ item.changeNum }}</view>
 					</view>
 					<view class="cell-item-c">
 						<view class="cell-item-label">备注</view>
-						<view class="cell-item-main">{{item.des ? item.des : '--'}}</view>
+						<view class="cell-item-main">{{item.remarks ? item.remarks : '--'}}</view>
 					</view>
 					<view class="cell-item-c handle-con">
 						<view class="cell-item-label">操作</view>
 						<view class="cell-item-main">
-							<u-button size="mini" v-if="item.state" class="handle-btn" hover-class="none" :custom-style="customBtnStyle" @click="revokeFun(item)">撤销单据</u-button>
-							<text v-else style="color: #909399;">单据已撤销</text>
+							<u-button size="mini" v-if="item.changeType=='ADD' && item.cancelFlag==0" class="handle-btn" hover-class="none" :custom-style="customBtnStyle" @click="revokeFun(item)">撤销单据</u-button>
+							<text v-if="item.changeType=='ADD' && item.cancelFlag==1" style="color: #909399;">单据已撤销</text>
+							<text v-if="item.changeType=='SUB'" style="color: #909399;">--</text>
 						</view>
 					</view>
 				</view>
@@ -51,17 +52,12 @@
 </template>
 <script>
 	import searchModal from './searchModal.vue'
+	import { getGoldLogList, GoldLogCancel } from '@/api/officialPartnerGoldLog.js'
 	export default {
 		components: { searchModal },
 		data() {
 			return {
-				listdata: [
-					{ creatDate: '2020-11-05 17:13', account: '15787878787', num: 154, state: 1, des: '备注备注备注11221备注'},
-					{ creatDate: '2020-11-05 17:13', account: '15787878787', num: -15, state: 1, des: '描述秒回的时刻萨菲科技尸鬼封尽看嘎是否1备注'},
-					{ creatDate: '2020-11-05 17:13', account: '15000000000', num: 4, state: 0, des: '备注备注备注11221备注'},
-					{ creatDate: '2020-11-05 17:13', account: '15787878787', num: -8, state: 1, des: ''},
-					{ creatDate: '2020-11-05 17:13', account: '15787878787', num: 50, state: 0, des: '备注备注备注11221备注'},
-				],
+				listdata: [],
 				pageNo: 1,  //  当前页码
 				pageSize: 10,  //  每页条数
 				total: 0,  //  数据总条数
@@ -71,13 +67,14 @@
 				searchForm: {  //  查询条件
 					beginDate: '',  //  创建时间默认筛选近7天
 					endDate: '',  //  创建时间默认筛选近7天
-					account: ''  //  支付账户
+					customerMobile: ''  //  支付账户
 				},
 				customBtnStyle: {  //  撤销单据  自定义按钮样式
 					borderColor: '#2ab4e5',
 					backgroundColor: '#2ab4e5',
 					color: '#fff'
-				}
+				},
+				scrollTop: 0,  //  滚动条位置
 			}
 		},
 		onShow() {
@@ -93,13 +90,18 @@
 			},
 			//  撤销单据
 			revokeFun(row){
-				let _this = this
+				const _this = this
 				uni.showModal({
 				  title: '提示',
 				  content: '撤销单据后乐豆将全部退回给原支付账号,确认撤销吗?',
 				  success(res) {
 				    if (res.confirm) {
-				      
+				      GoldLogCancel({ id: row.id }).then(ret => {
+						  if(ret.status == 200){
+							  uni.showToast({ title: ret.message, icon: 'none' })
+							  _this.searchHandle(1)
+						  }
+					  })
 				    }
 				  }
 				})
@@ -108,26 +110,29 @@
 			searchHandle (pageNo) {
 				this.status = "loading"
 				pageNo ? this.pageNo = pageNo : null
-				// searchSuppliers({
-				// 	pageNo: this.pageNo,
-				// 	pageSize: this.pageSize,
-				// 	queryWord: this.queryValue
-				// }).then(res => {
-				// 	if (res.status == 200) {
-				// 		if(this.pageNo>1){
-				// 			this.listdata = this.listdata.concat(res.data.list || [])
-				// 		}else{
-				// 			this.listdata = res.data.list || []
-				// 		}
-				// 		this.total = res.data.count || 0
-				// 		this.listdata.length == 0 && this.queryValue != '' ? this.noDataText = '没有搜索到相关结果' : this.noDataText = '暂无数据'
-				// 	} else {
-				// 		this.noDataText = res.message
-				// 		this.listdata = []
-				// 		this.total = 0
-				// 	}
+				getGoldLogList({
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					beginDate: this.searchForm.beginDate,
+					endDate: this.searchForm.endDate,
+					customerMobile: this.searchForm.customerMobile
+				}).then(res => {
+					if (res.status == 200) {
+						if(this.pageNo>1){
+							this.listdata = this.listdata.concat(res.data.list || [])
+						}else{
+							this.listdata = res.data.list || []
+							this.scrollTop = 0
+						}
+						this.total = res.data.count || 0
+						this.noDataText = '暂无数据'
+					} else {
+						this.noDataText = res.message
+						this.listdata = []
+						this.total = 0
+					}
 					this.status = "loadmore"
-				// })
+				})
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {

+ 4 - 4
pages/index/searchModal.vue

@@ -8,7 +8,7 @@
 					<u-input clearable v-model="form.time" disabled placeholder="请选择支付时间区间" class="form-item-inp" @click="openPicker" />
 					<u-icon v-show="form.time.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearTime"></u-icon>
 				</u-form-item>
-				<u-form-item label="支付账号" prop="storeName" class="form-item"><u-input v-model="form.storeName" :maxlength="30" placeholder="请输入支付账号" /></u-form-item>
+				<u-form-item label="支付账号" prop="customerMobile" class="form-item"><u-input v-model="form.customerMobile" :maxlength="30" placeholder="请输入支付账号" /></u-form-item>
 			</u-form>
 			<view class="uni-list-btns">
 				<u-button class="handle-btn search-btn" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
@@ -70,7 +70,7 @@ export default {
 			showPicker: false, // 是否显示时间弹窗
 			form: {
 				time: '', // 发起时间区间
-				storeName: '', // 门店名称
+				customerMobile: '', // 门店名称
 			},
 			beginDate: null, // 开始时间
 			endDate: null // 结束时间
@@ -87,7 +87,7 @@ export default {
 			}
 			this.beginDate = this.defaultParams.beginDate ? this.defaultParams.beginDate : ''
 			this.endDate = this.defaultParams.endDate ? this.defaultParams.endDate : ''
-			this.form.storeName = this.defaultParams.storeName ? this.defaultParams.storeName : ''
+			this.form.customerMobile = this.defaultParams.customerMobile ? this.defaultParams.customerMobile : ''
 		},
 		//  清空创建时间
 		clearTime(){
@@ -115,7 +115,7 @@ export default {
 			let params = {
 				beginDate: this.beginDate,
 				endDate: this.endDate,
-				storeName: this.form.storeName,
+				customerMobile: this.form.customerMobile,
 			};
 			this.$emit('refresh', params)
 			this.isShow = false

+ 0 - 1
pages/login/login.vue

@@ -192,7 +192,6 @@ export default {
 			});
 		},
 		toMain() {
-			console.log('跳转')
 			// 跳转到首页
 			uni.switchTab({
 				url: '/pages/index/index'

+ 1 - 7
pages/userCenter/changePwd.vue

@@ -5,7 +5,7 @@
 			<view class="input-group">
 				<view class="input-row border">
 					<text class="title">原密码:</text>
-					<m-input class="m-input"  type="password"  displayable v-model="formCustom.oldPwd" placeholder="请输入原密码"></m-input>
+					<m-input class="m-input" :maxlength="30"  type="password"  displayable v-model="formCustom.oldPwd" placeholder="请输入原密码"></m-input>
 				</view>
 				<view class="input-row">
 					<text class="title">新密码:</text>
@@ -19,12 +19,6 @@
 		</view>
 		<!-- 消息提醒弹窗 -->
 		<view class="form-footer-btn">
-			<!-- <button @click="handleReset" type="info">
-				重置
-			</button>
-			<button @click="handleSubmit" :loading="loading" type="primary">
-				保存
-			</button> -->
 			<u-button size="medium" hover-class="none" @click="handleReset">重置</u-button>
 			<u-button size="medium" hover-class="none" :loading="loading" :custom-style="customBtnStyle" @click="handleSubmit">保存</u-button>
 		</view>