index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <view>
  3. <view class="goods-section">
  4. <view class="g-item" style="padding-top: 10px;">
  5. <view class="right">
  6. <view class="price-box">
  7. <text class="font12">¥</text>
  8. <text class="price">{{ ((state.detail.amount+state.detail.grantsAmount)/100).toFixed(2) }}</text>
  9. </view>
  10. <block class="price-dsc" >洗车消费</block>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- 金额明细 -->
  15. <view class="yt-list" >
  16. <view class="yt-list-cell b-b">
  17. <text class="cell-tit clamp">订单编号</text>
  18. <text class="cell-tip copy" @click="handleCopy">{{ state.detail.orderNo }} <uv-icon name="info-circle"></uv-icon></text>
  19. </view>
  20. <view class="yt-list-cell b-b">
  21. <text class="cell-tit clamp">支付金额</text>
  22. <text class="cell-tip red">-¥{{ ((state.detail.amount)/100).toFixed(2) }}</text>
  23. </view>
  24. <view class="yt-list-cell b-b">
  25. <text class="cell-tit clamp">优惠金额</text>
  26. <text class="cell-tip red">-¥{{ ((state.detail.grantsAmount)/100).toFixed(2) }}</text>
  27. </view>
  28. <view class="yt-list-cell desc-cell">
  29. <text class="cell-tit clamp">备注</text>
  30. {{ state.detail.remark }}
  31. </view>
  32. <view class="yt-list-cell b-b">
  33. <text class="cell-tit clamp">交易状态</text>
  34. <text class="cell-tip" :class="state.detail.status==0?'primary':(state.detail.status==1?'success':'error')">
  35. {{fmtDictName('WalletDetail.status', state.detail.status)}}
  36. </text>
  37. </view>
  38. <view class="yt-list-cell b-b">
  39. <text class="cell-tit clamp">创建时间</text>
  40. <text class="cell-tip">{{ fmtDateTime(state.detail.createTime)}}</text>
  41. </view>
  42. <view class="yt-list-cell b-b">
  43. <text class="cell-tit clamp">交易时间</text>
  44. <text class="cell-tip">{{ fmtDateTime(state.detail.transactionTime)}}</text>
  45. </view>
  46. </view>
  47. <view class="btn">
  48. <!-- <view class="btn_2" @click="jump_torefund(my_order.order_id)">退款</view>-->
  49. </view>
  50. </view>
  51. </template>
  52. <script setup lang="ts">
  53. import {onHide, onShow,onLoad} from "@dcloudio/uni-app";
  54. import {reactive} from "vue";
  55. import {get} from "@/utils/https";
  56. import {fmtDictName,fmtDateTime} from "@/utils/common";
  57. const initState = () => ({
  58. detail: {} as any
  59. })
  60. const state = reactive(initState())
  61. onLoad((options:any) => {
  62. console.log("onshow",options)
  63. let {orderNo, id, type} = options;
  64. get(`/account/walletDetail?type=${type}&orderNo=${orderNo}`).then(res => {
  65. state.detail = res;
  66. })
  67. })
  68. onHide(() => {
  69. Object.assign(state, initState());
  70. })
  71. const handleCopy = ()=>{
  72. if (!state.detail.orderNo) return;
  73. uni.setClipboardData({
  74. data: state.detail.orderNo,
  75. success: function () {
  76. uni.showToast({
  77. title: '复制成功',
  78. icon: 'success',
  79. })
  80. }
  81. })
  82. }
  83. </script>
  84. <style lang="scss">
  85. page {
  86. background: #f8f8f8;
  87. padding-bottom: 100rpx;
  88. }
  89. .copy{
  90. color:$uni-color-primary !important;
  91. }
  92. .goods-section {
  93. margin-top: 16rpx;
  94. background: #fff;
  95. padding-bottom: 1px;
  96. .g-header {
  97. display: flex;
  98. align-items: center;
  99. height: 84rpx;
  100. padding: 0 30rpx;
  101. position: relative;
  102. }
  103. .logo {
  104. display: block;
  105. width: 50rpx;
  106. height: 50rpx;
  107. border-radius: 100px;
  108. }
  109. .name {
  110. font-size: 30rpx;
  111. color: #606266;
  112. margin-left: 24rpx;
  113. }
  114. .g-item {
  115. display: flex;
  116. margin: 20rpx 30rpx;
  117. image {
  118. flex-shrink: 0;
  119. display: block;
  120. width: 140rpx;
  121. height: 140rpx;
  122. border-radius: 4rpx;
  123. }
  124. .right {
  125. flex: 1;
  126. padding-left: 24rpx;
  127. overflow: hidden;
  128. text-align: center;
  129. }
  130. .title {
  131. font-size: 30rpx;
  132. color: #303133;
  133. }
  134. .spec {
  135. font-size: 26rpx;
  136. color: #909399;
  137. }
  138. .price-box {
  139. /* display: flex; */
  140. /* align-items: center; */
  141. color: #303133;
  142. padding-top: 10rpx;
  143. .price {
  144. margin-bottom: 4rpx;
  145. font-size: 48rpx;
  146. }
  147. .number {
  148. font-size: 26rpx;
  149. color: #606266;
  150. margin-left: 20rpx;
  151. }
  152. }
  153. .price-dsc{
  154. font-size:26rpx;
  155. color:$uni-text-color-grey;
  156. }
  157. .step-box {
  158. position: relative;
  159. }
  160. }
  161. }
  162. .yt-list {
  163. margin-top: 16rpx;
  164. background: #fff;
  165. }
  166. .yt-list-cell {
  167. display: flex;
  168. align-items: center;
  169. padding: 10rpx 30rpx 10rpx 40rpx;
  170. line-height: 70rpx;
  171. position: relative;
  172. &.cell-hover {
  173. background: #fafafa;
  174. }
  175. &.b-b:after {
  176. left: 30rpx;
  177. }
  178. .cell-icon {
  179. height: 32rpx;
  180. width: 32rpx;
  181. font-size: 22rpx;
  182. color: #fff;
  183. text-align: center;
  184. line-height: 32rpx;
  185. background: #f85e52;
  186. border-radius: 4rpx;
  187. margin-right: 12rpx;
  188. &.hb {
  189. background: #ffaa0e;
  190. }
  191. &.lpk {
  192. background: #3ab54a;
  193. }
  194. }
  195. .cell-more {
  196. align-self: center;
  197. font-size: 24rpx;
  198. color: #909399;
  199. margin-left: 8rpx;
  200. margin-right: -10upx;
  201. }
  202. .cell-tit {
  203. flex: 1;
  204. font-size: 26rpx;
  205. color: #909399;
  206. margin-right: 10rpx;
  207. }
  208. .cell-tip {
  209. font-size: 26rpx;
  210. color: #303133;
  211. &.disabled {
  212. color: #909399;
  213. }
  214. &.active {
  215. color: #fa436a;
  216. }
  217. &.red {
  218. color: #fa436a;
  219. }
  220. }
  221. &.desc-cell {
  222. .cell-tit {
  223. max-width: 90rpx;
  224. }
  225. }
  226. .desc {
  227. flex: 1;
  228. font-size: 28rpx;
  229. color: #303133;
  230. }
  231. }
  232. /* 支付列表 */
  233. .pay-list {
  234. padding-left: 40rpx;
  235. margin-top: 16rpx;
  236. background: #fff;
  237. .pay-item {
  238. display: flex;
  239. align-items: center;
  240. padding-right: 20rpx;
  241. line-height: 1;
  242. height: 110rpx;
  243. position: relative;
  244. }
  245. .icon-weixinzhifu {
  246. width: 80rpx;
  247. font-size: 40rpx;
  248. color: #6BCC03;
  249. }
  250. .icon-alipay {
  251. width: 80rpx;
  252. font-size: 40rpx;
  253. color: #06B4FD;
  254. }
  255. .icon-xuanzhong2 {
  256. display: flex;
  257. align-items: center;
  258. justify-content: center;
  259. width: 60rpx;
  260. height: 60rpx;
  261. font-size: 40rpx;
  262. color: #fa436a;
  263. }
  264. .tit {
  265. font-size: 32rpx;
  266. color: #303133;
  267. flex: 1;
  268. }
  269. }
  270. .footer {
  271. position: fixed;
  272. left: 0;
  273. bottom: 0;
  274. z-index: 995;
  275. display: flex;
  276. align-items: center;
  277. width: 100%;
  278. height: 90rpx;
  279. justify-content: space-between;
  280. font-size: 30rpx;
  281. background-color: #fff;
  282. z-index: 998;
  283. color: #606266;
  284. box-shadow: 0 -1px 5px rgba(0, 0, 0, .1);
  285. .price-content {
  286. padding-left: 30rpx;
  287. }
  288. .price-tip {
  289. color: #fa436a;
  290. margin-left: 8rpx;
  291. }
  292. .price {
  293. font-size: 36rpx;
  294. color: #fa436a;
  295. }
  296. .submit {
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. width: 280rpx;
  301. height: 100%;
  302. color: #fff;
  303. font-size: 32rpx;
  304. background-color: #fa436a;
  305. }
  306. }
  307. /* 优惠券面板 */
  308. .mask {
  309. display: flex;
  310. align-items: flex-end;
  311. position: fixed;
  312. left: 0;
  313. top: var(--window-top);
  314. bottom: 0;
  315. width: 100%;
  316. background: rgba(0, 0, 0, 0);
  317. z-index: 9995;
  318. transition: .3s;
  319. .mask-content {
  320. width: 100%;
  321. min-height: 30vh;
  322. max-height: 70vh;
  323. background: #f3f3f3;
  324. transform: translateY(100%);
  325. transition: .3s;
  326. overflow-y: scroll;
  327. }
  328. &.none {
  329. display: none;
  330. }
  331. &.show {
  332. background: rgba(0, 0, 0, .4);
  333. .mask-content {
  334. transform: translateY(0);
  335. }
  336. }
  337. }
  338. /* 优惠券列表 */
  339. .coupon-item {
  340. display: flex;
  341. flex-direction: column;
  342. margin: 20rpx 24rpx;
  343. background: #fff;
  344. .con {
  345. display: flex;
  346. align-items: center;
  347. position: relative;
  348. height: 120rpx;
  349. padding: 0 30rpx;
  350. &:after {
  351. position: absolute;
  352. left: 0;
  353. bottom: 0;
  354. content: '';
  355. width: 100%;
  356. height: 0;
  357. border-bottom: 1px dashed #f3f3f3;
  358. transform: scaleY(50%);
  359. }
  360. }
  361. .left {
  362. display: flex;
  363. flex-direction: column;
  364. justify-content: center;
  365. flex: 1;
  366. overflow: hidden;
  367. height: 100rpx;
  368. }
  369. .title {
  370. font-size: 32rpx;
  371. color: #303133;
  372. margin-bottom: 10rpx;
  373. }
  374. .time {
  375. font-size: 24rpx;
  376. color: #909399;
  377. }
  378. .right {
  379. display: flex;
  380. flex-direction: column;
  381. justify-content: center;
  382. align-items: center;
  383. font-size: 26rpx;
  384. color: #606266;
  385. height: 100rpx;
  386. }
  387. .price {
  388. font-size: 44rpx;
  389. color: #fa436a;
  390. &:before {
  391. content: '¥';
  392. font-size: 34rpx;
  393. }
  394. }
  395. .tips {
  396. font-size: 24rpx;
  397. color: #909399;
  398. line-height: 60rpx;
  399. padding-left: 30rpx;
  400. }
  401. .circle {
  402. position: absolute;
  403. left: -6upx;
  404. bottom: -10upx;
  405. z-index: 10;
  406. width: 20rpx;
  407. height: 20rpx;
  408. background: #f3f3f3;
  409. border-radius: 100px;
  410. &.r {
  411. left: auto;
  412. right: -6upx;
  413. }
  414. }
  415. }
  416. .primary{
  417. color: $uni-color-primary !important;
  418. }
  419. .success{
  420. color: $uni-color-success !important;
  421. }
  422. .error{
  423. color: $uni-color-error !important;
  424. }
  425. </style>