orderInformation.vue 8.2 KB

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