فهرست منبع

1.fix bug 2.花掌柜端(hdApp)--“我的”添加现金版块

shizhongqi 4 ماه پیش
والد
کامیت
6cb0ecc8ef

+ 120 - 2
hdApp/src/admin/home/me.vue

@@ -60,6 +60,25 @@
         </view>
         </template>
 
+        <!-- 添加现金模块 -->
+        <view class="account-info_box content_box">
+          <view class="info-lf_box">
+            <view class="balance-title">
+              <text>现金(元)</text>
+              <text class="contact-service" @click.stop="suggest()">联系客服</text>
+            </view>
+            <view class="balance-amount"> 
+              <text class="currency">¥</text> 
+              <span>{{ myInfo.money||0 }}</span>
+            </view>
+            <view class="balance-actions cash-actions">
+              <text class="action-btn" @click="pageTo({ url: '/admin/home/moneyChangeList' })">变动明细</text>
+              <text class="action-btn" @click="outAmountFn">取出</text>
+              <text class="action-btn" @click="inAmountFn">存入</text>
+            </view>
+          </view>
+        </view>
+
         <view class="module-com content_box user-open_bx">
           <view class="settings-group">
 
@@ -191,6 +210,31 @@
         </view>
       </view>
     </uni-popup>
+
+    <modal-module :show="outAmountShow" @click="outAmountConfirm" :maskClosable="true" title="提取金额" padding="30rpx 30rpx" >
+      <template v-slot:content>
+        <view class="app-modal-input-wrap">
+        <view class="inp-list-line">
+          <view class="line-input">
+          <input type="digit" ref="input" style="width:61.8%;text-align:center;" v-model="outAmount" :adjust-position="false" class="inp-input" />
+          </view>
+        </view>
+        </view>
+      </template>
+    </modal-module>
+
+    <modal-module :show="inAmountShow" @click="inAmountConfirm" :maskClosable="true" title="存入金额" padding="30rpx 30rpx" >
+      <template v-slot:content>
+        <view class="app-modal-input-wrap">
+        <view class="inp-list-line">
+          <view class="line-input">
+          <input type="digit" ref="input" style="width:61.8%;text-align:center;" v-model="inAmount" :adjust-position="false" class="inp-input" />
+          </view>
+        </view>
+        </view>
+      </template>
+    </modal-module>
+
     <custom-tab-bar :current="4" />
   </view>
 </template>
@@ -199,11 +243,13 @@ import AppAvatarModule from "@/components/module/app-avatar";
 import TuiListCell from "@/components/plugin/list-cell";
 import { mainMy, applyCash } from "@/api/home";
 import { modifySjName } from "@/api/shop";
+import { inMoney, outMoney } from "@/api/shop-money";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import { selectShop } from "@/mixins";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
 import NotLogin from "@/components/not-login";
+import ModalModule from "@/components/plugin/modal";
 import { clearLogin } from "@/api/admin";
 import { APP_VERSION } from "@/config";
 export default {
@@ -212,7 +258,8 @@ export default {
     AppAvatarModule,
     TuiListCell,
     DorpdownSelect,
-    NotLogin
+    NotLogin,
+    ModalModule
   },
   mixins: [selectShop, list],
   computed: {
@@ -224,7 +271,13 @@ export default {
       myInfo:{},
       version:'1.0.0',
       lookMoney:0,
-      editName: ''
+      editName: '',
+      inAmount:'',
+      outAmount:'',
+      outAmountShow:false,
+      inAmountShow:false,
+      inAmountFocus:false,
+      outAmountFocus:false
     };
   },
   onPullDownRefresh () {
@@ -351,6 +404,60 @@ export default {
     changeShop() {
       this.$util.pageTo({ url: "/admin/shop/myShop"});
     },
+    inAmountFn(){
+      this.inAmountShow = true
+      setTimeout(x => {
+        this.$nextTick(() => this.setInAmountFocus())
+      }, 200)
+    },
+    setInAmountFocus(){
+      this.inAmountFocus = true
+    },
+    outAmountFn(){
+      this.outAmountShow = true
+      setTimeout(x => {
+        this.$nextTick(() => this.setOutAmountFocus())
+      }, 200)
+    },
+    setOutAmountFocus(){
+      this.outAmountFocus = true
+    },
+    outAmountConfirm(val){
+      let that=this;
+      if (val.index == 0) {
+        that.outAmountShow = false
+        return
+      }
+      if(that.$util.isEmpty(that.outAmount) || Number(that.outAmount)<=0){
+        that.$msg('请填写金额')
+        return false
+      }
+      outMoney({amount:that.outAmount}).then(res=>{
+        if(res.code == 1){
+          that.$msg('操作成功')
+          that.outAmountShow = false
+          that.getMyInfo()
+        }
+      })
+    },
+    inAmountConfirm(val){
+      let that=this;
+      if (val.index == 0) {
+        that.inAmountShow = false
+        return
+      }
+      if(that.$util.isEmpty(that.inAmount) || Number(that.inAmount)<=0){
+        that.$msg('请填写金额')
+        return false
+      }
+      inMoney({amount:that.inAmount}).then(res=>{
+        if(res.code == 1){
+          that.$msg('操作成功')
+          that.inAmountShow = false
+          that.getMyInfo()
+        }
+      })
+    },
     getMyInfo () {
       mainMy().then(res=>{
         if(res.code == 1){
@@ -611,6 +718,10 @@ export default {
           flex-basis: 100%;
           margin-bottom: 8upx;
         }
+        &.cash-actions > text:first-child {
+          flex-basis: auto;
+          margin-bottom: 0;
+        }
         & .action-btn {
           border: 1upx solid #e5e5e5;
           border-radius: 20upx;
@@ -632,6 +743,13 @@ export default {
       height: 50upx;
       border-radius: 25upx;
     }
+    & .to-cash {
+      margin-left:30upx;
+      border: 1upx solid rgba(0, 0, 0, 0.2);
+      border-radius: 25upx;
+      font-size: 22upx;
+      padding: 6upx 17upx 6upx 17upx;
+    }
   }
   & .user-open_bx {
     margin-top: 20upx;

+ 80 - 0
hdApp/src/admin/home/moneyChangeList.vue

@@ -0,0 +1,80 @@
+<template>
+<view class="app-content">
+		<block v-if="!$util.isEmpty(list.data)">
+			<t-table :headerBackgroundColor="'#F0F2F6'">
+				<t-tr header>
+					<t-th><view style="width:150upx;">来源</view></t-th>
+					<t-th><view style="width:200upx;">事项</view></t-th>
+					<t-th>金额</t-th>
+					<t-th>余额</t-th>
+				</t-tr>
+				<view v-for="(item, index) in list.data" :key="index" @click="goDetail(item)">
+					<t-tr>
+						<t-td align="center" color="info">
+							<view style="width:150upx;">
+								<view>{{ item.addTime.substr(5,11) }}</view>
+								<view>{{item.ptStyle==1?'零售':'批发'}}</view>
+							</view>
+						</t-td>
+						<t-td align="center" color="info"><view style="width:200upx;">{{ item.event }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.amount) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
+					</t-tr>
+				</view>
+			</t-table>
+		</block>
+		<block v-else>
+			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+		</block>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { changeList } from '@/api/shop-money'
+import list from '@/mixins/list'
+export default {
+	name: "cashList",
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+		};
+	},
+	methods: {
+		async init(){
+			const res = await changeList({
+				page:this.list.page,tx:0
+			})
+			if (this.$util.isEmpty(res.data.list)){
+				this.completes(res)
+				return
+			}
+			let currentList = res.data.list
+			currentList.forEach(function(item,index,array){
+				array[index].amount = item.io ==0 ? '-'+item.amount : '+'+item.amount
+			});
+			res.data.list = currentList
+			this.completes(res)
+		},
+		goDetail(item){
+		}
+	},
+	async onPullDownRefresh() {
+		this.resetList();
+		await this.init()
+		uni.stopPullDownRefresh();
+	},
+	async onReachBottom() {
+		if (!this.list.finished) {
+			await this.init()
+			uni.stopPullDownRefresh();;
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	
+};
+</script>
+<style lang="scss" scoped></style>

+ 13 - 0
hdApp/src/api/shop-money/index.js

@@ -0,0 +1,13 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+export const changeList = data => {
+	return https.get('/shop-money/money-change-list', data)
+}
+
+export const inMoney = data => {
+	return https.get('/shop-money/in', data)
+}
+
+export const outMoney = data => {
+	return https.get('/shop-money/out', data)
+}

+ 1 - 0
hdApp/src/pages.json

@@ -12,6 +12,7 @@
 		{"path": "admin/home/register","style": {"navigationBarTitleText": "服务协议"}},
 		{"path": "admin/home/privacy","style": {"navigationBarTitleText": "隐私政策"}},
 		{ "path": "admin/home/me", "style": { "navigationBarTitleText": "我的", "enablePullDownRefresh": true, "navigationStyle": "custom" } },
+		{ "path": "admin/home/moneyChangeList", "style": { "navigationBarTitleText": "变动明细", "enablePullDownRefresh": true } },
 		{ "path": "admin/home/edit", "style": { "navigationBarTitleText": "花店信息" } },
 		{"path": "common/success","style": {"navigationBarBackgroundColor": "#ffffff","navigationBarTextStyle": "black"}},
 		{"path": "common/webview","style": {"navigationBarTitleText": "网页","navigationBarBackgroundColor": "#ffffff","navigationBarTextStyle": "black"}}

+ 3 - 3
mallApp/src/pages/member/recharge.vue

@@ -204,8 +204,8 @@ export default {
 						this.hdId = that.hdInfo.id
 					}
 
-					const itemType = res.data.itemType;
-					const itemList = res.data.itemList;
+					const itemType = res.data.itemType || '';
+					const itemList = res.data.itemList || [];
 					if(itemType == 'hb'){
 						let list = itemList.list || [];
 						let map = new Map();
@@ -243,7 +243,7 @@ export default {
 						this.itemList.sort((a, b) => a.amount - b.amount);
 					}else{
 						//报错提示
-						this.$msg('数据异常')
+						//this.$msg('数据异常')
 						return false
 					}
 				}

+ 3 - 3
mallApp/src/pages/member/rechargeResult.vue

@@ -20,7 +20,7 @@
           </view>
 
           <view class="confirm-btn-wrap">
-            <button v-if="moneyType == 'hb'" class="confirm-btn btn-primary" @click="myHb">我的红包</button>
+            <button v-if="itemType == 'hb'" class="confirm-btn btn-primary" @click="myHb">我的红包</button>
             <button class="confirm-btn" @click="goBack">返回</button>
           </view>
         </view>
@@ -43,7 +43,7 @@ export default {
     return {
       actionType:0,//0充值 1结账
       hdInfo:{},
-      moneyType:'',
+      itemType:'', //hb:送红包 money:送钱
       form:{
         name:''
       },
@@ -65,7 +65,7 @@ export default {
           this.hdInfo = res.data.hd ? res.data.hd : {}
           let balance = this.hdInfo.balance ? this.hdInfo.balance : 0
           this.actionType = Number(balance)>0 ? 0 : 1
-          this.moneyType = res.data.moneyType ? res.data.moneyType : ''
+          this.itemType = res.data.itemType ? res.data.itemType : ''
         }
       })
       this.getUserInfo()