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.

394 lines
9.2 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
  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" v-if="order.settle_status==0">
  67. <button class="refund-button" v-if="order.order_status==1"
  68. @click="orderRefund(order)">退款</button>
  69. <button class="refunded-button-style" v-if="order.order_status==2">退款中...</button>
  70. <button class="refunded-button-style" v-if="order.order_status==3">退款成功</button>
  71. </view>
  72. <view class="divider-style"></view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. merchantAccountInfo,
  83. merchantOrderList,
  84. merchantOrderRefund
  85. } from '../../common/api.js'
  86. export default {
  87. data() {
  88. return {
  89. accountInfo: {},
  90. orderList: []
  91. }
  92. },
  93. onLoad() {
  94. this.getAccountInfo()
  95. this.getOrderList()
  96. },
  97. methods: {
  98. getAccountInfo() {
  99. merchantAccountInfo().then(data => this.accountInfo = data)
  100. },
  101. getOrderList() {
  102. merchantOrderList({
  103. page: 1,
  104. page_size: 15
  105. }).then(data => this.orderList = data.list)
  106. },
  107. orderRefund(item) {
  108. uni.showModal({
  109. content: '确认退款?',
  110. success: function (res) {
  111. if (res.confirm) {
  112. merchantOrderRefund({
  113. out_trade_no: item.out_trade_no
  114. }).then(data => {
  115. item = Object.assign(item, data.new_attr)
  116. uni.showModal({
  117. content: data.refund_msg,
  118. showCancel: false
  119. });
  120. })
  121. }
  122. }
  123. })
  124. },
  125. handlerOrder() {
  126. // uni.navigateTo({
  127. // url: '/pages/user-orders/user-orders'
  128. // });
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. .agent-content {
  135. position: relative;
  136. width: 100%;
  137. height: 1500rpx;
  138. padding-left: 30rpx;
  139. padding-right: 30rpx;
  140. background: url(../../static/index/merchant-index-bg.png) no-repeat top center;
  141. background-size: 100% 100%;
  142. box-sizing: border-box;
  143. .avatar-information {
  144. display: flex;
  145. justify-content: left;
  146. align-items: center;
  147. padding: 30rpx 0;
  148. .information-content {
  149. margin-left: 30rpx;
  150. .information-name {
  151. font-family: PingFangSC-Regular, sans-serif;
  152. font-size: 32rpx;
  153. color: #fff;
  154. font-weight: bold;
  155. }
  156. .address-text {
  157. font-family: PingFangSC-Regular, sans-serif;
  158. font-size: 24rpx;
  159. color: #fff;
  160. margin-top: 15rpx;
  161. }
  162. }
  163. }
  164. .information-id-content {
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. padding: 0 25rpx;
  169. padding-bottom: 30rpx;
  170. .content-id-item {
  171. display: flex;
  172. justify-content: left;
  173. align-items: center;
  174. .id-text {
  175. font-family: PingFangSC-Regular, sans-serif;
  176. font-size: 24rpx;
  177. color: #fff;
  178. }
  179. .id-value {
  180. font-family: PingFangSC-Regular, sans-serif;
  181. font-size: 24rpx;
  182. color: #fff;
  183. }
  184. }
  185. }
  186. .revenue-information {
  187. display: flex;
  188. justify-content: space-between;
  189. align-items: center;
  190. height: 200rpx;
  191. background: url(../../static/index/income-bg.png) no-repeat center center;
  192. background-size: cover;
  193. padding: 0 60rpx;
  194. .projected-revenue-content {
  195. text-align: center;
  196. .projected-revenue-item {
  197. display: flex;
  198. justify-content: left;
  199. align-items: baseline;
  200. .character-style {
  201. font-family: PingFangSC-Regular, sans-serif;
  202. font-size: 30rpx;
  203. color: #454545;
  204. }
  205. .character-price {
  206. font-family: "Din";
  207. font-size: 50rpx;
  208. color: #454545;
  209. font-weight: bold;
  210. margin-left: 10rpx;
  211. }
  212. }
  213. .revenue-item-text {
  214. display: flex;
  215. justify-content: center;
  216. align-items: center;
  217. margin-top: 10rpx;
  218. }
  219. .character-text {
  220. font-family: PingFangSC-Regular, sans-serif;
  221. font-size: 28rpx;
  222. color: #454545;
  223. font-weight: bold;
  224. }
  225. image.help-icon {
  226. width: 30rpx;
  227. height: 30rpx;
  228. background-size: cover;
  229. margin-left: 10rpx;
  230. }
  231. }
  232. .segmentation {
  233. width: 1rpx;
  234. height: 90rpx;
  235. background: #E6E3E3;
  236. }
  237. }
  238. .recent-orders-content {
  239. background: #fff;
  240. margin-top: -2rpx;
  241. .recent-orders-title {
  242. display: flex;
  243. justify-content: left;
  244. align-items: center;
  245. padding: 30rpx;
  246. image.title-stlye {
  247. width: 15rpx;
  248. height: 19rpx;
  249. background-size: cover;
  250. margin-right: 20rpx;
  251. }
  252. .title-text {
  253. font-family: PingFangSC-Regular, sans-serif;
  254. font-size: 30rpx;
  255. color: #454545;
  256. font-weight: bold;
  257. }
  258. }
  259. .ordering-information {
  260. padding-bottom: 30rpx;
  261. .order-number {
  262. font-family: PingFangSC-Regular, sans-serif;
  263. font-size: 26rpx;
  264. color: #454545;
  265. padding: 0 30rpx;
  266. }
  267. .ordering-information-item {
  268. display: flex;
  269. justify-content: left;
  270. align-items: center;
  271. padding: 30rpx;
  272. .ordering-pic {
  273. width: 120rpx;
  274. height: 120rpx;
  275. background-size: cover;
  276. border-radius: 15rpx;
  277. image.order-chart {
  278. width: 120rpx;
  279. height: 120rpx;
  280. background-size: cover;
  281. border-radius: 15rpx;
  282. }
  283. }
  284. .ordering-text {
  285. margin-left: 30rpx;
  286. .ordering-text-title {
  287. font-family: PingFangSC-Regular, sans-serif;
  288. font-size: 30rpx;
  289. color: #454545;
  290. }
  291. .amount-of-money {
  292. font-family: PingFangSC-Regular, sans-serif;
  293. font-size: 24rpx;
  294. color: #999;
  295. padding: 10rpx 0;
  296. span.price-style {
  297. font-family: PingFangSC-Regular, sans-serif;
  298. font-size: 24rpx;
  299. color: #F52F3E;
  300. }
  301. }
  302. .order-time {
  303. font-family: PingFangSC-Regular, sans-serif;
  304. font-size: 24rpx;
  305. color: #999;
  306. }
  307. }
  308. }
  309. .order-status {
  310. display: flex;
  311. justify-content: space-around;
  312. align-items: center;
  313. padding: 30rpx 0;
  314. border-top: 1rpx solid #eeeeee;
  315. button.refund-button {
  316. min-width: 120rpx;
  317. height: 48rpx;
  318. line-height: 44rpx;
  319. font-family: PingFangSC-Regular, sans-serif;
  320. font-size: 24rpx;
  321. color: #454545;
  322. border-color: #E5E5E5;
  323. background: #fff;
  324. border-radius: 100rpx;
  325. margin: 0;
  326. margin-left: 500rpx;
  327. border: 1rpx solid #E5E5E5;
  328. }
  329. button.refunded-button-style {
  330. min-width: 130rpx;
  331. height: 48rpx;
  332. line-height: 44rpx;
  333. font-family: PingFangSC-Regular, sans-serif;
  334. font-size: 24rpx;
  335. color: #999 !important;
  336. background: #fff;
  337. border-radius: 100rpx;
  338. margin: 0;
  339. margin-left: 500rpx;
  340. border: 1rpx solid #E5E5E5;
  341. }
  342. }
  343. .divider-style {
  344. width: 690rpx;
  345. height: 10rpx;
  346. background: #f7f7f7;
  347. }
  348. }
  349. }
  350. }
  351. </style>