orderInformation.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template name="information">
  2. <view class="information-template">
  3. <!-- 订单信息 -->
  4. <view class="information-content">
  5. <view class="information-view title">
  6. <view class="view-num">
  7. <view class="bage-text">
  8. 订单编号:<label class="label">{{ orderData.orderNo ? orderData.orderNo : '' }}</label>
  9. <text class="clipboard" @click="clipboard(orderData.orderNo)">复制</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="information-view title">
  14. <view class="view-num">
  15. 订单总额:<label class="label"
  16. >¥{{ orderData.payTotalFee ? (orderData.payTotalFee | NumFormat) : '' }}</label
  17. >
  18. </view>
  19. </view>
  20. <view class="information-view">
  21. <view class="view-num time">
  22. 下单时间:<label class="label">{{ orderData.orderTime ? orderData.orderTime : '' }}</label>
  23. </view>
  24. </view>
  25. <view class="information-view bame">
  26. <view class="view-num"> 运费:<label class="label">包邮</label> </view>
  27. </view>
  28. <view class="information-view">
  29. <view class="view-num time" v-if="orderData.receiptAmount > 0">
  30. 支付时间:<label class="label">{{ orderData.receiptDate ? orderData.receiptDate : '' }}</label>
  31. </view>
  32. </view>
  33. <view class="information-view bame">
  34. <view class="view-man">
  35. 已退货/已取消:<label class="label"
  36. >{{ orderData.returnedNum }}/{{ orderData.actualCancelNum }}</label
  37. >
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import thorui from '@/components/clipboard/clipboard.thorui.js';
  45. export default {
  46. name: 'information',
  47. props: {
  48. information: {
  49. type: Object
  50. }
  51. },
  52. data() {
  53. return {
  54. orderData: '',
  55. freePostFlag: ''
  56. }
  57. },
  58. created() {
  59. this.initData(this.information)
  60. },
  61. filters: {
  62. NumFormat(value) {
  63. //处理金额
  64. return Number(value).toFixed(2)
  65. },
  66. TextFormat(status) {
  67. //处理金额
  68. let HtmlText,
  69. typeTextObject = {
  70. 0: '待确认',
  71. 4: '交易完成',
  72. 5: '订单完成',
  73. 6: '已关闭',
  74. 7: '交易全退',
  75. 77: '交易全退',
  76. 11: '待付款待发货',
  77. 12: '待付款部分发货',
  78. 13: '待付款已发货',
  79. 21: '部分付款待发货',
  80. 22: '部分付款部分发货',
  81. 23: '部分付款已发货',
  82. 31: '已付款待发货',
  83. 32: '已付款部分发货',
  84. 33: '已付款已发货',
  85. 111: '待付款待发货'
  86. }
  87. Object.keys(typeTextObject).forEach(key => {
  88. if (key == status) {
  89. HtmlText = typeTextObject[key]
  90. }
  91. })
  92. return HtmlText
  93. }
  94. },
  95. computed: {},
  96. watch: {
  97. information: {
  98. handler: function(val) {
  99. this.initData(val)
  100. },
  101. deep: true //对象内部的属性监听,也叫深度监听
  102. }
  103. },
  104. methods: {
  105. initData(res) {
  106. this.orderData = res
  107. },
  108. clipboard(data) {
  109. thorui.getClipboardData(data, res => {
  110. if (res) {
  111. this.$util.msg('复制成功', 2000, true, 'success')
  112. } else {
  113. this.$util.msg('复制失败', 2000, true, 'none')
  114. }
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .information-template {
  122. width: 100%;
  123. height: auto;
  124. background: #ffffff;
  125. float: left;
  126. margin-top: 24rpx;
  127. .information-content {
  128. width: 702rpx;
  129. padding: 15rpx 24rpx 20rpx 24rpx;
  130. .information-view {
  131. height: 50rpx;
  132. line-height: 50rpx;
  133. font-size: $font-size-24;
  134. margin: 4rpx 0;
  135. // display: flex;
  136. width: 58%;
  137. display: inline-block;
  138. &.same {
  139. width: 100%;
  140. text-align: right;
  141. }
  142. &.bame {
  143. width: 42%;
  144. text-align: right;
  145. }
  146. &.title {
  147. width: 100%;
  148. }
  149. view {
  150. // flex: 1;
  151. color: $text-color;
  152. color: #999999;
  153. .label {
  154. color: #666666;
  155. }
  156. }
  157. .view-num.title {
  158. height: 68rpx;
  159. line-height: 68rpx;
  160. position: relative;
  161. .bage-icon {
  162. width: 50rpx;
  163. height: 50rpx;
  164. display: block;
  165. position: absolute;
  166. right: 0;
  167. top: 9rpx;
  168. }
  169. .bage-text {
  170. display: inline-block;
  171. font-size: $font-size-28;
  172. line-height: 68rpx;
  173. text-align: left;
  174. color: $color-system;
  175. // margin-left: 10rpx;
  176. }
  177. }
  178. .view-num.ord {
  179. color: $color-system;
  180. text-align: left;
  181. flex: 3;
  182. font-weight: bold;
  183. }
  184. .view-num.time {
  185. color: #999999;
  186. flex: 6;
  187. }
  188. // .bold{
  189. // font-weight: bold;
  190. // }
  191. .red {
  192. color: #ff2a2a;
  193. }
  194. .view-type {
  195. float: right;
  196. text-align: right;
  197. color: #ff2a2a;
  198. flex: 4;
  199. }
  200. .clipboard {
  201. width: 64rpx;
  202. height: 32rpx;
  203. background: #fff8fd;
  204. text-align: center;
  205. font-size: $font-size-22;
  206. color: $color-system;
  207. border-radius: 8rpx;
  208. line-height: 32rpx;
  209. display: inline-block;
  210. margin-left: 15rpx;
  211. }
  212. }
  213. }
  214. }
  215. .openinfo {
  216. .btnInfo {
  217. width: 140rpx;
  218. height: 40rpx;
  219. border: 2rpx solid #e1e1e1;
  220. border-radius: 6rpx;
  221. padding: 5rpx;
  222. text-align: center;
  223. color: #b2b2b2;
  224. margin: 20rpx auto;
  225. font-size: $font-size-24;
  226. .iconfont {
  227. position: relative;
  228. top: 5rpx;
  229. right: -3rpx;
  230. }
  231. }
  232. }
  233. </style>