orderInformation.vue 8.2 KB

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