packageOrderPaySuccess.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="top">
  5. <text class="title">{{order.isPay==0?"支付失败":"支付成功"}}</text>
  6. <image class="icon" :src="order.isPay==1?'/static/images/success.png':'/static/images/error.png'" ></image>
  7. <view class="btn-box">
  8. <view class="btn cancel" @click="showOrderDetails(order.orderId)"> 查看订单</view>
  9. </view>
  10. </view>
  11. <!-- 订单详情查看 -->
  12. <view class="order-info">
  13. <view class="title">订单信息</view>
  14. <view class="item">
  15. <text class="label">订单编号</text>
  16. <view class="sn-box">
  17. <text class="text">{{order.orderSn}}</text>
  18. <view class="copy-btn" @click="copyTest(order.orderSn)">复制</view>
  19. </view>
  20. </view>
  21. <view class="item">
  22. <text class="label">支付金额</text>
  23. <text class="text">{{order.payMoney.toFixed(2)}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">下单时间</text>
  27. <text class="text">{{order.createTime}}</text>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- <u-popup mode="center" bgColor="transparent" round="32rpx" :show="show" :closeOnClickOverlay="false" @close="close">
  32. <view class="popbox es-pb-48">
  33. <view class="popbox-head">
  34. <image src="/static/svg/gift_img.svg" mode="heightFix"></image>
  35. </view>
  36. <view class="popbox-con">
  37. <image class="topbg" src="/static/images/ad/Frame_9492.png" mode="widthFix"></image>
  38. <view class="popbox-con-body">
  39. <image class="es-h-73" style="margin: auto;display: block;" src="/static/svg/new_user_bg.svg" mode="heightFix"></image>
  40. <image class="es-h-59 es-ml-48 es-mt-38 es-mb-24" src="/static/svg/text.svg" mode="heightFix"></image>
  41. <image class="es-h-73 es-ml-48" src="/static/svg/daozhang_tip.svg" mode="heightFix"></image>
  42. </view>
  43. </view>
  44. <image class="es-h-118" style="margin: auto;display: block;" src="/static/svg/pop_button.svg" mode="heightFix" @click="navTo()"></image>
  45. </view>
  46. <view class="adbox-close">
  47. <image src="@/static/images/ad/close_icon.png" @click="close"></image>
  48. </view>
  49. </u-popup> -->
  50. </view>
  51. </template>
  52. <script>
  53. import {getPackageOrderById} from '@/api/packageOrder.js'
  54. export default {
  55. data() {
  56. return {
  57. order:{},
  58. show: false,
  59. }
  60. },
  61. onLoad(option) {
  62. uni.setNavigationBarTitle({
  63.   title:'支付结果'
  64. })
  65. uni.$emit('refreshPackageOrder');
  66. this.orderId=option.orderId;
  67. this.getPackageOrderById();
  68. },
  69. methods: {
  70. open() {
  71. this.show = true,
  72. setTimeout(()=>{
  73. this.show = false
  74. },3000)
  75. },
  76. close() {
  77. this.show = false
  78. },
  79. navTo() {
  80. uni.navigateTo({
  81. url: '/pages/user/integral/integralGoodsList'
  82. })
  83. },
  84. getPackageOrderById(){
  85. var data = {orderId:this.orderId};
  86. var that=this;
  87. uni.showLoading();
  88. getPackageOrderById(data).then(
  89. res => {
  90. uni.hideLoading();
  91. if(res.code==200){
  92. that.order=res.order;
  93. }else{
  94. uni.showToast({
  95. icon:'none',
  96. title: res.msg,
  97. });
  98. }
  99. },
  100. rej => {}
  101. );
  102. },
  103. copyTest(text) {
  104. // 复制方法
  105. uni.setClipboardData({
  106. data:text,
  107. success:()=>{
  108. uni.showToast({
  109. title:'内容已成功复制到剪切板',
  110. icon:'none'
  111. })
  112. }
  113. });
  114. },
  115. showOrderDetails(orderId){
  116. uni.redirectTo({
  117. url: "/pages/store/packageOrderDetails?orderId="+orderId
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .adbox-close {
  125. display: inline-block;
  126. margin: 48rpx auto;
  127. image {
  128. width: 64rpx;
  129. height: 64rpx;
  130. }
  131. }
  132. .popbox {
  133. position: relative;
  134. width: 590rpx;
  135. // height: 590rpx;
  136. background: linear-gradient( 180deg, #F7E4DE 0%, #FFFFFF 35%, #FFFFFF 100%);
  137. box-sizing: border-box;
  138. border-radius: 32rpx 32rpx 32rpx 32rpx;
  139. .topbg{
  140. width: 100%;
  141. height: auto;
  142. }
  143. &-head {
  144. position: absolute;
  145. top: -119rpx;
  146. left: 50%;
  147. transform: translateX(-50%);
  148. z-index: 99;
  149. image {
  150. height: 120rpx;
  151. }
  152. }
  153. &-con {
  154. border-radius: 32rpx 32rpx 0 0;
  155. overflow: hidden;
  156. position: relative;
  157. }
  158. &-con-body {
  159. width: 100%;
  160. position: absolute;
  161. z-index: 100;
  162. top: 0;
  163. left: 0;
  164. }
  165. }
  166. .content{
  167. height: 100%;
  168. display: flex;
  169. flex-direction: column;
  170. justify-content: space-between;
  171. .inner{
  172. padding: 20upx;
  173. .top{
  174. box-sizing: border-box;
  175. background: #FFFFFF;
  176. border-radius: 16upx;
  177. display: flex;
  178. flex-direction: column;
  179. align-items: center;
  180. padding: 50upx 0upx;
  181. .title{
  182. font-size: 40upx;
  183. font-family: PingFang SC;
  184. font-weight: 500;
  185. color: #222222;
  186. line-height: 1;
  187. text-align: center;
  188. }
  189. .icon{
  190. margin: 60upx 0upx;
  191. width: 100upx;
  192. height: 100upx;
  193. }
  194. }
  195. .order-info{
  196. margin-top: 20upx;
  197. background: #FFFFFF;
  198. border-radius: 16upx;
  199. padding: 40upx 30upx;
  200. .title{
  201. font-size: 30upx;
  202. font-family: PingFang SC;
  203. font-weight: bold;
  204. color: #222222;
  205. line-height: 1;
  206. }
  207. .item{
  208. margin-top: 40upx;
  209. display: flex;
  210. align-items: center;
  211. justify-content: space-between;
  212. .label{
  213. font-size: 26upx;
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. color: #666666;
  217. line-height: 1;
  218. }
  219. .text{
  220. font-size: 26upx;
  221. font-family: PingFang SC;
  222. font-weight: 500;
  223. color: #222222;
  224. line-height: 32upx;
  225. }
  226. .cont-text{
  227. font-size: 26upx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #666666;
  231. .bold{
  232. color: #111111;
  233. }
  234. }
  235. .sn-box{
  236. display: flex;
  237. align-items: center;
  238. .copy-btn{
  239. width: 58upx;
  240. height: 32upx;
  241. line-height: 32upx;
  242. text-align: center;
  243. font-size: 22upx;
  244. font-family: PingFang SC;
  245. font-weight: 500;
  246. color: #222222;
  247. background: #F5F5F5;
  248. border-radius: 4upx;
  249. margin-left: 24upx;
  250. }
  251. }
  252. }
  253. .line{
  254. width: 100%;
  255. height: 1px;
  256. background: #F0F0F0;
  257. margin-top: 30upx;
  258. }
  259. }
  260. }
  261. .btn-box{
  262. margin-top: 20upx;
  263. box-sizing: border-box;
  264. display: flex;
  265. align-items: center;
  266. .btn{
  267. width: 155upx;
  268. height: 64upx;
  269. line-height: 64upx;
  270. font-size: 26upx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. text-align: center;
  274. border-radius: 32upx;
  275. &.cancel{
  276. border: 1px solid #DDDDDD;
  277. color: #666666;
  278. }
  279. }
  280. }
  281. }
  282. </style>