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.

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