From 2c01ac3e5b20bf4e0c62f388eb4616675d8ebf93 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期一, 28 十月 2024 15:53:53 +0800 Subject: [PATCH] 1.小程序-供应商:钱包功能 --- sub_pages/supplier/wallet/my-wallet.vue | 220 ++++++++++ package-lock.json | 11 sub_pages/supplier/wallet/wallet-withdrao-deposit.vue | 228 ++++++++++ pages/home/supplier-home.vue | 21 pages.json | 36 + sub_pages/supplier/data-statis/data-statis.vue | 56 + package.json | 8 sub_pages/supplier/wallet/wallet-billing-detail.vue | 217 +++++++++ sub_pages/customer/shop/shop.vue | 39 + sub_pages/supplier/wallet/wallet-withdrao-deposit-record.vue | 226 ++++++++++ sub_pages/supplier/wallet/wallet-deduction-record.vue | 222 ++++++++++ pages/order/comment/order-comment.vue | 23 12 files changed, 1,274 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a70db1..e8f3c35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "dayjs": "^1.11.13", "moment": "^2.30.1", "uview-ui": "^2.0.36" }, @@ -492,6 +493,11 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "peer": true + }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" }, "node_modules/electron-to-chromium": { "version": "1.4.811", @@ -1665,6 +1671,11 @@ "dev": true, "peer": true }, + "dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + }, "electron-to-chromium": { "version": "1.4.811", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.811.tgz", diff --git a/package.json b/package.json index 5c4c744..6e7bcd9 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "PUB_PARTNER": true } }, - "customer":{ + "customer": { "title": "花店/用户-小程序", "BROWSER": "Chrome", "env": { @@ -34,7 +34,7 @@ "PUB_CUSTOMER": true } }, - "customer-v2":{ + "customer-v2": { "title": "花店/用户端-小程序-开发", "BROWSER": "Chrome", "env": { @@ -46,10 +46,10 @@ "PUB_CUSTOMER": true } } - } }, "dependencies": { + "dayjs": "^1.11.13", "moment": "^2.30.1", "uview-ui": "^2.0.36" }, @@ -57,4 +57,4 @@ "sass": "^1.77.6", "sass-loader": "^10.5.2" } -} \ No newline at end of file +} diff --git a/pages.json b/pages.json index f0c07e5..5d51333 100644 --- a/pages.json +++ b/pages.json @@ -160,6 +160,42 @@ "root": "sub_pages/supplier", "pages": [ { + "path": "wallet/my-wallet", + "style": { + "navigationBarTitleText": "我的钱包", + "enablePullDownRefresh": true + } + }, + { + "path": "wallet/wallet-withdrao-deposit", + "style": { + "navigationBarTitleText": "提现到微信", + "enablePullDownRefresh": true + } + }, + { + "path": "wallet/wallet-billing-detail", + "style": { + "navigationBarTitleText": "账单明细", + "enablePullDownRefresh": true + } + }, + { + "path": "wallet/wallet-withdrao-deposit-record", + "style": { + "navigationBarTitleText": "提现记录", + "enablePullDownRefresh": true + } + }, + { + "path": "wallet/wallet-deduction-record", + "style": { + "navigationBarTitleText": "扣款记录", + "enablePullDownRefresh": true + } + }, + + { "path": "advertising/advertising", "style": { "navigationBarTitleText": "广告", diff --git a/pages/home/supplier-home.vue b/pages/home/supplier-home.vue index 0b3a9e3..65eda05 100644 --- a/pages/home/supplier-home.vue +++ b/pages/home/supplier-home.vue @@ -196,6 +196,7 @@ </view> <view class="order-desc syst">售后理赔</view> </view> + <!-- <view class="nav row margin-tb" @click="printDeliveryOrder"> <view class="img-c"> <image class="icon margin-bottom order-icon kkjl" @@ -203,6 +204,24 @@ </view> <view class="order-desc wbsp">测试蓝牙</view> </view> --> + </view> + <view class="flex order-icons m-t-12"> + <view class="nav row margin-tb" v-if="selftype==='supplier'" @click="goto('/sub_pages/supplier/wallet/my-wallet',true)"> + <view class="img-c"> + <image class="icon margin-bottom order-icon shlp" + src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/8d/8d72f2df8a4348ac90bfbfb553a9cc71qianbao.png" mode="scaleToFill" /> + </view> + <view class="order-desc syst">我的钱包</view> + </view> + <view class="nav row margin-tb"> + + </view> + <view class="nav row margin-tb"> + + </view> + <view class="nav row margin-tb"> + + </view> </view> </view> @@ -260,7 +279,7 @@ }, async onPullDownRefresh() { await this.$store.dispatch('getCurrentInfo') - await getTj(true) + await this.getTj(true) uni.stopPullDownRefresh() }, onLoad(options) { diff --git a/pages/order/comment/order-comment.vue b/pages/order/comment/order-comment.vue index 0364914..7413112 100644 --- a/pages/order/comment/order-comment.vue +++ b/pages/order/comment/order-comment.vue @@ -113,6 +113,20 @@ }, methods: { + // 改变匿名状态 + changeAnonyMity(item){ + //如果item.anonymityFalg 不存在,则为0,如果点击则为相反数 + item.anonymityFalg=item.anonymityFalg==1?0:1 + return item.anonymityFalg + // if(item.anonymityFalg){ + // item.anonymityFalg=!item.anonymityFalg + // return item.anonymityFalg + // }else{ + // item.anonymityFalg=0 + // item.anonymityFalg=!item.anonymityFalg + // return item.anonymityFalg + // } + }, async submitCommit(){ console.log("提交评价") @@ -650,10 +664,13 @@ <u-col span="12" > <view class="comment-content-div"> - <view class="comment-content-div"> - <u-radio-group v-model="item.anonymityFalg" :labelSize="10"> + <view class="comment-content-div flex "> + <!-- <u-radio-group v-model="item.anonymityFalg" :labelSize="10"> <u-radio label="匿名" :name="1"></u-radio> - </u-radio-group> + </u-radio-group> --> + <view :style="{'margin-top': '5rpx','margin-right': '12rpx','font-size':'24rpx'}" + @click="changeAnonyMity(item)" class="component-radio" :class="[item.anonymityFalg?'cur':'']" ></view> + 匿名 </view> <view class="comment-content-div"> <u--textarea v-model="item.comment" placeholder="请输入内容" count></u--textarea> diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue index 9a9bee1..832538a 100644 --- a/sub_pages/customer/shop/shop.vue +++ b/sub_pages/customer/shop/shop.vue @@ -170,16 +170,18 @@ </view> <view class="m-t-12"> - <view v-for="(item,index) of commentList" > + <view v-for="(item,index) of commentList" :key="index"> <u-row justify="space-between" > - <u-col> + <u-col span="2"> <view style="display: flex; justify-content: flex-start; align-items: center;padding: 5rpx;"> <u--image v-if="item.anonymityFalg==1 " :showLoading="true" src="https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png" width="30px" height="30px" shape="circle"></u--image> <u--image v-else :showLoading="true" :src="item.customerCover" width="30px" height="30px" shape="circle"></u--image> - <span v-if="item.anonymityFalg==1 " >匿名用户</span> - <span v-else>{{item.customerName}}</span> </view> + </u-col> + <u-col span="10" style="font-size: 12px;"> + <span v-if="item.anonymityFalg==1 " >匿名用户</span> + <span v-else>{{item.customerName}}</span> </u-col> <!-- <u-col span="4"> @@ -196,7 +198,7 @@ <view> <view> <span class="flower-unit" >{{item.flowerName}} {{item.flowerLevel}}</span> - <span class="comment"> + <span class="comment" style="font-size: 12px;"> {{item.comment}} </span> </view> @@ -204,7 +206,20 @@ <!-- <u--image v-for="(commentImg,index2) of item.commentImagesList" :key="index2" class="comment-img" :showLoading="true" :src="commentImg"></u--image> --> - <image v-for="(commentImg,index2) of item.commentImagesList" :key="index2" :src="commentImg" class="comment-img" @click="previewImg(commentImg)"></image> + <!-- <image v-for="(commentImg,index2) of item.commentImagesList" :key="index2" :src="commentImg" class="comment-img" @click="previewImg(commentImg)"></image> --> + + <u-grid + :border="false" + @click="click" + > + <u-grid-item + v-for="(commentImg,index2) of item.commentImagesList" + :key="index2" + > + <image :src="commentImg" class="comment-img" @click="previewImg(commentImg)"></image> + </u-grid-item> + </u-grid> + </view> </view> @@ -967,7 +982,7 @@ .comment{ margin: 10px; - font-size: 12rpx; + font-size: 10rpx; } } @@ -983,9 +998,10 @@ display: flex; flex-wrap: wrap; .comment-img{ - margin:10px; - width:80px;; - height:80px; + margin:5rpx; + width:150rpx;; + height:150rpx; + border-radius: 10rpx; } } @@ -994,6 +1010,7 @@ color: #6582B6; margin-top:10rpx; padding: 10rpx; + font-size: 12px; } .flower-unit{ @@ -1003,7 +1020,7 @@ margin-left:0px; padding-left: 5rpx; padding-right: 5rpx; - // font-size: 12px; + font-size: 12px; } } </style> \ No newline at end of file diff --git a/sub_pages/supplier/data-statis/data-statis.vue b/sub_pages/supplier/data-statis/data-statis.vue index 3a532cf..0f5a81e 100644 --- a/sub_pages/supplier/data-statis/data-statis.vue +++ b/sub_pages/supplier/data-statis/data-statis.vue @@ -10,21 +10,38 @@ <u-grid :border="true" col="3"> <u-grid-item > <text class="grid-text">总成交</text> - <view class="grid-text"><span class='statis_val'>0.00</span></view> + <view class="grid-text"><span class='statis_val'>{{tj.allSupplierAmount||0}}</span></view> </u-grid-item> <u-grid-item > <text class="grid-text">本月成交</text> - <view class="grid-text"><span class='statis_val'>0.00</span></view> + <view class="grid-text"><span class='statis_val'>{{tj.curMonSupplierAmount||0}}</span></view> </u-grid-item> <u-grid-item > <text class="grid-text">上月成交</text> - <view class="grid-text"><span class='statis_val'>{{tj.dealCountLastMonth||0}}</span>扎</view> + <view class="grid-text"><span class='statis_val'>{{tj.lastMonSupplierAmount||0}}</span></view> </u-grid-item> + <!-- <u-grid-item > + <text class="grid-text">上月成交</text> + <view class="grid-text"><span class='statis_val'>{{tj.dealCountLastMonth||0}}</span>扎</view> + </u-grid-item> --> <u-grid-item > <text class="grid-text">今日成交</text> - <view class="grid-text"><span class='statis_val'>0.00</span></view> + <view class="grid-text"><span class='statis_val'>{{tj.todaySupplierAmount||0}}</span></view> </u-grid-item> + <u-grid-item > + <text class="grid-text">本月售后订单</text> + <view class="grid-text"><span class='statis_val'>{{tj.curMonAfterSaleOrderNum||0}}</span>单</view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">本月售后扎数</text> + <view class="grid-text"><span class='statis_val'>{{tj.curMonAfterSaleFlowerNum||0}}</span>扎</view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">总成交扎数</text> + <view class="grid-text"><span class='statis_val'>{{tj.allSupplierFlowerNum||0}}</span>扎</view> + </u-grid-item> + <u-grid-item > <text class="grid-text">近30天成交扎数</text> <view class="grid-text"><span class='statis_val'>{{tj.dealCountDay30||0}}</span>扎</view> @@ -45,7 +62,7 @@ <u-line margin="10rpx"></u-line> <view> <u-grid :border="true" col="3"> - <u-grid-item > + <!-- <u-grid-item > <text class="grid-text">迟到(本月)</text> <view class="grid-text"><span class='statis_val'>0</span>次</view> </u-grid-item> @@ -53,24 +70,35 @@ <u-grid-item > <text class="grid-text">迟到(上月)</text> <view class="grid-text"><span class='statis_val'>0</span>次</view> - </u-grid-item> + </u-grid-item> --> <u-grid-item > <text class="grid-text">缺货(本月)</text> - <view class="grid-text"><span class='statis_val'>0</span>扎</view> + <view class="grid-text"><span class='statis_val'>{{tj.curMonLackNum||0}}</span>扎</view> </u-grid-item> - <u-grid-item > - <text class="grid-text">缺货(上月)</text> - <view class="grid-text"><span class='statis_val'>0</span>扎</view> - </u-grid-item> + <u-grid-item > <text class="grid-text">降级(本月)</text> - <view class="grid-text"><span class='statis_val'>0</span>扎</view> + <view class="grid-text"><span class='statis_val'>{{tj.curMonReduceNum||0}}</span>扎</view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">补货(本月)</text> + <view class="grid-text"><span class='statis_val'>{{tj.curMonReplaceNum||0}}</span>扎</view> + </u-grid-item> + + <u-grid-item > + <text class="grid-text">缺货(上月)</text> + <view class="grid-text"><span class='statis_val'>{{tj.lastMonLackNum||0}}</span>扎</view> </u-grid-item> <u-grid-item > <text class="grid-text">降级(上月)</text> - <view class="grid-text"><span class='statis_val'>0</span>扎</view> + <view class="grid-text"><span class='statis_val'>{{tj.lastMonReduceNum||0}}</span>扎</view> </u-grid-item> + <u-grid-item > + <text class="grid-text">补货(上月)</text> + <view class="grid-text"><span class='statis_val'>{{tj.lastMonReplaceNum||0}}</span>扎</view> + </u-grid-item> + <!-- <u-grid-item > <text class="grid-text">未入位(本月)</text> <view class="grid-text"><span class='statis_val'>0</span>扎</view> </u-grid-item> @@ -93,7 +121,7 @@ <u-grid-item > <text class="grid-text">退货(上月)</text> <view class="grid-text"><span class='statis_val'>0</span>扎</view> - </u-grid-item> + </u-grid-item> --> </u-grid> </view> diff --git a/sub_pages/supplier/wallet/my-wallet.vue b/sub_pages/supplier/wallet/my-wallet.vue new file mode 100644 index 0000000..b17f44d --- /dev/null +++ b/sub_pages/supplier/wallet/my-wallet.vue @@ -0,0 +1,220 @@ +<template> + + <view class="u-page"> + <view class="u-demo-block"> + <view class="tixian"> + <u-row > + <u-col span="6"> + <view class="margin-10"> + <u-grid :border="false" col="1"> + <u-grid-item > + <text class="grid-text-white" >可提现(元)</text> + <view class="grid-text-white"><span>¥</span>{{wallet.withdrawableAmount || '0' }}</view> + </u-grid-item> + </u-grid> + </view> + </u-col> + <u-col span="6"> + <view class="margin-10"> + <u-button type="warning" text="提现" size="normal" @click="goto('/sub_pages/supplier/wallet/wallet-withdrao-deposit',true)"></u-button> + </view> + </u-col> + </u-row> + <u-row > + <u-col span="6"> + <view class="margin-10"> + <u-grid :border="false" col="1"> + <u-grid-item > + <text class="grid-text-white">提现中(元)</text> + <view class="grid-text-white"><span>¥</span>{{wallet.withdrawingAmount || '0' }}</view> + </u-grid-item> + </u-grid> + </view> + </u-col> + <u-col span="6"> + <view class="margin-10"> + <u-grid :border="false" col="1"> + <u-grid-item > + <text class="grid-text-white">已提现(元)</text> + <view class="grid-text-white"><span>¥</span>{{wallet.withdrawnAmount || '0' }}</view> + </u-grid-item> + </u-grid> + </view> + </u-col> + </u-row> + </view> + </view> + + <view class="u-demo-block-2" > + <u-grid :border="false" col="3"> + + <u-grid-item > + <text class="grid-text">{{wallet.totalTransactionAmount || '0' }}</text> + <view class="grid-text"><span>总交易额</span></view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">{{wallet.settlingAmount || '0' }}</text> + <view class="grid-text"><span>结算中</span></view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">{{wallet.settledAmount || '0' }}</text> + <view class="grid-text"><span>已结算</span></view> + </u-grid-item> + <u-grid-item > + <text class="grid-text">{{wallet.totalDeduction || '0' }}</text> + <view class="grid-text"><span>总扣款额</span></view> + </u-grid-item> + + </u-grid> + + <u-cell-group> + <u-cell + title="账单明细" + icon="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/a3/a355880bac5742daa71a046cf3487c12zhangdan.png" + isLink + url="/sub_pages/supplier/wallet/wallet-billing-detail" + > + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/a3/a355880bac5742daa71a046cf3487c12zhangdan.png" class="image-icon"></image> + </u-cell> + <u-cell + title="提现记录" + icon="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f9/f90083b4c48b4ce78854bfffdeb702bbqiandaizi.png" + isLink + url="/sub_pages/supplier/wallet/wallet-withdrao-deposit-record" + > + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f9/f90083b4c48b4ce78854bfffdeb702bbqiandaizi.png" class="image-icon"></image> + </u-cell> + <u-cell + title="扣款记录" + icon="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f9/f90083b4c48b4ce78854bfffdeb702bbqiandaizi.png" + isLink + url="/sub_pages/supplier/wallet/wallet-deduction-record" + > + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f9/f90083b4c48b4ce78854bfffdeb702bbqiandaizi.png" class="image-icon"></image> + </u-cell> + </u-cell-group> + </view> + + </view> +</template> + +<script> + export default { + data() { + return { + wallet: {}, + tj_order: {}, + cacheUserId: '' + }; + }, + + onLoad(options) { + + + }, + onShow() { + this.getMyWallet(true) + }, + async onPullDownRefresh() { + this.getMyWallet(true) + }, + methods: { + click(name) { + + }, + getMyWallet(refresh=false) { + // /api/supplier/delivery + + if (this.currentInfo.id && (this.currentInfo.id !== this.cacheUserId || refresh)) { + this.cacheUserId = this.currentInfo.id + let that = this + setTimeout(() => { + //其他统计 + // #ifdef PUB_SUPPLIER + this.$http.request('get', '/v2/wallet/supplier', {}).then(res => { + if (res.code === 0) { + that.wallet = res.data || {} + } + }) + // #endif + // // #ifdef PUB_PARTNER + // this.$http.request('get', '/api/partner/order/statistics', {}).then(res => { + // if (res.code === 0) { + // that.tj = res.data || {} + // } + // }) + // // #endif + + }, 200) + } + + }, + } + } +</script> + +<style lang="scss"> + .u-page{ + .image-icon{ + width:30rpx; + height: 30rpx; + } + .u-button--plain.data-v-3bf2dba7 { + background-color: #00BCD4 !important ; + } + .u-button--plain.u-button--primary.data-v-3bf2dba7 { + color: #FFFFFF; + } + .u-button--primary.data-v-3bf2dba7 { + color: #fff; + border-color: #00BCD4 !important ; + border-width: 1px; + border-style: solid; + border-radius: 10rpx; + width:200rpx; + } + .u-demo-block{ + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 50rpx; + background-color: #00AF68; + margin: 20rpx; + .tixian{ + margin-top: 30rpx; + margin-bottom: 30rpx; + } + } + .u-demo-block-2{ + margin: 30rpx; + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 10rpx; + } + .title{ + text-align: center; + font-size: 30rpx; + color: #909399; + margin: 10rpx; + } + .grid-text-white{ + color: white; + } + .grid-text { + font-size: 14px; + color: #909399; + padding: 10rpx 0 20rpx 0rpx; + /* #ifndef APP-PLUS */ + box-sizing: border-box; + /* #endif */ + } + .statis_val{ + font-size: 16px; + color: black; + // font-weight: bold; + } + + .margin-10{ + margin:10rpx; + } + } +</style> \ No newline at end of file diff --git a/sub_pages/supplier/wallet/wallet-billing-detail.vue b/sub_pages/supplier/wallet/wallet-billing-detail.vue new file mode 100644 index 0000000..4edecd7 --- /dev/null +++ b/sub_pages/supplier/wallet/wallet-billing-detail.vue @@ -0,0 +1,217 @@ +<template> + + <view class="u-page"> + + <view class="u-demo-block-2" > + <view> + <u-cell-group> + <u-cell + @click="showCalendar(index)" + title="日期筛选" + :label="calendarLabel" + isLink + > + <image + slot="icon" + src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d8/d8398aa04a2040809285a9319cd9acc2calendar.png" + mode="widthFix" + class="image-icon" + ></image> + </u-cell> + </u-cell-group> + + <!-- <u-calendar + :show="calendarShow" + :minDate="minDate" + :maxDate="maxDate" + allowSameDay="true" + mode="range" + :defaultDate="[query.startDate,query.endDate]" + @confirm="confirm" + @close="close" + ></u-calendar> --> + <u-calendar + :show="calendarShow" + minDate="2024-07-01" + :maxDate="maxDate" + allowSameDay="true" + :monthNum="12" + mode="range" + :defaultDate="[query.startDate,query.endDate]" + @confirm="confirm" + @close="close" + ></u-calendar> + </view> + + <u-cell-group> + <u-cell + v-for="(item,index) in list " :key="index" + > + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/dc/dc56da3413664c829b0be3c229672c88qianbi.png" class="image-icon"></image> + <view slot="title" class="f10">{{ item.typeName }}</view> + <view slot="label" class="f10" >{{ getYyyyMmDdHh24Mi(item.createTime) }}</view> + <view slot="value" style="text-align: right;" class="f10"> + <view> + <text v-if="item.method==='reduce' ">-</text> + {{ item.changeAmount }} + </view> + <view>余额:{{ item.balance }}</view> + </view> + </u-cell> + </u-cell-group> + </view> + + </view> +</template> + +<script> + import dayjs from 'dayjs' + export default { + data() { + return { + calendarShow:false, + calendarLabel:'', + query:{ + startDate:"", + endDate:"" + }, + minDate: '', + maxDate: '', + }; + }, + + onLoad(options) { + this.getDefaultDate() + this.getPageList() + }, + onShow() { + + }, + onReachBottom() { + this.getMore() + }, + async onPullDownRefresh() { + this.page.current = 1 + await this.getPageList() + uni.stopPullDownRefresh() + }, + methods: { + getDefaultDate(){ + // 获取当天的开始日期和结束日期 + let startDate=dayjs().format('YYYY-MM-DD') + let endDate=dayjs().format('YYYY-MM-DD') + this.query.startDate=startDate + this.query.endDate=endDate + this.calendarLabel=startDate+"~"+endDate + + this.minDate = dayjs().subtract(2, 'month').format('YYYY-MM-DD') + this.maxDate=dayjs().format('YYYY-MM-DD') + }, + click(name) { + + }, + showCalendar(){ + this.calendarShow=true + }, + confirm(e){ + console.log("日历的值") + console.log(e) + this.query.startDate=e[0] + this.query.endDate=e[e.length-1] + this.calendarLabel=e[0]+"~"+e[e.length-1] + this.calendarShow=false + this.getPageList() + }, + close(){ + this.calendarShow=false + }, + + async getPageList(){ + this.page.size=20 + this.listApi = '/v2/wallet-bill-record/page' + let ref=await this.getList() + console.log(ref) + }, + + getYyyyMmDdHh24Mi(date){ + if(date){ + return dayjs(date).format('YYYY-MM-DD HH:mm') + } + return "" + } + + + } + } +</script> + +<style lang="scss"> + .u-page{ + font-size: 14px; + + .f10{ + font-size: 14px; + } + .image-icon{ + width:50rpx; + height: 50rpx; + } + .u-button--plain.data-v-3bf2dba7 { + background-color: #00BCD4; + } + .u-button--plain.u-button--primary.data-v-3bf2dba7 { + color: #FFFFFF; + } + .u-button--primary.data-v-3bf2dba7 { + color: #fff; + border-color: #00BCD4; + border-width: 1px; + border-style: solid; + border-radius: 10rpx; + width:200rpx; + } + .u-demo-block{ + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 50rpx; + background-color: #00AF68; + margin: 20rpx; + .tixian{ + margin-top: 30rpx; + margin-bottom: 30rpx; + } + } + .u-demo-block-2{ + margin: 10rpx; + // padding: 10rpx; + background-color: #FFFFFF; + border-radius: 10rpx; + } + .title{ + text-align: center; + font-size: 30rpx; + color: #909399; + margin: 10rpx; + } + .grid-text-white{ + color: white; + } + .grid-text { + font-size: 14px; + color: #909399; + padding: 10rpx 0 20rpx 0rpx; + /* #ifndef APP-PLUS */ + box-sizing: border-box; + /* #endif */ + } + .statis_val{ + font-size: 16px; + color: black; + // font-weight: bold; + } + + .margin-10{ + margin:10rpx; + } + } +</style> \ No newline at end of file diff --git a/sub_pages/supplier/wallet/wallet-deduction-record.vue b/sub_pages/supplier/wallet/wallet-deduction-record.vue new file mode 100644 index 0000000..4071d06 --- /dev/null +++ b/sub_pages/supplier/wallet/wallet-deduction-record.vue @@ -0,0 +1,222 @@ +<template> + + <view class="u-page"> + + <view class="u-demo-block-2" > + <!-- <view> + <u-cell-group> + <u-cell + @click="showCalendar(index)" + title="日期筛选" + :label="calendarLabel" + isLink + > + <image + slot="icon" + src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d8/d8398aa04a2040809285a9319cd9acc2calendar.png" + mode="widthFix" + class="image-icon" + ></image> + </u-cell> + </u-cell-group> + + <u-calendar + :show="calendarShow" + mode="multiple" + :defaultDate="['2022-03-01']" + @confirm="confirm" + @close="close" + ></u-calendar> + </view> --> + <view class="margin-10" style="height: 50px;"> + <um-dropdown width="200rpx" @change="canlendarTypeChange" :defaultIndex="def" rangeKey="label" :optionList="typeList"></um-dropdown> + </view> + <u-cell-group > + <u-cell v-for="(item,index) in list " :key="index" class="margin-10"> + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/dc/dc56da3413664c829b0be3c229672c88qianbi.png" class="image-icon"></image> + <view slot="title"> + <text class="f10">类别:{{item.typeName}}</text> + </view> + <view slot="label"> + <text class="f10">时间:{{getYyyyMmDdHh24Mi(item.auditTime)}}</text> + </view> + <view slot="value" class="content-right"> + <view class="f10">¥ {{item.fee}}</view> + </view> + </u-cell> + + </u-cell-group> + </view> + + </view> +</template> + +<script> +// 引入dayjs + import dayjs from 'dayjs' + export default { + data() { + return { + calendarShow:false, + calendarLabel:'', + query:{ + startDate:"", + endDate:"" + }, + type: 'month', //supplierName + def: 0, + typeList:[ + { + label: '本月', + value: 'month', + }, + { + label: '全部', + value: 'all', + }, + ], + }; + }, + + onLoad(options) { + this.getPageList() + + }, + onShow() { + + }, + onReachBottom() { + this.getMore() + }, + async onPullDownRefresh() { + this.page.current = 1 + await this.getPageList() + uni.stopPullDownRefresh() + }, + methods: { + getDefaultDate(){ + // 获取当月的开始日期和结束日期 + let startDate=dayjs().startOf('month').format('YYYY-MM-DD') + let endDate=dayjs().endOf('month').format('YYYY-MM-DD') + this.query.startDate=startDate + this.query.endDate=endDate + }, + + click(name) { + + }, + showCalendar(){ + this.calendarShow=true + }, + confirm(e){ + console.log("日历的值") + console.log(e) + this.queryForm.startDate=e[0] + this.queryForm.endDate=e[1] + this.calendarLabel=e[0]+"~"+e[1] + this.calendarShow=false + }, + close(){ + this.calendarShow=false + }, + canlendarTypeChange(e){ + this.type = e.value + this.query.startDate="" + this.query.endDate="" + if(this.type=='month'){ + this.getDefaultDate() + } + // 触发查询操作 + this.getPageList() + }, + async getPageList(){ + this.page.size=20 + this.listApi = '/v2/wallet/reduce-record/supplier/page' + let ref=await this.getList() + console.log(ref) + }, + getYyyyMmDdHh24Mi(date){ + if(date){ + return dayjs(date).format('YYYY-MM-DD HH:mm') + } + return "" + } + + } + } +</script> + +<style lang="scss"> + .u-page{ + font-size: 14px; + + .f10{ + font-size: 14px; + } + + .content-right{ + text-align: right; + } + .image-icon{ + width:50rpx; + height: 50rpx; + } + .u-button--plain.data-v-3bf2dba7 { + background-color: #00BCD4; + } + .u-button--plain.u-button--primary.data-v-3bf2dba7 { + color: #FFFFFF; + } + .u-button--primary.data-v-3bf2dba7 { + color: #fff; + border-color: #00BCD4; + border-width: 1px; + border-style: solid; + border-radius: 10rpx; + width:200rpx; + } + .u-demo-block{ + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 50rpx; + background-color: #00AF68; + margin: 20rpx; + .tixian{ + margin-top: 30rpx; + margin-bottom: 30rpx; + } + } + .u-demo-block-2{ + margin: 10rpx; + // padding: 10rpx; + background-color: #FFFFFF; + border-radius: 10rpx; + } + .title{ + text-align: center; + font-size: 30rpx; + color: #909399; + margin: 10rpx; + } + .grid-text-white{ + color: white; + } + .grid-text { + font-size: 14px; + color: #909399; + padding: 10rpx 0 20rpx 0rpx; + /* #ifndef APP-PLUS */ + box-sizing: border-box; + /* #endif */ + } + .statis_val{ + font-size: 16px; + color: black; + // font-weight: bold; + } + + .margin-10{ + margin:10rpx; + } + } +</style> \ No newline at end of file diff --git a/sub_pages/supplier/wallet/wallet-withdrao-deposit-record.vue b/sub_pages/supplier/wallet/wallet-withdrao-deposit-record.vue new file mode 100644 index 0000000..649a8eb --- /dev/null +++ b/sub_pages/supplier/wallet/wallet-withdrao-deposit-record.vue @@ -0,0 +1,226 @@ +<template> + + <view class="u-page"> + + <view class="u-demo-block-2" > + <!-- <view> + <u-cell-group> + <u-cell + @click="showCalendar(index)" + title="日期筛选" + :label="calendarLabel" + isLink + > + <image + slot="icon" + src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d8/d8398aa04a2040809285a9319cd9acc2calendar.png" + mode="widthFix" + class="image-icon" + ></image> + </u-cell> + </u-cell-group> + + <u-calendar + :show="calendarShow" + mode="multiple" + :defaultDate="['2022-03-01']" + @confirm="confirm" + @close="close" + ></u-calendar> + </view> --> + <view class="margin-10" style="height: 50px;"> + <um-dropdown width="200rpx" @change="canlendarTypeChange" :defaultIndex="def" rangeKey="label" :optionList="typeList"></um-dropdown> + </view> + <u-cell-group> + <u-cell v-for="(item,index) in list " :key="index"> + <image slot="icon" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/dc/dc56da3413664c829b0be3c229672c88qianbi.png" class="image-icon"></image> + <view slot="title"> + <text class="f10">提交:{{getYyyyMmDdHh24Mi(item.createTime)}}</text> + <text class="margin-lf-20 f10">¥{{item.amount}}</text> + </view> + <view slot="value" class="content-right"> + <view class="f10">{{ item.withdrawStateStr }}</view> + </view> + </u-cell> + + + </u-cell-group> + </view> + + </view> +</template> + +<script> + // 引入dayjs + import dayjs from 'dayjs' + export default { + data() { + return { + calendarShow:false, + calendarLabel:'', + query:{ + startDate:"", + endDate:"" + }, + type: 'month', //supplierName + def: 0, + typeList:[ + { + label: '本月', + value: 'month', + }, + { + label: '全部', + value: 'all', + }, + ], + }; + }, + + onLoad(options) { + this.getPageList() + }, + onShow() { + + }, + onReachBottom() { + this.getMore() + }, + async onPullDownRefresh() { + this.page.current = 1 + await this.getPageList() + uni.stopPullDownRefresh() + }, + methods: { + getDefaultDate(){ + // 获取当月的开始日期和结束日期 + let startDate=dayjs().startOf('month').format('YYYY-MM-DD') + let endDate=dayjs().endOf('month').format('YYYY-MM-DD') + this.query.startDate=startDate + this.query.endDate=endDate + }, + + click(name) { + + }, + showCalendar(){ + this.calendarShow=true + }, + confirm(e){ + console.log("日历的值") + console.log(e) + this.query.startDate=e[0] + this.query.endDate=e[1] + this.calendarLabel=e[0]+"~"+e[1] + this.calendarShow=false + }, + close(){ + this.calendarShow=false + }, + canlendarTypeChange(e){ + this.type = e.value + this.query.startDate="" + this.query.endDate="" + if(this.type=='month'){ + this.getDefaultDate() + } + // 触发查询操作 + this.getPageList() + }, + + async getPageList(){ + this.page.size=20 + this.listApi = '/v2/withdraw-record/supplier/page' + let ref=await this.getList() + console.log(ref) + }, + + getYyyyMmDdHh24Mi(date){ + if(date){ + return dayjs(date).format('YYYY-MM-DD HH:mm') + } + return "" + } + + } + } +</script> + +<style lang="scss"> + .u-page{ + font-size: 14px; + + .f10{ + font-size: 14px; + } + + .content-right{ + text-align: right; + } + .image-icon{ + width:50rpx; + height: 50rpx; + } + .u-button--plain.data-v-3bf2dba7 { + background-color: #00BCD4; + } + .u-button--plain.u-button--primary.data-v-3bf2dba7 { + color: #FFFFFF; + } + .u-button--primary.data-v-3bf2dba7 { + color: #fff; + border-color: #00BCD4; + border-width: 1px; + border-style: solid; + border-radius: 10rpx; + width:200rpx; + } + .u-demo-block{ + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 50rpx; + background-color: #00AF68; + margin: 20rpx; + .tixian{ + margin-top: 30rpx; + margin-bottom: 30rpx; + } + } + .u-demo-block-2{ + margin: 10rpx; + // padding: 10rpx; + background-color: #FFFFFF; + border-radius: 10rpx; + } + .title{ + text-align: center; + font-size: 30rpx; + color: #909399; + margin: 10rpx; + } + .grid-text-white{ + color: white; + } + .grid-text { + font-size: 14px; + color: #909399; + padding: 10rpx 0 20rpx 0rpx; + /* #ifndef APP-PLUS */ + box-sizing: border-box; + /* #endif */ + } + .statis_val{ + font-size: 16px; + color: black; + // font-weight: bold; + } + + .margin-10{ + margin:10rpx; + } + + .margin-lf-20{ + margin:20rpx; + } + } +</style> \ No newline at end of file diff --git a/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue b/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue new file mode 100644 index 0000000..0c983f5 --- /dev/null +++ b/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue @@ -0,0 +1,228 @@ +<template> + + <view class="u-page"> + + <view class="u-demo-block-2" > + <view class="margin-10"><span>提现金额</span></view> + <view class="margin-10"> + <u--form + labelPosition="left" + :model="walletInfo" + :rules="rules" + ref="uForm" + > + <u-form-item + label="¥" + prop="amount" + borderBottom + ref="item1" + > + <u--input + v-model="walletInfo.amount" + border="none" + placeholder="请输入提现金额" + ></u--input> + </u-form-item> + </u--form> + </view> + <view class="margin-10"> + 可提现余额<span class="t-red" style="margin-left:10rpx;margin-right:10rpx;">{{wallet.withdrawableAmount || '0' }}</span>元 + </view> + + + <!-- #ifdef PUB_SUPPLIER --> + + <view class="topic-gray flex " style=""> + <view :style="{'margin-top': '24rpx','margin-right': '12rpx','font-size':'24rpx'}" + @click="protocal=!protocal" class="component-radio" :class="[protocal?'cur':'']" > + </view> + <view :style="{'margin-top': '24rpx','margin-right': '12rpx','font-size':'24rpx'}">我已阅读并同意<span class="t-red" @click="goto('/pages/help/content?id=提现协议',false)">《提现协议》</span></view> + </view> + + <!-- #endif --> + + <view class="margin-30"> + <u-button type="primary" text="立即提现" size="normal" :disabled="!protocal" @click="submitWithdraw"></u-button> + </view> + </view> + + </view> +</template> + +<script> + export default { + data() { + return { + protocal:0, + wallet:{}, + walletInfo: { + "amount":0, + }, + rules:{ + 'amount':[ + { required: true, message: '请输入提现金额', trigger: ['blur', 'change'] }, + { validator: this.validateDecimal, trigger: ['blur', 'change'] } + ] + } + }; + }, + + onLoad(options) { + + + }, + onShow() { + this.getMyWallet(true) + + }, + async onPullDownRefresh() { + + }, + methods: { + submitWithdraw(){ + // 判断输入的金额是否是数字,需要真正则表达式,两位小数点 + this.$refs.uForm.validate().then(async res => { + const resp = await this.$http.request('post', '/v2/withdraw-record', { + data: this.walletInfo + }); + if (resp.code === 0) { + this.$message.showToast('提现操作成功,等待审核!') + // this.getMyWallet(true) + setTimeout(() => { + uni.navigateBack() + }, 1000) + } else { + this.$message.showToast(resp.msg) + } + + }).catch(err => { + console.log(err) + }) + + }, + + validateDecimal(rule, value, callback) { + + const decimalRegex = /^\d+(\.\d{1,2})?$/; // 正则表达式,支持最多两位小数 + if (!value) { + return callback(new Error('请输入提现金额')); + } + if (!decimalRegex.test(value)) { + return callback(new Error('提现金额必须是有效的数字(最多两位小数)')); + } + if (value > this.wallet.withdrawableAmount) { + return callback(new Error('提现金额不能大于可提现金额')); + } + callback(); + }, + + click(name) { + + }, + + getMyWallet(refresh=false) { + // /api/supplier/delivery + + if (this.currentInfo.id && (this.currentInfo.id !== this.cacheUserId || refresh)) { + this.cacheUserId = this.currentInfo.id + let that = this + setTimeout(() => { + //其他统计 + // #ifdef PUB_SUPPLIER + this.$http.request('get', '/v2/wallet/supplier', {}).then(res => { + if (res.code === 0) { + that.wallet = res.data || {} + } + }) + // #endif + // // #ifdef PUB_PARTNER + // this.$http.request('get', '/api/partner/order/statistics', {}).then(res => { + // if (res.code === 0) { + // that.tj = res.data || {} + // } + // }) + // // #endif + + }, 200) + } + + }, + + }, + onReady() { + //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。 + this.$refs.uForm.setRules(this.rules) + }, + } +</script> + +<style lang="scss"> + .u-page{ + .image-icon{ + width:30rpx; + height: 30rpx; + } + // .u-button--plain.data-v-3bf2dba7 { + // background-color: #00BCD4; + // } + // .u-button--plain.u-button--primary.data-v-3bf2dba7 { + // color: #FFFFFF; + // } + // .u-button--primary.data-v-3bf2dba7 { + // color: #fff; + // border-color: #00BCD4; + // border-width: 1px; + // border-style: solid; + // border-radius: 10rpx; + // width:200rpx; + // } + .u-demo-block{ + padding: 10rpx; + background-color: #FFFFFF; + border-radius: 50rpx; + background-color: #00AF68; + margin: 20rpx; + .tixian{ + margin-top: 30rpx; + margin-bottom: 30rpx; + } + } + .u-demo-block-2{ + margin: 30rpx; + padding: 30rpx; + // padding-top: 20rpx; + background-color: #FFFFFF; + border-radius: 10rpx; + } + .title{ + text-align: center; + font-size: 30rpx; + color: #909399; + margin: 10rpx; + } + .grid-text-white{ + color: white; + } + .grid-text { + font-size: 14px; + color: #909399; + padding: 10rpx 0 20rpx 0rpx; + /* #ifndef APP-PLUS */ + box-sizing: border-box; + /* #endif */ + } + .statis_val{ + font-size: 16px; + color: black; + // font-weight: bold; + } + + .margin-10{ + margin:10rpx; + } + + .margin-30{ + margin-top:30rpx; + } + } +</style> \ No newline at end of file -- Gitblit v1.9.3