lihongxiao 1 anno fa
parent
commit
fbe90a2f6d

+ 12 - 0
common/router/modules/routes.js

@@ -453,6 +453,18 @@ const routes = [{
 		meta: {
 			title: '余额账单',
 		},
+	},{
+		path: '/pages/financial/balanceBean',
+		name: 'balanceBean',
+		meta: {
+			title: '金豆账单',
+		},
+	},{
+		path: '/pages/financial/balancePonts',
+		name: 'balancePonts',
+		meta: {
+			title: '积分账单',
+		},
 	},
 ]
 export default routes

+ 6 - 0
pages.json

@@ -335,6 +335,12 @@
 		},{
 			"path": "pages/financial/balanceBill",
 			"style": {}
+		},{
+			"path": "pages/financial/balancePonts",
+			"style": {}
+		},{
+			"path": "pages/financial/balanceBean",
+			"style": {}
 		}
 		
 	],

+ 61 - 30
pages/coupon/activity.vue

@@ -11,17 +11,19 @@
                 <span @click="searchList">搜索</span>
             </view>
             <view class="type">
-                <text style="margin-right: 10px;" :style="showCategoryPopup?'color: #449AFF;':''" @click="showCategoryPopup = !showCategoryPopup">{{ selectedCategory ||
-                    '全部类型' }}<i :class="showCategoryPopup?'typeI':''"></i></text>
+                <text style="margin-right: 10px;" :style="showCategoryPopup ? 'color: #449AFF;' : ''"
+                    @click="showCategoryPopup = !showCategoryPopup">{{ selectedCategory ||
+                        '全部类型' }}<i :class="showCategoryPopup ? 'typeI' : ''"></i></text>
                 <!-- <u-select style="position: absolute;top:0" mode="single-column" :list="industryoptions"
                     v-model="industryShow" label-name="lable" value-name="value"
                     @confirm="industryopConfirm($event)"></u-select> -->
             </view>
         </view>
-           <!-- 弹出层 -->
-           <view :class="['dropdown-content', { 'show': showCategoryPopup }]" @tap="searchPopup">
+        <!-- 弹出层 -->
+        <view :class="['dropdown-content', { 'show': showCategoryPopup }]" @tap="searchPopup">
             <view class="dropdown-content2">
-                <view :class="['dropdown-content1', 'flex', 'justify-between', '', { 'scolcentent': showCategoryPopup }]"
+                <view
+                    :class="['dropdown-content1', 'flex', 'justify-between', '', { 'scolcentent': showCategoryPopup }]"
                     @tap.stop.prevent>
                     <scroll-view scroll-y class="colcentent">
                         <view class="category-content">
@@ -53,10 +55,10 @@
                             </scroll-view>
                         </view>
                     </scroll-view>
-                
+
                 </view>
                 <view class="operateBtn flex ">
-                    <view class="cancel " @click.stop="showCategoryPopup=false">
+                    <view class="cancel " @click.stop="showCategoryPopup = false">
                         取消
                     </view>
                     <view class="confirm " @click.stop="querysearch">
@@ -64,7 +66,7 @@
                     </view>
                 </view>
             </view>
-          
+
         </view>
         <view class="top"></view>
         <view class="content">
@@ -106,14 +108,14 @@
                 :disabled="this.selectedIds.length == 0">确定</button>
 
         </view>
-     
+
     </view>
 </template>
 <script>
 import { USER_INFO } from "@/common/util/constants"
 import {
-		mapState
-	} from 'vuex'
+    mapState
+} from 'vuex'
 
 export default {
     data() {
@@ -134,15 +136,15 @@ export default {
             selectedCategory: '全部类型',
             industryShow: false,
             rowDetail: {},
-            categoryId:''
+            categoryId: ''
         }
     },
     onLoad(e) {
-        
+
         this.getList()
         this.$http.get('/sys/category/getChildListBatch?parentIds=1889836358116098050').then(res => {
             if (res.data.success) {
-                this.firstLevel=res.data.result.records
+                this.firstLevel = res.data.result.records
             }
             else {
                 this.$tip.error(res.data.message);
@@ -157,17 +159,17 @@ export default {
 
     },
     methods: {
-        async  getSearch(id,type){
-            let res=await this.$http.get('/sys/category/childList?pid=' + id)
-            if(res.data.success){
-                this[type+'Level']=res.data.result
+        async getSearch(id, type) {
+            let res = await this.$http.get('/sys/category/childList?pid=' + id)
+            if (res.data.success) {
+                this[type + 'Level'] = res.data.result
             }
         },
         searchPopup() {
             this.showCategoryPopup = !this.showCategoryPopup;
         },
         getList() {
-            this.$http.post('/merchant/localVoucherInfo/getProductList', { merchantId: uni.getStorageSync(USER_INFO).merchantId, productName: this.productName,categoryId:this.categoryId }).then(res => {
+            this.$http.post('/merchant/localVoucherInfo/getProductList', { merchantId: uni.getStorageSync(USER_INFO).merchantId, productName: this.productName, categoryId: this.categoryId }).then(res => {
                 if (res.data.success) {
                     this.productList = res.data.result
                 }
@@ -183,7 +185,7 @@ export default {
             this.selectedThird = null
             this.selectedCategory = item.name
             // 根据选择加载二级分类
-            this.getSearch(item.id,'second')
+            this.getSearch(item.id, 'second')
             this.thirdLevel = []
         },
 
@@ -192,7 +194,7 @@ export default {
             this.selectedThird = null
             this.selectedCategory = item.name
             // 根据选择加载三级分类
-            this.getSearch(item.id,'third')
+            this.getSearch(item.id, 'third')
 
         },
 
@@ -200,18 +202,39 @@ export default {
             this.selectedThird = item.id
             this.selectedCategory = item.name
         },
-        querysearch(){
+        querysearch() {
             this.showCategoryPopup = false
-            this.categoryId=this.selectedThird?this.selectedThird:this.selectedSecond?this.selectedSecond:this.selectedFirst
+            this.categoryId = this.selectedThird ? this.selectedThird : this.selectedSecond ? this.selectedSecond : this.selectedFirst
             this.getList()
         },
         groupChange(e) {
             if (e == 1) {
                 this.selectedIds = !this.selectAll ? this.productList.map(item => item.productId) : []
                 this.selectAll = !this.selectAll
+                this.invertAll = false
             }
             if (e == 2) {
+                // 反选功能
                 this.invertAll = !this.invertAll
+                this.selectAll = false
+                // 获取所有商品ID
+                const allProductIds = this.productList.map(item => item.productId)
+
+                // 创建新的选中数组
+                let newSelectedIds = []
+
+                // 遍历所有商品ID
+                allProductIds.forEach(productId => {
+                    // 如果当前ID不在已选中列表中,则添加到新列表
+                    // 如果当前ID在已选中列表中,则不添加(即取消选中)
+                    if (!this.selectedIds.includes(productId)) {
+                        newSelectedIds.push(productId)
+                    }
+                })
+
+                // 更新选中列表
+                this.selectedIds = newSelectedIds
+
             }
         },
         searchList() {
@@ -237,12 +260,14 @@ export default {
                 delta: 1
             });
             if (this.selectedIds.length > 0) {
-                this.$store.state.shopSelectedIds=this.selectedIds
+                this.$store.state.shopSelectedIds = this.selectedIds
                 // uni.setStorageSync('allowanceSelected', this.selectedIds)
             }
         },
         // 单选按钮变化处理
         handleRadioChange(id) {
+           this. selectAll =false;
+           this. invertAll = false
             // 判断是否已存在
             const index = this.selectedIds.indexOf(id)
             if (index > -1) {
@@ -308,7 +333,7 @@ export default {
     border-bottom: 1px solid #EEEEEE;
     background: #fff;
     padding: 16rpx 24rpx;
-   
+
     .type {
         background: #FFFFFF;
         font-size: 26rpx;
@@ -327,7 +352,8 @@ export default {
             border-right: 4px solid transparent;
             border-left: 4px solid transparent;
         }
-        .typeI{
+
+        .typeI {
             border-color: #449AFF;
             border-top: 4px solid transparent;
             border-right: 4px solid transparent;
@@ -455,16 +481,18 @@ export default {
         color: #999;
     }
 }
+
 .operateBtn {
     font-weight: bold;
     font-size: 28rpx;
     text-align: center;
+
     .cancel {
         width: 50%;
         height: 70rpx;
         color: #449AFF;
         line-height: 70rpx;
-        background: rgba(68,154,255,0.05);
+        background: rgba(68, 154, 255, 0.05);
     }
 
     .confirm {
@@ -472,8 +500,8 @@ export default {
         height: 70rpx;
         line-height: 70rpx;
         color: #fff;
-        background: #449AFF ;
-        border-radius: 0px 0px 20rpx 0px ;
+        background: #449AFF;
+        border-radius: 0px 0px 20rpx 0px;
 
     }
 }
@@ -498,9 +526,10 @@ export default {
     padding: 20rpx 20rpx;
     font-size: 26rpx;
     color: #333;
+
     // border-bottom: 1px solid #f5f5f5;
     &.active {
-        background: rgba(68,154,255,0.1);
+        background: rgba(68, 154, 255, 0.1);
         color: #2983EC;
     }
 }
@@ -532,6 +561,7 @@ export default {
     transition: height 0.4s ease;
     // border-radius: 0px 0px 20rpx 20rpx;
 }
+
 .dropdown-content2 {
     background-color: #fff;
     // height: 0px;
@@ -541,6 +571,7 @@ export default {
     margin-bottom: 10px;
 
 }
+
 .scolcentent {
     height: 486rpx;
     overflow-y: auto;

+ 8 - 1
pages/coupon/creatDiscount.vue

@@ -423,6 +423,12 @@ export default {
 					icon: 'none'
 				});
 				return
+			}  else if (this.form.number == '0' || this.form.number == 0) {
+				uni.showToast({
+					title: '库存不能为0',
+					icon: 'none'
+				});
+				return
 			} else if (!this.form.beginTime && !this.form.endTime) {
 				uni.showToast({
 					title: '请选择有效时间',
@@ -499,9 +505,10 @@ export default {
 			this.$http.get("/merchant/localCouponInfo/queryById?id=" + this.productId).then(res => {
 				if (res.data.success) {
 					res.data.result.couponRangeInfo = res.data.result.couponRangeInfo ? res.data.result.couponRangeInfo.split(',').filter(id => id) : []
-					res.data.result.couponPhoto = res.data.result.couponPhoto && res.data.result.couponPhoto !== null ? res.data.result.couponPhoto.split(',').filter(id => id) : []
+					res.data.result.couponPhoto = res.data.result.couponPhoto!== null && res.data.result.couponPhoto.length>0? res.data.result.couponPhoto.split(',').filter(id => id) : []
 					res.data.result.couponWay = res.data.result.couponWay ? res.data.result.couponWay + '' : ''
 					res.data.result.repeatClaim = res.data.result.repeatClaim && res.data.result.repeatClaim == '1' ? true : false
+					this.headPhotoImg=res.data.result.couponPhoto
 					this.showDate = res.data.result.beginTime + '-' + res.data.result.endTime
 					this.form = res.data.result
 				}

+ 8 - 1
pages/coupon/creatReduction.vue

@@ -365,6 +365,12 @@ export default {
 					icon: 'none'
 				});
 				return
+			}  else if (this.form.number == '0' || this.form.number == 0) {
+				uni.showToast({
+					title: '库存不能为0',
+					icon: 'none'
+				});
+				return
 			} else if (this.form.couponWay == null) {
 				uni.showToast({
 					title: '请选择领取方式',
@@ -433,9 +439,10 @@ export default {
 			this.$http.get("/merchant/localCouponInfo/queryById?id=" + this.productId).then(res => {
 				if (res.data.success) {
 					res.data.result.couponRangeInfo = res.data.result.couponRangeInfo ? res.data.result.couponRangeInfo.split(',').filter(id => id) : []
-					res.data.result.couponPhoto = res.data.result.couponPhoto && res.data.result.couponPhoto !== null ? res.data.result.couponPhoto.split(',').filter(id => id) : []
+					res.data.result.couponPhoto = res.data.result.couponPhoto!== null && res.data.result.couponPhoto.length>0? res.data.result.couponPhoto.split(',').filter(id => id) : []
 					res.data.result.couponWay = res.data.result.couponWay ? res.data.result.couponWay + '' : ''
 					res.data.result.repeatClaim = res.data.result.repeatClaim && res.data.result.repeatClaim=='1'? true: false
+					this.headPhotoImg=res.data.result.couponPhoto
 					this.showDate = res.data.result.beginTime + '-' + res.data.result.endTime
 					this.form = res.data.result
 				}

+ 9 - 2
pages/coupon/creatcoupon.vue

@@ -357,7 +357,13 @@ export default {
 					icon: 'none'
 				});
 				return
-			}  else if (!this.form.beginTime || !this.form.endTime) {
+			}   else if (this.form.number == '0' || this.form.number == 0) {
+				uni.showToast({
+					title: '库存不能为0',
+					icon: 'none'
+				});
+				return
+			} else if (!this.form.beginTime || !this.form.endTime) {
 				uni.showToast({
 					title: '请选择有效时间',
 					icon: 'none'
@@ -450,11 +456,12 @@ export default {
 			this.$http.get("/merchant/localVoucherInfo/queryById?id="+this.productId ).then(res => {
 				if(res.data.success){
 					res.data.result.voucherRangeInfo=res.data.result.voucherRangeInfo?res.data.result.voucherRangeInfo.split(',').filter(id => id ):[]
-					res.data.result.voucherPhoto=res.data.result.voucherPhoto && res.data.result.voucherPhoto!==null?res.data.result.voucherPhoto.split(',').filter(id => id ):[]
+					res.data.result.voucherPhoto=res.data.result.voucherPhoto!==null && res.data.result.voucherPhoto.length>0?res.data.result.voucherPhoto.split(',').filter(id => id ):[]
 					res.data.result.conditionsUse = res.data.result.conditions == '0' ? '1' : '2'
 					res.data.result.voucherWay = res.data.result.voucherWay? res.data.result.voucherWay+'':''
 					this.voucherWayInfo1=res.data.result.voucherWay=='1'?res.data.result.voucherWayInfo:''
 					this.voucherWayInfo2=res.data.result.voucherWay=='2'?res.data.result.voucherWayInfo:''
+					this.headPhotoImg=res.data.result.voucherPhoto
 					this.showDate = res.data.result.beginTime + '-' + res.data.result.endTime
 					this.form=res.data.result
 				}

+ 473 - 0
pages/financial/balanceBean.vue

@@ -0,0 +1,473 @@
+<template>
+    <view class="creat">
+        <cu-custom bgColor="bg-fff" :isBack="true">
+            <block slot="content">金豆账单</block>
+        </cu-custom>
+        <view class="fix">
+            <view class="balanceBill-con">
+                <text style="margin-right: 10px;" :style="showCategoryPopup ? 'color: #449AFF;' : ''"
+                    @click="showCategoryPopup = !showCategoryPopup">全部账单<i
+                        :class="showCategoryPopup ? 'typeI' : ''"></i></text>
+            </view>
+            <view class="beans-list">
+                <!-- 顶部月份和总额 -->
+                <view class="header">
+
+                    <picker mode="date" :value="dateTime" fields="month" @change="bindDateChange">
+                        <view class="month-select">
+                            <text>{{ this.dateTime }}</text>
+                            <u-icon name="arrow-down" size="24"></u-icon>
+                        </view>
+                    </picker>
+                    <view>
+                        <text class="total-amount" style="margin-right: 18rpx;"> 支出¥{{ expense || 0 }}</text>
+                        <text class="total-amount">收入¥{{ income || 0 }}</text>
+                    </view>
+                </view>
+            </view>
+        </view>
+        <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
+            <!-- 明细列表 -->
+            <view class="list-content">
+                <view class="list-item" v-for="(item, index) in listData" :key="index">
+                    <view class="item-info">
+                        <view class="item-left">
+                            <image v-if="item.typeCode == '1'" class="icon-wrapper"
+                                src="/static/financial/yue/icon (6).png"></image>
+                            <image v-if="item.typeCode == '2'" class="icon-wrapper"
+                                src="/static/financial/jindou/icon (1).png"></image>
+                            <image v-if="item.typeCode == '3'" class="icon-wrapper"
+                                src="/static/financial/yue/icon (7).png"></image>
+                            <image v-if="item.typeCode == '4'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (3).png"></image>
+                            <image v-if="item.typeCode == '5'" class="icon-wrapper"
+                                src="/static/financial/jindou/icon (2).png"></image>
+                            <image v-if="item.typeCode == '6'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (4).png"></image>
+                            <image v-if="item.typeCode == '7'" class="icon-wrapper"
+                                src="/static/financial/jindou/icon.png"></image>
+                            <image v-if="item.typeCode == '8'" class="icon-wrapper"
+                                src="/static/financial/jindou/icon (3).png"></image>
+                            <image v-if="item.typeCode == '9'" class="icon-wrapper"
+                                src="/static/financial/jindou/icon (4).png"></image>
+                            <text class="item-title">{{ item.type }}</text>
+                        </view>
+                        <text class="item-time">{{ item.createTime }}</text>
+                    </view>
+                    <text class="item-amount" :class="{ 'income': item.amount > 0 }">
+                        {{ item.amount }}
+                    </text>
+                </view>
+            </view>
+        </mescroll-uni>
+
+        <u-popup v-model="showCategoryPopup" :round="10" mode="bottom ">
+            <view class="payment-popup">
+                <view class="popup-header">
+                    <text class="popup-title">全部账单</text>
+                    <view class="popup-icon">
+                        <u-icon name="close" size="20" @click="closePopup"></u-icon>
+                    </view>
+                </view>
+                <view>
+                    <!-- 收支类型 -->
+                    <view class="filter-section">
+                        <view class="section-title">收支类型</view>
+                        <view class="radio-group">
+                            <view class="radio-item" :class="{ active: changeType === '999' }"
+                                @tap="selectIncomeType('999')">全部</view>
+                            <view class="radio-item" :class="{ active: changeType === '2' }"
+                                @tap="selectIncomeType('2')">支出</view>
+                            <view class="radio-item" :class="{ active: changeType === '1' }"
+                                @tap="selectIncomeType('1')">收入</view>
+                        </view>
+                    </view>
+
+                    <!-- 交易类型 -->
+                    <view class="filter-section">
+                        <view class="section-title">交易类型</view>
+                        <view class="transaction-types">
+                            <view class="radio-item" :class="{ active: transType === '999' }"
+                                @tap="selectTransType('999')">全部</view>
+                            <view class="radio-item" v-for="(val, index) in cashTypeArr" :key="index" :class="{
+                                active: transType === val.code,
+                                disabled: changeType === val.type,
+                            }" @tap="selectTransType(val.code)">{{ val.desc }}</view>
+                        </view>
+                    </view>
+                </view>
+                <view class="action-buttons">
+                    <view class="cancel-btn" @click="closePopup">取消</view>
+                    <view class="confirm-btn" @click="handlePayment">确定</view>
+                </view>
+            </view>
+        </u-popup>
+    </view>
+</template>
+<script>
+import { USER_INFO } from "@/common/util/constants"
+
+export default {
+    data() {
+        return {
+
+            changeType: '999',
+            transType: '999',
+            show: true,
+            showCategoryPopup: false,
+            listData: [],
+            cashTypeArr: [],
+            dateTime: '',
+            dateTimeSu: '',
+            expense: '',
+            income: '',
+            mescroll: '',
+            upOption: {
+                page: {
+                    pageNo: 1,
+                    pageSize: 10
+                },
+                noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+                empty: {
+                    tip: '暂无相关数据'
+                }
+            },
+        }
+    },
+    onLoad() {
+        let curDate = new Date();
+        let curYear = curDate.getFullYear();
+        let curMonth = curDate.getMonth() + 1;
+        if (curMonth >= 1 && curMonth <= 9) {
+            curMonth = "0" + curMonth;
+        }
+        this.dateTime = curYear + '年' + curMonth + '月'
+        this.dateTimeSu = curYear + '-' + curMonth
+        this.$http.get('/merchant/app/finance/cashType?type=2').then(res => {
+            if (res.data.success) {
+                this.cashTypeArr = res.data.result
+            }
+            else {
+                this.$tip.error(res.data.message);
+            }
+        })
+    },
+    mounted() {
+        this.mescroll.optDown.use = false
+        // this.getList()
+    },
+    methods: {
+        getList(page) {
+            let data = {
+                type: 2,
+                merchantUserId: uni.getStorageSync(USER_INFO).id,
+                changeType: this.changeType == '999' ? null : this.changeType,
+                date: this.dateTimeSu,
+                incomeType: this.transType == '999' ? '' : this.transType,
+                pageSize: page.size,
+                pageNo: page.num,
+            }
+            this.$http.post('/merchant/app/finance/cashBill', data).then(res => {
+                if (res.data.success) {
+                    this.listData = res.data.result.page ? this.listData.concat(res.data.result.page.records) : this.listData
+                    this.expense = res.data.result.expense
+                    this.income = res.data.result.income
+                    this.mescroll.endSuccess(res.data.result.page.records, res.data.result.page.total);
+                    uni.showTabBar()
+                }
+
+                else {
+                    this.listData = []
+                    this.mescroll.endErr()
+                    this.$tip.error(res.data.message);
+
+                }
+            }).catch(() => {
+					this.mescroll.endErr()
+				})
+        },
+        mescrollInit(mescroll) {
+            this.mescroll = mescroll;
+        },
+        bindDateChange(e) {
+            let page = {
+                num: 1,
+                size: 10
+            }
+            const value = e.detail.value
+            this.dateTimeSu = value
+            this.dateTime = value.split('-')[0] + '年' + value.split('-')[1] + '月'
+            this.getList(page)
+        },
+        selectIncomeType(type) {
+            this.changeType = type
+            this.transType = '999'
+        },
+        selectTransType(type) {
+            this.transType = type
+        },
+        handlePayment() {
+            let page = {
+                num: 1,
+                size: 10
+            }
+            this.getList(page)
+            this.showCategoryPopup = false
+        },
+        closePopup() {
+            this.showCategoryPopup = false
+        }
+    }
+}
+</script>
+<style scoped lang="scss">
+.creat {
+    width: 100vw;
+    height: 100vh;
+    background: #F7F8FC;
+    display: flex;
+    flex-direction: column;
+    position: fixed;
+}
+
+.balanceBill-con {
+    padding: 26rpx 35rpx;
+
+    text {
+        background: #EAEEF5;
+        border-radius: 67rpx;
+        padding: 14rpx 26rpx;
+        font-size: 26rpx;
+        color: #333333;
+
+        i {
+            margin-left: 12rpx;
+            display: inline-block;
+            width: 0;
+            height: 0;
+            border: 4px solid;
+            border-color: #AFB0B3;
+            border-bottom: 4px solid transparent;
+            border-right: 4px solid transparent;
+            border-left: 4px solid transparent;
+        }
+
+        .typeI {
+            border-color: #449AFF;
+            border-top: 4px solid transparent;
+            border-right: 4px solid transparent;
+            border-left: 4px solid transparent;
+            margin-bottom: 8rpx;
+        }
+
+    }
+
+}
+
+.beans-list {
+    // min-height: 100vh;
+    background: #FFFFFF;
+
+
+    .header {
+        padding: 26rpx 34rpx;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        border-bottom: 1px solid #EEEEEE;
+
+        .month-select {
+            display: flex;
+            align-items: center;
+            font-size: 32rpx;
+            color: #333;
+
+            .u-icon {
+                margin-left: 10rpx;
+            }
+        }
+
+        .total-amount {
+            font-size: 28rpx;
+            color: #999999;
+        }
+    }
+}
+
+.list-content {
+    padding: 0 34rpx;
+    width: 100%;
+
+    .list-item {
+        padding: 18rpx 0;
+        // border-radius: 12rpx;
+        // margin-bottom: 20rpx;
+        border-bottom: 1px solid #EEEEEE;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+
+        .item-amount {
+            font-weight: bold;
+            font-size: 34rpx;
+            color: #333333;
+        }
+
+        .icon-wrapper {
+            width: 42rpx;
+            height: 42rpx;
+            // border-radius: 50%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            margin-right: 14rpx;
+        }
+
+        .item-info {
+            .item-title {
+                color: #333;
+                margin-bottom: 8rpx;
+                display: block;
+                font-weight: 500;
+                font-size: 32rpx;
+            }
+
+            .item-time {
+                font-size: 24rpx;
+                color: #999;
+            }
+        }
+
+        .item-left {
+            display: flex;
+            align-items: flex-start;
+        }
+
+    }
+}
+
+.payment-popup {
+    padding: 30rpx;
+
+    .popup-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding-bottom: 20rpx;
+        border-bottom: 1px solid #EEEEEE;
+        margin-bottom: 26rpx;
+
+        .popup-title {
+            font-size: 34rpx;
+            color: #333;
+            font-weight: 500;
+            transform: translateX(37vw);
+        }
+
+        .popup-icon {
+            background: #DEDEDE;
+            width: 39rpx;
+            height: 39rpx;
+            text-align: center;
+            border-radius: 50%
+        }
+    }
+
+    .action-buttons {
+        display: flex;
+        margin-top: 20rpx;
+        gap: 20rpx;
+        padding-top: 20rpx;
+        border-top: 1rpx solid #EEEEEE;
+
+        .cancel-btn,
+        .confirm-btn {
+            flex: 1;
+            height: 78rpx;
+            line-height: 78rpx;
+            text-align: center;
+            border-radius: 44rpx;
+            font-size: 28rpx;
+        }
+
+        .cancel-btn {
+            background: #F5F6FA;
+            color: #666;
+        }
+
+        .confirm-btn {
+            background: #5B9CF9;
+            color: #FFFFFF;
+        }
+    }
+}
+
+.filter-section {
+    margin-bottom: 26rpx;
+
+    .section-title {
+        font-size: 28rpx;
+        color: #333;
+        margin-bottom: 26rpx;
+    }
+}
+
+.radio-group {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20rpx;
+}
+
+.transaction-types {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20rpx;
+}
+
+.radio-item {
+    width: 31.5%;
+    height: 86rpx;
+    line-height: 86rpx;
+    text-align: center;
+    // padding: 16rpx 30rpx;
+    background-color: #f5f7fa;
+    border-radius: 10rpx;
+    font-size: 28rpx;
+    color: #333;
+
+    &.active {
+        color: #2983EC;
+        border: 1px solid #449AFF;
+        background: rgba(68, 154, 255, 0.1);
+    }
+
+    &.disabled {
+        background-color: #f5f5f5;
+        color: #999;
+        cursor: not-allowed;
+    }
+}
+
+.fix {
+    width: 100%;
+    height: auto;
+    background: #F7F8FC;
+    position: sticky;
+    top: 0px;
+
+    /*#ifdef APP-PLUS*/
+    .top {
+        width: 100%;
+        height: var(--status-bar-height);
+        background: linear-gradient(87deg, #E2F4F8 0%, #A3CDFF 100%), linear-gradient(to bottom, #FFFFFF, #FFFFFF);
+    }
+}
+
+.list {
+    flex: 1;
+    width: 100%;
+    overflow-y: auto;
+    background: #FFFFFF;
+
+}
+</style>

+ 1 - 1
pages/financial/balanceBill.vue

@@ -158,7 +158,7 @@ export default {
         getList(page) {
             let data = {
                 type: 1,
-                merchantUserId: '1897951094540124161' || uni.getStorageSync(USER_INFO).id,
+                merchantUserId: uni.getStorageSync(USER_INFO).id,
                 changeType: this.changeType == '999' ? null : this.changeType,
                 date: this.dateTimeSu,
                 incomeType: this.transType == '999' ? '' : this.transType,

+ 467 - 0
pages/financial/balancePonts.vue

@@ -0,0 +1,467 @@
+<template>
+    <view class="creat">
+        <cu-custom bgColor="bg-fff" :isBack="true">
+            <block slot="content">积分账单</block>
+        </cu-custom>
+        <view class="fix">
+            <view class="balanceBill-con">
+                <text style="margin-right: 10px;" :style="showCategoryPopup ? 'color: #449AFF;' : ''"
+                    @click="showCategoryPopup = !showCategoryPopup">全部账单<i
+                        :class="showCategoryPopup ? 'typeI' : ''"></i></text>
+            </view>
+            <view class="beans-list">
+                <!-- 顶部月份和总额 -->
+                <view class="header">
+
+                    <picker mode="date" :value="dateTime" fields="month" @change="bindDateChange">
+                        <view class="month-select">
+                            <text>{{ this.dateTime }}</text>
+                            <u-icon name="arrow-down" size="24"></u-icon>
+                        </view>
+                    </picker>
+                    <view>
+                        <text class="total-amount" style="margin-right: 18rpx;"> 支出¥{{ expense || 0 }}</text>
+                        <text class="total-amount">收入¥{{ income || 0 }}</text>
+                    </view>
+                </view>
+            </view>
+        </view>
+        <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
+            <!-- 明细列表 -->
+            <view class="list-content">
+                <view class="list-item" v-for="(item, index) in listData" :key="index">
+                    <view class="item-info">
+                        <view class="item-left">
+                            <image v-if="item.typeCode == '1'" class="icon-wrapper"
+                                src="/static/financial/yue/icon (7).png"></image>
+                            <image v-if="item.typeCode == '2'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (2).png"></image>
+                            <image v-if="item.typeCode == '3'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (3).png"></image>
+                            <image v-if="item.typeCode == '4'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (4).png"></image>
+                            <image v-if="item.typeCode == '5'" class="icon-wrapper"
+                                src="/static/financial/jifen/icon (1).png"></image>
+                            <image v-if="item.typeCode == '6'" class="icon-wrapper"
+                                src="/static/financial/yue/icon (6).png"></image>
+                            <text class="item-title">{{ item.type }}</text>
+                        </view>
+                        <text class="item-time">{{ item.createTime }}</text>
+                    </view>
+                    <text class="item-amount" :class="{ 'income': item.amount > 0 }">
+                        {{ item.amount }}
+                    </text>
+                </view>
+            </view>
+        </mescroll-uni>
+
+        <u-popup v-model="showCategoryPopup" :round="10" mode="bottom ">
+            <view class="payment-popup">
+                <view class="popup-header">
+                    <text class="popup-title">全部账单</text>
+                    <view class="popup-icon">
+                        <u-icon name="close" size="20" @click="closePopup"></u-icon>
+                    </view>
+                </view>
+                <view>
+                    <!-- 收支类型 -->
+                    <view class="filter-section">
+                        <view class="section-title">收支类型</view>
+                        <view class="radio-group">
+                            <view class="radio-item" :class="{ active: changeType === '999' }"
+                                @tap="selectIncomeType('999')">全部</view>
+                            <view class="radio-item" :class="{ active: changeType === '2' }"
+                                @tap="selectIncomeType('2')">支出</view>
+                            <view class="radio-item" :class="{ active: changeType === '1' }"
+                                @tap="selectIncomeType('1')">收入</view>
+                        </view>
+                    </view>
+
+                    <!-- 交易类型 -->
+                    <view class="filter-section">
+                        <view class="section-title">交易类型</view>
+                        <view class="transaction-types">
+                            <view class="radio-item" :class="{ active: transType === '999' }"
+                                @tap="selectTransType('999')">全部</view>
+                            <view class="radio-item" v-for="(val, index) in cashTypeArr" :key="index" :class="{
+                                active: transType === val.code,
+                                disabled: changeType === val.type,
+                            }" @tap="selectTransType(val.code)">{{ val.desc }}</view>
+                        </view>
+                    </view>
+                </view>
+                <view class="action-buttons">
+                    <view class="cancel-btn" @click="closePopup">取消</view>
+                    <view class="confirm-btn" @click="handlePayment">确定</view>
+                </view>
+            </view>
+        </u-popup>
+    </view>
+</template>
+<script>
+import { USER_INFO } from "@/common/util/constants"
+
+export default {
+    data() {
+        return {
+
+            changeType: '999',
+            transType: '999',
+            show: true,
+            showCategoryPopup: false,
+            listData: [],
+            cashTypeArr: [],
+            dateTime: '',
+            dateTimeSu: '',
+            expense: '',
+            income: '',
+            mescroll: '',
+            upOption: {
+                page: {
+                    pageNo: 1,
+                    pageSize: 10
+                },
+                noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+                empty: {
+                    tip: '暂无相关数据'
+                }
+            },
+        }
+    },
+    onLoad() {
+        let curDate = new Date();
+        let curYear = curDate.getFullYear();
+        let curMonth = curDate.getMonth() + 1;
+        if (curMonth >= 1 && curMonth <= 9) {
+            curMonth = "0" + curMonth;
+        }
+        this.dateTime = curYear + '年' + curMonth + '月'
+        this.dateTimeSu = curYear + '-' + curMonth
+        this.$http.get('/merchant/app/finance/cashType?type=3').then(res => {
+            if (res.data.success) {
+                this.cashTypeArr = res.data.result
+            }
+            else {
+                this.$tip.error(res.data.message);
+            }
+        })
+    },
+    mounted() {
+        this.mescroll.optDown.use = false
+        // this.getList()
+    },
+    methods: {
+        getList(page) {
+            let data = {
+                type: 3,
+                merchantUserId: uni.getStorageSync(USER_INFO).id,
+                changeType: this.changeType == '999' ? null : this.changeType,
+                date: this.dateTimeSu,
+                incomeType: this.transType == '999' ? '' : this.transType,
+                pageSize: page.size,
+                pageNo: page.num,
+            }
+            this.$http.post('/merchant/app/finance/cashBill', data).then(res => {
+                if (res.data.success) {
+                    this.listData = res.data.result.page ? this.listData.concat(res.data.result.page.records) : this.listData
+                    this.expense = res.data.result.expense
+                    this.income = res.data.result.income
+                    this.mescroll.endSuccess(res.data.result.page.records, res.data.result.page.total);
+                    uni.showTabBar()
+                }
+
+                else {
+                    this.listData = []
+                    this.mescroll.endErr()
+                    this.$tip.error(res.data.message);
+
+                }
+            }).catch(() => {
+					this.mescroll.endErr()
+				})
+        },
+        mescrollInit(mescroll) {
+            this.mescroll = mescroll;
+        },
+        bindDateChange(e) {
+            let page = {
+                num: 1,
+                size: 10
+            }
+            const value = e.detail.value
+            this.dateTimeSu = value
+            this.dateTime = value.split('-')[0] + '年' + value.split('-')[1] + '月'
+            this.getList(page)
+        },
+        selectIncomeType(type) {
+            this.changeType = type
+            this.transType = '999'
+        },
+        selectTransType(type) {
+            this.transType = type
+        },
+        handlePayment() {
+            let page = {
+                num: 1,
+                size: 10
+            }
+            this.getList(page)
+            this.showCategoryPopup = false
+        },
+        closePopup() {
+            this.showCategoryPopup = false
+        }
+    }
+}
+</script>
+<style scoped lang="scss">
+.creat {
+    width: 100vw;
+    height: 100vh;
+    background: #F7F8FC;
+    display: flex;
+    flex-direction: column;
+    position: fixed;
+}
+
+.balanceBill-con {
+    padding: 26rpx 35rpx;
+
+    text {
+        background: #EAEEF5;
+        border-radius: 67rpx;
+        padding: 14rpx 26rpx;
+        font-size: 26rpx;
+        color: #333333;
+
+        i {
+            margin-left: 12rpx;
+            display: inline-block;
+            width: 0;
+            height: 0;
+            border: 4px solid;
+            border-color: #AFB0B3;
+            border-bottom: 4px solid transparent;
+            border-right: 4px solid transparent;
+            border-left: 4px solid transparent;
+        }
+
+        .typeI {
+            border-color: #449AFF;
+            border-top: 4px solid transparent;
+            border-right: 4px solid transparent;
+            border-left: 4px solid transparent;
+            margin-bottom: 8rpx;
+        }
+
+    }
+
+}
+
+.beans-list {
+    // min-height: 100vh;
+    background: #FFFFFF;
+
+
+    .header {
+        padding: 26rpx 34rpx;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        border-bottom: 1px solid #EEEEEE;
+
+        .month-select {
+            display: flex;
+            align-items: center;
+            font-size: 32rpx;
+            color: #333;
+
+            .u-icon {
+                margin-left: 10rpx;
+            }
+        }
+
+        .total-amount {
+            font-size: 28rpx;
+            color: #999999;
+        }
+    }
+}
+
+.list-content {
+    padding: 0 34rpx;
+    width: 100%;
+
+    .list-item {
+        padding: 18rpx 0;
+        // border-radius: 12rpx;
+        // margin-bottom: 20rpx;
+        border-bottom: 1px solid #EEEEEE;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+
+        .item-amount {
+            font-weight: bold;
+            font-size: 34rpx;
+            color: #333333;
+        }
+
+        .icon-wrapper {
+            width: 42rpx;
+            height: 42rpx;
+            // border-radius: 50%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            margin-right: 14rpx;
+        }
+
+        .item-info {
+            .item-title {
+                color: #333;
+                margin-bottom: 8rpx;
+                display: block;
+                font-weight: 500;
+                font-size: 32rpx;
+            }
+
+            .item-time {
+                font-size: 24rpx;
+                color: #999;
+            }
+        }
+
+        .item-left {
+            display: flex;
+            align-items: flex-start;
+        }
+
+    }
+}
+
+.payment-popup {
+    padding: 30rpx;
+
+    .popup-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding-bottom: 20rpx;
+        border-bottom: 1px solid #EEEEEE;
+        margin-bottom: 26rpx;
+
+        .popup-title {
+            font-size: 34rpx;
+            color: #333;
+            font-weight: 500;
+            transform: translateX(37vw);
+        }
+
+        .popup-icon {
+            background: #DEDEDE;
+            width: 39rpx;
+            height: 39rpx;
+            text-align: center;
+            border-radius: 50%
+        }
+    }
+
+    .action-buttons {
+        display: flex;
+        margin-top: 20rpx;
+        gap: 20rpx;
+        padding-top: 20rpx;
+        border-top: 1rpx solid #EEEEEE;
+
+        .cancel-btn,
+        .confirm-btn {
+            flex: 1;
+            height: 78rpx;
+            line-height: 78rpx;
+            text-align: center;
+            border-radius: 44rpx;
+            font-size: 28rpx;
+        }
+
+        .cancel-btn {
+            background: #F5F6FA;
+            color: #666;
+        }
+
+        .confirm-btn {
+            background: #5B9CF9;
+            color: #FFFFFF;
+        }
+    }
+}
+
+.filter-section {
+    margin-bottom: 26rpx;
+
+    .section-title {
+        font-size: 28rpx;
+        color: #333;
+        margin-bottom: 26rpx;
+    }
+}
+
+.radio-group {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20rpx;
+}
+
+.transaction-types {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 20rpx;
+}
+
+.radio-item {
+    width: 31.5%;
+    height: 86rpx;
+    line-height: 86rpx;
+    text-align: center;
+    // padding: 16rpx 30rpx;
+    background-color: #f5f7fa;
+    border-radius: 10rpx;
+    font-size: 28rpx;
+    color: #333;
+
+    &.active {
+        color: #2983EC;
+        border: 1px solid #449AFF;
+        background: rgba(68, 154, 255, 0.1);
+    }
+
+    &.disabled {
+        background-color: #f5f5f5;
+        color: #999;
+        cursor: not-allowed;
+    }
+}
+
+.fix {
+    width: 100%;
+    height: auto;
+    background: #F7F8FC;
+    position: sticky;
+    top: 0px;
+
+    /*#ifdef APP-PLUS*/
+    .top {
+        width: 100%;
+        height: var(--status-bar-height);
+        background: linear-gradient(87deg, #E2F4F8 0%, #A3CDFF 100%), linear-gradient(to bottom, #FFFFFF, #FFFFFF);
+    }
+}
+
+.list {
+    flex: 1;
+    width: 100%;
+    overflow-y: auto;
+    background: #FFFFFF;
+
+}
+</style>

+ 212 - 26
pages/financial/buyBean.vue

@@ -13,12 +13,12 @@
       </view>
       <view class="handle_con flex align-center ">
         <image src="/static/financial/jindou.png"></image>
-        <text>300</text>
+        <text>{{ bill }}</text>
       </view>
     </view>
     <view style="margin:104rpx 20rpx 0 20rpx ;background: #FFFFFF;border-radius:16rpx;">
       <view class="amount-tab flex align-center">
-        <view :class="[active == 1 ? 'select jindou' : 'jindou1']" @click="active = 2">兑换金豆</view>
+        <view :class="[active == 1 ? 'select jindou' : 'jindou1']" @click="active = 2;exchange();pointsdBean()">兑换金豆</view>
         <view :class="[active == 2 ? 'select jifen' : 'jindou1']" @click="active = 1">购买金豆</view>
       </view>
       <view class="amount-title" v-if="active == 1">选择购买面额(元)</view>
@@ -34,26 +34,26 @@
       </view>
       <view v-if="active == 2" style="padding: 20rpx;">
         <view class="header">
-          <text class="title">金豆兑金豆</text>
-          <text class="max-amount">最多可兑换金豆:356个</text>
+          <text class="title">积分兑金豆</text>
+          <text class="max-amount">最多可兑换金豆:{{billMax}}个</text>
         </view>
         <view class="exchange-title">兑换金豆</view>
         <!-- 兑换数量输入框 -->
         <view class="exchange-input">
-          <input type="digit" v-model="amount" placeholder-class="input-placeholder" />
-
+            <input  type="digit" v-model.number="amount" @input="handleStockInput" placeholder-class="input-placeholder" />
+          <text class="exchange-all" @click="amount=billMax">全部兑换</text>
         </view>
 
         <!-- 金豆明细 -->
         <view class="points-detail">
-          <text class="detail-text">使用金豆22000个,还剩金豆13642个</text>
-          <text class="exchange-all" @click="handleExchangeAll">全部兑换</text>
+          <text class="detail-text">使用积分{{usePoint || 0}}个,还剩积分{{remainingPoint }}个</text>
         </view>
       </view>
 
     </view>
     <view class="bottom-button">
-      <button class="recharge-button" @click="handleRecharge">立即购买</button>
+      <button class="recharge-button" v-if="active == 1"  @click="showPaymentPopup=true">立即购买</button>
+      <button class="recharge-button" v-if="active == 2"  @click="pointsForGold">立即兑换</button>
     </view>
     <!-- 底部支付弹框 -->
     <u-popup v-model="showPaymentPopup" mode="bottom" :round="10">
@@ -99,9 +99,33 @@
         </view>
       </view>
     </u-popup>
+    <u-popup v-model="showFailDialog" round="10"  mode="center" :closeable="false">
+            <view class="fail-dialog">
+                <view class="fail-title">{{ failTitle }}</view>
+                <view class="fail-icon">
+                    <image  src="/static/financial/fail.png" mode="aspectFit"></image>
+                </view>
+                <view class="fail-desc">请重新充值</view>
+                <view class="fail-button" @click="handleConfirm">
+                    确定
+                </view>
+            </view>
+        </u-popup>
+        <u-popup v-model="showSucessDialog" round="10"  mode="center" :closeable="false">
+            <view class="fail-dialog">
+                <view class="fail-title">{{ sucessTitle }}</view>
+                <view class="fail-icon">
+                    <image  src="/static/financial/sucess.png" mode="aspectFit"></image>
+                </view>
+                <view class="fail-button" @click="handleConfirm">
+                    确定
+                </view>
+            </view>
+        </u-popup>
   </view>
 </template>
 <script>
+import { USER_INFO } from "@/common/util/constants"
 export default {
   data() {
     return {
@@ -111,14 +135,30 @@ export default {
       amountList: [],
       showPaymentPopup: false,
       paymentMethod: 'wechat',
+      showFailDialog:false,
+      showSucessDialog:false,
+      bill:'',
+      failTitle:'购买失败',
+      sucessTitle:'购买成功',
+      billMax:'',
+      usePoint:'',//使用积分
+      remainingPoint:'',//剩余积分
     }
   },
   onLoad(e){
     if(e){
       this.active=e.index
+      if(e.index==2){
+        this.exchange()
+        this.pointsdBean()
+      }
+    }
+    else{
+      this.active=1
     }
   },
   onShow() {
+    this.getList()
     this.$http.get('/merchant/app/finance/goldSellList').then(res => {
           if (res.data.success) {
               this.amountList =res.data.result
@@ -131,20 +171,97 @@ export default {
       })
   },
   methods: {
+    getList() {
+          this.$http.get('/merchant/app/finance/financeIndex', {params:{ merchantUserId: uni.getStorageSync(USER_INFO).id }}).then(res => {
+              if (res.data.success) {
+                  this.bill = res.data.result.goldenBeanTotal
+              }
+              else {
+                  this.$tip.error(res.data.message);
+              }
+          })
+      },
+      exchange() {
+          this.$http.post('/merchant/app/finance/pointsForGoldMax?merchantUserId='+uni.getStorageSync(USER_INFO).id).then(res => {
+              if (res.data.success) {
+                this.billMax=res.data.result
+              }
+              else {
+                this.$tip.error(res.data.message);
+              }
+          })
+      },
+      pointsdBean(){
+        this.$http.post(`/merchant/app/finance/pointsForGoldSurplus?merchantUserId=${uni.getStorageSync(USER_INFO).id}&goldCount=${this.amount || 0}`).then(res => {
+              if (res.data.success) {
+                  this.usePoint=res.data.result.exchangePoint
+                  this.remainingPoint=res.data.result.surplusPoint
+              }
+              else {
+                this.$tip.error(res.data.message);
+
+              }
+          })
+      },
+      pointsForGold() {
+          this.$http.post('/merchant/app/finance/pointsForGold', { merchantUserId: uni.getStorageSync(USER_INFO).id,exchangePoint:this.usePoint,goldBean:this.amount }).then(res => {
+              if (res.data.code==200) {
+                  this.amount=''
+                  this.sucessTitle='兑换成功'
+                  this.showSucessDialog=true
+                  this.exchange()
+                  this.pointsdBean()
+              }
+              else {
+                this.failTitle='兑换失败'
+                this.showFailDialog=true
+              }
+          })
+      },
+      
+    handleStockInput(e) {
+
+      // 移除非数字字符
+      let num = e.detail.value.replace(/[^\d]/g, '')
+      
+      // 转换为数字并限制最大值为99999999
+      if (num) {
+        num = parseInt(num)
+        if (num > this.billMax) {
+          num = ''
+          uni.showToast({
+            title: '不能超过最多可兑换数',
+            icon: 'none'
+          })
+        }
+      }
+      
+      // 更新表单值
+      this.$nextTick(() => {
+        this.amount = num.toString()
+        this.pointsdBean()
+      })
+    },
     //返回
     back() {
       uni.navigateBack({
         delta: 1
       });
     },
-    getBill() { },
+    getBill() { 
+      uni.navigateTo({
+            url: "/pages/financial/balanceBean"
+        })
+    },
     selectAmount(index) {
       this.selectedAmount = this.amountList[index].price
+      
     },
-    handleRecharge() {
-      this.showPaymentPopup = true
+    // 确定按钮处理
+    handleConfirm() {
+        this.showFailDialog=false
+        this.showSucessDialog = false
     },
-
     // 选择支付方式
     selectPayment(method) {
       this.paymentMethod = method
@@ -157,9 +274,25 @@ export default {
 
     // 处理支付
     handlePayment() {
-      // TODO: 实现支付逻辑
-      uni.showLoading({
-        title: '支付中...'
+
+      let obj=this.amountList.find(val=>val.price== this.selectedAmount)
+      console.log(obj);
+      let data={
+        id:obj.id,
+        price:this.selectedAmount,
+        amount:obj.amount,
+        merchantUserId:uni.getStorageSync(USER_INFO).id
+      }
+      this.$http.post("/merchant/app/finance/buyGolden", data).then(res => {
+          if (res.data.code == 200) {
+              this.showPaymentPopup = false
+              this.showSucessDialog = true
+              this.getList()
+
+          }
+          else {
+              this.showFailDialog = true
+          }
       })
     }
 
@@ -469,15 +602,23 @@ export default {
 
 .exchange-input {
   display: flex;
+  justify-content: space-between;
+  font-size: 38rpx;
+  background: #F7F8FC;
+  border-radius: 12rpx;
   margin-bottom: 20rpx;
-
+  padding: 20rpx;
+  .exchange-all {
+    color: #449AFF;
+    font-size: 28rpx;
+  }
   input {
-    flex: 1;
-    font-size: 38rpx;
-    height: 70rpx;
-    background: #F7F8FC;
-    border-radius: 12rpx;
-    text-align: center;
+    // flex: 1;
+    // font-size: 38rpx;
+    // height: 70rpx;
+    // background: #F7F8FC;
+    // border-radius: 12rpx;
+    // text-align: center;
   }
 }
 
@@ -490,8 +631,53 @@ export default {
     margin-right: 12rpx;
   }
 
-  .exchange-all {
-    color: #449AFF;
-  }
+ 
+}
+.fail-dialog {
+    width: 560rpx;
+    padding: 20rpx 30rpx;
+    background: #FFFFFF;
+    border-radius: 20rpx;
+    text-align: center;
+
+    .fail-icon {
+        margin: 50rpx 0;
+        font-weight: 500;
+        font-size: 34rpx;
+        color: #333333;
+        image{
+            width: 110rpx;
+            height: 110rpx;
+        }
+    }
+
+    .fail-title {
+        font-size: 34rpx;
+        color: #333333;
+        font-weight: 600;
+        padding-bottom: 26rpx;
+        border-bottom: 1px solid #EEEEEE;
+
+    }
+
+    .fail-desc {
+        font-size: 28rpx;
+        color: #666666;
+        margin-bottom: 40rpx;
+    }
+
+    .fail-button {
+        height: 78rpx;
+        line-height: 78rpx;
+        background: #449AFF;
+        color: #FFFFFF;
+        font-size: 32rpx;
+        border-radius: 44rpx;
+        margin: 0 40rpx;
+
+        &:active {
+            opacity: 0.9;
+        }
+    }
 }
 </style>

+ 125 - 15
pages/financial/buyPoints.vue

@@ -13,7 +13,7 @@
       </view>
       <view class="handle_con flex align-center ">
         <image class="asset-icon" src="/static/financial/jifen.png"></image>
-        <text>300</text>
+        <text>{{ points }}</text>
       </view>
     </view>
     <view class="amount-options">
@@ -73,9 +73,33 @@
         </view>
       </view>
     </u-popup>
+    <u-popup v-model="showFailDialog" round="10" mode="center" :closeable="false">
+      <view class="fail-dialog">
+        <view class="fail-title">充值失败</view>
+        <view class="fail-icon">
+          <image src="/static/financial/fail.png" mode="aspectFit"></image>
+        </view>
+        <view class="fail-desc">请重新充值</view>
+        <view class="fail-button" @click="handleConfirm">
+          确定
+        </view>
+      </view>
+    </u-popup>
+    <u-popup v-model="showSucessDialog" round="10" mode="center" :closeable="false">
+      <view class="fail-dialog">
+        <view class="fail-title">充值成功</view>
+        <view class="fail-icon">
+          <image src="/static/financial/sucess.png" mode="aspectFit"></image>
+        </view>
+        <view class="fail-button" @click="handleConfirm">
+          确定
+        </view>
+      </view>
+    </u-popup>
   </view>
 </template>
 <script>
+import { USER_INFO } from "@/common/util/constants"
 export default {
   data() {
     return {
@@ -83,35 +107,57 @@ export default {
       amountList: [],
       showPaymentPopup: false,
       paymentMethod: 'wechat',
+      showFailDialog: false,
+      showSucessDialog: false,
+      points:''
     }
   },
   onShow() {
+    this.getList()
     this.$http.get('/merchant/app/finance/getList').then(res => {
-          if (res.data.success) {
-              this.amountList =res.data.result
-              this.selectedAmount = this.amountList[0].price
-
-          }
-          else {
-              this.$tip.error(res.data.message);
-          }
-      })
+      if (res.data.success) {
+        this.amountList = res.data.result
+        this.selectedAmount = this.amountList[0].price
+
+      }
+      else {
+        this.$tip.error(res.data.message);
+      }
+    })
   },
   methods: {
+    getList() {
+          this.$http.get('/merchant/app/finance/financeIndex', {params:{ merchantUserId: uni.getStorageSync(USER_INFO).id }}).then(res => {
+              if (res.data.success) {
+                  this.points = res.data.result.pointTotal
+              }
+              else {
+                  this.$tip.error(res.data.message);
+              }
+          })
+      },
     //返回
     back() {
       uni.navigateBack({
         delta: 1
       });
     },
-    getBill() { },
+    getBill() {
+      uni.navigateTo({
+                url: "/pages/financial/balancePonts"
+            })
+     },
     selectAmount(index) {
       this.selectedAmount = this.amountList[index].price
     },
     handleRecharge() {
       this.showPaymentPopup = true
     },
-
+   // 确定按钮处理
+   handleConfirm() {
+        this.showFailDialog=false
+        this.showSucessDialog = false
+    },
     // 选择支付方式
     selectPayment(method) {
       this.paymentMethod = method
@@ -124,9 +170,24 @@ export default {
 
     // 处理支付
     handlePayment() {
-      // TODO: 实现支付逻辑
-      uni.showLoading({
-        title: '支付中...'
+      let obj = this.amountList.find(val => val.price == this.selectedAmount)
+      console.log(obj);
+      let data = {
+        id: obj.id,
+        price: this.selectedAmount,
+        amount: obj.amount,
+        merchantUserId: uni.getStorageSync(USER_INFO).id
+      }
+      this.$http.post("/merchant/app/finance/buyPoints", data).then(res => {
+        if (res.data.code == 200) {
+          this.showPaymentPopup = false
+          this.showSucessDialog = true
+          this.getList()
+
+        }
+        else {
+          this.showFailDialog = true
+        }
       })
     }
 
@@ -354,4 +415,53 @@ export default {
     }
   }
 }
+
+.fail-dialog {
+  width: 560rpx;
+  padding: 20rpx 30rpx;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+  text-align: center;
+
+  .fail-icon {
+    margin: 50rpx 0;
+    font-weight: 500;
+    font-size: 34rpx;
+    color: #333333;
+
+    image {
+      width: 110rpx;
+      height: 110rpx;
+    }
+  }
+
+  .fail-title {
+    font-size: 34rpx;
+    color: #333333;
+    font-weight: 600;
+    padding-bottom: 26rpx;
+    border-bottom: 1px solid #EEEEEE;
+
+  }
+
+  .fail-desc {
+    font-size: 28rpx;
+    color: #666666;
+    margin-bottom: 40rpx;
+  }
+
+  .fail-button {
+    height: 78rpx;
+    line-height: 78rpx;
+    background: #449AFF;
+    color: #FFFFFF;
+    font-size: 32rpx;
+    border-radius: 44rpx;
+    margin: 0 40rpx;
+
+    &:active {
+      opacity: 0.9;
+    }
+  }
+}
 </style>

+ 4 - 3
pages/financial/management.vue

@@ -7,6 +7,7 @@
                     <u-icon name="arrow-left" color="#FFFFFF" size="32"></u-icon>
                 </view>
                 <view class="page-title">财务管理</view>
+                
             </view>
 
             <!-- 顶部用户信息卡片 -->
@@ -141,7 +142,7 @@ export default {
 }
 
 .nav-bacg {
-    height: 370rpx;
+    height: 420rpx;
     position: relative;
     background: url("/static/financial/bg.png");
 }
@@ -149,7 +150,8 @@ export default {
 .nav-bar {
     display: flex;
     align-items: center;
-    padding: 30rpx 24rpx;
+    // padding: 30rpx 24rpx;
+    padding: 78rpx 24rpx 64rpx 24rpx;
 
     .back-icon {
         padding: 10rpx;
@@ -174,7 +176,6 @@ export default {
     border-top: 1px solid #FFFFFF;
     padding: 34rpx 26rpx;
     margin: 0 24rpx;
-    margin-top: 32rpx;
 
     color: #103653;
 

+ 32 - 8
pages/financial/recharge.vue

@@ -47,12 +47,23 @@
             <button class="recharge-button" @click="handleRecharge" :disabled="!isValid">充值</button>
         </view>
         <u-popup v-model="showFailDialog" round="10"  mode="center" :closeable="false">
+            <view class="fail-dialog">
+                <view class="fail-title">充值失败</view>
+                <view class="fail-icon">
+                    <image  src="/static/financial/fail.png" mode="aspectFit"></image>
+                </view>
+                <view class="fail-desc">请重新充值</view>
+                <view class="fail-button" @click="handleConfirm">
+                    确定
+                </view>
+            </view>
+        </u-popup>
+        <u-popup v-model="showSucessDialog" round="10"  mode="center" :closeable="false">
             <view class="fail-dialog">
                 <view class="fail-title">充值成功</view>
                 <view class="fail-icon">
                     <image  src="/static/financial/sucess.png" mode="aspectFit"></image>
                 </view>
-                <view class="fail-desc">请重新充值</view>
                 <view class="fail-button" @click="handleConfirm">
                     确定
                 </view>
@@ -61,12 +72,14 @@
     </view>
 </template>
 <script>
+import { USER_INFO } from "@/common/util/constants"
 export default {
     data() {
         return {
             amount: '',
             paymentMethod: 'wechat',
             showFailDialog: false, // 控制弹窗显示
+            showSucessDialog:false
         }
 
 
@@ -87,8 +100,12 @@ export default {
 
         // 确定按钮处理
         handleConfirm() {
-            this.showFailDialog = false
+            this.showFailDialog=false
+            this.showSucessDialog = false
             // 可以在这里添加重新充值的逻辑
+            uni.navigateTo({
+					url: '/pages/financial/management'
+				})
         },
 
         selectPayment(method) {
@@ -102,8 +119,14 @@ export default {
                 })
                 return
             }
-            this.showFailDialog = true
-
+            this.$http.post("/merchant/app/finance/recharge", {amount:this.amount,merchantUserId:uni.getStorageSync(USER_INFO).id}).then(res => {
+                if (res.data.code == 200) {
+                    this.showSucessDialog = true
+                }
+                else {
+                    this.showFailDialog = true
+                }
+            })
             // TODO: 调用充值API
         },
 
@@ -133,7 +156,7 @@ export default {
     background: #FFFFFF;
     padding: 30rpx;
     border-radius: 12rpx;
-    margin-bottom: 20rpx;
+    margin: 40rpx 0;
 }
 
 .amount-input {
@@ -225,8 +248,9 @@ export default {
     display: flex;
     justify-content: space-between;
     align-items: center;
-    padding: 0px 24rpx;
+    // padding: 0px 24rpx;
     position: relative;
+    padding: 78rpx 24rpx 32rpx 24rpx;
 
     .head_left {
         font-size: 40rpx;
@@ -235,7 +259,7 @@ export default {
     .center {
         position: absolute;
         left: 50%;
-        top: 50%;
+        top: 67%;
         transform: translate(-50%, -50%);
         font-size: 36rpx;
         font-weight: 600;
@@ -269,7 +293,7 @@ export default {
     text-align: center;
 
     .fail-icon {
-        margin: 20rpx 0;
+        margin: 50rpx 0;
         font-weight: 500;
         font-size: 34rpx;
         color: #333333;

+ 13 - 4
pages/login/settled.vue

@@ -209,11 +209,18 @@
                     </view>
                     <view class="cu-form-group">
                         <view class="title">所在地区</view>
-                        <input disabled="true" @mousedown="$refs.picker.show()" placeholder="请选择所在地区" ref="inputRef"
+                        <view style="display: flex;width: 74%;justify-content: space-between;" @click="$refs.picker.show()">
+                            <!-- <u-input readonly placeholder="去设置" v-model="form.locality" @click="$refs.picker.show()"    /> -->
+                            <view style="font-size: 30rpx;">
+                                <text v-if="form.locality"> {{ form.locality }}</text>
+                                <text  v-else style="color: grey">请选择所在地区</text>
+                            </view>
+                            <u-icon  name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
+                        </view>
+                        <!-- <input disabled="true" @mousedown="$refs.picker.show()" placeholder="请选择所在地区" ref="inputRef"
                             name="input" v-model="form.locality"></input>
-                        <text class='cuIcon-right' style="color: #C7C6CA ;" @click="$refs.picker.show();mapIsHidden='none'"></text>
-                        <w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
-                            @confirm="onConfirm($event, 'region')"></w-picker>
+                        <text class='cuIcon-right' style="color: #C7C6CA ;" @click="$refs.picker.show();mapIsHidden='none'"></text> -->
+                        
                     </view>
                     <view class="cu-form-group">
                         <view class="title">门店地址</view>
@@ -273,6 +280,8 @@
             <image src="/static/logo.png" mode="aspectFit"></image>
             <view class="gray-text">加载中...</view>
         </view>
+        <w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
+                            @confirm="onConfirm($event, 'region')"></w-picker>
     </view>
 
 </template>

+ 1 - 1
pages/product/details.vue

@@ -90,7 +90,7 @@
 						<view class="item">
 							{{form.refundLabelName}}
 						</view>
-						<view class="item">
+						<view class="item">   
 							{{form.refundConfirmName}}
 						</view>
 					</view>

+ 16 - 3
pages/store/editStore.vue

@@ -10,11 +10,22 @@
             </view>
             <view class="cu-form-group">
                 <view class="title">所在地区</view>
-                <input disabled="true" @mousedown="$refs.picker.show()" placeholder="请选择所在地区" ref="inputRef"
-                    name="input" v-model="form.locality"></input>
-                <text class='cuIcon-right' style="color: #C7C6CA ;" @click="$refs.picker.show()"></text>
+                <view style="display: flex;width: 77%;justify-content: space-between;" @click="$refs.picker.show()">
+                    <!-- <u-input readonly placeholder="去设置" v-model="form.locality" @click="$refs.picker.show()"    /> -->
+                    <view >
+                        <text v-if="form.locality"> {{ form.locality }}</text>
+                        <text v-else>去设置</text>
+                    </view>
+                    <u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
+                </view>
+                <!-- <view>
+                    <input disabled="true" @mousedown="$refs.picker.show()" placeholder="请选择所在地区" ref="inputRef"
+                        name="input" v-model="form.locality"></input> 
+                <text class='cuIcon-right' style="color: #C7C6CA ;" @click="$refs.picker.show()"></text> 
                 <w-picker :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
                     @confirm="onConfirm($event, 'region')"></w-picker>
+                </view> -->
+
             </view>
             <view class="cu-form-group">
                 <view class="title">门店地址</view>
@@ -58,6 +69,8 @@
         <view class="padding flex flex-direction sub-bottom">
             <button class="cu-btn bg-blue round " @click="submit">提交审核</button>
         </view>
+        <w-picker :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
+        @confirm="onConfirm($event, 'region')"></w-picker>
     </view>
 </template>
 <script>

BIN
static/financial/jifen/icon (1).png


BIN
static/financial/jifen/icon (2).png


BIN
static/financial/jifen/icon (3).png


BIN
static/financial/jifen/icon (4).png


BIN
static/financial/jindou/icon (1).png


BIN
static/financial/jindou/icon (2).png


BIN
static/financial/jindou/icon (3).png


BIN
static/financial/jindou/icon (4).png


BIN
static/financial/jindou/icon.png