orderInformation.vue 6.3 KB

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