You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

491 lines
12 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="app-container">
  3. <view class="agent-content">
  4. <view class="avatar-information">
  5. <view class="avatar-container">
  6. <image class="avatar-img" v-if="accountInfo.logo" :src="accountInfo.logo" alt="" />
  7. <image class="avatar-img" v-else src="/static/index/head-sculpture.png" alt="" />
  8. </view>
  9. <view class="information-content">
  10. <view class="information-name">{{accountInfo.name}}</view>
  11. <view class="address-text">地址{{accountInfo.address || '未填写地址'}}</view>
  12. </view>
  13. </view>
  14. <view class="information-id-content">
  15. <view class="content-id-item">
  16. <view class="id-text">
  17. 商户ID
  18. </view>
  19. <view class="id-value">
  20. {{accountInfo.id}}
  21. </view>
  22. </view>
  23. <view class="information-alipay-content" @click="toManagement()">
  24. <view>
  25. <text>支付宝余额{{accountInfo.wallet_balance}}</text>
  26. </view>
  27. <view>
  28. <text>提现管理 >></text>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="revenue-information" @click="handlerOrder">
  33. <view class="projected-revenue-content">
  34. <view class="projected-revenue-item">
  35. <view class="character-style"></view>
  36. <view class="character-price">{{accountInfo.waiting_revenue}}</view>
  37. </view>
  38. <view class="revenue-item-text">
  39. <view class="character-text">预计到账收益</view>
  40. <image class="help-icon"
  41. src="https://common-1257637852.cos.ap-guangzhou.myqcloud.com/paidui-pay/help-icon.png" />
  42. </view>
  43. </view>
  44. <view class="segmentation"></view>
  45. <view class="projected-revenue-content">
  46. <view class="projected-revenue-item">
  47. <view class="character-style"></view>
  48. <view class="character-price">{{accountInfo.received_revenue}}</view>
  49. </view>
  50. <view class="revenue-item-text">
  51. <view class="character-text">总到账收益</view>
  52. <image class="help-icon"
  53. src="https://common-1257637852.cos.ap-guangzhou.myqcloud.com/paidui-pay/help-icon.png" />
  54. </view>
  55. </view>
  56. </view>
  57. <view class="recent-orders-content">
  58. <view class="recent-orders-title">
  59. <image class="title-stlye" src="/static/index/merchant-title-style.png" alt="" />
  60. <view class="title-text">最近订单</view>
  61. </view>
  62. <view class="ordering-information" v-for="order in orderList" :key="order.out_trade_no">
  63. <view class="order-number">订单编号 {{order.out_trade_no}}</view>
  64. <view class="ordering-information-item">
  65. <view class="ordering-pic">
  66. <image v-if="accountInfo.logo" class="order-chart" :src="accountInfo.logo" alt="" />
  67. <image v-else class="order-chart" src="/static/index/order-chart.png" alt="" />
  68. </view>
  69. <view class="ordering-text">
  70. <view class="ordering-text-title">{{accountInfo.name}}</view>
  71. <view class="amount-list">
  72. <view class="amount-of-money">订单金额<span class="price-style">{{order.amount}}</span></view>
  73. <view class="amount-of-money">分成金额<span class="price-style">{{share_amount(order)}}</span></view>
  74. </view>
  75. <view class="amount-list">
  76. <view class="amount-of-money">扣手续费<span class="price-style">{{order.merchant_fee}}</span></view>
  77. <view class="amount-of-money">实际收益<span class="price-style">{{order.merchant_income}}</span></view>
  78. </view>
  79. <view class="order-time">订单时间{{order.paid_at}}</view>
  80. </view>
  81. </view>
  82. <view class="order-status">
  83. <button class="refund-button" v-if="order.refund_status==0" @click="orderRefund(order)">退款</button>
  84. <button class="refunded-button-style" v-if="order.refund_status==1">退款中...</button>
  85. <text class="refunded-style-success" v-if="order.refund_status==2">退款成功</text>
  86. <text class="refunded-style-reject" v-if="order.refund_status==3">退款失败{{order.refund_fail_reason}}</text>
  87. </view>
  88. <view class="divider-style"></view>
  89. </view>
  90. </view>
  91. <view class="load-more" @click="getOrderList">{{ hasMore ? '加载更多数据...' : '已加载完毕' }}</view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import {
  97. merchantAccountInfo,
  98. merchantOrderList,
  99. merchantOrderRefund
  100. } from '../../common/api.js'
  101. export default {
  102. data() {
  103. return {
  104. accountInfo: {},
  105. orderList: [],
  106. hasMore: true,
  107. page: 0,
  108. }
  109. },
  110. onLoad() {
  111. this.getAccountInfo()
  112. this.getOrderList()
  113. },
  114. onReachBottom() {
  115. this.getOrderList()
  116. },
  117. methods: {
  118. getAccountInfo() {
  119. merchantAccountInfo().then(data => this.accountInfo = data)
  120. },
  121. getOrderList() {
  122. if (!this.hasMore) {
  123. return
  124. }
  125. this.page++
  126. merchantOrderList({
  127. page: this.page,
  128. page_size: 15
  129. }).then(data => {
  130. this.orderList = [...this.orderList, ...data.list]
  131. this.hasMore = data.has_more
  132. })
  133. },
  134. orderRefund(item) {
  135. uni.showModal({
  136. content: '确认退款?',
  137. success: function (res) {
  138. if (res.confirm) {
  139. merchantOrderRefund({
  140. out_trade_no: item.out_trade_no
  141. }).then(data => {
  142. item = Object.assign(item, data.new_attr)
  143. uni.showModal({
  144. content: data.refund_msg,
  145. showCancel: false
  146. });
  147. })
  148. }
  149. }
  150. })
  151. },
  152. toManagement(){
  153. uni.navigateTo({
  154. url:'/pages/merchant-withdrawal-management/merchant-withdrawal-management'
  155. })
  156. },
  157. handlerOrder() {
  158. // uni.navigateTo({
  159. // url: '/pages/user-orders/user-orders'
  160. // });
  161. },
  162. share_amount: function(order) {
  163. return (parseFloat(order.merchant_income) + parseFloat(order.merchant_fee)).toFixed(2)
  164. }
  165. },
  166. onNavigationBarButtonTap(e) {
  167. uni.showModal({
  168. title: '提示',
  169. content: '确认注销登录吗?',
  170. success: function (res) {
  171. if (res.confirm) {
  172. uni.reLaunch({
  173. url: "/pages/merchant-login/index"
  174. });
  175. uni.removeStorageSync('merchant_token');
  176. }
  177. }
  178. });
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. .agent-content {
  184. position: relative;
  185. width: 100%;
  186. height: 1500rpx;
  187. padding-left: 30rpx;
  188. padding-right: 30rpx;
  189. background: url(../../static/index/merchant-index-bg.png) no-repeat top center;
  190. background-size: 100% 100%;
  191. box-sizing: border-box;
  192. .avatar-information {
  193. //display: flex;
  194. //justify-content: left;
  195. //align-items: center;
  196. padding: 30rpx 0;
  197. .avatar-container {
  198. display: inline-block;
  199. width: 120rpx;
  200. .avatar-img {
  201. width: 110rpx;
  202. height: 110rpx;
  203. border-radius: 50%;
  204. }
  205. }
  206. .information-content {
  207. display: inline-block;
  208. width: calc(100% - 120rpx - 30rpx);
  209. margin-left: 30rpx;
  210. .information-name {
  211. font-family: PingFangSC-Regular, sans-serif;
  212. font-size: 32rpx;
  213. color: #fff;
  214. font-weight: bold;
  215. }
  216. .address-text {
  217. font-family: PingFangSC-Regular, sans-serif;
  218. font-size: 24rpx;
  219. color: #fff;
  220. margin-top: 15rpx;
  221. }
  222. }
  223. }
  224. .information-alipay-content{
  225. font-size: 24rpx;
  226. color: #fff;
  227. display: flex;
  228. flex-direction: column;
  229. }
  230. .information-id-content {
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. padding: 0 25rpx;
  235. padding-bottom: 30rpx;
  236. .content-id-item {
  237. display: flex;
  238. justify-content: left;
  239. align-items: center;
  240. .id-text {
  241. font-family: PingFangSC-Regular, sans-serif;
  242. font-size: 24rpx;
  243. color: #fff;
  244. }
  245. .id-value {
  246. font-family: PingFangSC-Regular, sans-serif;
  247. font-size: 24rpx;
  248. color: #fff;
  249. }
  250. }
  251. }
  252. .revenue-information {
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. height: 200rpx;
  257. background: url(../../static/index/income-bg.png) no-repeat center center;
  258. background-size: cover;
  259. padding: 0 60rpx;
  260. .projected-revenue-content {
  261. text-align: center;
  262. .projected-revenue-item {
  263. display: flex;
  264. justify-content: left;
  265. align-items: baseline;
  266. .character-style {
  267. font-family: PingFangSC-Regular, sans-serif;
  268. font-size: 30rpx;
  269. color: #454545;
  270. }
  271. .character-price {
  272. font-family: "Din";
  273. font-size: 50rpx;
  274. color: #454545;
  275. font-weight: bold;
  276. margin-left: 10rpx;
  277. }
  278. }
  279. .revenue-item-text {
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. margin-top: 10rpx;
  284. }
  285. .character-text {
  286. font-family: PingFangSC-Regular, sans-serif;
  287. font-size: 28rpx;
  288. color: #454545;
  289. font-weight: bold;
  290. }
  291. image.help-icon {
  292. width: 30rpx;
  293. height: 30rpx;
  294. background-size: cover;
  295. margin-left: 10rpx;
  296. }
  297. }
  298. .segmentation {
  299. width: 1rpx;
  300. height: 90rpx;
  301. background: #E6E3E3;
  302. }
  303. }
  304. .recent-orders-content {
  305. background: #fff;
  306. margin-top: -2rpx;
  307. .recent-orders-title {
  308. display: flex;
  309. justify-content: left;
  310. align-items: center;
  311. padding: 30rpx;
  312. image.title-stlye {
  313. width: 15rpx;
  314. height: 19rpx;
  315. background-size: cover;
  316. margin-right: 20rpx;
  317. }
  318. .title-text {
  319. font-family: PingFangSC-Regular, sans-serif;
  320. font-size: 30rpx;
  321. color: #454545;
  322. font-weight: bold;
  323. }
  324. }
  325. .ordering-information {
  326. padding-bottom: 30rpx;
  327. .order-number {
  328. font-family: PingFangSC-Regular, sans-serif;
  329. font-size: 26rpx;
  330. color: #454545;
  331. padding: 0 30rpx;
  332. }
  333. .ordering-information-item {
  334. display: flex;
  335. justify-content: left;
  336. align-items: center;
  337. padding: 30rpx;
  338. .ordering-pic {
  339. width: 120rpx;
  340. height: 120rpx;
  341. background-size: cover;
  342. border-radius: 15rpx;
  343. image.order-chart {
  344. width: 120rpx;
  345. height: 120rpx;
  346. background-size: cover;
  347. border-radius: 15rpx;
  348. }
  349. }
  350. .ordering-text {
  351. margin-left: 30rpx;
  352. width: 100%;
  353. line-height: 110%;
  354. .ordering-text-title {
  355. font-family: PingFangSC-Regular, sans-serif;
  356. font-size: 30rpx;
  357. color: #454545;
  358. }
  359. .amount-list {
  360. display: flex;
  361. justify-content: flex-start;
  362. }
  363. .amount-of-money {
  364. font-family: PingFangSC-Regular, sans-serif;
  365. font-size: 24rpx;
  366. color: #999;
  367. width: 50%;
  368. span.price-style {
  369. font-family: PingFangSC-Regular, sans-serif;
  370. font-size: 24rpx;
  371. color: #F52F3E;
  372. }
  373. }
  374. .order-time {
  375. font-family: PingFangSC-Regular, sans-serif;
  376. font-size: 24rpx;
  377. color: #999;
  378. }
  379. }
  380. }
  381. .order-status {
  382. display: flex;
  383. justify-content: right;
  384. align-items: center;
  385. padding: 30rpx 20rpx;
  386. border-top: 1rpx solid #eeeeee;
  387. button.refund-button {
  388. min-width: 120rpx;
  389. height: 48rpx;
  390. line-height: 44rpx;
  391. font-family: PingFangSC-Regular, sans-serif;
  392. font-size: 24rpx;
  393. color: #454545;
  394. border-color: #E5E5E5;
  395. background: #fff;
  396. border-radius: 100rpx;
  397. margin: 0;
  398. margin-left: 500rpx;
  399. border: 1rpx solid #E5E5E5;
  400. }
  401. button.refunded-button-style {
  402. min-width: 130rpx;
  403. height: 48rpx;
  404. line-height: 44rpx;
  405. font-family: PingFangSC-Regular, sans-serif;
  406. font-size: 24rpx;
  407. color: #999 !important;
  408. background: #fff;
  409. border-radius: 100rpx;
  410. margin: 0;
  411. margin-left: 500rpx;
  412. border: 1rpx solid #E5E5E5;
  413. }
  414. .refunded-style-success {
  415. height: 48rpx;
  416. line-height: 44rpx;
  417. font-family: PingFangSC-Regular, sans-serif;
  418. font-size: 24rpx;
  419. color: #38a800 !important;
  420. margin: 0;
  421. }
  422. .refunded-style-reject {
  423. height: 48rpx;
  424. line-height: 44rpx;
  425. font-family: PingFangSC-Regular, sans-serif;
  426. font-size: 24rpx;
  427. color: #e30000 !important;
  428. margin: 0;
  429. }
  430. }
  431. .divider-style {
  432. width: 690rpx;
  433. height: 10rpx;
  434. background: #f7f7f7;
  435. }
  436. }
  437. }
  438. }
  439. .load-more {
  440. text-align: center;
  441. font-size: 14px;
  442. }
  443. </style>