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.

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