orderInformation.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. console.log('this.orderData', this.orderData)
  180. },
  181. clipboard(data) {
  182. thorui.getClipboardData(data, res => {
  183. if (res) {
  184. this.$util.msg('复制成功', 2000, true, 'success')
  185. } else {
  186. this.$util.msg('复制失败', 2000, true, 'none')
  187. }
  188. })
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss">
  194. .information-template {
  195. width: 100%;
  196. height: auto;
  197. background: #ffffff;
  198. float: left;
  199. margin-top: 24rpx;
  200. .information-content {
  201. width: 702rpx;
  202. padding: 15rpx 24rpx 20rpx 24rpx;
  203. .information-view {
  204. height: 50rpx;
  205. line-height: 50rpx;
  206. font-size: $font-size-24;
  207. margin: 4rpx 0;
  208. // display: flex;
  209. width: 55%;
  210. display: inline-block;
  211. &.same {
  212. width: 45%;
  213. text-align: right;
  214. }
  215. // &.title{
  216. // height: 68rpx;
  217. // line-height: 68rpx;
  218. // margin-bottom: 5rpx;
  219. // }
  220. view {
  221. // flex: 1;
  222. color: $text-color;
  223. color: #999999;
  224. .label {
  225. color: #666666;
  226. }
  227. }
  228. .view-num.title {
  229. height: 68rpx;
  230. line-height: 68rpx;
  231. position: relative;
  232. .bage-icon {
  233. width: 50rpx;
  234. height: 50rpx;
  235. display: block;
  236. position: absolute;
  237. right: 0;
  238. top: 9rpx;
  239. }
  240. .bage-buss {
  241. display: inline-block;
  242. width: 72rpx;
  243. height: 30rpx;
  244. background: radial-gradient(circle, rgba(255, 39, 180, 1) 0%, rgba(193, 77, 245, 1) 100%);
  245. border-radius: 4rpx;
  246. line-height: 30rpx;
  247. font-size: $font-size-24;
  248. text-align: center;
  249. color: #ffffff;
  250. margin-top: 10rpx;
  251. }
  252. .bage-auto {
  253. display: inline-block;
  254. width: 72rpx;
  255. height: 30rpx;
  256. background: radial-gradient(circle, rgba(255, 180, 39, 1) 0%, rgba(245, 142, 77, 1) 100%);
  257. border-radius: 4rpx;
  258. line-height: 30rpx;
  259. font-size: $font-size-24;
  260. text-align: center;
  261. color: #ffffff;
  262. margin-top: 10rpx;
  263. }
  264. .bage-text {
  265. display: inline-block;
  266. font-size: $font-size-28;
  267. line-height: 68rpx;
  268. text-align: left;
  269. color: $color-system;
  270. // margin-left: 10rpx;
  271. }
  272. }
  273. .view-num.ord {
  274. color: $color-system;
  275. text-align: left;
  276. flex: 3;
  277. font-weight: bold;
  278. }
  279. .view-num.time {
  280. color: #999999;
  281. flex: 6;
  282. }
  283. // .bold{
  284. // font-weight: bold;
  285. // }
  286. .red {
  287. color: #ff2a2a;
  288. }
  289. .view-type {
  290. float: right;
  291. text-align: right;
  292. color: #ff2a2a;
  293. flex: 4;
  294. }
  295. .clipboard {
  296. width: 84rpx;
  297. height: 36rpx;
  298. background: linear-gradient(34deg, rgba(255, 41, 41, 1) 0%, rgba(255, 109, 27, 1) 100%);
  299. text-align: center;
  300. font-size: $font-size-24;
  301. color: #ffffff;
  302. border-radius: 6rpx;
  303. line-height: 36rpx;
  304. display: inline-block;
  305. margin-left: 42rpx;
  306. }
  307. }
  308. }
  309. }
  310. .openinfo {
  311. width: 100%;
  312. height: 48rpx;
  313. margin-bottom: 30rpx;
  314. .btnInfo{
  315. width: 168rpx;
  316. height: 48rpx;
  317. line-height: 46rpx;
  318. box-sizing: border-box;
  319. border: 2rpx solid #e1e1e1;
  320. border-radius: 8rpx;
  321. text-align: center;
  322. color: #b2b2b2;
  323. margin: 0 auto;
  324. font-size: $font-size-24;
  325. }
  326. }
  327. </style>