orderInformation.vue 8.2 KB

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