success.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="content">
  3. <view class="inner">
  4. <view class="top">
  5. <text class="title">支付成功</text>
  6. <image class="icon" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/success.png" ></image>
  7. <view class="btn-box">
  8. <view class="btn cancel" @click="goOrderDetails(order.id)"> 查看订单</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. <view v-if="order.orderCodes">
  18. <view class="text" v-for="item in order.orderCodes" :key="item">{{item}}</view>
  19. </view>
  20. <view v-else>
  21. <view class="text">{{orderCode}}</view>
  22. </view>
  23. <view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
  24. </view>
  25. </view>
  26. <view class="item">
  27. <text class="label">下单时间</text>
  28. <text class="text">{{order.createTime}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. order:null,
  39. orderCode: "",
  40. ids: []
  41. }
  42. },
  43. onLoad(option) {
  44. this.order=JSON.parse(decodeURIComponent(option.order))
  45. console.log(this.order)
  46. // orderCodes和ids字段表示店铺订单
  47. this.orderCode = this.order && this.order.orderCodes ? this.order.orderCodes.join(',') : this.order.orderCode || '';
  48. this.ids = this.order && this.order.ids ? this.order.ids : this.order.id ? [this.order.id] : [];
  49. uni.$emit('refreshOrder');
  50. },
  51. methods: {
  52. copyOrderSn(text) {
  53. // 复制方法
  54. uni.setClipboardData({
  55. data:text,
  56. success:()=>{
  57. uni.showToast({
  58. title:'内容已成功复制到剪切板',
  59. icon:'none'
  60. })
  61. }
  62. });
  63. },
  64. goOrderDetails(id){
  65. if(this.ids && this.ids.length > 1) {
  66. uni.navigateTo({
  67. url: '/pages_user/shopping/storeOrder?status='
  68. })
  69. } else {
  70. uni.redirectTo({
  71. url: "/pages_user/shopping/storeOrderDetail?id="+this.ids[0]
  72. })
  73. }
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. page{
  80. height: 100%;
  81. }
  82. .content{
  83. height: 100%;
  84. display: flex;
  85. flex-direction: column;
  86. justify-content: space-between;
  87. .inner{
  88. padding: 20upx;
  89. .top{
  90. box-sizing: border-box;
  91. background: #FFFFFF;
  92. border-radius: 16upx;
  93. display: flex;
  94. flex-direction: column;
  95. align-items: center;
  96. padding: 50upx 0upx;
  97. .title{
  98. font-size: 40upx;
  99. font-family: PingFang SC;
  100. font-weight: 500;
  101. color: #222222;
  102. line-height: 1;
  103. text-align: center;
  104. }
  105. .icon{
  106. margin: 60upx 0upx;
  107. width: 100upx;
  108. height: 100upx;
  109. }
  110. }
  111. .order-info{
  112. margin-top: 20upx;
  113. background: #FFFFFF;
  114. border-radius: 16upx;
  115. padding: 40upx 30upx;
  116. .title{
  117. font-size: 30upx;
  118. font-family: PingFang SC;
  119. font-weight: bold;
  120. color: #222222;
  121. line-height: 1;
  122. }
  123. .item{
  124. margin-top: 40upx;
  125. display: flex;
  126. align-items: center;
  127. justify-content: space-between;
  128. .label{
  129. font-size: 26upx;
  130. font-family: PingFang SC;
  131. font-weight: 500;
  132. color: #666666;
  133. line-height: 1;
  134. }
  135. .text{
  136. font-size: 26upx;
  137. font-family: PingFang SC;
  138. font-weight: 500;
  139. color: #222222;
  140. line-height: 32upx;
  141. }
  142. .cont-text{
  143. font-size: 26upx;
  144. font-family: PingFang SC;
  145. font-weight: 500;
  146. color: #666666;
  147. .bold{
  148. color: #111111;
  149. }
  150. }
  151. .sn-box{
  152. display: flex;
  153. align-items: center;
  154. .copy-btn{
  155. width: 58upx;
  156. height: 32upx;
  157. line-height: 32upx;
  158. text-align: center;
  159. font-size: 22upx;
  160. font-family: PingFang SC;
  161. font-weight: 500;
  162. color: #222222;
  163. background: #F5F5F5;
  164. border-radius: 4upx;
  165. margin-left: 24upx;
  166. }
  167. }
  168. }
  169. .line{
  170. width: 100%;
  171. height: 1px;
  172. background: #F0F0F0;
  173. margin-top: 30upx;
  174. }
  175. }
  176. }
  177. .btn-box{
  178. margin-top: 20upx;
  179. box-sizing: border-box;
  180. display: flex;
  181. align-items: center;
  182. .btn{
  183. width: 155upx;
  184. height: 64upx;
  185. line-height: 64upx;
  186. font-size: 26upx;
  187. font-family: PingFang SC;
  188. font-weight: 500;
  189. text-align: center;
  190. border-radius: 32upx;
  191. &.cancel{
  192. border: 1px solid #DDDDDD;
  193. color: #666666;
  194. }
  195. }
  196. }
  197. }
  198. </style>